gl-draw 0.6.6 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
1
  export declare const ENTIRE_SCENE = 0;
2
- export declare const BLOOM_SCENE = 1;
3
2
  export declare const IS_DEV: boolean;
4
3
  export declare const WEBGLE2_AVAILABLE: boolean;
@@ -1,13 +1,18 @@
1
1
  import * as THREE from 'three';
2
2
  import GUI from 'lil-gui';
3
- import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer';
4
- import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass';
5
- import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass';
6
- import { SMAAPass } from 'three/examples/jsm/postprocessing/SMAAPass';
7
- import { SSAARenderPass } from 'three/examples/jsm/postprocessing/SSAARenderPass';
8
- import BloomController, { BloomParams } from './pass/bloom';
9
- import OutlineController, { OutlineParams } from './pass/outline';
10
- import SSRController, { SSRParams } from './pass/ssr';
3
+ import { EffectComposer, CopyPass, EffectPass, SelectiveBloomEffect } from 'postprocessing';
4
+ export interface BloomParams {
5
+ luminanceThreshold: number;
6
+ luminanceSmoothing: number;
7
+ mipmapBlur: boolean;
8
+ intensity: number;
9
+ }
10
+ export declare const defaultBloomParams: {
11
+ luminanceThreshold: number;
12
+ luminanceSmoothing: number;
13
+ mipmapBlur: boolean;
14
+ intensity: number;
15
+ };
11
16
  export interface ComposerParams {
12
17
  multisampling: number;
13
18
  type: THREE.TextureDataType;
@@ -17,7 +22,6 @@ interface Options {
17
22
  renderer: THREE.WebGLRenderer;
18
23
  scene: THREE.Scene;
19
24
  camera: THREE.Camera;
20
- gui?: GUI;
21
25
  composerParams: ComposerParams;
22
26
  }
23
27
  export default class {
@@ -25,35 +29,22 @@ export default class {
25
29
  scene: THREE.Scene;
26
30
  camera: THREE.Camera;
27
31
  finalComposer: EffectComposer;
28
- renderPass: RenderPass;
29
- copyPass?: ShaderPass;
30
- gammaCorrectionPass?: ShaderPass;
31
- smaaPass?: SMAAPass;
32
- fxaaPass?: ShaderPass;
33
- ssaaPass?: SSAARenderPass;
34
- bloomController?: BloomController;
35
- outlineController?: OutlineController;
36
- ssrController?: SSRController;
37
- renderTarget: THREE.WebGLRenderTarget;
32
+ copyPass: CopyPass;
33
+ fxaaPass?: EffectPass;
34
+ bloomPass?: EffectPass;
35
+ bloomEffect?: SelectiveBloomEffect;
38
36
  options: Options;
39
37
  active: boolean;
40
38
  constructor(options: Options);
41
- createRenderTarget(): THREE.WebGLRenderTarget;
42
- addRenderPasss(): void;
43
39
  addCopyPass(): void;
44
- addGammaCorrectionPass(): void;
45
40
  addFXAAPass(): void;
46
- addSMAAPass(): void;
47
- addSSAAPass(): void;
48
- addBloomPass(bloomParams: BloomParams): void;
49
- addOutlinePass(outlineParams: OutlineParams): void;
50
- addSSRPass(ssrParams: SSRParams): void;
41
+ addBloomPass(params: BloomParams): void;
42
+ addBloomGui(gui: GUI): void;
43
+ toggleBloomSelection(obj: THREE.Object3D<THREE.Event>): void;
51
44
  getSize(): THREE.Vector2;
52
45
  enable(): void;
53
46
  disable(): void;
54
- checkCopyPass(): void;
55
47
  setSize(width: number, height: number): void;
56
- setFXAAPassSize(width: number, height: number): void;
57
48
  render(): void;
58
49
  dispose(): void;
59
50
  }
@@ -8,10 +8,7 @@ import { CameraParams } from '../core/Camera';
8
8
  import SceneController, { SceneParams } from '../core/Scene';
9
9
  import ControlController, { ControlParams } from '../core/Control';
10
10
  import CSSRendererController, { CSSRendererParams } from '../core/CSSRenderer';
11
- import ComposerController from '../core/Composer';
12
- import { BloomParams } from '../core/pass/bloom';
13
- import { OutlineParams } from '../core/pass/outline';
14
- import { SSRParams } from '../core/pass/ssr';
11
+ import ComposerController, { BloomParams } from '../core/Composer';
15
12
  declare type DeepRequired<T> = T extends Function | HTMLElement ? T : T extends object ? {
16
13
  [P in keyof T]-?: DeepRequired<T[P]>;
17
14
  } : T;
@@ -26,7 +23,7 @@ interface Options {
26
23
  controlParams?: Partial<ControlParams>;
27
24
  resizeObserver?: boolean;
28
25
  renderer?: {
29
- antialias?: false | 'fxaa' | 'smaa' | 'ssaa' | 'msaa';
26
+ antialias?: false | 'fxaa' | 'msaa';
30
27
  } & Omit<Partial<RendererParams>, 'antialias'>;
31
28
  multisampling?: number;
32
29
  staticRender?: boolean;
@@ -34,10 +31,6 @@ interface Options {
34
31
  camera?: Partial<CameraParams> | THREE.PerspectiveCamera;
35
32
  bloom?: boolean;
36
33
  bloomParams?: Partial<BloomParams>;
37
- outline?: boolean;
38
- outlineParams?: Partial<OutlineParams>;
39
- ssr?: boolean;
40
- ssrParams?: Partial<SSRParams>;
41
34
  css2DRenderer?: boolean;
42
35
  css2DRendererParams?: Partial<CSSRendererParams>;
43
36
  css3DRenderer?: boolean;
@@ -80,6 +73,9 @@ export default class Pencil {
80
73
  logarithmicDepthBuffer: boolean;
81
74
  preserveDrawingBuffer: boolean;
82
75
  context: null;
76
+ stencil: boolean;
77
+ depth: boolean;
78
+ physicallyCorrectLights: boolean;
83
79
  };
84
80
  staticRender: boolean;
85
81
  multisampling: number;
@@ -93,27 +89,12 @@ export default class Pencil {
93
89
  };
94
90
  bloom: boolean;
95
91
  bloomParams: {
96
- threshold: number;
97
- strength: number;
98
- radius: number;
99
- };
100
- outline: boolean;
101
- outlineParams: {
102
- edgeStrength: number;
103
- edgeGlow: number;
104
- edgeThickness: number;
105
- pulsePeriod: number;
106
- rotate: boolean;
107
- usePatternTexture: boolean;
108
- visibleEdgeColor: string;
109
- hiddenEdgeColor: string;
92
+ luminanceThreshold: number;
93
+ luminanceSmoothing: number;
94
+ mipmapBlur: boolean;
95
+ intensity: number;
110
96
  };
111
97
  css2DRenderer: boolean;
112
- ssr: boolean;
113
- ssrParams: {
114
- maxDistance: number;
115
- selects: boolean;
116
- };
117
98
  css2DRendererParams: {
118
99
  zIndex: string;
119
100
  };
@@ -18,6 +18,9 @@ export interface RendererParams {
18
18
  logarithmicDepthBuffer: boolean;
19
19
  preserveDrawingBuffer: boolean;
20
20
  context: WebGLRenderingContext | undefined;
21
+ stencil: boolean;
22
+ depth: boolean;
23
+ physicallyCorrectLights: boolean;
21
24
  }
22
25
  export declare const defaultRendererParams: {
23
26
  antialias: boolean;
@@ -30,6 +33,9 @@ export declare const defaultRendererParams: {
30
33
  logarithmicDepthBuffer: boolean;
31
34
  preserveDrawingBuffer: boolean;
32
35
  context: null;
36
+ stencil: boolean;
37
+ depth: boolean;
38
+ physicallyCorrectLights: boolean;
33
39
  };
34
40
  interface Options {
35
41
  isdev: boolean;
@@ -1,5 +1,2 @@
1
- export { default as Bloom } from './bloom';
2
- export { default as Outline } from './outline';
3
- export { default as SSR } from './ssr';
4
1
  export { default as Scan } from './scan';
5
2
  export { default as Scan2 } from './scan2';
@@ -1,4 +1,4 @@
1
- (function(){var K={666:function(b){var O=function(m){"use strict";var F=Object.prototype,D=F.hasOwnProperty,M,q=typeof Symbol=="function"?Symbol:{},A=q.iterator||"@@iterator",V=q.asyncIterator||"@@asyncIterator",I=q.toStringTag||"@@toStringTag";function W(r,t,o){return Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{W({},"")}catch(r){W=function(t,o,c){return t[o]=c}}function Y(r,t,o,c){var u=t&&t.prototype instanceof H?t:H,y=Object.create(u.prototype),j=new v(c||[]);return y._invoke=i(r,o,j),y}m.wrap=Y;function G(r,t,o){try{return{type:"normal",arg:r.call(t,o)}}catch(c){return{type:"throw",arg:c}}}var R="suspendedStart",J="suspendedYield",L="executing",N="completed",P={};function H(){}function T(){}function E(){}var U={};W(U,A,function(){return this});var p=Object.getPrototypeOf,f=p&&p(p(h([])));f&&f!==F&&D.call(f,A)&&(U=f);var a=E.prototype=H.prototype=Object.create(U);T.prototype=E,W(a,"constructor",E),W(E,"constructor",T),T.displayName=W(E,I,"GeneratorFunction");function n(r){["next","throw","return"].forEach(function(t){W(r,t,function(o){return this._invoke(t,o)})})}m.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===T||(t.displayName||t.name)==="GeneratorFunction":!1},m.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,E):(r.__proto__=E,W(r,I,"GeneratorFunction")),r.prototype=Object.create(a),r},m.awrap=function(r){return{__await:r}};function e(r,t){function o(y,j,x,g){var _=G(r[y],r,j);if(_.type==="throw")g(_.arg);else{var z=_.arg,C=z.value;return C&&typeof C=="object"&&D.call(C,"__await")?t.resolve(C.__await).then(function(k){o("next",k,x,g)},function(k){o("throw",k,x,g)}):t.resolve(C).then(function(k){z.value=k,x(z)},function(k){return o("throw",k,x,g)})}}var c;function u(y,j){function x(){return new t(function(g,_){o(y,j,g,_)})}return c=c?c.then(x,x):x()}this._invoke=u}n(e.prototype),W(e.prototype,V,function(){return this}),m.AsyncIterator=e,m.async=function(r,t,o,c,u){u===void 0&&(u=Promise);var y=new e(Y(r,t,o,c),u);return m.isGeneratorFunction(t)?y:y.next().then(function(j){return j.done?j.value:y.next()})};function i(r,t,o){var c=R;return function(y,j){if(c===L)throw new Error("Generator is already running");if(c===N){if(y==="throw")throw j;return w()}for(o.method=y,o.arg=j;;){var x=o.delegate;if(x){var g=d(x,o);if(g){if(g===P)continue;return g}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(c===R)throw c=N,o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);c=L;var _=G(r,t,o);if(_.type==="normal"){if(c=o.done?N:J,_.arg===P)continue;return{value:_.arg,done:o.done}}else _.type==="throw"&&(c=N,o.method="throw",o.arg=_.arg)}}}function d(r,t){var o=r.iterator[t.method];if(o===M){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=M,d(r,t),t.method==="throw"))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var c=G(o,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,P;var u=c.arg;if(!u)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P;if(u.done)t[r.resultName]=u.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=M);else return u;return t.delegate=null,P}n(a),W(a,I,"Generator"),W(a,A,function(){return this}),W(a,"toString",function(){return"[object Generator]"});function s(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function l(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function v(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(s,this),this.reset(!0)}m.keys=function(r){var t=[];for(var o in r)t.push(o);return t.reverse(),function c(){for(;t.length;){var u=t.pop();if(u in r)return c.value=u,c.done=!1,c}return c.done=!0,c}};function h(r){if(r){var t=r[A];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var o=-1,c=function u(){for(;++o<r.length;)if(D.call(r,o))return u.value=r[o],u.done=!1,u;return u.value=M,u.done=!0,u};return c.next=c}}return{next:w}}m.values=h;function w(){return{value:M,done:!0}}return v.prototype={constructor:v,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=M,this.done=!1,this.delegate=null,this.method="next",this.arg=M,this.tryEntries.forEach(l),!r)for(var t in this)t.charAt(0)==="t"&&D.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=M)},stop:function(){this.done=!0;var r=this.tryEntries[0],t=r.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(g,_){return y.type="throw",y.arg=r,t.next=g,_&&(t.method="next",t.arg=M),!!_}for(var c=this.tryEntries.length-1;c>=0;--c){var u=this.tryEntries[c],y=u.completion;if(u.tryLoc==="root")return o("end");if(u.tryLoc<=this.prev){var j=D.call(u,"catchLoc"),x=D.call(u,"finallyLoc");if(j&&x){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(j){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else if(x){if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var o=this.tryEntries.length-1;o>=0;--o){var c=this.tryEntries[o];if(c.tryLoc<=this.prev&&D.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var u=c;break}}u&&(r==="break"||r==="continue")&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var y=u?u.completion:{};return y.type=r,y.arg=t,u?(this.method="next",this.next=u.finallyLoc,P):this.complete(y)},complete:function(r,t){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&t&&(this.next=t),P},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===r)return this.complete(o.completion,o.afterLoc),l(o),P}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===r){var c=o.completion;if(c.type==="throw"){var u=c.arg;l(o)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,o){return this.delegate={iterator:h(r),resultName:t,nextLoc:o},this.method==="next"&&(this.arg=M),P}},m}(b.exports);try{regeneratorRuntime=O}catch(m){typeof globalThis=="object"?globalThis.regeneratorRuntime=O:Function("r","regeneratorRuntime = r")(O)}}},Q={};function S(b){var O=Q[b];if(O!==void 0)return O.exports;var m=Q[b]={exports:{}};return K[b](m,m.exports,S),m.exports}(function(){S.n=function(b){var O=b&&b.__esModule?function(){return b.default}:function(){return b};return S.d(O,{a:O}),O}})(),function(){S.d=function(b,O){for(var m in O)S.o(O,m)&&!S.o(b,m)&&Object.defineProperty(b,m,{enumerable:!0,get:O[m]})}}(),function(){S.o=function(b,O){return Object.prototype.hasOwnProperty.call(b,O)}}(),function(){S.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})}}();var $={};(function(){"use strict";S.r($),S.d($,{Bloom:function(){return I},Outline:function(){return W},SSR:function(){return Y},Scan:function(){return E},Scan2:function(){return U}});function b(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function O(p,f,a){return f in p?Object.defineProperty(p,f,{value:a,enumerable:!0,configurable:!0,writable:!0}):p[f]=a,p}function m(p){for(var f=1;f<arguments.length;f++){var a=arguments[f]!=null?arguments[f]:{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.forEach(function(e){O(p,e,a[e])})}return p}var F=function(){try{var p=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&p.getContext("webgl2"))}catch(f){return!1}},D=0,M=1,q=null,A=F()!==!1,V={},I=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.bloomController?!0:(console.warn("err:pencil.options.bloom"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.bloomController;l.enable(),e.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||(h.layers.enable(M),V[h.uuid]=!0)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.bloomController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||(h.layers.disable(M),delete V[h.uuid])}),Object.keys(V).length===0&&(l.disable(),e.event.emit("passcheck","bloom"))}},p}(),W=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.outlineController?!0:(console.warn("err:pencil.options.outline"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.outlineController;l.enable(),e.event.emit("passcheck","outline"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||h.material&&l.selectedObjects.push(h)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.outlineController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||!h.material||l.selectedObjects.splice(l.selectedObjects.indexOf(h),1)}),l.selectedObjects.length===0&&(l.disable(),e.event.emit("passcheck","outline"))}},p}(),Y=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.ssrController?!0:(console.warn("err:pencil.options.ssr"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.ssrController;l.enable(),e.event.emit("passcheck","ssr"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||h.material&&l.selectedObjects.push(h)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.ssrController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||!h.material||l.selectedObjects.splice(l.selectedObjects.indexOf(h),1)}),l.selectedObjects.length===0&&(l.disable(),e.event.emit("passcheck","ssr"))}},p}();function G(p,f,a,n,e,i,d){try{var s=p[i](d),l=s.value}catch(v){a(v);return}s.done?f(l):Promise.resolve(l).then(n,e)}function R(p){return function(){var f=this,a=arguments;return new Promise(function(n,e){var i=p.apply(f,a);function d(l){G(i,n,e,d,s,"next",l)}function s(l){G(i,n,e,d,s,"throw",l)}d(void 0)})}}var J=S(666),L=S.n(J),N=require("three"),P=require("popmotion");function H(p){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return p.then(function(a){return m({err:null,res:a},f)}).catch(function(a){return m({err:a,res:void 0},f)})}function T(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(n,e){a.resolve=n,a.reject=e}),p&&(a.promise=H(a.promise,f)),a}var E=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new N.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},n)}var f=p.prototype;return f.initMaterial=function(){var n=this,e=this.options,i=e.color,d=e.lineNum,s=e.lineWidth,l=e.lineHieght,v=e.fade,h=e.fadeType,w=e.radius,r=e.range,t=e.vertical,o=e.step,c=e.opacity,u=e.exclude,y={field:{value:new N.Vector4(0,0,0,0)},color:{value:new N.Color(i)},opacity:{value:c},lineNum:{value:d},lineWidth:{value:s},lineHieght:{value:l},sizeNum:{value:new N.Vector3(w,w,w)},objPos:{value:new N.Vector3(0,0,0)},fade:{value:v},fadeType:{value:h},range:{value:r},angle:{value:0},stepNum:{value:o}};if(!w){var j=this.object.getSize().size;y.sizeNum.value.copy(j)}this.uniforms=y,this.object.object3d.traverse(function(x){var g=x;!g.material||u&&u.includes(g)||(g.userData.materialO?g.material=g.userData.materialO.clone():g.userData.materialO=Array.isArray(g.material)?g.material.map(function(_){return _.clone()}):g.material.clone(),Array.isArray(g.material)?g.material.forEach(function(_){t?n.setVerticalMaterial(_):n.setMaterial(_)}):t?n.setVerticalMaterial(g.material):n.setMaterial(g.material))})},f.setMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(i){i.uniforms.field=e.field,i.uniforms.fieldColor=e.color,i.uniforms.fieldOpacity=e.opacity,i.uniforms.lineNum=e.lineNum,i.uniforms.lineWidth=e.lineWidth,i.uniforms.sizeNum=e.sizeNum,i.uniforms.fade=e.fade,i.uniforms.fadeType=e.fadeType,i.uniforms.range=e.range,i.uniforms.stepNum=e.stepNum,i.vertexShader=`
1
+ (function(){var Q={666:function(w){var b=function(g){"use strict";var F=Object.prototype,M=F.hasOwnProperty,z,E=typeof Symbol=="function"?Symbol:{},x=E.iterator||"@@iterator",q=E.asyncIterator||"@@asyncIterator",I=E.toStringTag||"@@toStringTag";function W(r,e,n){return Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{W({},"")}catch(r){W=function(e,n,f){return e[n]=f}}function B(r,e,n,f){var o=e&&e.prototype instanceof i?e:i,y=Object.create(o.prototype),P=new T(f||[]);return y._invoke=H(r,n,P),y}g.wrap=B;function R(r,e,n){try{return{type:"normal",arg:r.call(e,n)}}catch(f){return{type:"throw",arg:f}}}var m="suspendedStart",s="suspendedYield",l="executing",a="completed",t={};function i(){}function p(){}function u(){}var c={};W(c,x,function(){return this});var d=Object.getPrototypeOf,O=d&&d(d(L([])));O&&O!==F&&M.call(O,x)&&(c=O);var v=u.prototype=i.prototype=Object.create(c);p.prototype=u,W(v,"constructor",u),W(u,"constructor",p),p.displayName=W(u,I,"GeneratorFunction");function D(r){["next","throw","return"].forEach(function(e){W(r,e,function(n){return this._invoke(e,n)})})}g.isGeneratorFunction=function(r){var e=typeof r=="function"&&r.constructor;return e?e===p||(e.displayName||e.name)==="GeneratorFunction":!1},g.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,u):(r.__proto__=u,W(r,I,"GeneratorFunction")),r.prototype=Object.create(v),r},g.awrap=function(r){return{__await:r}};function h(r,e){function n(y,P,N,C){var S=R(r[y],r,P);if(S.type==="throw")C(S.arg);else{var $=S.arg,U=$.value;return U&&typeof U=="object"&&M.call(U,"__await")?e.resolve(U.__await).then(function(V){n("next",V,N,C)},function(V){n("throw",V,N,C)}):e.resolve(U).then(function(V){$.value=V,N($)},function(V){return n("throw",V,N,C)})}}var f;function o(y,P){function N(){return new e(function(C,S){n(y,P,C,S)})}return f=f?f.then(N,N):N()}this._invoke=o}D(h.prototype),W(h.prototype,q,function(){return this}),g.AsyncIterator=h,g.async=function(r,e,n,f,o){o===void 0&&(o=Promise);var y=new h(B(r,e,n,f),o);return g.isGeneratorFunction(e)?y:y.next().then(function(P){return P.done?P.value:y.next()})};function H(r,e,n){var f=m;return function(y,P){if(f===l)throw new Error("Generator is already running");if(f===a){if(y==="throw")throw P;return _()}for(n.method=y,n.arg=P;;){var N=n.delegate;if(N){var C=G(N,n);if(C){if(C===t)continue;return C}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(f===m)throw f=a,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=l;var S=R(r,e,n);if(S.type==="normal"){if(f=n.done?a:s,S.arg===t)continue;return{value:S.arg,done:n.done}}else S.type==="throw"&&(f=a,n.method="throw",n.arg=S.arg)}}}function G(r,e){var n=r.iterator[e.method];if(n===z){if(e.delegate=null,e.method==="throw"){if(r.iterator.return&&(e.method="return",e.arg=z,G(r,e),e.method==="throw"))return t;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return t}var f=R(n,r.iterator,e.arg);if(f.type==="throw")return e.method="throw",e.arg=f.arg,e.delegate=null,t;var o=f.arg;if(!o)return e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,t;if(o.done)e[r.resultName]=o.value,e.next=r.nextLoc,e.method!=="return"&&(e.method="next",e.arg=z);else return o;return e.delegate=null,t}D(v),W(v,I,"Generator"),W(v,x,function(){return this}),W(v,"toString",function(){return"[object Generator]"});function A(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function k(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function T(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(A,this),this.reset(!0)}g.keys=function(r){var e=[];for(var n in r)e.push(n);return e.reverse(),function f(){for(;e.length;){var o=e.pop();if(o in r)return f.value=o,f.done=!1,f}return f.done=!0,f}};function L(r){if(r){var e=r[x];if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var n=-1,f=function o(){for(;++n<r.length;)if(M.call(r,n))return o.value=r[n],o.done=!1,o;return o.value=z,o.done=!0,o};return f.next=f}}return{next:_}}g.values=L;function _(){return{value:z,done:!0}}return T.prototype={constructor:T,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=z,this.done=!1,this.delegate=null,this.method="next",this.arg=z,this.tryEntries.forEach(k),!r)for(var e in this)e.charAt(0)==="t"&&M.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=z)},stop:function(){this.done=!0;var r=this.tryEntries[0],e=r.completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(C,S){return y.type="throw",y.arg=r,e.next=C,S&&(e.method="next",e.arg=z),!!S}for(var f=this.tryEntries.length-1;f>=0;--f){var o=this.tryEntries[f],y=o.completion;if(o.tryLoc==="root")return n("end");if(o.tryLoc<=this.prev){var P=M.call(o,"catchLoc"),N=M.call(o,"finallyLoc");if(P&&N){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(P){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else if(N){if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,e){for(var n=this.tryEntries.length-1;n>=0;--n){var f=this.tryEntries[n];if(f.tryLoc<=this.prev&&M.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var o=f;break}}o&&(r==="break"||r==="continue")&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var y=o?o.completion:{};return y.type=r,y.arg=e,o?(this.method="next",this.next=o.finallyLoc,t):this.complete(y)},complete:function(r,e){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&e&&(this.next=e),t},finish:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),k(n),t}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===r){var f=n.completion;if(f.type==="throw"){var o=f.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:L(r),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=z),t}},g}(w.exports);try{regeneratorRuntime=b}catch(g){typeof globalThis=="object"?globalThis.regeneratorRuntime=b:Function("r","regeneratorRuntime = r")(b)}}},J={};function j(w){var b=J[w];if(b!==void 0)return b.exports;var g=J[w]={exports:{}};return Q[w](g,g.exports,j),g.exports}(function(){j.n=function(w){var b=w&&w.__esModule?function(){return w.default}:function(){return w};return j.d(b,{a:b}),b}})(),function(){j.d=function(w,b){for(var g in b)j.o(b,g)&&!j.o(w,g)&&Object.defineProperty(w,g,{enumerable:!0,get:b[g]})}}(),function(){j.o=function(w,b){return Object.prototype.hasOwnProperty.call(w,b)}}(),function(){j.r=function(w){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})}}();var Y={};(function(){"use strict";j.r(Y),j.d(Y,{Scan:function(){return B},Scan2:function(){return R}});function w(m,s,l,a,t,i,p){try{var u=m[i](p),c=u.value}catch(d){l(d);return}u.done?s(c):Promise.resolve(c).then(a,t)}function b(m){return function(){var s=this,l=arguments;return new Promise(function(a,t){var i=m.apply(s,l);function p(c){w(i,a,t,p,u,"next",c)}function u(c){w(i,a,t,p,u,"throw",c)}p(void 0)})}}function g(m,s){if(!(m instanceof s))throw new TypeError("Cannot call a class as a function")}function F(m,s,l){return s in m?Object.defineProperty(m,s,{value:l,enumerable:!0,configurable:!0,writable:!0}):m[s]=l,m}function M(m){for(var s=1;s<arguments.length;s++){var l=arguments[s]!=null?arguments[s]:{},a=Object.keys(l);typeof Object.getOwnPropertySymbols=="function"&&(a=a.concat(Object.getOwnPropertySymbols(l).filter(function(t){return Object.getOwnPropertyDescriptor(l,t).enumerable}))),a.forEach(function(t){F(m,t,l[t])})}return m}var z=j(666),E=j.n(z),x=require("three"),q=require("popmotion");function I(m){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return m.then(function(l){return M({err:null,res:l},s)}).catch(function(l){return M({err:l,res:void 0},s)})}function W(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l={};return l.promise=new Promise(function(a,t){l.resolve=a,l.reject=t}),m&&(l.promise=I(l.promise,s)),l}var B=function(){"use strict";function m(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};g(this,m),this.object=l,this.options=M({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new x.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},a)}var s=m.prototype;return s.initMaterial=function(){var a=this,t=this.options,i=t.color,p=t.lineNum,u=t.lineWidth,c=t.lineHieght,d=t.fade,O=t.fadeType,v=t.radius,D=t.range,h=t.vertical,H=t.step,G=t.opacity,A=t.exclude,k={field:{value:new x.Vector4(0,0,0,0)},color:{value:new x.Color(i)},opacity:{value:G},lineNum:{value:p},lineWidth:{value:u},lineHieght:{value:c},sizeNum:{value:new x.Vector3(v,v,v)},objPos:{value:new x.Vector3(0,0,0)},fade:{value:d},fadeType:{value:O},range:{value:D},angle:{value:0},stepNum:{value:H}};if(!v){var T=this.object.getSize().size;k.sizeNum.value.copy(T)}this.uniforms=k,this.object.object3d.traverse(function(L){var _=L;!_.material||A&&A.includes(_)||(_.userData.materialO?_.material=_.userData.materialO.clone():_.userData.materialO=Array.isArray(_.material)?_.material.map(function(r){return r.clone()}):_.material.clone(),Array.isArray(_.material)?_.material.forEach(function(r){h?a.setVerticalMaterial(r):a.setMaterial(r)}):h?a.setVerticalMaterial(_.material):a.setMaterial(_.material))})},s.setMaterial=function(a){var t=this.uniforms;a.onBeforeCompile=function(i){i.uniforms.field=t.field,i.uniforms.fieldColor=t.color,i.uniforms.fieldOpacity=t.opacity,i.uniforms.lineNum=t.lineNum,i.uniforms.lineWidth=t.lineWidth,i.uniforms.sizeNum=t.sizeNum,i.uniforms.fade=t.fade,i.uniforms.fadeType=t.fadeType,i.uniforms.range=t.range,i.uniforms.stepNum=t.stepNum,i.vertexShader=`
2
2
  varying vec4 vWorldPos;
3
3
  `.concat(i.vertexShader,`
4
4
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
@@ -54,7 +54,7 @@
54
54
  }
