gl-draw 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var Te={187:function(x){"use strict";var _=typeof Reflect=="object"?Reflect:null,c=_&&typeof _.apply=="function"?_.apply:function(o,p,m){return Function.prototype.apply.call(o,p,m)},y;_&&typeof _.ownKeys=="function"?y=_.ownKeys:Object.getOwnPropertySymbols?y=function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:y=function(o){return Object.getOwnPropertyNames(o)};function P(u){console&&console.warn&&console.warn(u)}var f=Number.isNaN||function(o){return o!==o};function s(){s.init.call(this)}x.exports=s,x.exports.once=D,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var n=10;function O(u){if(typeof u!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof u)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(u){if(typeof u!="number"||u<0||f(u))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+u+".");n=u}}),s.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},s.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||f(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this};function S(u){return u._maxListeners===void 0?s.defaultMaxListeners:u._maxListeners}s.prototype.getMaxListeners=function(){return S(this)},s.prototype.emit=function(o){for(var p=[],m=1;m<arguments.length;m++)p.push(arguments[m]);var T=o==="error",U=this._events;if(U!==void 0)T=T&&U.error===void 0;else if(!T)return!1;if(T){var G;if(p.length>0&&(G=p[0]),G instanceof Error)throw G;var X=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw X.context=G,X}var ie=U[o];if(ie===void 0)return!1;if(typeof ie=="function")c(ie,this,p);else for(var ue=ie.length,ce=Q(ie,ue),m=0;m<ue;++m)c(ce[m],this,p);return!0};function M(u,o,p,m){var T,U,G;if(O(p),U=u._events,U===void 0?(U=u._events=Object.create(null),u._eventsCount=0):(U.newListener!==void 0&&(u.emit("newListener",o,p.listener?p.listener:p),U=u._events),G=U[o]),G===void 0)G=U[o]=p,++u._eventsCount;else if(typeof G=="function"?G=U[o]=m?[p,G]:[G,p]:m?G.unshift(p):G.push(p),T=S(u),T>0&&G.length>T&&!G.warned){G.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(o)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=u,X.type=o,X.count=G.length,P(X)}return u}s.prototype.addListener=function(o,p){return M(this,o,p,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(o,p){return M(this,o,p,!0)};function N(){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 V(u,o,p){var m={fired:!1,wrapFn:void 0,target:u,type:o,listener:p},T=N.bind(m);return T.listener=p,m.wrapFn=T,T}s.prototype.once=function(o,p){return O(p),this.on(o,V(this,o,p)),this},s.prototype.prependOnceListener=function(o,p){return O(p),this.prependListener(o,V(this,o,p)),this},s.prototype.removeListener=function(o,p){var m,T,U,G,X;if(O(p),T=this._events,T===void 0)return this;if(m=T[o],m===void 0)return this;if(m===p||m.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete T[o],T.removeListener&&this.emit("removeListener",o,m.listener||p));else if(typeof m!="function"){for(U=-1,G=m.length-1;G>=0;G--)if(m[G]===p||m[G].listener===p){X=m[G].listener,U=G;break}if(U<0)return this;U===0?m.shift():q(m,U),m.length===1&&(T[o]=m[0]),T.removeListener!==void 0&&this.emit("removeListener",o,X||p)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(o){var p,m,T;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[o]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete m[o]),this;if(arguments.length===0){var U=Object.keys(m),G;for(T=0;T<U.length;++T)G=U[T],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=m[o],typeof p=="function")this.removeListener(o,p);else if(p!==void 0)for(T=p.length-1;T>=0;T--)this.removeListener(o,p[T]);return this};function F(u,o,p){var m=u._events;if(m===void 0)return[];var T=m[o];return T===void 0?[]:typeof T=="function"?p?[T.listener||T]:[T]:p?k(T):Q(T,T.length)}s.prototype.listeners=function(o){return F(this,o,!0)},s.prototype.rawListeners=function(o){return F(this,o,!1)},s.listenerCount=function(u,o){return typeof u.listenerCount=="function"?u.listenerCount(o):K.call(u,o)},s.prototype.listenerCount=K;function K(u){var o=this._events;if(o!==void 0){var p=o[u];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?y(this._events):[]};function Q(u,o){for(var p=new Array(o),m=0;m<o;++m)p[m]=u[m];return p}function q(u,o){for(;o+1<u.length;o++)u[o]=u[o+1];u.pop()}function k(u){for(var o=new Array(u.length),p=0;p<o.length;++p)o[p]=u[p].listener||u[p];return o}function D(u,o){return new Promise(function(p,m){function T(G){u.removeListener(o,U),m(G)}function U(){typeof u.removeListener=="function"&&u.removeListener("error",T),p([].slice.call(arguments))}C(u,o,U,{once:!0}),o!=="error"&&R(u,T,{once:!0})})}function R(u,o,p){typeof u.on=="function"&&C(u,"error",o,p)}function C(u,o,p,m){if(typeof u.on=="function")m.once?u.once(o,p):u.on(o,p);else if(typeof u.addEventListener=="function")u.addEventListener(o,function T(U){m.once&&u.removeEventListener(o,T),p(U)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof u)}},666:function(x){var _=function(c){"use strict";var y=Object.prototype,P=y.hasOwnProperty,f,s=typeof Symbol=="function"?Symbol:{},n=s.iterator||"@@iterator",O=s.asyncIterator||"@@asyncIterator",S=s.toStringTag||"@@toStringTag";function M(v,h,w){return Object.defineProperty(v,h,{value:w,enumerable:!0,configurable:!0,writable:!0}),v[h]}try{M({},"")}catch(v){M=function(h,w,B){return h[w]=B}}function N(v,h,w,B){var L=h&&h.prototype instanceof D?h:D,Y=Object.create(L.prototype),ee=new ce(B||[]);return Y._invoke=G(v,w,ee),Y}c.wrap=N;function V(v,h,w){try{return{type:"normal",arg:v.call(h,w)}}catch(B){return{type:"throw",arg:B}}}var F="suspendedStart",K="suspendedYield",Q="executing",q="completed",k={};function D(){}function R(){}function C(){}var u={};M(u,n,function(){return this});var o=Object.getPrototypeOf,p=o&&o(o(fe([])));p&&p!==y&&P.call(p,n)&&(u=p);var m=C.prototype=D.prototype=Object.create(u);R.prototype=C,M(m,"constructor",C),M(C,"constructor",R),R.displayName=M(C,S,"GeneratorFunction");function T(v){["next","throw","return"].forEach(function(h){M(v,h,function(w){return this._invoke(h,w)})})}c.isGeneratorFunction=function(v){var h=typeof v=="function"&&v.constructor;return h?h===R||(h.displayName||h.name)==="GeneratorFunction":!1},c.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,C):(v.__proto__=C,M(v,S,"GeneratorFunction")),v.prototype=Object.create(m),v},c.awrap=function(v){return{__await:v}};function U(v,h){function w(Y,ee,te,ne){var re=V(v[Y],v,ee);if(re.type==="throw")ne(re.arg);else{var he=re.arg,de=he.value;return de&&typeof de=="object"&&P.call(de,"__await")?h.resolve(de.__await).then(function(le){w("next",le,te,ne)},function(le){w("throw",le,te,ne)}):h.resolve(de).then(function(le){he.value=le,te(he)},function(le){return w("throw",le,te,ne)})}}var B;function L(Y,ee){function te(){return new h(function(ne,re){w(Y,ee,ne,re)})}return B=B?B.then(te,te):te()}this._invoke=L}T(U.prototype),M(U.prototype,O,function(){return this}),c.AsyncIterator=U,c.async=function(v,h,w,B,L){L===void 0&&(L=Promise);var Y=new U(N(v,h,w,B),L);return c.isGeneratorFunction(h)?Y:Y.next().then(function(ee){return ee.done?ee.value:Y.next()})};function G(v,h,w){var B=F;return function(Y,ee){if(B===Q)throw new Error("Generator is already running");if(B===q){if(Y==="throw")throw ee;return ge()}for(w.method=Y,w.arg=ee;;){var te=w.delegate;if(te){var ne=X(te,w);if(ne){if(ne===k)continue;return ne}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(B===F)throw B=q,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);B=Q;var re=V(v,h,w);if(re.type==="normal"){if(B=w.done?q:K,re.arg===k)continue;return{value:re.arg,done:w.done}}else re.type==="throw"&&(B=q,w.method="throw",w.arg=re.arg)}}}function X(v,h){var w=v.iterator[h.method];if(w===f){if(h.delegate=null,h.method==="throw"){if(v.iterator.return&&(h.method="return",h.arg=f,X(v,h),h.method==="throw"))return k;h.method="throw",h.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var B=V(w,v.iterator,h.arg);if(B.type==="throw")return h.method="throw",h.arg=B.arg,h.delegate=null,k;var L=B.arg;if(!L)return h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,k;if(L.done)h[v.resultName]=L.value,h.next=v.nextLoc,h.method!=="return"&&(h.method="next",h.arg=f);else return L;return h.delegate=null,k}T(m),M(m,S,"Generator"),M(m,n,function(){return this}),M(m,"toString",function(){return"[object Generator]"});function ie(v){var h={tryLoc:v[0]};1 in v&&(h.catchLoc=v[1]),2 in v&&(h.finallyLoc=v[2],h.afterLoc=v[3]),this.tryEntries.push(h)}function ue(v){var h=v.completion||{};h.type="normal",delete h.arg,v.completion=h}function ce(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(ie,this),this.reset(!0)}c.keys=function(v){var h=[];for(var w in v)h.push(w);return h.reverse(),function B(){for(;h.length;){var L=h.pop();if(L in v)return B.value=L,B.done=!1,B}return B.done=!0,B}};function fe(v){if(v){var h=v[n];if(h)return h.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var w=-1,B=function L(){for(;++w<v.length;)if(P.call(v,w))return L.value=v[w],L.done=!1,L;return L.value=f,L.done=!0,L};return B.next=B}}return{next:ge}}c.values=fe;function ge(){return{value:f,done:!0}}return ce.prototype={constructor:ce,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(ue),!v)for(var h in this)h.charAt(0)==="t"&&P.call(this,h)&&!isNaN(+h.slice(1))&&(this[h]=f)},stop:function(){this.done=!0;var v=this.tryEntries[0],h=v.completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var h=this;function w(ne,re){return Y.type="throw",Y.arg=v,h.next=ne,re&&(h.method="next",h.arg=f),!!re}for(var B=this.tryEntries.length-1;B>=0;--B){var L=this.tryEntries[B],Y=L.completion;if(L.tryLoc==="root")return w("end");if(L.tryLoc<=this.prev){var ee=P.call(L,"catchLoc"),te=P.call(L,"finallyLoc");if(ee&&te){if(this.prev<L.catchLoc)return w(L.catchLoc,!0);if(this.prev<L.finallyLoc)return w(L.finallyLoc)}else if(ee){if(this.prev<L.catchLoc)return w(L.catchLoc,!0)}else if(te){if(this.prev<L.finallyLoc)return w(L.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,h){for(var w=this.tryEntries.length-1;w>=0;--w){var B=this.tryEntries[w];if(B.tryLoc<=this.prev&&P.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var L=B;break}}L&&(v==="break"||v==="continue")&&L.tryLoc<=h&&h<=L.finallyLoc&&(L=null);var Y=L?L.completion:{};return Y.type=v,Y.arg=h,L?(this.method="next",this.next=L.finallyLoc,k):this.complete(Y)},complete:function(v,h){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&h&&(this.next=h),k},finish:function(v){for(var h=this.tryEntries.length-1;h>=0;--h){var w=this.tryEntries[h];if(w.finallyLoc===v)return this.complete(w.completion,w.afterLoc),ue(w),k}},catch:function(v){for(var h=this.tryEntries.length-1;h>=0;--h){var w=this.tryEntries[h];if(w.tryLoc===v){var B=w.completion;if(B.type==="throw"){var L=B.arg;ue(w)}return L}}throw new Error("illegal catch attempt")},delegateYield:function(v,h,w){return this.delegate={iterator:fe(v),resultName:h,nextLoc:w},this.method==="next"&&(this.arg=f),k}},c}(x.exports);try{regeneratorRuntime=_}catch(c){typeof globalThis=="object"?globalThis.regeneratorRuntime=_:Function("r","regeneratorRuntime = r")(_)}},701:function(x,_,c){"use strict";c.d(_,{ZP:function(){return q}});var y=c(438),P=c(998);function f(){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(k){return!1}}function s(k,D,R){return f()?s=Reflect.construct:s=function(u,o,p){var m=[null];m.push.apply(m,o);var T=Function.bind.apply(u,m),U=new T;return p&&(0,P.Z)(U,p.prototype),U},s.apply(null,arguments)}function n(k,D,R){return s.apply(null,arguments)}var O=c(951),S=c(342),M=c(644),N=c(282),V=require("three/examples/jsm/renderers/CSS2DRenderer"),F=c(530),K=c(519),Q=function(k){k&&((0,K.disposeMesh)(k),k.children.forEach(function(D){D.userData.BaseObject_||Q(D)}))},q=function(){"use strict";function k(){(0,y.Z)(this,k),this.objecttype__="BaseObject",this.userData={},this.pm=(0,N.Z)(),this.visible=!1}var D=k.prototype;return D.init=function(){},D.create=function(){},D.render=function(){},D.update=function(C,u){},D.resize=function(C,u){},D.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},D.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},D.isVisible=function(){return this.visible},D.createMesh=function(){for(var C=arguments.length,u=new Array(C),o=0;o<C;o++)u[o]=arguments[o];return this.object3d=n(M.Mesh,(0,S.Z)(u)),this},D.createGroup=function(){return this.object3d=new M.Group,this},D.createPoints=function(){for(var C=arguments.length,u=new Array(C),o=0;o<C;o++)u[o]=arguments[o];return this.object3d=n(M.Points,(0,S.Z)(u)),this},D.createCSS2DObject=function(C){return this.object3d=new V.CSS2DObject(C),this},D.createCSS3DObject=function(C){return this.object3d=new F.CSS3DObject(C),this},D.createCSS3DSprite=function(C){return this.object3d=new F.CSS3DSprite(C),this},D.createSprite=function(C){return this.object3d=new M.Sprite(C),this},D.add=function(){for(var C=arguments.length,u=new Array(C),o=0;o<C;o++)u[o]=arguments[o];var p;return(p=this.object3d).add.apply(p,(0,S.Z)(u)),this},D.remove=function(){for(var C=arguments.length,u=new Array(C),o=0;o<C;o++)u[o]=arguments[o];var p;return(p=this.object3d).remove.apply(p,(0,S.Z)(u)),this},D.getSize=function(){var C=new M.Box3().setFromObject(this.object3d);return{min:C.min,max:C.max,size:C.getSize(new M.Vector3)}},D.traverse=function(C){C(this),this.children.forEach(function(u){u.traverse(C)})},D.dispose=function(){Q(this.object3d)},(0,O.Z)(k,[{key:"parent",get:function(){var C=this.object3d.parent;return(C==null?void 0:C.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(C){return C.userData.BaseObject_}).filter(function(C){return!!C})}}]),k}()},896:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});var y=c(438),P=function(){"use strict";function f(n){(0,y.Z)(this,f),this.guiParams={},n&&(this.guiParams=n)}var s=f.prototype;return s.showGui=function(O){var S=this;!O||Object.keys(this.guiParams).forEach(function(M){var N=O.addFolder(M),V=S.guiParams[M];Object.keys(V).forEach(function(F){var K=V[F],Q=K.min,q=K.max,k=K.step,D=K.name,R=K.paramMap,C=K.items,u=K.value,o=K.target,p=F.toLowerCase().indexOf("color")>-1,m,T=typeof u=="undefined"&&o,U=T?o():V[F],G=T?F:"value";C?m=N.add(U,G,C):p?m=N.addColor(U,G):m=N.add(U,G),m=m.name(D||F),typeof Q!="undefined"&&(m=m.min(Q)),typeof q!="undefined"&&(m=m.max(q)),typeof k!="undefined"&&(m=m.step(k)),m=m.onChange(function(){S.setTargetValue(M,F,U[G],R)}),T&&m.listen()})})},s.setTargetValue=function(O,S,M,N){var V=this.guiParams[O][S],F=V.onChange,K=V.target,Q=V.value,q=S.toLowerCase().indexOf("color")>-1,k=typeof Q=="undefined"&&K;if(K&&!k){var D=K();Array.isArray(D)||(D=[D]),D.forEach(function(R){if(!!R)if(q)try{R[N||S].set(M)}catch(C){S!=="color"&&!N&&console.warn("".concat(S," is not a color,set paramMap"))}else R[N||S]=M})}F&&F(M)},s.setTargetValueByParams=function(){var O=this;Object.keys(this.guiParams).forEach(function(S){Object.keys(O.guiParams[S]).forEach(function(M){var N=O.guiParams[S][M];typeof N.value!="undefined"&&O.setTargetValue(S,M,N.value,N.paramMap)})})},f}()},695:function(x,_,c){"use strict";c.d(_,{Z:function(){return y}});function y(P){if(P.geometry&&P.geometry.dispose(),P.material){var f=Array.isArray(P.material)?P.material:[P.material];f.forEach(function(s){var n,O,S,M,N,V,F,K,Q,q,k,D,R;(n=s.map)===null||n===void 0||n.dispose(),(O=s.lightMap)===null||O===void 0||O.dispose(),(S=s.bumpMap)===null||S===void 0||S.dispose(),(M=s.normalMap)===null||M===void 0||M.dispose(),(N=s.specularMap)===null||N===void 0||N.dispose(),(V=s.envMap)===null||V===void 0||V.dispose(),(F=s.alphaMap)===null||F===void 0||F.dispose(),(K=s.aoMap)===null||K===void 0||K.dispose(),(Q=s.displacementMap)===null||Q===void 0||Q.dispose(),(q=s.emissiveMap)===null||q===void 0||q.dispose(),(k=s.gradientMap)===null||k===void 0||k.dispose(),(D=s.metalnessMap)===null||D===void 0||D.dispose(),(R=s.roughnessMap)===null||R===void 0||R.dispose(),s.dispose()})}}},519:function(x,_,c){"use strict";c.d(_,{disposeMesh:function(){return s.Z},isPlainObject:function(){return S.Z}});var y=c(666),P=c.n(y),f=null,s=c(695),n=c(644);function O(k){if(k.material){var D=Array.isArray(k.material)?k.material:[k.material];D.forEach(function(R){var C,u;(C=R.color)===null||C===void 0||C.convertSRGBToLinear(),(u=R.emissive)===null||u===void 0||u.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var S=c(738),M=c(568),N=c(924),V=require("idb-keyval"),F=c(484),K=null,Q=null,q=function(){var k=(0,M.Z)(P().mark(function D(R,C){var u,o,p,m,T,U;return P().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return u=C.version,X.next=4,(0,V.get)(R);case 4:if(p=X.sent,!(p&&p[u])){X.next=9;break}o=p[u],X.next=15;break;case 9:return X.next=11,(0,F.Z)(fetch(R).then(function(ie){if(ie.ok)return ie.blob();throw new Error}));case 11:m=X.sent,T=m.res,U=m.err,U||(o=T,(0,V.set)(R,(0,N.Z)({},u,T)));case 15:return X.abrupt("return",o?{url:URL.createObjectURL(o)}:{url:R});case 16:case"end":return X.stop()}},D)}));return function(R,C){return k.apply(this,arguments)}}()},738:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});function y(f){return Object.prototype.toString.call(f)==="[object Object]"}function P(f){if(y(f)===!1)return!1;var s=f.constructor;if(s===void 0)return!0;var n=s.prototype;return!(y(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}},282:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});var y=c(484);function P(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(O,S){n.resolve=O,n.reject=S}),f&&(n.promise=(0,y.Z)(n.promise,s)),n}},484:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});var y=c(42);function P(f){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return f.then(function(n){return(0,y.Z)({err:null,res:n},s)}).catch(function(n){return(0,y.Z)({err:n,res:void 0},s)})}},494:function(x){"use strict";x.exports=require("@tweenjs/tween.js")},644:function(x){"use strict";x.exports=require("three")},530:function(x){"use strict";x.exports=require("three/examples/jsm/renderers/CSS3DRenderer")},943:function(x,_,c){"use strict";c.d(_,{Z:function(){return y}});function y(P,f){(f==null||f>P.length)&&(f=P.length);for(var s=0,n=new Array(f);s<f;s++)n[s]=P[s];return n}},982:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});var y=c(943);function P(f){if(Array.isArray(f))return(0,y.Z)(f)}},111:function(x,_,c){"use strict";c.d(_,{Z:function(){return y}});function y(P){if(P===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P}},568:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});function y(f,s,n,O,S,M,N){try{var V=f[M](N),F=V.value}catch(K){n(K);return}V.done?s(F):Promise.resolve(F).then(O,S)}function P(f){return function(){var s=this,n=arguments;return new Promise(function(O,S){var M=f.apply(s,n);function N(F){y(M,O,S,N,V,"next",F)}function V(F){y(M,O,S,N,V,"throw",F)}N(void 0)})}}},438:function(x,_,c){"use strict";c.d(_,{Z:function(){return y}});function y(P,f){if(!(P instanceof f))throw new TypeError("Cannot call a class as a function")}},951:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});function y(f,s){for(var n=0;n<s.length;n++){var O=s[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(f,O.key,O)}}function P(f,s,n){return s&&y(f.prototype,s),n&&y(f,n),f}},485:function(x,_,c){"use strict";c.d(_,{Z:function(){return O}});function y(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(S){return!1}}var P=c(662),f=c(111);function s(S){return S&&S.constructor===Symbol?"symbol":typeof S}function n(S,M){return M&&(s(M)==="object"||typeof M=="function")?M:(0,f.Z)(S)}function O(S){var M=y();return function(){var V=(0,P.Z)(S),F;if(M){var K=(0,P.Z)(this).constructor;F=Reflect.construct(V,arguments,K)}else F=V.apply(this,arguments);return n(this,F)}}},924:function(x,_,c){"use strict";c.d(_,{Z:function(){return y}});function y(P,f,s){return f in P?Object.defineProperty(P,f,{value:s,enumerable:!0,configurable:!0,writable:!0}):P[f]=s,P}},662:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});function y(f){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},y(f)}function P(f){return y(f)}},668:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});var y=c(998);function P(f,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(s&&s.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),s&&(0,y.Z)(f,s)}},375:function(x,_,c){"use strict";c.d(_,{Z:function(){return y}});function y(P){if(typeof Symbol!="undefined"&&P[Symbol.iterator]!=null||P["@@iterator"]!=null)return Array.from(P)}},270:function(x,_,c){"use strict";c.d(_,{Z:function(){return y}});function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});var y=c(924);function P(f){for(var s=1;s<arguments.length;s++){var n=arguments[s]!=null?arguments[s]:{},O=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(O=O.concat(Object.getOwnPropertySymbols(n).filter(function(S){return Object.getOwnPropertyDescriptor(n,S).enumerable}))),O.forEach(function(S){(0,y.Z)(f,S,n[S])})}return f}},396:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});function y(f,s){var n=Object.keys(f);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(f);s&&(O=O.filter(function(S){return Object.getOwnPropertyDescriptor(f,S).enumerable})),n.push.apply(n,O)}return n}function P(f,s){return s=s!=null?s:{},Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(s)):y(Object(s)).forEach(function(n){Object.defineProperty(f,n,Object.getOwnPropertyDescriptor(s,n))}),f}},607:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});function y(f,s){if(f==null)return{};var n={},O=Object.keys(f),S,M;for(M=0;M<O.length;M++)S=O[M],!(s.indexOf(S)>=0)&&(n[S]=f[S]);return n}function P(f,s){if(f==null)return{};var n=y(f,s),O,S;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(f);for(S=0;S<M.length;S++)O=M[S],!(s.indexOf(O)>=0)&&(!Object.prototype.propertyIsEnumerable.call(f,O)||(n[O]=f[O]))}return n}},998:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});function y(f,s){return y=Object.setPrototypeOf||function(O,S){return O.__proto__=S,O},y(f,s)}function P(f,s){return y(f,s)}},342:function(x,_,c){"use strict";c.d(_,{Z:function(){return n}});var y=c(982),P=c(375),f=c(270),s=c(566);function n(O){return(0,y.Z)(O)||(0,P.Z)(O)||(0,s.Z)(O)||(0,f.Z)()}},566:function(x,_,c){"use strict";c.d(_,{Z:function(){return P}});var y=c(943);function P(f,s){if(!!f){if(typeof f=="string")return(0,y.Z)(f,s);var n=Object.prototype.toString.call(f).slice(8,-1);if(n==="Object"&&f.constructor&&(n=f.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,y.Z)(f,s)}}}},Se={};function H(x){var _=Se[x];if(_!==void 0)return _.exports;var c=Se[x]={exports:{}};return Te[x](c,c.exports,H),c.exports}(function(){H.n=function(x){var _=x&&x.__esModule?function(){return x.default}:function(){return x};return H.d(_,{a:_}),_}})(),function(){H.d=function(x,_){for(var c in _)H.o(_,c)&&!H.o(x,c)&&Object.defineProperty(x,c,{enumerable:!0,get:_[c]})}}(),function(){H.o=function(x,_){return Object.prototype.hasOwnProperty.call(x,_)}}(),function(){H.r=function(x){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})}}(),function(){H.p="/"}();var be={};(function(){"use strict";H.r(be),H.d(be,{BaseObject:function(){return Qe.ZP},GUIObject:function(){return Q.Z},Pencil:function(){return ye},default:function(){return ye}});var x=H(438),_=H(951),c=H(42),y=H(396),P=H(342),f=H(494),s=H.n(f),n=H(644),O=H(187),S=require("deepmerge"),M=H.n(S),N=require("three/examples/jsm/libs/stats.module"),V=H.n(N),F=require("lil-gui"),K=H.n(F),Q=H(896),q={None:n.NoToneMapping,Linear:n.LinearToneMapping,Reinhard:n.ReinhardToneMapping,Cineon:n.CineonToneMapping,ACESFilmic:n.ACESFilmicToneMapping},k={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:n.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},D=function(){"use strict";function z(a){(0,x.Z)(this,z),this.options=a;var e=a.width,t=a.height,r=a.rendererParams,l=r.alpha,d=r.devicePixelRatio,i=r.antialias,b=r.powerPreference,Z=r.toneMapping,j=r.toneMappingExposure,E=r.outputEncoding,A=r.logarithmicDepthBuffer,I=r.preserveDrawingBuffer,W=new n.WebGLRenderer({alpha:l,antialias:i,powerPreference:b,logarithmicDepthBuffer:A,preserveDrawingBuffer:I});W.setSize(e,t),W.setPixelRatio(d),W.autoClear=!1,W.toneMapping=q[Z],W.toneMappingExposure=j,W.outputEncoding=E,this.renderer=W}var g=z.prototype;return g.setSize=function(e,t){this.renderer.setSize(e,t)},g.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},g.setGui=function(e){var t=this,r=new Q.Z({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:q,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},g.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},z}(),R={fov:45,near:1,far:1e3},C=function(){"use strict";function z(a){(0,x.Z)(this,z),this.oldCameraPosition=new n.Vector3,this.oldCameraRotation=new n.Euler,this.customCamera=!1,this.options=a;var e=a.width,t=a.height,r=a.cameraParams;if(r instanceof n.Camera)this.camera=r,this.customCamera=!0;else{var l=r.fov,d=r.far,i=r.near,b=new n.PerspectiveCamera(l,e/t,i,d);b.position.set(0,0,400),b.lookAt(0,0,0),this.camera=b}}var g=z.prototype;return g.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},g.setSize=function(e,t){this.camera instanceof n.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},g.setGui=function(e){var t=this,r=new Q.Z({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(l){t.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return t.camera},onChange:function(l){t.camera.updateProjectionMatrix()}}}});this.camera instanceof n.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(l){t.camera.updateProjectionMatrix()}}),r.showGui(e)},z}(),u=H(519),o={background:null},p=function(){"use strict";function z(a){(0,x.Z)(this,z),this.options=a;var e=a.camera,t=a.sceneParams,r=t.background,l=new n.Scene;r&&(l.background=r),l.add(e),this.scene=l}var g=z.prototype;return g.addAxesHelper=function(){var e,t=new n.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},g.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,u.disposeMesh)(t)})},z}(),m=require("three/examples/jsm/controls/OrbitControls"),T={},U=function(){"use strict";function z(a){(0,x.Z)(this,z),this.options=a;var e=a.camera,t=a.controlParams,r=a.mapControl,l=t.domElement,d=r?new m.MapControls(e,l):new m.OrbitControls(e,l);d.minPolarAngle=Math.PI*.15,d.maxPolarAngle=Math.PI*.85,d.enableDamping=!0,d.dampingFactor=.063,d.autoRotate=!1,d.autoRotateSpeed=-60,d.enableZoom=!0,d.zoomSpeed=.2,this.control=d}var g=z.prototype;return g.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,l=e.minX,d=l===void 0?-1/0:l,i=e.maxZ,b=i===void 0?1/0:i,Z=e.minZ,j=Z===void 0?-1/0:Z,E=e.maxY,A=E===void 0?1/0:E,I=e.minY,W=I===void 0?-1/0:I,J=this.limitPanV||new n.Vector3,$=this.control,ae=this.options.camera,se=new n.Vector3(d,W,j),oe=new n.Vector3(r,A,b);this.limitPanV=J,J.copy($.target),$.target.clamp(se,oe),J.sub($.target),ae.position.sub(J)},g.update=function(){this.control.update()},g.dispose=function(){this.control.dispose()},z}(),G=H(530),X=new n.Vector3,ie=new n.Matrix4,ue=new n.Matrix4,ce=new n.Vector3,fe=new n.Vector3,ge=function z(){"use strict";var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,x.Z)(this,z);var a=function(I,W){return ce.setFromMatrixPosition(I.matrixWorld),fe.setFromMatrixPosition(W.matrixWorld),ce.distanceToSquared(fe)},e=function(I){var W=[];return I.traverse(function(J){J.isCSS2DObject&&W.push(J)}),W},t=function(I){for(var W=e(I).sort(function(oe,ve){if(oe.renderOrder!==ve.renderOrder)return ve.renderOrder-oe.renderOrder;var me=Z.objects.get(oe).distanceToCameraSquared,_e=Z.objects.get(ve).distanceToCameraSquared;return me-_e}),J=W.length,$=0,ae=W.length;$<ae;$++){var se=W[$].userData.zIndexFix||0;W[$].element.style.zIndex=J-$+se}},r=this,l,d,i,b,Z={objects:new WeakMap},j=g.element!==void 0?g.element:document.createElement("div");j.style.overflow="hidden",this.domElement=j,this.getSize=function(){return{width:l,height:d}},this.render=function(A,I){A.autoUpdate===!0&&A.updateMatrixWorld(),I.parent===null&&I.updateMatrixWorld(),ie.copy(I.matrixWorldInverse),ue.multiplyMatrices(I.projectionMatrix,ie),E(A,A,I),t(A)},this.setSize=function(A,I){l=A,d=I,i=l/2,b=d/2,j.style.width="".concat(A,"px"),j.style.height="".concat(I,"px")};function E(A,I,W){if(A.isCSS2DObject){X.setFromMatrixPosition(A.matrixWorld),X.applyMatrix4(ue);var J=A.visible===!0&&X.z>=-1&&X.z<=1&&A.layers.test(W.layers)===!0;if(A.element.style.display=J===!0?"":"none",J===!0){A.onBeforeRender(r,I,W);var $=A.element;$.style.transform="translate(-50%,-50%) translate(".concat(X.x*i+i,"px,").concat(-X.y*b+b,"px)"),$.parentNode!==j&&j.appendChild($),A.onAfterRender(r,I,W)}var ae={distanceToCameraSquared:a(W,A)};Z.objects.set(A,ae)}for(var se=0,oe=A.children.length;se<oe;se++)E(A.children[se],I,W)}},v={zIndex:"auto"},h=function(){"use strict";function z(a){(0,x.Z)(this,z),this.container=a}var g=z.prototype;return g.addRenderer=function(e,t){var r=this.container,l=r.offsetWidth,d=r.offsetHeight,i=e==="css2d"?new ge:new G.CSS3DRenderer;i.domElement.style.position="absolute",i.domElement.style.top="0",i.domElement.style.pointerEvents="none",i.domElement.style.zIndex=t.zIndex,i.setSize(l,d),r.appendChild(i.domElement),e==="css2d"?this.css2Drenderer=i:e==="css3d"&&(this.css3Drenderer=i)},g.setSize=function(e,t){var r,l;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(l=this.css3Drenderer)===null||l===void 0||l.setSize(e,t)},g.render=function(e,t){var r,l;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(l=this.css3Drenderer)===null||l===void 0||l.render(e,t)},g.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},z}(),w=require("three/examples/jsm/postprocessing/EffectComposer"),B=require("three/examples/jsm/postprocessing/RenderPass"),L=require("three/examples/jsm/postprocessing/ShaderPass"),Y=require("three/examples/jsm/shaders/CopyShader"),ee=require("three/examples/jsm/shaders/GammaCorrectionShader"),te=require("three/examples/jsm/postprocessing/SMAAPass"),ne=require("three/examples/jsm/postprocessing/SSAARenderPass"),re=require("three/examples/jsm/shaders/FXAAShader"),he=function(){try{var z=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&z.getContext("webgl2"))}catch(g){return!1}},de=0,le=1,pe=!1,Ce=he()!==!1,je=H.p+"static/media/vertex.cc08e9108dec6da9504a.glsl",Le=H.p+"static/media/fragment.2913fac3481dac4d4a06.glsl",Ae=H(668),De=H(485),xe=require("three/examples/jsm/postprocessing/Pass"),Oe=require("three/examples/jsm/shaders/LuminosityHighPassShader"),Pe=function(z){"use strict";(0,Ae.Z)(a,z);var g=(0,De.Z)(a);function a(t,r,l,d){(0,x.Z)(this,a);var i;i=g.call(this),i.strength=r!==void 0?r:1,i.radius=l,i.threshold=d,i.resolution=t!==void 0?new n.Vector2(t.x,t.y):new n.Vector2(256,256),i.clearColor=new n.Color(0,0,0);var b={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat};i.renderTargetsHorizontal=[],i.renderTargetsVertical=[],i.nMips=5;var Z=Math.round(i.resolution.x/2),j=Math.round(i.resolution.y/2);i.renderTargetBright=new n.WebGLRenderTarget(Z,j,b),i.renderTargetBright.texture.name="UnrealBloomPass.bright",i.renderTargetBright.texture.generateMipmaps=!1;for(var E=0;E<i.nMips;E++){var A=new n.WebGLRenderTarget(Z,j,b);A.texture.name="UnrealBloomPass.h".concat(E),A.texture.generateMipmaps=!1,i.renderTargetsHorizontal.push(A);var I=new n.WebGLRenderTarget(Z,j,b);I.texture.name="UnrealBloomPass.v".concat(E),I.texture.generateMipmaps=!1,i.renderTargetsVertical.push(I),Z=Math.round(Z/2),j=Math.round(j/2)}Oe.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var W=Oe.LuminosityHighPassShader;i.highPassUniforms=n.UniformsUtils.clone(W.uniforms),i.highPassUniforms.luminosityThreshold.value=d,i.highPassUniforms.smoothWidth.value=.01,i.materialHighPassFilter=new n.ShaderMaterial({uniforms:i.highPassUniforms,vertexShader:W.vertexShader,fragmentShader:W.fragmentShader,defines:{}}),i.separableBlurMaterials=[];var J=[3,5,7,9,11];Z=Math.round(i.resolution.x/2),j=Math.round(i.resolution.y/2);for(var $=0;$<i.nMips;$++)i.separableBlurMaterials.push(i.getSeperableBlurMaterial(J[$])),i.separableBlurMaterials[$].uniforms.texSize.value=new n.Vector2(Z,j),Z=Math.round(Z/2),j=Math.round(j/2);i.compositeMaterial=i.getCompositeMaterial(i.nMips),i.compositeMaterial.uniforms.blurTexture1.value=i.renderTargetsVertical[0].texture,i.compositeMaterial.uniforms.blurTexture2.value=i.renderTargetsVertical[1].texture,i.compositeMaterial.uniforms.blurTexture3.value=i.renderTargetsVertical[2].texture,i.compositeMaterial.uniforms.blurTexture4.value=i.renderTargetsVertical[3].texture,i.compositeMaterial.uniforms.blurTexture5.value=i.renderTargetsVertical[4].texture,i.compositeMaterial.uniforms.bloomStrength.value=r,i.compositeMaterial.uniforms.bloomRadius.value=.1,i.compositeMaterial.needsUpdate=!0;var ae=[1,.8,.6,.4,.2];i.compositeMaterial.uniforms.bloomFactors.value=ae,i.bloomTintColors=[new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1)],i.compositeMaterial.uniforms.bloomTintColors.value=i.bloomTintColors,Y.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var se=Y.CopyShader;return i.copyUniforms=n.UniformsUtils.clone(se.uniforms),i.copyUniforms.opacity.value=1,i.materialCopy=new n.ShaderMaterial({uniforms:i.copyUniforms,vertexShader:se.vertexShader,fragmentShader:se.fragmentShader,blending:n.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),i.enabled=!0,i.needsSwap=!1,i._oldClearColor=new n.Color,i.oldClearAlpha=1,i.basic=new n.MeshBasicMaterial,i.fsQuad=new xe.FullScreenQuad(void 0),i}var e=a.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var l=0;l<this.renderTargetsVertical.length;l++)this.renderTargetsVertical[l].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,l){var d=Math.round(r/2),i=Math.round(l/2);this.renderTargetBright.setSize(d,i);for(var b=0;b<this.nMips;b++)this.renderTargetsHorizontal[b].setSize(d,i),this.renderTargetsVertical[b].setSize(d,i),this.separableBlurMaterials[b].uniforms.texSize.value=new n.Vector2(d,i),d=Math.round(d/2),i=Math.round(i/2)},e.render=function(r,l,d,i,b){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var Z=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),b&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=d.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=d.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var j=this.renderTargetBright,E=0;E<this.nMips;E++)this.fsQuad.material=this.separableBlurMaterials[E],this.separableBlurMaterials[E].uniforms.colorTexture.value=j.texture,this.separableBlurMaterials[E].uniforms.direction.value=a.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[E]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[E].uniforms.colorTexture.value=this.renderTargetsHorizontal[E].texture,this.separableBlurMaterials[E].uniforms.direction.value=a.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[E]),r.clear(),this.fsQuad.render(r),j=this.renderTargetsVertical[E];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,b&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(d),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=Z},e.getSeperableBlurMaterial=function(r){return new n.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new n.Vector2(.5,.5)},direction:{value:new n.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
1
|
+
(function(){var Be={187:function(R){"use strict";var T=typeof Reflect=="object"?Reflect:null,x=T&&typeof T.apply=="function"?T.apply:function(c,v,b){return Function.prototype.apply.call(c,v,b)},G;T&&typeof T.ownKeys=="function"?G=T.ownKeys:Object.getOwnPropertySymbols?G=function(c){return Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c))}:G=function(c){return Object.getOwnPropertyNames(c)};function z(f){console&&console.warn&&console.warn(f)}var E=Number.isNaN||function(c){return c!==c};function m(){m.init.call(this)}R.exports=m,R.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var B=10;function X(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");B=f}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(c){if(typeof c!="number"||c<0||E(c))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+c+".");return this._maxListeners=c,this};function W(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return W(this)},m.prototype.emit=function(c){for(var v=[],b=1;b<arguments.length;b++)v.push(arguments[b]);var S=c==="error",A=this._events;if(A!==void 0)S=S&&A.error===void 0;else if(!S)return!1;if(S){var j;if(v.length>0&&(j=v[0]),j instanceof Error)throw j;var F=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw F.context=j,F}var oe=A[c];if(oe===void 0)return!1;if(typeof oe=="function")x(oe,this,v);else for(var de=oe.length,he=se(oe,de),b=0;b<de;++b)x(he[b],this,v);return!0};function k(f,c,v,b){var S,A,j;if(X(v),A=f._events,A===void 0?(A=f._events=Object.create(null),f._eventsCount=0):(A.newListener!==void 0&&(f.emit("newListener",c,v.listener?v.listener:v),A=f._events),j=A[c]),j===void 0)j=A[c]=v,++f._eventsCount;else if(typeof j=="function"?j=A[c]=b?[v,j]:[j,v]:b?j.unshift(v):j.push(v),S=W(f),S>0&&j.length>S&&!j.warned){j.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=f,F.type=c,F.count=j.length,z(F)}return f}m.prototype.addListener=function(c,v){return k(this,c,v,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(c,v){return k(this,c,v,!0)};function Q(){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 Y(f,c,v){var b={fired:!1,wrapFn:void 0,target:f,type:c,listener:v},S=Q.bind(b);return S.listener=v,b.wrapFn=S,S}m.prototype.once=function(c,v){return X(v),this.on(c,Y(this,c,v)),this},m.prototype.prependOnceListener=function(c,v){return X(v),this.prependListener(c,Y(this,c,v)),this},m.prototype.removeListener=function(c,v){var b,S,A,j,F;if(X(v),S=this._events,S===void 0)return this;if(b=S[c],b===void 0)return this;if(b===v||b.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete S[c],S.removeListener&&this.emit("removeListener",c,b.listener||v));else if(typeof b!="function"){for(A=-1,j=b.length-1;j>=0;j--)if(b[j]===v||b[j].listener===v){F=b[j].listener,A=j;break}if(A<0)return this;A===0?b.shift():ie(b,A),b.length===1&&(S[c]=b[0]),S.removeListener!==void 0&&this.emit("removeListener",c,F||v)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(c){var v,b,S;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[c]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[c]),this;if(arguments.length===0){var A=Object.keys(b),j;for(S=0;S<A.length;++S)j=A[S],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=b[c],typeof v=="function")this.removeListener(c,v);else if(v!==void 0)for(S=v.length-1;S>=0;S--)this.removeListener(c,v[S]);return this};function K(f,c,v){var b=f._events;if(b===void 0)return[];var S=b[c];return S===void 0?[]:typeof S=="function"?v?[S.listener||S]:[S]:v?I(S):se(S,S.length)}m.prototype.listeners=function(c){return K(this,c,!0)},m.prototype.rawListeners=function(c){return K(this,c,!1)},m.listenerCount=function(f,c){return typeof f.listenerCount=="function"?f.listenerCount(c):d.call(f,c)},m.prototype.listenerCount=d;function d(f){var c=this._events;if(c!==void 0){var v=c[f];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function se(f,c){for(var v=new Array(c),b=0;b<c;++b)v[b]=f[b];return v}function ie(f,c){for(;c+1<f.length;c++)f[c]=f[c+1];f.pop()}function I(f){for(var c=new Array(f.length),v=0;v<c.length;++v)c[v]=f[v].listener||f[v];return c}function $(f,c){return new Promise(function(v,b){function S(j){f.removeListener(c,A),b(j)}function A(){typeof f.removeListener=="function"&&f.removeListener("error",S),v([].slice.call(arguments))}N(f,c,A,{once:!0}),c!=="error"&&D(f,S,{once:!0})})}function D(f,c,v){typeof f.on=="function"&&N(f,"error",c,v)}function N(f,c,v,b){if(typeof f.on=="function")b.once?f.once(c,v):f.on(c,v);else if(typeof f.addEventListener=="function")f.addEventListener(c,function S(A){b.once&&f.removeEventListener(c,S),v(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(R){var T=function(x){"use strict";var G=Object.prototype,z=G.hasOwnProperty,E,m=typeof Symbol=="function"?Symbol:{},B=m.iterator||"@@iterator",X=m.asyncIterator||"@@asyncIterator",W=m.toStringTag||"@@toStringTag";function k(p,l,g){return Object.defineProperty(p,l,{value:g,enumerable:!0,configurable:!0,writable:!0}),p[l]}try{k({},"")}catch(p){k=function(l,g,O){return l[g]=O}}function Q(p,l,g,O){var C=l&&l.prototype instanceof $?l:$,H=Object.create(C.prototype),te=new he(O||[]);return H._invoke=j(p,g,te),H}x.wrap=Q;function Y(p,l,g){try{return{type:"normal",arg:p.call(l,g)}}catch(O){return{type:"throw",arg:O}}}var K="suspendedStart",d="suspendedYield",se="executing",ie="completed",I={};function $(){}function D(){}function N(){}var f={};k(f,B,function(){return this});var c=Object.getPrototypeOf,v=c&&c(c(me([])));v&&v!==G&&z.call(v,B)&&(f=v);var b=N.prototype=$.prototype=Object.create(f);D.prototype=N,k(b,"constructor",N),k(N,"constructor",D),D.displayName=k(N,W,"GeneratorFunction");function S(p){["next","throw","return"].forEach(function(l){k(p,l,function(g){return this._invoke(l,g)})})}x.isGeneratorFunction=function(p){var l=typeof p=="function"&&p.constructor;return l?l===D||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,N):(p.__proto__=N,k(p,W,"GeneratorFunction")),p.prototype=Object.create(b),p},x.awrap=function(p){return{__await:p}};function A(p,l){function g(H,te,J,re){var ee=Y(p[H],p,te);if(ee.type==="throw")re(ee.arg);else{var pe=ee.arg,le=pe.value;return le&&typeof le=="object"&&z.call(le,"__await")?l.resolve(le.__await).then(function(ue){g("next",ue,J,re)},function(ue){g("throw",ue,J,re)}):l.resolve(le).then(function(ue){pe.value=ue,J(pe)},function(ue){return g("throw",ue,J,re)})}}var O;function C(H,te){function J(){return new l(function(re,ee){g(H,te,re,ee)})}return O=O?O.then(J,J):J()}this._invoke=C}S(A.prototype),k(A.prototype,X,function(){return this}),x.AsyncIterator=A,x.async=function(p,l,g,O,C){C===void 0&&(C=Promise);var H=new A(Q(p,l,g,O),C);return x.isGeneratorFunction(l)?H:H.next().then(function(te){return te.done?te.value:H.next()})};function j(p,l,g){var O=K;return function(H,te){if(O===se)throw new Error("Generator is already running");if(O===ie){if(H==="throw")throw te;return ge()}for(g.method=H,g.arg=te;;){var J=g.delegate;if(J){var re=F(J,g);if(re){if(re===I)continue;return re}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(O===K)throw O=ie,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);O=se;var ee=Y(p,l,g);if(ee.type==="normal"){if(O=g.done?ie:d,ee.arg===I)continue;return{value:ee.arg,done:g.done}}else ee.type==="throw"&&(O=ie,g.method="throw",g.arg=ee.arg)}}}function F(p,l){var g=p.iterator[l.method];if(g===E){if(l.delegate=null,l.method==="throw"){if(p.iterator.return&&(l.method="return",l.arg=E,F(p,l),l.method==="throw"))return I;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return I}var O=Y(g,p.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,I;var C=O.arg;if(!C)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,I;if(C.done)l[p.resultName]=C.value,l.next=p.nextLoc,l.method!=="return"&&(l.method="next",l.arg=E);else return C;return l.delegate=null,I}S(b),k(b,W,"Generator"),k(b,B,function(){return this}),k(b,"toString",function(){return"[object Generator]"});function oe(p){var l={tryLoc:p[0]};1 in p&&(l.catchLoc=p[1]),2 in p&&(l.finallyLoc=p[2],l.afterLoc=p[3]),this.tryEntries.push(l)}function de(p){var l=p.completion||{};l.type="normal",delete l.arg,p.completion=l}function he(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(oe,this),this.reset(!0)}x.keys=function(p){var l=[];for(var g in p)l.push(g);return l.reverse(),function O(){for(;l.length;){var C=l.pop();if(C in p)return O.value=C,O.done=!1,O}return O.done=!0,O}};function me(p){if(p){var l=p[B];if(l)return l.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var g=-1,O=function C(){for(;++g<p.length;)if(z.call(p,g))return C.value=p[g],C.done=!1,C;return C.value=E,C.done=!0,C};return O.next=O}}return{next:ge}}x.values=me;function ge(){return{value:E,done:!0}}return he.prototype={constructor:he,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(de),!p)for(var l in this)l.charAt(0)==="t"&&z.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=E)},stop:function(){this.done=!0;var p=this.tryEntries[0],l=p.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var l=this;function g(re,ee){return H.type="throw",H.arg=p,l.next=re,ee&&(l.method="next",l.arg=E),!!ee}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],H=C.completion;if(C.tryLoc==="root")return g("end");if(C.tryLoc<=this.prev){var te=z.call(C,"catchLoc"),J=z.call(C,"finallyLoc");if(te&&J){if(this.prev<C.catchLoc)return g(C.catchLoc,!0);if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else if(te){if(this.prev<C.catchLoc)return g(C.catchLoc,!0)}else if(J){if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,l){for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g];if(O.tryLoc<=this.prev&&z.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=l&&l<=C.finallyLoc&&(C=null);var H=C?C.completion:{};return H.type=p,H.arg=l,C?(this.method="next",this.next=C.finallyLoc,I):this.complete(H)},complete:function(p,l){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"&&l&&(this.next=l),I},finish:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.finallyLoc===p)return this.complete(g.completion,g.afterLoc),de(g),I}},catch:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.tryLoc===p){var O=g.completion;if(O.type==="throw"){var C=O.arg;de(g)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(p,l,g){return this.delegate={iterator:me(p),resultName:l,nextLoc:g},this.method==="next"&&(this.arg=E),I}},x}(R.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function G(z){if(z.geometry&&z.geometry.dispose(),z.material){var E=Array.isArray(z.material)?z.material:[z.material];E.forEach(function(m){var B,X,W,k,Q,Y,K,d,se,ie,I,$,D;(B=m.map)===null||B===void 0||B.dispose(),(X=m.lightMap)===null||X===void 0||X.dispose(),(W=m.bumpMap)===null||W===void 0||W.dispose(),(k=m.normalMap)===null||k===void 0||k.dispose(),(Q=m.specularMap)===null||Q===void 0||Q.dispose(),(Y=m.envMap)===null||Y===void 0||Y.dispose(),(K=m.alphaMap)===null||K===void 0||K.dispose(),(d=m.aoMap)===null||d===void 0||d.dispose(),(se=m.displacementMap)===null||se===void 0||se.dispose(),(ie=m.emissiveMap)===null||ie===void 0||ie.dispose(),(I=m.gradientMap)===null||I===void 0||I.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(D=m.roughnessMap)===null||D===void 0||D.dispose(),m.dispose()})}}},519:function(R,T,x){"use strict";x.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return W.Z}});var G=x(666),z=x.n(G),E=null,m=x(695),B=x(644);function X(I){if(I.material){var $=Array.isArray(I.material)?I.material:[I.material];$.forEach(function(D){var N,f;(N=D.color)===null||N===void 0||N.convertSRGBToLinear(),(f=D.emissive)===null||f===void 0||f.convertSRGBToLinear(),D.map&&(D.map.encoding=THREE.sRGBEncoding),D.emissiveMap&&(D.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=x(738),k=x(568),Q=x(924),Y=require("idb-keyval"),K=x(484),d=null,se=null,ie=function(){var I=(0,k.Z)(z().mark(function $(D,N){var f,c,v,b,S,A;return z().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return f=N.version,F.next=4,(0,Y.get)(D);case 4:if(v=F.sent,!(v&&v[f])){F.next=9;break}c=v[f],F.next=15;break;case 9:return F.next=11,(0,K.Z)(fetch(D).then(function(oe){if(oe.ok)return oe.blob();throw new Error}));case 11:b=F.sent,S=b.res,A=b.err,A||(c=S,(0,Y.set)(D,(0,Q.Z)({},f,S)));case 15:return F.abrupt("return",c?{url:URL.createObjectURL(c)}:{url:D});case 16:case"end":return F.stop()}},$)}));return function(D,N){return I.apply(this,arguments)}}()},738:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function G(E){return Object.prototype.toString.call(E)==="[object Object]"}function z(E){if(G(E)===!1)return!1;var m=E.constructor;if(m===void 0)return!0;var B=m.prototype;return!(G(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});var G=x(42);function z(E){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,G.Z)({err:null,res:B},m)}).catch(function(B){return(0,G.Z)({err:B,res:void 0},m)})}},644:function(R){"use strict";R.exports=require("three")},568:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});function G(E,m,B,X,W,k,Q){try{var Y=E[k](Q),K=Y.value}catch(d){B(d);return}Y.done?m(K):Promise.resolve(K).then(X,W)}function z(E){return function(){var m=this,B=arguments;return new Promise(function(X,W){var k=E.apply(m,B);function Q(K){G(k,X,W,Q,Y,"next",K)}function Y(K){G(k,X,W,Q,Y,"throw",K)}Q(void 0)})}}},924:function(R,T,x){"use strict";x.d(T,{Z:function(){return G}});function G(z,E,m){return E in z?Object.defineProperty(z,E,{value:m,enumerable:!0,configurable:!0,writable:!0}):z[E]=m,z}},42:function(R,T,x){"use strict";x.d(T,{Z:function(){return z}});var G=x(924);function z(E){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{},X=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(B).filter(function(W){return Object.getOwnPropertyDescriptor(B,W).enumerable}))),X.forEach(function(W){(0,G.Z)(E,W,B[W])})}return E}}},Oe={};function q(R){var T=Oe[R];if(T!==void 0)return T.exports;var x=Oe[R]={exports:{}};return Be[R](x,x.exports,q),x.exports}(function(){q.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return q.d(T,{a:T}),T}})(),function(){q.d=function(R,T){for(var x in T)q.o(T,x)&&!q.o(R,x)&&Object.defineProperty(R,x,{enumerable:!0,get:T[x]})}}(),function(){q.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)}}(),function(){q.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}(),function(){q.p="/"}();var Pe={};(function(){"use strict";q.r(Pe),q.d(Pe,{BaseObject:function(){return gt},GUIObject:function(){return c},Pencil:function(){return Ce},default:function(){return Ce}});function R(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function T(s,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function x(s,i,n){return i&&T(s.prototype,i),n&&T(s,n),s}var G=q(42);function z(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);i&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable})),n.push.apply(n,e)}return n}function E(s,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(i,n))}),s}function m(s,i){(i==null||i>s.length)&&(i=s.length);for(var n=0,e=new Array(i);n<i;n++)e[n]=s[n];return e}function B(s){if(Array.isArray(s))return m(s)}function X(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function W(){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 k(s,i){if(!!s){if(typeof s=="string")return m(s,i);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(s,i)}}function Q(s){return B(s)||X(s)||k(s)||W()}var Y=require("@tweenjs/tween.js"),K=q.n(Y),d=q(644),se=q(187),ie=require("deepmerge"),I=q.n(ie),$=require("three/examples/jsm/libs/stats.module"),D=q.n($),N=require("lil-gui"),f=q.n(N),c=function(){"use strict";function s(n){R(this,s),this.guiParams={},n&&(this.guiParams=n)}var i=s.prototype;return i.showGui=function(e){var t=this;!e||Object.keys(this.guiParams).forEach(function(r){var o=e.addFolder(r),u=t.guiParams[r];Object.keys(u).forEach(function(a){var h=u[a],w=h.min,P=h.max,y=h.step,_=h.name,M=h.paramMap,L=h.items,Z=h.value,V=h.target,ae=a.toLowerCase().indexOf("color")>-1,U,ne=typeof Z=="undefined"&&V,ce=ne?V():u[a],fe=ne?a:"value";L?U=o.add(ce,fe,L):ae?U=o.addColor(ce,fe):U=o.add(ce,fe),U=U.name(_||a),typeof w!="undefined"&&(U=U.min(w)),typeof P!="undefined"&&(U=U.max(P)),typeof y!="undefined"&&(U=U.step(y)),U=U.onChange(function(){t.setTargetValue(r,a,ce[fe],M)}),ne&&U.listen()})})},i.setTargetValue=function(e,t,r,o){var u=this.guiParams[e][t],a=u.onChange,h=u.target,w=u.value,P=t.toLowerCase().indexOf("color")>-1,y=typeof w=="undefined"&&h;if(h&&!y){var _=h();Array.isArray(_)||(_=[_]),_.forEach(function(M){if(!!M)if(P)try{M[o||t].set(r)}catch(L){t!=="color"&&!o&&console.warn("".concat(t," is not a color,set paramMap"))}else M[o||t]=r})}a&&a(r)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(t){Object.keys(e.guiParams[t]).forEach(function(r){var o=e.guiParams[t][r];typeof o.value!="undefined"&&e.setTargetValue(t,r,o.value,o.paramMap)})})},s}(),v={None:d.NoToneMapping,Linear:d.LinearToneMapping,Reinhard:d.ReinhardToneMapping,Cineon:d.CineonToneMapping,ACESFilmic:d.ACESFilmicToneMapping},b={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:d.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},S=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.width,t=n.height,r=n.rendererParams,o=r.alpha,u=r.devicePixelRatio,a=r.antialias,h=r.powerPreference,w=r.toneMapping,P=r.toneMappingExposure,y=r.outputEncoding,_=r.logarithmicDepthBuffer,M=r.preserveDrawingBuffer,L=new d.WebGLRenderer({alpha:o,antialias:a,powerPreference:h,logarithmicDepthBuffer:_,preserveDrawingBuffer:M});L.setSize(e,t),L.setPixelRatio(u),L.autoClear=!1,L.toneMapping=v[w],L.toneMappingExposure=P,L.outputEncoding=y,this.renderer=L}var i=s.prototype;return i.setSize=function(e,t){this.renderer.setSize(e,t)},i.render=function(){var e=this.options,t=e.scene,r=e.camera;this.renderer.render(t,r)},i.setGui=function(e){var t=this,r=new c({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:v,target:function(){return t.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return t.renderer}}}});r.showGui(e)},i.dispose=function(){var e,t,r;(e=this.renderer)===null||e===void 0||e.clear(),(t=this.renderer)===null||t===void 0||t.dispose(),(r=this.renderer)===null||r===void 0||r.renderLists.dispose()},s}(),A={fov:45,near:1,far:1e3},j=function(){"use strict";function s(n){R(this,s),this.oldCameraPosition=new d.Vector3,this.oldCameraRotation=new d.Euler,this.customCamera=!1,this.options=n;var e=n.width,t=n.height,r=n.cameraParams;if(r instanceof d.Camera)this.camera=r,this.customCamera=!0;else{var o=r.fov,u=r.far,a=r.near,h=new d.PerspectiveCamera(o,e/t,a,u);h.position.set(0,0,400),h.lookAt(0,0,0),this.camera=h}}var i=s.prototype;return i.checkCameraChange=function(){var e=this.camera,t=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!t},i.setSize=function(e,t){this.camera instanceof d.PerspectiveCamera&&(this.camera.aspect=e/t),this.camera.updateProjectionMatrix()},i.setGui=function(e){var t=this,r=new c({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 d.PerspectiveCamera&&(r.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return t.camera},onChange:function(o){t.camera.updateProjectionMatrix()}}),r.showGui(e)},s}(),F=q(519),oe={background:null},de=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.sceneParams,r=t.background,o=new d.Scene;r&&(o.background=r),o.add(e),this.scene=o}var i=s.prototype;return i.addAxesHelper=function(){var e,t=new d.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(t)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(t){(0,F.disposeMesh)(t)})},s}(),he=require("three/examples/jsm/controls/OrbitControls"),me={},ge=function(){"use strict";function s(n){R(this,s),this.options=n;var e=n.camera,t=n.controlParams,r=n.mapControl,o=t.domElement,u=r?new he.MapControls(e,o):new he.OrbitControls(e,o);u.minPolarAngle=Math.PI*.15,u.maxPolarAngle=Math.PI*.85,u.enableDamping=!0,u.dampingFactor=.063,u.autoRotate=!1,u.autoRotateSpeed=-60,u.enableZoom=!0,u.zoomSpeed=.2,this.control=u}var i=s.prototype;return i.limitPan=function(e){var t=e.maxX,r=t===void 0?1/0:t,o=e.minX,u=o===void 0?-1/0:o,a=e.maxZ,h=a===void 0?1/0:a,w=e.minZ,P=w===void 0?-1/0:w,y=e.maxY,_=y===void 0?1/0:y,M=e.minY,L=M===void 0?-1/0:M,Z=this.limitPanV||new d.Vector3,V=this.control,ae=this.options.camera,U=new d.Vector3(u,L,P),ne=new d.Vector3(r,_,h);this.limitPanV=Z,Z.copy(V.target),V.target.clamp(U,ne),Z.sub(V.target),ae.position.sub(Z)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},s}(),p=require("three/examples/jsm/renderers/CSS3DRenderer"),l=new d.Vector3,g=new d.Matrix4,O=new d.Matrix4,C=new d.Vector3,H=new d.Vector3,te=function s(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,s);var n=function(M,L){return C.setFromMatrixPosition(M.matrixWorld),H.setFromMatrixPosition(L.matrixWorld),C.distanceToSquared(H)},e=function(M){var L=[];return M.traverse(function(Z){Z.isCSS2DObject&&L.push(Z)}),L},t=function(M){for(var L=e(M).sort(function(ne,ce){if(ne.renderOrder!==ce.renderOrder)return ce.renderOrder-ne.renderOrder;var fe=w.objects.get(ne).distanceToCameraSquared,ye=w.objects.get(ce).distanceToCameraSquared;return fe-ye}),Z=L.length,V=0,ae=L.length;V<ae;V++){var U=L[V].userData.zIndexFix||0;L[V].element.style.zIndex=Z-V+U}},r=this,o,u,a,h,w={objects:new WeakMap},P=i.element!==void 0?i.element:document.createElement("div");P.style.overflow="hidden",this.domElement=P,this.getSize=function(){return{width:o,height:u}},this.render=function(_,M){_.autoUpdate===!0&&_.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld(),g.copy(M.matrixWorldInverse),O.multiplyMatrices(M.projectionMatrix,g),y(_,_,M),t(_)},this.setSize=function(_,M){o=_,u=M,a=o/2,h=u/2,P.style.width="".concat(_,"px"),P.style.height="".concat(M,"px")};function y(_,M,L){if(_.isCSS2DObject){l.setFromMatrixPosition(_.matrixWorld),l.applyMatrix4(O);var Z=_.visible===!0&&l.z>=-1&&l.z<=1&&_.layers.test(L.layers)===!0;if(_.element.style.display=Z===!0?"":"none",Z===!0){_.onBeforeRender(r,M,L);var V=_.element;V.style.transform="translate(-50%,-50%) translate(".concat(l.x*a+a,"px,").concat(-l.y*h+h,"px)"),V.parentNode!==P&&P.appendChild(V),_.onAfterRender(r,M,L)}var ae={distanceToCameraSquared:n(L,_)};w.objects.set(_,ae)}for(var U=0,ne=_.children.length;U<ne;U++)y(_.children[U],M,L)}},J={zIndex:"auto"},re=function(){"use strict";function s(n){R(this,s),this.container=n}var i=s.prototype;return i.addRenderer=function(e,t){var r=this.container,o=r.offsetWidth,u=r.offsetHeight,a=e==="css2d"?new te:new p.CSS3DRenderer;a.domElement.style.position="absolute",a.domElement.style.top="0",a.domElement.style.pointerEvents="none",a.domElement.style.zIndex=t.zIndex,a.setSize(o,u),r.appendChild(a.domElement),e==="css2d"?this.css2Drenderer=a:e==="css3d"&&(this.css3Drenderer=a)},i.setSize=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.setSize(e,t),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,t)},i.render=function(e,t){var r,o;(r=this.css2Drenderer)===null||r===void 0||r.render(e,t),(o=this.css3Drenderer)===null||o===void 0||o.render(e,t)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},s}(),ee=require("three/examples/jsm/postprocessing/EffectComposer"),pe=require("three/examples/jsm/postprocessing/RenderPass"),le=require("three/examples/jsm/postprocessing/ShaderPass"),ue=require("three/examples/jsm/shaders/CopyShader"),Fe=require("three/examples/jsm/shaders/GammaCorrectionShader"),ke=require("three/examples/jsm/postprocessing/SMAAPass"),Ue=require("three/examples/jsm/postprocessing/SSAARenderPass"),Ie=require("three/examples/jsm/shaders/FXAAShader"),Ve=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(i){return!1}},Pt=0,Ne=1,ve=!1,Re=Ve()!==!1,We=q.p+"static/media/vertex.cc08e9108dec6da9504a.glsl",He=q.p+"static/media/fragment.2913fac3481dac4d4a06.glsl";function _e(s,i){return _e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_e(s,i)}function Me(s,i){return _e(s,i)}function Ze(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),i&&Me(s,i)}function qe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function Se(s){return Se=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Se(s)}function Te(s){return Se(s)}function Xe(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Qe(s){return s&&s.constructor===Symbol?"symbol":typeof s}function Ye(s,i){return i&&(Qe(i)==="object"||typeof i=="function")?i:Xe(s)}function Ke(s){var i=qe();return function(){var e=Te(s),t;if(i){var r=Te(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return Ye(this,t)}}var je=require("three/examples/jsm/postprocessing/Pass"),Ee=require("three/examples/jsm/shaders/LuminosityHighPassShader"),we=function(s){"use strict";Ze(n,s);var i=Ke(n);function n(t,r,o,u){R(this,n);var a;a=i.call(this),a.strength=r!==void 0?r:1,a.radius=o,a.threshold=u,a.resolution=t!==void 0?new d.Vector2(t.x,t.y):new d.Vector2(256,256),a.clearColor=new d.Color(0,0,0);var h={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat};a.renderTargetsHorizontal=[],a.renderTargetsVertical=[],a.nMips=5;var w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);a.renderTargetBright=new d.WebGLRenderTarget(w,P,h),a.renderTargetBright.texture.name="UnrealBloomPass.bright",a.renderTargetBright.texture.generateMipmaps=!1;for(var y=0;y<a.nMips;y++){var _=new d.WebGLRenderTarget(w,P,h);_.texture.name="UnrealBloomPass.h".concat(y),_.texture.generateMipmaps=!1,a.renderTargetsHorizontal.push(_);var M=new d.WebGLRenderTarget(w,P,h);M.texture.name="UnrealBloomPass.v".concat(y),M.texture.generateMipmaps=!1,a.renderTargetsVertical.push(M),w=Math.round(w/2),P=Math.round(P/2)}Ee.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var L=Ee.LuminosityHighPassShader;a.highPassUniforms=d.UniformsUtils.clone(L.uniforms),a.highPassUniforms.luminosityThreshold.value=u,a.highPassUniforms.smoothWidth.value=.01,a.materialHighPassFilter=new d.ShaderMaterial({uniforms:a.highPassUniforms,vertexShader:L.vertexShader,fragmentShader:L.fragmentShader,defines:{}}),a.separableBlurMaterials=[];var Z=[3,5,7,9,11];w=Math.round(a.resolution.x/2),P=Math.round(a.resolution.y/2);for(var V=0;V<a.nMips;V++)a.separableBlurMaterials.push(a.getSeperableBlurMaterial(Z[V])),a.separableBlurMaterials[V].uniforms.texSize.value=new d.Vector2(w,P),w=Math.round(w/2),P=Math.round(P/2);a.compositeMaterial=a.getCompositeMaterial(a.nMips),a.compositeMaterial.uniforms.blurTexture1.value=a.renderTargetsVertical[0].texture,a.compositeMaterial.uniforms.blurTexture2.value=a.renderTargetsVertical[1].texture,a.compositeMaterial.uniforms.blurTexture3.value=a.renderTargetsVertical[2].texture,a.compositeMaterial.uniforms.blurTexture4.value=a.renderTargetsVertical[3].texture,a.compositeMaterial.uniforms.blurTexture5.value=a.renderTargetsVertical[4].texture,a.compositeMaterial.uniforms.bloomStrength.value=r,a.compositeMaterial.uniforms.bloomRadius.value=.1,a.compositeMaterial.needsUpdate=!0;var ae=[1,.8,.6,.4,.2];a.compositeMaterial.uniforms.bloomFactors.value=ae,a.bloomTintColors=[new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1),new d.Vector3(1,1,1)],a.compositeMaterial.uniforms.bloomTintColors.value=a.bloomTintColors,ue.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var U=ue.CopyShader;return a.copyUniforms=d.UniformsUtils.clone(U.uniforms),a.copyUniforms.opacity.value=1,a.materialCopy=new d.ShaderMaterial({uniforms:a.copyUniforms,vertexShader:U.vertexShader,fragmentShader:U.fragmentShader,blending:d.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),a.enabled=!0,a.needsSwap=!1,a._oldClearColor=new d.Color,a.oldClearAlpha=1,a.basic=new d.MeshBasicMaterial,a.fsQuad=new je.FullScreenQuad(void 0),a}var e=n.prototype;return e.dispose=function(){for(var r=0;r<this.renderTargetsHorizontal.length;r++)this.renderTargetsHorizontal[r].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(r,o){var u=Math.round(r/2),a=Math.round(o/2);this.renderTargetBright.setSize(u,a);for(var h=0;h<this.nMips;h++)this.renderTargetsHorizontal[h].setSize(u,a),this.renderTargetsVertical[h].setSize(u,a),this.separableBlurMaterials[h].uniforms.texSize.value=new d.Vector2(u,a),u=Math.round(u/2),a=Math.round(a/2)},e.render=function(r,o,u,a,h){r.getClearColor(this._oldClearColor),this.oldClearAlpha=r.getClearAlpha();var w=r.autoClear;r.autoClear=!1,r.setClearColor(this.clearColor,0),h&&r.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=u.texture,r.setRenderTarget(null),r.clear(),this.fsQuad.render(r)),this.highPassUniforms.tDiffuse.value=u.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,r.setRenderTarget(this.renderTargetBright),r.clear(),this.fsQuad.render(r);for(var P=this.renderTargetBright,y=0;y<this.nMips;y++)this.fsQuad.material=this.separableBlurMaterials[y],this.separableBlurMaterials[y].uniforms.colorTexture.value=P.texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionX,r.setRenderTarget(this.renderTargetsHorizontal[y]),r.clear(),this.fsQuad.render(r),this.separableBlurMaterials[y].uniforms.colorTexture.value=this.renderTargetsHorizontal[y].texture,this.separableBlurMaterials[y].uniforms.direction.value=n.BlurDirectionY,r.setRenderTarget(this.renderTargetsVertical[y]),r.clear(),this.fsQuad.render(r),P=this.renderTargetsVertical[y];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,r.setRenderTarget(this.renderTargetsHorizontal[0]),r.clear(),this.fsQuad.render(r),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,h&&r.state.buffers.stencil.setTest(!0),this.renderToScreen?(r.setRenderTarget(null),this.fsQuad.render(r)):(r.setRenderTarget(u),this.fsQuad.render(r)),r.setClearColor(this._oldClearColor,this.oldClearAlpha),r.autoClear=w},e.getSeperableBlurMaterial=function(r){return new d.ShaderMaterial({defines:{KERNEL_RADIUS:r,SIGMA:r},uniforms:{colorTexture:{value:null},texSize:{value:new d.Vector2(.5,.5)},direction:{value:new d.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
2
2
|
void main() {
|
|
3
3
|
vUv = uv;
|
|
4
4
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
void main() {
|
|
14
14
|
vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
|
|
15
|
-
}`})},e.getCompositeMaterial=function(r){return new
|
|
15
|
+
}`})},e.getCompositeMaterial=function(r){return new d.ShaderMaterial({defines:{NUM_MIPS:r},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
|
|
16
16
|
void main() {
|
|
17
17
|
vUv = uv;
|
|
18
18
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -37,4 +37,4 @@
|
|
|
37
37
|
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
38
38
|
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
39
39
|
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
40
|
-
}`})},a}(xe.Pass);Pe.BlurDirectionX=new n.Vector2(1,0),Pe.BlurDirectionY=new n.Vector2(0,1);var ze={threshold:.2,strength:.5,radius:0},Ze=new n.MeshBasicMaterial({color:"black"}),Be=new n.SpriteMaterial({color:"#000"}),Ge=function(){"use strict";function z(a,e){(0,x.Z)(this,z),this.materials={},this.bloomLayer=new n.Layers,this.active=!0,this.composerController=a,this.options=e;var t=a.renderer,r=a.renderPass,l=a.finalComposer,d=a.getSize(),i=d.width,b=d.height,Z=new Pe(new n.Vector2(i,b),e.strength,e.radius,e.threshold);this.bloomPass=Z;var j=new w.EffectComposer(t);j.renderToScreen=!1,j.addPass(r),j.addPass(this.bloomPass),this.bloomComposer=j,this.bloomLayer.set(le);var E=new n.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:j.renderTarget2.texture}},vertexShader:je,fragmentShader:Le,defines:{}}),A=new L.ShaderPass(E,"baseTexture");A.needsSwap=!0,this.finalPass=A,l.addPass(A)}var g=z.prototype;return g.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},g.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},g.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,l=t.bloomLayer,d=t.materials;e.traverse(function(i){var b=i;b.material&&l.test(b.layers)===!1&&(d[b.uuid]=b.material,b.material=b.isSprite?Be:Ze)}),r.render(),e.traverse(function(i){var b=i;d[b.uuid]&&(b.material=d[b.uuid],delete d[b.uuid])})}},g.setSize=function(e,t){this.bloomComposer.setSize(e,t)},g.setGui=function(e){var t=this,r=new Q.Z({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},g.dispose=function(){this.bloomPass.dispose(),this.materials={}},z}(),ke=require("three/examples/jsm/postprocessing/OutlinePass"),Ue={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},Fe=function(){"use strict";function z(a,e){(0,x.Z)(this,z),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var t=a.scene,r=a.camera,l=a.finalComposer,d=a.getSize(),i=d.width,b=d.height,Z=new ke.OutlinePass(new n.Vector2(i,b),t,r);Z.selectedObjects=this.selectedObjects,this.outlinePass=Z,l.addPass(Z),this.setGui()}var g=z.prototype;return g.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},g.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},g.setGui=function(){var e=this,t=new Q.Z({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},g.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},z}(),Ie=H(607),Ve=require("three/examples/jsm/postprocessing/SSRPass"),Ne=require("three/examples/jsm/objects/ReflectorForSSRPass"),We={maxDistance:10,selects:!0},He={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},Xe=function(){"use strict";function z(a,e){(0,x.Z)(this,z),this.selectedObjects=[],this.active=!0,this.composerController=a,this.options=e;var t=a.scene,r=a.camera,l=a.renderer,d=a.finalComposer,i=a.getSize(),b=i.width,Z=i.height,j=new Ve.SSRPass({renderer:l,scene:t,camera:r,width:b,height:Z,groundReflector:null,selects:this.selectedObjects});this.ssrPass=j,d.addPass(j),this.setGui()}var g=z.prototype;return g.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,c.Z)({},He,e),r=t.width,l=t.height,d=(0,Ie.Z)(t,["width","height"]),i=this.composerController,b=i.scene,Z=i.getSize(),j=new n.PlaneGeometry(r,l),E=new Ne.ReflectorForSSRPass(j,(0,y.Z)((0,c.Z)({},d),{textureWidth:Z.width,textureHeight:Z.height}));E.material.depthWrite=!1,E.rotation.x=-Math.PI/2,E.visible=!1,b.add(E),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=E},g.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},g.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},g.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},g.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},g.setGui=function(){var e=this,t=new Q.Z({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},g.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},z}(),Ke=function(){"use strict";function z(a){(0,x.Z)(this,z),this.active=!0,this.options=a;var e=a.renderer,t=a.scene,r=a.camera,l=this.createRenderTarget(),d=new w.EffectComposer(e,l);d.setPixelRatio(e.getPixelRatio()),this.finalComposer=d,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=l,this.camera=r}var g=z.prototype;return g.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,l=e.encoding,d=this.getSize(),i={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat,encoding:l,type:r},b;if(+n.REVISION<138&&t>0){var Z=new n.WebGLMultisampleRenderTarget(d.width,d.height,i);Z.samples=t,b=Z}else if(+n.REVISION>=138&&t>0){var j=new n.WebGLRenderTarget(d.width,d.height,(0,y.Z)((0,c.Z)({},i),{samples:t}));b=j}else{var E=new n.WebGLRenderTarget(d.width,d.height,i);b=E}return b.texture.name="EffectComposer.rt1",b},g.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,l=new B.RenderPass(t,r);this.finalComposer.addPass(l),this.renderPass=l},g.addCopyPass=function(){var e=new L.ShaderPass(Y.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},g.addGammaCorrectionPass=function(){var e=new L.ShaderPass(ee.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},g.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,l=new L.ShaderPass(re.FXAAShader);this.finalComposer.addPass(l),this.fxaaPass=l,this.setFXAAPassSize(t,r)},g.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,l=this.options.renderer,d=new te.SMAAPass(t*l.getPixelRatio(),r*l.getPixelRatio());this.finalComposer.addPass(d),this.smaaPass=d},g.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,l=new ne.SSAARenderPass(t,r,0,0);l.unbiased=!0,l.sampleLevel=1,this.finalComposer.addPass(l),this.ssaaPass=l},g.addBloomPass=function(e){var t=new Ge(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},g.addOutlinePass=function(e){var t=new Fe(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},g.addSSRPass=function(e){var t=new Xe(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},g.getSize=function(){var e=this.options.renderer;return e.getSize(new n.Vector2)},g.enable=function(){this.active||(this.active=!0)},g.disable=function(){!this.active||(this.active=!1)},g.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},g.setSize=function(e,t){var r,l;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(l=this.ssrController)===null||l===void 0||l.setSize(e,t),this.setFXAAPassSize(e,t)},g.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,l=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*l),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*l)}},g.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()}},g.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(l){var d,i,b;(d=l.fsQuad)===null||d===void 0||d.dispose(),(i=l.fsQuad)===null||i===void 0||(b=i.material)===null||b===void 0||b.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},z}(),ye=function(){"use strict";function z(a){(0,x.Z)(this,z),this.raycaster=new n.Raycaster,this.installPlugins=new Map,this.event=new O.EventEmitter,this.clock=new n.Clock,this.options=M()(z.options,a,{isMergeableObject:u.isPlainObject});var e=this.options,t=e.container,r=e.stats,l=e.gui;if(l){var d=new(K());d.open(!1),this.gui=d}if(r){var i=new(V());i.showPanel(0),i.dom.style.position="absolute",t.appendChild(i.dom),this.stats=i}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var g=z.prototype;return g.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),l=1;l<t;l++)r[l-1]=arguments[l];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var d;(d=e).install.apply(d,[this].concat((0,P.Z)(r))),this.installPlugins.set(e,!0)}},g.init=function(){var e=this,t=this.options,r=t.container,l=t.isdev,d=t.axesHelper,i=t.renderer,b=t.scene,Z=t.camera,j=this.getSize(),E=j.width,A=j.height,I=new C({isdev:l,width:E,height:A,cameraParams:Z});this.gui&&I.setGui(this.gui);var W=I.camera,J=new p({camera:W,sceneParams:b}),$=J.scene,ae=new D({width:E,height:A,scene:$,camera:W,isdev:l,rendererParams:(0,y.Z)((0,c.Z)({},i),{outputEncoding:n.LinearEncoding,antialias:!1})});this.gui&&ae.setGui(this.gui);var se=ae.renderer;d&&J.addAxesHelper(),this.sceneController=J,this.rendererController=ae,this.cameraController=I,r.appendChild(se.domElement);var oe=new ResizeObserver(function(ve){var me=!0,_e=!1,Re=void 0;try{for(var we=ve[Symbol.iterator](),Me;!(me=(Me=we.next()).done);me=!0){var Ye=Me.value,Ee=Ye.contentRect;e.handeleResize(Ee.width,Ee.height)}}catch($e){_e=!0,Re=$e}finally{try{!me&&we.return!=null&&we.return()}finally{if(_e)throw Re}}});oe.observe(r),this.resizeObserver=oe},g.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,l=e.ssr,d=e.renderer,i=e.bloomParams,b=e.outlineParams,Z=e.ssrParams,j=e.multisampling,E=d.antialias;E==="msaa"&&!Ce&&(E=!1,console.warn("MSAA is not supported on this browser"));var A=new Ke({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:E==="msaa"?j:0,type:n.UnsignedByteType,encoding:d.outputEncoding}});this.composerController=A,E==="ssaa"&&A.addSSAAPass(),l&&A.addSSRPass(Z),t&&A.addBloomPass(i),r&&A.addOutlinePass(b),d.outputEncoding===n.sRGBEncoding&&A.addGammaCorrectionPass(),E==="fxaa"?A.addFXAAPass():E==="smaa"&&A.addSMAAPass(),A.checkCopyPass(),this.event.on("passcheck",function(){A.checkCopyPass()})},g.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,l=e.css3DRenderer,d=e.css2DRendererParams,i=e.css3DRendererParams;if(r||l){var b=new h(t);r&&b.addRenderer("css2d",d),l&&b.addRenderer("css3d",i),this.cssRendererController=b}},g.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,l=e.controlParams;if(t){var d=new U({camera:this.camera,controlParams:{domElement:(l==null?void 0:l.domElement)||this.renderer.domElement},mapControl:r});this.controlController=d}},g.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},g.handeleResize=function(e,t){var r=this,l=r.rendererController,d=r.cameraController,i=r.composerController,b=r.cssRendererController;d==null||d.setSize(e,t),l==null||l.setSize(e,t),i==null||i.setSize(e,t),b==null||b.setSize(e,t),this.installPlugins.forEach(function(Z,j){var E;(E=j.resize)===null||E===void 0||E.call(j,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},g.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=this,d=l.raycaster,i=l.options,b=i.container,Z=new n.Vector2,j=b.getBoundingClientRect();if(Z.x=(e.clientX-j.left)/(j.right-j.left)*2-1,Z.y=-((e.clientY-j.top)/(j.bottom-j.top))*2+1,this.camera&&this.scene){d.setFromCamera(Z,this.camera);var E=d.intersectObjects(t||this.scene.children,r);if(E.length)return{object:E[0].object,intersects:E}}},g.render=function(){var e,t,r,l,d=this,i=d.renderer,b=d.scene,Z=d.camera,j=d.clock;if(!(!i||!b||!Z||this.options.staticRender&&!this.cameraController.checkCameraChange())){var E=j.getDelta(),A=j.getElapsedTime();if(i.clear(),s().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(W,J){var $;($=J.update)===null||$===void 0||$.call(J,E,A)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var I;(I=this.rendererController)===null||I===void 0||I.render()}(r=this.cssRendererController)===null||r===void 0||r.render(b,Z),(l=this.stats)===null||l===void 0||l.update(),this.event.emit("render",{delta:E,elapsed:A})}},g.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},g.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},g.dispose=function(){var e,t,r,l,d,i,b;this.stop(),s().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(Z,j){var E;(E=j.dispose)===null||E===void 0||E.call(j)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(l=this.sceneController)===null||l===void 0||l.dispose(),(d=this.composerController)===null||d===void 0||d.dispose(),(i=this.rendererController)===null||i===void 0||i.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(b=this.gui)===null||b===void 0||b.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},(0,_.Z)(z,[{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}}]),z}();ye.options={isdev:pe,stats:pe,gui:pe,axesHelper:pe,control:pe,renderer:(0,y.Z)((0,c.Z)({},k),{antialias:Ce?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:o,camera:R,bloom:!1,bloomParams:ze,outline:!1,outlineParams:Ue,css2DRenderer:!1,ssr:!1,ssrParams:We,css2DRendererParams:(0,c.Z)({},v),css3DRenderer:!1,css3DRendererParams:(0,c.Z)({},v)};var Qe=H(701)})(),module.exports=be})();
|
|
40
|
+
}`})},n}(je.Pass);we.BlurDirectionX=new d.Vector2(1,0),we.BlurDirectionY=new d.Vector2(0,1);var $e={threshold:.2,strength:.5,radius:0},Je=new d.MeshBasicMaterial({color:"black"}),et=new d.SpriteMaterial({color:"#000"}),tt=function(){"use strict";function s(n,e){R(this,s),this.materials={},this.bloomLayer=new d.Layers,this.active=!0,this.composerController=n,this.options=e;var t=n.renderer,r=n.renderPass,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new we(new d.Vector2(a,h),e.strength,e.radius,e.threshold);this.bloomPass=w;var P=new ee.EffectComposer(t);P.renderToScreen=!1,P.addPass(r),P.addPass(this.bloomPass),this.bloomComposer=P,this.bloomLayer.set(Ne);var y=new d.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:P.renderTarget2.texture}},vertexShader:We,fragmentShader:He,defines:{}}),_=new le.ShaderPass(y,"baseTexture");_.needsSwap=!0,this.finalPass=_,o.addPass(_)}var i=s.prototype;return i.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},i.render=function(e){if(!!this.active){var t=this,r=t.bloomComposer,o=t.bloomLayer,u=t.materials;e.traverse(function(a){var h=a;h.material&&o.test(h.layers)===!1&&(u[h.uuid]=h.material,h.material=h.isSprite?et:Je)}),r.render(),e.traverse(function(a){var h=a;u[h.uuid]&&(h.material=u[h.uuid],delete u[h.uuid])})}},i.setSize=function(e,t){this.bloomComposer.setSize(e,t)},i.setGui=function(e){var t=this,r=new c({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return t.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return t.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return t.bloomPass}}}});r.showGui(e)},i.dispose=function(){this.bloomPass.dispose(),this.materials={}},s}(),rt=require("three/examples/jsm/postprocessing/OutlinePass"),nt={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},it=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.finalComposer,u=n.getSize(),a=u.width,h=u.height,w=new rt.OutlinePass(new d.Vector2(a,h),t,r);w.selectedObjects=this.selectedObjects,this.outlinePass=w,o.addPass(w),this.setGui()}var i=s.prototype;return i.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},i.setGui=function(){var e=this,t=new c({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});t.setTargetValueByParams(),this.outlineGui=t},i.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},s}();function at(s,i){if(s==null)return{};var n={},e=Object.keys(s),t,r;for(r=0;r<e.length;r++)t=e[r],!(i.indexOf(t)>=0)&&(n[t]=s[t]);return n}function st(s,i){if(s==null)return{};var n=at(s,i),e,t;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);for(t=0;t<r.length;t++)e=r[t],!(i.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,e)||(n[e]=s[e]))}return n}var ot=require("three/examples/jsm/postprocessing/SSRPass"),ut=require("three/examples/jsm/objects/ReflectorForSSRPass"),lt={maxDistance:10,selects:!0},ct={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},ft=function(){"use strict";function s(n,e){R(this,s),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var t=n.scene,r=n.camera,o=n.renderer,u=n.finalComposer,a=n.getSize(),h=a.width,w=a.height,P=new ot.SSRPass({renderer:o,scene:t,camera:r,width:h,height:w,groundReflector:null,selects:this.selectedObjects});this.ssrPass=P,u.addPass(P),this.setGui()}var i=s.prototype;return i.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=(0,G.Z)({},ct,e),r=t.width,o=t.height,u=st(t,["width","height"]),a=this.composerController,h=a.scene,w=a.getSize(),P=new d.PlaneGeometry(r,o),y=new ut.ReflectorForSSRPass(P,E((0,G.Z)({},u),{textureWidth:w.width,textureHeight:w.height}));y.material.depthWrite=!1,y.rotation.x=-Math.PI/2,y.visible=!1,h.add(y),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=y},i.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},i.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},i.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},i.setSize=function(e,t){var r=this.groundReflector;r&&(r.getRenderTarget().setSize(e,t),r.resolution.set(e,t))},i.setGui=function(){var e=this,t=new c({ssr:{thickness:{value:.018,min:0,max:.1,step:1e-4,target:function(){return e.ssrPass}},infiniteThick:{value:!1,target:function(){return e.ssrPass}},fresnel:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},distanceAttenuation:{value:!0,target:function(){return[e.ssrPass,e.groundReflector]}},selects:{value:this.options.selects,onChange:function(r){r?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});t.setTargetValueByParams(),this.ssrGui=t},i.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},s}(),dt=function(){"use strict";function s(n){R(this,s),this.active=!0,this.options=n;var e=n.renderer,t=n.scene,r=n.camera,o=this.createRenderTarget(),u=new ee.EffectComposer(e,o);u.setPixelRatio(e.getPixelRatio()),this.finalComposer=u,this.addRenderPasss(),this.renderer=e,this.scene=t,this.renderTarget=o,this.camera=r}var i=s.prototype;return i.createRenderTarget=function(){var e=this.options.composerParams,t=e.multisampling,r=e.type,o=e.encoding,u=this.getSize(),a={minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:d.RGBAFormat,encoding:o,type:r},h;if(+d.REVISION<138&&t>0){var w=new d.WebGLMultisampleRenderTarget(u.width,u.height,a);w.samples=t,h=w}else if(+d.REVISION>=138&&t>0){var P=new d.WebGLRenderTarget(u.width,u.height,E((0,G.Z)({},a),{samples:t}));h=P}else{var y=new d.WebGLRenderTarget(u.width,u.height,a);h=y}return h.texture.name="EffectComposer.rt1",h},i.addRenderPasss=function(){var e=this.options,t=e.scene,r=e.camera,o=new pe.RenderPass(t,r);this.finalComposer.addPass(o),this.renderPass=o},i.addCopyPass=function(){var e=new le.ShaderPass(ue.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},i.addGammaCorrectionPass=function(){var e=new le.ShaderPass(Fe.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},i.addFXAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=new le.ShaderPass(Ie.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(t,r)},i.addSMAAPass=function(){var e=this.getSize(),t=e.width,r=e.height,o=this.options.renderer,u=new ke.SMAAPass(t*o.getPixelRatio(),r*o.getPixelRatio());this.finalComposer.addPass(u),this.smaaPass=u},i.addSSAAPass=function(){var e=this.options,t=e.scene,r=e.camera,o=new Ue.SSAARenderPass(t,r,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},i.addBloomPass=function(e){var t=new tt(this,e);t.disable(),this.options.gui&&t.setGui(this.options.gui),this.bloomController=t},i.addOutlinePass=function(e){var t=new it(this,e);t.disable(),this.options.gui&&t.outlineGui.showGui(this.options.gui),this.outlineController=t},i.addSSRPass=function(e){var t=new ft(this,e);t.disable(),this.options.gui&&t.ssrGui.showGui(this.options.gui),this.ssrController=t},i.getSize=function(){var e=this.options.renderer;return e.getSize(new d.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.checkCopyPass=function(){var e=this,t=this.finalComposer.passes.some(function(r){return r!==e.renderPass&&r!==e.copyPass?r.enabled:!1});t&&this.copyPass?this.copyPass.enabled=!1:!t&&this.copyPass?this.copyPass.enabled=!0:!t&&!this.copyPass&&this.addCopyPass()},i.setSize=function(e,t){var r,o;this.finalComposer.setSize(e,t),(r=this.bloomController)===null||r===void 0||r.setSize(e,t),(o=this.ssrController)===null||o===void 0||o.setSize(e,t),this.setFXAAPassSize(e,t)},i.setFXAAPassSize=function(e,t){if(!!this.fxaaPass){var r=this.options.renderer,o=r.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(t*o)}},i.render=function(){var e;if(!!this.active){var t=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(t),this.finalComposer.render()}},i.dispose=function(){var e,t,r;(e=this.bloomController)===null||e===void 0||e.dispose(),(t=this.outlineController)===null||t===void 0||t.dispose(),(r=this.ssrController)===null||r===void 0||r.dispose(),this.finalComposer.passes.forEach(function(o){var u,a,h;(u=o.fsQuad)===null||u===void 0||u.dispose(),(a=o.fsQuad)===null||a===void 0||(h=a.material)===null||h===void 0||h.dispose()}),this.renderTarget.dispose(),this.copyPass=void 0,this.gammaCorrectionPass=void 0,this.smaaPass=void 0,this.ssaaPass=void 0,this.fxaaPass=void 0,this.bloomController=void 0,this.outlineController=void 0,this.ssrController=void 0},s}(),Ce=function(){"use strict";function s(n){R(this,s),this.raycaster=new d.Raycaster,this.installPlugins=new Map,this.event=new se.EventEmitter,this.clock=new d.Clock,this.options=I()(s.options,n,{isMergeableObject:F.isPlainObject});var e=this.options,t=e.container,r=e.stats,o=e.gui;if(o){var u=new(f());u.open(!1),this.gui=u}if(r){var a=new(D());a.showPanel(0),a.dom.style.position="absolute",t.appendChild(a.dom),this.stats=a}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=s.prototype;return i.use=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var u;(u=e).install.apply(u,[this].concat(Q(r))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this,t=this.options,r=t.container,o=t.isdev,u=t.axesHelper,a=t.renderer,h=t.scene,w=t.camera,P=this.getSize(),y=P.width,_=P.height,M=new j({isdev:o,width:y,height:_,cameraParams:w});this.gui&&M.setGui(this.gui);var L=M.camera,Z=new de({camera:L,sceneParams:h}),V=Z.scene,ae=new S({width:y,height:_,scene:V,camera:L,isdev:o,rendererParams:E((0,G.Z)({},a),{outputEncoding:d.LinearEncoding,antialias:!1})});this.gui&&ae.setGui(this.gui);var U=ae.renderer;u&&Z.addAxesHelper(),this.sceneController=Z,this.rendererController=ae,this.cameraController=M,r.appendChild(U.domElement);var ne=new ResizeObserver(function(ce){var fe=!0,ye=!1,De=void 0;try{for(var xe=ce[Symbol.iterator](),ze;!(fe=(ze=xe.next()).done);fe=!0){var bt=ze.value,Ge=bt.contentRect;e.handeleResize(Ge.width,Ge.height)}}catch(yt){ye=!0,De=yt}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(ye)throw De}}});ne.observe(r),this.resizeObserver=ne},i.initComposer=function(){var e=this.options,t=e.bloom,r=e.outline,o=e.ssr,u=e.renderer,a=e.bloomParams,h=e.outlineParams,w=e.ssrParams,P=e.multisampling,y=u.antialias;y==="msaa"&&!Re&&(y=!1,console.warn("MSAA is not supported on this browser"));var _=new dt({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:y==="msaa"?P:0,type:d.UnsignedByteType,encoding:u.outputEncoding}});this.composerController=_,y==="ssaa"&&_.addSSAAPass(),o&&_.addSSRPass(w),t&&_.addBloomPass(a),r&&_.addOutlinePass(h),u.outputEncoding===d.sRGBEncoding&&_.addGammaCorrectionPass(),y==="fxaa"?_.addFXAAPass():y==="smaa"&&_.addSMAAPass(),_.checkCopyPass(),this.event.on("passcheck",function(){_.checkCopyPass()})},i.initCSSRenderer=function(){var e=this.options,t=e.container,r=e.css2DRenderer,o=e.css3DRenderer,u=e.css2DRendererParams,a=e.css3DRendererParams;if(r||o){var h=new re(t);r&&h.addRenderer("css2d",u),o&&h.addRenderer("css3d",a),this.cssRendererController=h}},i.initControl=function(){var e=this.options,t=e.control,r=e.mapControl,o=e.controlParams;if(t){var u=new ge({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:r});this.controlController=u}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.handeleResize=function(e,t){var r=this,o=r.rendererController,u=r.cameraController,a=r.composerController,h=r.cssRendererController;u==null||u.setSize(e,t),o==null||o.setSize(e,t),a==null||a.setSize(e,t),h==null||h.setSize(e,t),this.installPlugins.forEach(function(w,P){var y;(y=P.resize)===null||y===void 0||y.call(P,{width:e,height:t})}),this.event.emit("resize",{width:e,height:t})},i.pick=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,u=o.raycaster,a=o.options,h=a.container,w=new d.Vector2,P=h.getBoundingClientRect();if(w.x=(e.clientX-P.left)/(P.right-P.left)*2-1,w.y=-((e.clientY-P.top)/(P.bottom-P.top))*2+1,this.camera&&this.scene){u.setFromCamera(w,this.camera);var y=u.intersectObjects(t||this.scene.children,r);if(y.length)return{object:y[0].object,intersects:y}}},i.render=function(){var e,t,r,o,u=this,a=u.renderer,h=u.scene,w=u.camera,P=u.clock;if(!(!a||!h||!w||this.options.staticRender&&!this.cameraController.checkCameraChange())){var y=P.getDelta(),_=P.getElapsedTime();if(a.clear(),K().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(L,Z){var V;(V=Z.update)===null||V===void 0||V.call(Z,y,_)}),!((t=this.composerController)===null||t===void 0)&&t.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(r=this.cssRendererController)===null||r===void 0||r.render(h,w),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:y,elapsed:_})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,t,r,o,u,a,h;this.stop(),K().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(w,P){var y;(y=P.dispose)===null||y===void 0||y.call(P)}),(t=this.controlController)===null||t===void 0||t.dispose(),(r=this.cssRendererController)===null||r===void 0||r.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(u=this.composerController)===null||u===void 0||u.dispose(),(a=this.rendererController)===null||a===void 0||a.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(h=this.gui)===null||h===void 0||h.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},x(s,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),s}();Ce.options={isdev:ve,stats:ve,gui:ve,axesHelper:ve,control:ve,renderer:E((0,G.Z)({},b),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:oe,camera:A,bloom:!1,bloomParams:$e,outline:!1,outlineParams:nt,css2DRenderer:!1,ssr:!1,ssrParams:lt,css2DRendererParams:(0,G.Z)({},J),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},J)};function ht(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function be(s,i,n){return ht()?be=Reflect.construct:be=function(t,r,o){var u=[null];u.push.apply(u,r);var a=Function.bind.apply(t,u),h=new a;return o&&Me(h,o.prototype),h},be.apply(null,arguments)}function Le(s,i,n){return be.apply(null,arguments)}var pt=q(484);function vt(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),s&&(n.promise=(0,pt.Z)(n.promise,i)),n}var mt=require("three/examples/jsm/renderers/CSS2DRenderer"),Ae=function(s){s&&((0,F.disposeMesh)(s),s.children.forEach(function(i){i.userData.BaseObject_||Ae(i)}))},gt=function(){"use strict";function s(){R(this,s),this.objecttype__="BaseObject",this.userData={},this.pm=vt(),this.visible=!1}var i=s.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,t){},i.resize=function(e,t){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(d.Mesh,Q(t)),this},i.createGroup=function(){return this.object3d=new d.Group,this},i.createPoints=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.object3d=Le(d.Points,Q(t)),this},i.createCSS2DObject=function(e){return this.object3d=new mt.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new p.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new p.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new d.Sprite(e),this},i.add=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).add.apply(o,Q(t)),this},i.remove=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;return(o=this.object3d).remove.apply(o,Q(t)),this},i.getSize=function(){var e=new d.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new d.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(t){t.traverse(e)})},i.dispose=function(){Ae(this.object3d)},x(s,[{key:"parent",get:function(){var e=this.object3d.parent;return(e==null?void 0:e.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(e){return e.userData.BaseObject_}).filter(function(e){return!!e})}}]),s}()})(),module.exports=Pe})();
|
package/dist/objects/index.js
CHANGED
|
@@ -1,45 +1,6 @@
|
|
|
1
|
-
(function(){var nt={187:function(V){"use strict";var T=typeof Reflect=="object"?Reflect:null,d=T&&typeof T.apply=="function"?T.apply:function(m,x,R){return Function.prototype.apply.call(m,x,R)},E;T&&typeof T.ownKeys=="function"?E=T.ownKeys:Object.getOwnPropertySymbols?E=function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:E=function(m){return Object.getOwnPropertyNames(m)};function j(_){console&&console.warn&&console.warn(_)}var a=Number.isNaN||function(m){return m!==m};function p(){p.init.call(this)}V.exports=p,V.exports.once=N,p.EventEmitter=p,p.prototype._events=void 0,p.prototype._eventsCount=0,p.prototype._maxListeners=void 0;var A=10;function z(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return A},set:function(_){if(typeof _!="number"||_<0||a(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");A=_}}),p.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},p.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||a(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this};function B(_){return _._maxListeners===void 0?p.defaultMaxListeners:_._maxListeners}p.prototype.getMaxListeners=function(){return B(this)},p.prototype.emit=function(m){for(var x=[],R=1;R<arguments.length;R++)x.push(arguments[R]);var U=m==="error",H=this._events;if(H!==void 0)U=U&&H.error===void 0;else if(!U)return!1;if(U){var X;if(x.length>0&&(X=x[0]),X instanceof Error)throw X;var ie=new Error("Unhandled error."+(X?" ("+X.message+")":""));throw ie.context=X,ie}var pe=H[m];if(pe===void 0)return!1;if(typeof pe=="function")d(pe,this,x);else for(var xe=pe.length,me=se(pe,xe),R=0;R<xe;++R)d(me[R],this,x);return!0};function h(_,m,x,R){var U,H,X;if(z(x),H=_._events,H===void 0?(H=_._events=Object.create(null),_._eventsCount=0):(H.newListener!==void 0&&(_.emit("newListener",m,x.listener?x.listener:x),H=_._events),X=H[m]),X===void 0)X=H[m]=x,++_._eventsCount;else if(typeof X=="function"?X=H[m]=R?[x,X]:[X,x]:R?X.unshift(x):X.push(x),U=B(_),U>0&&X.length>U&&!X.warned){X.warned=!0;var ie=new Error("Possible EventEmitter memory leak detected. "+X.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit");ie.name="MaxListenersExceededWarning",ie.emitter=_,ie.type=m,ie.count=X.length,j(ie)}return _}p.prototype.addListener=function(m,x){return h(this,m,x,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(m,x){return h(this,m,x,!0)};function ee(){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 $(_,m,x){var R={fired:!1,wrapFn:void 0,target:_,type:m,listener:x},U=ee.bind(R);return U.listener=x,R.wrapFn=U,U}p.prototype.once=function(m,x){return z(x),this.on(m,$(this,m,x)),this},p.prototype.prependOnceListener=function(m,x){return z(x),this.prependListener(m,$(this,m,x)),this},p.prototype.removeListener=function(m,x){var R,U,H,X,ie;if(z(x),U=this._events,U===void 0)return this;if(R=U[m],R===void 0)return this;if(R===x||R.listener===x)--this._eventsCount===0?this._events=Object.create(null):(delete U[m],U.removeListener&&this.emit("removeListener",m,R.listener||x));else if(typeof R!="function"){for(H=-1,X=R.length-1;X>=0;X--)if(R[X]===x||R[X].listener===x){ie=R[X].listener,H=X;break}if(H<0)return this;H===0?R.shift():oe(R,H),R.length===1&&(U[m]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",m,ie||x)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(m){var x,R,U;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[m]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[m]),this;if(arguments.length===0){var H=Object.keys(R),X;for(U=0;U<H.length;++U)X=H[U],X!=="removeListener"&&this.removeAllListeners(X);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(x=R[m],typeof x=="function")this.removeListener(m,x);else if(x!==void 0)for(U=x.length-1;U>=0;U--)this.removeListener(m,x[U]);return this};function J(_,m,x){var R=_._events;if(R===void 0)return[];var U=R[m];return U===void 0?[]:typeof U=="function"?x?[U.listener||U]:[U]:x?K(U):se(U,U.length)}p.prototype.listeners=function(m){return J(this,m,!0)},p.prototype.rawListeners=function(m){return J(this,m,!1)},p.listenerCount=function(_,m){return typeof _.listenerCount=="function"?_.listenerCount(m):te.call(_,m)},p.prototype.listenerCount=te;function te(_){var m=this._events;if(m!==void 0){var x=m[_];if(typeof x=="function")return 1;if(x!==void 0)return x.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?E(this._events):[]};function se(_,m){for(var x=new Array(m),R=0;R<m;++R)x[R]=_[R];return x}function oe(_,m){for(;m+1<_.length;m++)_[m]=_[m+1];_.pop()}function K(_){for(var m=new Array(_.length),x=0;x<m.length;++x)m[x]=_[x].listener||_[x];return m}function N(_,m){return new Promise(function(x,R){function U(X){_.removeListener(m,H),R(X)}function H(){typeof _.removeListener=="function"&&_.removeListener("error",U),x([].slice.call(arguments))}k(_,m,H,{once:!0}),m!=="error"&&G(_,U,{once:!0})})}function G(_,m,x){typeof _.on=="function"&&k(_,"error",m,x)}function k(_,m,x,R){if(typeof _.on=="function")R.once?_.once(m,x):_.on(m,x);else if(typeof _.addEventListener=="function")_.addEventListener(m,function U(H){R.once&&_.removeEventListener(m,U),x(H)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}},666:function(V){var T=function(d){"use strict";var E=Object.prototype,j=E.hasOwnProperty,a,p=typeof Symbol=="function"?Symbol:{},A=p.iterator||"@@iterator",z=p.asyncIterator||"@@asyncIterator",B=p.toStringTag||"@@toStringTag";function h(O,S,D){return Object.defineProperty(O,S,{value:D,enumerable:!0,configurable:!0,writable:!0}),O[S]}try{h({},"")}catch(O){h=function(S,D,W){return S[D]=W}}function ee(O,S,D,W){var I=S&&S.prototype instanceof N?S:N,ae=Object.create(I.prototype),le=new me(W||[]);return ae._invoke=X(O,D,le),ae}d.wrap=ee;function $(O,S,D){try{return{type:"normal",arg:O.call(S,D)}}catch(W){return{type:"throw",arg:W}}}var J="suspendedStart",te="suspendedYield",se="executing",oe="completed",K={};function N(){}function G(){}function k(){}var _={};h(_,A,function(){return this});var m=Object.getPrototypeOf,x=m&&m(m(Ce([])));x&&x!==E&&j.call(x,A)&&(_=x);var R=k.prototype=N.prototype=Object.create(_);G.prototype=k,h(R,"constructor",k),h(k,"constructor",G),G.displayName=h(k,B,"GeneratorFunction");function U(O){["next","throw","return"].forEach(function(S){h(O,S,function(D){return this._invoke(S,D)})})}d.isGeneratorFunction=function(O){var S=typeof O=="function"&&O.constructor;return S?S===G||(S.displayName||S.name)==="GeneratorFunction":!1},d.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,k):(O.__proto__=k,h(O,B,"GeneratorFunction")),O.prototype=Object.create(R),O},d.awrap=function(O){return{__await:O}};function H(O,S){function D(ae,le,ue,fe){var he=$(O[ae],O,le);if(he.type==="throw")fe(he.arg);else{var ge=he.arg,Me=ge.value;return Me&&typeof Me=="object"&&j.call(Me,"__await")?S.resolve(Me.__await).then(function(we){D("next",we,ue,fe)},function(we){D("throw",we,ue,fe)}):S.resolve(Me).then(function(we){ge.value=we,ue(ge)},function(we){return D("throw",we,ue,fe)})}}var W;function I(ae,le){function ue(){return new S(function(fe,he){D(ae,le,fe,he)})}return W=W?W.then(ue,ue):ue()}this._invoke=I}U(H.prototype),h(H.prototype,z,function(){return this}),d.AsyncIterator=H,d.async=function(O,S,D,W,I){I===void 0&&(I=Promise);var ae=new H(ee(O,S,D,W),I);return d.isGeneratorFunction(S)?ae:ae.next().then(function(le){return le.done?le.value:ae.next()})};function X(O,S,D){var W=J;return function(ae,le){if(W===se)throw new Error("Generator is already running");if(W===oe){if(ae==="throw")throw le;return Re()}for(D.method=ae,D.arg=le;;){var ue=D.delegate;if(ue){var fe=ie(ue,D);if(fe){if(fe===K)continue;return fe}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(W===J)throw W=oe,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);W=se;var he=$(O,S,D);if(he.type==="normal"){if(W=D.done?oe:te,he.arg===K)continue;return{value:he.arg,done:D.done}}else he.type==="throw"&&(W=oe,D.method="throw",D.arg=he.arg)}}}function ie(O,S){var D=O.iterator[S.method];if(D===a){if(S.delegate=null,S.method==="throw"){if(O.iterator.return&&(S.method="return",S.arg=a,ie(O,S),S.method==="throw"))return K;S.method="throw",S.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var W=$(D,O.iterator,S.arg);if(W.type==="throw")return S.method="throw",S.arg=W.arg,S.delegate=null,K;var I=W.arg;if(!I)return S.method="throw",S.arg=new TypeError("iterator result is not an object"),S.delegate=null,K;if(I.done)S[O.resultName]=I.value,S.next=O.nextLoc,S.method!=="return"&&(S.method="next",S.arg=a);else return I;return S.delegate=null,K}U(R),h(R,B,"Generator"),h(R,A,function(){return this}),h(R,"toString",function(){return"[object Generator]"});function pe(O){var S={tryLoc:O[0]};1 in O&&(S.catchLoc=O[1]),2 in O&&(S.finallyLoc=O[2],S.afterLoc=O[3]),this.tryEntries.push(S)}function xe(O){var S=O.completion||{};S.type="normal",delete S.arg,O.completion=S}function me(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(pe,this),this.reset(!0)}d.keys=function(O){var S=[];for(var D in O)S.push(D);return S.reverse(),function W(){for(;S.length;){var I=S.pop();if(I in O)return W.value=I,W.done=!1,W}return W.done=!0,W}};function Ce(O){if(O){var S=O[A];if(S)return S.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var D=-1,W=function I(){for(;++D<O.length;)if(j.call(O,D))return I.value=O[D],I.done=!1,I;return I.value=a,I.done=!0,I};return W.next=W}}return{next:Re}}d.values=Ce;function Re(){return{value:a,done:!0}}return me.prototype={constructor:me,reset:function(O){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(xe),!O)for(var S in this)S.charAt(0)==="t"&&j.call(this,S)&&!isNaN(+S.slice(1))&&(this[S]=a)},stop:function(){this.done=!0;var O=this.tryEntries[0],S=O.completion;if(S.type==="throw")throw S.arg;return this.rval},dispatchException:function(O){if(this.done)throw O;var S=this;function D(fe,he){return ae.type="throw",ae.arg=O,S.next=fe,he&&(S.method="next",S.arg=a),!!he}for(var W=this.tryEntries.length-1;W>=0;--W){var I=this.tryEntries[W],ae=I.completion;if(I.tryLoc==="root")return D("end");if(I.tryLoc<=this.prev){var le=j.call(I,"catchLoc"),ue=j.call(I,"finallyLoc");if(le&&ue){if(this.prev<I.catchLoc)return D(I.catchLoc,!0);if(this.prev<I.finallyLoc)return D(I.finallyLoc)}else if(le){if(this.prev<I.catchLoc)return D(I.catchLoc,!0)}else if(ue){if(this.prev<I.finallyLoc)return D(I.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(O,S){for(var D=this.tryEntries.length-1;D>=0;--D){var W=this.tryEntries[D];if(W.tryLoc<=this.prev&&j.call(W,"finallyLoc")&&this.prev<W.finallyLoc){var I=W;break}}I&&(O==="break"||O==="continue")&&I.tryLoc<=S&&S<=I.finallyLoc&&(I=null);var ae=I?I.completion:{};return ae.type=O,ae.arg=S,I?(this.method="next",this.next=I.finallyLoc,K):this.complete(ae)},complete:function(O,S){if(O.type==="throw")throw O.arg;return O.type==="break"||O.type==="continue"?this.next=O.arg:O.type==="return"?(this.rval=this.arg=O.arg,this.method="return",this.next="end"):O.type==="normal"&&S&&(this.next=S),K},finish:function(O){for(var S=this.tryEntries.length-1;S>=0;--S){var D=this.tryEntries[S];if(D.finallyLoc===O)return this.complete(D.completion,D.afterLoc),xe(D),K}},catch:function(O){for(var S=this.tryEntries.length-1;S>=0;--S){var D=this.tryEntries[S];if(D.tryLoc===O){var W=D.completion;if(W.type==="throw"){var I=W.arg;xe(D)}return I}}throw new Error("illegal catch attempt")},delegateYield:function(O,S,D){return this.delegate={iterator:Ce(O),resultName:S,nextLoc:D},this.method==="next"&&(this.arg=a),K}},d}(V.exports);try{regeneratorRuntime=T}catch(d){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},701:function(V,T,d){"use strict";d.d(T,{ZP:function(){return oe}});var E=d(438),j=d(998);function a(){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(K){return!1}}function p(K,N,G){return a()?p=Reflect.construct:p=function(_,m,x){var R=[null];R.push.apply(R,m);var U=Function.bind.apply(_,R),H=new U;return x&&(0,j.Z)(H,x.prototype),H},p.apply(null,arguments)}function A(K,N,G){return p.apply(null,arguments)}var z=d(951),B=d(342),h=d(644),ee=d(282),$=require("three/examples/jsm/renderers/CSS2DRenderer"),J=d(530),te=d(519),se=function(K){K&&((0,te.disposeMesh)(K),K.children.forEach(function(N){N.userData.BaseObject_||se(N)}))},oe=function(){"use strict";function K(){(0,E.Z)(this,K),this.objecttype__="BaseObject",this.userData={},this.pm=(0,ee.Z)(),this.visible=!1}var N=K.prototype;return N.init=function(){},N.create=function(){},N.render=function(){},N.update=function(k,_){},N.resize=function(k,_){},N.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},N.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},N.isVisible=function(){return this.visible},N.createMesh=function(){for(var k=arguments.length,_=new Array(k),m=0;m<k;m++)_[m]=arguments[m];return this.object3d=A(h.Mesh,(0,B.Z)(_)),this},N.createGroup=function(){return this.object3d=new h.Group,this},N.createPoints=function(){for(var k=arguments.length,_=new Array(k),m=0;m<k;m++)_[m]=arguments[m];return this.object3d=A(h.Points,(0,B.Z)(_)),this},N.createCSS2DObject=function(k){return this.object3d=new $.CSS2DObject(k),this},N.createCSS3DObject=function(k){return this.object3d=new J.CSS3DObject(k),this},N.createCSS3DSprite=function(k){return this.object3d=new J.CSS3DSprite(k),this},N.createSprite=function(k){return this.object3d=new h.Sprite(k),this},N.add=function(){for(var k=arguments.length,_=new Array(k),m=0;m<k;m++)_[m]=arguments[m];var x;return(x=this.object3d).add.apply(x,(0,B.Z)(_)),this},N.remove=function(){for(var k=arguments.length,_=new Array(k),m=0;m<k;m++)_[m]=arguments[m];var x;return(x=this.object3d).remove.apply(x,(0,B.Z)(_)),this},N.getSize=function(){var k=new h.Box3().setFromObject(this.object3d);return{min:k.min,max:k.max,size:k.getSize(new h.Vector3)}},N.traverse=function(k){k(this),this.children.forEach(function(_){_.traverse(k)})},N.dispose=function(){se(this.object3d)},(0,z.Z)(K,[{key:"parent",get:function(){var k=this.object3d.parent;return(k==null?void 0:k.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(k){return k.userData.BaseObject_}).filter(function(k){return!!k})}}]),K}()},896:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});var E=d(438),j=function(){"use strict";function a(A){(0,E.Z)(this,a),this.guiParams={},A&&(this.guiParams=A)}var p=a.prototype;return p.showGui=function(z){var B=this;!z||Object.keys(this.guiParams).forEach(function(h){var ee=z.addFolder(h),$=B.guiParams[h];Object.keys($).forEach(function(J){var te=$[J],se=te.min,oe=te.max,K=te.step,N=te.name,G=te.paramMap,k=te.items,_=te.value,m=te.target,x=J.toLowerCase().indexOf("color")>-1,R,U=typeof _=="undefined"&&m,H=U?m():$[J],X=U?J:"value";k?R=ee.add(H,X,k):x?R=ee.addColor(H,X):R=ee.add(H,X),R=R.name(N||J),typeof se!="undefined"&&(R=R.min(se)),typeof oe!="undefined"&&(R=R.max(oe)),typeof K!="undefined"&&(R=R.step(K)),R=R.onChange(function(){B.setTargetValue(h,J,H[X],G)}),U&&R.listen()})})},p.setTargetValue=function(z,B,h,ee){var $=this.guiParams[z][B],J=$.onChange,te=$.target,se=$.value,oe=B.toLowerCase().indexOf("color")>-1,K=typeof se=="undefined"&&te;if(te&&!K){var N=te();Array.isArray(N)||(N=[N]),N.forEach(function(G){if(!!G)if(oe)try{G[ee||B].set(h)}catch(k){B!=="color"&&!ee&&console.warn("".concat(B," is not a color,set paramMap"))}else G[ee||B]=h})}J&&J(h)},p.setTargetValueByParams=function(){var z=this;Object.keys(this.guiParams).forEach(function(B){Object.keys(z.guiParams[B]).forEach(function(h){var ee=z.guiParams[B][h];typeof ee.value!="undefined"&&z.setTargetValue(B,h,ee.value,ee.paramMap)})})},a}()},639:function(V,T,d){"use strict";d.d(T,{BaseObject:function(){return C.ZP}});var E=d(438),j=d(951),a=d(42),p=d(396),A=d(342),z=d(494),B=d.n(z),h=d(644),ee=d(187),$=require("deepmerge"),J=d.n($),te=require("three/examples/jsm/libs/stats.module"),se=d.n(te),oe=require("lil-gui"),K=d.n(oe),N=d(896),G={None:h.NoToneMapping,Linear:h.LinearToneMapping,Reinhard:h.ReinhardToneMapping,Cineon:h.CineonToneMapping,ACESFilmic:h.ACESFilmicToneMapping},k={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:h.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},_=function(){"use strict";function v(s){(0,E.Z)(this,v),this.options=s;var e=s.width,r=s.height,n=s.rendererParams,o=n.alpha,c=n.devicePixelRatio,t=n.antialias,P=n.powerPreference,L=n.toneMapping,Z=n.toneMappingExposure,M=n.outputEncoding,F=n.logarithmicDepthBuffer,Y=n.preserveDrawingBuffer,Q=new h.WebGLRenderer({alpha:o,antialias:t,powerPreference:P,logarithmicDepthBuffer:F,preserveDrawingBuffer:Y});Q.setSize(e,r),Q.setPixelRatio(c),Q.autoClear=!1,Q.toneMapping=G[L],Q.toneMappingExposure=Z,Q.outputEncoding=M,this.renderer=Q}var f=v.prototype;return f.setSize=function(e,r){this.renderer.setSize(e,r)},f.render=function(){var e=this.options,r=e.scene,n=e.camera;this.renderer.render(r,n)},f.setGui=function(e){var r=this,n=new N.Z({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:G,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});n.showGui(e)},f.dispose=function(){var e,r,n;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(n=this.renderer)===null||n===void 0||n.renderLists.dispose()},v}(),m={fov:45,near:1,far:1e3},x=function(){"use strict";function v(s){(0,E.Z)(this,v),this.oldCameraPosition=new h.Vector3,this.oldCameraRotation=new h.Euler,this.customCamera=!1,this.options=s;var e=s.width,r=s.height,n=s.cameraParams;if(n instanceof h.Camera)this.camera=n,this.customCamera=!0;else{var o=n.fov,c=n.far,t=n.near,P=new h.PerspectiveCamera(o,e/r,t,c);P.position.set(0,0,400),P.lookAt(0,0,0),this.camera=P}}var f=v.prototype;return f.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},f.setSize=function(e,r){this.camera instanceof h.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},f.setGui=function(e){var r=this,n=new N.Z({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}}});this.camera instanceof h.PerspectiveCamera&&(n.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(o){r.camera.updateProjectionMatrix()}}),n.showGui(e)},v}(),R=d(519),U={background:null},H=function(){"use strict";function v(s){(0,E.Z)(this,v),this.options=s;var e=s.camera,r=s.sceneParams,n=r.background,o=new h.Scene;n&&(o.background=n),o.add(e),this.scene=o}var f=v.prototype;return f.addAxesHelper=function(){var e,r=new h.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},f.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,R.disposeMesh)(r)})},v}(),X=require("three/examples/jsm/controls/OrbitControls"),ie={},pe=function(){"use strict";function v(s){(0,E.Z)(this,v),this.options=s;var e=s.camera,r=s.controlParams,n=s.mapControl,o=r.domElement,c=n?new X.MapControls(e,o):new X.OrbitControls(e,o);c.minPolarAngle=Math.PI*.15,c.maxPolarAngle=Math.PI*.85,c.enableDamping=!0,c.dampingFactor=.063,c.autoRotate=!1,c.autoRotateSpeed=-60,c.enableZoom=!0,c.zoomSpeed=.2,this.control=c}var f=v.prototype;return f.limitPan=function(e){var r=e.maxX,n=r===void 0?1/0:r,o=e.minX,c=o===void 0?-1/0:o,t=e.maxZ,P=t===void 0?1/0:t,L=e.minZ,Z=L===void 0?-1/0:L,M=e.maxY,F=M===void 0?1/0:M,Y=e.minY,Q=Y===void 0?-1/0:Y,ne=this.limitPanV||new h.Vector3,re=this.control,de=this.options.camera,ce=new h.Vector3(c,Q,Z),ye=new h.Vector3(n,F,P);this.limitPanV=ne,ne.copy(re.target),re.target.clamp(ce,ye),ne.sub(re.target),de.position.sub(ne)},f.update=function(){this.control.update()},f.dispose=function(){this.control.dispose()},v}(),xe=d(530),me=new h.Vector3,Ce=new h.Matrix4,Re=new h.Matrix4,O=new h.Vector3,S=new h.Vector3,D=function v(){"use strict";var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,E.Z)(this,v);var s=function(Y,Q){return O.setFromMatrixPosition(Y.matrixWorld),S.setFromMatrixPosition(Q.matrixWorld),O.distanceToSquared(S)},e=function(Y){var Q=[];return Y.traverse(function(ne){ne.isCSS2DObject&&Q.push(ne)}),Q},r=function(Y){for(var Q=e(Y).sort(function(ye,je){if(ye.renderOrder!==je.renderOrder)return je.renderOrder-ye.renderOrder;var Le=L.objects.get(ye).distanceToCameraSquared,ze=L.objects.get(je).distanceToCameraSquared;return Le-ze}),ne=Q.length,re=0,de=Q.length;re<de;re++){var ce=Q[re].userData.zIndexFix||0;Q[re].element.style.zIndex=ne-re+ce}},n=this,o,c,t,P,L={objects:new WeakMap},Z=f.element!==void 0?f.element:document.createElement("div");Z.style.overflow="hidden",this.domElement=Z,this.getSize=function(){return{width:o,height:c}},this.render=function(F,Y){F.autoUpdate===!0&&F.updateMatrixWorld(),Y.parent===null&&Y.updateMatrixWorld(),Ce.copy(Y.matrixWorldInverse),Re.multiplyMatrices(Y.projectionMatrix,Ce),M(F,F,Y),r(F)},this.setSize=function(F,Y){o=F,c=Y,t=o/2,P=c/2,Z.style.width="".concat(F,"px"),Z.style.height="".concat(Y,"px")};function M(F,Y,Q){if(F.isCSS2DObject){me.setFromMatrixPosition(F.matrixWorld),me.applyMatrix4(Re);var ne=F.visible===!0&&me.z>=-1&&me.z<=1&&F.layers.test(Q.layers)===!0;if(F.element.style.display=ne===!0?"":"none",ne===!0){F.onBeforeRender(n,Y,Q);var re=F.element;re.style.transform="translate(-50%,-50%) translate(".concat(me.x*t+t,"px,").concat(-me.y*P+P,"px)"),re.parentNode!==Z&&Z.appendChild(re),F.onAfterRender(n,Y,Q)}var de={distanceToCameraSquared:s(Q,F)};L.objects.set(F,de)}for(var ce=0,ye=F.children.length;ce<ye;ce++)M(F.children[ce],Y,Q)}},W={zIndex:"auto"},I=function(){"use strict";function v(s){(0,E.Z)(this,v),this.container=s}var f=v.prototype;return f.addRenderer=function(e,r){var n=this.container,o=n.offsetWidth,c=n.offsetHeight,t=e==="css2d"?new D:new xe.CSS3DRenderer;t.domElement.style.position="absolute",t.domElement.style.top="0",t.domElement.style.pointerEvents="none",t.domElement.style.zIndex=r.zIndex,t.setSize(o,c),n.appendChild(t.domElement),e==="css2d"?this.css2Drenderer=t:e==="css3d"&&(this.css3Drenderer=t)},f.setSize=function(e,r){var n,o;(n=this.css2Drenderer)===null||n===void 0||n.setSize(e,r),(o=this.css3Drenderer)===null||o===void 0||o.setSize(e,r)},f.render=function(e,r){var n,o;(n=this.css2Drenderer)===null||n===void 0||n.render(e,r),(o=this.css3Drenderer)===null||o===void 0||o.render(e,r)},f.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},v}(),ae=require("three/examples/jsm/postprocessing/EffectComposer"),le=require("three/examples/jsm/postprocessing/RenderPass"),ue=require("three/examples/jsm/postprocessing/ShaderPass"),fe=require("three/examples/jsm/shaders/CopyShader"),he=require("three/examples/jsm/shaders/GammaCorrectionShader"),ge=require("three/examples/jsm/postprocessing/SMAAPass"),Me=require("three/examples/jsm/postprocessing/SSAARenderPass"),we=require("three/examples/jsm/shaders/FXAAShader"),Ne=function(){try{var v=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&v.getContext("webgl2"))}catch(f){return!1}},tt=0,Ae=1,Te=!1,Be=Ne()!==!1,He=d.p+"static/media/vertex.cc08e9108dec6da9504a.glsl",Xe=d.p+"static/media/fragment.2913fac3481dac4d4a06.glsl",De=d(668),Ke=d(485),Ve=require("three/examples/jsm/postprocessing/Pass"),Fe=require("three/examples/jsm/shaders/LuminosityHighPassShader"),Ze=function(v){"use strict";(0,De.Z)(s,v);var f=(0,Ke.Z)(s);function s(r,n,o,c){(0,E.Z)(this,s);var t;t=f.call(this),t.strength=n!==void 0?n:1,t.radius=o,t.threshold=c,t.resolution=r!==void 0?new h.Vector2(r.x,r.y):new h.Vector2(256,256),t.clearColor=new h.Color(0,0,0);var P={minFilter:h.LinearFilter,magFilter:h.LinearFilter,format:h.RGBAFormat};t.renderTargetsHorizontal=[],t.renderTargetsVertical=[],t.nMips=5;var L=Math.round(t.resolution.x/2),Z=Math.round(t.resolution.y/2);t.renderTargetBright=new h.WebGLRenderTarget(L,Z,P),t.renderTargetBright.texture.name="UnrealBloomPass.bright",t.renderTargetBright.texture.generateMipmaps=!1;for(var M=0;M<t.nMips;M++){var F=new h.WebGLRenderTarget(L,Z,P);F.texture.name="UnrealBloomPass.h".concat(M),F.texture.generateMipmaps=!1,t.renderTargetsHorizontal.push(F);var Y=new h.WebGLRenderTarget(L,Z,P);Y.texture.name="UnrealBloomPass.v".concat(M),Y.texture.generateMipmaps=!1,t.renderTargetsVertical.push(Y),L=Math.round(L/2),Z=Math.round(Z/2)}Fe.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var Q=Fe.LuminosityHighPassShader;t.highPassUniforms=h.UniformsUtils.clone(Q.uniforms),t.highPassUniforms.luminosityThreshold.value=c,t.highPassUniforms.smoothWidth.value=.01,t.materialHighPassFilter=new h.ShaderMaterial({uniforms:t.highPassUniforms,vertexShader:Q.vertexShader,fragmentShader:Q.fragmentShader,defines:{}}),t.separableBlurMaterials=[];var ne=[3,5,7,9,11];L=Math.round(t.resolution.x/2),Z=Math.round(t.resolution.y/2);for(var re=0;re<t.nMips;re++)t.separableBlurMaterials.push(t.getSeperableBlurMaterial(ne[re])),t.separableBlurMaterials[re].uniforms.texSize.value=new h.Vector2(L,Z),L=Math.round(L/2),Z=Math.round(Z/2);t.compositeMaterial=t.getCompositeMaterial(t.nMips),t.compositeMaterial.uniforms.blurTexture1.value=t.renderTargetsVertical[0].texture,t.compositeMaterial.uniforms.blurTexture2.value=t.renderTargetsVertical[1].texture,t.compositeMaterial.uniforms.blurTexture3.value=t.renderTargetsVertical[2].texture,t.compositeMaterial.uniforms.blurTexture4.value=t.renderTargetsVertical[3].texture,t.compositeMaterial.uniforms.blurTexture5.value=t.renderTargetsVertical[4].texture,t.compositeMaterial.uniforms.bloomStrength.value=n,t.compositeMaterial.uniforms.bloomRadius.value=.1,t.compositeMaterial.needsUpdate=!0;var de=[1,.8,.6,.4,.2];t.compositeMaterial.uniforms.bloomFactors.value=de,t.bloomTintColors=[new h.Vector3(1,1,1),new h.Vector3(1,1,1),new h.Vector3(1,1,1),new h.Vector3(1,1,1),new h.Vector3(1,1,1)],t.compositeMaterial.uniforms.bloomTintColors.value=t.bloomTintColors,fe.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var ce=fe.CopyShader;return t.copyUniforms=h.UniformsUtils.clone(ce.uniforms),t.copyUniforms.opacity.value=1,t.materialCopy=new h.ShaderMaterial({uniforms:t.copyUniforms,vertexShader:ce.vertexShader,fragmentShader:ce.fragmentShader,blending:h.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),t.enabled=!0,t.needsSwap=!1,t._oldClearColor=new h.Color,t.oldClearAlpha=1,t.basic=new h.MeshBasicMaterial,t.fsQuad=new Ve.FullScreenQuad(void 0),t}var e=s.prototype;return e.dispose=function(){for(var n=0;n<this.renderTargetsHorizontal.length;n++)this.renderTargetsHorizontal[n].dispose();for(var o=0;o<this.renderTargetsVertical.length;o++)this.renderTargetsVertical[o].dispose();this.renderTargetBright.dispose()},e.setSize=function(n,o){var c=Math.round(n/2),t=Math.round(o/2);this.renderTargetBright.setSize(c,t);for(var P=0;P<this.nMips;P++)this.renderTargetsHorizontal[P].setSize(c,t),this.renderTargetsVertical[P].setSize(c,t),this.separableBlurMaterials[P].uniforms.texSize.value=new h.Vector2(c,t),c=Math.round(c/2),t=Math.round(t/2)},e.render=function(n,o,c,t,P){n.getClearColor(this._oldClearColor),this.oldClearAlpha=n.getClearAlpha();var L=n.autoClear;n.autoClear=!1,n.setClearColor(this.clearColor,0),P&&n.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=c.texture,n.setRenderTarget(null),n.clear(),this.fsQuad.render(n)),this.highPassUniforms.tDiffuse.value=c.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,n.setRenderTarget(this.renderTargetBright),n.clear(),this.fsQuad.render(n);for(var Z=this.renderTargetBright,M=0;M<this.nMips;M++)this.fsQuad.material=this.separableBlurMaterials[M],this.separableBlurMaterials[M].uniforms.colorTexture.value=Z.texture,this.separableBlurMaterials[M].uniforms.direction.value=s.BlurDirectionX,n.setRenderTarget(this.renderTargetsHorizontal[M]),n.clear(),this.fsQuad.render(n),this.separableBlurMaterials[M].uniforms.colorTexture.value=this.renderTargetsHorizontal[M].texture,this.separableBlurMaterials[M].uniforms.direction.value=s.BlurDirectionY,n.setRenderTarget(this.renderTargetsVertical[M]),n.clear(),this.fsQuad.render(n),Z=this.renderTargetsVertical[M];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,n.setRenderTarget(this.renderTargetsHorizontal[0]),n.clear(),this.fsQuad.render(n),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,P&&n.state.buffers.stencil.setTest(!0),this.renderToScreen?(n.setRenderTarget(null),this.fsQuad.render(n)):(n.setRenderTarget(c),this.fsQuad.render(n)),n.setClearColor(this._oldClearColor,this.oldClearAlpha),n.autoClear=L},e.getSeperableBlurMaterial=function(n){return new h.ShaderMaterial({defines:{KERNEL_RADIUS:n,SIGMA:n},uniforms:{colorTexture:{value:null},texSize:{value:new h.Vector2(.5,.5)},direction:{value:new h.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
5
|
-
}`,fragmentShader:`#include <common>
|
|
6
|
-
varying vec2 vUv;
|
|
7
|
-
uniform sampler2D colorTexture;
|
|
8
|
-
uniform vec2 texSize;
|
|
9
|
-
uniform vec2 direction;
|
|
10
|
-
float gaussianPdf(in float x, in float sigma) {
|
|
11
|
-
return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;
|
|
12
|
-
}
|
|
13
|
-
void main() {
|
|
14
|
-
vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);
|
|
15
|
-
}`})},e.getCompositeMaterial=function(n){return new h.ShaderMaterial({defines:{NUM_MIPS:n},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv;
|
|
16
|
-
void main() {
|
|
17
|
-
vUv = uv;
|
|
18
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
19
|
-
}`,fragmentShader:`varying vec2 vUv;
|
|
20
|
-
uniform sampler2D blurTexture1;
|
|
21
|
-
uniform sampler2D blurTexture2;
|
|
22
|
-
uniform sampler2D blurTexture3;
|
|
23
|
-
uniform sampler2D blurTexture4;
|
|
24
|
-
uniform sampler2D blurTexture5;
|
|
25
|
-
uniform sampler2D dirtTexture;
|
|
26
|
-
uniform float bloomStrength;
|
|
27
|
-
uniform float bloomRadius;
|
|
28
|
-
uniform float bloomFactors[NUM_MIPS];
|
|
29
|
-
uniform vec3 bloomTintColors[NUM_MIPS];
|
|
30
|
-
float lerpBloomFactor(const in float factor) {
|
|
31
|
-
float mirrorFactor = 1.2 - factor;
|
|
32
|
-
return mix(factor, mirrorFactor, bloomRadius);
|
|
33
|
-
}
|
|
34
|
-
void main() {
|
|
35
|
-
gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +
|
|
36
|
-
lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +
|
|
37
|
-
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
38
|
-
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
39
|
-
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
40
|
-
}`})},s}(Ve.Pass);Ze.BlurDirectionX=new h.Vector2(1,0),Ze.BlurDirectionY=new h.Vector2(0,1);var ke={threshold:.2,strength:.5,radius:0},Ue=new h.MeshBasicMaterial({color:"black"}),We=new h.SpriteMaterial({color:"#000"}),Ye=function(){"use strict";function v(s,e){(0,E.Z)(this,v),this.materials={},this.bloomLayer=new h.Layers,this.active=!0,this.composerController=s,this.options=e;var r=s.renderer,n=s.renderPass,o=s.finalComposer,c=s.getSize(),t=c.width,P=c.height,L=new Ze(new h.Vector2(t,P),e.strength,e.radius,e.threshold);this.bloomPass=L;var Z=new ae.EffectComposer(r);Z.renderToScreen=!1,Z.addPass(n),Z.addPass(this.bloomPass),this.bloomComposer=Z,this.bloomLayer.set(Ae);var M=new h.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:Z.renderTarget2.texture}},vertexShader:He,fragmentShader:Xe,defines:{}}),F=new ue.ShaderPass(M,"baseTexture");F.needsSwap=!0,this.finalPass=F,o.addPass(F)}var f=v.prototype;return f.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},f.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},f.render=function(e){if(!!this.active){var r=this,n=r.bloomComposer,o=r.bloomLayer,c=r.materials;e.traverse(function(t){var P=t;P.material&&o.test(P.layers)===!1&&(c[P.uuid]=P.material,P.material=P.isSprite?We:Ue)}),n.render(),e.traverse(function(t){var P=t;c[P.uuid]&&(P.material=c[P.uuid],delete c[P.uuid])})}},f.setSize=function(e,r){this.bloomComposer.setSize(e,r)},f.setGui=function(e){var r=this,n=new N.Z({bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}});n.showGui(e)},f.dispose=function(){this.bloomPass.dispose(),this.materials={}},v}(),Qe=require("three/examples/jsm/postprocessing/OutlinePass"),Ge={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},$e=function(){"use strict";function v(s,e){(0,E.Z)(this,v),this.selectedObjects=[],this.active=!0,this.composerController=s,this.options=e;var r=s.scene,n=s.camera,o=s.finalComposer,c=s.getSize(),t=c.width,P=c.height,L=new Qe.OutlinePass(new h.Vector2(t,P),r,n);L.selectedObjects=this.selectedObjects,this.outlinePass=L,o.addPass(L),this.setGui()}var f=v.prototype;return f.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},f.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},f.setGui=function(){var e=this,r=new N.Z({outline:{edgeStrength:{value:this.options.edgeStrength,min:.01,max:10,step:.01,target:function(){return e.outlinePass}},edgeGlow:{value:this.options.edgeGlow,min:0,max:10,step:.01,target:function(){return e.outlinePass}},edgeThickness:{value:this.options.edgeThickness,min:0,max:4,step:.01,target:function(){return e.outlinePass}},pulsePeriod:{value:this.options.pulsePeriod,min:0,max:4,step:.01,target:function(){return e.outlinePass}},usePatternTexture:{value:this.options.usePatternTexture,target:function(){return e.outlinePass}},visibleEdgeColor:{value:this.options.visibleEdgeColor,target:function(){return e.outlinePass}},hiddenEdgeColor:{value:this.options.hiddenEdgeColor,target:function(){return e.outlinePass}}}});r.setTargetValueByParams(),this.outlineGui=r},f.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},v}(),Je=d(607),l=require("three/examples/jsm/postprocessing/SSRPass"),w=require("three/examples/jsm/objects/ReflectorForSSRPass"),u={maxDistance:10,selects:!0},g={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},b=function(){"use strict";function v(s,e){(0,E.Z)(this,v),this.selectedObjects=[],this.active=!0,this.composerController=s,this.options=e;var r=s.scene,n=s.camera,o=s.renderer,c=s.finalComposer,t=s.getSize(),P=t.width,L=t.height,Z=new l.SSRPass({renderer:o,scene:r,camera:n,width:P,height:L,groundReflector:null,selects:this.selectedObjects});this.ssrPass=Z,c.addPass(Z),this.setGui()}var f=v.prototype;return f.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,a.Z)({},g,e),n=r.width,o=r.height,c=(0,Je.Z)(r,["width","height"]),t=this.composerController,P=t.scene,L=t.getSize(),Z=new h.PlaneGeometry(n,o),M=new w.ReflectorForSSRPass(Z,(0,p.Z)((0,a.Z)({},c),{textureWidth:L.width,textureHeight:L.height}));M.material.depthWrite=!1,M.rotation.x=-Math.PI/2,M.visible=!1,P.add(M),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=M},f.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},f.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},f.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},f.setSize=function(e,r){var n=this.groundReflector;n&&(n.getRenderTarget().setSize(e,r),n.resolution.set(e,r))},f.setGui=function(){var e=this,r=new N.Z({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(n){n?e.ssrPass.selects=e.selectedObjects:e.ssrPass.selects=null}},maxDistance:{value:this.options.maxDistance,min:0,max:100,step:.001,target:function(){return[e.ssrPass,e.groundReflector]}},opacity:{value:1,min:0,max:1,step:.01,target:function(){return[e.ssrPass,e.groundReflector]}}}});r.setTargetValueByParams(),this.ssrGui=r},f.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},v}(),i=function(){"use strict";function v(s){(0,E.Z)(this,v),this.active=!0,this.options=s;var e=s.renderer,r=s.scene,n=s.camera,o=this.createRenderTarget(),c=new ae.EffectComposer(e,o);c.setPixelRatio(e.getPixelRatio()),this.finalComposer=c,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=o,this.camera=n}var f=v.prototype;return f.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,n=e.type,o=e.encoding,c=this.getSize(),t={minFilter:h.LinearFilter,magFilter:h.LinearFilter,format:h.RGBAFormat,encoding:o,type:n},P;if(+h.REVISION<138&&r>0){var L=new h.WebGLMultisampleRenderTarget(c.width,c.height,t);L.samples=r,P=L}else if(+h.REVISION>=138&&r>0){var Z=new h.WebGLRenderTarget(c.width,c.height,(0,p.Z)((0,a.Z)({},t),{samples:r}));P=Z}else{var M=new h.WebGLRenderTarget(c.width,c.height,t);P=M}return P.texture.name="EffectComposer.rt1",P},f.addRenderPasss=function(){var e=this.options,r=e.scene,n=e.camera,o=new le.RenderPass(r,n);this.finalComposer.addPass(o),this.renderPass=o},f.addCopyPass=function(){var e=new ue.ShaderPass(fe.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},f.addGammaCorrectionPass=function(){var e=new ue.ShaderPass(he.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},f.addFXAAPass=function(){var e=this.getSize(),r=e.width,n=e.height,o=new ue.ShaderPass(we.FXAAShader);this.finalComposer.addPass(o),this.fxaaPass=o,this.setFXAAPassSize(r,n)},f.addSMAAPass=function(){var e=this.getSize(),r=e.width,n=e.height,o=this.options.renderer,c=new ge.SMAAPass(r*o.getPixelRatio(),n*o.getPixelRatio());this.finalComposer.addPass(c),this.smaaPass=c},f.addSSAAPass=function(){var e=this.options,r=e.scene,n=e.camera,o=new Me.SSAARenderPass(r,n,0,0);o.unbiased=!0,o.sampleLevel=1,this.finalComposer.addPass(o),this.ssaaPass=o},f.addBloomPass=function(e){var r=new Ye(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},f.addOutlinePass=function(e){var r=new $e(this,e);r.disable(),this.options.gui&&r.outlineGui.showGui(this.options.gui),this.outlineController=r},f.addSSRPass=function(e){var r=new b(this,e);r.disable(),this.options.gui&&r.ssrGui.showGui(this.options.gui),this.ssrController=r},f.getSize=function(){var e=this.options.renderer;return e.getSize(new h.Vector2)},f.enable=function(){this.active||(this.active=!0)},f.disable=function(){!this.active||(this.active=!1)},f.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(n){return n!==e.renderPass&&n!==e.copyPass?n.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},f.setSize=function(e,r){var n,o;this.finalComposer.setSize(e,r),(n=this.bloomController)===null||n===void 0||n.setSize(e,r),(o=this.ssrController)===null||o===void 0||o.setSize(e,r),this.setFXAAPassSize(e,r)},f.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var n=this.options.renderer,o=n.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*o),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*o)}},f.render=function(){var e;if(!!this.active){var r=this.options.scene;(e=this.bloomController)===null||e===void 0||e.render(r),this.finalComposer.render()}},f.dispose=function(){var e,r,n;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(n=this.ssrController)===null||n===void 0||n.dispose(),this.finalComposer.passes.forEach(function(o){var c,t,P;(c=o.fsQuad)===null||c===void 0||c.dispose(),(t=o.fsQuad)===null||t===void 0||(P=t.material)===null||P===void 0||P.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},v}(),y=function(){"use strict";function v(s){(0,E.Z)(this,v),this.raycaster=new h.Raycaster,this.installPlugins=new Map,this.event=new ee.EventEmitter,this.clock=new h.Clock,this.options=J()(v.options,s,{isMergeableObject:R.isPlainObject});var e=this.options,r=e.container,n=e.stats,o=e.gui;if(o){var c=new(K());c.open(!1),this.gui=c}if(n){var t=new(se());t.showPanel(0),t.dom.style.position="absolute",r.appendChild(t.dom),this.stats=t}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var f=v.prototype;return f.use=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var c;(c=e).install.apply(c,[this].concat((0,A.Z)(n))),this.installPlugins.set(e,!0)}},f.init=function(){var e=this,r=this.options,n=r.container,o=r.isdev,c=r.axesHelper,t=r.renderer,P=r.scene,L=r.camera,Z=this.getSize(),M=Z.width,F=Z.height,Y=new x({isdev:o,width:M,height:F,cameraParams:L});this.gui&&Y.setGui(this.gui);var Q=Y.camera,ne=new H({camera:Q,sceneParams:P}),re=ne.scene,de=new _({width:M,height:F,scene:re,camera:Q,isdev:o,rendererParams:(0,p.Z)((0,a.Z)({},t),{outputEncoding:h.LinearEncoding,antialias:!1})});this.gui&&de.setGui(this.gui);var ce=de.renderer;c&&ne.addAxesHelper(),this.sceneController=ne,this.rendererController=de,this.cameraController=Y,n.appendChild(ce.domElement);var ye=new ResizeObserver(function(je){var Le=!0,ze=!1,ve=void 0;try{for(var _e=je[Symbol.iterator](),Pe;!(Le=(Pe=_e.next()).done);Le=!0){var be=Pe.value,Oe=be.contentRect;e.handeleResize(Oe.width,Oe.height)}}catch(Ee){ze=!0,ve=Ee}finally{try{!Le&&_e.return!=null&&_e.return()}finally{if(ze)throw ve}}});ye.observe(n),this.resizeObserver=ye},f.initComposer=function(){var e=this.options,r=e.bloom,n=e.outline,o=e.ssr,c=e.renderer,t=e.bloomParams,P=e.outlineParams,L=e.ssrParams,Z=e.multisampling,M=c.antialias;M==="msaa"&&!Be&&(M=!1,console.warn("MSAA is not supported on this browser"));var F=new i({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:M==="msaa"?Z:0,type:h.UnsignedByteType,encoding:c.outputEncoding}});this.composerController=F,M==="ssaa"&&F.addSSAAPass(),o&&F.addSSRPass(L),r&&F.addBloomPass(t),n&&F.addOutlinePass(P),c.outputEncoding===h.sRGBEncoding&&F.addGammaCorrectionPass(),M==="fxaa"?F.addFXAAPass():M==="smaa"&&F.addSMAAPass(),F.checkCopyPass(),this.event.on("passcheck",function(){F.checkCopyPass()})},f.initCSSRenderer=function(){var e=this.options,r=e.container,n=e.css2DRenderer,o=e.css3DRenderer,c=e.css2DRendererParams,t=e.css3DRendererParams;if(n||o){var P=new I(r);n&&P.addRenderer("css2d",c),o&&P.addRenderer("css3d",t),this.cssRendererController=P}},f.initControl=function(){var e=this.options,r=e.control,n=e.mapControl,o=e.controlParams;if(r){var c=new pe({camera:this.camera,controlParams:{domElement:(o==null?void 0:o.domElement)||this.renderer.domElement},mapControl:n});this.controlController=c}},f.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},f.handeleResize=function(e,r){var n=this,o=n.rendererController,c=n.cameraController,t=n.composerController,P=n.cssRendererController;c==null||c.setSize(e,r),o==null||o.setSize(e,r),t==null||t.setSize(e,r),P==null||P.setSize(e,r),this.installPlugins.forEach(function(L,Z){var M;(M=Z.resize)===null||M===void 0||M.call(Z,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},f.pick=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this,c=o.raycaster,t=o.options,P=t.container,L=new h.Vector2,Z=P.getBoundingClientRect();if(L.x=(e.clientX-Z.left)/(Z.right-Z.left)*2-1,L.y=-((e.clientY-Z.top)/(Z.bottom-Z.top))*2+1,this.camera&&this.scene){c.setFromCamera(L,this.camera);var M=c.intersectObjects(r||this.scene.children,n);if(M.length)return{object:M[0].object,intersects:M}}},f.render=function(){var e,r,n,o,c=this,t=c.renderer,P=c.scene,L=c.camera,Z=c.clock;if(!(!t||!P||!L||this.options.staticRender&&!this.cameraController.checkCameraChange())){var M=Z.getDelta(),F=Z.getElapsedTime();if(t.clear(),B().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(Q,ne){var re;(re=ne.update)===null||re===void 0||re.call(ne,M,F)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var Y;(Y=this.rendererController)===null||Y===void 0||Y.render()}(n=this.cssRendererController)===null||n===void 0||n.render(P,L),(o=this.stats)===null||o===void 0||o.update(),this.event.emit("render",{delta:M,elapsed:F})}},f.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},f.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},f.dispose=function(){var e,r,n,o,c,t,P;this.stop(),B().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(L,Z){var M;(M=Z.dispose)===null||M===void 0||M.call(Z)}),(r=this.controlController)===null||r===void 0||r.dispose(),(n=this.cssRendererController)===null||n===void 0||n.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(c=this.composerController)===null||c===void 0||c.dispose(),(t=this.rendererController)===null||t===void 0||t.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(P=this.gui)===null||P===void 0||P.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},(0,j.Z)(v,[{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}}]),v}();y.options={isdev:Te,stats:Te,gui:Te,axesHelper:Te,control:Te,renderer:(0,p.Z)((0,a.Z)({},k),{antialias:Be?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:U,camera:m,bloom:!1,bloomParams:ke,outline:!1,outlineParams:Ge,css2DRenderer:!1,ssr:!1,ssrParams:u,css2DRendererParams:(0,a.Z)({},W),css3DRenderer:!1,css3DRendererParams:(0,a.Z)({},W)};var C=d(701)},695:function(V,T,d){"use strict";d.d(T,{Z:function(){return E}});function E(j){if(j.geometry&&j.geometry.dispose(),j.material){var a=Array.isArray(j.material)?j.material:[j.material];a.forEach(function(p){var A,z,B,h,ee,$,J,te,se,oe,K,N,G;(A=p.map)===null||A===void 0||A.dispose(),(z=p.lightMap)===null||z===void 0||z.dispose(),(B=p.bumpMap)===null||B===void 0||B.dispose(),(h=p.normalMap)===null||h===void 0||h.dispose(),(ee=p.specularMap)===null||ee===void 0||ee.dispose(),($=p.envMap)===null||$===void 0||$.dispose(),(J=p.alphaMap)===null||J===void 0||J.dispose(),(te=p.aoMap)===null||te===void 0||te.dispose(),(se=p.displacementMap)===null||se===void 0||se.dispose(),(oe=p.emissiveMap)===null||oe===void 0||oe.dispose(),(K=p.gradientMap)===null||K===void 0||K.dispose(),(N=p.metalnessMap)===null||N===void 0||N.dispose(),(G=p.roughnessMap)===null||G===void 0||G.dispose(),p.dispose()})}}},519:function(V,T,d){"use strict";d.d(T,{disposeMesh:function(){return p.Z},isPlainObject:function(){return B.Z}});var E=d(666),j=d.n(E),a=null,p=d(695),A=d(644);function z(K){if(K.material){var N=Array.isArray(K.material)?K.material:[K.material];N.forEach(function(G){var k,_;(k=G.color)===null||k===void 0||k.convertSRGBToLinear(),(_=G.emissive)===null||_===void 0||_.convertSRGBToLinear(),G.map&&(G.map.encoding=THREE.sRGBEncoding),G.emissiveMap&&(G.emissiveMap.encoding=THREE.sRGBEncoding)})}}var B=d(738),h=d(568),ee=d(924),$=require("idb-keyval"),J=d(484),te=null,se=null,oe=function(){var K=(0,h.Z)(j().mark(function N(G,k){var _,m,x,R,U,H;return j().wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return _=k.version,ie.next=4,(0,$.get)(G);case 4:if(x=ie.sent,!(x&&x[_])){ie.next=9;break}m=x[_],ie.next=15;break;case 9:return ie.next=11,(0,J.Z)(fetch(G).then(function(pe){if(pe.ok)return pe.blob();throw new Error}));case 11:R=ie.sent,U=R.res,H=R.err,H||(m=U,(0,$.set)(G,(0,ee.Z)({},_,U)));case 15:return ie.abrupt("return",m?{url:URL.createObjectURL(m)}:{url:G});case 16:case"end":return ie.stop()}},N)}));return function(G,k){return K.apply(this,arguments)}}()},738:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});function E(a){return Object.prototype.toString.call(a)==="[object Object]"}function j(a){if(E(a)===!1)return!1;var p=a.constructor;if(p===void 0)return!0;var A=p.prototype;return!(E(A)===!1||A.hasOwnProperty("isPrototypeOf")===!1)}},282:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});var E=d(484);function j(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A={};return A.promise=new Promise(function(z,B){A.resolve=z,A.reject=B}),a&&(A.promise=(0,E.Z)(A.promise,p)),A}},484:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});var E=d(42);function j(a){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(A){return(0,E.Z)({err:null,res:A},p)}).catch(function(A){return(0,E.Z)({err:A,res:void 0},p)})}},494:function(V){"use strict";V.exports=require("@tweenjs/tween.js")},644:function(V){"use strict";V.exports=require("three")},530:function(V){"use strict";V.exports=require("three/examples/jsm/renderers/CSS3DRenderer")},943:function(V,T,d){"use strict";d.d(T,{Z:function(){return E}});function E(j,a){(a==null||a>j.length)&&(a=j.length);for(var p=0,A=new Array(a);p<a;p++)A[p]=j[p];return A}},982:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});var E=d(943);function j(a){if(Array.isArray(a))return(0,E.Z)(a)}},111:function(V,T,d){"use strict";d.d(T,{Z:function(){return E}});function E(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}},568:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});function E(a,p,A,z,B,h,ee){try{var $=a[h](ee),J=$.value}catch(te){A(te);return}$.done?p(J):Promise.resolve(J).then(z,B)}function j(a){return function(){var p=this,A=arguments;return new Promise(function(z,B){var h=a.apply(p,A);function ee(J){E(h,z,B,ee,$,"next",J)}function $(J){E(h,z,B,ee,$,"throw",J)}ee(void 0)})}}},438:function(V,T,d){"use strict";d.d(T,{Z:function(){return E}});function E(j,a){if(!(j instanceof a))throw new TypeError("Cannot call a class as a function")}},951:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});function E(a,p){for(var A=0;A<p.length;A++){var z=p[A];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(a,z.key,z)}}function j(a,p,A){return p&&E(a.prototype,p),A&&E(a,A),a}},485:function(V,T,d){"use strict";d.d(T,{Z:function(){return z}});function E(){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(B){return!1}}var j=d(662),a=d(111);function p(B){return B&&B.constructor===Symbol?"symbol":typeof B}function A(B,h){return h&&(p(h)==="object"||typeof h=="function")?h:(0,a.Z)(B)}function z(B){var h=E();return function(){var $=(0,j.Z)(B),J;if(h){var te=(0,j.Z)(this).constructor;J=Reflect.construct($,arguments,te)}else J=$.apply(this,arguments);return A(this,J)}}},924:function(V,T,d){"use strict";d.d(T,{Z:function(){return E}});function E(j,a,p){return a in j?Object.defineProperty(j,a,{value:p,enumerable:!0,configurable:!0,writable:!0}):j[a]=p,j}},662:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});function E(a){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},E(a)}function j(a){return E(a)}},668:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});var E=d(998);function j(a,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(p&&p.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),p&&(0,E.Z)(a,p)}},375:function(V,T,d){"use strict";d.d(T,{Z:function(){return E}});function E(j){if(typeof Symbol!="undefined"&&j[Symbol.iterator]!=null||j["@@iterator"]!=null)return Array.from(j)}},270:function(V,T,d){"use strict";d.d(T,{Z:function(){return E}});function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});var E=d(924);function j(a){for(var p=1;p<arguments.length;p++){var A=arguments[p]!=null?arguments[p]:{},z=Object.keys(A);typeof Object.getOwnPropertySymbols=="function"&&(z=z.concat(Object.getOwnPropertySymbols(A).filter(function(B){return Object.getOwnPropertyDescriptor(A,B).enumerable}))),z.forEach(function(B){(0,E.Z)(a,B,A[B])})}return a}},396:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});function E(a,p){var A=Object.keys(a);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(a);p&&(z=z.filter(function(B){return Object.getOwnPropertyDescriptor(a,B).enumerable})),A.push.apply(A,z)}return A}function j(a,p){return p=p!=null?p:{},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(p)):E(Object(p)).forEach(function(A){Object.defineProperty(a,A,Object.getOwnPropertyDescriptor(p,A))}),a}},607:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});function E(a,p){if(a==null)return{};var A={},z=Object.keys(a),B,h;for(h=0;h<z.length;h++)B=z[h],!(p.indexOf(B)>=0)&&(A[B]=a[B]);return A}function j(a,p){if(a==null)return{};var A=E(a,p),z,B;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);for(B=0;B<h.length;B++)z=h[B],!(p.indexOf(z)>=0)&&(!Object.prototype.propertyIsEnumerable.call(a,z)||(A[z]=a[z]))}return A}},998:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});function E(a,p){return E=Object.setPrototypeOf||function(z,B){return z.__proto__=B,z},E(a,p)}function j(a,p){return E(a,p)}},342:function(V,T,d){"use strict";d.d(T,{Z:function(){return A}});var E=d(982),j=d(375),a=d(270),p=d(566);function A(z){return(0,E.Z)(z)||(0,j.Z)(z)||(0,p.Z)(z)||(0,a.Z)()}},566:function(V,T,d){"use strict";d.d(T,{Z:function(){return j}});var E=d(943);function j(a,p){if(!!a){if(typeof a=="string")return(0,E.Z)(a,p);var A=Object.prototype.toString.call(a).slice(8,-1);if(A==="Object"&&a.constructor&&(A=a.constructor.name),A==="Map"||A==="Set")return Array.from(A);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return(0,E.Z)(a,p)}}}},et={};function q(V){var T=et[V];if(T!==void 0)return T.exports;var d=et[V]={exports:{}};return nt[V](d,d.exports,q),d.exports}(function(){q.n=function(V){var T=V&&V.__esModule?function(){return V.default}:function(){return V};return q.d(T,{a:T}),T}})(),function(){q.d=function(V,T){for(var d in T)q.o(T,d)&&!q.o(V,d)&&Object.defineProperty(V,d,{enumerable:!0,get:T[d]})}}(),function(){q.o=function(V,T){return Object.prototype.hasOwnProperty.call(V,T)}}(),function(){q.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})}}(),function(){q.p="/"}();var Ie={};(function(){"use strict";q.r(Ie),q.d(Ie,{ConicPolygon:function(){return Qe},ExtrudePolygon:function(){return Je},Image:function(){return ee},Line:function(){return me},MeshLine:function(){return x},MeshLineMaterial:function(){return H},MeshLineRaycast:function(){return R},Node:function(){return G},Text:function(){return A},Video:function(){return K}});var V=q(438),T=q(668),d=q(42),E=q(396),j=q(485),a=q(644),p=q(701),A=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.width=0,i.canvas=document.createElement("canvas"),i.options=(0,d.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.position,C=i.lookAt,v=i.sprite,f=i.text,s=i.sizeAttenuation;if(v){var e=new a.Sprite(new a.SpriteMaterial({transparent:!0,sizeAttenuation:s}));this.object3d=e}else{var r=new a.MeshBasicMaterial({side:a.DoubleSide,transparent:!0}),n=new a.PlaneGeometry(1,1,1,1);this.createMesh(n,r)}this.object3d.position.copy(y),C&&this.object3d.lookAt(C),this.setText(f)},g.setText=function(i,y){var C=(0,d.Z)((0,E.Z)((0,d.Z)({},this.options),{text:i}),y||{}),v=C.text,f=C.fontSize,s=C.fontFamily,e=C.fontWeight,r=C.flipX,n=C.scale,o=this.canvas;o.width=f*v.length*2,o.height=f;var c=o.getContext("2d");c.font="".concat(e," ").concat(f,"px/1 ").concat(s);var t=c.measureText(v).width;o.width=t,this.width=t,c=o.getContext("2d"),c.clearRect(0,0,o.width,o.height),r&&c.scale(-1,1),c.font="".concat(e," ").concat(f,"px/1 ").concat(s),c.textBaseline="middle",c.fillStyle="#ffffff",c.fillText(v,r?t*-1:0,o.height/2),c.restore();var P=new a.Texture(o);P.anisotropy=16,P.needsUpdate=!0;var L=this.object3d;L.material.map&&L.material.map.dispose(),L.material.map=P,L.material.needsUpdate=!0,L.scale.set(P.image.width*n,P.image.height*n,1)},u}(p.ZP),z=q(568),B=q(666),h=q.n(B),ee=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=b,i}var g=u.prototype;return g.getMaterial=function(){var i=this;return(0,z.Z)(h().mark(function y(){var C,v,f,s,e,r,n,o,c,t;return h().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return C=i.options,v=C.transparent,f=C.blending,s=C.src,e=C.depthWrite,r=C.alphaTest,n=C.sprite,o=C.sizeAttenuation,L.next=3,new a.TextureLoader().loadAsync(s);case 3:return c=L.sent,t=n?new a.SpriteMaterial({map:c,transparent:v!=null?v:!1,blending:f!=null?f:a.NormalBlending,depthWrite:e!=null?e:!0,alphaTest:r!=null?r:0,sizeAttenuation:o!=null?o:!0}):new a.MeshBasicMaterial({map:c,transparent:v!=null?v:!1,blending:f!=null?f:a.NormalBlending,depthWrite:e!=null?e:!0,alphaTest:r!=null?r:0}),L.abrupt("return",t);case 6:case"end":return L.stop()}},y)}))()},g.create=function(){var i=this;return(0,z.Z)(h().mark(function y(){var C,v,f,s,e,r,n,o;return h().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(C=i.options,v=C.scale,f=C.position,s=C.src,e=C.cache,r=C.sprite,!(e&&!e.get(s))){t.next=7;break}return e.init(s),t.next=5,i.getMaterial();case 5:n=t.sent,e.set(s,n);case 7:if(!e){t.next=13;break}return t.next=10,e.get(s);case 10:t.t0=t.sent,t.next=16;break;case 13:return t.next=15,i.getMaterial();case 15:t.t0=t.sent;case 16:o=t.t0,i.texture=o.map,r?i.createSprite(o):i.createMesh(new a.PlaneBufferGeometry(1,1),o),v&&i.object3d.scale.set(o.map.image.width*v,o.map.image.height*v,1),f&&i.object3d.position.copy(f);case 21:case"end":return t.stop()}},y)}))()},u}(p.ZP),$=q(662);function J(l,w){for(;!Object.prototype.hasOwnProperty.call(l,w)&&(l=(0,$.Z)(l),l!==null););return l}function te(l,w,u){return typeof Reflect!="undefined"&&Reflect.get?te=Reflect.get:te=function(b,i,y){var C=J(b,i);if(!!C){var v=Object.getOwnPropertyDescriptor(C,i);return v.get?v.get.call(y||b):v.value}},te(l,w,u)}function se(l,w,u){return te(l,w,u)}var oe=q(282),K=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=(0,d.Z)({},{autoPlay:!0,loop:!0},b),i}var g=u.prototype;return g.getMaterial=function(){var i=this.options,y=i.src,C=i.transparent,v=i.blending,f=i.depthWrite,s=i.format,e=i.autoPlay,r=i.loop,n=i.alphaTest,o=i.sprite,c=(0,oe.Z)(),t=document.createElement("video");return t.addEventListener("loadedmetadata",function(){var P=new a.VideoTexture(t);P.format=s!=null?s:a.RGBAFormat,P.needsUpdate=!0;var L=o?new a.SpriteMaterial({map:P,transparent:C!=null?C:!1,blending:v!=null?v:a.NormalBlending,depthWrite:f!=null?f:!0,alphaTest:n!=null?n:0}):new a.MeshBasicMaterial({map:P,transparent:C!=null?C:!1,blending:v!=null?v:a.NormalBlending,depthWrite:f!=null?f:!0,alphaTest:n!=null?n:0});c.resolve(L)},!1),t.src=y,t.muted=!0,t.autoplay=e,t.loop=r,t.preload="auto",c.promise},g.create=function(){var i=this;return(0,z.Z)(h().mark(function y(){var C,v,f,s,e,r,n,o;return h().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(C=i.options,v=C.scale,f=C.position,s=C.src,e=C.cache,r=C.sprite,!(e&&!e.get(s))){t.next=7;break}return e.init(s),t.next=5,i.getMaterial();case 5:n=t.sent,e.set(s,n);case 7:if(!e){t.next=13;break}return t.next=10,e.get(s);case 10:t.t0=t.sent,t.next=16;break;case 13:return t.next=15,i.getMaterial();case 15:t.t0=t.sent;case 16:o=t.t0,i.video=o.map.image,r?i.createSprite(o):i.createMesh(new a.PlaneBufferGeometry(1,1),o),v&&i.object3d.scale.set(i.video.videoWidth*v,i.video.videoHeight*v,1),f&&i.object3d.position.copy(f);case 21:case"end":return t.stop()}},y)}))()},g.render=function(){var i=this.options.autoPlay;i&&this.video.play()},g.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),se((0,$.Z)(u.prototype),"dispose",this).call(this)},u}(p.ZP),N=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=(0,d.Z)({},b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.position,C=i.children,v=i.onClick,f=i.zIndexFix,s=document.createElement("div");s.appendChild(C),this.createCSS2DObject(s),y&&this.object3d.position.copy(y),v&&s.addEventListener("click",v),f&&(this.object3d.userData.zIndexFix=f)},g.getMaterial=function(i){return(0,z.Z)(h().mark(function y(){var C,v,f,s;return h().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return C=document.createElement("canvas"),C.width=256,C.height=256,v=C.getContext("2d"),v.fillStyle="#ff0000",v.fillRect(0,0,256,256),f=new a.CanvasTexture(C),s=new a.SpriteMaterial({map:f,opacity:i?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),r.abrupt("return",s);case 9:case"end":return r.stop()}},y)}))()},g.createPickObject=function(i){var y=i.show,C=y===void 0?!1:y,v=i.scale,f=v===void 0?new a.Vector3(1,1,1):v,s=i.position,e=s===void 0?new a.Vector3(0,0,0):s,r=i.cache,n=this;return(0,z.Z)(h().mark(function o(){var c,t,P,L;return h().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(c="node-create-pick-object",!(r&&!r.get(c))){M.next=7;break}return r.init(c),M.next=5,n.getMaterial(C);case 5:t=M.sent,r.set(c,t);case 7:if(!r){M.next=13;break}return M.next=10,r.get(c);case 10:M.t0=M.sent,M.next=16;break;case 13:return M.next=15,n.getMaterial(C);case 15:M.t0=M.sent;case 16:P=M.t0,L=new a.Sprite(P),L.scale.set(P.map.image.width*f.x,P.map.image.height*f.y,1),L.position.copy(e),n.add(L),n.pickObject=L;case 22:case"end":return M.stop()}},o)}))()},g.dispose=function(){var i=this.options.onClick;if(i){var y;(y=this.object3d.element)===null||y===void 0||y.removeEventListener("click",i)}se((0,$.Z)(u.prototype),"dispose",this).call(this)},u}(p.ZP),G=N,k=q(111),_=`
|
|
41
|
-
`.concat(a.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
42
|
-
`).concat(a.ShaderChunk.fog_pars_vertex,`
|
|
1
|
+
(function(){var $e={666:function(S){var L=function(x){"use strict";var T=Object.prototype,P=T.hasOwnProperty,R,A=typeof Symbol=="function"?Symbol:{},W=A.iterator||"@@iterator",N=A.asyncIterator||"@@asyncIterator",B=A.toStringTag||"@@toStringTag";function E(l,c,p){return Object.defineProperty(l,c,{value:p,enumerable:!0,configurable:!0,writable:!0}),l[c]}try{E({},"")}catch(l){E=function(c,p,M){return c[p]=M}}function $(l,c,p,M){var w=c&&c.prototype instanceof C?c:C,z=Object.create(w.prototype),X=new _e(M||[]);return z._invoke=J(l,p,X),z}x.wrap=$;function q(l,c,p){try{return{type:"normal",arg:l.call(c,p)}}catch(M){return{type:"throw",arg:M}}}var V="suspendedStart",s="suspendedYield",fe="executing",Z="completed",D={};function C(){}function U(){}function G(){}var ne={};E(ne,W,function(){return this});var re=Object.getPrototypeOf,ie=re&&re(re(se([])));ie&&ie!==T&&P.call(ie,W)&&(ne=ie);var ee=G.prototype=C.prototype=Object.create(ne);U.prototype=G,E(ee,"constructor",G),E(G,"constructor",U),U.displayName=E(G,B,"GeneratorFunction");function H(l){["next","throw","return"].forEach(function(c){E(l,c,function(p){return this._invoke(c,p)})})}x.isGeneratorFunction=function(l){var c=typeof l=="function"&&l.constructor;return c?c===U||(c.displayName||c.name)==="GeneratorFunction":!1},x.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,G):(l.__proto__=G,E(l,B,"GeneratorFunction")),l.prototype=Object.create(ee),l},x.awrap=function(l){return{__await:l}};function de(l,c){function p(z,X,K,te){var Q=q(l[z],l,X);if(Q.type==="throw")te(Q.arg);else{var Se=Q.arg,ge=Se.value;return ge&&typeof ge=="object"&&P.call(ge,"__await")?c.resolve(ge.__await).then(function(Y){p("next",Y,K,te)},function(Y){p("throw",Y,K,te)}):c.resolve(ge).then(function(Y){Se.value=Y,K(Se)},function(Y){return p("throw",Y,K,te)})}}var M;function w(z,X){function K(){return new c(function(te,Q){p(z,X,te,Q)})}return M=M?M.then(K,K):K()}this._invoke=w}H(de.prototype),E(de.prototype,N,function(){return this}),x.AsyncIterator=de,x.async=function(l,c,p,M,w){w===void 0&&(w=Promise);var z=new de($(l,c,p,M),w);return x.isGeneratorFunction(c)?z:z.next().then(function(X){return X.done?X.value:z.next()})};function J(l,c,p){var M=V;return function(z,X){if(M===fe)throw new Error("Generator is already running");if(M===Z){if(z==="throw")throw X;return ke()}for(p.method=z,p.arg=X;;){var K=p.delegate;if(K){var te=me(K,p);if(te){if(te===D)continue;return te}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(M===V)throw M=Z,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);M=fe;var Q=q(l,c,p);if(Q.type==="normal"){if(M=p.done?Z:s,Q.arg===D)continue;return{value:Q.arg,done:p.done}}else Q.type==="throw"&&(M=Z,p.method="throw",p.arg=Q.arg)}}}function me(l,c){var p=l.iterator[c.method];if(p===R){if(c.delegate=null,c.method==="throw"){if(l.iterator.return&&(c.method="return",c.arg=R,me(l,c),c.method==="throw"))return D;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return D}var M=q(p,l.iterator,c.arg);if(M.type==="throw")return c.method="throw",c.arg=M.arg,c.delegate=null,D;var w=M.arg;if(!w)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,D;if(w.done)c[l.resultName]=w.value,c.next=l.nextLoc,c.method!=="return"&&(c.method="next",c.arg=R);else return w;return c.delegate=null,D}H(ee),E(ee,B,"Generator"),E(ee,W,function(){return this}),E(ee,"toString",function(){return"[object Generator]"});function Le(l){var c={tryLoc:l[0]};1 in l&&(c.catchLoc=l[1]),2 in l&&(c.finallyLoc=l[2],c.afterLoc=l[3]),this.tryEntries.push(c)}function Pe(l){var c=l.completion||{};c.type="normal",delete c.arg,l.completion=c}function _e(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(Le,this),this.reset(!0)}x.keys=function(l){var c=[];for(var p in l)c.push(p);return c.reverse(),function M(){for(;c.length;){var w=c.pop();if(w in l)return M.value=w,M.done=!1,M}return M.done=!0,M}};function se(l){if(l){var c=l[W];if(c)return c.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var p=-1,M=function w(){for(;++p<l.length;)if(P.call(l,p))return w.value=l[p],w.done=!1,w;return w.value=R,w.done=!0,w};return M.next=M}}return{next:ke}}x.values=se;function ke(){return{value:R,done:!0}}return _e.prototype={constructor:_e,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(Pe),!l)for(var c in this)c.charAt(0)==="t"&&P.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=R)},stop:function(){this.done=!0;var l=this.tryEntries[0],c=l.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var c=this;function p(te,Q){return z.type="throw",z.arg=l,c.next=te,Q&&(c.method="next",c.arg=R),!!Q}for(var M=this.tryEntries.length-1;M>=0;--M){var w=this.tryEntries[M],z=w.completion;if(w.tryLoc==="root")return p("end");if(w.tryLoc<=this.prev){var X=P.call(w,"catchLoc"),K=P.call(w,"finallyLoc");if(X&&K){if(this.prev<w.catchLoc)return p(w.catchLoc,!0);if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else if(X){if(this.prev<w.catchLoc)return p(w.catchLoc,!0)}else if(K){if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,c){for(var p=this.tryEntries.length-1;p>=0;--p){var M=this.tryEntries[p];if(M.tryLoc<=this.prev&&P.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var w=M;break}}w&&(l==="break"||l==="continue")&&w.tryLoc<=c&&c<=w.finallyLoc&&(w=null);var z=w?w.completion:{};return z.type=l,z.arg=c,w?(this.method="next",this.next=w.finallyLoc,D):this.complete(z)},complete:function(l,c){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"&&c&&(this.next=c),D},finish:function(l){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.finallyLoc===l)return this.complete(p.completion,p.afterLoc),Pe(p),D}},catch:function(l){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.tryLoc===l){var M=p.completion;if(M.type==="throw"){var w=M.arg;Pe(p)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(l,c,p){return this.delegate={iterator:se(l),resultName:c,nextLoc:p},this.method==="next"&&(this.arg=R),D}},x}(S.exports);try{regeneratorRuntime=L}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},695:function(S,L,x){"use strict";x.d(L,{Z:function(){return T}});function T(P){if(P.geometry&&P.geometry.dispose(),P.material){var R=Array.isArray(P.material)?P.material:[P.material];R.forEach(function(A){var W,N,B,E,$,q,V,s,fe,Z,D,C,U;(W=A.map)===null||W===void 0||W.dispose(),(N=A.lightMap)===null||N===void 0||N.dispose(),(B=A.bumpMap)===null||B===void 0||B.dispose(),(E=A.normalMap)===null||E===void 0||E.dispose(),($=A.specularMap)===null||$===void 0||$.dispose(),(q=A.envMap)===null||q===void 0||q.dispose(),(V=A.alphaMap)===null||V===void 0||V.dispose(),(s=A.aoMap)===null||s===void 0||s.dispose(),(fe=A.displacementMap)===null||fe===void 0||fe.dispose(),(Z=A.emissiveMap)===null||Z===void 0||Z.dispose(),(D=A.gradientMap)===null||D===void 0||D.dispose(),(C=A.metalnessMap)===null||C===void 0||C.dispose(),(U=A.roughnessMap)===null||U===void 0||U.dispose(),A.dispose()})}}},519:function(S,L,x){"use strict";x.d(L,{disposeMesh:function(){return A.Z}});var T=x(666),P=x.n(T),R=null,A=x(695),W=x(644);function N(Z){if(Z.material){var D=Array.isArray(Z.material)?Z.material:[Z.material];D.forEach(function(C){var U,G;(U=C.color)===null||U===void 0||U.convertSRGBToLinear(),(G=C.emissive)===null||G===void 0||G.convertSRGBToLinear(),C.map&&(C.map.encoding=THREE.sRGBEncoding),C.emissiveMap&&(C.emissiveMap.encoding=THREE.sRGBEncoding)})}}var B=x(568),E=x(924),$=require("idb-keyval"),q=x(484),V=null,s=null,fe=function(){var Z=(0,B.Z)(P().mark(function D(C,U){var G,ne,re,ie,ee,H;return P().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return G=U.version,J.next=4,(0,$.get)(C);case 4:if(re=J.sent,!(re&&re[G])){J.next=9;break}ne=re[G],J.next=15;break;case 9:return J.next=11,(0,q.Z)(fetch(C).then(function(me){if(me.ok)return me.blob();throw new Error}));case 11:ie=J.sent,ee=ie.res,H=ie.err,H||(ne=ee,(0,$.set)(C,(0,E.Z)({},G,ee)));case 15:return J.abrupt("return",ne?{url:URL.createObjectURL(ne)}:{url:C});case 16:case"end":return J.stop()}},D)}));return function(C,U){return Z.apply(this,arguments)}}()},484:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});var T=x(42);function P(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(W){return(0,T.Z)({err:null,res:W},A)}).catch(function(W){return(0,T.Z)({err:W,res:void 0},A)})}},644:function(S){"use strict";S.exports=require("three")},568:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});function T(R,A,W,N,B,E,$){try{var q=R[E]($),V=q.value}catch(s){W(s);return}q.done?A(V):Promise.resolve(V).then(N,B)}function P(R){return function(){var A=this,W=arguments;return new Promise(function(N,B){var E=R.apply(A,W);function $(V){T(E,N,B,$,q,"next",V)}function q(V){T(E,N,B,$,q,"throw",V)}$(void 0)})}}},924:function(S,L,x){"use strict";x.d(L,{Z:function(){return T}});function T(P,R,A){return R in P?Object.defineProperty(P,R,{value:A,enumerable:!0,configurable:!0,writable:!0}):P[R]=A,P}},42:function(S,L,x){"use strict";x.d(L,{Z:function(){return P}});var T=x(924);function P(R){for(var A=1;A<arguments.length;A++){var W=arguments[A]!=null?arguments[A]:{},N=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(N=N.concat(Object.getOwnPropertySymbols(W).filter(function(B){return Object.getOwnPropertyDescriptor(W,B).enumerable}))),N.forEach(function(B){(0,T.Z)(R,B,W[B])})}return R}}},Ue={};function F(S){var L=Ue[S];if(L!==void 0)return L.exports;var x=Ue[S]={exports:{}};return $e[S](x,x.exports,F),x.exports}(function(){F.n=function(S){var L=S&&S.__esModule?function(){return S.default}:function(){return S};return F.d(L,{a:L}),L}})(),function(){F.d=function(S,L){for(var x in L)F.o(L,x)&&!F.o(S,x)&&Object.defineProperty(S,x,{enumerable:!0,get:L[x]})}}(),function(){F.o=function(S,L){return Object.prototype.hasOwnProperty.call(S,L)}}(),function(){F.r=function(S){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})}}();var Re={};(function(){"use strict";F.r(Re),F.d(Re,{ConicPolygon:function(){return yt},ExtrudePolygon:function(){return _t},Image:function(){return M},Line:function(){return et},MeshLine:function(){return Y},MeshLineMaterial:function(){return Ee},MeshLineRaycast:function(){return Fe},Node:function(){return Q},Text:function(){return ke},Video:function(){return K}});function S(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function L(t,i){return L=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},L(t,i)}function x(t,i){return L(t,i)}function T(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&&x(t,i)}var P=F(42);function R(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 A(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function W(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function N(t){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},N(t)}function B(t){return N(t)}function E(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return t&&t.constructor===Symbol?"symbol":typeof t}function q(t,i){return i&&($(i)==="object"||typeof i=="function")?i:E(t)}function V(t){var i=W();return function(){var n=B(t),a;if(i){var e=B(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return q(this,a)}}var s=F(644);function fe(){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 Z(t,i,r){return fe()?Z=Reflect.construct:Z=function(a,e,o){var u=[null];u.push.apply(u,e);var h=Function.bind.apply(a,u),v=new h;return o&&x(v,o.prototype),v},Z.apply(null,arguments)}function D(t,i,r){return Z.apply(null,arguments)}function C(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 U(t,i,r){return i&&C(t.prototype,i),r&&C(t,r),t}function G(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 ne(t){if(Array.isArray(t))return G(t)}function re(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ie(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ee(t,i){if(!!t){if(typeof t=="string")return G(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 G(t,i)}}function H(t){return ne(t)||re(t)||ee(t)||ie()}var de=F(484);function J(){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,de.Z)(r.promise,i)),r}var me=require("three/examples/jsm/renderers/CSS2DRenderer"),Le=require("three/examples/jsm/renderers/CSS3DRenderer"),Pe=F(519),_e=function(t){t&&((0,Pe.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||_e(i)}))},se=function(){"use strict";function t(){S(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=J(),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=D(s.Mesh,H(a)),this},i.createGroup=function(){return this.object3d=new s.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=D(s.Points,H(a)),this},i.createCSS2DObject=function(n){return this.object3d=new me.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new Le.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new Le.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new s.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,H(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,H(a)),this},i.getSize=function(){var n=new s.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new s.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){_e(this.object3d)},U(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";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,P.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,m=e.sizeAttenuation;if(h){var d=new s.Sprite(new s.SpriteMaterial({transparent:!0,sizeAttenuation:m}));this.object3d=d}else{var y=new s.MeshBasicMaterial({side:s.DoubleSide,transparent:!0}),b=new s.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),u&&this.object3d.lookAt(u),this.setText(v)},n.setText=function(e,o){var u=(0,P.Z)(A((0,P.Z)({},this.options),{text:e}),o||{}),h=u.text,v=u.fontSize,m=u.fontFamily,d=u.fontWeight,y=u.flipX,b=u.scale,g=this.canvas;g.width=v*h.length*2,g.height=v;var _=g.getContext("2d");_.font="".concat(d," ").concat(v,"px/1 ").concat(m);var f=_.measureText(h).width;g.width=f,this.width=f,_=g.getContext("2d"),_.clearRect(0,0,g.width,g.height),y&&_.scale(-1,1),_.font="".concat(d," ").concat(v,"px/1 ").concat(m),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(h,y?f*-1:0,g.height/2),_.restore();var O=new s.Texture(g);O.anisotropy=16,O.needsUpdate=!0;var j=this.object3d;j.material.map&&j.material.map.dispose(),j.material.map=O,j.material.needsUpdate=!0,j.scale.set(O.image.width*b,O.image.height*b,1)},r}(se),l=F(568),c=F(666),p=F.n(c),M=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(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,m,d,y,b,g,_,f;return p().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return u=e.options,h=u.transparent,v=u.blending,m=u.src,d=u.depthWrite,y=u.alphaTest,b=u.sprite,g=u.sizeAttenuation,j.next=3,new s.TextureLoader().loadAsync(m);case 3:return _=j.sent,f=b?new s.SpriteMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:y!=null?y:0,sizeAttenuation:g!=null?g:!0}):new s.MeshBasicMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:s.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:y!=null?y:0}),j.abrupt("return",f);case 6:case"end":return j.stop()}},o)}))()},n.create=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,h,v,m,d,y,b,g;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=e.options,h=u.scale,v=u.position,m=u.src,d=u.cache,y=u.sprite,!(d&&!d.get(m))){f.next=7;break}return d.init(m),f.next=5,e.getMaterial();case 5:b=f.sent,d.set(m,b);case 7:if(!d){f.next=13;break}return f.next=10,d.get(m);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:g=f.t0,e.texture=g.map,y?e.createSprite(g):e.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&e.object3d.scale.set(g.map.image.width*h,g.map.image.height*h,1),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},r}(se);function w(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=B(t),t!==null););return t}function z(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?z=Reflect.get:z=function(a,e,o){var u=w(a,e);if(!!u){var h=Object.getOwnPropertyDescriptor(u,e);return h.get?h.get.call(o||a):h.value}},z(t,i,r)}function X(t,i,r){return z(t,i,r)}var K=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=(0,P.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,m=e.format,d=e.autoPlay,y=e.loop,b=e.alphaTest,g=e.sprite,_=J(),f=document.createElement("video");return f.addEventListener("loadedmetadata",function(){var O=new s.VideoTexture(f);O.format=m!=null?m:s.RGBAFormat,O.needsUpdate=!0;var j=g?new s.SpriteMaterial({map:O,transparent:u!=null?u:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new s.MeshBasicMaterial({map:O,transparent:u!=null?u:!1,blending:h!=null?h:s.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});_.resolve(j)},!1),f.src=o,f.muted=!0,f.autoplay=d,f.loop=y,f.preload="auto",_.promise},n.create=function(){var e=this;return(0,l.Z)(p().mark(function o(){var u,h,v,m,d,y,b,g;return p().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(u=e.options,h=u.scale,v=u.position,m=u.src,d=u.cache,y=u.sprite,!(d&&!d.get(m))){f.next=7;break}return d.init(m),f.next=5,e.getMaterial();case 5:b=f.sent,d.set(m,b);case 7:if(!d){f.next=13;break}return f.next=10,d.get(m);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:g=f.t0,e.video=g.map.image,y?e.createSprite(g):e.createMesh(new s.PlaneBufferGeometry(1,1),g),h&&e.object3d.scale.set(e.video.videoWidth*h,e.video.videoHeight*h,1),v&&e.object3d.position.copy(v);case 21:case"end":return f.stop()}},o)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),X(B(r.prototype),"dispose",this).call(this)},r}(se),te=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=(0,P.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,m=document.createElement("div");m.appendChild(u),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),h&&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,m;return p().wrap(function(y){for(;;)switch(y.prev=y.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 s.CanvasTexture(u),m=new s.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",m);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,u=o===void 0?!1:o,h=e.scale,v=h===void 0?new s.Vector3(1,1,1):h,m=e.position,d=m===void 0?new s.Vector3(0,0,0):m,y=e.cache,b=this;return(0,l.Z)(p().mark(function g(){var _,f,O,j;return p().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(_="node-create-pick-object",!(y&&!y.get(_))){k.next=7;break}return y.init(_),k.next=5,b.getMaterial(u);case 5:f=k.sent,y.set(_,f);case 7:if(!y){k.next=13;break}return k.next=10,y.get(_);case 10:k.t0=k.sent,k.next=16;break;case 13:return k.next=15,b.getMaterial(u);case 15:k.t0=k.sent;case 16:O=k.t0,j=new s.Sprite(O),j.scale.set(O.map.image.width*v.x,O.map.image.height*v.y,1),j.position.copy(d),b.add(j),b.pickObject=j;case 22:case"end":return k.stop()}},g)}))()},n.dispose=function(){var e=this.options.onClick;if(e){var o;(o=this.object3d.element)===null||o===void 0||o.removeEventListener("click",e)}X(B(r.prototype),"dispose",this).call(this)},r}(se),Q=te,Se=`
|
|
2
|
+
`.concat(s.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(s.ShaderChunk.fog_pars_vertex,`
|
|
43
4
|
attribute vec3 previous;
|
|
44
5
|
attribute vec3 next;
|
|
45
6
|
attribute float side;
|
|
@@ -130,13 +91,13 @@
|
|
|
130
91
|
finalPosition.xy+=offset.xy;
|
|
131
92
|
|
|
132
93
|
gl_Position=finalPosition;
|
|
133
|
-
`).concat(
|
|
94
|
+
`).concat(s.ShaderChunk.logdepthbuf_vertex,`
|
|
134
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
135
|
-
`).concat(
|
|
96
|
+
`).concat(s.ShaderChunk.fog_vertex,`
|
|
136
97
|
}
|
|
137
|
-
`),
|
|
138
|
-
`.concat(
|
|
139
|
-
`).concat(
|
|
98
|
+
`),ge=`
|
|
99
|
+
`.concat(s.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(s.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
140
101
|
|
|
141
102
|
|
|
142
103
|
uniform sampler2D map;
|
|
@@ -156,7 +117,7 @@ varying vec4 vColor;
|
|
|
156
117
|
varying float vCounters;
|
|
157
118
|
|
|
158
119
|
void main() {
|
|
159
|
-
`).concat(
|
|
120
|
+
`).concat(s.ShaderChunk.logdepthbuf_fragment,`
|
|
160
121
|
vec4 c = vColor;
|
|
161
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
162
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -166,6 +127,6 @@ void main() {
|
|
|
166
127
|
}
|
|
167
128
|
gl_FragColor = c;
|
|
168
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
169
|
-
`).concat(
|
|
130
|
+
`).concat(s.ShaderChunk.fog_fragment,`
|
|
170
131
|
}
|
|
171
|
-
`),x=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(){(0,V.Z)(this,u);var g;return g=w.call(this),g.isMeshLine=!0,g.type="MeshLine",g.positions=[],g.previous=[],g.next=[],g.side=[],g.width=[],g.indices_array=[],g.uvs=[],g.counters=[],g._points=[],g._geom=null,g.widthCallback=null,g.matrixWorld=new a.Matrix4,Object.defineProperties((0,k.Z)(g),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(i){this.setGeometry(i,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(i){this.setPoints(i,this.widthCallback)}}}),g}return u}(a.BufferGeometry);x.prototype.setMatrixWorld=function(l){this.matrixWorld=l},x.prototype.setGeometry=function(l,w){this._geometry=l,this.setPoints(l.getAttribute("position").array,w)},x.prototype.setPoints=function(l,w){if(!(l instanceof Float32Array)&&!(l instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=l,this.widthCallback=w,this.positions=[],this.counters=[],l.length&&l[0]instanceof a.Vector3)for(var u=0;u<l.length;u++){var g=l[u],b=u/l.length;this.positions.push(g.x,g.y,g.z),this.positions.push(g.x,g.y,g.z),this.counters.push(b),this.counters.push(b)}else for(var u=0;u<l.length;u+=3){var b=u/l.length;this.positions.push(l[u],l[u+1],l[u+2]),this.positions.push(l[u],l[u+1],l[u+2]),this.counters.push(b),this.counters.push(b)}this.process()};function R(l,w){var u=new a.Matrix4,g=new a.Ray,b=new a.Sphere,i=new a.Vector3,y=this.geometry;if(y.boundingSphere||y.computeBoundingSphere(),b.copy(y.boundingSphere),b.applyMatrix4(this.matrixWorld),l.ray.intersectSphere(b,i)!==!1){u.copy(this.matrixWorld).invert(),g.copy(l.ray).applyMatrix4(u);var C=new a.Vector3,v=new a.Vector3,f=new a.Vector3,s=this instanceof a.LineSegments?2:1,e=y.index,r=y.attributes;if(e!==null)for(var n=e.array,o=r.position.array,c=r.width.array,t=0,P=n.length-1;t<P;t+=s){var L=n[t],Z=n[t+1];C.fromArray(o,L*3),v.fromArray(o,Z*3);var M=c[Math.floor(t/3)]!==void 0?c[Math.floor(t/3)]:1,F=l.params.Line.threshold+this.material.lineWidth*M/2,Y=F*F,Q=g.distanceSqToSegment(C,v,i,f);if(!(Q>Y)){i.applyMatrix4(this.matrixWorld);var ne=l.ray.origin.distanceTo(i);ne<l.near||ne>l.far||(w.push({distance:ne,point:f.clone().applyMatrix4(this.matrixWorld),index:t,face:null,faceIndex:null,object:this}),t=P)}}}}x.prototype.raycast=R,x.prototype.compareV3=function(l,w){var u=l*6,g=w*6;return this.positions[u]===this.positions[g]&&this.positions[u+1]===this.positions[g+1]&&this.positions[u+2]===this.positions[g+2]},x.prototype.copyV3=function(l){var w=l*6;return[this.positions[w],this.positions[w+1],this.positions[w+2]]},x.prototype.process=function(){var l=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var w,u;this.compareV3(0,l-1)?u=this.copyV3(l-2):u=this.copyV3(0),this.previous.push(u[0],u[1],u[2]),this.previous.push(u[0],u[1],u[2]);for(var g=0;g<l;g++){if(this.side.push(1),this.side.push(-1),this.widthCallback?w=this.widthCallback(g/(l-1)):w=1,this.width.push(w),this.width.push(w),this.uvs.push(g/(l-1),0),this.uvs.push(g/(l-1),1),g<l-1){u=this.copyV3(g),this.previous.push(u[0],u[1],u[2]),this.previous.push(u[0],u[1],u[2]);var b=g*2;this.indices_array.push(b,b+1,b+2),this.indices_array.push(b+2,b+1,b+3)}g>0&&(u=this.copyV3(g),this.next.push(u[0],u[1],u[2]),this.next.push(u[0],u[1],u[2]))}this.compareV3(l-1,0)?u=this.copyV3(1):u=this.copyV3(l-1),this.next.push(u[0],u[1],u[2]),this.next.push(u[0],u[1],u[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new a.BufferAttribute(new Float32Array(this.positions),3),previous:new a.BufferAttribute(new Float32Array(this.previous),3),next:new a.BufferAttribute(new Float32Array(this.next),3),side:new a.BufferAttribute(new Float32Array(this.side),1),width:new a.BufferAttribute(new Float32Array(this.width),1),uv:new a.BufferAttribute(new Float32Array(this.uvs),2),index:new a.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new a.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 U(l,w,u,g,b){var i;if(l=l.subarray||l.slice?l:l.buffer,u=u.subarray||u.slice?u:u.buffer,l=w?l.subarray?l.subarray(w,b&&w+b):l.slice(w,b&&w+b):l,u.set)u.set(l,g);else for(i=0;i<l.length;i++)u[i+g]=l[i];return u}x.prototype.advance=function(l){var w=this._attributes.position.array,u=this._attributes.previous.array,g=this._attributes.next.array,b=w.length;U(w,0,u,0,b),U(w,6,w,0,b-6),w[b-6]=l.x,w[b-5]=l.y,w[b-4]=l.z,w[b-3]=l.x,w[b-2]=l.y,w[b-1]=l.z,U(w,6,g,0,b-6),g[b-6]=l.x,g[b-5]=l.y,g[b-4]=l.z,g[b-3]=l.x,g[b-2]=l.y,g[b-1]=l.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},a.ShaderChunk.meshline_vert=_,a.ShaderChunk.meshline_frag=m;var H=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(g){(0,V.Z)(this,u);var b;return b=w.call(this,{uniforms:Object.assign({},a.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new a.Color(16777215)},opacity:{value:1},resolution:{value:new a.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 a.Vector2(1,1)},offset:{value:new a.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new a.Vector2(0,0)},lightColor:{value:new a.Color(16777215)}}),vertexShader:a.ShaderChunk.meshline_vert,fragmentShader:a.ShaderChunk.meshline_frag}),b.isMeshLineMaterial=!0,b.type="MeshLineMaterial",Object.defineProperties((0,k.Z)(b),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(y){this.uniforms.lineWidth.value=y}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(y){this.uniforms.lineLightAnimation.value=y}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(y){this.uniforms.map.value=y}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(y){this.uniforms.useMap.value=y}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(y){this.uniforms.alphaMap.value=y}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(y){this.uniforms.useAlphaMap.value=y}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(y){this.uniforms.color.value=y}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(y){this.uniforms.lightColor.value=y}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(y){this.uniforms.time.value=y}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(y){this.uniforms.uCenter.value=y}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(y){this.uniforms.size.value=y}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(y){this.uniforms.opacity.value=y}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(y){this.uniforms.resolution.value.copy(y)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(y){this.uniforms.sizeAttenuation.value=y}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(y){this.uniforms.dashArray.value=y,this.useDash=y!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(y){this.uniforms.dashOffset.value=y}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(y){this.uniforms.dashRatio.value=y}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(y){this.uniforms.useDash.value=y}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(y){this.uniforms.visibility.value=y}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(y){this.uniforms.alphaTest.value=y}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(y){this.uniforms.repeat.value.copy(y)}}}),b.setValues(g),b}return u}(a.ShaderMaterial);H.prototype.copy=function(l){return a.ShaderMaterial.prototype.copy.call(this,l),this.lineWidth=l.lineWidth,this.map=l.map,this.useMap=l.useMap,this.alphaMap=l.alphaMap,this.useAlphaMap=l.useAlphaMap,this.color.copy(l.color),this.opacity=l.opacity,this.resolution.copy(l.resolution),this.sizeAttenuation=l.sizeAttenuation,this.dashArray.copy(l.dashArray),this.dashOffset.copy(l.dashOffset),this.dashRatio.copy(l.dashRatio),this.useDash=l.useDash,this.visibility=l.visibility,this.alphaTest=l.alphaTest,this.repeat.copy(l.repeat),this};var X=q(607),ie=q(494),pe=q.n(ie),xe={nodes:[],color:new a.Color("red"),lineWidth:3,sizeAttenuation:0},me=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,V.Z)(this,u);var i;return i=w.call(this),i.geometry=new a.BufferGeometry,i.meshline=new x,i.options=(0,d.Z)({},xe,b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.nodes,C=i.duration,v=i.delay,f=i.onComplete,s=i.setPointWidth,e=(0,X.Z)(i,["nodes","duration","delay","onComplete","setPointWidth"]),r=this.pencil.getSize(),n=r.width,o=r.height;delete e.key,this.geometry.setFromPoints(y),this.meshline.setGeometry(this.geometry,s);var c=new H((0,E.Z)((0,d.Z)({},e),{resolution:new a.Vector2(n,o)}));this.material=c,this.createMesh(this.meshline,c)},g.resize=function(i,y){this.material.uniforms.resolution.value.set(i,y)},g.animate=function(){var i=this.options,y=i.duration,C=i.delay,v=i.onComplete,f=this.material.uniforms.offset,s=new(pe()).Tween(f.value).to({x:0},y!=null?y:1e3).delay(C!=null?C:0).repeat(1/0);v&&s.onComplete(v),s.start(),this.tween=s},g.dispose=function(){se((0,$.Z)(u.prototype),"dispose",this).call(this),this.tween&&pe().remove(this.tween)},u}(p.ZP),Ce=q(639);function Re(l){if(Array.isArray(l))return l}var O=q(375);function S(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var D=q(566);function W(l,w){return Re(l)||(0,O.Z)(l,w)||(0,D.Z)(l,w)||S()}var I=require("d3-array"),ae=require("earcut"),le=q.n(ae),ue=require("@turf/boolean-clockwise"),fe=q.n(ue);function he(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=(90-w)*Math.PI/180,b=(90-l)*Math.PI/180;return[u*Math.sin(g)*Math.cos(b),u*Math.cos(g),u*Math.sin(g)*Math.sin(b)]}var ge=q(342),Me=require("delaunator"),we=q.n(Me),Ne=require("@turf/boolean-point-in-polygon"),tt=q.n(Ne),Ae=require("d3-geo"),Te=require("d3-geo-voronoi"),Be=require("d3-scale");function He(l,w){return l.map(function(u){var g=[],b;return u.forEach(function(i){if(b){var y=(0,Ae.geoDistance)(i,b)*180/Math.PI;if(y>w)for(var C=(0,Ae.geoInterpolate)(b,i),v=1/Math.ceil(y/w),f=v;f<1;)g.push(C(f)),f+=v}g.push(b=i)}),g})}function Xe(l){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=w.minLng,g=w.maxLng,b=w.minLat,i=w.maxLat,y=Math.round(Math.pow(360/l,2)/Math.PI),C=(1+Math.sqrt(5))/2,v=function(t){return t/C*360%360-180},f=function(t){return Math.acos(2*t/y-1)/Math.PI*180-90},s=function(t){return y*(Math.cos((t+90)*Math.PI/180)+1)/2},e=[i!==void 0?Math.ceil(s(i)):0,b!==void 0?Math.floor(s(b)):y-1],r=u===void 0&&g===void 0?function(){return!0}:u===void 0?function(t){return t<=g}:g===void 0?function(t){return t>=u}:g>=u?function(t){return t>=u&&t<=g}:function(t){return t>=u||t<=g},n=[],o=e[0];o<=e[1];o++){var c=v(o);r(c)&&n.push([c,f(o)])}return n}function De(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u?(0,Ae.geoContains)(w,l):tt()(l,w)}function Ke(l,w){var u={type:"Polygon",coordinates:l},g=W((0,Ae.geoBounds)(u),2),b=W(g[0],2),i=b[0],y=b[1],C=W(g[1],2),v=C[0],f=C[1];if(Math.min(Math.abs(v-i),Math.abs(f-y))<w)return[];var s=i>v||f>=89||y<=-89;return Xe(w,{minLng:i,maxLng:v,minLat:y,maxLat:f}).filter(function(e){return De(e,u,s)})}function Ve(l){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=w.resolution,g=u===void 0?1/0:u,b=He(l,g),i=(0,I.merge)(b),y=Ke(l,g),C=(0,ge.Z)(i).concat((0,ge.Z)(y)),v={type:"Polygon",coordinates:l},f=W((0,Ae.geoBounds)(v),2),s=W(f[0],2),e=s[0],r=s[1],n=W(f[1],2),o=n[0],c=n[1],t=e>o||c>=89||r<=-89,P=[];if(t){var L=(0,Te.geoVoronoi)(C).triangles(),Z=new Map(C.map(function(ve,_e){var Pe=W(ve,2),be=Pe[0],Oe=Pe[1];return["".concat(be,"-").concat(Oe),_e]}));L.features.forEach(function(ve){var _e,Pe=ve.geometry.coordinates[0].slice(0,3).reverse(),be=[];if(Pe.forEach(function(Ee){var Se=W(Ee,2),qe=Se[0],it=Se[1],rt="".concat(qe,"-").concat(it);Z.has(rt)&&be.push(Z.get(rt))}),be.length===3){if(be.some(function(Ee){return Ee<i.length})){var Oe=ve.properties.circumcenter;if(!De(Oe,v,t))return}(_e=P).push.apply(_e,(0,ge.Z)(be))}})}else if(y.length)for(var ne=function(ve,_e){var Pe,be=[2,1,0].map(function(Se){return re.triangles[ve+Se]}),Oe=be.map(function(Se){return C[Se]});if(be.some(function(Se){return Se<i.length})){var Ee=[0,1].map(function(Se){return(0,I.mean)(Oe,function(qe){return qe[Se]})});if(!De(Ee,v,t))return"continue"}(Pe=P).push.apply(Pe,(0,ge.Z)(be))},re=we().from(C),de=0,ce=re.triangles.length;de<ce;de+=3)ne(de,ce);else{var M=le().flatten(b),F=M.vertices,Y=M.holes,Q=Y===void 0?[]:Y;P=le()(F,Q,2)}var ye=(0,Be.scaleLinear)((0,I.extent)(C,function(ve){return ve[0]}),[0,1]),je=(0,Be.scaleLinear)((0,I.extent)(C,function(ve){return ve[1]}),[0,1]),Le=C.map(function(ve){var _e=W(ve,2),Pe=_e[0],be=_e[1];return[ye(Pe),je(be)]}),ze={points:C,indices:P,uvs:Le};return{contour:b,triangles:ze}}var Fe=Ve,Ze=new a.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function ke(l,w){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,g=l.map(function(b){return b.map(function(i){var y=W(i,2),C=y[0],v=y[1];return u?he(C,v,w):[C,v,w]})});return le().flatten(g)}function Ue(l,w,u){for(var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,b=ke(l,w,g),i=b.vertices,y=b.holes,C=ke(l,u,g),v=C.vertices,f=(0,I.merge)([v,i]),s=Math.round(v.length/3),e=new Set(y),r=0,n=[],o=0;o<s;o++){var c=o+1;if(c===s)c=r;else if(e.has(c)){var t=c;c=r,r=t}n.push(o,o+s,c+s),n.push(c+s,c,o)}for(var P=[],L=1;L>=0;L--)for(var Z=0;Z<s;Z+=1)P.push(Z/(s-1),L);return{indices:n,vertices:f,uvs:P,topVerts:v}}function We(l,w,u){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,b=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:g?l.indices:l.indices.slice().reverse(),vertices:ke([l.points],w,b).vertices,uvs:u}}var Ye=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,V.Z)(this,u);var i;i=w.call(this),i.type="PolygonBufferGeometry",i.parameters=(0,d.Z)({},{polygonGeoJson:g,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},b);var y=i.parameters,C=y.startHeight,v=y.endHeight,f=y.closedBottom,s=y.closedTop,e=y.includeSides,r=y.curvatureResolution,n=y.cartesian,o=y.userDataRsoOffset;fe()(g[0])||g[0].reverse();var c=Fe(g,{resolution:r}),t=c.contour,P=c.triangles,L=(0,I.merge)(P.uvs),Z=[],M=[],F=[],Y=0,Q=function(re){var de=Math.round(Z.length/3),ce=F.length;Z=Z.concat(re.vertices),M=M.concat(re.uvs),F=F.concat(de?re.indices.map(function(ye){return ye+de}):re.indices),i.addGroup(ce,F.length-ce,Y++)};if(e){var ne=Ue(t,C,v,n);Q(ne),i.userData.rso=o?Ue(t,C,v+o,n):ne}return f&&Q(We(P,C,L,!1,n)),s&&Q(We(P,v,L,!0,n)),i.setIndex(F),i[Ze]("position",new a.Float32BufferAttribute(Z,3)),i[Ze]("uv",new a.Float32BufferAttribute(M,2)),i.computeVertexNormals(),i}return u}(a.BufferGeometry),Qe=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=(0,d.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.startHeight,C=i.height,v=i.closedBottom,f=i.closedTop,s=i.curvatureResolution,e=i.userDataRsoOffset,r=i.cartesian,n=new Ye(this.options.geojson,{startHeight:y,endHeight:y+C,closedBottom:v,closedTop:f,curvatureResolution:s,cartesian:r,userDataRsoOffset:e});this.createMesh(n,this.options.material)},u}(Ce.BaseObject),Ge=new Map,$e={generateTopUV:function(l,w,u,g,b){var i=w[u*3],y=w[u*3+1],C=w[g*3],v=w[g*3+1],f=w[b*3],s=w[b*3+1],e;if(Ge.has(l))e=Ge.get(l);else{var r,n,o,c,t=l.parameters.shapes.getPoints();e={minX:(r=Math).min.apply(r,(0,ge.Z)(t.map(function(Z){var M=Z.x;return M}))),maxX:(n=Math).max.apply(n,(0,ge.Z)(t.map(function(Z){var M=Z.x;return M}))),minY:(o=Math).min.apply(o,(0,ge.Z)(t.map(function(Z){var M=Z.y;return M}))),maxY:(c=Math).max.apply(c,(0,ge.Z)(t.map(function(Z){var M=Z.y;return M})))},Ge.set(l,e)}var P=e.maxX-e.minX,L=e.maxY-e.minY;return[new a.Vector2((i-e.minX)/P,1-(y-e.minY)/L),new a.Vector2((C-e.minX)/P,1-(v-e.minY)/L),new a.Vector2((f-e.minX)/P,1-(s-e.minY)/L)]},generateSideWallUV:function(l,w,u,g,b,i){var y=w[u*3],C=w[u*3+1],v=w[u*3+2],f=w[g*3],s=w[g*3+1],e=w[g*3+2],r=w[b*3],n=w[b*3+1],o=w[b*3+2],c=w[i*3],t=w[i*3+1],P=w[i*3+2];return Math.abs(C-s)<.01?[new a.Vector2(y,1-v),new a.Vector2(f,1-e),new a.Vector2(r,1-o),new a.Vector2(c,1-P)]:[new a.Vector2(C,1-v),new a.Vector2(s,1-e),new a.Vector2(n,1-o),new a.Vector2(t,1-P)]}},Je=function(l){"use strict";(0,T.Z)(u,l);var w=(0,j.Z)(u);function u(b){(0,V.Z)(this,u);var i;return i=w.call(this),i.options=(0,d.Z)({},b),i}var g=u.prototype;return g.create=function(){var i=this.options,y=i.points,C=i.depth,v=i.material,f=new a.ExtrudeBufferGeometry(new a.Shape(y),{depth:C,bevelEnabled:!1,UVGenerator:$e});this.createMesh(f,v)},u}(Ce.BaseObject)})(),module.exports=Ie})();
|
|
132
|
+
`),Y=function(t){"use strict";T(r,t);var i=V(r);function r(){S(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new s.Matrix4,Object.defineProperties(E(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}(s.BufferGeometry);Y.prototype.setMatrixWorld=function(t){this.matrixWorld=t},Y.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},Y.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 s.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Fe(t,i){var r=new s.Matrix4,n=new s.Ray,a=new s.Sphere,e=new s.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 s.Vector3,h=new s.Vector3,v=new s.Vector3,m=this instanceof s.LineSegments?2:1,d=o.index,y=o.attributes;if(d!==null)for(var b=d.array,g=y.position.array,_=y.width.array,f=0,O=b.length-1;f<O;f+=m){var j=b[f],I=b[f+1];u.fromArray(g,j*3),h.fromArray(g,I*3);var k=_[Math.floor(f/3)]!==void 0?_[Math.floor(f/3)]:1,ce=t.params.Line.threshold+this.material.lineWidth*k/2,Me=ce*ce,ye=n.distanceSqToSegment(u,h,e,v);if(!(ye>Me)){e.applyMatrix4(this.matrixWorld);var pe=t.ray.origin.distanceTo(e);pe<t.near||pe>t.far||(i.push({distance:pe,point:v.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}),f=O)}}}}Y.prototype.raycast=Fe,Y.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]},Y.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},Y.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 s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Te(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}Y.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},s.ShaderChunk.meshline_vert=Se,s.ShaderChunk.meshline_frag=ge;var Ee=function(t){"use strict";T(r,t);var i=V(r);function r(n){S(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)},offset:{value:new s.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new s.Vector2(0,0)},lightColor:{value:new s.Color(16777215)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(E(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(s.ShaderMaterial);Ee.prototype.copy=function(t){return s.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 Qe=require("@tweenjs/tween.js"),Ie=F.n(Qe),Je={nodes:[],color:new s.Color("red"),lineWidth:3,sizeAttenuation:0},et=function(t){"use strict";T(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};S(this,r);var e;return e=i.call(this),e.geometry=new s.BufferGeometry,e.meshline=new Y,e.options=(0,P.Z)({},Je,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,m=e.setPointWidth,d=Ke(e,["nodes","duration","delay","onComplete","setPointWidth"]),y=this.pencil.getSize(),b=y.width,g=y.height;delete d.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,m);var _=new Ee(A((0,P.Z)({},d),{resolution:new s.Vector2(b,g)}));this.material=_,this.createMesh(this.meshline,_)},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,m=new(Ie()).Tween(v.value).to({x:0},o!=null?o:1e3).delay(u!=null?u:0).repeat(1/0);h&&m.onComplete(h),m.start(),this.tween=m},n.dispose=function(){X(B(r.prototype),"dispose",this).call(this),this.tween&&Ie().remove(this.tween)},r}(se);function tt(t){if(Array.isArray(t))return t}function rt(){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 ue(t,i){return tt(t)||re(t,i)||ee(t,i)||rt()}var we=require("d3-array"),nt=require("earcut"),Be=F.n(nt),it=require("@turf/boolean-clockwise"),at=F.n(it);function ot(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 st=require("delaunator"),ut=F.n(st),ct=require("@turf/boolean-point-in-polygon"),lt=F.n(ct),Ae=require("d3-geo"),ft=require("d3-geo-voronoi"),Ze=require("d3-scale");function ht(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Ae.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var u=(0,Ae.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 pt(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},m=function(f){return o*(Math.cos((f+90)*Math.PI/180)+1)/2},d=[e!==void 0?Math.ceil(m(e)):0,a!==void 0?Math.floor(m(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(f){return f<=n}:n===void 0?function(f){return f>=r}:n>=r?function(f){return f>=r&&f<=n}:function(f){return f>=r||f<=n},b=[],g=d[0];g<=d[1];g++){var _=h(g);y(_)&&b.push([_,v(g)])}return b}function Ve(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ae.geoContains)(i,t):lt()(t,i)}function vt(t,i){var r={type:"Polygon",coordinates:t},n=ue((0,Ae.geoBounds)(r),2),a=ue(n[0],2),e=a[0],o=a[1],u=ue(n[1],2),h=u[0],v=u[1];if(Math.min(Math.abs(h-e),Math.abs(v-o))<i)return[];var m=e>h||v>=89||o<=-89;return pt(i,{minLng:e,maxLng:h,minLat:o,maxLat:v}).filter(function(d){return Ve(d,r,m)})}function dt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=ht(t,n),e=(0,we.merge)(a),o=vt(t,n),u=H(e).concat(H(o)),h={type:"Polygon",coordinates:t},v=ue((0,Ae.geoBounds)(h),2),m=ue(v[0],2),d=m[0],y=m[1],b=ue(v[1],2),g=b[0],_=b[1],f=d>g||_>=89||y<=-89,O=[];if(f){var j=(0,ft.geoVoronoi)(u).triangles(),I=new Map(u.map(function(ae,ve){var he=ue(ae,2),oe=he[0],je=he[1];return["".concat(oe,"-").concat(je),ve]}));j.features.forEach(function(ae){var ve,he=ae.geometry.coordinates[0].slice(0,3).reverse(),oe=[];if(he.forEach(function(Ce){var le=ue(Ce,2),Ge=le[0],Pt=le[1],Ye="".concat(Ge,"-").concat(Pt);I.has(Ye)&&oe.push(I.get(Ye))}),oe.length===3){if(oe.some(function(Ce){return Ce<e.length})){var je=ae.properties.circumcenter;if(!Ve(je,h,f))return}(ve=O).push.apply(ve,H(oe))}})}else if(o.length)for(var pe=function(ae,ve){var he,oe=[2,1,0].map(function(le){return be.triangles[ae+le]}),je=oe.map(function(le){return u[le]});if(oe.some(function(le){return le<e.length})){var Ce=[0,1].map(function(le){return(0,we.mean)(je,function(Ge){return Ge[le]})});if(!Ve(Ce,h,f))return"continue"}(he=O).push.apply(he,H(oe))},be=ut().from(u),xe=0,Oe=be.triangles.length;xe<Oe;xe+=3)pe(xe,Oe);else{var k=Be().flatten(a),ce=k.vertices,Me=k.holes,ye=Me===void 0?[]:Me;O=Be()(ce,ye,2)}var De=(0,Ze.scaleLinear)((0,we.extent)(u,function(ae){return ae[0]}),[0,1]),wt=(0,Ze.scaleLinear)((0,we.extent)(u,function(ae){return ae[1]}),[0,1]),Mt=u.map(function(ae){var ve=ue(ae,2),he=ve[0],oe=ve[1];return[De(he),wt(oe)]}),xt={points:u,indices:O,uvs:Mt};return{contour:a,triangles:xt}}var mt=dt,Ne=new s.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function ze(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=ue(e,2),u=o[0],h=o[1];return r?ot(u,h,i):[u,h,i]})});return Be().flatten(n)}function He(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=ze(t,i,n),e=a.vertices,o=a.holes,u=ze(t,r,n),h=u.vertices,v=(0,we.merge)([h,e]),m=Math.round(h.length/3),d=new Set(o),y=0,b=[],g=0;g<m;g++){var _=g+1;if(_===m)_=y;else if(d.has(_)){var f=_;_=y,y=f}b.push(g,g+m,_+m),b.push(_+m,_,g)}for(var O=[],j=1;j>=0;j--)for(var I=0;I<m;I+=1)O.push(I/(m-1),j);return{indices:b,vertices:v,uvs:O,topVerts:h}}function Xe(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:ze([t.points],i,a).vertices,uvs:r}}var gt=function(t){"use strict";T(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};S(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,P.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,m=o.closedTop,d=o.includeSides,y=o.curvatureResolution,b=o.cartesian,g=o.userDataRsoOffset;at()(n[0])||n[0].reverse();var _=mt(n,{resolution:y}),f=_.contour,O=_.triangles,j=(0,we.merge)(O.uvs),I=[],k=[],ce=[],Me=0,ye=function(be){var xe=Math.round(I.length/3),Oe=ce.length;I=I.concat(be.vertices),k=k.concat(be.uvs),ce=ce.concat(xe?be.indices.map(function(De){return De+xe}):be.indices),e.addGroup(Oe,ce.length-Oe,Me++)};if(d){var pe=He(f,u,h,b);ye(pe),e.userData.rso=g?He(f,u,h+g,b):pe}return v&&ye(Xe(O,u,j,!1,b)),m&&ye(Xe(O,h,j,!0,b)),e.setIndex(ce),e[Ne]("position",new s.Float32BufferAttribute(I,3)),e[Ne]("uv",new s.Float32BufferAttribute(k,2)),e.computeVertexNormals(),e}return r}(s.BufferGeometry),yt=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=(0,P.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,m=e.curvatureResolution,d=e.userDataRsoOffset,y=e.cartesian,b=new gt(this.options.geojson,{startHeight:o,endHeight:o+u,closedBottom:h,closedTop:v,curvatureResolution:m,cartesian:y,userDataRsoOffset:d});this.createMesh(b,this.options.material)},r}(se),We=new Map,bt={generateTopUV:function(t,i,r,n,a){var e=i[r*3],o=i[r*3+1],u=i[n*3],h=i[n*3+1],v=i[a*3],m=i[a*3+1],d;if(We.has(t))d=We.get(t);else{var y,b,g,_,f=t.parameters.shapes.getPoints();d={minX:(y=Math).min.apply(y,H(f.map(function(I){var k=I.x;return k}))),maxX:(b=Math).max.apply(b,H(f.map(function(I){var k=I.x;return k}))),minY:(g=Math).min.apply(g,H(f.map(function(I){var k=I.y;return k}))),maxY:(_=Math).max.apply(_,H(f.map(function(I){var k=I.y;return k})))},We.set(t,d)}var O=d.maxX-d.minX,j=d.maxY-d.minY;return[new s.Vector2((e-d.minX)/O,1-(o-d.minY)/j),new s.Vector2((u-d.minX)/O,1-(h-d.minY)/j),new s.Vector2((v-d.minX)/O,1-(m-d.minY)/j)]},generateSideWallUV:function(t,i,r,n,a,e){var o=i[r*3],u=i[r*3+1],h=i[r*3+2],v=i[n*3],m=i[n*3+1],d=i[n*3+2],y=i[a*3],b=i[a*3+1],g=i[a*3+2],_=i[e*3],f=i[e*3+1],O=i[e*3+2];return Math.abs(u-m)<.01?[new s.Vector2(o,1-h),new s.Vector2(v,1-d),new s.Vector2(y,1-g),new s.Vector2(_,1-O)]:[new s.Vector2(u,1-h),new s.Vector2(m,1-d),new s.Vector2(b,1-g),new s.Vector2(f,1-O)]}},_t=function(t){"use strict";T(r,t);var i=V(r);function r(a){S(this,r);var e;return e=i.call(this),e.options=(0,P.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 s.ExtrudeBufferGeometry(new s.Shape(o),{depth:u,bevelEnabled:!1,UVGenerator:bt});this.createMesh(v,h)},r}(se)})(),module.exports=Re})();
|