gl-draw 0.0.3 → 0.0.6

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.
@@ -4,11 +4,17 @@ interface Options {
4
4
  position: THREE.Vector3;
5
5
  key?: string;
6
6
  children?: HTMLElement;
7
- onClick?: (key?: string) => {};
8
7
  }
9
8
  export declare class Css2dBind extends BaseObject {
10
9
  options: Options;
10
+ pickObject?: THREE.Sprite;
11
11
  constructor(options: Partial<Options>);
12
+ create(): void;
13
+ createPickObject({ show, scale, position, }: {
14
+ show?: boolean | undefined;
15
+ scale?: THREE.Vector3 | undefined;
16
+ position?: THREE.Vector3 | undefined;
17
+ }): void;
12
18
  }
13
19
  declare const _default: {
14
20
  Css2dBind: typeof Css2dBind;
@@ -1,12 +1,13 @@
1
1
  import * as THREE from 'three';
2
2
  import BaseObject from '../../core/BaseObject';
3
+ import Cache from '../../plugins/Cache';
3
4
  interface Options {
4
5
  src: string;
5
6
  scale?: number;
6
7
  position?: THREE.Vector3;
7
8
  transparent?: boolean;
8
9
  blending?: THREE.Blending;
9
- cache?: boolean;
10
+ cache?: Cache;
10
11
  depthWrite?: boolean;
11
12
  alphaTest?: number;
12
13
  }
@@ -3,5 +3,6 @@ export { default as Image } from './image';
3
3
  export { default as SpriteImage } from './spriteImage';
4
4
  export { default as Video } from './video';
5
5
  export { default as SpriteVideo } from './spriteVideo';
6
+ export { MeshLine, MeshLineMaterial, MeshLineRaycast } from './line/meshLine';
6
7
  export { default as Line } from './line';
7
8
  export { Css2dBind } from './css2dbind';
@@ -1,6 +1,6 @@
1
- (function(){var Et={666:function(M){var C=function(_){"use strict";var T=Object.prototype,A=T.hasOwnProperty,j,P=typeof Symbol=="function"?Symbol:{},E=P.iterator||"@@iterator",Z=P.asyncIterator||"@@asyncIterator",L=P.toStringTag||"@@toStringTag";function W(d,c,g){return Object.defineProperty(d,c,{value:g,enumerable:!0,configurable:!0,writable:!0}),d[c]}try{W({},"")}catch(d){W=function(c,g,x){return c[g]=x}}function K(d,c,g,x){var b=c&&c.prototype instanceof Y?c:Y,V=Object.create(b.prototype),H=new at(x||[]);return V._invoke=_t(d,g,H),V}_.wrap=K;function I(d,c,g){try{return{type:"normal",arg:d.call(c,g)}}catch(x){return{type:"throw",arg:x}}}var D="suspendedStart",f="suspendedYield",lt="executing",tt="completed",R={};function Y(){}function O(){}function B(){}var N={};W(N,E,function(){return this});var nt=Object.getPrototypeOf,rt=nt&&nt(nt(vt([])));rt&&rt!==T&&A.call(rt,E)&&(N=rt);var et=B.prototype=Y.prototype=Object.create(N);O.prototype=B,W(et,"constructor",B),W(B,"constructor",O),O.displayName=W(B,L,"GeneratorFunction");function it(d){["next","throw","return"].forEach(function(c){W(d,c,function(g){return this._invoke(c,g)})})}_.isGeneratorFunction=function(d){var c=typeof d=="function"&&d.constructor;return c?c===O||(c.displayName||c.name)==="GeneratorFunction":!1},_.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,B):(d.__proto__=B,W(d,L,"GeneratorFunction")),d.prototype=Object.create(et),d},_.awrap=function(d){return{__await:d}};function st(d,c){function g(V,H,X,G){var q=I(d[V],d,H);if(q.type==="throw")G(q.arg);else{var wt=q.arg,ht=wt.value;return ht&&typeof ht=="object"&&A.call(ht,"__await")?c.resolve(ht.__await).then(function(Q){g("next",Q,X,G)},function(Q){g("throw",Q,X,G)}):c.resolve(ht).then(function(Q){wt.value=Q,X(wt)},function(Q){return g("throw",Q,X,G)})}}var x;function b(V,H){function X(){return new c(function(G,q){g(V,H,G,q)})}return x=x?x.then(X,X):X()}this._invoke=b}it(st.prototype),W(st.prototype,Z,function(){return this}),_.AsyncIterator=st,_.async=function(d,c,g,x,b){b===void 0&&(b=Promise);var V=new st(K(d,c,g,x),b);return _.isGeneratorFunction(c)?V:V.next().then(function(H){return H.done?H.value:V.next()})};function _t(d,c,g){var x=D;return function(V,H){if(x===lt)throw new Error("Generator is already running");if(x===tt){if(V==="throw")throw H;return gt()}for(g.method=V,g.arg=H;;){var X=g.delegate;if(X){var G=$(X,g);if(G){if(G===R)continue;return G}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(x===D)throw x=tt,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);x=lt;var q=I(d,c,g);if(q.type==="normal"){if(x=g.done?tt:f,q.arg===R)continue;return{value:q.arg,done:g.done}}else q.type==="throw"&&(x=tt,g.method="throw",g.arg=q.arg)}}}function $(d,c){var g=d.iterator[c.method];if(g===j){if(c.delegate=null,c.method==="throw"){if(d.iterator.return&&(c.method="return",c.arg=j,$(d,c),c.method==="throw"))return R;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return R}var x=I(g,d.iterator,c.arg);if(x.type==="throw")return c.method="throw",c.arg=x.arg,c.delegate=null,R;var b=x.arg;if(!b)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,R;if(b.done)c[d.resultName]=b.value,c.next=d.nextLoc,c.method!=="return"&&(c.method="next",c.arg=j);else return b;return c.delegate=null,R}it(et),W(et,L,"Generator"),W(et,E,function(){return this}),W(et,"toString",function(){return"[object Generator]"});function dt(d){var c={tryLoc:d[0]};1 in d&&(c.catchLoc=d[1]),2 in d&&(c.finallyLoc=d[2],c.afterLoc=d[3]),this.tryEntries.push(c)}function pt(d){var c=d.completion||{};c.type="normal",delete c.arg,d.completion=c}function at(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(dt,this),this.reset(!0)}_.keys=function(d){var c=[];for(var g in d)c.push(g);return c.reverse(),function x(){for(;c.length;){var b=c.pop();if(b in d)return x.value=b,x.done=!1,x}return x.done=!0,x}};function vt(d){if(d){var c=d[E];if(c)return c.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var g=-1,x=function b(){for(;++g<d.length;)if(A.call(d,g))return b.value=d[g],b.done=!1,b;return b.value=j,b.done=!0,b};return x.next=x}}return{next:gt}}_.values=vt;function gt(){return{value:j,done:!0}}return at.prototype={constructor:at,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=j,this.done=!1,this.delegate=null,this.method="next",this.arg=j,this.tryEntries.forEach(pt),!d)for(var c in this)c.charAt(0)==="t"&&A.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=j)},stop:function(){this.done=!0;var d=this.tryEntries[0],c=d.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var c=this;function g(G,q){return V.type="throw",V.arg=d,c.next=G,q&&(c.method="next",c.arg=j),!!q}for(var x=this.tryEntries.length-1;x>=0;--x){var b=this.tryEntries[x],V=b.completion;if(b.tryLoc==="root")return g("end");if(b.tryLoc<=this.prev){var H=A.call(b,"catchLoc"),X=A.call(b,"finallyLoc");if(H&&X){if(this.prev<b.catchLoc)return g(b.catchLoc,!0);if(this.prev<b.finallyLoc)return g(b.finallyLoc)}else if(H){if(this.prev<b.catchLoc)return g(b.catchLoc,!0)}else if(X){if(this.prev<b.finallyLoc)return g(b.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(d,c){for(var g=this.tryEntries.length-1;g>=0;--g){var x=this.tryEntries[g];if(x.tryLoc<=this.prev&&A.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var b=x;break}}b&&(d==="break"||d==="continue")&&b.tryLoc<=c&&c<=b.finallyLoc&&(b=null);var V=b?b.completion:{};return V.type=d,V.arg=c,b?(this.method="next",this.next=b.finallyLoc,R):this.complete(V)},complete:function(d,c){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&c&&(this.next=c),R},finish:function(d){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.finallyLoc===d)return this.complete(g.completion,g.afterLoc),pt(g),R}},catch:function(d){for(var c=this.tryEntries.length-1;c>=0;--c){var g=this.tryEntries[c];if(g.tryLoc===d){var x=g.completion;if(x.type==="throw"){var b=x.arg;pt(g)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(d,c,g){return this.delegate={iterator:vt(d),resultName:c,nextLoc:g},this.method==="next"&&(this.arg=j),R}},_}(M.exports);try{regeneratorRuntime=C}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(M,C,_){"use strict";_.d(C,{Z:function(){return T}});function T(A){if(A.geometry&&A.geometry.dispose(),A.material){var j=Array.isArray(A.material)?A.material:[A.material];j.forEach(function(P){var E,Z,L,W,K,I,D,f,lt,tt,R,Y,O;(E=P.map)===null||E===void 0||E.dispose(),(Z=P.lightMap)===null||Z===void 0||Z.dispose(),(L=P.bumpMap)===null||L===void 0||L.dispose(),(W=P.normalMap)===null||W===void 0||W.dispose(),(K=P.specularMap)===null||K===void 0||K.dispose(),(I=P.envMap)===null||I===void 0||I.dispose(),(D=P.alphaMap)===null||D===void 0||D.dispose(),(f=P.aoMap)===null||f===void 0||f.dispose(),(lt=P.displacementMap)===null||lt===void 0||lt.dispose(),(tt=P.emissiveMap)===null||tt===void 0||tt.dispose(),(R=P.gradientMap)===null||R===void 0||R.dispose(),(Y=P.metalnessMap)===null||Y===void 0||Y.dispose(),(O=P.roughnessMap)===null||O===void 0||O.dispose(),P.dispose()})}}},519:function(M,C,_){"use strict";_.d(C,{disposeMesh:function(){return E.Z},makePromiseCreator:function(){return T.Z}});var T=_(282),A=_(666),j=_.n(A),P=null,E=_(695),Z=_(644);function L(R){if(R.material){var Y=Array.isArray(R.material)?R.material:[R.material];Y.forEach(function(O){var B,N;(B=O.color)===null||B===void 0||B.convertSRGBToLinear(),(N=O.emissive)===null||N===void 0||N.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var W=_(568),K=_(924),I=require("idb-keyval"),D=_(484),f=null,lt=null,tt=function(){var R=(0,W.Z)(j().mark(function Y(O,B){var N,nt,rt,et,it,st;return j().wrap(function($){for(;;)switch($.prev=$.next){case 0:return N=B.version,$.next=4,(0,I.get)(O);case 4:if(rt=$.sent,!(rt&&rt[N])){$.next=9;break}nt=rt[N],$.next=15;break;case 9:return $.next=11,(0,D.Z)(fetch(O).then(function(dt){if(dt.ok)return dt.blob();throw new Error}));case 11:et=$.sent,it=et.res,st=et.err,st||(nt=it,(0,I.set)(O,(0,K.Z)({},N,it)));case 15:return $.abrupt("return",nt?{url:URL.createObjectURL(nt)}:{url:O});case 16:case"end":return $.stop()}},Y)}));return function(O,B){return R.apply(this,arguments)}}()},282:function(M,C,_){"use strict";_.d(C,{Z:function(){return A}});var T=_(484);function A(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={};return E.promise=new Promise(function(Z,L){E.resolve=Z,E.reject=L}),j&&(E.promise=(0,T.Z)(E.promise,P)),E}},484:function(M,C,_){"use strict";_.d(C,{Z:function(){return A}});var T=_(42);function A(j){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(E){return(0,T.Z)({err:null,res:E},P)}).catch(function(E){return(0,T.Z)({err:E,res:void 0},P)})}},644:function(M){"use strict";M.exports=require("three")},568:function(M,C,_){"use strict";_.d(C,{Z:function(){return A}});function T(j,P,E,Z,L,W,K){try{var I=j[W](K),D=I.value}catch(f){E(f);return}I.done?P(D):Promise.resolve(D).then(Z,L)}function A(j){return function(){var P=this,E=arguments;return new Promise(function(Z,L){var W=j.apply(P,E);function K(D){T(W,Z,L,K,I,"next",D)}function I(D){T(W,Z,L,K,I,"throw",D)}K(void 0)})}}},924:function(M,C,_){"use strict";_.d(C,{Z:function(){return T}});function T(A,j,P){return j in A?Object.defineProperty(A,j,{value:P,enumerable:!0,configurable:!0,writable:!0}):A[j]=P,A}},42:function(M,C,_){"use strict";_.d(C,{Z:function(){return A}});var T=_(924);function A(j){for(var P=1;P<arguments.length;P++){var E=arguments[P]!=null?arguments[P]:{},Z=Object.keys(E);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(E).filter(function(L){return Object.getOwnPropertyDescriptor(E,L).enumerable}))),Z.forEach(function(L){(0,T.Z)(j,L,E[L])})}return j}}},At={};function F(M){var C=At[M];if(C!==void 0)return C.exports;var _=At[M]={exports:{}};return Et[M](_,_.exports,F),_.exports}(function(){F.n=function(M){var C=M&&M.__esModule?function(){return M.default}:function(){return M};return F.d(C,{a:C}),C}})(),function(){F.d=function(M,C){for(var _ in C)F.o(C,_)&&!F.o(M,_)&&Object.defineProperty(M,_,{enumerable:!0,get:C[_]})}}(),function(){F.o=function(M,C){return Object.prototype.hasOwnProperty.call(M,C)}}(),function(){F.r=function(M){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(M,"__esModule",{value:!0})}}();var St={};(function(){"use strict";F.r(St),F.d(St,{Css2dBind:function(){return jt},Image:function(){return Lt},Line:function(){return Ht},SpriteImage:function(){return Dt},SpriteVideo:function(){return Bt},Text:function(){return Tt},Video:function(){return zt}});function M(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function C(e,a){return C=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},C(e,a)}function _(e,a){return C(e,a)}function T(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),a&&_(e,a)}var A=F(42);function j(e,a){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);a&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function P(e,a){return a=a!=null?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))}),e}function E(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Z(e)}function L(e){return Z(e)}function W(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return e&&e.constructor===Symbol?"symbol":typeof e}function I(e,a){return a&&(K(a)==="object"||typeof a=="function")?a:W(e)}function D(e){var a=E();return function(){var i=L(e),n;if(a){var t=L(this).constructor;n=Reflect.construct(i,arguments,t)}else n=i.apply(this,arguments);return I(this,n)}}var f=F(644);function lt(){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(e){return!1}}function tt(e,a,r){return lt()?tt=Reflect.construct:tt=function(n,t,o){var s=[null];s.push.apply(s,t);var v=Function.bind.apply(n,s),y=new v;return o&&_(y,o.prototype),y},tt.apply(null,arguments)}function R(e,a,r){return tt.apply(null,arguments)}function Y(e,a){for(var r=0;r<a.length;r++){var i=a[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function O(e,a,r){return a&&Y(e.prototype,a),r&&Y(e,r),e}function B(e,a){(a==null||a>e.length)&&(a=e.length);for(var r=0,i=new Array(a);r<a;r++)i[r]=e[r];return i}function N(e){if(Array.isArray(e))return B(e)}function nt(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rt(){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 et(e,a){if(!!e){if(typeof e=="string")return B(e,a);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(e,a)}}function it(e){return N(e)||nt(e)||et(e)||rt()}var st=F(282),_t=require("@tweenjs/tween.js"),$=F.n(_t),dt=function(){"use strict";function e(){M(this,e),this.guiParams={}}var a=e.prototype;return a.showGuiParams=function(i){var n=this;!i||Object.keys(this.guiParams).forEach(function(t){var o=i.addFolder(t),s=n.guiParams[t];Object.keys(s).forEach(function(v){var y=s[v],p=y.min,w=y.max,S=y.step,m=y.name,h=y.to,l=y.paramMap,u=y.items,k=y.value,z=y.target,J=v.toLowerCase().indexOf("color")>-1,U,ft=typeof k=="undefined"&&z,mt=ft?z():s[v],yt=ft?v:"value";u?U=o.add(mt,yt,u):J?U=o.addColor(mt,yt):U=o.add(mt,yt),U=U.name(m||v),typeof p!="undefined"&&(U=U.min(p)),typeof w!="undefined"&&(U=U.max(w)),typeof S!="undefined"&&(U=U.step(S)),U=U.onChange(function(){n.setGuiTargetValue(t,v,mt[yt],l)}),(h||ft)&&U.listen()})})},a.setGuiTargetValue=function(i,n,t,o){var s=this.guiParams[i][n],v=s.onChange,y=s.target,p=s.value,w=n.toLowerCase().indexOf("color")>-1,S=typeof p=="undefined"&&y;if(y&&!S){var m=y();Array.isArray(m)||(m=[m]),m.forEach(function(h){if(!!h)if(w)try{h[o||n].set(t)}catch(l){n!=="color"&&!o&&console.warn("".concat(n," is not a color,set paramMap"))}else h[o||n]=t})}v&&v(t)},a.setGuiTargetValueByParams=function(){var i=this;Object.keys(this.guiParams).forEach(function(n){Object.keys(i.guiParams[n]).forEach(function(t){var o=i.guiParams[n][t];typeof o.value!="undefined"&&i.setGuiTargetValue(n,t,o.value,o.paramMap)})})},a.guiParamTween=function(i,n,t){var o=t.duration,s=o===void 0?0:o,v=this,y=this.guiParams[i][n],p=y.to,w=y.paramMap,S=w===void 0?"":w;return new($()).Tween(this.guiParams[i][n]).to({value:p},s).onUpdate(function(m){v.setGuiTargetValue(i,n,m.value,S)})},e}();class pt extends f.Object3D{constructor(a=document.createElement("div")){super(),this.element=a,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(r){r.element instanceof Element&&r.element.parentNode!==null&&r.element.parentNode.removeChild(r.element)})})}copy(a,r){return super.copy(a,r),this.element=a.element.cloneNode(!0),this}}pt.prototype.isCSS2DObject=!0;const at=new f.Vector3,vt=new f.Matrix4,gt=new f.Matrix4,d=new f.Vector3,c=new f.Vector3;class g{constructor(a={}){const r=this;let i,n,t,o;const s={objects:new WeakMap},v=a.element!==void 0?a.element:document.createElement("div");v.style.overflow="hidden",this.domElement=v,this.getSize=function(){return{width:i,height:n}},this.render=function(m,h){m.autoUpdate===!0&&m.updateMatrixWorld(),h.parent===null&&h.updateMatrixWorld(),vt.copy(h.matrixWorldInverse),gt.multiplyMatrices(h.projectionMatrix,vt),y(m,m,h),S(m)},this.setSize=function(m,h){i=m,n=h,t=i/2,o=n/2,v.style.width=m+"px",v.style.height=h+"px"};function y(m,h,l){if(m.isCSS2DObject){m.onBeforeRender(r,h,l),at.setFromMatrixPosition(m.matrixWorld),at.applyMatrix4(gt);const u=m.element;/apple/i.test(navigator.vendor)?u.style.transform="translate(-50%,-50%) translate("+Math.round(at.x*t+t)+"px,"+Math.round(-at.y*o+o)+"px)":u.style.transform="translate(-50%,-50%) translate("+(at.x*t+t)+"px,"+(-at.y*o+o)+"px)",u.style.display=m.visible&&at.z>=-1&&at.z<=1?"":"none";const k={distanceToCameraSquared:p(l,m)};s.objects.set(m,k),u.parentNode!==v&&v.appendChild(u),m.onAfterRender(r,h,l)}for(let u=0,k=m.children.length;u<k;u++)y(m.children[u],h,l)}function p(m,h){return d.setFromMatrixPosition(m.matrixWorld),c.setFromMatrixPosition(h.matrixWorld),d.distanceToSquared(c)}function w(m){const h=[];return m.traverse(function(l){l.isCSS2DObject&&h.push(l)}),h}function S(m){const h=w(m).sort(function(u,k){const z=s.objects.get(u).distanceToCameraSquared,J=s.objects.get(k).distanceToCameraSquared;return z-J}),l=h.length;for(let u=0,k=h.length;u<k;u++)h[u].element.style.zIndex=l-u}}}const x=new f.Vector3,b=new f.Quaternion,V=new f.Vector3;class H extends f.Object3D{constructor(a=document.createElement("div")){super(),this.element=a,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(r){r.element instanceof Element&&r.element.parentNode!==null&&r.element.parentNode.removeChild(r.element)})})}copy(a,r){return super.copy(a,r),this.element=a.element.cloneNode(!0),this}}H.prototype.isCSS3DObject=!0;class X extends H{constructor(a){super(a),this.rotation2D=0}copy(a,r){return super.copy(a,r),this.rotation2D=a.rotation2D,this}}X.prototype.isCSS3DSprite=!0;const G=new f.Matrix4,q=new f.Matrix4;class wt{constructor(a={}){const r=this;let i,n,t,o;const s={camera:{fov:0,style:""},objects:new WeakMap},v=a.element!==void 0?a.element:document.createElement("div");v.style.overflow="hidden",this.domElement=v;const y=document.createElement("div");y.style.transformStyle="preserve-3d",y.style.pointerEvents="none",v.appendChild(y),this.getSize=function(){return{width:i,height:n}},this.render=function(h,l){const u=l.projectionMatrix.elements[5]*o;s.camera.fov!==u&&(v.style.perspective=l.isPerspectiveCamera?u+"px":"",s.camera.fov=u),h.autoUpdate===!0&&h.updateMatrixWorld(),l.parent===null&&l.updateMatrixWorld();let k,z;l.isOrthographicCamera&&(k=-(l.right+l.left)/2,z=(l.top+l.bottom)/2);const J=l.isOrthographicCamera?"scale("+u+")translate("+p(k)+"px,"+p(z)+"px)"+w(l.matrixWorldInverse):"translateZ("+u+"px)"+w(l.matrixWorldInverse),U=J+"translate("+t+"px,"+o+"px)";s.camera.style!==U&&(y.style.transform=U,s.camera.style=U),m(h,h,l,J)},this.setSize=function(h,l){i=h,n=l,t=i/2,o=n/2,v.style.width=h+"px",v.style.height=l+"px",y.style.width=h+"px",y.style.height=l+"px"};function p(h){return Math.abs(h)<1e-10?0:h}function w(h){const l=h.elements;return"matrix3d("+p(l[0])+","+p(-l[1])+","+p(l[2])+","+p(l[3])+","+p(l[4])+","+p(-l[5])+","+p(l[6])+","+p(l[7])+","+p(l[8])+","+p(-l[9])+","+p(l[10])+","+p(l[11])+","+p(l[12])+","+p(-l[13])+","+p(l[14])+","+p(l[15])+")"}function S(h){const l=h.elements,u="matrix3d("+p(l[0])+","+p(l[1])+","+p(l[2])+","+p(l[3])+","+p(-l[4])+","+p(-l[5])+","+p(-l[6])+","+p(-l[7])+","+p(l[8])+","+p(l[9])+","+p(l[10])+","+p(l[11])+","+p(l[12])+","+p(l[13])+","+p(l[14])+","+p(l[15])+")";return"translate(-50%,-50%)"+u}function m(h,l,u,k){if(h.isCSS3DObject){h.onBeforeRender(r,l,u);let z;h.isCSS3DSprite?(G.copy(u.matrixWorldInverse),G.transpose(),h.rotation2D!==0&&G.multiply(q.makeRotationZ(h.rotation2D)),h.matrixWorld.decompose(x,b,V),G.setPosition(x),G.scale(V),G.elements[3]=0,G.elements[7]=0,G.elements[11]=0,G.elements[15]=1,z=S(G)):z=S(h.matrixWorld);const J=h.element,U=s.objects.get(h);if(U===void 0||U.style!==z){J.style.transform=z;const ft={style:z};s.objects.set(h,ft)}J.style.display=h.visible?"":"none",J.parentNode!==y&&y.appendChild(J),h.onAfterRender(r,l,u)}for(let z=0,J=h.children.length;z<J;z++)m(h.children[z],l,u,k)}}}var ht=F(519),Q=function(e){"use strict";T(r,e);var a=D(r);function r(n){M(this,r);var t;return t=a.call(this),t.objecttype__="BaseObject",t.isAdd=!1,t.userData={},t.pm=(0,st.Z)(),t.visible=!1,t}var i=r.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(t,o){},i.resize=function(t,o){},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 t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];return this.object3d=R(f.Mesh,it(o)),this},i.createGroup=function(){return this.object3d=new f.Group,this},i.createPoints=function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];return this.object3d=R(f.Points,it(o)),this},i.createCSS2DObject=function(t){return this.object3d=new pt(t),this},i.createCSS3DObject=function(t){return this.object3d=new H(t),this},i.createCSS3DSprite=function(t){return this.object3d=new X(t),this},i.add=function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];var v;return(v=this.object3d).add.apply(v,it(o)),this},i.remove=function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];var v;return(v=this.object3d).remove.apply(v,it(o)),this},i.getSize=function(){var t=new f.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new f.Vector3)}},i.traverse=function(t){t(this),this.children.forEach(function(o){o.traverse(t)})},i.dispose=function(){var t;(t=this.object3d)===null||t===void 0||t.traverse(function(o){(0,ht.disposeMesh)(o)})},O(r,[{key:"parent",get:function(){var t=this.object3d.parent;return(t==null?void 0:t.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(t){return t.userData.BaseObject_}).filter(function(t){return!!t})}}]),r}(dt),Tt=function(e){"use strict";T(r,e);var a=D(r);function r(n){M(this,r);var t;return t=a.call(this),t.width=0,t.options=(0,A.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},n),t}var i=r.prototype;return i.init=function(){var t=document.createElement("canvas");this.canvas=t},i.create=function(){var t=this.options,o=t.position,s=t.lookAt,v=t.sprite,y=t.text,p=t.sizeAttenuation;if(v){var w=new f.Sprite(new f.SpriteMaterial({transparent:!0,sizeAttenuation:p}));this.object3d=w}else{var S=new f.MeshBasicMaterial({side:f.DoubleSide,transparent:!0}),m=new f.PlaneGeometry(1,1,1,1);this.createMesh(m,S)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(y)},i.setText=function(t,o){var s=(0,A.Z)(P((0,A.Z)({},this.options),{text:t}),o||{}),v=s.text,y=s.fontSize,p=s.fontFamily,w=s.fontWeight,S=s.flipX,m=s.scale,h=this.canvas;h.width=y*v.length*2,h.height=y;var l=h.getContext("2d");l.font="".concat(w," ").concat(y,"px/1 ").concat(p);var u=l.measureText(v).width;h.width=u,this.width=u,l=h.getContext("2d"),l.clearRect(0,0,h.width,h.height),S&&l.scale(-1,1),l.font="".concat(w," ").concat(y,"px/1 ").concat(p),l.textBaseline="middle",l.fillStyle="#ffffff",l.fillText(v,S?u*-1:0,h.height/2),l.restore();var k=new f.Texture(h);k.anisotropy=16,k.needsUpdate=!0;var z=this.object3d;z.material.map&&z.material.map.dispose(),z.material.map=k,z.material.needsUpdate=!0,z.scale.set(k.image.width*m,k.image.height*m,1)},r}(Q),bt=F(568),Wt=F(666),ut=F.n(Wt),kt=function(){"use strict";function e(){M(this,e),this.cache=new Map}var a=e.prototype;return a.install=function(i){this.pencil=i},a.init=function(i){var n=(0,ht.makePromiseCreator)();this.cache.set(i,n)},a.get=function(i){var n;return(n=this.cache.get(i))===null||n===void 0?void 0:n.promise},a.set=function(i,n){var t=this.cache.get(i);t?t.resolve(n):console.warn("init cache first")},a.dispose=function(){this.cache.forEach(function(i,n){i.reject("stop set cache:".concat(n))}),this.cache.clear()},e}(),ot=new kt,Lt=function(e){"use strict";T(r,e);var a=D(r);function r(n){M(this,r);var t;return t=a.call(this),t.options=n,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,bt.Z)(ut().mark(function o(){var s,v,y,p,w,S,m,h;return ut().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return s=t.options,v=s.transparent,y=s.blending,p=s.src,w=s.depthWrite,S=s.alphaTest,u.next=3,new f.TextureLoader().loadAsync(p);case 3:return m=u.sent,h=new f.MeshBasicMaterial({map:m,transparent:v!=null?v:!1,blending:y!=null?y:f.NormalBlending,depthWrite:w!=null?w:!0,alphaTest:S!=null?S:0}),u.abrupt("return",h);case 6:case"end":return u.stop()}},o)}))()},i.create=function(){var t=this;return(0,bt.Z)(ut().mark(function o(){var s,v,y,p,w,S,m,h;return ut().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,v=s.scale,y=s.position,p=s.src,w=s.cache,!(w&&!ot.get(p))){u.next=7;break}return ot.init(p),u.next=5,t.getMaterial();case 5:S=u.sent,ot.set(p,S);case 7:if(!w){u.next=13;break}return u.next=10,ot.get(p);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,t.texture=m.map,h=new f.PlaneBufferGeometry(m.map.image.width,m.map.image.height),t.createMesh(h,m),v&&t.object3d.scale.set(v,v,1),y&&t.object3d.position.copy(y);case 22:case"end":return u.stop()}},o)}))()},r}(Q),Dt=function(e){"use strict";T(r,e);var a=D(r);function r(n){M(this,r);var t;return t=a.call(this),t.options=n,t}var i=r.prototype;return i.init=function(){var t=this;return(0,bt.Z)(ut().mark(function o(){var s,v;return ut().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return s=t.options.src,p.next=3,new f.TextureLoader().loadAsync(s);case 3:v=p.sent,t.texture=v;case 5:case"end":return p.stop()}},o)}))()},i.create=function(){var t=this.texture,o=this.options,s=o.scale,v=o.position,y=o.blending,p=o.transparent,w=o.depthWrite,S=o.alphaTest,m=o.sizeAttenuation,h=new f.Sprite(new f.SpriteMaterial({map:t,transparent:p!=null?p:!0,blending:y!=null?y:f.NormalBlending,depthWrite:w!=null?w:!0,alphaTest:S!=null?S:0,sizeAttenuation:m!=null?m:!0}));s&&h.scale.set(t.image.width*s,t.image.height*s,1),v&&h.position.copy(v),this.object3d=h},r}(Q);function Rt(e,a){for(;!Object.prototype.hasOwnProperty.call(e,a)&&(e=L(e),e!==null););return e}function xt(e,a,r){return typeof Reflect!="undefined"&&Reflect.get?xt=Reflect.get:xt=function(n,t,o){var s=Rt(n,t);if(!!s){var v=Object.getOwnPropertyDescriptor(s,t);return v.get?v.get.call(o||n):v.value}},xt(e,a,r)}function Ct(e,a,r){return xt(e,a,r)}var zt=function(e){"use strict";T(r,e);var a=D(r);function r(n){M(this,r);var t;return t=a.call(this),t.options=(0,A.Z)({},{autoPlay:!0,loop:!0},n),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,v=t.blending,y=t.depthWrite,p=t.format,w=t.autoPlay,S=t.loop,m=t.alphaTest,h=(0,st.Z)(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var u=new f.VideoTexture(l);u.format=p!=null?p:f.RGBAFormat,u.needsUpdate=!0;var k=new f.MeshBasicMaterial({map:u,transparent:s!=null?s:!0,blending:v!=null?v:f.AdditiveBlending,depthWrite:y!=null?y:!0,alphaTest:m!=null?m:0});h.resolve(k)},!1),l.src=o,l.muted=!0,l.autoplay=w,l.loop=S,l.preload="auto",h.promise},i.create=function(){var t=this;return(0,bt.Z)(ut().mark(function o(){var s,v,y,p,w,S,m,h;return ut().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,v=s.scale,y=s.position,p=s.src,w=s.cache,!(w&&!ot.get(p))){u.next=7;break}return ot.init(p),u.next=5,t.getMaterial();case 5:S=u.sent,ot.set(p,S);case 7:if(!w){u.next=13;break}return u.next=10,ot.get(p);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,t.video=m.map.image,h=new f.PlaneBufferGeometry(t.video.videoWidth,t.video.videoHeight),t.createMesh(h,m),v&&t.object3d.scale.set(v,v,1),y&&t.object3d.position.copy(y);case 22:case"end":return u.stop()}},o)}))()},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Ct(L(r.prototype),"dispose",this).call(this)},r}(Q),Bt=function(e){"use strict";T(r,e);var a=D(r);function r(n){M(this,r);var t;return t=a.call(this),t.options=(0,A.Z)({},{autoPlay:!0,loop:!0},n),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,v=t.blending,y=t.depthWrite,p=t.autoPlay,w=t.loop,S=t.alphaTest,m=t.format,h=(0,st.Z)(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var u=new f.VideoTexture(l);u.format=m!=null?m:f.RGBAFormat,u.needsUpdate=!0;var k=new f.SpriteMaterial({map:u,transparent:s!=null?s:!0,blending:v!=null?v:f.AdditiveBlending,depthWrite:y!=null?y:!0,alphaTest:S!=null?S:0});h.resolve(k)},!1),l.src=o,l.muted=!0,l.autoplay=p,l.loop=w,l.preload="auto",h.promise},i.create=function(){var t=this;return(0,bt.Z)(ut().mark(function o(){var s,v,y,p,w,S,m,h;return ut().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,v=s.scale,y=s.position,p=s.src,w=s.cache,!(w&&!ot.get(p))){u.next=7;break}return ot.init(p),u.next=5,t.getMaterial();case 5:S=u.sent,ot.set(p,S);case 7:if(!w){u.next=13;break}return u.next=10,ot.get(p);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:m=u.t0,t.video=m.map.image,h=new f.Sprite(m),v&&h.scale.set(t.video.videoWidth*v,t.video.videoHeight*v,1),y&&h.position.copy(y),t.object3d=h;case 22:case"end":return u.stop()}},o)}))()},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),Ct(L(r.prototype),"dispose",this).call(this)},r}(Q);function Vt(e,a){if(e==null)return{};var r={},i=Object.keys(e),n,t;for(t=0;t<i.length;t++)n=i[t],!(a.indexOf(n)>=0)&&(r[n]=e[n]);return r}function Gt(e,a){if(e==null)return{};var r=Vt(e,a),i,n;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(n=0;n<t.length;n++)i=t[n],!(a.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var Ut=`
2
- `.concat(f.ShaderChunk.logdepthbuf_pars_vertex,`
3
- `).concat(f.ShaderChunk.fog_pars_vertex,`
1
+ (function(){var je={666:function(A){var C=function(w){"use strict";var T=Object.prototype,M=T.hasOwnProperty,j,S=typeof Symbol=="function"?Symbol:{},R=S.iterator||"@@iterator",D=S.asyncIterator||"@@asyncIterator",k=S.toStringTag||"@@toStringTag";function L(l,s,f){return Object.defineProperty(l,s,{value:f,enumerable:!0,configurable:!0,writable:!0}),l[s]}try{L({},"")}catch(l){L=function(s,f,b){return s[f]=b}}function F(l,s,f,b){var d=s&&s.prototype instanceof O?s:O,G=Object.create(d.prototype),H=new de(b||[]);return G._invoke=$(l,f,H),G}w.wrap=F;function Z(l,s,f){try{return{type:"normal",arg:l.call(s,f)}}catch(b){return{type:"throw",arg:b}}}var E="suspendedStart",c="suspendedYield",ie="executing",V="completed",W={};function O(){}function z(){}function B(){}var Q={};L(Q,R,function(){return this});var q=Object.getPrototypeOf,ee=q&&q(q(le([])));ee&&ee!==T&&M.call(ee,R)&&(Q=ee);var J=B.prototype=O.prototype=Object.create(Q);z.prototype=B,L(J,"constructor",B),L(B,"constructor",z),z.displayName=L(B,k,"GeneratorFunction");function te(l){["next","throw","return"].forEach(function(s){L(l,s,function(f){return this._invoke(s,f)})})}w.isGeneratorFunction=function(l){var s=typeof l=="function"&&l.constructor;return s?s===z||(s.displayName||s.name)==="GeneratorFunction":!1},w.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,B):(l.__proto__=B,L(l,k,"GeneratorFunction")),l.prototype=Object.create(J),l},w.awrap=function(l){return{__await:l}};function oe(l,s){function f(G,H,X,I){var N=Z(l[G],l,H);if(N.type==="throw")I(N.arg);else{var me=N.arg,ue=me.value;return ue&&typeof ue=="object"&&M.call(ue,"__await")?s.resolve(ue.__await).then(function(ae){f("next",ae,X,I)},function(ae){f("throw",ae,X,I)}):s.resolve(ue).then(function(ae){me.value=ae,X(me)},function(ae){return f("throw",ae,X,I)})}}var b;function d(G,H){function X(){return new s(function(I,N){f(G,H,I,N)})}return b=b?b.then(X,X):X()}this._invoke=d}te(oe.prototype),L(oe.prototype,D,function(){return this}),w.AsyncIterator=oe,w.async=function(l,s,f,b,d){d===void 0&&(d=Promise);var G=new oe(F(l,s,f,b),d);return w.isGeneratorFunction(s)?G:G.next().then(function(H){return H.done?H.value:G.next()})};function $(l,s,f){var b=E;return function(G,H){if(b===ie)throw new Error("Generator is already running");if(b===V){if(G==="throw")throw H;return ye()}for(f.method=G,f.arg=H;;){var X=f.delegate;if(X){var I=se(X,f);if(I){if(I===W)continue;return I}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(b===E)throw b=V,f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);b=ie;var N=Z(l,s,f);if(N.type==="normal"){if(b=f.done?V:c,N.arg===W)continue;return{value:N.arg,done:f.done}}else N.type==="throw"&&(b=V,f.method="throw",f.arg=N.arg)}}}function se(l,s){var f=l.iterator[s.method];if(f===j){if(s.delegate=null,s.method==="throw"){if(l.iterator.return&&(s.method="return",s.arg=j,se(l,s),s.method==="throw"))return W;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var b=Z(f,l.iterator,s.arg);if(b.type==="throw")return s.method="throw",s.arg=b.arg,s.delegate=null,W;var d=b.arg;if(!d)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,W;if(d.done)s[l.resultName]=d.value,s.next=l.nextLoc,s.method!=="return"&&(s.method="next",s.arg=j);else return d;return s.delegate=null,W}te(J),L(J,k,"Generator"),L(J,R,function(){return this}),L(J,"toString",function(){return"[object Generator]"});function pe(l){var s={tryLoc:l[0]};1 in l&&(s.catchLoc=l[1]),2 in l&&(s.finallyLoc=l[2],s.afterLoc=l[3]),this.tryEntries.push(s)}function ve(l){var s=l.completion||{};s.type="normal",delete s.arg,l.completion=s}function de(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(pe,this),this.reset(!0)}w.keys=function(l){var s=[];for(var f in l)s.push(f);return s.reverse(),function b(){for(;s.length;){var d=s.pop();if(d in l)return b.value=d,b.done=!1,b}return b.done=!0,b}};function le(l){if(l){var s=l[R];if(s)return s.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var f=-1,b=function d(){for(;++f<l.length;)if(M.call(l,f))return d.value=l[f],d.done=!1,d;return d.value=j,d.done=!0,d};return b.next=b}}return{next:ye}}w.values=le;function ye(){return{value:j,done:!0}}return de.prototype={constructor:de,reset:function(l){if(this.prev=0,this.next=0,this.sent=this._sent=j,this.done=!1,this.delegate=null,this.method="next",this.arg=j,this.tryEntries.forEach(ve),!l)for(var s in this)s.charAt(0)==="t"&&M.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=j)},stop:function(){this.done=!0;var l=this.tryEntries[0],s=l.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(l){if(this.done)throw l;var s=this;function f(I,N){return G.type="throw",G.arg=l,s.next=I,N&&(s.method="next",s.arg=j),!!N}for(var b=this.tryEntries.length-1;b>=0;--b){var d=this.tryEntries[b],G=d.completion;if(d.tryLoc==="root")return f("end");if(d.tryLoc<=this.prev){var H=M.call(d,"catchLoc"),X=M.call(d,"finallyLoc");if(H&&X){if(this.prev<d.catchLoc)return f(d.catchLoc,!0);if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else if(H){if(this.prev<d.catchLoc)return f(d.catchLoc,!0)}else if(X){if(this.prev<d.finallyLoc)return f(d.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(l,s){for(var f=this.tryEntries.length-1;f>=0;--f){var b=this.tryEntries[f];if(b.tryLoc<=this.prev&&M.call(b,"finallyLoc")&&this.prev<b.finallyLoc){var d=b;break}}d&&(l==="break"||l==="continue")&&d.tryLoc<=s&&s<=d.finallyLoc&&(d=null);var G=d?d.completion:{};return G.type=l,G.arg=s,d?(this.method="next",this.next=d.finallyLoc,W):this.complete(G)},complete:function(l,s){if(l.type==="throw")throw l.arg;return l.type==="break"||l.type==="continue"?this.next=l.arg:l.type==="return"?(this.rval=this.arg=l.arg,this.method="return",this.next="end"):l.type==="normal"&&s&&(this.next=s),W},finish:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===l)return this.complete(f.completion,f.afterLoc),ve(f),W}},catch:function(l){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===l){var b=f.completion;if(b.type==="throw"){var d=b.arg;ve(f)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(l,s,f){return this.delegate={iterator:le(l),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=j),W}},w}(A.exports);try{regeneratorRuntime=C}catch(w){typeof globalThis=="object"?globalThis.regeneratorRuntime=C:Function("r","regeneratorRuntime = r")(C)}},695:function(A,C,w){"use strict";w.d(C,{Z:function(){return T}});function T(M){if(M.geometry&&M.geometry.dispose(),M.material){var j=Array.isArray(M.material)?M.material:[M.material];j.forEach(function(S){var R,D,k,L,F,Z,E,c,ie,V,W,O,z;(R=S.map)===null||R===void 0||R.dispose(),(D=S.lightMap)===null||D===void 0||D.dispose(),(k=S.bumpMap)===null||k===void 0||k.dispose(),(L=S.normalMap)===null||L===void 0||L.dispose(),(F=S.specularMap)===null||F===void 0||F.dispose(),(Z=S.envMap)===null||Z===void 0||Z.dispose(),(E=S.alphaMap)===null||E===void 0||E.dispose(),(c=S.aoMap)===null||c===void 0||c.dispose(),(ie=S.displacementMap)===null||ie===void 0||ie.dispose(),(V=S.emissiveMap)===null||V===void 0||V.dispose(),(W=S.gradientMap)===null||W===void 0||W.dispose(),(O=S.metalnessMap)===null||O===void 0||O.dispose(),(z=S.roughnessMap)===null||z===void 0||z.dispose(),S.dispose()})}}},519:function(A,C,w){"use strict";w.d(C,{disposeMesh:function(){return S.Z}});var T=w(666),M=w.n(T),j=null,S=w(695),R=w(644);function D(V){if(V.material){var W=Array.isArray(V.material)?V.material:[V.material];W.forEach(function(O){var z,B;(z=O.color)===null||z===void 0||z.convertSRGBToLinear(),(B=O.emissive)===null||B===void 0||B.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var k=w(568),L=w(924),F=require("idb-keyval"),Z=w(484),E=null,c=null,ie=function(){var V=(0,k.Z)(M().mark(function W(O,z){var B,Q,q,ee,J,te;return M().wrap(function($){for(;;)switch($.prev=$.next){case 0:return B=z.version,$.next=4,(0,F.get)(O);case 4:if(q=$.sent,!(q&&q[B])){$.next=9;break}Q=q[B],$.next=15;break;case 9:return $.next=11,(0,Z.Z)(fetch(O).then(function(se){if(se.ok)return se.blob();throw new Error}));case 11:ee=$.sent,J=ee.res,te=ee.err,te||(Q=J,(0,F.set)(O,(0,L.Z)({},B,J)));case 15:return $.abrupt("return",Q?{url:URL.createObjectURL(Q)}:{url:O});case 16:case"end":return $.stop()}},W)}));return function(O,z){return V.apply(this,arguments)}}()},484:function(A,C,w){"use strict";w.d(C,{Z:function(){return M}});var T=w(42);function M(j){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return j.then(function(R){return(0,T.Z)({err:null,res:R},S)}).catch(function(R){return(0,T.Z)({err:R,res:void 0},S)})}},644:function(A){"use strict";A.exports=require("three")},568:function(A,C,w){"use strict";w.d(C,{Z:function(){return M}});function T(j,S,R,D,k,L,F){try{var Z=j[L](F),E=Z.value}catch(c){R(c);return}Z.done?S(E):Promise.resolve(E).then(D,k)}function M(j){return function(){var S=this,R=arguments;return new Promise(function(D,k){var L=j.apply(S,R);function F(E){T(L,D,k,F,Z,"next",E)}function Z(E){T(L,D,k,F,Z,"throw",E)}F(void 0)})}}},924:function(A,C,w){"use strict";w.d(C,{Z:function(){return T}});function T(M,j,S){return j in M?Object.defineProperty(M,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):M[j]=S,M}},42:function(A,C,w){"use strict";w.d(C,{Z:function(){return M}});var T=w(924);function M(j){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{},D=Object.keys(R);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(R).filter(function(k){return Object.getOwnPropertyDescriptor(R,k).enumerable}))),D.forEach(function(k){(0,T.Z)(j,k,R[k])})}return j}}},Se={};function U(A){var C=Se[A];if(C!==void 0)return C.exports;var w=Se[A]={exports:{}};return je[A](w,w.exports,U),w.exports}(function(){U.n=function(A){var C=A&&A.__esModule?function(){return A.default}:function(){return A};return U.d(C,{a:C}),C}})(),function(){U.d=function(A,C){for(var w in C)U.o(C,w)&&!U.o(A,w)&&Object.defineProperty(A,w,{enumerable:!0,get:C[w]})}}(),function(){U.o=function(A,C){return Object.prototype.hasOwnProperty.call(A,C)}}(),function(){U.r=function(A){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}}();var be={};(function(){"use strict";U.r(be),U.d(be,{Css2dBind:function(){return Ce},Image:function(){return G},Line:function(){return We},MeshLine:function(){return re},MeshLineMaterial:function(){return we},MeshLineRaycast:function(){return Me},SpriteImage:function(){return H},SpriteVideo:function(){return ue},Text:function(){return s},Video:function(){return me}});function A(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function C(t,o){return C=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C(t,o)}function w(t,o){return C(t,o)}function T(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&w(t,o)}var M=U(42);function j(t,o){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);o&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function S(t,o){return o=o!=null?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):j(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}),t}function R(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function k(t){return D(t)}function L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function Z(t,o){return o&&(F(o)==="object"||typeof o=="function")?o:L(t)}function E(t){var o=R();return function(){var n=k(t),i;if(o){var e=k(this).constructor;i=Reflect.construct(n,arguments,e)}else i=n.apply(this,arguments);return Z(this,i)}}var c=U(644);function ie(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function V(t,o,r){return ie()?V=Reflect.construct:V=function(i,e,a){var u=[null];u.push.apply(u,e);var p=Function.bind.apply(i,u),v=new p;return a&&w(v,a.prototype),v},V.apply(null,arguments)}function W(t,o,r){return V.apply(null,arguments)}function O(t,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function z(t,o,r){return o&&O(t.prototype,o),r&&O(t,r),t}function B(t,o){(o==null||o>t.length)&&(o=t.length);for(var r=0,n=new Array(o);r<o;r++)n[r]=t[r];return n}function Q(t){if(Array.isArray(t))return B(t)}function q(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){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 J(t,o){if(!!t){if(typeof t=="string")return B(t,o);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,o)}}function te(t){return Q(t)||q(t)||J(t)||ee()}var oe=U(484);function $(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,i){r.resolve=n,r.reject=i}),t&&(r.promise=(0,oe.Z)(r.promise,o)),r}var se=require("@tweenjs/tween.js"),pe=U.n(se),ve=function(){"use strict";function t(){A(this,t),this.guiParams={}}var o=t.prototype;return o.showGuiParams=function(n){var i=this;!n||Object.keys(this.guiParams).forEach(function(e){var a=n.addFolder(e),u=i.guiParams[e];Object.keys(u).forEach(function(p){var v=u[p],m=v.min,y=v.max,_=v.step,g=v.name,P=v.to,x=v.paramMap,h=v.items,K=v.value,ne=v.target,xe=p.toLowerCase().indexOf("color")>-1,Y,ce=typeof K=="undefined"&&ne,he=ce?ne():u[p],fe=ce?p:"value";h?Y=a.add(he,fe,h):xe?Y=a.addColor(he,fe):Y=a.add(he,fe),Y=Y.name(g||p),typeof m!="undefined"&&(Y=Y.min(m)),typeof y!="undefined"&&(Y=Y.max(y)),typeof _!="undefined"&&(Y=Y.step(_)),Y=Y.onChange(function(){i.setGuiTargetValue(e,p,he[fe],x)}),(P||ce)&&Y.listen()})})},o.setGuiTargetValue=function(n,i,e,a){var u=this.guiParams[n][i],p=u.onChange,v=u.target,m=u.value,y=i.toLowerCase().indexOf("color")>-1,_=typeof m=="undefined"&&v;if(v&&!_){var g=v();Array.isArray(g)||(g=[g]),g.forEach(function(P){if(!!P)if(y)try{P[a||i].set(e)}catch(x){i!=="color"&&!a&&console.warn("".concat(i," is not a color,set paramMap"))}else P[a||i]=e})}p&&p(e)},o.setGuiTargetValueByParams=function(){var n=this;Object.keys(this.guiParams).forEach(function(i){Object.keys(n.guiParams[i]).forEach(function(e){var a=n.guiParams[i][e];typeof a.value!="undefined"&&n.setGuiTargetValue(i,e,a.value,a.paramMap)})})},o.guiParamTween=function(n,i,e){var a=e.duration,u=a===void 0?0:a,p=this,v=this.guiParams[n][i],m=v.to,y=v.paramMap,_=y===void 0?"":y;return new(pe()).Tween(this.guiParams[n][i]).to({value:m},u).onUpdate(function(g){p.setGuiTargetValue(n,i,g.value,_)})},t}(),de=require("three/examples/jsm/renderers/CSS2DRenderer"),le=require("three/examples/jsm/renderers/CSS3DRenderer"),ye=U(519),l=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.objecttype__="BaseObject",e.isAdd=!1,e.userData={},e.pm=$(),e.visible=!1,e}var n=r.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,a){},n.resize=function(e,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return this.object3d=W(c.Mesh,te(a)),this},n.createGroup=function(){return this.object3d=new c.Group,this},n.createPoints=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return this.object3d=W(c.Points,te(a)),this},n.createCSS2DObject=function(e){return this.object3d=new de.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new le.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new le.CSS3DSprite(e),this},n.add=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var p;return(p=this.object3d).add.apply(p,te(a)),this},n.remove=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var p;return(p=this.object3d).remove.apply(p,te(a)),this},n.getSize=function(){var e=new c.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new c.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(a){a.traverse(e)})},n.dispose=function(){var e;(e=this.object3d)===null||e===void 0||e.traverse(function(a){(0,ye.disposeMesh)(a)})},z(r,[{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})}}]),r}(ve),s=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.width=0,e.options=(0,M.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},i),e}var n=r.prototype;return n.init=function(){var e=document.createElement("canvas");this.canvas=e},n.create=function(){var e=this.options,a=e.position,u=e.lookAt,p=e.sprite,v=e.text,m=e.sizeAttenuation;if(p){var y=new c.Sprite(new c.SpriteMaterial({transparent:!0,sizeAttenuation:m}));this.object3d=y}else{var _=new c.MeshBasicMaterial({side:c.DoubleSide,transparent:!0}),g=new c.PlaneGeometry(1,1,1,1);this.createMesh(g,_)}this.object3d.position.copy(a),u&&this.object3d.lookAt(u),this.setText(v)},n.setText=function(e,a){var u=(0,M.Z)(S((0,M.Z)({},this.options),{text:e}),a||{}),p=u.text,v=u.fontSize,m=u.fontFamily,y=u.fontWeight,_=u.flipX,g=u.scale,P=this.canvas;P.width=v*p.length*2,P.height=v;var x=P.getContext("2d");x.font="".concat(y," ").concat(v,"px/1 ").concat(m);var h=x.measureText(p).width;P.width=h,this.width=h,x=P.getContext("2d"),x.clearRect(0,0,P.width,P.height),_&&x.scale(-1,1),x.font="".concat(y," ").concat(v,"px/1 ").concat(m),x.textBaseline="middle",x.fillStyle="#ffffff",x.fillText(p,_?h*-1:0,P.height/2),x.restore();var K=new c.Texture(P);K.anisotropy=16,K.needsUpdate=!0;var ne=this.object3d;ne.material.map&&ne.material.map.dispose(),ne.material.map=K,ne.material.needsUpdate=!0,ne.scale.set(K.image.width*g,K.image.height*g,1)},r}(l),f=U(568),b=U(666),d=U.n(b),G=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=i,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p,v,m,y,_,g,P;return d().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=e.options,p=u.transparent,v=u.blending,m=u.src,y=u.depthWrite,_=u.alphaTest,h.next=3,new c.TextureLoader().loadAsync(m);case 3:return g=h.sent,P=new c.MeshBasicMaterial({map:g,transparent:p!=null?p:!1,blending:v!=null?v:c.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:_!=null?_:0}),h.abrupt("return",P);case 6:case"end":return h.stop()}},a)}))()},n.create=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p,v,m,y,_,g,P;return d().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,m=u.src,y=u.cache,!(y&&!y.get(m))){h.next=7;break}return y.init(m),h.next=5,e.getMaterial();case 5:_=h.sent,y.set(m,_);case 7:if(!y){h.next=13;break}return h.next=10,y.get(m);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.texture=g.map,P=new c.PlaneBufferGeometry(g.map.image.width,g.map.image.height),e.createMesh(P,g),p&&e.object3d.scale.set(p,p,1),v&&e.object3d.position.copy(v);case 22:case"end":return h.stop()}},a)}))()},r}(l),H=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=i,e}var n=r.prototype;return n.init=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p;return d().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return u=e.options.src,m.next=3,new c.TextureLoader().loadAsync(u);case 3:p=m.sent,e.texture=p;case 5:case"end":return m.stop()}},a)}))()},n.create=function(){var e=this.texture,a=this.options,u=a.scale,p=a.position,v=a.blending,m=a.transparent,y=a.depthWrite,_=a.alphaTest,g=a.sizeAttenuation,P=new c.Sprite(new c.SpriteMaterial({map:e,transparent:m!=null?m:!0,blending:v!=null?v:c.NormalBlending,depthWrite:y!=null?y:!0,alphaTest:_!=null?_:0,sizeAttenuation:g!=null?g:!0}));u&&P.scale.set(e.image.width*u,e.image.height*u,1),p&&P.position.copy(p),this.object3d=P},r}(l);function X(t,o){for(;!Object.prototype.hasOwnProperty.call(t,o)&&(t=k(t),t!==null););return t}function I(t,o,r){return typeof Reflect!="undefined"&&Reflect.get?I=Reflect.get:I=function(i,e,a){var u=X(i,e);if(!!u){var p=Object.getOwnPropertyDescriptor(u,e);return p.get?p.get.call(a||i):p.value}},I(t,o,r)}function N(t,o,r){return I(t,o,r)}var me=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,a=e.src,u=e.transparent,p=e.blending,v=e.depthWrite,m=e.format,y=e.autoPlay,_=e.loop,g=e.alphaTest,P=$(),x=document.createElement("video");return x.addEventListener("loadedmetadata",function(){var h=new c.VideoTexture(x);h.format=m!=null?m:c.RGBAFormat,h.needsUpdate=!0;var K=new c.MeshBasicMaterial({map:h,transparent:u!=null?u:!0,blending:p!=null?p:c.AdditiveBlending,depthWrite:v!=null?v:!0,alphaTest:g!=null?g:0});P.resolve(K)},!1),x.src=a,x.muted=!0,x.autoplay=y,x.loop=_,x.preload="auto",P.promise},n.create=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p,v,m,y,_,g,P;return d().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,m=u.src,y=u.cache,!(y&&!y.get(m))){h.next=7;break}return y.init(m),h.next=5,e.getMaterial();case 5:_=h.sent,y.set(m,_);case 7:if(!y){h.next=13;break}return h.next=10,y.get(m);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.video=g.map.image,P=new c.PlaneBufferGeometry(e.video.videoWidth,e.video.videoHeight),e.createMesh(P,g),p&&e.object3d.scale.set(p,p,1),v&&e.object3d.position.copy(v);case 22:case"end":return h.stop()}},a)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(k(r.prototype),"dispose",this).call(this)},r}(l),ue=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},{autoPlay:!0,loop:!0},i),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,a=e.src,u=e.transparent,p=e.blending,v=e.depthWrite,m=e.autoPlay,y=e.loop,_=e.alphaTest,g=e.format,P=$(),x=document.createElement("video");return x.addEventListener("loadedmetadata",function(){var h=new c.VideoTexture(x);h.format=g!=null?g:c.RGBAFormat,h.needsUpdate=!0;var K=new c.SpriteMaterial({map:h,transparent:u!=null?u:!0,blending:p!=null?p:c.AdditiveBlending,depthWrite:v!=null?v:!0,alphaTest:_!=null?_:0});P.resolve(K)},!1),x.src=a,x.muted=!0,x.autoplay=m,x.loop=y,x.preload="auto",P.promise},n.create=function(){var e=this;return(0,f.Z)(d().mark(function a(){var u,p,v,m,y,_,g,P;return d().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(u=e.options,p=u.scale,v=u.position,m=u.src,y=u.cache,!(y&&!y.get(m))){h.next=7;break}return y.init(m),h.next=5,e.getMaterial();case 5:_=h.sent,y.set(m,_);case 7:if(!y){h.next=13;break}return h.next=10,y.get(m);case 10:h.t0=h.sent,h.next=16;break;case 13:return h.next=15,e.getMaterial();case 15:h.t0=h.sent;case 16:g=h.t0,e.video=g.map.image,P=new c.Sprite(g),p&&P.scale.set(e.video.videoWidth*p,e.video.videoHeight*p,1),v&&P.position.copy(v),e.object3d=P;case 22:case"end":return h.stop()}},a)}))()},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),N(k(r.prototype),"dispose",this).call(this)},r}(l),ae=`
2
+ `.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
3
+ `).concat(c.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
5
5
  attribute vec3 next;
6
6
  attribute float side;
@@ -91,13 +91,13 @@
91
91
  finalPosition.xy+=offset.xy;
92
92
 
93
93
  gl_Position=finalPosition;
94
- `).concat(f.ShaderChunk.logdepthbuf_vertex,`
94
+ `).concat(c.ShaderChunk.logdepthbuf_vertex,`
95
95
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
96
- `).concat(f.ShaderChunk.fog_vertex,`
96
+ `).concat(c.ShaderChunk.fog_vertex,`
97
97
  }
98
- `),Zt=`
99
- `.concat(f.ShaderChunk.fog_pars_fragment,`
100
- `).concat(f.ShaderChunk.logdepthbuf_pars_fragment,`
98
+ `),Te=`
99
+ `.concat(c.ShaderChunk.fog_pars_fragment,`
100
+ `).concat(c.ShaderChunk.logdepthbuf_pars_fragment,`
101
101
 
102
102
 
103
103
  uniform sampler2D map;
@@ -117,7 +117,7 @@ varying vec4 vColor;
117
117
  varying float vCounters;
118
118
 
119
119
  void main() {
120
- `).concat(f.ShaderChunk.logdepthbuf_fragment,`
120
+ `).concat(c.ShaderChunk.logdepthbuf_fragment,`
121
121
  vec4 c = vColor;
122
122
  if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
123
123
  if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
@@ -127,6 +127,6 @@ void main() {
127
127
  }
128
128
  gl_FragColor = c;
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
- `).concat(f.ShaderChunk.fog_fragment,`
130
+ `).concat(c.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),ct=function(e){"use strict";T(r,e);var a=D(r);function r(){M(this,r);var i;return i=a.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new f.Matrix4,Object.defineProperties(W(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(f.BufferGeometry);ct.prototype.setMatrixWorld=function(e){this.matrixWorld=e},ct.prototype.setGeometry=function(e,a){this._geometry=e,this.setPoints(e.getAttribute("position").array,a)},ct.prototype.setPoints=function(e,a){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=a,this.positions=[],this.counters=[],e.length&&e[0]instanceof f.Vector3)for(var r=0;r<e.length;r++){var i=e[r],n=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(n),this.counters.push(n)}else for(var r=0;r<e.length;r+=3){var n=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(n),this.counters.push(n)}this.process()};function Ft(e,a){var r=new f.Matrix4,i=new f.Ray,n=new f.Sphere,t=new f.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(n,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var s=new f.Vector3,v=new f.Vector3,y=new f.Vector3,p=this instanceof f.LineSegments?2:1,w=o.index,S=o.attributes;if(w!==null)for(var m=w.array,h=S.position.array,l=S.width.array,u=0,k=m.length-1;u<k;u+=p){var z=m[u],J=m[u+1];s.fromArray(h,z*3),v.fromArray(h,J*3);var U=l[Math.floor(u/3)]!==void 0?l[Math.floor(u/3)]:1,ft=e.params.Line.threshold+this.material.lineWidth*U/2,mt=ft*ft,yt=i.distanceSqToSegment(s,v,t,y);if(!(yt>mt)){t.applyMatrix4(this.matrixWorld);var Pt=e.ray.origin.distanceTo(t);Pt<e.near||Pt>e.far||(a.push({distance:Pt,point:y.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=k)}}}}ct.prototype.raycast=Ft,ct.prototype.compareV3=function(e,a){var r=e*6,i=a*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},ct.prototype.copyV3=function(e){var a=e*6;return[this.positions[a],this.positions[a+1],this.positions[a+2]]},ct.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var a,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?a=this.widthCallback(i/(e-1)):a=1,this.width.push(a),this.width.push(a),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var n=i*2;this.indices_array.push(n,n+1,n+2),this.indices_array.push(n+2,n+1,n+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new f.BufferAttribute(new Float32Array(this.positions),3),previous:new f.BufferAttribute(new Float32Array(this.previous),3),next:new f.BufferAttribute(new Float32Array(this.next),3),side:new f.BufferAttribute(new Float32Array(this.side),1),width:new f.BufferAttribute(new Float32Array(this.width),1),uv:new f.BufferAttribute(new Float32Array(this.uvs),2),index:new f.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new f.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Mt(e,a,r,i,n){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=a?e.subarray?e.subarray(a,n&&a+n):e.slice(a,n&&a+n):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}ct.prototype.advance=function(e){var a=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,n=a.length;Mt(a,0,r,0,n),Mt(a,6,a,0,n-6),a[n-6]=e.x,a[n-5]=e.y,a[n-4]=e.z,a[n-3]=e.x,a[n-2]=e.y,a[n-1]=e.z,Mt(a,6,i,0,n-6),i[n-6]=e.x,i[n-5]=e.y,i[n-4]=e.z,i[n-3]=e.x,i[n-2]=e.y,i[n-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},f.ShaderChunk.meshline_vert=Ut,f.ShaderChunk.meshline_frag=Zt;var Ot=function(e){"use strict";T(r,e);var a=D(r);function r(i){M(this,r);var n;return n=a.call(this,{uniforms:Object.assign({},f.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new f.Color(16777215)},opacity:{value:1},resolution:{value:new f.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new f.Vector2(1,1)},offset:{value:new f.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new f.Vector2(0,0)},lightColor:{value:new f.Color(16777215)}}),vertexShader:f.ShaderChunk.meshline_vert,fragmentShader:f.ShaderChunk.meshline_frag}),n.isMeshLineMaterial=!0,n.type="MeshLineMaterial",Object.defineProperties(W(n),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),n.setValues(i),n}return r}(f.ShaderMaterial);Ot.prototype.copy=function(e){return f.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};var It={nodes:[],color:new f.Color("red"),lineWidth:3,sizeAttenuation:0},Nt=function(e){"use strict";T(r,e);var a=D(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,r);var t;return t=a.call(this),t.geometry=new f.BufferGeometry,t.meshline=new ct,t.options=(0,A.Z)({},It,n),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.nodes,s=t.duration,v=t.delay,y=t.onComplete,p=t.setPointWidth,w=Gt(t,["nodes","duration","delay","onComplete","setPointWidth"]),S=this.pencil.getSize(),m=S.width,h=S.height;delete w.key,this.geometry.setFromPoints(o),this.meshline.setGeometry(this.geometry,p);var l=new Ot(P((0,A.Z)({},w),{resolution:new f.Vector2(m,h)}));this.material=l,this.createMesh(this.meshline,l)},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,v=t.onComplete,y=this.material.uniforms.offset,p=new($()).Tween(y.value).to({x:0},o!=null?o:1e3).delay(s!=null?s:0).repeat(1/0);v&&p.onComplete(v),p.start(),this.tween=p},i.dispose=function(){this.tween&&$().remove(this.tween)},r}(Q),Ht=Nt,$t={position:new f.Vector3(0,0,0),onClick:void 0},jt=function(e){"use strict";T(r,e);var a=D(r);function r(i){M(this,r);var n;n=a.call(this),n.options=(0,A.Z)({},$t,i);var t=document.createElement("div");t.addEventListener("click",function(){var s,v;(v=(s=n.options).onClick)===null||v===void 0||v.call(s,n.options.key)}),n.options.children&&t.appendChild(n.options.children);var o=new pt(t);return o.position.copy(n.options.position),n.object3d=o,n}return r}(Q),Xt={Css2dBind:jt}})(),module.exports=St})();
132
+ `),re=function(t){"use strict";T(r,t);var o=E(r);function r(){A(this,r);var n;return n=o.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new c.Matrix4,Object.defineProperties(L(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(c.BufferGeometry);re.prototype.setMatrixWorld=function(t){this.matrixWorld=t},re.prototype.setGeometry=function(t,o){this._geometry=t,this.setPoints(t.getAttribute("position").array,o)},re.prototype.setPoints=function(t,o){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=o,this.positions=[],this.counters=[],t.length&&t[0]instanceof c.Vector3)for(var r=0;r<t.length;r++){var n=t[r],i=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(i),this.counters.push(i)}else for(var r=0;r<t.length;r+=3){var i=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(i),this.counters.push(i)}this.process()};function Me(t,o){var r=new c.Matrix4,n=new c.Ray,i=new c.Sphere,e=new c.Vector3,a=this.geometry;if(a.boundingSphere||a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(i,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var u=new c.Vector3,p=new c.Vector3,v=new c.Vector3,m=this instanceof c.LineSegments?2:1,y=a.index,_=a.attributes;if(y!==null)for(var g=y.array,P=_.position.array,x=_.width.array,h=0,K=g.length-1;h<K;h+=m){var ne=g[h],xe=g[h+1];u.fromArray(P,ne*3),p.fromArray(P,xe*3);var Y=x[Math.floor(h/3)]!==void 0?x[Math.floor(h/3)]:1,ce=t.params.Line.threshold+this.material.lineWidth*Y/2,he=ce*ce,fe=n.distanceSqToSegment(u,p,e,v);if(!(fe>he)){e.applyMatrix4(this.matrixWorld);var Ae=t.ray.origin.distanceTo(e);Ae<t.near||Ae>t.far||(o.push({distance:Ae,point:v.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=K)}}}}re.prototype.raycast=Me,re.prototype.compareV3=function(t,o){var r=t*6,n=o*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},re.prototype.copyV3=function(t){var o=t*6;return[this.positions[o],this.positions[o+1],this.positions[o+2]]},re.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var o,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?o=this.widthCallback(n/(t-1)):o=1,this.width.push(o),this.width.push(o),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var i=n*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function _e(t,o,r,n,i){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=o?t.subarray?t.subarray(o,i&&o+i):t.slice(o,i&&o+i):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}re.prototype.advance=function(t){var o=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,i=o.length;_e(o,0,r,0,i),_e(o,6,o,0,i-6),o[i-6]=t.x,o[i-5]=t.y,o[i-4]=t.z,o[i-3]=t.x,o[i-2]=t.y,o[i-1]=t.z,_e(o,6,n,0,i-6),n[i-6]=t.x,n[i-5]=t.y,n[i-4]=t.z,n[i-3]=t.x,n[i-2]=t.y,n[i-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},c.ShaderChunk.meshline_vert=ae,c.ShaderChunk.meshline_frag=Te;var we=function(t){"use strict";T(r,t);var o=E(r);function r(n){A(this,r);var i;return i=o.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),i.isMeshLineMaterial=!0,i.type="MeshLineMaterial",Object.defineProperties(L(i),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(a){this.uniforms.lineWidth.value=a}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(a){this.uniforms.lineLightAnimation.value=a}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(a){this.uniforms.map.value=a}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(a){this.uniforms.useMap.value=a}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(a){this.uniforms.alphaMap.value=a}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(a){this.uniforms.useAlphaMap.value=a}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(a){this.uniforms.color.value=a}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(a){this.uniforms.lightColor.value=a}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(a){this.uniforms.time.value=a}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(a){this.uniforms.uCenter.value=a}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(a){this.uniforms.size.value=a}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(a){this.uniforms.opacity.value=a}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(a){this.uniforms.resolution.value.copy(a)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(a){this.uniforms.sizeAttenuation.value=a}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(a){this.uniforms.dashArray.value=a,this.useDash=a!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(a){this.uniforms.dashOffset.value=a}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(a){this.uniforms.dashRatio.value=a}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(a){this.uniforms.useDash.value=a}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(a){this.uniforms.visibility.value=a}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(a){this.uniforms.alphaTest.value=a}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(a){this.uniforms.repeat.value.copy(a)}}}),i.setValues(n),i}return r}(c.ShaderMaterial);we.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function Le(t,o){if(t==null)return{};var r={},n=Object.keys(t),i,e;for(e=0;e<n.length;e++)i=n[e],!(o.indexOf(i)>=0)&&(r[i]=t[i]);return r}function ke(t,o){if(t==null)return{};var r=Le(t,o),n,i;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(i=0;i<e.length;i++)n=e[i],!(o.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ee={nodes:[],color:new c.Color("red"),lineWidth:3,sizeAttenuation:0},Re=function(t){"use strict";T(r,t);var o=E(r);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,r);var e;return e=o.call(this),e.geometry=new c.BufferGeometry,e.meshline=new re,e.options=(0,M.Z)({},Ee,i),e}var n=r.prototype;return n.create=function(){var e=this.options,a=e.nodes,u=e.duration,p=e.delay,v=e.onComplete,m=e.setPointWidth,y=ke(e,["nodes","duration","delay","onComplete","setPointWidth"]),_=this.pencil.getSize(),g=_.width,P=_.height;delete y.key,this.geometry.setFromPoints(a),this.meshline.setGeometry(this.geometry,m);var x=new we(S((0,M.Z)({},y),{resolution:new c.Vector2(g,P)}));this.material=x,this.createMesh(this.meshline,x)},n.resize=function(e,a){this.material.uniforms.resolution.value.set(e,a)},n.animate=function(){var e=this.options,a=e.duration,u=e.delay,p=e.onComplete,v=this.material.uniforms.offset,m=new(pe()).Tween(v.value).to({x:0},a!=null?a:1e3).delay(u!=null?u:0).repeat(1/0);p&&m.onComplete(p),m.start(),this.tween=m},n.dispose=function(){this.tween&&pe().remove(this.tween)},r}(l),We=Re,Be={position:new c.Vector3(0,0,0),onClick:void 0},ge=document.createElement("canvas");ge.width=256,ge.height=256;var Oe=ge.getContext("2d");Oe.fillStyle="#ff0000",Oe.fillRect(0,0,256,256);var Pe=new c.CanvasTexture(ge),Ce=function(t){"use strict";T(r,t);var o=E(r);function r(i){A(this,r);var e;return e=o.call(this),e.options=(0,M.Z)({},Be,i),e}var n=r.prototype;return n.create=function(){var e=document.createElement("div");this.options.children&&e.appendChild(this.options.children),this.createCSS2DObject(e),this.object3d.position.copy(this.options.position)},n.createPickObject=function(e){var a=e.show,u=a===void 0?!1:a,p=e.scale,v=p===void 0?new c.Vector3(1,1,1):p,m=e.position,y=m===void 0?new c.Vector3(0,0,0):m,_=new c.Sprite(new c.SpriteMaterial({map:Pe,opacity:u?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}));_.scale.set(Pe.image.width*v.x,Pe.image.height*v.y,1),_.position.copy(y),this.add(_),this.pickObject=_},r}(l),ze={Css2dBind:Ce}})(),module.exports=be})();
@@ -1,10 +1,11 @@
1
1
  import * as THREE from 'three';
2
2
  import BaseObject from '../../core/BaseObject';
3
+ import Cache from '../../plugins/Cache';
3
4
  interface Options {
4
5
  src: string;
5
6
  scale?: number;
6
7
  position?: THREE.Vector3;
7
- cache?: boolean;
8
+ cache?: Cache;
8
9
  transparent?: boolean;
9
10
  blending?: THREE.Blending;
10
11
  depthWrite?: boolean;
@@ -1,10 +1,11 @@
1
1
  import * as THREE from 'three';
2
2
  import BaseObject from '../../core/BaseObject';
3
+ import Cache from '../../plugins/Cache';
3
4
  interface Options {
4
5
  src: string;
5
6
  scale?: number;
6
7
  position?: THREE.Vector3;
7
- cache?: boolean;
8
+ cache?: Cache;
8
9
  transparent?: boolean;
9
10
  blending?: THREE.Blending;
10
11
  depthWrite?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.0.3",
3
+ "version": "0.0.6",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "PORT=3002 bundler-dev",
@@ -1,3 +0,0 @@
1
- import Cache from '../plugins/Cache';
2
- declare const _default: Cache;
3
- export default _default;