55
55
  }
56
56
  }
57
- `)},n.needsUpdate=!0},f.setVerticalMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(i){i.uniforms.field=e.field,i.uniforms.fieldColor=e.color,i.uniforms.fieldOpacity=e.opacity,i.uniforms.lineNum=e.lineNum,i.uniforms.lineWidth=e.lineWidth,i.uniforms.lineHieght=e.lineHieght,i.uniforms.sizeNum=e.sizeNum,i.uniforms.fade=e.fade,i.uniforms.range=e.range,i.uniforms.angle=e.angle,i.uniforms.objPos=e.objPos,i.vertexShader=`
57
+ `)},a.needsUpdate=!0},s.setVerticalMaterial=function(a){var t=this.uniforms;a.onBeforeCompile=function(i){i.uniforms.field=t.field,i.uniforms.fieldColor=t.color,i.uniforms.fieldOpacity=t.opacity,i.uniforms.lineNum=t.lineNum,i.uniforms.lineWidth=t.lineWidth,i.uniforms.lineHieght=t.lineHieght,i.uniforms.sizeNum=t.sizeNum,i.uniforms.fade=t.fade,i.uniforms.range=t.range,i.uniforms.angle=t.angle,i.uniforms.objPos=t.objPos,i.vertexShader=`
58
58
  varying vec4 vWorldPos;
