gl-draw 0.0.21 → 0.0.22

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