gl-draw 0.0.8 → 0.0.9

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.
@@ -55,7 +55,7 @@ export default class Pencil {
55
55
  gui?: GUI;
56
56
  private resizeObserver?;
57
57
  private raycaster;
58
- installPlugins: Map<string, any>;
58
+ installPlugins: Map<any, boolean>;
59
59
  get renderer(): THREE.WebGLRenderer | undefined;
60
60
  get control(): import("three/examples/jsm/controls/OrbitControls").OrbitControls | undefined;
61
61
  get camera(): THREE.PerspectiveCamera | undefined;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){var Fe={187:function(O){"use strict";var R=typeof Reflect=="object"?Reflect:null,C=R&&typeof R.apply=="function"?R.apply:function(l,p,b){return Function.prototype.apply.call(l,p,b)},G;R&&typeof R.ownKeys=="function"?G=R.ownKeys:Object.getOwnPropertySymbols?G=function(l){return Object.getOwnPropertyNames(l).concat(Object.getOwnPropertySymbols(l))}:G=function(l){return Object.getOwnPropertyNames(l)};function A(f){console&&console.warn&&console.warn(f)}var j=Number.isNaN||function(l){return l!==l};function m(){m.init.call(this)}O.exports=m,O.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var D=10;function V(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 D},set:function(f){if(typeof f!="number"||f<0||j(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");D=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(l){if(typeof l!="number"||l<0||j(l))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+l+".");return this._maxListeners=l,this};function k(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return k(this)},m.prototype.emit=function(l){for(var p=[],b=1;b<arguments.length;b++)p.push(arguments[b]);var w=l==="error",E=this._events;if(E!==void 0)w=w&&E.error===void 0;else if(!w)return!1;if(w){var T;if(p.length>0&&(T=p[0]),T instanceof Error)throw T;var z=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw z.context=T,z}var ie=E[l];if(ie===void 0)return!1;if(typeof ie=="function")C(ie,this,p);else for(var le=ie.length,ce=ne(ie,le),b=0;b<le;++b)C(ce[b],this,p);return!0};function B(f,l,p,b){var w,E,T;if(V(p),E=f._events,E===void 0?(E=f._events=Object.create(null),f._eventsCount=0):(E.newListener!==void 0&&(f.emit("newListener",l,p.listener?p.listener:p),E=f._events),T=E[l]),T===void 0)T=E[l]=p,++f._eventsCount;else if(typeof T=="function"?T=E[l]=b?[p,T]:[T,p]:b?T.unshift(p):T.push(p),w=k(f),w>0&&T.length>w&&!T.warned){T.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(l)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=f,z.type=l,z.count=T.length,A(z)}return f}m.prototype.addListener=function(l,p){return B(this,l,p,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(l,p){return B(this,l,p,!0)};function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function X(f,l,p){var b={fired:!1,wrapFn:void 0,target:f,type:l,listener:p},w=I.bind(b);return w.listener=p,b.wrapFn=w,w}m.prototype.once=function(l,p){return V(p),this.on(l,X(this,l,p)),this},m.prototype.prependOnceListener=function(l,p){return V(p),this.prependListener(l,X(this,l,p)),this},m.prototype.removeListener=function(l,p){var b,w,E,T,z;if(V(p),w=this._events,w===void 0)return this;if(b=w[l],b===void 0)return this;if(b===p||b.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete w[l],w.removeListener&&this.emit("removeListener",l,b.listener||p));else if(typeof b!="function"){for(E=-1,T=b.length-1;T>=0;T--)if(b[T]===p||b[T].listener===p){z=b[T].listener,E=T;break}if(E<0)return this;E===0?b.shift():re(b,E),b.length===1&&(w[l]=b[0]),w.removeListener!==void 0&&this.emit("removeListener",l,z||p)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(l){var p,b,w;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[l]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[l]),this;if(arguments.length===0){var E=Object.keys(b),T;for(w=0;w<E.length;++w)T=E[w],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=b[l],typeof p=="function")this.removeListener(l,p);else if(p!==void 0)for(w=p.length-1;w>=0;w--)this.removeListener(l,p[w]);return this};function N(f,l,p){var b=f._events;if(b===void 0)return[];var w=b[l];return w===void 0?[]:typeof w=="function"?p?[w.listener||w]:[w]:p?F(w):ne(w,w.length)}m.prototype.listeners=function(l){return N(this,l,!0)},m.prototype.rawListeners=function(l){return N(this,l,!1)},m.listenerCount=function(f,l){return typeof f.listenerCount=="function"?f.listenerCount(l):v.call(f,l)},m.prototype.listenerCount=v;function v(f){var l=this._events;if(l!==void 0){var p=l[f];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ne(f,l){for(var p=new Array(l),b=0;b<l;++b)p[b]=f[b];return p}function re(f,l){for(;l+1<f.length;l++)f[l]=f[l+1];f.pop()}function F(f){for(var l=new Array(f.length),p=0;p<l.length;++p)l[p]=f[p].listener||f[p];return l}function $(f,l){return new Promise(function(p,b){function w(T){f.removeListener(l,E),b(T)}function E(){typeof f.removeListener=="function"&&f.removeListener("error",w),p([].slice.call(arguments))}U(f,l,E,{once:!0}),l!=="error"&&L(f,w,{once:!0})})}function L(f,l,p){typeof f.on=="function"&&U(f,"error",l,p)}function U(f,l,p,b){if(typeof f.on=="function")b.once?f.once(l,p):f.on(l,p);else if(typeof f.addEventListener=="function")f.addEventListener(l,function w(E){b.once&&f.removeEventListener(l,w),p(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(O){var R=function(C){"use strict";var G=Object.prototype,A=G.hasOwnProperty,j,m=typeof Symbol=="function"?Symbol:{},D=m.iterator||"@@iterator",V=m.asyncIterator||"@@asyncIterator",k=m.toStringTag||"@@toStringTag";function B(h,c,g){return Object.defineProperty(h,c,{value:g,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{B({},"")}catch(h){B=function(c,g,x){return c[g]=x}}function I(h,c,g,x){var S=c&&c.prototype instanceof $?c:$,H=Object.create(S.prototype),Q=new ce(x||[]);return H._invoke=T(h,g,Q),H}C.wrap=I;function X(h,c,g){try{return{type:"normal",arg:h.call(c,g)}}catch(x){return{type:"throw",arg:x}}}var N="suspendedStart",v="suspendedYield",ne="executing",re="completed",F={};function $(){}function L(){}function U(){}var f={};B(f,D,function(){return this});var l=Object.getPrototypeOf,p=l&&l(l(me([])));p&&p!==G&&A.call(p,D)&&(f=p);var b=U.prototype=$.prototype=Object.create(f);L.prototype=U,B(b,"constructor",U),B(U,"constructor",L),L.displayName=B(U,k,"GeneratorFunction");function w(h){["next","throw","return"].forEach(function(c){B(h,c,function(g){return this._invoke(c,g)})})}C.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return c?c===L||(c.displayName||c.name)==="GeneratorFunction":!1},C.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,U):(h.__proto__=U,B(h,k,"GeneratorFunction")),h.prototype=Object.create(b),h},C.awrap=function(h){return{__await:h}};function E(h,c){function g(H,Q,K,te){var ee=X(h[H],h,Q);if(ee.type==="throw")te(ee.arg);else{var ve=ee.arg,de=ve.value;return de&&typeof de=="object"&&A.call(de,"__await")?c.resolve(de.__await).then(function(oe){g("next",oe,K,te)},function(oe){g("throw",oe,K,te)}):c.resolve(de).then(function(oe){ve.value=oe,K(ve)},function(oe){return g("throw",oe,K,te)})}}var x;function S(H,Q){function K(){return new c(function(te,ee){g(H,Q,te,ee)})}return x=x?x.then(K,K):K()}this._invoke=S}w(E.prototype),B(E.prototype,V,function(){return this}),C.AsyncIterator=E,C.async=function(h,c,g,x,S){S===void 0&&(S=Promise);var H=new E(I(h,c,g,x),S);return C.isGeneratorFunction(c)?H:H.next().then(function(Q){return Q.done?Q.value:H.next()})};function T(h,c,g){var x=N;return function(H,Q){if(x===ne)throw new Error("Generator is already running");if(x===re){if(H==="throw")throw Q;return ge()}for(g.method=H,g.arg=Q;;){var K=g.delegate;if(K){var te=z(K,g);if(te){if(te===F)continue;return te}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(x===N)throw x=re,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);x=ne;var ee=X(h,c,g);if(ee.type==="normal"){if(x=g.done?re:v,ee.arg===F)continue;return{value:ee.arg,done:g.done}}else ee.type==="throw"&&(x=re,g.method="throw",g.arg=ee.arg)}}}function z(h,c){var g=h.iterator[c.method];if(g===j){if(c.delegate=null,c.method==="throw"){if(h.iterator.return&&(c.method="return",c.arg=j,z(h,c),c.method==="throw"))return F;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return F}var x=X(g,h.iterator,c.arg);if(x.type==="throw")return c.method="throw",c.arg=x.arg,c.delegate=null,F;var S=x.arg;if(!S)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,F;if(S.done)c[h.resultName]=S.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=j);else return S;return c.delegate=null,F}w(b),B(b,k,"Generator"),B(b,D,function(){return this}),B(b,"toString",function(){return"[object Generator]"});function ie(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function le(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function ce(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(ie,this),this.reset(!0)}C.keys=function(h){var c=[];for(var g in h)c.push(g);return c.reverse(),function x(){for(;c.length;){var S=c.pop();if(S in h)return x.value=S,x.done=!1,x}return x.done=!0,x}};function me(h){if(h){var c=h[D];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var g=-1,x=function S(){for(;++g<h.length;)if(A.call(h,g))return S.value=h[g],S.done=!1,S;return S.value=j,S.done=!0,S};return x.next=x}}return{next:ge}}C.values=me;function ge(){return{value:j,done:!0}}return ce.prototype={constructor:ce,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=j,this.done=!1,this.delegate=null,this.method="next",this.arg=j,this.tryEntries.forEach(le),!h)for(var c in this)c.charAt(0)==="t"&&A.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=j)},stop:function(){this.done=!0;var h=this.tryEntries[0],c=h.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var c=this;function g(te,ee){return H.type="throw",H.arg=h,c.next=te,ee&&(c.method="next",c.arg=j),!!ee}for(var x=this.tryEntries.length-1;x>=0;--x){var S=this.tryEntries[x],H=S.completion;if(S.tryLoc==="root")return g("end");if(S.tryLoc<=this.prev){var Q=A.call(S,"catchLoc"),K=A.call(S,"finallyLoc");if(Q&&K){if(this.prev<S.catchLoc)return g(S.catchLoc,!0);if(this.prev<S.finallyLoc)return g(S.finallyLoc)}else if(Q){if(this.prev<S.catchLoc)return g(S.catchLoc,!0)}else if(K){if(this.prev<S.finallyLoc)return g(S.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(h,c){for(var g=this.tryEntries.length-1;g>=0;--g){var x=this.tryEntries[g];if(x.tryLoc<=this.prev&&A.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var S=x;break}}S&&(h==="break"||h==="continue")&&S.tryLoc<=c&&c<=S.finallyLoc&&(S=null);var H=S?S.completion:{};return H.type=h,H.arg=c,S?(this.method="next",this.next=S.finallyLoc,F):this.complete(H)},complete:function(h,c){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&c&&(this.next=c),F},finish:function(h){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.finallyLoc===h)return this.complete(g.completion,g.afterLoc),le(g),F}},catch:function(h){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.tryLoc===h){var x=g.completion;if(x.type==="throw"){var S=x.arg;le(g)}return S}}throw new Error("illegal catch attempt")},delegateYield:function(h,c,g){return this.delegate={iterator:me(h),resultName:c,nextLoc:g},this.method==="next"&&(this.arg=j),F}},C}(O.exports);try{regeneratorRuntime=R}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(O,R,C){"use strict";C.d(R,{Z:function(){return G}});function G(A){if(A.geometry&&A.geometry.dispose(),A.material){var j=Array.isArray(A.material)?A.material:[A.material];j.forEach(function(m){var D,V,k,B,I,X,N,v,ne,re,F,$,L;(D=m.map)===null||D===void 0||D.dispose(),(V=m.lightMap)===null||V===void 0||V.dispose(),(k=m.bumpMap)===null||k===void 0||k.dispose(),(B=m.normalMap)===null||B===void 0||B.dispose(),(I=m.specularMap)===null||I===void 0||I.dispose(),(X=m.envMap)===null||X===void 0||X.dispose(),(N=m.alphaMap)===null||N===void 0||N.dispose(),(v=m.aoMap)===null||v===void 0||v.dispose(),(ne=m.displacementMap)===null||ne===void 0||ne.dispose(),(re=m.emissiveMap)===null||re===void 0||re.dispose(),(F=m.gradientMap)===null||F===void 0||F.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(L=m.roughnessMap)===null||L===void 0||L.dispose(),m.dispose()})}}},519:function(O,R,C){"use strict";C.d(R,{disposeMesh:function(){return m.Z},isPlainObject:function(){return k.Z}});var G=C(666),A=C.n(G),j=null,m=C(695),D=C(644);function V(F){if(F.material){var $=Array.isArray(F.material)?F.material:[F.material];$.forEach(function(L){var U,f;(U=L.color)===null||U===void 0||U.convertSRGBToLinear(),(f=L.emissive)===null||f===void 0||f.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var k=C(738),B=C(568),I=C(924),X=require("idb-keyval"),N=C(484),v=null,ne=null,re=function(){var F=(0,B.Z)(A().mark(function $(L,U){var f,l,p,b,w,E;return A().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return f=U.version,z.next=4,(0,X.get)(L);case 4:if(p=z.sent,!(p&&p[f])){z.next=9;break}l=p[f],z.next=15;break;case 9:return z.next=11,(0,N.Z)(fetch(L).then(function(ie){if(ie.ok)return ie.blob();throw new Error}));case 11:b=z.sent,w=b.res,E=b.err,E||(l=w,(0,X.set)(L,(0,I.Z)({},f,w)));case 15:return z.abrupt("return",l?{url:URL.createObjectURL(l)}:{url:L});case 16:case"end":return z.stop()}},$)}));return function(L,U){return F.apply(this,arguments)}}()},738:function(O,R,C){"use strict";C.d(R,{Z:function(){return A}});function G(j){return Object.prototype.toString.call(j)==="[object Object]"}function A(j){if(G(j)===!1)return!1;var m=j.constructor;if(m===void 0)return!0;var D=m.prototype;return!(G(D)===!1||D.hasOwnProperty("isPrototypeOf")===!1)}},484:function(O,R,C){"use strict";C.d(R,{Z:function(){return A}});var G=C(42);function A(j){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(D){return(0,G.Z)({err:null,res:D},m)}).catch(function(D){return(0,G.Z)({err:D,res:void 0},m)})}},644:function(O){"use strict";O.exports=require("three")},568:function(O,R,C){"use strict";C.d(R,{Z:function(){return A}});function G(j,m,D,V,k,B,I){try{var X=j[B](I),N=X.value}catch(v){D(v);return}X.done?m(N):Promise.resolve(N).then(V,k)}function A(j){return function(){var m=this,D=arguments;return new Promise(function(V,k){var B=j.apply(m,D);function I(N){G(B,V,k,I,X,"next",N)}function X(N){G(B,V,k,I,X,"throw",N)}I(void 0)})}}},924:function(O,R,C){"use strict";C.d(R,{Z:function(){return G}});function G(A,j,m){return j in A?Object.defineProperty(A,j,{value:m,enumerable:!0,configurable:!0,writable:!0}):A[j]=m,A}},42:function(O,R,C){"use strict";C.d(R,{Z:function(){return A}});var G=C(924);function A(j){for(var m=1;m<arguments.length;m++){var D=arguments[m]!=null?arguments[m]:{},V=Object.keys(D);typeof Object.getOwnPropertySymbols=="function"&&(V=V.concat(Object.getOwnPropertySymbols(D).filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable}))),V.forEach(function(k){(0,G.Z)(j,k,D[k])})}return j}}},Oe={};function q(O){var R=Oe[O];if(R!==void 0)return R.exports;var C=Oe[O]={exports:{}};return Fe[O](C,C.exports,q),C.exports}(function(){q.n=function(O){var R=O&&O.__esModule?function(){return O.default}:function(){return O};return q.d(R,{a:R}),R}})(),function(){q.d=function(O,R){for(var C in R)q.o(R,C)&&!q.o(O,C)&&Object.defineProperty(O,C,{enumerable:!0,get:R[C]})}}(),function(){q.o=function(O,R){return Object.prototype.hasOwnProperty.call(O,R)}}(),function(){q.r=function(O){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(O,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";q.r(ye),q.d(ye,{BaseObject:function(){return ct},Pencil:function(){return Ce},default:function(){return Ce}});function O(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}function R(u,a){for(var n=0;n<a.length;n++){var e=a[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(u,e.key,e)}}function C(u,a,n){return a&&R(u.prototype,a),n&&R(u,n),u}var G=q(42);function A(u,a){var n=Object.keys(u);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(u);a&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),n.push.apply(n,e)}return n}function j(u,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):A(Object(a)).forEach(function(n){Object.defineProperty(u,n,Object.getOwnPropertyDescriptor(a,n))}),u}function m(u,a){(a==null||a>u.length)&&(a=u.length);for(var n=0,e=new Array(a);n<a;n++)e[n]=u[n];return e}function D(u){if(Array.isArray(u))return m(u)}function V(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function k(){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 B(u,a){if(!!u){if(typeof u=="string")return m(u,a);var n=Object.prototype.toString.call(u).slice(8,-1);if(n==="Object"&&u.constructor&&(n=u.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(u,a)}}function I(u){return D(u)||V(u)||B(u)||k()}var X=require("@tweenjs/tween.js"),N=q.n(X),v=q(644),ne=q(187),re=require("deepmerge"),F=q.n(re),$=require("three/examples/jsm/libs/stats.module"),L=q.n($),U=require("lil-gui"),f=q.n(U),l=function(){"use strict";function u(){O(this,u),this.guiParams={}}var a=u.prototype;return a.showGuiParams=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(t){var s=e.addFolder(t),o=r.guiParams[t];Object.keys(o).forEach(function(i){var d=o[i],P=d.min,y=d.max,_=d.step,M=d.name,Z=d.to,W=d.paramMap,J=d.items,se=d.value,ae=d.target,ue=i.toLowerCase().indexOf("color")>-1,Y,pe=typeof se=="undefined"&&ae,fe=pe?ae():o[i],he=pe?i:"value";J?Y=s.add(fe,he,J):ue?Y=s.addColor(fe,he):Y=s.add(fe,he),Y=Y.name(M||i),typeof P!="undefined"&&(Y=Y.min(P)),typeof y!="undefined"&&(Y=Y.max(y)),typeof _!="undefined"&&(Y=Y.step(_)),Y=Y.onChange(function(){r.setGuiTargetValue(t,i,fe[he],W)}),(Z||pe)&&Y.listen()})})},a.setGuiTargetValue=function(e,r,t,s){var o=this.guiParams[e][r],i=o.onChange,d=o.target,P=o.value,y=r.toLowerCase().indexOf("color")>-1,_=typeof P=="undefined"&&d;if(d&&!_){var M=d();Array.isArray(M)||(M=[M]),M.forEach(function(Z){if(!!Z)if(y)try{Z[s||r].set(t)}catch(W){r!=="color"&&!s&&console.warn("".concat(r," is not a color,set paramMap"))}else Z[s||r]=t})}i&&i(t)},a.setGuiTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(t){var s=e.guiParams[r][t];typeof s.value!="undefined"&&e.setGuiTargetValue(r,t,s.value,s.paramMap)})})},a.guiParamTween=function(e,r,t){var s=t.duration,o=s===void 0?0:s,i=this,d=this.guiParams[e][r],P=d.to,y=d.paramMap,_=y===void 0?"":y;return new(N()).Tween(this.guiParams[e][r]).to({value:P},o).onUpdate(function(M){i.setGuiTargetValue(e,r,M.value,_)})},u}(),p={None:v.NoToneMapping,Linear:v.LinearToneMapping,Reinhard:v.ReinhardToneMapping,Cineon:v.CineonToneMapping,ACESFilmic:v.ACESFilmicToneMapping},b={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:v.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},w=function(){"use strict";function u(n){O(this,u),this.options=n;var e=n.width,r=n.height,t=n.rendererParams,s=t.alpha,o=t.devicePixelRatio,i=t.antialias,d=t.powerPreference,P=t.toneMapping,y=t.toneMappingExposure,_=t.outputEncoding,M=t.logarithmicDepthBuffer,Z=t.preserveDrawingBuffer,W=new v.WebGLRenderer({alpha:s,antialias:i,powerPreference:d,logarithmicDepthBuffer:M,preserveDrawingBuffer:Z});W.setSize(e,r),W.setPixelRatio(o),W.autoClear=!1,W.toneMapping=p[P],W.toneMappingExposure=y,W.outputEncoding=_,this.renderer=W}var a=u.prototype;return a.setSize=function(e,r){this.renderer.setSize(e,r)},a.render=function(){var e=this.options,r=e.scene,t=e.camera;this.renderer.render(r,t)},a.setGui=function(e){var r=this,t=new l;t.guiParams={renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:p,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}},t.showGuiParams(e)},a.dispose=function(){var e,r,t;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(t=this.renderer)===null||t===void 0||t.renderLists.dispose(),this.renderer=void 0},u}(),E={fov:45,near:1,far:1e3},T=function(){"use strict";function u(n){O(this,u),this.oldCameraPosition=new v.Vector3,this.oldCameraRotation=new v.Euler,this.customCamera=!1,this.options=n;var e=n.isdev,r=n.width,t=n.height,s=n.cameraParams;if(s instanceof v.Camera)this.camera=s,this.customCamera=!0;else{var o=s.fov,i=s.far,d=s.near,P=new v.PerspectiveCamera(o,r/t,d,i);(!o||!i)&&e&&(console.warn("camera.fov \u9ED8\u8BA4\u503C\u4E3A 45\uFF0C\u65E7\u7248\u672C\u4E3A 12"),console.warn("camera.far \u9ED8\u8BA4\u503C\u4E3A 1000\uFF0C\u65E7\u7248\u672C\u4E3A 20000")),P.position.set(0,0,400),P.lookAt(0,0,0),this.camera=P}}var a=u.prototype;return a.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},a.setSize=function(e,r){this.camera instanceof v.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},a.dispose=function(){this.camera=void 0},a.setGui=function(e){var r=this,t=new l;t.guiParams={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(s){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(s){r.camera.updateProjectionMatrix()}}}},this.camera instanceof v.PerspectiveCamera&&(t.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(s){r.camera.updateProjectionMatrix()}}),t.showGuiParams(e)},u}(),z=q(519),ie={background:null},le=function(){"use strict";function u(n){O(this,u),this.options=n;var e=n.camera,r=n.sceneParams,t=r.background,s=new v.Scene;t&&(s.background=t),s.add(e),this.scene=s}var a=u.prototype;return a.addAxesHelper=function(){var e,r=new v.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},a.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,z.disposeMesh)(r)}),this.scene=void 0},u}(),ce=require("three/examples/jsm/controls/OrbitControls"),me={},ge=function(){"use strict";function u(n){O(this,u),this.options=n;var e=n.camera,r=n.controlParams,t=n.mapControl,s=r.domElement,o=t?new ce.MapControls(e,s):new ce.OrbitControls(e,s);o.minPolarAngle=Math.PI*.15,o.maxPolarAngle=Math.PI*.85,o.enableDamping=!0,o.dampingFactor=.063,o.autoRotate=!1,o.autoRotateSpeed=-60,o.enableZoom=!0,o.zoomSpeed=.2,this.control=o}var a=u.prototype;return a.limitPan=function(e){var r=e.maxX,t=r===void 0?1/0:r,s=e.minX,o=s===void 0?-1/0:s,i=e.maxZ,d=i===void 0?1/0:i,P=e.minZ,y=P===void 0?-1/0:P,_=e.maxY,M=_===void 0?1/0:_,Z=e.minY,W=Z===void 0?-1/0:Z,J=this.limitPanV||new v.Vector3,se=this.control,ae=this.options.camera,ue=new v.Vector3(o,W,y),Y=new v.Vector3(t,M,d);this.limitPanV=J,J.copy(se.target),se.target.clamp(ue,Y),J.sub(se.target),ae.position.sub(J)},a.update=function(){var e;(e=this.control)===null||e===void 0||e.update()},a.dispose=function(){var e;(e=this.control)===null||e===void 0||e.dispose(),this.control=void 0},u}(),h=require("three/examples/jsm/renderers/CSS2DRenderer"),c=require("three/examples/jsm/renderers/CSS3DRenderer"),g={zIndex:"auto"},x=function(){"use strict";function u(n){O(this,u),this.container=n}var a=u.prototype;return a.addRenderer=function(e,r){var t=this.container,s=t.offsetWidth,o=t.offsetHeight,i=e==="css2d"?new h.CSS2DRenderer:new c.CSS3DRenderer;i.domElement.style.position="absolute",i.domElement.style.top="0",i.domElement.style.pointerEvents="none",i.domElement.style.zIndex=r.zIndex,i.setSize(s,o),t.appendChild(i.domElement),e==="css2d"?this.css2Drenderer=i:e==="css3d"&&(this.css3Drenderer=i)},a.setSize=function(e,r){var t,s;(t=this.css2Drenderer)===null||t===void 0||t.setSize(e,r),(s=this.css3Drenderer)===null||s===void 0||s.setSize(e,r)},a.render=function(e,r){var t,s;(t=this.css2Drenderer)===null||t===void 0||t.render(e,r),(s=this.css3Drenderer)===null||s===void 0||s.render(e,r)},a.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},u}(),S=require("three/examples/jsm/postprocessing/EffectComposer"),H=require("three/examples/jsm/postprocessing/RenderPass"),Q=require("three/examples/jsm/postprocessing/ShaderPass"),K=require("three/examples/jsm/shaders/CopyShader"),te=require("three/examples/jsm/shaders/GammaCorrectionShader"),ee=require("three/examples/jsm/postprocessing/SMAAPass"),ve=require("three/examples/jsm/postprocessing/SSAARenderPass"),de=require("three/examples/jsm/shaders/FXAAShader"),oe=function(){try{var u=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&u.getContext("webgl2"))}catch(a){return!1}},ht=0,Ue=1,be=!1,Re=oe()!==!1,ke=`varying vec2 vUv;
1
+ (function(){var Fe={187:function(O){"use strict";var T=typeof Reflect=="object"?Reflect:null,C=T&&typeof T.apply=="function"?T.apply:function(l,p,b){return Function.prototype.apply.call(l,p,b)},G;T&&typeof T.ownKeys=="function"?G=T.ownKeys:Object.getOwnPropertySymbols?G=function(l){return Object.getOwnPropertyNames(l).concat(Object.getOwnPropertySymbols(l))}:G=function(l){return Object.getOwnPropertyNames(l)};function A(f){console&&console.warn&&console.warn(f)}var M=Number.isNaN||function(l){return l!==l};function m(){m.init.call(this)}O.exports=m,O.exports.once=$,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var D=10;function V(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 D},set:function(f){if(typeof f!="number"||f<0||M(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");D=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(l){if(typeof l!="number"||l<0||M(l))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+l+".");return this._maxListeners=l,this};function k(f){return f._maxListeners===void 0?m.defaultMaxListeners:f._maxListeners}m.prototype.getMaxListeners=function(){return k(this)},m.prototype.emit=function(l){for(var p=[],b=1;b<arguments.length;b++)p.push(arguments[b]);var w=l==="error",E=this._events;if(E!==void 0)w=w&&E.error===void 0;else if(!w)return!1;if(w){var j;if(p.length>0&&(j=p[0]),j instanceof Error)throw j;var z=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw z.context=j,z}var ae=E[l];if(ae===void 0)return!1;if(typeof ae=="function")C(ae,this,p);else for(var le=ae.length,ce=ie(ae,le),b=0;b<le;++b)C(ce[b],this,p);return!0};function B(f,l,p,b){var w,E,j;if(V(p),E=f._events,E===void 0?(E=f._events=Object.create(null),f._eventsCount=0):(E.newListener!==void 0&&(f.emit("newListener",l,p.listener?p.listener:p),E=f._events),j=E[l]),j===void 0)j=E[l]=p,++f._eventsCount;else if(typeof j=="function"?j=E[l]=b?[p,j]:[j,p]:b?j.unshift(p):j.push(p),w=k(f),w>0&&j.length>w&&!j.warned){j.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(l)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=f,z.type=l,z.count=j.length,A(z)}return f}m.prototype.addListener=function(l,p){return B(this,l,p,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(l,p){return B(this,l,p,!0)};function I(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function W(f,l,p){var b={fired:!1,wrapFn:void 0,target:f,type:l,listener:p},w=I.bind(b);return w.listener=p,b.wrapFn=w,w}m.prototype.once=function(l,p){return V(p),this.on(l,W(this,l,p)),this},m.prototype.prependOnceListener=function(l,p){return V(p),this.prependListener(l,W(this,l,p)),this},m.prototype.removeListener=function(l,p){var b,w,E,j,z;if(V(p),w=this._events,w===void 0)return this;if(b=w[l],b===void 0)return this;if(b===p||b.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete w[l],w.removeListener&&this.emit("removeListener",l,b.listener||p));else if(typeof b!="function"){for(E=-1,j=b.length-1;j>=0;j--)if(b[j]===p||b[j].listener===p){z=b[j].listener,E=j;break}if(E<0)return this;E===0?b.shift():ne(b,E),b.length===1&&(w[l]=b[0]),w.removeListener!==void 0&&this.emit("removeListener",l,z||p)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(l){var p,b,w;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[l]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[l]),this;if(arguments.length===0){var E=Object.keys(b),j;for(w=0;w<E.length;++w)j=E[w],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=b[l],typeof p=="function")this.removeListener(l,p);else if(p!==void 0)for(w=p.length-1;w>=0;w--)this.removeListener(l,p[w]);return this};function N(f,l,p){var b=f._events;if(b===void 0)return[];var w=b[l];return w===void 0?[]:typeof w=="function"?p?[w.listener||w]:[w]:p?F(w):ie(w,w.length)}m.prototype.listeners=function(l){return N(this,l,!0)},m.prototype.rawListeners=function(l){return N(this,l,!1)},m.listenerCount=function(f,l){return typeof f.listenerCount=="function"?f.listenerCount(l):v.call(f,l)},m.prototype.listenerCount=v;function v(f){var l=this._events;if(l!==void 0){var p=l[f];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]};function ie(f,l){for(var p=new Array(l),b=0;b<l;++b)p[b]=f[b];return p}function ne(f,l){for(;l+1<f.length;l++)f[l]=f[l+1];f.pop()}function F(f){for(var l=new Array(f.length),p=0;p<l.length;++p)l[p]=f[p].listener||f[p];return l}function $(f,l){return new Promise(function(p,b){function w(j){f.removeListener(l,E),b(j)}function E(){typeof f.removeListener=="function"&&f.removeListener("error",w),p([].slice.call(arguments))}U(f,l,E,{once:!0}),l!=="error"&&L(f,w,{once:!0})})}function L(f,l,p){typeof f.on=="function"&&U(f,"error",l,p)}function U(f,l,p,b){if(typeof f.on=="function")b.once?f.once(l,p):f.on(l,p);else if(typeof f.addEventListener=="function")f.addEventListener(l,function w(E){b.once&&f.removeEventListener(l,w),p(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}},666:function(O){var T=function(C){"use strict";var G=Object.prototype,A=G.hasOwnProperty,M,m=typeof Symbol=="function"?Symbol:{},D=m.iterator||"@@iterator",V=m.asyncIterator||"@@asyncIterator",k=m.toStringTag||"@@toStringTag";function B(h,c,g){return Object.defineProperty(h,c,{value:g,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{B({},"")}catch(h){B=function(c,g,x){return c[g]=x}}function I(h,c,g,x){var S=c&&c.prototype instanceof $?c:$,H=Object.create(S.prototype),Q=new ce(x||[]);return H._invoke=j(h,g,Q),H}C.wrap=I;function W(h,c,g){try{return{type:"normal",arg:h.call(c,g)}}catch(x){return{type:"throw",arg:x}}}var N="suspendedStart",v="suspendedYield",ie="executing",ne="completed",F={};function $(){}function L(){}function U(){}var f={};B(f,D,function(){return this});var l=Object.getPrototypeOf,p=l&&l(l(me([])));p&&p!==G&&A.call(p,D)&&(f=p);var b=U.prototype=$.prototype=Object.create(f);L.prototype=U,B(b,"constructor",U),B(U,"constructor",L),L.displayName=B(U,k,"GeneratorFunction");function w(h){["next","throw","return"].forEach(function(c){B(h,c,function(g){return this._invoke(c,g)})})}C.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return c?c===L||(c.displayName||c.name)==="GeneratorFunction":!1},C.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,U):(h.__proto__=U,B(h,k,"GeneratorFunction")),h.prototype=Object.create(b),h},C.awrap=function(h){return{__await:h}};function E(h,c){function g(H,Q,K,re){var J=W(h[H],h,Q);if(J.type==="throw")re(J.arg);else{var ve=J.arg,de=ve.value;return de&&typeof de=="object"&&A.call(de,"__await")?c.resolve(de.__await).then(function(oe){g("next",oe,K,re)},function(oe){g("throw",oe,K,re)}):c.resolve(de).then(function(oe){ve.value=oe,K(ve)},function(oe){return g("throw",oe,K,re)})}}var x;function S(H,Q){function K(){return new c(function(re,J){g(H,Q,re,J)})}return x=x?x.then(K,K):K()}this._invoke=S}w(E.prototype),B(E.prototype,V,function(){return this}),C.AsyncIterator=E,C.async=function(h,c,g,x,S){S===void 0&&(S=Promise);var H=new E(I(h,c,g,x),S);return C.isGeneratorFunction(c)?H:H.next().then(function(Q){return Q.done?Q.value:H.next()})};function j(h,c,g){var x=N;return function(H,Q){if(x===ie)throw new Error("Generator is already running");if(x===ne){if(H==="throw")throw Q;return ge()}for(g.method=H,g.arg=Q;;){var K=g.delegate;if(K){var re=z(K,g);if(re){if(re===F)continue;return re}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(x===N)throw x=ne,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);x=ie;var J=W(h,c,g);if(J.type==="normal"){if(x=g.done?ne:v,J.arg===F)continue;return{value:J.arg,done:g.done}}else J.type==="throw"&&(x=ne,g.method="throw",g.arg=J.arg)}}}function z(h,c){var g=h.iterator[c.method];if(g===M){if(c.delegate=null,c.method==="throw"){if(h.iterator.return&&(c.method="return",c.arg=M,z(h,c),c.method==="throw"))return F;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return F}var x=W(g,h.iterator,c.arg);if(x.type==="throw")return c.method="throw",c.arg=x.arg,c.delegate=null,F;var S=x.arg;if(!S)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,F;if(S.done)c[h.resultName]=S.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=M);else return S;return c.delegate=null,F}w(b),B(b,k,"Generator"),B(b,D,function(){return this}),B(b,"toString",function(){return"[object Generator]"});function ae(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function le(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function ce(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(ae,this),this.reset(!0)}C.keys=function(h){var c=[];for(var g in h)c.push(g);return c.reverse(),function x(){for(;c.length;){var S=c.pop();if(S in h)return x.value=S,x.done=!1,x}return x.done=!0,x}};function me(h){if(h){var c=h[D];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var g=-1,x=function S(){for(;++g<h.length;)if(A.call(h,g))return S.value=h[g],S.done=!1,S;return S.value=M,S.done=!0,S};return x.next=x}}return{next:ge}}C.values=me;function ge(){return{value:M,done:!0}}return ce.prototype={constructor:ce,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=M,this.done=!1,this.delegate=null,this.method="next",this.arg=M,this.tryEntries.forEach(le),!h)for(var c in this)c.charAt(0)==="t"&&A.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=M)},stop:function(){this.done=!0;var h=this.tryEntries[0],c=h.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var c=this;function g(re,J){return H.type="throw",H.arg=h,c.next=re,J&&(c.method="next",c.arg=M),!!J}for(var x=this.tryEntries.length-1;x>=0;--x){var S=this.tryEntries[x],H=S.completion;if(S.tryLoc==="root")return g("end");if(S.tryLoc<=this.prev){var Q=A.call(S,"catchLoc"),K=A.call(S,"finallyLoc");if(Q&&K){if(this.prev<S.catchLoc)return g(S.catchLoc,!0);if(this.prev<S.finallyLoc)return g(S.finallyLoc)}else if(Q){if(this.prev<S.catchLoc)return g(S.catchLoc,!0)}else if(K){if(this.prev<S.finallyLoc)return g(S.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(h,c){for(var g=this.tryEntries.length-1;g>=0;--g){var x=this.tryEntries[g];if(x.tryLoc<=this.prev&&A.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var S=x;break}}S&&(h==="break"||h==="continue")&&S.tryLoc<=c&&c<=S.finallyLoc&&(S=null);var H=S?S.completion:{};return H.type=h,H.arg=c,S?(this.method="next",this.next=S.finallyLoc,F):this.complete(H)},complete:function(h,c){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&c&&(this.next=c),F},finish:function(h){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.finallyLoc===h)return this.complete(g.completion,g.afterLoc),le(g),F}},catch:function(h){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.tryLoc===h){var x=g.completion;if(x.type==="throw"){var S=x.arg;le(g)}return S}}throw new Error("illegal catch attempt")},delegateYield:function(h,c,g){return this.delegate={iterator:me(h),resultName:c,nextLoc:g},this.method==="next"&&(this.arg=M),F}},C}(O.exports);try{regeneratorRuntime=T}catch(C){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(O,T,C){"use strict";C.d(T,{Z:function(){return G}});function G(A){if(A.geometry&&A.geometry.dispose(),A.material){var M=Array.isArray(A.material)?A.material:[A.material];M.forEach(function(m){var D,V,k,B,I,W,N,v,ie,ne,F,$,L;(D=m.map)===null||D===void 0||D.dispose(),(V=m.lightMap)===null||V===void 0||V.dispose(),(k=m.bumpMap)===null||k===void 0||k.dispose(),(B=m.normalMap)===null||B===void 0||B.dispose(),(I=m.specularMap)===null||I===void 0||I.dispose(),(W=m.envMap)===null||W===void 0||W.dispose(),(N=m.alphaMap)===null||N===void 0||N.dispose(),(v=m.aoMap)===null||v===void 0||v.dispose(),(ie=m.displacementMap)===null||ie===void 0||ie.dispose(),(ne=m.emissiveMap)===null||ne===void 0||ne.dispose(),(F=m.gradientMap)===null||F===void 0||F.dispose(),($=m.metalnessMap)===null||$===void 0||$.dispose(),(L=m.roughnessMap)===null||L===void 0||L.dispose(),m.dispose()})}}},519:function(O,T,C){"use strict";C.d(T,{disposeMesh:function(){return m.Z},isPlainObject:function(){return k.Z}});var G=C(666),A=C.n(G),M=null,m=C(695),D=C(644);function V(F){if(F.material){var $=Array.isArray(F.material)?F.material:[F.material];$.forEach(function(L){var U,f;(U=L.color)===null||U===void 0||U.convertSRGBToLinear(),(f=L.emissive)===null||f===void 0||f.convertSRGBToLinear(),L.map&&(L.map.encoding=THREE.sRGBEncoding),L.emissiveMap&&(L.emissiveMap.encoding=THREE.sRGBEncoding)})}}var k=C(738),B=C(568),I=C(924),W=require("idb-keyval"),N=C(484),v=null,ie=null,ne=function(){var F=(0,B.Z)(A().mark(function $(L,U){var f,l,p,b,w,E;return A().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return f=U.version,z.next=4,(0,W.get)(L);case 4:if(p=z.sent,!(p&&p[f])){z.next=9;break}l=p[f],z.next=15;break;case 9:return z.next=11,(0,N.Z)(fetch(L).then(function(ae){if(ae.ok)return ae.blob();throw new Error}));case 11:b=z.sent,w=b.res,E=b.err,E||(l=w,(0,W.set)(L,(0,I.Z)({},f,w)));case 15:return z.abrupt("return",l?{url:URL.createObjectURL(l)}:{url:L});case 16:case"end":return z.stop()}},$)}));return function(L,U){return F.apply(this,arguments)}}()},738:function(O,T,C){"use strict";C.d(T,{Z:function(){return A}});function G(M){return Object.prototype.toString.call(M)==="[object Object]"}function A(M){if(G(M)===!1)return!1;var m=M.constructor;if(m===void 0)return!0;var D=m.prototype;return!(G(D)===!1||D.hasOwnProperty("isPrototypeOf")===!1)}},484:function(O,T,C){"use strict";C.d(T,{Z:function(){return A}});var G=C(42);function A(M){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return M.then(function(D){return(0,G.Z)({err:null,res:D},m)}).catch(function(D){return(0,G.Z)({err:D,res:void 0},m)})}},644:function(O){"use strict";O.exports=require("three")},568:function(O,T,C){"use strict";C.d(T,{Z:function(){return A}});function G(M,m,D,V,k,B,I){try{var W=M[B](I),N=W.value}catch(v){D(v);return}W.done?m(N):Promise.resolve(N).then(V,k)}function A(M){return function(){var m=this,D=arguments;return new Promise(function(V,k){var B=M.apply(m,D);function I(N){G(B,V,k,I,W,"next",N)}function W(N){G(B,V,k,I,W,"throw",N)}I(void 0)})}}},924:function(O,T,C){"use strict";C.d(T,{Z:function(){return G}});function G(A,M,m){return M in A?Object.defineProperty(A,M,{value:m,enumerable:!0,configurable:!0,writable:!0}):A[M]=m,A}},42:function(O,T,C){"use strict";C.d(T,{Z:function(){return A}});var G=C(924);function A(M){for(var m=1;m<arguments.length;m++){var D=arguments[m]!=null?arguments[m]:{},V=Object.keys(D);typeof Object.getOwnPropertySymbols=="function"&&(V=V.concat(Object.getOwnPropertySymbols(D).filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable}))),V.forEach(function(k){(0,G.Z)(M,k,D[k])})}return M}}},Oe={};function q(O){var T=Oe[O];if(T!==void 0)return T.exports;var C=Oe[O]={exports:{}};return Fe[O](C,C.exports,q),C.exports}(function(){q.n=function(O){var T=O&&O.__esModule?function(){return O.default}:function(){return O};return q.d(T,{a:T}),T}})(),function(){q.d=function(O,T){for(var C in T)q.o(T,C)&&!q.o(O,C)&&Object.defineProperty(O,C,{enumerable:!0,get:T[C]})}}(),function(){q.o=function(O,T){return Object.prototype.hasOwnProperty.call(O,T)}}(),function(){q.r=function(O){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(O,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";q.r(ye),q.d(ye,{BaseObject:function(){return ct},Pencil:function(){return Ce},default:function(){return Ce}});function O(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")}function T(u,s){for(var n=0;n<s.length;n++){var e=s[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(u,e.key,e)}}function C(u,s,n){return s&&T(u.prototype,s),n&&T(u,n),u}var G=q(42);function A(u,s){var n=Object.keys(u);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(u);s&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),n.push.apply(n,e)}return n}function M(u,s){return s=s!=null?s:{},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(s)):A(Object(s)).forEach(function(n){Object.defineProperty(u,n,Object.getOwnPropertyDescriptor(s,n))}),u}function m(u,s){(s==null||s>u.length)&&(s=u.length);for(var n=0,e=new Array(s);n<s;n++)e[n]=u[n];return e}function D(u){if(Array.isArray(u))return m(u)}function V(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function k(){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 B(u,s){if(!!u){if(typeof u=="string")return m(u,s);var n=Object.prototype.toString.call(u).slice(8,-1);if(n==="Object"&&u.constructor&&(n=u.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(u,s)}}function I(u){return D(u)||V(u)||B(u)||k()}var W=require("@tweenjs/tween.js"),N=q.n(W),v=q(644),ie=q(187),ne=require("deepmerge"),F=q.n(ne),$=require("three/examples/jsm/libs/stats.module"),L=q.n($),U=require("lil-gui"),f=q.n(U),l=function(){"use strict";function u(){O(this,u),this.guiParams={}}var s=u.prototype;return s.showGuiParams=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(t){var a=e.addFolder(t),o=r.guiParams[t];Object.keys(o).forEach(function(i){var d=o[i],y=d.min,_=d.max,P=d.step,R=d.name,Z=d.to,X=d.paramMap,ee=d.items,te=d.value,se=d.target,ue=i.toLowerCase().indexOf("color")>-1,Y,pe=typeof te=="undefined"&&se,fe=pe?se():o[i],he=pe?i:"value";ee?Y=a.add(fe,he,ee):ue?Y=a.addColor(fe,he):Y=a.add(fe,he),Y=Y.name(R||i),typeof y!="undefined"&&(Y=Y.min(y)),typeof _!="undefined"&&(Y=Y.max(_)),typeof P!="undefined"&&(Y=Y.step(P)),Y=Y.onChange(function(){r.setGuiTargetValue(t,i,fe[he],X)}),(Z||pe)&&Y.listen()})})},s.setGuiTargetValue=function(e,r,t,a){var o=this.guiParams[e][r],i=o.onChange,d=o.target,y=o.value,_=r.toLowerCase().indexOf("color")>-1,P=typeof y=="undefined"&&d;if(d&&!P){var R=d();Array.isArray(R)||(R=[R]),R.forEach(function(Z){if(!!Z)if(_)try{Z[a||r].set(t)}catch(X){r!=="color"&&!a&&console.warn("".concat(r," is not a color,set paramMap"))}else Z[a||r]=t})}i&&i(t)},s.setGuiTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(t){var a=e.guiParams[r][t];typeof a.value!="undefined"&&e.setGuiTargetValue(r,t,a.value,a.paramMap)})})},s.guiParamTween=function(e,r,t){var a=t.duration,o=a===void 0?0:a,i=this,d=this.guiParams[e][r],y=d.to,_=d.paramMap,P=_===void 0?"":_;return new(N()).Tween(this.guiParams[e][r]).to({value:y},o).onUpdate(function(R){i.setGuiTargetValue(e,r,R.value,P)})},u}(),p={None:v.NoToneMapping,Linear:v.LinearToneMapping,Reinhard:v.ReinhardToneMapping,Cineon:v.CineonToneMapping,ACESFilmic:v.ACESFilmicToneMapping},b={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:v.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1},w=function(){"use strict";function u(n){O(this,u),this.options=n;var e=n.width,r=n.height,t=n.rendererParams,a=t.alpha,o=t.devicePixelRatio,i=t.antialias,d=t.powerPreference,y=t.toneMapping,_=t.toneMappingExposure,P=t.outputEncoding,R=t.logarithmicDepthBuffer,Z=t.preserveDrawingBuffer,X=new v.WebGLRenderer({alpha:a,antialias:i,powerPreference:d,logarithmicDepthBuffer:R,preserveDrawingBuffer:Z});X.setSize(e,r),X.setPixelRatio(o),X.autoClear=!1,X.toneMapping=p[y],X.toneMappingExposure=_,X.outputEncoding=P,this.renderer=X}var s=u.prototype;return s.setSize=function(e,r){this.renderer.setSize(e,r)},s.render=function(){var e=this.options,r=e.scene,t=e.camera;this.renderer.render(r,t)},s.setGui=function(e){var r=this,t=new l;t.guiParams={renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:p,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}},t.showGuiParams(e)},s.dispose=function(){var e,r,t;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(t=this.renderer)===null||t===void 0||t.renderLists.dispose(),this.renderer=void 0},u}(),E={fov:45,near:1,far:1e3},j=function(){"use strict";function u(n){O(this,u),this.oldCameraPosition=new v.Vector3,this.oldCameraRotation=new v.Euler,this.customCamera=!1,this.options=n;var e=n.isdev,r=n.width,t=n.height,a=n.cameraParams;if(a instanceof v.Camera)this.camera=a,this.customCamera=!0;else{var o=a.fov,i=a.far,d=a.near,y=new v.PerspectiveCamera(o,r/t,d,i);(!o||!i)&&e&&(console.warn("camera.fov \u9ED8\u8BA4\u503C\u4E3A 45\uFF0C\u65E7\u7248\u672C\u4E3A 12"),console.warn("camera.far \u9ED8\u8BA4\u503C\u4E3A 1000\uFF0C\u65E7\u7248\u672C\u4E3A 20000")),y.position.set(0,0,400),y.lookAt(0,0,0),this.camera=y}}var s=u.prototype;return s.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},s.setSize=function(e,r){this.camera instanceof v.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},s.dispose=function(){this.camera=void 0},s.setGui=function(e){var r=this,t=new l;t.guiParams={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(a){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(a){r.camera.updateProjectionMatrix()}}}},this.camera instanceof v.PerspectiveCamera&&(t.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(a){r.camera.updateProjectionMatrix()}}),t.showGuiParams(e)},u}(),z=q(519),ae={background:null},le=function(){"use strict";function u(n){O(this,u),this.options=n;var e=n.camera,r=n.sceneParams,t=r.background,a=new v.Scene;t&&(a.background=t),a.add(e),this.scene=a}var s=u.prototype;return s.addAxesHelper=function(){var e,r=new v.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},s.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,z.disposeMesh)(r)}),this.scene=void 0},u}(),ce=require("three/examples/jsm/controls/OrbitControls"),me={},ge=function(){"use strict";function u(n){O(this,u),this.options=n;var e=n.camera,r=n.controlParams,t=n.mapControl,a=r.domElement,o=t?new ce.MapControls(e,a):new ce.OrbitControls(e,a);o.minPolarAngle=Math.PI*.15,o.maxPolarAngle=Math.PI*.85,o.enableDamping=!0,o.dampingFactor=.063,o.autoRotate=!1,o.autoRotateSpeed=-60,o.enableZoom=!0,o.zoomSpeed=.2,this.control=o}var s=u.prototype;return s.limitPan=function(e){var r=e.maxX,t=r===void 0?1/0:r,a=e.minX,o=a===void 0?-1/0:a,i=e.maxZ,d=i===void 0?1/0:i,y=e.minZ,_=y===void 0?-1/0:y,P=e.maxY,R=P===void 0?1/0:P,Z=e.minY,X=Z===void 0?-1/0:Z,ee=this.limitPanV||new v.Vector3,te=this.control,se=this.options.camera,ue=new v.Vector3(o,X,_),Y=new v.Vector3(t,R,d);this.limitPanV=ee,ee.copy(te.target),te.target.clamp(ue,Y),ee.sub(te.target),se.position.sub(ee)},s.update=function(){var e;(e=this.control)===null||e===void 0||e.update()},s.dispose=function(){var e;(e=this.control)===null||e===void 0||e.dispose(),this.control=void 0},u}(),h=require("three/examples/jsm/renderers/CSS2DRenderer"),c=require("three/examples/jsm/renderers/CSS3DRenderer"),g={zIndex:"auto"},x=function(){"use strict";function u(n){O(this,u),this.container=n}var s=u.prototype;return s.addRenderer=function(e,r){var t=this.container,a=t.offsetWidth,o=t.offsetHeight,i=e==="css2d"?new h.CSS2DRenderer:new c.CSS3DRenderer;i.domElement.style.position="absolute",i.domElement.style.top="0",i.domElement.style.pointerEvents="none",i.domElement.style.zIndex=r.zIndex,i.setSize(a,o),t.appendChild(i.domElement),e==="css2d"?this.css2Drenderer=i:e==="css3d"&&(this.css3Drenderer=i)},s.setSize=function(e,r){var t,a;(t=this.css2Drenderer)===null||t===void 0||t.setSize(e,r),(a=this.css3Drenderer)===null||a===void 0||a.setSize(e,r)},s.render=function(e,r){var t,a;(t=this.css2Drenderer)===null||t===void 0||t.render(e,r),(a=this.css3Drenderer)===null||a===void 0||a.render(e,r)},s.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},u}(),S=require("three/examples/jsm/postprocessing/EffectComposer"),H=require("three/examples/jsm/postprocessing/RenderPass"),Q=require("three/examples/jsm/postprocessing/ShaderPass"),K=require("three/examples/jsm/shaders/CopyShader"),re=require("three/examples/jsm/shaders/GammaCorrectionShader"),J=require("three/examples/jsm/postprocessing/SMAAPass"),ve=require("three/examples/jsm/postprocessing/SSAARenderPass"),de=require("three/examples/jsm/shaders/FXAAShader"),oe=function(){try{var u=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&u.getContext("webgl2"))}catch(s){return!1}},ht=0,Ue=1,be=!1,Re=oe()!==!1,ke=`varying vec2 vUv;
2
2
 