59
59
  `.concat(i.vertexShader,`
60
60
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
@@ -125,7 +125,7 @@
125
125
  }
126
126
  }
127
127
 
128
- `)},n.needsUpdate=!0},f.resetMaterial=function(){this.object.object3d.traverse(function(n){var e=n;e.material&&e.userData.materialO&&(e.material=e.userData.materialO.clone(),e.userData.materialO=void 0)})},f.play=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;this.stop();var i=T(!0),d=this,s=d.object,l=d.uniforms,v=m({},this.options,n),h=v.lineNum,w=v.step,r=v.lineWidth,t=v.pos,o=v.duration,c=s.getSize(),u=c.min,y=c.max,j=c.size,x=h,g=r;w>0&&(x=1,g=j.y/w);var _=l.sizeNum.value.y*(x>1?2:1);return this.tween=(0,P.animate)({from:0,to:1,duration:o,onPlay:function(){var z,C=new N.Vector3;t==="bottom"?C.set(u.x-.001,u.y-.001,u.z-.001):t==="top"&&C.set(y.x+.001,y.y+.001,y.z+.001);var k=((z=s.pencil.control)===null||z===void 0?void 0:z.getAzimuthalAngle())||0,B=e.object.object3d.position.clone();if(k){var X=Math.sqrt(Math.pow(j.x,2)+Math.pow(j.z,2))/2;C.x=B.x+X,C.z=B.z+X;var Z=new N.Vector3().subVectors(C,B),ee=new N.Vector3(0,1,0);Z.applyAxisAngle(ee,k),C.addVectors(B,Z)}l.objPos.value.copy(B),l.field.value.set(C.x,C.y,C.z,0),l.angle.value=k,l.lineNum.value=x,l.lineWidth.value=g},onUpdate:function(z){w>0?l.field.value.w=Math.floor(z*w)/w*_:l.field.value.w=z*_},onStop:function(){l.field.value.w=0,i.reject("stop")},onComplete:function(){i.resolve()}}),i.promise},f.checkRepeat=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;return R(L().mark(function i(){var d,s,l,v,h,w;return L().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return d=m({},e.options,n),s=d.yoyo,l=d.repeat,v=d.pos,l===e.options.repeat&&e.initMaterial(),t.next=4,e.play(n);case 4:if(h=t.sent.err,!h){t.next=8;break}return e.resetMaterial(),t.abrupt("return");case 8:if(!l){t.next=15;break}return w=v,s&&(w=w==="bottom"?"top":"bottom"),t.next=13,e.checkRepeat({pos:w,repeat:l===1/0?-1:l-1});case 13:t.next=16;break;case 15:e.resetMaterial();case 16:case"end":return t.stop()}},i)}))()},f.start=function(){return this.checkRepeat()},f.stop=function(){this.tween&&this.tween.stop()},p}(),U=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new N.Vector3(0,0,0),duration:5e3,repeat:0},n)}var f=p.prototype;return f.initMaterial=function(){var n=this,e=this.options.exclude,i={field:{value:new N.Vector4(0,0,0,1e-4)},color:{value:new N.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=i,this.object.object3d.traverse(function(d){var s=d;!s.material||e&&e.includes(s)||(s.userData.materialO?s.material=s.userData.materialO:s.userData.materialO=Array.isArray(s.material)?s.material.map(function(l){return l.clone()}):s.material.clone(),Array.isArray(s.material)?s.material.forEach(function(l){n.setMaterial(l)}):n.setMaterial(s.material))})},f.setMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(i){i.uniforms.field=e.field,i.uniforms.fieldColor=e.color,i.uniforms.fieldOpacity=e.opacity,i.uniforms.lineWidth=e.lineWidth,i.vertexShader=`
128
+ `)},a.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(a){var t=a;t.material&&t.userData.materialO&&(t.material=t.userData.materialO.clone(),t.userData.materialO=void 0)})},s.play=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;this.stop();var i=W(!0),p=this,u=p.object,c=p.uniforms,d=M({},this.options,a),O=d.lineNum,v=d.step,D=d.lineWidth,h=d.pos,H=d.duration,G=u.getSize(),A=G.min,k=G.max,T=G.size,L=O,_=D;v>0&&(L=1,_=T.y/v);var r=c.sizeNum.value.y*(L>1?2:1);return this.tween=(0,q.animate)({from:0,to:1,duration:H,onPlay:function(){var e,n=new x.Vector3;h==="bottom"?n.set(A.x-.001,A.y-.001,A.z-.001):h==="top"&&n.set(k.x+.001,k.y+.001,k.z+.001);var f=((e=u.pencil.control)===null||e===void 0?void 0:e.getAzimuthalAngle())||0,o=t.object.object3d.position.clone();if(f){var y=Math.sqrt(Math.pow(T.x,2)+Math.pow(T.z,2))/2;n.x=o.x+y,n.z=o.z+y;var P=new x.Vector3().subVectors(n,o),N=new x.Vector3(0,1,0);P.applyAxisAngle(N,f),n.addVectors(o,P)}c.objPos.value.copy(o),c.field.value.set(n.x,n.y,n.z,0),c.angle.value=f,c.lineNum.value=L,c.lineWidth.value=_},onUpdate:function(e){v>0?c.field.value.w=Math.floor(e*v)/v*r:c.field.value.w=e*r},onStop:function(){c.field.value.w=0,i.reject("stop")},onComplete:function(){i.resolve()}}),i.promise},s.checkRepeat=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;return b(E().mark(function i(){var p,u,c,d,O,v;return E().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return p=M({},t.options,a),u=p.yoyo,c=p.repeat,d=p.pos,c===t.options.repeat&&t.initMaterial(),h.next=4,t.play(a);case 4:if(O=h.sent.err,!O){h.next=8;break}return t.resetMaterial(),h.abrupt("return");case 8:if(!c){h.next=15;break}return v=d,u&&(v=v==="bottom"?"top":"bottom"),h.next=13,t.checkRepeat({pos:v,repeat:c===1/0?-1:c-1});case 13:h.next=16;break;case 15:t.resetMaterial();case 16:case"end":return h.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},m}(),R=function(){"use strict";function m(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};g(this,m),this.object=l,this.options=M({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new x.Vector3(0,0,0),duration:5e3,repeat:0},a)}var s=m.prototype;return s.initMaterial=function(){var a=this,t=this.options.exclude,i={field:{value:new x.Vector4(0,0,0,1e-4)},color:{value:new x.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=i,this.object.object3d.traverse(function(p){var u=p;!u.material||t&&t.includes(u)||(u.userData.materialO?u.material=u.userData.materialO:u.userData.materialO=Array.isArray(u.material)?u.material.map(function(c){return c.clone()}):u.material.clone(),Array.isArray(u.material)?u.material.forEach(function(c){a.setMaterial(c)}):a.setMaterial(u.material))})},s.setMaterial=function(a){var t=this.uniforms;a.onBeforeCompile=function(i){i.uniforms.field=t.field,i.uniforms.fieldColor=t.color,i.uniforms.fieldOpacity=t.opacity,i.uniforms.lineWidth=t.lineWidth,i.vertexShader=`
129
129
  varying vec4 vWorldPos;
130
130
  `.concat(i.vertexShader,`
131
131
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
@@ -157,4 +157,4 @@
157
157
  }
158
158
  gl_FragColor.rgb = mix(gl_FragColor.rgb, fieldColor, fadeout);
159
159
 
160
- `)},n.needsUpdate=!0},f.resetMaterial=function(){this.object.object3d.traverse(function(n){var e=n;e.material&&e.userData.materialO&&(e.material=e.userData.materialO.clone(),e.userData.materialO=void 0)})},f.play=function(){var n=this;this.stop();var e=T(!0),i=this,d=i.object,s=i.uniforms,l=this.options,v=l.position,h=l.duration,w=this.options.radius;if(!w){var r=d.getSize().size;w=Math.max(r.x,r.y,r.z)}return this.tween=(0,P.animate)({from:1e-4,to:1,duration:h,onPlay:function(){s.field.value.set(v.x,v.y,v.z,1e-4),n.options.fade&&(s.opacity.value=n.options.opacity)},onUpdate:function(t){s.field.value.w=t*w,n.options.fade&&(s.opacity.value=(1-t)*n.options.opacity)},onStop:function(){s.field.value.w=0,e.reject("stop")},onComplete:function(){e.resolve()}}),e.promise},f.checkRepeat=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;return R(L().mark(function i(){var d,s;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return d=m({},e.options,n).repeat,d===e.options.repeat&&e.initMaterial(),v.next=4,e.play();case 4:if(s=v.sent.err,!s){v.next=8;break}return e.resetMaterial(),v.abrupt("return");case 8:if(!d){v.next=13;break}return v.next=11,e.checkRepeat({repeat:d===1/0?-1:d-1});case 11:v.next=14;break;case 13:e.resetMaterial();case 14:case"end":return v.stop()}},i)}))()},f.start=function(){return this.checkRepeat()},f.stop=function(){this.tween&&this.tween.stop()},p}()})(),module.exports=$})();
160
+ `)},a.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(a){var t=a;t.material&&t.userData.materialO&&(t.material=t.userData.materialO.clone(),t.userData.materialO=void 0)})},s.play=function(){var a=this;this.stop();var t=W(!0),i=this,p=i.object,u=i.uniforms,c=this.options,d=c.position,O=c.duration,v=this.options.radius;if(!v){var D=p.getSize().size;v=Math.max(D.x,D.y,D.z)}return this.tween=(0,q.animate)({from:1e-4,to:1,duration:O,onPlay:function(){u.field.value.set(d.x,d.y,d.z,1e-4),a.options.fade&&(u.opacity.value=a.options.opacity)},onUpdate:function(h){u.field.value.w=h*v,a.options.fade&&(u.opacity.value=(1-h)*a.options.opacity)},onStop:function(){u.field.value.w=0,t.reject("stop")},onComplete:function(){t.resolve()}}),t.promise},s.checkRepeat=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;return b(E().mark(function i(){var p,u;return E().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return p=M({},t.options,a).repeat,p===t.options.repeat&&t.initMaterial(),d.next=4,t.play();case 4:if(u=d.sent.err,!u){d.next=8;break}return t.resetMaterial(),d.abrupt("return");case 8:if(!p){d.next=13;break}return d.next=11,t.checkRepeat({repeat:p===1/0?-1:p-1});case 11:d.next=14;break;case 13:t.resetMaterial();case 14:case"end":return d.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},m}()})(),module.exports=Y})();
@@ -1,4 +1,4 @@
1
- import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var w=function(v){"use strict";var $=Object.prototype,S=$.hasOwnProperty,C,X=typeof Symbol=="function"?Symbol:{},U=X.iterator||"@@iterator",B=X.asyncIterator||"@@asyncIterator",F=X.toStringTag||"@@toStringTag";function j(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{j({},"")}catch(e){j=function(t,n,a){return t[n]=a}}function J(e,t,n,a){var u=t&&t.prototype instanceof x?t:x,p=Object.create(u.prototype),_=new i(a||[]);return p._invoke=s(e,n,_),p}v.wrap=J;function T(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(a){return{type:"throw",arg:a}}}var H="suspendedStart",Z="suspendedYield",z="executing",A="completed",O={};function x(){}function G(){}function k(){}var V={};j(V,U,function(){return this});var q=Object.getPrototypeOf,L=q&&q(q(d([])));L&&L!==$&&S.call(L,U)&&(V=L);var E=k.prototype=x.prototype=Object.create(V);G.prototype=k,j(E,"constructor",k),j(k,"constructor",G),G.displayName=j(k,F,"GeneratorFunction");function K(e){["next","throw","return"].forEach(function(t){j(e,t,function(n){return this._invoke(t,n)})})}v.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===G||(t.displayName||t.name)==="GeneratorFunction":!1},v.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,j(e,F,"GeneratorFunction")),e.prototype=Object.create(E),e},v.awrap=function(e){return{__await:e}};function c(e,t){function n(p,_,y,b){var g=T(e[p],e,_);if(g.type==="throw")b(g.arg);else{var P=g.arg,N=P.value;return N&&typeof N=="object"&&S.call(N,"__await")?t.resolve(N.__await).then(function(h){n("next",h,y,b)},function(h){n("throw",h,y,b)}):t.resolve(N).then(function(h){P.value=h,y(P)},function(h){return n("throw",h,y,b)})}}var a;function u(p,_){function y(){return new t(function(b,g){n(p,_,b,g)})}return a=a?a.then(y,y):y()}this._invoke=u}K(c.prototype),j(c.prototype,B,function(){return this}),v.AsyncIterator=c,v.async=function(e,t,n,a,u){u===void 0&&(u=Promise);var p=new c(J(e,t,n,a),u);return v.isGeneratorFunction(t)?p:p.next().then(function(_){return _.done?_.value:p.next()})};function s(e,t,n){var a=H;return function(p,_){if(a===z)throw new Error("Generator is already running");if(a===A){if(p==="throw")throw _;return f()}for(n.method=p,n.arg=_;;){var y=n.delegate;if(y){var b=l(y,n);if(b){if(b===O)continue;return b}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(a===H)throw a=A,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);a=z;var g=T(e,t,n);if(g.type==="normal"){if(a=n.done?A:Z,g.arg===O)continue;return{value:g.arg,done:n.done}}else g.type==="throw"&&(a=A,n.method="throw",n.arg=g.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===C){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=C,l(e,t),t.method==="throw"))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var a=T(n,e.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,O;var u=a.arg;if(!u)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O;if(u.done)t[e.resultName]=u.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=C);else return u;return t.delegate=null,O}K(E),j(E,F,"Generator"),j(E,U,function(){return this}),j(E,"toString",function(){return"[object Generator]"});function o(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function r(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function i(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(o,this),this.reset(!0)}v.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function a(){for(;t.length;){var u=t.pop();if(u in e)return a.value=u,a.done=!1,a}return a.done=!0,a}};function d(e){if(e){var t=e[U];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,a=function u(){for(;++n<e.length;)if(S.call(e,n))return u.value=e[n],u.done=!1,u;return u.value=C,u.done=!0,u};return a.next=a}}return{next:f}}v.values=d;function f(){return{value:C,done:!0}}return i.prototype={constructor:i,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(r),!e)for(var t in this)t.charAt(0)==="t"&&S.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=C)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(b,g){return p.type="throw",p.arg=e,t.next=b,g&&(t.method="next",t.arg=C),!!g}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],p=u.completion;if(u.tryLoc==="root")return n("end");if(u.tryLoc<=this.prev){var _=S.call(u,"catchLoc"),y=S.call(u,"finallyLoc");if(_&&y){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(_){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else if(y){if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&S.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var u=a;break}}u&&(e==="break"||e==="continue")&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var p=u?u.completion:{};return p.type=e,p.arg=t,u?(this.method="next",this.next=u.finallyLoc,O):this.complete(p)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),r(n),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if(a.type==="throw"){var u=a.arg;r(n)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=C),O}},v}(m.exports);try{regeneratorRuntime=w}catch(v){typeof globalThis=="object"?globalThis.regeneratorRuntime=w:Function("r","regeneratorRuntime = r")(w)}}},ne={};function W(m){var w=ne[m];if(w!==void 0)return w.exports;var v=ne[m]={exports:{}};return ae[m](v,v.exports,W),v.exports}(function(){W.n=function(m){var w=m&&m.__esModule?function(){return m.default}:function(){return m};return W.d(w,{a:w}),w}})(),function(){W.d=function(m,w){for(var v in w)W.o(w,v)&&!W.o(m,v)&&Object.defineProperty(m,v,{enumerable:!0,get:w[v]})}}(),function(){W.o=function(m,w){return Object.prototype.hasOwnProperty.call(m,w)}}();var I={};(function(){W.d(I,{dp:function(){return F},bw:function(){return j},F7:function(){return J},hC:function(){return E},WU:function(){return K}});function m(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}function w(c,s,l){return s in c?Object.defineProperty(c,s,{value:l,enumerable:!0,configurable:!0,writable:!0}):c[s]=l,c}function v(c){for(var s=1;s<arguments.length;s++){var l=arguments[s]!=null?arguments[s]:{},o=Object.keys(l);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(l).filter(function(r){return Object.getOwnPropertyDescriptor(l,r).enumerable}))),o.forEach(function(r){w(c,r,l[r])})}return c}var $=function(){try{var c=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&c.getContext("webgl2"))}catch(s){return!1}},S=0,C=1,X=null,U=$()!==!1,B={},F=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.bloomController?!0:(console.warn("err:pencil.options.bloom"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.bloomController;e.enable(),r.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||(n.layers.enable(C),B[n.uuid]=!0)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.bloomController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||(n.layers.disable(C),delete B[n.uuid])}),Object.keys(B).length===0&&(e.disable(),r.event.emit("passcheck","bloom"))}},c}(),j=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.outlineController?!0:(console.warn("err:pencil.options.outline"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.outlineController;e.enable(),r.event.emit("passcheck","outline"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||n.material&&e.selectedObjects.push(n)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.outlineController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||!n.material||e.selectedObjects.splice(e.selectedObjects.indexOf(n),1)}),e.selectedObjects.length===0&&(e.disable(),r.event.emit("passcheck","outline"))}},c}(),J=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.ssrController?!0:(console.warn("err:pencil.options.ssr"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.ssrController;e.enable(),r.event.emit("passcheck","ssr"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||n.material&&e.selectedObjects.push(n)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.ssrController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||!n.material||e.selectedObjects.splice(e.selectedObjects.indexOf(n),1)}),e.selectedObjects.length===0&&(e.disable(),r.event.emit("passcheck","ssr"))}},c}();function T(c,s,l,o,r,i,d){try{var f=c[i](d),e=f.value}catch(t){l(t);return}f.done?s(e):Promise.resolve(e).then(o,r)}function H(c){return function(){var s=this,l=arguments;return new Promise(function(o,r){var i=c.apply(s,l);function d(e){T(i,o,r,d,f,"next",e)}function f(e){T(i,o,r,d,f,"throw",e)}d(void 0)})}}var Z=W(666),z=W.n(Z),A=c=>{var s={};return W.d(s,c),s},O=c=>()=>c,x=A({Color:()=>Q.Color,Vector2:()=>Q.Vector2,Vector3:()=>Q.Vector3,Vector4:()=>Q.Vector4}),G=c=>{var s={};return W.d(s,c),s},k=c=>()=>c,V=G({animate:()=>ie.animate});function q(c){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return c.then(function(l){return v({err:null,res:l},s)}).catch(function(l){return v({err:l,res:void 0},s)})}function L(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l={};return l.promise=new Promise(function(o,r){l.resolve=o,l.reject=r}),c&&(l.promise=q(l.promise,s)),l}var E=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new x.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},o)}var s=c.prototype;return s.initMaterial=function(){var o=this,r=this.options,i=r.color,d=r.lineNum,f=r.lineWidth,e=r.lineHieght,t=r.fade,n=r.fadeType,a=r.radius,u=r.range,p=r.vertical,_=r.step,y=r.opacity,b=r.exclude,g={field:{value:new x.Vector4(0,0,0,0)},color:{value:new x.Color(i)},opacity:{value:y},lineNum:{value:d},lineWidth:{value:f},lineHieght:{value:e},sizeNum:{value:new x.Vector3(a,a,a)},objPos:{value:new x.Vector3(0,0,0)},fade:{value:t},fadeType:{value:n},range:{value:u},angle:{value:0},stepNum:{value:_}};if(!a){var P=this.object.getSize().size;g.sizeNum.value.copy(P)}this.uniforms=g,this.object.object3d.traverse(function(N){var h=N;!h.material||b&&b.includes(h)||(h.userData.materialO?h.material=h.userData.materialO.clone():h.userData.materialO=Array.isArray(h.material)?h.material.map(function(D){return D.clone()}):h.material.clone(),Array.isArray(h.material)?h.material.forEach(function(D){p?o.setVerticalMaterial(D):o.setMaterial(D)}):p?o.setVerticalMaterial(h.material):o.setMaterial(h.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineNum=r.lineNum,i.uniforms.lineWidth=r.lineWidth,i.uniforms.sizeNum=r.sizeNum,i.uniforms.fade=r.fade,i.uniforms.fadeType=r.fadeType,i.uniforms.range=r.range,i.uniforms.stepNum=r.stepNum,i.vertexShader=`
1
+ import*as q from"three";import*as K from"popmotion";var Q={666:function(b){var _=function(g){"use strict";var U=Object.prototype,P=U.hasOwnProperty,S,E=typeof Symbol=="function"?Symbol:{},G=E.iterator||"@@iterator",X=E.asyncIterator||"@@asyncIterator",M=E.toStringTag||"@@toStringTag";function O(r,e,n){return Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{O({},"")}catch(r){O=function(e,n,o){return e[n]=o}}function Y(r,e,n,o){var a=e&&e.prototype instanceof l?e:l,v=Object.create(a.prototype),h=new L(o||[]);return v._invoke=z(r,n,h),v}g.wrap=Y;function V(r,e,n){try{return{type:"normal",arg:r.call(e,n)}}catch(o){return{type:"throw",arg:o}}}var H="suspendedStart",F="suspendedYield",B="executing",I="completed",u={};function l(){}function s(){}function f(){}var t={};O(t,G,function(){return this});var i=Object.getPrototypeOf,m=i&&i(i(D([])));m&&m!==U&&P.call(m,G)&&(t=m);var c=f.prototype=l.prototype=Object.create(t);s.prototype=f,O(c,"constructor",f),O(f,"constructor",s),s.displayName=O(f,M,"GeneratorFunction");function p(r){["next","throw","return"].forEach(function(e){O(r,e,function(n){return this._invoke(e,n)})})}g.isGeneratorFunction=function(r){var e=typeof r=="function"&&r.constructor;return e?e===s||(e.displayName||e.name)==="GeneratorFunction":!1},g.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,O(r,M,"GeneratorFunction")),r.prototype=Object.create(c),r},g.awrap=function(r){return{__await:r}};function d(r,e){function n(v,h,x,W){var N=V(r[v],r,h);if(N.type==="throw")W(N.arg);else{var R=N.arg,T=R.value;return T&&typeof T=="object"&&P.call(T,"__await")?e.resolve(T.__await).then(function(A){n("next",A,x,W)},function(A){n("throw",A,x,W)}):e.resolve(T).then(function(A){R.value=A,x(R)},function(A){return n("throw",A,x,W)})}}var o;function a(v,h){function x(){return new e(function(W,N){n(v,h,W,N)})}return o=o?o.then(x,x):x()}this._invoke=a}p(d.prototype),O(d.prototype,X,function(){return this}),g.AsyncIterator=d,g.async=function(r,e,n,o,a){a===void 0&&(a=Promise);var v=new d(Y(r,e,n,o),a);return g.isGeneratorFunction(e)?v:v.next().then(function(h){return h.done?h.value:v.next()})};function z(r,e,n){var o=H;return function(v,h){if(o===B)throw new Error("Generator is already running");if(o===I){if(v==="throw")throw h;return k()}for(n.method=v,n.arg=h;;){var x=n.delegate;if(x){var W=w(x,n);if(W){if(W===u)continue;return W}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(o===H)throw o=I,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);o=B;var N=V(r,e,n);if(N.type==="normal"){if(o=n.done?I:F,N.arg===u)continue;return{value:N.arg,done:n.done}}else N.type==="throw"&&(o=I,n.method="throw",n.arg=N.arg)}}}function w(r,e){var n=r.iterator[e.method];if(n===S){if(e.delegate=null,e.method==="throw"){if(r.iterator.return&&(e.method="return",e.arg=S,w(r,e),e.method==="throw"))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var o=V(n,r.iterator,e.arg);if(o.type==="throw")return e.method="throw",e.arg=o.arg,e.delegate=null,u;var a=o.arg;if(!a)return e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u;if(a.done)e[r.resultName]=a.value,e.next=r.nextLoc,e.method!=="return"&&(e.method="next",e.arg=S);else return a;return e.delegate=null,u}p(c),O(c,M,"Generator"),O(c,G,function(){return this}),O(c,"toString",function(){return"[object Generator]"});function C(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function y(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function L(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(C,this),this.reset(!0)}g.keys=function(r){var e=[];for(var n in r)e.push(n);return e.reverse(),function o(){for(;e.length;){var a=e.pop();if(a in r)return o.value=a,o.done=!1,o}return o.done=!0,o}};function D(r){if(r){var e=r[G];if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var n=-1,o=function a(){for(;++n<r.length;)if(P.call(r,n))return a.value=r[n],a.done=!1,a;return a.value=S,a.done=!0,a};return o.next=o}}return{next:k}}g.values=D;function k(){return{value:S,done:!0}}return L.prototype={constructor:L,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=S,this.done=!1,this.delegate=null,this.method="next",this.arg=S,this.tryEntries.forEach(y),!r)for(var e in this)e.charAt(0)==="t"&&P.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=S)},stop:function(){this.done=!0;var r=this.tryEntries[0],e=r.completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(W,N){return v.type="throw",v.arg=r,e.next=W,N&&(e.method="next",e.arg=S),!!N}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],v=a.completion;if(a.tryLoc==="root")return n("end");if(a.tryLoc<=this.prev){var h=P.call(a,"catchLoc"),x=P.call(a,"finallyLoc");if(h&&x){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(h){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else if(x){if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&P.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&(r==="break"||r==="continue")&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var v=a?a.completion:{};return v.type=r,v.arg=e,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(v)},complete:function(r,e){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&e&&(this.next=e),u},finish:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),y(n),u}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===r){var o=n.completion;if(o.type==="throw"){var a=o.arg;y(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:D(r),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=S),u}},g}(b.exports);try{regeneratorRuntime=_}catch(g){typeof globalThis=="object"?globalThis.regeneratorRuntime=_:Function("r","regeneratorRuntime = r")(_)}}},J={};function j(b){var _=J[b];if(_!==void 0)return _.exports;var g=J[b]={exports:{}};return Q[b](g,g.exports,j),g.exports}(function(){j.n=function(b){var _=b&&b.__esModule?function(){return b.default}:function(){return b};return j.d(_,{a:_}),_}})(),function(){j.d=function(b,_){for(var g in _)j.o(_,g)&&!j.o(b,g)&&Object.defineProperty(b,g,{enumerable:!0,get:_[g]})}}(),function(){j.o=function(b,_){return Object.prototype.hasOwnProperty.call(b,_)}}();var $={};(function(){j.d($,{h:function(){return B},W:function(){return I}});function b(u,l,s,f,t,i,m){try{var c=u[i](m),p=c.value}catch(d){s(d);return}c.done?l(p):Promise.resolve(p).then(f,t)}function _(u){return function(){var l=this,s=arguments;return new Promise(function(f,t){var i=u.apply(l,s);function m(p){b(i,f,t,m,c,"next",p)}function c(p){b(i,f,t,m,c,"throw",p)}m(void 0)})}}function g(u,l){if(!(u instanceof l))throw new TypeError("Cannot call a class as a function")}function U(u,l,s){return l in u?Object.defineProperty(u,l,{value:s,enumerable:!0,configurable:!0,writable:!0}):u[l]=s,u}function P(u){for(var l=1;l<arguments.length;l++){var s=arguments[l]!=null?arguments[l]:{},f=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(s).filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable}))),f.forEach(function(t){U(u,t,s[t])})}return u}var S=j(666),E=j.n(S),G=u=>{var l={};return j.d(l,u),l},X=u=>()=>u,M=G({Color:()=>q.Color,Vector2:()=>q.Vector2,Vector3:()=>q.Vector3,Vector4:()=>q.Vector4}),O=u=>{var l={};return j.d(l,u),l},Y=u=>()=>u,V=O({animate:()=>K.animate});function H(u){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return u.then(function(s){return P({err:null,res:s},l)}).catch(function(s){return P({err:s,res:void 0},l)})}function F(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s={};return s.promise=new Promise(function(f,t){s.resolve=f,s.reject=t}),u&&(s.promise=H(s.promise,l)),s}var B=function(){"use strict";function u(s){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};g(this,u),this.object=s,this.options=P({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new M.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},f)}var l=u.prototype;return l.initMaterial=function(){var f=this,t=this.options,i=t.color,m=t.lineNum,c=t.lineWidth,p=t.lineHieght,d=t.fade,z=t.fadeType,w=t.radius,C=t.range,y=t.vertical,L=t.step,D=t.opacity,k=t.exclude,r={field:{value:new M.Vector4(0,0,0,0)},color:{value:new M.Color(i)},opacity:{value:D},lineNum:{value:m},lineWidth:{value:c},lineHieght:{value:p},sizeNum:{value:new M.Vector3(w,w,w)},objPos:{value:new M.Vector3(0,0,0)},fade:{value:d},fadeType:{value:z},range:{value:C},angle:{value:0},stepNum:{value:L}};if(!w){var e=this.object.getSize().size;r.sizeNum.value.copy(e)}this.uniforms=r,this.object.object3d.traverse(function(n){var o=n;!o.material||k&&k.includes(o)||(o.userData.materialO?o.material=o.userData.materialO.clone():o.userData.materialO=Array.isArray(o.material)?o.material.map(function(a){return a.clone()}):o.material.clone(),Array.isArray(o.material)?o.material.forEach(function(a){y?f.setVerticalMaterial(a):f.setMaterial(a)}):y?f.setVerticalMaterial(o.material):f.setMaterial(o.material))})},l.setMaterial=function(f){var t=this.uniforms;f.onBeforeCompile=function(i){i.uniforms.field=t.field,i.uniforms.fieldColor=t.color,i.uniforms.fieldOpacity=t.opacity,i.uniforms.lineNum=t.lineNum,i.uniforms.lineWidth=t.lineWidth,i.uniforms.sizeNum=t.sizeNum,i.uniforms.fade=t.fade,i.uniforms.fadeType=t.fadeType,i.uniforms.range=t.range,i.uniforms.stepNum=t.stepNum,i.vertexShader=`
2
2
  varying vec4 vWorldPos;
3
3
  `.concat(i.vertexShader,`
4
4
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
@@ -54,7 +54,7 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
54
54
  }
55
55
  }
56
56
  }
57
- `)},o.needsUpdate=!0},s.setVerticalMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineNum=r.lineNum,i.uniforms.lineWidth=r.lineWidth,i.uniforms.lineHieght=r.lineHieght,i.uniforms.sizeNum=r.sizeNum,i.uniforms.fade=r.fade,i.uniforms.range=r.range,i.uniforms.angle=r.angle,i.uniforms.objPos=r.objPos,i.vertexShader=`
57
+ `)},f.needsUpdate=!0},l.setVerticalMaterial=function(f){var t=this.uniforms;f.onBeforeCompile=function(i){i.uniforms.field=t.field,i.uniforms.fieldColor=t.color,i.uniforms.fieldOpacity=t.opacity,i.uniforms.lineNum=t.lineNum,i.uniforms.lineWidth=t.lineWidth,i.uniforms.lineHieght=t.lineHieght,i.uniforms.sizeNum=t.sizeNum,i.uniforms.fade=t.fade,i.uniforms.range=t.range,i.uniforms.angle=t.angle,i.uniforms.objPos=t.objPos,i.vertexShader=`
58
58
  varying vec4 vWorldPos;
59
59
  `.concat(i.vertexShader,`
60
60
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
@@ -125,7 +125,7 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
125
125
  }
126
126
  }