3
3
  void main() {
4
4
 
@@ -15,7 +15,7 @@ void main() {
15
15
 
16
16
  gl_FragColor = (texture2D(baseTexture, vUv) + vec4(1.0) * texture2D(bloomTexture, vUv));
17
17
 
18
- }`;function _e(u,a){return _e=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},_e(u,a)}function Te(u,a){return _e(u,a)}function je(u,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(a&&a.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),a&&Te(u,a)}function Ie(){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(u){return!1}}function we(u){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},we(u)}function Me(u){return we(u)}function Ne(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function He(u){return u&&u.constructor===Symbol?"symbol":typeof u}function Ze(u,a){return a&&(He(a)==="object"||typeof a=="function")?a:Ne(u)}function Ee(u){var a=Ie();return function(){var e=Me(u),r;if(a){var t=Me(this).constructor;r=Reflect.construct(e,arguments,t)}else r=e.apply(this,arguments);return Ze(this,r)}}var Le=require("three/examples/jsm/postprocessing/Pass"),Ae=require("three/examples/jsm/shaders/LuminosityHighPassShader"),Se=function(u){"use strict";je(n,u);var a=Ee(n);function n(r,t,s,o){O(this,n);var i;i=a.call(this),i.strength=t!==void 0?t:1,i.radius=s,i.threshold=o,i.resolution=r!==void 0?new v.Vector2(r.x,r.y):new v.Vector2(256,256),i.clearColor=new v.Color(0,0,0);var d={minFilter:v.LinearFilter,magFilter:v.LinearFilter,format:v.RGBAFormat};i.renderTargetsHorizontal=[],i.renderTargetsVertical=[],i.nMips=5;var P=Math.round(i.resolution.x/2),y=Math.round(i.resolution.y/2);i.renderTargetBright=new v.WebGLRenderTarget(P,y,d),i.renderTargetBright.texture.name="UnrealBloomPass.bright",i.renderTargetBright.texture.generateMipmaps=!1;for(var _=0;_<i.nMips;_++){var M=new v.WebGLRenderTarget(P,y,d);M.texture.name="UnrealBloomPass.h".concat(_),M.texture.generateMipmaps=!1,i.renderTargetsHorizontal.push(M);var Z=new v.WebGLRenderTarget(P,y,d);Z.texture.name="UnrealBloomPass.v".concat(_),Z.texture.generateMipmaps=!1,i.renderTargetsVertical.push(Z),P=Math.round(P/2),y=Math.round(y/2)}Ae.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var W=Ae.LuminosityHighPassShader;i.highPassUniforms=v.UniformsUtils.clone(W.uniforms),i.highPassUniforms.luminosityThreshold.value=o,i.highPassUniforms.smoothWidth.value=.01,i.materialHighPassFilter=new v.ShaderMaterial({uniforms:i.highPassUniforms,vertexShader:W.vertexShader,fragmentShader:W.fragmentShader,defines:{}}),i.separableBlurMaterials=[];var J=[3,5,7,9,11];P=Math.round(i.resolution.x/2),y=Math.round(i.resolution.y/2);for(var se=0;se<i.nMips;se++)i.separableBlurMaterials.push(i.getSeperableBlurMaterial(J[se])),i.separableBlurMaterials[se].uniforms.texSize.value=new v.Vector2(P,y),P=Math.round(P/2),y=Math.round(y/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=t,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 v.Vector3(1,1,1),new v.Vector3(1,1,1),new v.Vector3(1,1,1),new v.Vector3(1,1,1),new v.Vector3(1,1,1)],i.compositeMaterial.uniforms.bloomTintColors.value=i.bloomTintColors,K.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var ue=K.CopyShader;return i.copyUniforms=v.UniformsUtils.clone(ue.uniforms),i.copyUniforms.opacity.value=1,i.materialCopy=new v.ShaderMaterial({uniforms:i.copyUniforms,vertexShader:ue.vertexShader,fragmentShader:ue.fragmentShader,blending:v.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),i.enabled=!0,i.needsSwap=!1,i._oldClearColor=new v.Color,i.oldClearAlpha=1,i.basic=new v.MeshBasicMaterial,i.fsQuad=new Le.FullScreenQuad(void 0),i}var e=n.prototype;return e.dispose=function(){for(var t=0;t<this.renderTargetsHorizontal.length;t++)this.renderTargetsHorizontal[t].dispose();for(var s=0;s<this.renderTargetsVertical.length;s++)this.renderTargetsVertical[s].dispose();this.renderTargetBright.dispose()},e.setSize=function(t,s){var o=Math.round(t/2),i=Math.round(s/2);this.renderTargetBright.setSize(o,i);for(var d=0;d<this.nMips;d++)this.renderTargetsHorizontal[d].setSize(o,i),this.renderTargetsVertical[d].setSize(o,i),this.separableBlurMaterials[d].uniforms.texSize.value=new v.Vector2(o,i),o=Math.round(o/2),i=Math.round(i/2)},e.render=function(t,s,o,i,d){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();var P=t.autoClear;t.autoClear=!1,t.setClearColor(this.clearColor,0),d&&t.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=o.texture,t.setRenderTarget(null),t.clear(),this.fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=o.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this.fsQuad.render(t);for(var y=this.renderTargetBright,_=0;_<this.nMips;_++)this.fsQuad.material=this.separableBlurMaterials[_],this.separableBlurMaterials[_].uniforms.colorTexture.value=y.texture,this.separableBlurMaterials[_].uniforms.direction.value=n.BlurDirectionX,t.setRenderTarget(this.renderTargetsHorizontal[_]),t.clear(),this.fsQuad.render(t),this.separableBlurMaterials[_].uniforms.colorTexture.value=this.renderTargetsHorizontal[_].texture,this.separableBlurMaterials[_].uniforms.direction.value=n.BlurDirectionY,t.setRenderTarget(this.renderTargetsVertical[_]),t.clear(),this.fsQuad.render(t),y=this.renderTargetsVertical[_];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,t.setRenderTarget(this.renderTargetsHorizontal[0]),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,d&&t.state.buffers.stencil.setTest(!0),this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(o),this.fsQuad.render(t)),t.setClearColor(this._oldClearColor,this.oldClearAlpha),t.autoClear=P},e.getSeperableBlurMaterial=function(t){return new v.ShaderMaterial({defines:{KERNEL_RADIUS:t,SIGMA:t},uniforms:{colorTexture:{value:null},texSize:{value:new v.Vector2(.5,.5)},direction:{value:new v.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
18
+ }`;function _e(u,s){return _e=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},_e(u,s)}function Te(u,s){return _e(u,s)}function je(u,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(s&&s.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),s&&Te(u,s)}function Ie(){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(u){return!1}}function we(u){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},we(u)}function Me(u){return we(u)}function Ne(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function He(u){return u&&u.constructor===Symbol?"symbol":typeof u}function Ze(u,s){return s&&(He(s)==="object"||typeof s=="function")?s:Ne(u)}function Ee(u){var s=Ie();return function(){var e=Me(u),r;if(s){var t=Me(this).constructor;r=Reflect.construct(e,arguments,t)}else r=e.apply(this,arguments);return Ze(this,r)}}var Le=require("three/examples/jsm/postprocessing/Pass"),Ae=require("three/examples/jsm/shaders/LuminosityHighPassShader"),Se=function(u){"use strict";je(n,u);var s=Ee(n);function n(r,t,a,o){O(this,n);var i;i=s.call(this),i.strength=t!==void 0?t:1,i.radius=a,i.threshold=o,i.resolution=r!==void 0?new v.Vector2(r.x,r.y):new v.Vector2(256,256),i.clearColor=new v.Color(0,0,0);var d={minFilter:v.LinearFilter,magFilter:v.LinearFilter,format:v.RGBAFormat};i.renderTargetsHorizontal=[],i.renderTargetsVertical=[],i.nMips=5;var y=Math.round(i.resolution.x/2),_=Math.round(i.resolution.y/2);i.renderTargetBright=new v.WebGLRenderTarget(y,_,d),i.renderTargetBright.texture.name="UnrealBloomPass.bright",i.renderTargetBright.texture.generateMipmaps=!1;for(var P=0;P<i.nMips;P++){var R=new v.WebGLRenderTarget(y,_,d);R.texture.name="UnrealBloomPass.h".concat(P),R.texture.generateMipmaps=!1,i.renderTargetsHorizontal.push(R);var Z=new v.WebGLRenderTarget(y,_,d);Z.texture.name="UnrealBloomPass.v".concat(P),Z.texture.generateMipmaps=!1,i.renderTargetsVertical.push(Z),y=Math.round(y/2),_=Math.round(_/2)}Ae.LuminosityHighPassShader===void 0&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");var X=Ae.LuminosityHighPassShader;i.highPassUniforms=v.UniformsUtils.clone(X.uniforms),i.highPassUniforms.luminosityThreshold.value=o,i.highPassUniforms.smoothWidth.value=.01,i.materialHighPassFilter=new v.ShaderMaterial({uniforms:i.highPassUniforms,vertexShader:X.vertexShader,fragmentShader:X.fragmentShader,defines:{}}),i.separableBlurMaterials=[];var ee=[3,5,7,9,11];y=Math.round(i.resolution.x/2),_=Math.round(i.resolution.y/2);for(var te=0;te<i.nMips;te++)i.separableBlurMaterials.push(i.getSeperableBlurMaterial(ee[te])),i.separableBlurMaterials[te].uniforms.texSize.value=new v.Vector2(y,_),y=Math.round(y/2),_=Math.round(_/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=t,i.compositeMaterial.uniforms.bloomRadius.value=.1,i.compositeMaterial.needsUpdate=!0;var se=[1,.8,.6,.4,.2];i.compositeMaterial.uniforms.bloomFactors.value=se,i.bloomTintColors=[new v.Vector3(1,1,1),new v.Vector3(1,1,1),new v.Vector3(1,1,1),new v.Vector3(1,1,1),new v.Vector3(1,1,1)],i.compositeMaterial.uniforms.bloomTintColors.value=i.bloomTintColors,K.CopyShader===void 0&&console.error("THREE.UnrealBloomPass relies on CopyShader");var ue=K.CopyShader;return i.copyUniforms=v.UniformsUtils.clone(ue.uniforms),i.copyUniforms.opacity.value=1,i.materialCopy=new v.ShaderMaterial({uniforms:i.copyUniforms,vertexShader:ue.vertexShader,fragmentShader:ue.fragmentShader,blending:v.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),i.enabled=!0,i.needsSwap=!1,i._oldClearColor=new v.Color,i.oldClearAlpha=1,i.basic=new v.MeshBasicMaterial,i.fsQuad=new Le.FullScreenQuad(void 0),i}var e=n.prototype;return e.dispose=function(){for(var t=0;t<this.renderTargetsHorizontal.length;t++)this.renderTargetsHorizontal[t].dispose();for(var a=0;a<this.renderTargetsVertical.length;a++)this.renderTargetsVertical[a].dispose();this.renderTargetBright.dispose()},e.setSize=function(t,a){var o=Math.round(t/2),i=Math.round(a/2);this.renderTargetBright.setSize(o,i);for(var d=0;d<this.nMips;d++)this.renderTargetsHorizontal[d].setSize(o,i),this.renderTargetsVertical[d].setSize(o,i),this.separableBlurMaterials[d].uniforms.texSize.value=new v.Vector2(o,i),o=Math.round(o/2),i=Math.round(i/2)},e.render=function(t,a,o,i,d){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();var y=t.autoClear;t.autoClear=!1,t.setClearColor(this.clearColor,0),d&&t.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=o.texture,t.setRenderTarget(null),t.clear(),this.fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=o.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this.fsQuad.render(t);for(var _=this.renderTargetBright,P=0;P<this.nMips;P++)this.fsQuad.material=this.separableBlurMaterials[P],this.separableBlurMaterials[P].uniforms.colorTexture.value=_.texture,this.separableBlurMaterials[P].uniforms.direction.value=n.BlurDirectionX,t.setRenderTarget(this.renderTargetsHorizontal[P]),t.clear(),this.fsQuad.render(t),this.separableBlurMaterials[P].uniforms.colorTexture.value=this.renderTargetsHorizontal[P].texture,this.separableBlurMaterials[P].uniforms.direction.value=n.BlurDirectionY,t.setRenderTarget(this.renderTargetsVertical[P]),t.clear(),this.fsQuad.render(t),_=this.renderTargetsVertical[P];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,t.setRenderTarget(this.renderTargetsHorizontal[0]),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,d&&t.state.buffers.stencil.setTest(!0),this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(o),this.fsQuad.render(t)),t.setClearColor(this._oldClearColor,this.oldClearAlpha),t.autoClear=y},e.getSeperableBlurMaterial=function(t){return new v.ShaderMaterial({defines:{KERNEL_RADIUS:t,SIGMA:t},uniforms:{colorTexture:{value:null},texSize:{value:new v.Vector2(.5,.5)},direction:{value:new v.Vector2(.5,.5)}},vertexShader:`varying vec2 vUv;
19
19
  void main() {
20
20
  vUv = uv;
21
21
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
@@ -54,4 +54,4 @@ void main() {
54
54
  lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
55
55
  lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
56
56
  lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
57
- }`})},n}(Le.Pass);Se.BlurDirectionX=new v.Vector2(1,0),Se.BlurDirectionY=new v.Vector2(0,1);var We={threshold:.2,strength:.5,radius:0},Xe=new v.MeshBasicMaterial({color:"black"}),qe=new v.SpriteMaterial({color:"#000"}),Qe=function(){"use strict";function u(n,e){O(this,u),this.materials={},this.bloomLayer=new v.Layers,this.active=!0,this.composerController=n,this.options=e;var r=n.renderer,t=n.renderPass,s=n.finalComposer,o=n.getSize(),i=o.width,d=o.height,P=new Se(new v.Vector2(i,d),e.strength,e.radius,e.threshold);this.bloomPass=P;var y=new S.EffectComposer(r);y.renderToScreen=!1,y.addPass(t),y.addPass(this.bloomPass),this.bloomComposer=y,this.bloomLayer.set(Ue);var _=new v.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:y.renderTarget2.texture}},vertexShader:ke,fragmentShader:Ve,defines:{}}),M=new Q.ShaderPass(_,"baseTexture");M.needsSwap=!0,this.finalPass=M,s.addPass(M)}var a=u.prototype;return a.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},a.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},a.render=function(e){if(!!this.active){var r=this,t=r.bloomComposer,s=r.bloomLayer,o=r.materials;e.traverse(function(i){var d=i;d.material&&s.test(d.layers)===!1&&(o[d.uuid]=d.material,d.material=d.isSprite?qe:Xe)}),t.render(),e.traverse(function(i){var d=i;o[d.uuid]&&(d.material=o[d.uuid],delete o[d.uuid])})}},a.setSize=function(e,r){this.bloomComposer.setSize(e,r)},a.setGui=function(e){var r=this,t=new l;t.guiParams={bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}},t.showGuiParams(e)},a.dispose=function(){this.bloomPass.dispose(),this.materials={}},u}(),Ye=require("three/examples/jsm/postprocessing/OutlinePass"),Ke={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},$e=function(){"use strict";function u(n,e){O(this,u),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,s=n.finalComposer,o=n.getSize(),i=o.width,d=o.height,P=new Ye.OutlinePass(new v.Vector2(i,d),r,t);P.selectedObjects=this.selectedObjects,this.outlinePass=P,s.addPass(P),this.setGui()}var a=u.prototype;return a.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},a.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},a.setGui=function(){var e=this,r=new l;r.guiParams={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.setGuiTargetValueByParams(),this.outlineGui=r},a.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},u}();function Je(u,a){if(u==null)return{};var n={},e=Object.keys(u),r,t;for(t=0;t<e.length;t++)r=e[t],!(a.indexOf(r)>=0)&&(n[r]=u[r]);return n}function et(u,a){if(u==null)return{};var n=Je(u,a),e,r;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);for(r=0;r<t.length;r++)e=t[r],!(a.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(u,e)||(n[e]=u[e]))}return n}var tt=require("three/examples/jsm/postprocessing/SSRPass"),rt=require("three/examples/jsm/objects/ReflectorForSSRPass"),nt={maxDistance:10,selects:!0},it={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},st=function(){"use strict";function u(n,e){O(this,u),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,s=n.renderer,o=n.finalComposer,i=n.getSize(),d=i.width,P=i.height,y=new tt.SSRPass({renderer:s,scene:r,camera:t,width:d,height:P,groundReflector:null,selects:this.selectedObjects});this.ssrPass=y,o.addPass(y),this.setGui()}var a=u.prototype;return a.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},it,e),t=r.width,s=r.height,o=et(r,["width","height"]),i=this.composerController,d=i.scene,P=i.getSize(),y=new v.PlaneGeometry(t,s),_=new rt.ReflectorForSSRPass(y,j((0,G.Z)({},o),{textureWidth:P.width,textureHeight:P.height}));_.material.depthWrite=!1,_.rotation.x=-Math.PI/2,_.visible=!1,d.add(_),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=_},a.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},a.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},a.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},a.setSize=function(e,r){var t=this.groundReflector;t&&(t.getRenderTarget().setSize(e,r),t.resolution.set(e,r))},a.setGui=function(){var e=this,r=new l;r.guiParams={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(t){t?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.setGuiTargetValueByParams(),this.ssrGui=r},a.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},u}(),at=function(){"use strict";function u(n){O(this,u),this.active=!0,this.options=n;var e=n.renderer,r=n.scene,t=n.camera,s=this.createRenderTarget(),o=new S.EffectComposer(e,s);o.setPixelRatio(e.getPixelRatio()),this.finalComposer=o,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=s,this.camera=t}var a=u.prototype;return a.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,t=e.type,s=e.encoding,o=this.getSize(),i={minFilter:v.LinearFilter,magFilter:v.LinearFilter,format:v.RGBAFormat,encoding:s,type:t},d;if(+v.REVISION<138&&r>0){var P=new v.WebGLMultisampleRenderTarget(o.width,o.height,i);P.samples=r,d=P}else if(+v.REVISION>=138&&r>0){var y=new v.WebGLRenderTarget(o.width,o.height,j((0,G.Z)({},i),{samples:r}));d=y}else{var _=new v.WebGLRenderTarget(o.width,o.height,i);d=_}return d.texture.name="EffectComposer.rt1",d},a.addRenderPasss=function(){var e=this.options,r=e.scene,t=e.camera,s=new H.RenderPass(r,t);this.finalComposer.addPass(s),this.renderPass=s},a.addCopyPass=function(){var e=new Q.ShaderPass(K.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},a.addGammaCorrectionPass=function(){var e=new Q.ShaderPass(te.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},a.addFXAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,s=new Q.ShaderPass(de.FXAAShader);this.finalComposer.addPass(s),this.fxaaPass=s,this.setFXAAPassSize(r,t)},a.addSMAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,s=this.options.renderer,o=new ee.SMAAPass(r*s.getPixelRatio(),t*s.getPixelRatio());this.finalComposer.addPass(o),this.smaaPass=o},a.addSSAAPass=function(){var e=this.options,r=e.scene,t=e.camera,s=new ve.SSAARenderPass(r,t,0,0);s.unbiased=!0,s.sampleLevel=1,this.finalComposer.addPass(s),this.ssaaPass=s},a.addBloomPass=function(e){var r=new Qe(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},a.addOutlinePass=function(e){var r=new $e(this,e);r.disable(),this.options.gui&&r.outlineGui.showGuiParams(this.options.gui),this.outlineController=r},a.addSSRPass=function(e){var r=new st(this,e);r.disable(),this.options.gui&&r.ssrGui.showGuiParams(this.options.gui),this.ssrController=r},a.getSize=function(){var e=this.options.renderer;return e.getSize(new v.Vector2)},a.enable=function(){this.active||(this.active=!0)},a.disable=function(){!this.active||(this.active=!1)},a.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(t){return t!==e.renderPass&&t!==e.copyPass?t.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},a.setSize=function(e,r){var t,s;this.finalComposer.setSize(e,r),(t=this.bloomController)===null||t===void 0||t.setSize(e,r),(s=this.ssrController)===null||s===void 0||s.setSize(e,r),this.setFXAAPassSize(e,r)},a.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var t=this.options.renderer,s=t.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*s),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*s)}},a.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()}},a.dispose=function(){var e,r,t,s,o;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(t=this.ssrController)===null||t===void 0||t.dispose(),(s=this.finalComposer)===null||s===void 0||s.passes.forEach(function(i){var d,P,y;(d=i.fsQuad)===null||d===void 0||d.dispose(),(P=i.fsQuad)===null||P===void 0||(y=P.material)===null||y===void 0||y.dispose()}),(o=this.renderTarget)===null||o===void 0||o.dispose(),this.renderer=void 0,this.scene=void 0,this.camera=void 0,this.finalComposer=void 0,this.renderTarget=void 0,this.renderPass=void 0,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},u}(),Ce=function(){"use strict";function u(n){O(this,u),this.raycaster=new v.Raycaster,this.installPlugins=new Map,this.event=new ne.EventEmitter,this.clock=new v.Clock,this.options=F()(u.options,n,{isMergeableObject:z.isPlainObject});var e=this.options,r=e.container,t=e.stats,s=e.gui;if(s){var o=new(f());o.open(!1),this.gui=o}if(t){var i=new(L());i.showPanel(0),i.dom.style.position="absolute",r.appendChild(i.dom),this.stats=i}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var a=u.prototype;return a.use=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),s=1;s<r;s++)t[s-1]=arguments[s];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var o;(o=e).install.apply(o,[this].concat(I(t))),this.installPlugins.set(e,!0)}},a.init=function(){var e=this,r=this.options,t=r.container,s=r.isdev,o=r.axesHelper,i=r.renderer,d=r.scene,P=r.camera,y=this.getSize(),_=y.width,M=y.height,Z=new T({isdev:s,width:_,height:M,cameraParams:P});this.gui&&Z.setGui(this.gui);var W=Z.camera,J=new le({camera:W,sceneParams:d}),se=J.scene,ae=new w({width:_,height:M,scene:se,camera:W,isdev:s,rendererParams:j((0,G.Z)({},i),{outputEncoding:v.LinearEncoding,antialias:!1})});this.gui&&ae.setGui(this.gui);var ue=ae.renderer;o&&J.addAxesHelper(),this.sceneController=J,this.rendererController=ae,this.cameraController=Z,t.appendChild(ue.domElement);var Y=new ResizeObserver(function(pe){var fe=!0,he=!1,De=void 0;try{for(var xe=pe[Symbol.iterator](),ze;!(fe=(ze=xe.next()).done);fe=!0){var ft=ze.value,Be=ft.contentRect;e.handeleResize(Be.width,Be.height)}}catch(dt){he=!0,De=dt}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(he)throw De}}});Y.observe(t),this.resizeObserver=Y},a.initComposer=function(){var e=this.options,r=e.bloom,t=e.outline,s=e.ssr,o=e.renderer,i=e.bloomParams,d=e.outlineParams,P=e.ssrParams,y=e.multisampling,_=o.antialias;_==="msaa"&&!Re&&(_=!1,console.warn("MSAA is not supported on this browser"));var M=new at({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:_==="msaa"?y:0,type:v.UnsignedByteType,encoding:o.outputEncoding}});this.composerController=M,_==="ssaa"&&M.addSSAAPass(),s&&M.addSSRPass(P),r&&M.addBloomPass(i),t&&M.addOutlinePass(d),o.outputEncoding===v.sRGBEncoding&&M.addGammaCorrectionPass(),_==="fxaa"?M.addFXAAPass():_==="smaa"&&M.addSMAAPass(),M.checkCopyPass(),this.event.on("passcheck",function(){M.checkCopyPass()})},a.initCSSRenderer=function(){var e=this.options,r=e.container,t=e.css2DRenderer,s=e.css3DRenderer,o=e.css2DRendererParams,i=e.css3DRendererParams;if(t||s){var d=new x(r);t&&d.addRenderer("css2d",o),s&&d.addRenderer("css3d",i),this.cssRendererController=d}},a.initControl=function(){var e=this.options,r=e.control,t=e.mapControl,s=e.controlParams;if(r){var o=new ge({camera:this.camera,controlParams:{domElement:(s==null?void 0:s.domElement)||this.renderer.domElement},mapControl:t});this.controlController=o}},a.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},a.handeleResize=function(e,r){var t=this,s=t.rendererController,o=t.cameraController,i=t.composerController,d=t.cssRendererController;o==null||o.setSize(e,r),s==null||s.setSize(e,r),i==null||i.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(P){var y;(y=P.resize)===null||y===void 0||y.call(P,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},a.pick=function(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=this,o=s.raycaster,i=s.options,d=i.container,P=new v.Vector2,y=d.getBoundingClientRect();if(P.x=(e.clientX-y.left)/(y.right-y.left)*2-1,P.y=-((e.clientY-y.top)/(y.bottom-y.top))*2+1,this.camera&&this.scene){o.setFromCamera(P,this.camera);var _=o.intersectObjects(r||this.scene.children,t);if(_.length)return{object:_[0].object,intersects:_}}},a.render=function(){var e,r,t,s,o=this,i=o.renderer,d=o.scene,P=o.camera,y=o.clock;if(!(!i||!d||!P||this.options.staticRender&&!this.cameraController.checkCameraChange())){var _=y.getDelta(),M=y.getElapsedTime();if(i.clear(),N().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(W){var J;(J=W.update)===null||J===void 0||J.call(W,_,M)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var Z;(Z=this.rendererController)===null||Z===void 0||Z.render()}(t=this.cssRendererController)===null||t===void 0||t.render(d,P),(s=this.stats)===null||s===void 0||s.update(),this.event.emit("render",{delta:_,elapsed:M})}},a.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},a.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},a.dispose=function(){var e,r,t,s,o,i,d,P;this.stop(),N().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.resizeObserver=void 0,this.installPlugins.forEach(function(y){var _;(_=y.dispose)===null||_===void 0||_.call(y)}),(r=this.controlController)===null||r===void 0||r.dispose(),(t=this.cssRendererController)===null||t===void 0||t.dispose(),(s=this.cameraController)===null||s===void 0||s.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(i=this.composerController)===null||i===void 0||i.dispose(),(d=this.rendererController)===null||d===void 0||d.dispose(),this.controlController=void 0,this.cssRendererController=void 0,this.cameraController=void 0,this.sceneController=void 0,this.composerController=void 0,this.rendererController=void 0,(P=this.gui)===null||P===void 0||P.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(u,[{key:"renderer",get:function(){var e;return(e=this.rendererController)===null||e===void 0?void 0:e.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){var e;return(e=this.cameraController)===null||e===void 0?void 0:e.camera}},{key:"scene",get:function(){var e;return(e=this.sceneController)===null||e===void 0?void 0:e.scene}}]),u}();Ce.options={isdev:be,stats:be,gui:be,axesHelper:be,control:!1,renderer:j((0,G.Z)({},b),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:ie,camera:E,bloom:!1,bloomParams:We,outline:!1,outlineParams:Ke,css2DRenderer:!1,ssr:!1,ssrParams:nt,css2DRendererParams:(0,G.Z)({},g),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},g),staticPath:"/"};function ot(){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(u){return!1}}function Pe(u,a,n){return ot()?Pe=Reflect.construct:Pe=function(r,t,s){var o=[null];o.push.apply(o,t);var i=Function.bind.apply(r,o),d=new i;return s&&Te(d,s.prototype),d},Pe.apply(null,arguments)}function Ge(u,a,n){return Pe.apply(null,arguments)}var ut=q(484);function lt(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={};return n.promise=new Promise(function(e,r){n.resolve=e,n.reject=r}),u&&(n.promise=(0,ut.Z)(n.promise,a)),n}var ct=function(u){"use strict";je(n,u);var a=Ee(n);function n(r){O(this,n);var t;return t=a.call(this),t.objecttype__="BaseObject",t.isAdd=!1,t.userData={},t.pm=lt(),t.visible=!1,t}var e=n.prototype;return e.init=function(){},e.create=function(){},e.render=function(){},e.update=function(t,s){},e.resize=function(t,s){},e.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},e.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},e.isVisible=function(){return this.visible},e.createMesh=function(){for(var t=arguments.length,s=new Array(t),o=0;o<t;o++)s[o]=arguments[o];return this.object3d=Ge(v.Mesh,I(s)),this},e.createGroup=function(){return this.object3d=new v.Group,this},e.createPoints=function(){for(var t=arguments.length,s=new Array(t),o=0;o<t;o++)s[o]=arguments[o];return this.object3d=Ge(v.Points,I(s)),this},e.createCSS2DObject=function(t){return this.object3d=new h.CSS2DObject(t),this},e.createCSS3DObject=function(t){return this.object3d=new c.CSS3DObject(t),this},e.createCSS3DSprite=function(t){return this.object3d=new c.CSS3DSprite(t),this},e.createSprite=function(t){return this.object3d=new v.Sprite(t),this},e.add=function(){for(var t=arguments.length,s=new Array(t),o=0;o<t;o++)s[o]=arguments[o];var i;return(i=this.object3d).add.apply(i,I(s)),this},e.remove=function(){for(var t=arguments.length,s=new Array(t),o=0;o<t;o++)s[o]=arguments[o];var i;return(i=this.object3d).remove.apply(i,I(s)),this},e.getSize=function(){var t=new v.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new v.Vector3)}},e.traverse=function(t){t(this),this.children.forEach(function(s){s.traverse(t)})},e.dispose=function(){var t;(t=this.object3d)===null||t===void 0||t.traverse(function(s){(0,z.disposeMesh)(s)})},C(n,[{key:"parent",get:function(){var t=this.object3d.parent;return(t==null?void 0:t.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(t){return t.userData.BaseObject_}).filter(function(t){return!!t})}}]),n}(l)})(),module.exports=ye})();
57
+ }`})},n}(Le.Pass);Se.BlurDirectionX=new v.Vector2(1,0),Se.BlurDirectionY=new v.Vector2(0,1);var We={threshold:.2,strength:.5,radius:0},Xe=new v.MeshBasicMaterial({color:"black"}),qe=new v.SpriteMaterial({color:"#000"}),Qe=function(){"use strict";function u(n,e){O(this,u),this.materials={},this.bloomLayer=new v.Layers,this.active=!0,this.composerController=n,this.options=e;var r=n.renderer,t=n.renderPass,a=n.finalComposer,o=n.getSize(),i=o.width,d=o.height,y=new Se(new v.Vector2(i,d),e.strength,e.radius,e.threshold);this.bloomPass=y;var _=new S.EffectComposer(r);_.renderToScreen=!1,_.addPass(t),_.addPass(this.bloomPass),this.bloomComposer=_,this.bloomLayer.set(Ue);var P=new v.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:_.renderTarget2.texture}},vertexShader:ke,fragmentShader:Ve,defines:{}}),R=new Q.ShaderPass(P,"baseTexture");R.needsSwap=!0,this.finalPass=R,a.addPass(R)}var s=u.prototype;return s.enable=function(){this.active||(this.finalPass.enabled=!0,this.bloomPass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.finalPass.enabled=!1,this.bloomPass.enabled=!1,this.active=!1)},s.render=function(e){if(!!this.active){var r=this,t=r.bloomComposer,a=r.bloomLayer,o=r.materials;e.traverse(function(i){var d=i;d.material&&a.test(d.layers)===!1&&(o[d.uuid]=d.material,d.material=d.isSprite?qe:Xe)}),t.render(),e.traverse(function(i){var d=i;o[d.uuid]&&(d.material=o[d.uuid],delete o[d.uuid])})}},s.setSize=function(e,r){this.bloomComposer.setSize(e,r)},s.setGui=function(e){var r=this,t=new l;t.guiParams={bloom:{threshold:{value:this.options.threshold,min:0,max:1,target:function(){return r.bloomPass}},strength:{value:this.options.strength,min:0,max:10,target:function(){return r.bloomPass}},radius:{value:this.options.radius,min:0,max:2,step:.01,target:function(){return r.bloomPass}}}},t.showGuiParams(e)},s.dispose=function(){this.bloomPass.dispose(),this.materials={}},u}(),Ye=require("three/examples/jsm/postprocessing/OutlinePass"),Ke={edgeStrength:3,edgeGlow:4,edgeThickness:1,pulsePeriod:0,rotate:!1,usePatternTexture:!1,visibleEdgeColor:"#5ee8e8",hiddenEdgeColor:"#190a05"},$e=function(){"use strict";function u(n,e){O(this,u),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.finalComposer,o=n.getSize(),i=o.width,d=o.height,y=new Ye.OutlinePass(new v.Vector2(i,d),r,t);y.selectedObjects=this.selectedObjects,this.outlinePass=y,a.addPass(y),this.setGui()}var s=u.prototype;return s.enable=function(){this.active||(this.outlinePass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.outlinePass.enabled=!1,this.active=!1)},s.setGui=function(){var e=this,r=new l;r.guiParams={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.setGuiTargetValueByParams(),this.outlineGui=r},s.dispose=function(){this.outlinePass.dispose(),this.selectedObjects=[]},u}();function Je(u,s){if(u==null)return{};var n={},e=Object.keys(u),r,t;for(t=0;t<e.length;t++)r=e[t],!(s.indexOf(r)>=0)&&(n[r]=u[r]);return n}function et(u,s){if(u==null)return{};var n=Je(u,s),e,r;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);for(r=0;r<t.length;r++)e=t[r],!(s.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(u,e)||(n[e]=u[e]))}return n}var tt=require("three/examples/jsm/postprocessing/SSRPass"),rt=require("three/examples/jsm/objects/ReflectorForSSRPass"),nt={maxDistance:10,selects:!0},it={width:1,height:1,clipBias:3e-4,color:8947848,useDepthTexture:!0},at=function(){"use strict";function u(n,e){O(this,u),this.selectedObjects=[],this.active=!0,this.composerController=n,this.options=e;var r=n.scene,t=n.camera,a=n.renderer,o=n.finalComposer,i=n.getSize(),d=i.width,y=i.height,_=new tt.SSRPass({renderer:a,scene:r,camera:t,width:d,height:y,groundReflector:null,selects:this.selectedObjects});this.ssrPass=_,o.addPass(_),this.setGui()}var s=u.prototype;return s.addGroundReflector=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(0,G.Z)({},it,e),t=r.width,a=r.height,o=et(r,["width","height"]),i=this.composerController,d=i.scene,y=i.getSize(),_=new v.PlaneGeometry(t,a),P=new rt.ReflectorForSSRPass(_,M((0,G.Z)({},o),{textureWidth:y.width,textureHeight:y.height}));P.material.depthWrite=!1,P.rotation.x=-Math.PI/2,P.visible=!1,d.add(P),this.ssrPass.groundReflector=this.groundReflector,this.groundReflector=P},s.removeaGroundReflector=function(){this.ssrPass.groundReflector=null,this.groundReflector=void 0},s.enable=function(){this.active||(this.ssrPass.enabled=!0,this.active=!0)},s.disable=function(){!this.active||(this.ssrPass.enabled=!1,this.active=!1)},s.setSize=function(e,r){var t=this.groundReflector;t&&(t.getRenderTarget().setSize(e,r),t.resolution.set(e,r))},s.setGui=function(){var e=this,r=new l;r.guiParams={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(t){t?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.setGuiTargetValueByParams(),this.ssrGui=r},s.dispose=function(){this.ssrPass.dispose(),this.selectedObjects=[]},u}(),st=function(){"use strict";function u(n){O(this,u),this.active=!0,this.options=n;var e=n.renderer,r=n.scene,t=n.camera,a=this.createRenderTarget(),o=new S.EffectComposer(e,a);o.setPixelRatio(e.getPixelRatio()),this.finalComposer=o,this.addRenderPasss(),this.renderer=e,this.scene=r,this.renderTarget=a,this.camera=t}var s=u.prototype;return s.createRenderTarget=function(){var e=this.options.composerParams,r=e.multisampling,t=e.type,a=e.encoding,o=this.getSize(),i={minFilter:v.LinearFilter,magFilter:v.LinearFilter,format:v.RGBAFormat,encoding:a,type:t},d;if(+v.REVISION<138&&r>0){var y=new v.WebGLMultisampleRenderTarget(o.width,o.height,i);y.samples=r,d=y}else if(+v.REVISION>=138&&r>0){var _=new v.WebGLRenderTarget(o.width,o.height,M((0,G.Z)({},i),{samples:r}));d=_}else{var P=new v.WebGLRenderTarget(o.width,o.height,i);d=P}return d.texture.name="EffectComposer.rt1",d},s.addRenderPasss=function(){var e=this.options,r=e.scene,t=e.camera,a=new H.RenderPass(r,t);this.finalComposer.addPass(a),this.renderPass=a},s.addCopyPass=function(){var e=new Q.ShaderPass(K.CopyShader);this.finalComposer.addPass(e),this.copyPass=e},s.addGammaCorrectionPass=function(){var e=new Q.ShaderPass(re.GammaCorrectionShader);this.finalComposer.addPass(e),this.gammaCorrectionPass=e},s.addFXAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,a=new Q.ShaderPass(de.FXAAShader);this.finalComposer.addPass(a),this.fxaaPass=a,this.setFXAAPassSize(r,t)},s.addSMAAPass=function(){var e=this.getSize(),r=e.width,t=e.height,a=this.options.renderer,o=new J.SMAAPass(r*a.getPixelRatio(),t*a.getPixelRatio());this.finalComposer.addPass(o),this.smaaPass=o},s.addSSAAPass=function(){var e=this.options,r=e.scene,t=e.camera,a=new ve.SSAARenderPass(r,t,0,0);a.unbiased=!0,a.sampleLevel=1,this.finalComposer.addPass(a),this.ssaaPass=a},s.addBloomPass=function(e){var r=new Qe(this,e);r.disable(),this.options.gui&&r.setGui(this.options.gui),this.bloomController=r},s.addOutlinePass=function(e){var r=new $e(this,e);r.disable(),this.options.gui&&r.outlineGui.showGuiParams(this.options.gui),this.outlineController=r},s.addSSRPass=function(e){var r=new at(this,e);r.disable(),this.options.gui&&r.ssrGui.showGuiParams(this.options.gui),this.ssrController=r},s.getSize=function(){var e=this.options.renderer;return e.getSize(new v.Vector2)},s.enable=function(){this.active||(this.active=!0)},s.disable=function(){!this.active||(this.active=!1)},s.checkCopyPass=function(){var e=this,r=this.finalComposer.passes.some(function(t){return t!==e.renderPass&&t!==e.copyPass?t.enabled:!1});r&&this.copyPass?this.copyPass.enabled=!1:!r&&this.copyPass?this.copyPass.enabled=!0:!r&&!this.copyPass&&this.addCopyPass()},s.setSize=function(e,r){var t,a;this.finalComposer.setSize(e,r),(t=this.bloomController)===null||t===void 0||t.setSize(e,r),(a=this.ssrController)===null||a===void 0||a.setSize(e,r),this.setFXAAPassSize(e,r)},s.setFXAAPassSize=function(e,r){if(!!this.fxaaPass){var t=this.options.renderer,a=t.getPixelRatio();this.fxaaPass.material.uniforms.resolution.value.x=1/(e*a),this.fxaaPass.material.uniforms.resolution.value.y=1/(r*a)}},s.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()}},s.dispose=function(){var e,r,t,a,o;(e=this.bloomController)===null||e===void 0||e.dispose(),(r=this.outlineController)===null||r===void 0||r.dispose(),(t=this.ssrController)===null||t===void 0||t.dispose(),(a=this.finalComposer)===null||a===void 0||a.passes.forEach(function(i){var d,y,_;(d=i.fsQuad)===null||d===void 0||d.dispose(),(y=i.fsQuad)===null||y===void 0||(_=y.material)===null||_===void 0||_.dispose()}),(o=this.renderTarget)===null||o===void 0||o.dispose(),this.renderer=void 0,this.scene=void 0,this.camera=void 0,this.finalComposer=void 0,this.renderTarget=void 0,this.renderPass=void 0,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},u}(),Ce=function(){"use strict";function u(n){O(this,u),this.raycaster=new v.Raycaster,this.installPlugins=new Map,this.event=new ie.EventEmitter,this.clock=new v.Clock,this.options=F()(u.options,n,{isMergeableObject:z.isPlainObject});var e=this.options,r=e.container,t=e.stats,a=e.gui;if(a){var o=new(f());o.open(!1),this.gui=o}if(t){var i=new(L());i.showPanel(0),i.dom.style.position="absolute",r.appendChild(i.dom),this.stats=i}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),this.clock.getDelta(),this.clock.getElapsedTime()}var s=u.prototype;return s.use=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var o;(o=e).install.apply(o,[this].concat(I(t))),this.installPlugins.set(e,!0)}},s.init=function(){var e=this,r=this.options,t=r.container,a=r.isdev,o=r.axesHelper,i=r.renderer,d=r.scene,y=r.camera,_=this.getSize(),P=_.width,R=_.height,Z=new j({isdev:a,width:P,height:R,cameraParams:y});this.gui&&Z.setGui(this.gui);var X=Z.camera,ee=new le({camera:X,sceneParams:d}),te=ee.scene,se=new w({width:P,height:R,scene:te,camera:X,isdev:a,rendererParams:M((0,G.Z)({},i),{outputEncoding:v.LinearEncoding,antialias:!1})});this.gui&&se.setGui(this.gui);var ue=se.renderer;o&&ee.addAxesHelper(),this.sceneController=ee,this.rendererController=se,this.cameraController=Z,t.appendChild(ue.domElement);var Y=new ResizeObserver(function(pe){var fe=!0,he=!1,De=void 0;try{for(var xe=pe[Symbol.iterator](),ze;!(fe=(ze=xe.next()).done);fe=!0){var ft=ze.value,Be=ft.contentRect;e.handeleResize(Be.width,Be.height)}}catch(dt){he=!0,De=dt}finally{try{!fe&&xe.return!=null&&xe.return()}finally{if(he)throw De}}});Y.observe(t),this.resizeObserver=Y},s.initComposer=function(){var e=this.options,r=e.bloom,t=e.outline,a=e.ssr,o=e.renderer,i=e.bloomParams,d=e.outlineParams,y=e.ssrParams,_=e.multisampling,P=o.antialias;P==="msaa"&&!Re&&(P=!1,console.warn("MSAA is not supported on this browser"));var R=new st({renderer:this.renderer,scene:this.scene,camera:this.camera,gui:this.gui,composerParams:{multisampling:P==="msaa"?_:0,type:v.UnsignedByteType,encoding:o.outputEncoding}});this.composerController=R,P==="ssaa"&&R.addSSAAPass(),a&&R.addSSRPass(y),r&&R.addBloomPass(i),t&&R.addOutlinePass(d),o.outputEncoding===v.sRGBEncoding&&R.addGammaCorrectionPass(),P==="fxaa"?R.addFXAAPass():P==="smaa"&&R.addSMAAPass(),R.checkCopyPass(),this.event.on("passcheck",function(){R.checkCopyPass()})},s.initCSSRenderer=function(){var e=this.options,r=e.container,t=e.css2DRenderer,a=e.css3DRenderer,o=e.css2DRendererParams,i=e.css3DRendererParams;if(t||a){var d=new x(r);t&&d.addRenderer("css2d",o),a&&d.addRenderer("css3d",i),this.cssRendererController=d}},s.initControl=function(){var e=this.options,r=e.control,t=e.mapControl,a=e.controlParams;if(r){var o=new ge({camera:this.camera,controlParams:{domElement:(a==null?void 0:a.domElement)||this.renderer.domElement},mapControl:t});this.controlController=o}},s.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},s.handeleResize=function(e,r){var t=this,a=t.rendererController,o=t.cameraController,i=t.composerController,d=t.cssRendererController;o==null||o.setSize(e,r),a==null||a.setSize(e,r),i==null||i.setSize(e,r),d==null||d.setSize(e,r),this.installPlugins.forEach(function(y,_){var P;(P=_.resize)===null||P===void 0||P.call(_,{width:e,height:r})}),this.event.emit("resize",{width:e,height:r})},s.pick=function(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this,o=a.raycaster,i=a.options,d=i.container,y=new v.Vector2,_=d.getBoundingClientRect();if(y.x=(e.clientX-_.left)/(_.right-_.left)*2-1,y.y=-((e.clientY-_.top)/(_.bottom-_.top))*2+1,this.camera&&this.scene){o.setFromCamera(y,this.camera);var P=o.intersectObjects(r||this.scene.children,t);if(P.length)return{object:P[0].object,intersects:P}}},s.render=function(){var e,r,t,a,o=this,i=o.renderer,d=o.scene,y=o.camera,_=o.clock;if(!(!i||!d||!y||this.options.staticRender&&!this.cameraController.checkCameraChange())){var P=_.getDelta(),R=_.getElapsedTime();if(i.clear(),N().update(),(e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(X,ee){var te;(te=ee.update)===null||te===void 0||te.call(ee,P,R)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var Z;(Z=this.rendererController)===null||Z===void 0||Z.render()}(t=this.cssRendererController)===null||t===void 0||t.render(d,y),(a=this.stats)===null||a===void 0||a.update(),this.event.emit("render",{delta:P,elapsed:R})}},s.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},s.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},s.dispose=function(){var e,r,t,a,o,i,d,y;this.stop(),N().removeAll(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.resizeObserver=void 0,this.installPlugins.forEach(function(_,P){var R;(R=P.dispose)===null||R===void 0||R.call(P)}),(r=this.controlController)===null||r===void 0||r.dispose(),(t=this.cssRendererController)===null||t===void 0||t.dispose(),(a=this.cameraController)===null||a===void 0||a.dispose(),(o=this.sceneController)===null||o===void 0||o.dispose(),(i=this.composerController)===null||i===void 0||i.dispose(),(d=this.rendererController)===null||d===void 0||d.dispose(),this.controlController=void 0,this.cssRendererController=void 0,this.cameraController=void 0,this.sceneController=void 0,this.composerController=void 0,this.rendererController=void 0,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},C(u,[{key:"renderer",get:function(){var e;return(e=this.rendererController)===null||e===void 0?void 0:e.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){var e;return(e=this.cameraController)===null||e===void 0?void 0:e.camera}},{key:"scene",get:function(){var e;return(e=this.sceneController)===null||e===void 0?void 0:e.scene}}]),u}();Ce.options={isdev:be,stats:be,gui:be,axesHelper:be,control:!1,renderer:M((0,G.Z)({},b),{antialias:Re?"msaa":"smaa"}),staticRender:!1,multisampling:8,scene:ae,camera:E,bloom:!1,bloomParams:We,outline:!1,outlineParams:Ke,css2DRenderer:!1,ssr:!1,ssrParams:nt,css2DRendererParams:(0,G.Z)({},g),css3DRenderer:!1,css3DRendererParams:(0,G.Z)({},g),staticPath:"/"};function ot(){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(u){return!1}}function Pe(u,s,n){return ot()?Pe=Reflect.construct:Pe=function(r,t,a){var o=[null];o.push.apply(o,t);var i=Function.bind.apply(r,o),d=new i;return a&&Te(d,a.prototype),d},Pe.apply(null,arguments)}function Ge(u,s,n){return Pe.apply(null,arguments)}var ut=q(484);function lt(){var u=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(e,r){n.resolve=e,n.reject=r}),u&&(n.promise=(0,ut.Z)(n.promise,s)),n}var ct=function(u){"use strict";je(n,u);var s=Ee(n);function n(r){O(this,n);var t;return t=s.call(this),t.objecttype__="BaseObject",t.isAdd=!1,t.userData={},t.pm=lt(),t.visible=!1,t}var e=n.prototype;return e.init=function(){},e.create=function(){},e.render=function(){},e.update=function(t,a){},e.resize=function(t,a){},e.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},e.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},e.isVisible=function(){return this.visible},e.createMesh=function(){for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return this.object3d=Ge(v.Mesh,I(a)),this},e.createGroup=function(){return this.object3d=new v.Group,this},e.createPoints=function(){for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return this.object3d=Ge(v.Points,I(a)),this},e.createCSS2DObject=function(t){return this.object3d=new h.CSS2DObject(t),this},e.createCSS3DObject=function(t){return this.object3d=new c.CSS3DObject(t),this},e.createCSS3DSprite=function(t){return this.object3d=new c.CSS3DSprite(t),this},e.createSprite=function(t){return this.object3d=new v.Sprite(t),this},e.add=function(){for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];var i;return(i=this.object3d).add.apply(i,I(a)),this},e.remove=function(){for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];var i;return(i=this.object3d).remove.apply(i,I(a)),this},e.getSize=function(){var t=new v.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new v.Vector3)}},e.traverse=function(t){t(this),this.children.forEach(function(a){a.traverse(t)})},e.dispose=function(){var t;(t=this.object3d)===null||t===void 0||t.traverse(function(a){(0,z.disposeMesh)(a)})},C(n,[{key:"parent",get:function(){var t=this.object3d.parent;return(t==null?void 0:t.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(t){return t.userData.BaseObject_}).filter(function(t){return!!t})}}]),n}(l)})(),module.exports=ye})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",