127
127
 
128
- `)},o.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(o){var r=o;r.material&&r.userData.materialO&&(r.material=r.userData.materialO.clone(),r.userData.materialO=void 0)})},s.play=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;this.stop();var i=L(!0),d=this,f=d.object,e=d.uniforms,t=v({},this.options,o),n=t.lineNum,a=t.step,u=t.lineWidth,p=t.pos,_=t.duration,y=f.getSize(),b=y.min,g=y.max,P=y.size,N=n,h=u;a>0&&(N=1,h=P.y/a);var D=e.sizeNum.value.y*(N>1?2:1);return this.tween=(0,V.animate)({from:0,to:1,duration:_,onPlay:function(){var R,M=new x.Vector3;p==="bottom"?M.set(b.x-.001,b.y-.001,b.z-.001):p==="top"&&M.set(g.x+.001,g.y+.001,g.z+.001);var ee=((R=f.pencil.control)===null||R===void 0?void 0:R.getAzimuthalAngle())||0,Y=r.object.object3d.position.clone();if(ee){var te=Math.sqrt(Math.pow(P.x,2)+Math.pow(P.z,2))/2;M.x=Y.x+te,M.z=Y.z+te;var re=new x.Vector3().subVectors(M,Y),oe=new x.Vector3(0,1,0);re.applyAxisAngle(oe,ee),M.addVectors(Y,re)}e.objPos.value.copy(Y),e.field.value.set(M.x,M.y,M.z,0),e.angle.value=ee,e.lineNum.value=N,e.lineWidth.value=h},onUpdate:function(R){a>0?e.field.value.w=Math.floor(R*a)/a*D:e.field.value.w=R*D},onStop:function(){e.field.value.w=0,i.reject("stop")},onComplete:function(){i.resolve()}}),i.promise},s.checkRepeat=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;return H(z().mark(function i(){var d,f,e,t,n,a;return z().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return d=v({},r.options,o),f=d.yoyo,e=d.repeat,t=d.pos,e===r.options.repeat&&r.initMaterial(),p.next=4,r.play(o);case 4:if(n=p.sent.err,!n){p.next=8;break}return r.resetMaterial(),p.abrupt("return");case 8:if(!e){p.next=15;break}return a=t,f&&(a=a==="bottom"?"top":"bottom"),p.next=13,r.checkRepeat({pos:a,repeat:e===1/0?-1:e-1});case 13:p.next=16;break;case 15:r.resetMaterial();case 16:case"end":return p.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},c}(),K=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new x.Vector3(0,0,0),duration:5e3,repeat:0},o)}var s=c.prototype;return s.initMaterial=function(){var o=this,r=this.options.exclude,i={field:{value:new x.Vector4(0,0,0,1e-4)},color:{value:new x.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=i,this.object.object3d.traverse(function(d){var f=d;!f.material||r&&r.includes(f)||(f.userData.materialO?f.material=f.userData.materialO:f.userData.materialO=Array.isArray(f.material)?f.material.map(function(e){return e.clone()}):f.material.clone(),Array.isArray(f.material)?f.material.forEach(function(e){o.setMaterial(e)}):o.setMaterial(f.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineWidth=r.lineWidth,i.vertexShader=`
128
+ `)},f.needsUpdate=!0},l.resetMaterial=function(){this.object.object3d.traverse(function(f){var t=f;t.material&&t.userData.materialO&&(t.material=t.userData.materialO.clone(),t.userData.materialO=void 0)})},l.play=function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;this.stop();var i=F(!0),m=this,c=m.object,p=m.uniforms,d=P({},this.options,f),z=d.lineNum,w=d.step,C=d.lineWidth,y=d.pos,L=d.duration,D=c.getSize(),k=D.min,r=D.max,e=D.size,n=z,o=C;w>0&&(n=1,o=e.y/w);var a=p.sizeNum.value.y*(n>1?2:1);return this.tween=(0,V.animate)({from:0,to:1,duration:L,onPlay:function(){var v,h=new M.Vector3;y==="bottom"?h.set(k.x-.001,k.y-.001,k.z-.001):y==="top"&&h.set(r.x+.001,r.y+.001,r.z+.001);var x=((v=c.pencil.control)===null||v===void 0?void 0:v.getAzimuthalAngle())||0,W=t.object.object3d.position.clone();if(x){var N=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.z,2))/2;h.x=W.x+N,h.z=W.z+N;var R=new M.Vector3().subVectors(h,W),T=new M.Vector3(0,1,0);R.applyAxisAngle(T,x),h.addVectors(W,R)}p.objPos.value.copy(W),p.field.value.set(h.x,h.y,h.z,0),p.angle.value=x,p.lineNum.value=n,p.lineWidth.value=o},onUpdate:function(v){w>0?p.field.value.w=Math.floor(v*w)/w*a:p.field.value.w=v*a},onStop:function(){p.field.value.w=0,i.reject("stop")},onComplete:function(){i.resolve()}}),i.promise},l.checkRepeat=function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;return _(E().mark(function i(){var m,c,p,d,z,w;return E().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return m=P({},t.options,f),c=m.yoyo,p=m.repeat,d=m.pos,p===t.options.repeat&&t.initMaterial(),y.next=4,t.play(f);case 4:if(z=y.sent.err,!z){y.next=8;break}return t.resetMaterial(),y.abrupt("return");case 8:if(!p){y.next=15;break}return w=d,c&&(w=w==="bottom"?"top":"bottom"),y.next=13,t.checkRepeat({pos:w,repeat:p===1/0?-1:p-1});case 13:y.next=16;break;case 15:t.resetMaterial();case 16:case"end":return y.stop()}},i)}))()},l.start=function(){return this.checkRepeat()},l.stop=function(){this.tween&&this.tween.stop()},u}(),I=function(){"use strict";function u(s){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};g(this,u),this.object=s,this.options=P({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new M.Vector3(0,0,0),duration:5e3,repeat:0},f)}var l=u.prototype;return l.initMaterial=function(){var f=this,t=this.options.exclude,i={field:{value:new M.Vector4(0,0,0,1e-4)},color:{value:new M.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=i,this.object.object3d.traverse(function(m){var c=m;!c.material||t&&t.includes(c)||(c.userData.materialO?c.material=c.userData.materialO:c.userData.materialO=Array.isArray(c.material)?c.material.map(function(p){return p.clone()}):c.material.clone(),Array.isArray(c.material)?c.material.forEach(function(p){f.setMaterial(p)}):f.setMaterial(c.material))})},l.setMaterial=function(f){var t=this.uniforms;f.onBeforeCompile=function(i){i.uniforms.field=t.field,i.uniforms.fieldColor=t.color,i.uniforms.fieldOpacity=t.opacity,i.uniforms.lineWidth=t.lineWidth,i.vertexShader=`
129
129
  varying vec4 vWorldPos;
130
130
  `.concat(i.vertexShader,`
131
131
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
@@ -157,4 +157,4 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
157
157
  }
158
158
  gl_FragColor.rgb = mix(gl_FragColor.rgb, fieldColor, fadeout);
159
159
 
160
- `)},o.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(o){var r=o;r.material&&r.userData.materialO&&(r.material=r.userData.materialO.clone(),r.userData.materialO=void 0)})},s.play=function(){var o=this;this.stop();var r=L(!0),i=this,d=i.object,f=i.uniforms,e=this.options,t=e.position,n=e.duration,a=this.options.radius;if(!a){var u=d.getSize().size;a=Math.max(u.x,u.y,u.z)}return this.tween=(0,V.animate)({from:1e-4,to:1,duration:n,onPlay:function(){f.field.value.set(t.x,t.y,t.z,1e-4),o.options.fade&&(f.opacity.value=o.options.opacity)},onUpdate:function(p){f.field.value.w=p*a,o.options.fade&&(f.opacity.value=(1-p)*o.options.opacity)},onStop:function(){f.field.value.w=0,r.reject("stop")},onComplete:function(){r.resolve()}}),r.promise},s.checkRepeat=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;return H(z().mark(function i(){var d,f;return z().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return d=v({},r.options,o).repeat,d===r.options.repeat&&r.initMaterial(),t.next=4,r.play();case 4:if(f=t.sent.err,!f){t.next=8;break}return r.resetMaterial(),t.abrupt("return");case 8:if(!d){t.next=13;break}return t.next=11,r.checkRepeat({repeat:d===1/0?-1:d-1});case 11:t.next=14;break;case 13:r.resetMaterial();case 14:case"end":return t.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},c}()})();var le=I.dp,se=I.bw,ue=I.F7,fe=I.hC,ce=I.WU;export{le as Bloom,se as Outline,ue as SSR,fe as Scan,ce as Scan2};
160
+ `)},f.needsUpdate=!0},l.resetMaterial=function(){this.object.object3d.traverse(function(f){var t=f;t.material&&t.userData.materialO&&(t.material=t.userData.materialO.clone(),t.userData.materialO=void 0)})},l.play=function(){var f=this;this.stop();var t=F(!0),i=this,m=i.object,c=i.uniforms,p=this.options,d=p.position,z=p.duration,w=this.options.radius;if(!w){var C=m.getSize().size;w=Math.max(C.x,C.y,C.z)}return this.tween=(0,V.animate)({from:1e-4,to:1,duration:z,onPlay:function(){c.field.value.set(d.x,d.y,d.z,1e-4),f.options.fade&&(c.opacity.value=f.options.opacity)},onUpdate:function(y){c.field.value.w=y*w,f.options.fade&&(c.opacity.value=(1-y)*f.options.opacity)},onStop:function(){c.field.value.w=0,t.reject("stop")},onComplete:function(){t.resolve()}}),t.promise},l.checkRepeat=function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;return _(E().mark(function i(){var m,c;return E().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return m=P({},t.options,f).repeat,m===t.options.repeat&&t.initMaterial(),d.next=4,t.play();case 4:if(c=d.sent.err,!c){d.next=8;break}return t.resetMaterial(),d.abrupt("return");case 8:if(!m){d.next=13;break}return d.next=11,t.checkRepeat({repeat:m===1/0?-1:m-1});case 11:d.next=14;break;case 13:t.resetMaterial();case 14:case"end":return d.stop()}},i)}))()},l.start=function(){return this.checkRepeat()},l.stop=function(){this.tween&&this.tween.stop()},u}()})();var Z=$.h,ee=$.W;export{Z as Scan,ee as Scan2};