gl-draw 0.8.24 → 0.8.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/CSSRenderer/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.module.js +1 -1
- package/dist/objects/index.js +2 -2
- package/dist/objects/index.module.js +2 -2
- package/dist/objects/node/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +1 -1
- package/package.json +1 -1
- package/dist/core/CSSRenderer/CSS2DRenderer.d.ts +0 -17
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer';
|
|
3
|
-
import { CSS2DRenderer } from '
|
|
3
|
+
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
4
4
|
export interface CSSRendererParams {
|
|
5
5
|
zIndex: string;
|
|
6
6
|
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){var xe={187:function(R){"use strict";var j=typeof Reflect=="object"?Reflect:null,_=j&&typeof j.apply=="function"?j.apply:function(o,l,d){return Function.prototype.apply.call(o,l,d)},D;j&&typeof j.ownKeys=="function"?D=j.ownKeys:Object.getOwnPropertySymbols?D=function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:D=function(o){return Object.getOwnPropertyNames(o)};function T(a){console&&console.warn&&console.warn(a)}var L=Number.isNaN||function(o){return o!==o};function h(){h.init.call(this)}R.exports=h,R.exports.once=Y,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var B=10;function k(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return B},set:function(a){if(typeof a!="number"||a<0||L(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");B=a}}),h.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||L(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this};function I(a){return a._maxListeners===void 0?h.defaultMaxListeners:a._maxListeners}h.prototype.getMaxListeners=function(){return I(this)},h.prototype.emit=function(o){for(var l=[],d=1;d<arguments.length;d++)l.push(arguments[d]);var m=o==="error",E=this._events;if(E!==void 0)m=m&&E.error===void 0;else if(!m)return!1;if(m){var w;if(l.length>0&&(w=l[0]),w instanceof Error)throw w;var K=new Error("Unhandled error."+(w?" ("+w.message+")":""));throw K.context=w,K}var oe=E[o];if(oe===void 0)return!1;if(typeof oe=="function")_(oe,this,l);else for(var F=oe.length,X=ie(oe,F),d=0;d<F;++d)_(X[d],this,l);return!0};function P(a,o,l,d){var m,E,w;if(k(l),E=a._events,E===void 0?(E=a._events=Object.create(null),a._eventsCount=0):(E.newListener!==void 0&&(a.emit("newListener",o,l.listener?l.listener:l),E=a._events),w=E[o]),w===void 0)w=E[o]=l,++a._eventsCount;else if(typeof w=="function"?w=E[o]=d?[l,w]:[w,l]:d?w.unshift(l):w.push(l),m=I(a),m>0&&w.length>m&&!w.warned){w.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(o)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=a,K.type=o,K.count=w.length,T(K)}return a}h.prototype.addListener=function(o,l){return P(this,o,l,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(o,l){return P(this,o,l,!0)};function N(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(a,o,l){var d={fired:!1,wrapFn:void 0,target:a,type:o,listener:l},m=N.bind(d);return m.listener=l,d.wrapFn=m,m}h.prototype.once=function(o,l){return k(l),this.on(o,g(this,o,l)),this},h.prototype.prependOnceListener=function(o,l){return k(l),this.prependListener(o,g(this,o,l)),this},h.prototype.removeListener=function(o,l){var d,m,E,w,K;if(k(l),m=this._events,m===void 0)return this;if(d=m[o],d===void 0)return this;if(d===l||d.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[o],m.removeListener&&this.emit("removeListener",o,d.listener||l));else if(typeof d!="function"){for(E=-1,w=d.length-1;w>=0;w--)if(d[w]===l||d[w].listener===l){K=d[w].listener,E=w;break}if(E<0)return this;E===0?d.shift():re(d,E),d.length===1&&(m[o]=d[0]),m.removeListener!==void 0&&this.emit("removeListener",o,K||l)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(o){var l,d,m;if(d=this._events,d===void 0)return this;if(d.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):d[o]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete d[o]),this;if(arguments.length===0){var E=Object.keys(d),w;for(m=0;m<E.length;++m)w=E[m],w!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(l=d[o],typeof l=="function")this.removeListener(o,l);else if(l!==void 0)for(m=l.length-1;m>=0;m--)this.removeListener(o,l[m]);return this};function W(a,o,l){var d=a._events;if(d===void 0)return[];var m=d[o];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?U(m):ie(m,m.length)}h.prototype.listeners=function(o){return W(this,o,!0)},h.prototype.rawListeners=function(o){return W(this,o,!1)},h.listenerCount=function(a,o){return typeof a.listenerCount=="function"?a.listenerCount(o):ee.call(a,o)},h.prototype.listenerCount=ee;function ee(a){var o=this._events;if(o!==void 0){var l=o[a];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?D(this._events):[]};function ie(a,o){for(var l=new Array(o),d=0;d<o;++d)l[d]=a[d];return l}function re(a,o){for(;o+1<a.length;o++)a[o]=a[o+1];a.pop()}function U(a){for(var o=new Array(a.length),l=0;l<o.length;++l)o[l]=a[l].listener||a[l];return o}function Y(a,o){return new Promise(function(l,d){function m(w){a.removeListener(o,E),d(w)}function E(){typeof a.removeListener=="function"&&a.removeListener("error",m),l([].slice.call(arguments))}x(a,o,E,{once:!0}),o!=="error"&&q(a,m,{once:!0})})}function q(a,o,l){typeof a.on=="function"&&x(a,"error",o,l)}function x(a,o,l,d){if(typeof a.on=="function")d.once?a.once(o,l):a.on(o,l);else if(typeof a.addEventListener=="function")a.addEventListener(o,function m(E){d.once&&a.removeEventListener(o,m),l(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}},666:function(R){var j=function(_){"use strict";var D=Object.prototype,T=D.hasOwnProperty,L,h=typeof Symbol=="function"?Symbol:{},B=h.iterator||"@@iterator",k=h.asyncIterator||"@@asyncIterator",I=h.toStringTag||"@@toStringTag";function P(f,s,v){return Object.defineProperty(f,s,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[s]}try{P({},"")}catch(f){P=function(s,v,S){return s[v]=S}}function N(f,s,v,S){var C=s&&s.prototype instanceof Y?s:Y,$=Object.create(C.prototype),ae=new X(S||[]);return $._invoke=w(f,v,ae),$}_.wrap=N;function g(f,s,v){try{return{type:"normal",arg:f.call(s,v)}}catch(S){return{type:"throw",arg:S}}}var W="suspendedStart",ee="suspendedYield",ie="executing",re="completed",U={};function Y(){}function q(){}function x(){}var a={};P(a,B,function(){return this});var o=Object.getPrototypeOf,l=o&&o(o(ne([])));l&&l!==D&&T.call(l,B)&&(a=l);var d=x.prototype=Y.prototype=Object.create(a);q.prototype=x,P(d,"constructor",x),P(x,"constructor",q),q.displayName=P(x,I,"GeneratorFunction");function m(f){["next","throw","return"].forEach(function(s){P(f,s,function(v){return this._invoke(s,v)})})}_.isGeneratorFunction=function(f){var s=typeof f=="function"&&f.constructor;return s?s===q||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,x):(f.__proto__=x,P(f,I,"GeneratorFunction")),f.prototype=Object.create(d),f},_.awrap=function(f){return{__await:f}};function E(f,s){function v($,ae,J,ue){var se=g(f[$],f,ae);if(se.type==="throw")ue(se.arg);else{var me=se.arg,pe=me.value;return pe&&typeof pe=="object"&&T.call(pe,"__await")?s.resolve(pe.__await).then(function(ce){v("next",ce,J,ue)},function(ce){v("throw",ce,J,ue)}):s.resolve(pe).then(function(ce){me.value=ce,J(me)},function(ce){return v("throw",ce,J,ue)})}}var S;function C($,ae){function J(){return new s(function(ue,se){v($,ae,ue,se)})}return S=S?S.then(J,J):J()}this._invoke=C}m(E.prototype),P(E.prototype,k,function(){return this}),_.AsyncIterator=E,_.async=function(f,s,v,S,C){C===void 0&&(C=Promise);var $=new E(N(f,s,v,S),C);return _.isGeneratorFunction(s)?$:$.next().then(function(ae){return ae.done?ae.value:$.next()})};function w(f,s,v){var S=W;return function($,ae){if(S===ie)throw new Error("Generator is already running");if(S===re){if($==="throw")throw ae;return le()}for(v.method=$,v.arg=ae;;){var J=v.delegate;if(J){var ue=K(J,v);if(ue){if(ue===U)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(S===W)throw S=re,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);S=ie;var se=g(f,s,v);if(se.type==="normal"){if(S=v.done?re:ee,se.arg===U)continue;return{value:se.arg,done:v.done}}else se.type==="throw"&&(S=re,v.method="throw",v.arg=se.arg)}}}function K(f,s){var v=f.iterator[s.method];if(v===L){if(s.delegate=null,s.method==="throw"){if(f.iterator.return&&(s.method="return",s.arg=L,K(f,s),s.method==="throw"))return U;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return U}var S=g(v,f.iterator,s.arg);if(S.type==="throw")return s.method="throw",s.arg=S.arg,s.delegate=null,U;var C=S.arg;if(!C)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,U;if(C.done)s[f.resultName]=C.value,s.next=f.nextLoc,s.method!=="return"&&(s.method="next",s.arg=L);else return C;return s.delegate=null,U}m(d),P(d,I,"Generator"),P(d,B,function(){return this}),P(d,"toString",function(){return"[object Generator]"});function oe(f){var s={tryLoc:f[0]};1 in f&&(s.catchLoc=f[1]),2 in f&&(s.finallyLoc=f[2],s.afterLoc=f[3]),this.tryEntries.push(s)}function F(f){var s=f.completion||{};s.type="normal",delete s.arg,f.completion=s}function X(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(oe,this),this.reset(!0)}_.keys=function(f){var s=[];for(var v in f)s.push(v);return s.reverse(),function S(){for(;s.length;){var C=s.pop();if(C in f)return S.value=C,S.done=!1,S}return S.done=!0,S}};function ne(f){if(f){var s=f[B];if(s)return s.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,S=function C(){for(;++v<f.length;)if(T.call(f,v))return C.value=f[v],C.done=!1,C;return C.value=L,C.done=!0,C};return S.next=S}}return{next:le}}_.values=ne;function le(){return{value:L,done:!0}}return X.prototype={constructor:X,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=L,this.done=!1,this.delegate=null,this.method="next",this.arg=L,this.tryEntries.forEach(F),!f)for(var s in this)s.charAt(0)==="t"&&T.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=L)},stop:function(){this.done=!0;var f=this.tryEntries[0],s=f.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function v(ue,se){return $.type="throw",$.arg=f,s.next=ue,se&&(s.method="next",s.arg=L),!!se}for(var S=this.tryEntries.length-1;S>=0;--S){var C=this.tryEntries[S],$=C.completion;if(C.tryLoc==="root")return v("end");if(C.tryLoc<=this.prev){var ae=T.call(C,"catchLoc"),J=T.call(C,"finallyLoc");if(ae&&J){if(this.prev<C.catchLoc)return v(C.catchLoc,!0);if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else if(ae){if(this.prev<C.catchLoc)return v(C.catchLoc,!0)}else if(J){if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,s){for(var v=this.tryEntries.length-1;v>=0;--v){var S=this.tryEntries[v];if(S.tryLoc<=this.prev&&T.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var C=S;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=s&&s<=C.finallyLoc&&(C=null);var $=C?C.completion:{};return $.type=f,$.arg=s,C?(this.method="next",this.next=C.finallyLoc,U):this.complete($)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),U},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var v=this.tryEntries[s];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),F(v),U}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var v=this.tryEntries[s];if(v.tryLoc===f){var S=v.completion;if(S.type==="throw"){var C=S.arg;F(v)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,v){return this.delegate={iterator:ne(f),resultName:s,nextLoc:v},this.method==="next"&&(this.arg=L),U}},_}(R.exports);try{regeneratorRuntime=j}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(R,j,_){"use strict";_.d(j,{Z:function(){return D}});function D(T){if(T.geometry&&T.geometry.dispose(),T.material){var L=Array.isArray(T.material)?T.material:[T.material];L.forEach(function(h){var B,k,I,P,N,g,W,ee,ie,re,U,Y,q;(B=h.map)===null||B===void 0||B.dispose(),(k=h.lightMap)===null||k===void 0||k.dispose(),(I=h.bumpMap)===null||I===void 0||I.dispose(),(P=h.normalMap)===null||P===void 0||P.dispose(),(N=h.specularMap)===null||N===void 0||N.dispose(),(g=h.envMap)===null||g===void 0||g.dispose(),(W=h.alphaMap)===null||W===void 0||W.dispose(),(ee=h.aoMap)===null||ee===void 0||ee.dispose(),(ie=h.displacementMap)===null||ie===void 0||ie.dispose(),(re=h.emissiveMap)===null||re===void 0||re.dispose(),(U=h.gradientMap)===null||U===void 0||U.dispose(),(Y=h.metalnessMap)===null||Y===void 0||Y.dispose(),(q=h.roughnessMap)===null||q===void 0||q.dispose(),h.dispose()})}}},584:function(R,j,_){"use strict";_.d(j,{disposeMesh:function(){return h.Z},isPlainObject:function(){return I.Z}});var D=_(666),T=_.n(D),L=null,h=_(695),B=_(644);function k(Y){if(Y.material){var q=Array.isArray(Y.material)?Y.material:[Y.material];q.forEach(function(x){var a,o;(a=x.color)===null||a===void 0||a.convertSRGBToLinear(),(o=x.emissive)===null||o===void 0||o.convertSRGBToLinear(),x.map&&(x.map.encoding=THREE.sRGBEncoding),x.emissiveMap&&(x.emissiveMap.encoding=THREE.sRGBEncoding)})}}var I=_(738),P=_(568),N=_(924),g=_(360),W=_(484),ee=null,ie=null,re=function(){var Y=(0,P.Z)(T().mark(function q(x,a){var o,l,d,m,E,w,K,oe,F;return T().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return o=a.type,l=o===void 0?"blob":o,d=a.version,m=d===void 0?"1":d,ne.next=4,(0,g.get)(x);case 4:if(w=ne.sent,!(w&&w[m])){ne.next=9;break}E=w[m],ne.next=15;break;case 9:return ne.next=11,(0,W.Z)(fetch(x).then(function(le){if(le.ok)return le[l]();throw new Error}));case 11:K=ne.sent,oe=K.res,F=K.err,F||(E=oe,(0,g.set)(x,(0,N.Z)({},m,oe)));case 15:return ne.abrupt("return",E?{url:l==="json"?x:URL.createObjectURL(E),store:E}:{url:x});case 16:case"end":return ne.stop()}},q)}));return function(x,a){return Y.apply(this,arguments)}}(),U=_(705)},738:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});function D(L){return Object.prototype.toString.call(L)==="[object Object]"}function T(L){if(D(L)===!1)return!1;var h=L.constructor;if(h===void 0)return!0;var B=h.prototype;return!(D(B)===!1||B.hasOwnProperty("isPrototypeOf")===!1)}},484:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});var D=_(42);function T(L){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L.then(function(B){return(0,D.Z)({err:null,res:B},h)}).catch(function(B){return(0,D.Z)({err:B,res:void 0},h)})}},705:function(R,j,_){"use strict";var D=_(644),T=_.n(D),L=new Map,h=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(I,P,N,g,W){var ee=P[N*3],ie=P[N*3+1],re=P[g*3],U=P[g*3+1],Y=P[W*3],q=P[W*3+1],x;if(L.has(I))x=L.get(I);else{var a=k.box3||new THREE.Box3;if(!k.box3){var o=I.parameters.shapes.getPoints();a.setFromArray(o.map(function(w){return[w.x,w.y,0]}).flat())}var l=a.getSize(new THREE.Vector3);k.split&&(l.y/=k.split),x={box:a,size:l},L.set(I,x)}var d=x.box,m=x.size,E=k.split?1-k.split:0;return[new THREE.Vector2((ee-d.min.x)/m.x,(ie-d.min.y)/m.y+E),new THREE.Vector2((re-d.min.x)/m.x,(U-d.min.y)/m.y+E),new THREE.Vector2((Y-d.min.x)/m.x,(q-d.min.y)/m.y+E)]},generateSideWallUV:function(I,P,N,g,W,ee){var ie=P[N*3],re=P[N*3+1],U=P[N*3+2],Y=P[g*3],q=P[g*3+1],x=P[g*3+2],a=P[W*3],o=P[W*3+1],l=P[W*3+2],d=P[ee*3],m=P[ee*3+1],E=P[ee*3+2],w;if(L.has(P))w=L.get(P);else{var K=new THREE.Box3;K.setFromArray(P);var oe=K.getSize(new THREE.Vector3);k.split&&(oe.z/=1-k.split),w={box:K,size:oe},L.set(P,w)}var F=w.box,X=w.size;return Math.abs(re-q)<Math.abs(ie-Y)?[new THREE.Vector2((ie-F.min.x)/X.x,(U-F.min.z)/X.z),new THREE.Vector2((Y-F.min.x)/X.x,(x-F.min.z)/X.z),new THREE.Vector2((a-F.min.x)/X.x,(l-F.min.z)/X.z),new THREE.Vector2((d-F.min.x)/X.x,(E-F.min.z)/X.z)]:[new THREE.Vector2((re-F.min.y)/X.y,(U-F.min.z)/X.z),new THREE.Vector2((q-F.min.y)/X.y,(x-F.min.z)/X.z),new THREE.Vector2((o-F.min.y)/X.y,(l-F.min.z)/X.z),new THREE.Vector2((m-F.min.y)/X.y,(E-F.min.z)/X.z)]}}},B=function(){L.clear()}},360:function(R){"use strict";R.exports=require("idb-keyval")},644:function(R){"use strict";R.exports=require("three")},568:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});function D(L,h,B,k,I,P,N){try{var g=L[P](N),W=g.value}catch(ee){B(ee);return}g.done?h(W):Promise.resolve(W).then(k,I)}function T(L){return function(){var h=this,B=arguments;return new Promise(function(k,I){var P=L.apply(h,B);function N(W){D(P,k,I,N,g,"next",W)}function g(W){D(P,k,I,N,g,"throw",W)}N(void 0)})}}},924:function(R,j,_){"use strict";_.d(j,{Z:function(){return D}});function D(T,L,h){return L in T?Object.defineProperty(T,L,{value:h,enumerable:!0,configurable:!0,writable:!0}):T[L]=h,T}},42:function(R,j,_){"use strict";_.d(j,{Z:function(){return T}});var D=_(924);function T(L){for(var h=1;h<arguments.length;h++){var B=arguments[h]!=null?arguments[h]:{},k=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(k=k.concat(Object.getOwnPropertySymbols(B).filter(function(I){return Object.getOwnPropertyDescriptor(B,I).enumerable}))),k.forEach(function(I){(0,D.Z)(L,I,B[I])})}return L}}},we={};function te(R){var j=we[R];if(j!==void 0)return j.exports;var _=we[R]={exports:{}};return xe[R](_,_.exports,te),_.exports}(function(){te.n=function(R){var j=R&&R.__esModule?function(){return R.default}:function(){return R};return te.d(j,{a:j}),j}})(),function(){te.d=function(R,j){for(var _ in j)te.o(j,_)&&!te.o(R,_)&&Object.defineProperty(R,_,{enumerable:!0,get:j[_]})}}(),function(){te.o=function(R,j){return Object.prototype.hasOwnProperty.call(R,j)}}(),function(){te.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";te.r(ye),te.d(ye,{BaseObject:function(){return Me},GUIObject:function(){return x},Pencil:function(){return be},default:function(){return be}});function R(u,i){if(!(u instanceof i))throw new TypeError("Cannot call a class as a function")}function j(u,i){for(var t=0;t<i.length;t++){var e=i[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(u,e.key,e)}}function _(u,i,t){return i&&j(u.prototype,i),t&&j(u,t),u}var D=te(42);function T(u,i){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(u);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),t.push.apply(t,e)}return t}function L(u,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(i)):T(Object(i)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(i,t))}),u}function h(u,i){(i==null||i>u.length)&&(i=u.length);for(var t=0,e=new Array(i);t<i;t++)e[t]=u[t];return e}function B(u){if(Array.isArray(u))return h(u)}function k(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function I(){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 P(u,i){if(!!u){if(typeof u=="string")return h(u,i);var t=Object.prototype.toString.call(u).slice(8,-1);if(t==="Object"&&u.constructor&&(t=u.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(u,i)}}function N(u){return B(u)||k(u)||P(u)||I()}var g=te(644),W=te(187),ee=require("deepmerge"),ie=te.n(ee),re=require("three/examples/jsm/libs/stats.module"),U=te.n(re),Y=require("lil-gui"),q=te.n(Y),x=function(){"use strict";function u(t){R(this,u),this.guiParams={},t&&(this.guiParams=t)}var i=u.prototype;return i.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(n){var c=e.addFolder(n),p=r.guiParams[n];Object.keys(p).forEach(function(y){var b=p[y],A=b.min,z=b.max,G=b.step,O=b.name,M=b.paramMap,H=b.items,Q=b.value,Z=b.target,fe=y.toLowerCase().indexOf("color")>-1,V,de=typeof Q=="undefined"&&Z,he=de?Z():p[y],ve=de?y:"value";H?V=c.add(he,ve,H):fe?V=c.addColor(he,ve):V=c.add(he,ve),V=V.name(O||y),typeof A!="undefined"&&(V=V.min(A)),typeof z!="undefined"&&(V=V.max(z)),typeof G!="undefined"&&(V=V.step(G)),V=V.onChange(function(){r.setTargetValue(n,y,he[ve],M)}),de&&V.listen()})})},i.setTargetValue=function(e,r,n,c){var p=this.guiParams[e][r],y=p.onChange,b=p.target,A=p.value,z=r.toLowerCase().indexOf("color")>-1,G=typeof A=="undefined"&&b;if(b&&!G){var O=b();Array.isArray(O)||(O=[O]),O.forEach(function(M){if(!!M)if(z)try{M[c||r].set(n)}catch(H){r!=="color"&&!c&&console.warn("".concat(r," is not a color,set paramMap"))}else M[c||r]=n})}y&&y(n)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(n){var c=e.guiParams[r][n];typeof c.value!="undefined"&&e.setTargetValue(r,n,c.value,c.paramMap)})})},u}(),a={None:g.NoToneMapping,Linear:g.LinearToneMapping,Reinhard:g.ReinhardToneMapping,Cineon:g.CineonToneMapping,ACESFilmic:g.ACESFilmicToneMapping},o={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:g.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},l=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.width,r=t.height,n=t.rendererParams,c=n.context,p=n.alpha,y=n.devicePixelRatio,b=n.antialias,A=n.powerPreference,z=n.toneMapping,G=n.toneMappingExposure,O=n.outputEncoding,M=n.logarithmicDepthBuffer,H=n.preserveDrawingBuffer,Q=n.stencil,Z=n.depth,fe=n.physicallyCorrectLights,V=new g.WebGLRenderer({context:c,alpha:p,antialias:b,powerPreference:A,logarithmicDepthBuffer:M,preserveDrawingBuffer:H,stencil:Q,depth:Z});V.setSize(e,r),V.setPixelRatio(y),V.toneMapping=a[z],V.toneMappingExposure=G,V.outputEncoding=O,V.physicallyCorrectLights=fe,this.renderer=V}var i=u.prototype;return i.setSize=function(e,r){this.renderer.setSize(e,r)},i.render=function(){var e=this.options,r=e.scene,n=e.camera;this.renderer.render(r,n)},i.setGui=function(e){var r=this,n=new x({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:a,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});n.showGui(e)},i.dispose=function(){var e,r,n;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(n=this.renderer)===null||n===void 0||n.renderLists.dispose()},u}(),d={fov:45,near:1,far:1e3},m=function(){"use strict";function u(t){R(this,u),this.oldCameraPosition=new g.Vector3,this.oldCameraRotation=new g.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,n=t.cameraParams;if(n instanceof g.Camera)this.camera=n,this.customCamera=!0;else{var c=n.fov,p=n.far,y=n.near,b=new g.PerspectiveCamera(c,e/r,y,p);b.position.set(0,0,400),b.lookAt(0,0,0),this.camera=b}}var i=u.prototype;return i.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},i.setSize=function(e,r){this.camera instanceof g.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},i.setGui=function(e){var r=this,n=new x({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}}});this.camera instanceof g.PerspectiveCamera&&(n.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}),n.showGui(e)},u}(),E=te(584),w={background:null},K=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.camera,r=t.sceneParams,n=r.background,c=new g.Scene;n&&(c.background=n),c.add(e),this.scene=c}var i=u.prototype;return i.addAxesHelper=function(){var e,r=new g.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,E.disposeMesh)(r)})},u}(),oe=require("three/examples/jsm/controls/OrbitControls"),F={},X=function(){"use strict";function u(t){R(this,u),this.options=t;var e=t.camera,r=t.controlParams,n=t.mapControl,c=r.domElement,p=n?new oe.MapControls(e,c):new oe.OrbitControls(e,c);p.minPolarAngle=Math.PI*.15,p.maxPolarAngle=Math.PI*.85,p.enableDamping=!0,p.dampingFactor=.063,p.autoRotate=!1,p.autoRotateSpeed=-60,p.enableZoom=!0,p.zoomSpeed=.2,this.control=p}var i=u.prototype;return i.limitPan=function(e){var r=e.maxX,n=r===void 0?1/0:r,c=e.minX,p=c===void 0?-1/0:c,y=e.maxZ,b=y===void 0?1/0:y,A=e.minZ,z=A===void 0?-1/0:A,G=e.maxY,O=G===void 0?1/0:G,M=e.minY,H=M===void 0?-1/0:M,Q=this.limitPanV||new g.Vector3,Z=this.control,fe=this.options.camera,V=new g.Vector3(p,H,z),de=new g.Vector3(n,O,b);this.limitPanV=Q,Q.copy(Z.target),Z.target.clamp(V,de),Q.sub(Z.target),fe.position.sub(Q)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},u}(),ne=require("three/examples/jsm/renderers/CSS3DRenderer"),le=new g.Vector3,f=new g.Matrix4,s=new g.Matrix4,v=new g.Vector3,S=new g.Vector3,C=function u(){"use strict";var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};R(this,u);var t=function(M,H){return v.setFromMatrixPosition(M.matrixWorld),S.setFromMatrixPosition(H.matrixWorld),v.distanceToSquared(S)},e=function(M){var H=[];return M.traverse(function(Q){Q.isCSS2DObject&&H.push(Q)}),H},r=function(M){for(var H=e(M).sort(function(de,he){if(de.renderOrder!==he.renderOrder)return he.renderOrder-de.renderOrder;var ve=A.objects.get(de).distanceToCameraSquared,ze=A.objects.get(he).distanceToCameraSquared;return ve-ze}),Q=H.length,Z=0,fe=H.length;Z<fe;Z++){var V=H[Z].userData.zIndexFix||0;H[Z].element.style.zIndex=Q-Z+V}},n=this,c,p,y,b,A={objects:new WeakMap},z=i.element!==void 0?i.element:document.createElement("div");z.style.overflow="hidden",this.domElement=z,this.getSize=function(){return{width:c,height:p}},this.render=function(O,M){+g.REVISION<144?(O.autoUpdate===!0&&O.updateMatrixWorld(),M.parent===null&&M.updateMatrixWorld()):(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),M.parent===null&&M.matrixWorldAutoUpdate===!0&&M.updateMatrixWorld()),f.copy(M.matrixWorldInverse),s.multiplyMatrices(M.projectionMatrix,f),G(O,O,M),r(O)},this.setSize=function(O,M){c=O,p=M,y=c/2,b=p/2,z.style.width="".concat(O,"px"),z.style.height="".concat(M,"px")};function G(O,M,H){if(O.isCSS2DObject){le.setFromMatrixPosition(O.matrixWorld),le.applyMatrix4(s);var Q=O.visible===!0&&le.z>=-1&&le.z<=1&&O.layers.test(H.layers)===!0;if(O.element.style.display=Q===!0?"":"none",Q===!0){O.onBeforeRender(n,M,H);var Z=O.element;Z.style.transform="translate(-50%,-50%) translate(".concat(le.x*y+y,"px,").concat(-le.y*b+b,"px)"),Z.parentNode!==z&&z.appendChild(Z),O.onAfterRender(n,M,H)}var fe={distanceToCameraSquared:t(H,O)};A.objects.set(O,fe)}for(var V=0,de=O.children.length;V<de;V++)G(O.children[V],M,H)}},$={zIndex:"auto"},ae=function(){"use strict";function u(t){R(this,u),this.container=t}var i=u.prototype;return i.addRenderer=function(e,r){var n=this.container,c=n.offsetWidth,p=n.offsetHeight,y=e==="css2d"?new C:new ne.CSS3DRenderer;y.domElement.style.position="absolute",y.domElement.style.top="0",y.domElement.style.pointerEvents="none",y.domElement.style.zIndex=r.zIndex,y.setSize(c,p),n.appendChild(y.domElement),e==="css2d"?this.css2Drenderer=y:e==="css3d"&&(this.css3Drenderer=y)},i.setSize=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.setSize(e,r),(c=this.css3Drenderer)===null||c===void 0||c.setSize(e,r)},i.render=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.render(e,r),(c=this.css3Drenderer)===null||c===void 0||c.render(e,r)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},u}(),J=require("postprocessing"),ue={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},se=function(){"use strict";function u(t){R(this,u),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,n=t.camera,c=t.composerParams,p=c.multisampling,y=e.capabilities.maxSamples,b=new J.EffectComposer(e,{multisampling:Math.min(p,y)});b.addPass(new J.RenderPass(r,n)),this.finalComposer=b,this.renderer=e,this.scene=r,this.camera=n}var i=u.prototype;return i.addCopyPass=function(){var e=new J.CopyPass;e.renderToScreen=!0,this.finalComposer.addPass(e),this.copyPass=e},i.addFXAAPass=function(){var e=this.camera,r=new J.FXAAEffect({blendFunction:J.BlendFunction.NORMAL}),n=new J.EffectPass(e,r);this.finalComposer.addPass(n),this.fxaaPass=n},i.addBloomPass=function(e){var r=this,n=r.camera,c=r.scene,p=new J.SelectiveBloomEffect(c,n,(0,D.Z)({},e)),y=new J.EffectPass(n,p);y.enabled=!1,this.finalComposer.addPass(y),this.bloomPass=y,this.bloomEffect=p},i.addBloomGui=function(e){var r=this;if(!!this.bloomEffect){var n=new x({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(c){r.bloomEffect.luminancePass.enabled=c}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});n.showGui(e)}},i.toggleBloomSelection=function(e){if(!this.bloomEffect||!this.bloomPass){console.warn("err:pencil.options.bloom");return}this.bloomEffect.selection.toggle(e),this.bloomPass.enabled=!!this.bloomEffect.selection.size},i.getSize=function(){var e=this.options.renderer;return e.getSize(new g.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.setSize=function(e,r){this.finalComposer.setSize(e,r)},i.render=function(){!this.active||this.finalComposer.render()},i.dispose=function(){this.finalComposer.dispose()},u}(),me=function(){try{var u=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&u.getContext("webgl2"))}catch(i){return!1}},pe=0,ce=!1,Pe=me()!==!1,be=function(){"use strict";function u(t){R(this,u),this.raycaster=new g.Raycaster,this.installPlugins=new Map,this.event=new W.EventEmitter,this.clock=new g.Clock,this.userData={},this.options=ie()(u.options,t,{isMergeableObject:E.isPlainObject});var e=this.options,r=e.container,n=e.stats,c=e.gui,p=e.resizeObserver;if(c){var y=new(q());y.open(!1),this.gui=y}if(n){var b=new(U());b.showPanel(0),b.dom.style.position="absolute",r.appendChild(b.dom),this.stats=b}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),p&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=u.prototype;return i.use=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),c=1;c<r;c++)n[c-1]=arguments[c];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var p;(p=e).install.apply(p,[this].concat(N(n))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,r=e.container,n=e.isdev,c=e.axesHelper,p=e.renderer,y=e.scene,b=e.camera,A=this.getSize(),z=A.width,G=A.height,O=new m({isdev:n,width:z,height:G,cameraParams:b});this.gui&&O.setGui(this.gui);var M=O.camera,H=new K({camera:M,sceneParams:y}),Q=H.scene,Z=new l({width:z,height:G,scene:Q,camera:M,isdev:n,rendererParams:L((0,D.Z)({},p),{antialias:!1})});this.gui&&Z.setGui(this.gui);var fe=Z.renderer;c&&H.addAxesHelper(),this.sceneController=H,this.rendererController=Z,this.cameraController=O,r.appendChild(fe.domElement)},i.initComposer=function(){var e=this.options,r=e.bloom,n=e.bloomParams,c=e.renderer,p=e.multisampling,y=e.passes,b=c.antialias;b==="msaa"&&!Pe&&(b=!1,console.warn("MSAA is not supported on this browser"));var A=new se({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:b==="msaa"?p:0,type:g.UnsignedByteType,encoding:c.outputEncoding}});this.composerController=A,r&&(A.addBloomPass(n),this.gui&&A.addBloomGui(this.gui)),b==="fxaa"&&A.addFXAAPass(),y&&y.forEach(function(z){A.finalComposer.addPass(z)}),A.addCopyPass()},i.initCSSRenderer=function(){var e=this.options,r=e.container,n=e.css2DRenderer,c=e.css3DRenderer,p=e.css2DRendererParams,y=e.css3DRendererParams;if(n||c){var b=new ae(r);n&&b.addRenderer("css2d",p),c&&b.addRenderer("css3d",y),this.cssRendererController=b}},i.initControl=function(){var e=this.options,r=e.control,n=e.mapControl,c=e.controlParams;if(r){var p=new X({camera:this.camera,controlParams:{domElement:(c==null?void 0:c.domElement)||this.renderer.domElement},mapControl:n});this.controlController=p}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var n=new ResizeObserver(function(c){var p=!0,y=!1,b=void 0;try{for(var A=c[Symbol.iterator](),z;!(p=(z=A.next()).done);p=!0){var G=z.value,O=G.contentRect;e.handeleResize(O.width,O.height),e.render()}}catch(M){y=!0,b=M}finally{try{!p&&A.return!=null&&A.return()}finally{if(y)throw b}}});n.observe(r),this.resizeObserver=n}},i.handeleResize=function(e,r){var n=this,c=n.rendererController,p=n.cameraController,y=n.composerController,b=n.cssRendererController;p==null||p.setSize(e,r),c==null||c.setSize(e,r),y==null||y.setSize(e,r),b==null||b.setSize(e,r),this.installPlugins.forEach(function(A,z){var G;(G=z.setSize)===null||G===void 0||G.call(z,e,r)}),this.event.emit("resize",{width:e,height:r})},i.pick=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=this,p=c.raycaster,y=c.options,b=y.container,A=new g.Vector2,z=b.getBoundingClientRect();if(A.x=(e.clientX-z.left)/(z.right-z.left)*2-1,A.y=-((e.clientY-z.top)/(z.bottom-z.top))*2+1,this.camera&&this.scene){p.setFromCamera(A,this.camera);var G=p.intersectObjects(r||this.scene.children,n);if(G.length)return{object:G[0].object,intersects:G}}},i.render=function(){var e,r,n,c,p=this,y=p.renderer,b=p.scene,A=p.camera,z=p.clock;if(!(!y||!b||!A||this.options.staticRender&&!this.cameraController.checkCameraChange())){var G=z.getDelta(),O=z.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(H,Q){var Z;(Z=Q.update)===null||Z===void 0||Z.call(Q,G,O)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var M;(M=this.rendererController)===null||M===void 0||M.render()}(n=this.cssRendererController)===null||n===void 0||n.render(b,A),(c=this.stats)===null||c===void 0||c.update(),this.event.emit("render",{delta:G,elapsed:O})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,r,n,c,p,y,b;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(A,z){var G;(G=z.dispose)===null||G===void 0||G.call(z)}),(r=this.controlController)===null||r===void 0||r.dispose(),(n=this.cssRendererController)===null||n===void 0||n.dispose(),(c=this.sceneController)===null||c===void 0||c.dispose(),(p=this.composerController)===null||p===void 0||p.dispose(),(y=this.rendererController)===null||y===void 0||y.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(b=this.gui)===null||b===void 0||b.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},_(u,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),u}();be.options={isdev:ce,stats:ce,gui:ce,axesHelper:ce,control:ce,resizeObserver:!0,renderer:L((0,D.Z)({},o),{antialias:Pe?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:w,camera:d,bloom:!1,bloomParams:ue,css2DRenderer:!1,css2DRendererParams:(0,D.Z)({},$),css3DRenderer:!1,css3DRendererParams:(0,D.Z)({},$)};function _e(u,i){return _e=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},_e(u,i)}function Se(u,i){return _e(u,i)}function Oe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(u){return!1}}function ge(u,i,t){return Oe()?ge=Reflect.construct:ge=function(r,n,c){var p=[null];p.push.apply(p,n);var y=Function.bind.apply(r,p),b=new y;return c&&Se(b,c.prototype),b},ge.apply(null,arguments)}function Ce(u,i,t){return ge.apply(null,arguments)}var Le=te(484);function Re(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),u&&(t.promise=(0,Le.Z)(t.promise,i)),t}var je=require("three/examples/jsm/renderers/CSS2DRenderer"),Ee=function(u){u&&((0,E.disposeMesh)(u),u.children.forEach(function(i){i.userData.BaseObject_||Ee(i)}))},Me=function(){"use strict";function u(){R(this,u),this.objecttype__="BaseObject",this.userData={},this.pm=Re(),this.visible=!1}var i=u.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,r){},i.resize=function(e,r){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=Ce(g.Mesh,N(r)),this},i.createGroup=function(){return this.object3d=new g.Group,this},i.createPoints=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=Ce(g.Points,N(r)),this},i.createCSS2DObject=function(e){return this.object3d=new je.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ne.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ne.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new g.Sprite(e),this},i.add=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).add.apply(c,N(r)),this},i.remove=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).remove.apply(c,N(r)),this},i.getSize=function(){var e=new g.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new g.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},i.dispose=function(){Ee(this.object3d)},_(u,[{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})}}]),u}()})(),module.exports=ye})();
|
|
1
|
+
(function(){var Pe={187:function(j){"use strict";var L=typeof Reflect=="object"?Reflect:null,_=L&&typeof L.apply=="function"?L.apply:function(o,l,h){return Function.prototype.apply.call(o,l,h)},M;L&&typeof L.ownKeys=="function"?M=L.ownKeys:Object.getOwnPropertySymbols?M=function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:M=function(o){return Object.getOwnPropertyNames(o)};function R(a){console&&console.warn&&console.warn(a)}var x=Number.isNaN||function(o){return o!==o};function p(){p.init.call(this)}j.exports=p,j.exports.once=Z,p.EventEmitter=p,p.prototype._events=void 0,p.prototype._eventsCount=0,p.prototype._maxListeners=void 0;var T=10;function D(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return T},set:function(a){if(typeof a!="number"||a<0||x(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");T=a}}),p.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},p.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||x(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this};function G(a){return a._maxListeners===void 0?p.defaultMaxListeners:a._maxListeners}p.prototype.getMaxListeners=function(){return G(this)},p.prototype.emit=function(o){for(var l=[],h=1;h<arguments.length;h++)l.push(arguments[h]);var m=o==="error",E=this._events;if(E!==void 0)m=m&&E.error===void 0;else if(!m)return!1;if(m){var w;if(l.length>0&&(w=l[0]),w instanceof Error)throw w;var F=new Error("Unhandled error."+(w?" ("+w.message+")":""));throw F.context=w,F}var ne=E[o];if(ne===void 0)return!1;if(typeof ne=="function")_(ne,this,l);else for(var V=ne.length,H=re(ne,V),h=0;h<V;++h)_(H[h],this,l);return!0};function P(a,o,l,h){var m,E,w;if(D(l),E=a._events,E===void 0?(E=a._events=Object.create(null),a._eventsCount=0):(E.newListener!==void 0&&(a.emit("newListener",o,l.listener?l.listener:l),E=a._events),w=E[o]),w===void 0)w=E[o]=l,++a._eventsCount;else if(typeof w=="function"?w=E[o]=h?[l,w]:[w,l]:h?w.unshift(l):w.push(l),m=G(a),m>0&&w.length>m&&!w.warned){w.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(o)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=a,F.type=o,F.count=w.length,R(F)}return a}p.prototype.addListener=function(o,l){return P(this,o,l,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(o,l){return P(this,o,l,!0)};function B(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(a,o,l){var h={fired:!1,wrapFn:void 0,target:a,type:o,listener:l},m=B.bind(h);return m.listener=l,h.wrapFn=m,m}p.prototype.once=function(o,l){return D(l),this.on(o,b(this,o,l)),this},p.prototype.prependOnceListener=function(o,l){return D(l),this.prependListener(o,b(this,o,l)),this},p.prototype.removeListener=function(o,l){var h,m,E,w,F;if(D(l),m=this._events,m===void 0)return this;if(h=m[o],h===void 0)return this;if(h===l||h.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[o],m.removeListener&&this.emit("removeListener",o,h.listener||l));else if(typeof h!="function"){for(E=-1,w=h.length-1;w>=0;w--)if(h[w]===l||h[w].listener===l){F=h[w].listener,E=w;break}if(E<0)return this;E===0?h.shift():Q(h,E),h.length===1&&(m[o]=h[0]),m.removeListener!==void 0&&this.emit("removeListener",o,F||l)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(o){var l,h,m;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[o]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[o]),this;if(arguments.length===0){var E=Object.keys(h),w;for(m=0;m<E.length;++m)w=E[m],w!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(l=h[o],typeof l=="function")this.removeListener(o,l);else if(l!==void 0)for(m=l.length-1;m>=0;m--)this.removeListener(o,l[m]);return this};function I(a,o,l){var h=a._events;if(h===void 0)return[];var m=h[o];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?N(m):re(m,m.length)}p.prototype.listeners=function(o){return I(this,o,!0)},p.prototype.rawListeners=function(o){return I(this,o,!1)},p.listenerCount=function(a,o){return typeof a.listenerCount=="function"?a.listenerCount(o):$.call(a,o)},p.prototype.listenerCount=$;function $(a){var o=this._events;if(o!==void 0){var l=o[a];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?M(this._events):[]};function re(a,o){for(var l=new Array(o),h=0;h<o;++h)l[h]=a[h];return l}function Q(a,o){for(;o+1<a.length;o++)a[o]=a[o+1];a.pop()}function N(a){for(var o=new Array(a.length),l=0;l<o.length;++l)o[l]=a[l].listener||a[l];return o}function Z(a,o){return new Promise(function(l,h){function m(w){a.removeListener(o,E),h(w)}function E(){typeof a.removeListener=="function"&&a.removeListener("error",m),l([].slice.call(arguments))}O(a,o,E,{once:!0}),o!=="error"&&W(a,m,{once:!0})})}function W(a,o,l){typeof a.on=="function"&&O(a,"error",o,l)}function O(a,o,l,h){if(typeof a.on=="function")h.once?a.once(o,l):a.on(o,l);else if(typeof a.addEventListener=="function")a.addEventListener(o,function m(E){h.once&&a.removeEventListener(o,m),l(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}},666:function(j){var L=function(_){"use strict";var M=Object.prototype,R=M.hasOwnProperty,x,p=typeof Symbol=="function"?Symbol:{},T=p.iterator||"@@iterator",D=p.asyncIterator||"@@asyncIterator",G=p.toStringTag||"@@toStringTag";function P(f,s,d){return Object.defineProperty(f,s,{value:d,enumerable:!0,configurable:!0,writable:!0}),f[s]}try{P({},"")}catch(f){P=function(s,d,S){return s[d]=S}}function B(f,s,d,S){var C=s&&s.prototype instanceof Z?s:Z,X=Object.create(C.prototype),oe=new H(S||[]);return X._invoke=w(f,d,oe),X}_.wrap=B;function b(f,s,d){try{return{type:"normal",arg:f.call(s,d)}}catch(S){return{type:"throw",arg:S}}}var I="suspendedStart",$="suspendedYield",re="executing",Q="completed",N={};function Z(){}function W(){}function O(){}var a={};P(a,T,function(){return this});var o=Object.getPrototypeOf,l=o&&o(o(ee([])));l&&l!==M&&R.call(l,T)&&(a=l);var h=O.prototype=Z.prototype=Object.create(a);W.prototype=O,P(h,"constructor",O),P(O,"constructor",W),W.displayName=P(O,G,"GeneratorFunction");function m(f){["next","throw","return"].forEach(function(s){P(f,s,function(d){return this._invoke(s,d)})})}_.isGeneratorFunction=function(f){var s=typeof f=="function"&&f.constructor;return s?s===W||(s.displayName||s.name)==="GeneratorFunction":!1},_.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,O):(f.__proto__=O,P(f,G,"GeneratorFunction")),f.prototype=Object.create(h),f},_.awrap=function(f){return{__await:f}};function E(f,s){function d(X,oe,Y,ae){var te=b(f[X],f,oe);if(te.type==="throw")ae(te.arg);else{var fe=te.arg,de=fe.value;return de&&typeof de=="object"&&R.call(de,"__await")?s.resolve(de.__await).then(function(ce){d("next",ce,Y,ae)},function(ce){d("throw",ce,Y,ae)}):s.resolve(de).then(function(ce){fe.value=ce,Y(fe)},function(ce){return d("throw",ce,Y,ae)})}}var S;function C(X,oe){function Y(){return new s(function(ae,te){d(X,oe,ae,te)})}return S=S?S.then(Y,Y):Y()}this._invoke=C}m(E.prototype),P(E.prototype,D,function(){return this}),_.AsyncIterator=E,_.async=function(f,s,d,S,C){C===void 0&&(C=Promise);var X=new E(B(f,s,d,S),C);return _.isGeneratorFunction(s)?X:X.next().then(function(oe){return oe.done?oe.value:X.next()})};function w(f,s,d){var S=I;return function(X,oe){if(S===re)throw new Error("Generator is already running");if(S===Q){if(X==="throw")throw oe;return le()}for(d.method=X,d.arg=oe;;){var Y=d.delegate;if(Y){var ae=F(Y,d);if(ae){if(ae===N)continue;return ae}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(S===I)throw S=Q,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);S=re;var te=b(f,s,d);if(te.type==="normal"){if(S=d.done?Q:$,te.arg===N)continue;return{value:te.arg,done:d.done}}else te.type==="throw"&&(S=Q,d.method="throw",d.arg=te.arg)}}}function F(f,s){var d=f.iterator[s.method];if(d===x){if(s.delegate=null,s.method==="throw"){if(f.iterator.return&&(s.method="return",s.arg=x,F(f,s),s.method==="throw"))return N;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return N}var S=b(d,f.iterator,s.arg);if(S.type==="throw")return s.method="throw",s.arg=S.arg,s.delegate=null,N;var C=S.arg;if(!C)return s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,N;if(C.done)s[f.resultName]=C.value,s.next=f.nextLoc,s.method!=="return"&&(s.method="next",s.arg=x);else return C;return s.delegate=null,N}m(h),P(h,G,"Generator"),P(h,T,function(){return this}),P(h,"toString",function(){return"[object Generator]"});function ne(f){var s={tryLoc:f[0]};1 in f&&(s.catchLoc=f[1]),2 in f&&(s.finallyLoc=f[2],s.afterLoc=f[3]),this.tryEntries.push(s)}function V(f){var s=f.completion||{};s.type="normal",delete s.arg,f.completion=s}function H(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(ne,this),this.reset(!0)}_.keys=function(f){var s=[];for(var d in f)s.push(d);return s.reverse(),function S(){for(;s.length;){var C=s.pop();if(C in f)return S.value=C,S.done=!1,S}return S.done=!0,S}};function ee(f){if(f){var s=f[T];if(s)return s.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var d=-1,S=function C(){for(;++d<f.length;)if(R.call(f,d))return C.value=f[d],C.done=!1,C;return C.value=x,C.done=!0,C};return S.next=S}}return{next:le}}_.values=ee;function le(){return{value:x,done:!0}}return H.prototype={constructor:H,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=x,this.done=!1,this.delegate=null,this.method="next",this.arg=x,this.tryEntries.forEach(V),!f)for(var s in this)s.charAt(0)==="t"&&R.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=x)},stop:function(){this.done=!0;var f=this.tryEntries[0],s=f.completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var s=this;function d(ae,te){return X.type="throw",X.arg=f,s.next=ae,te&&(s.method="next",s.arg=x),!!te}for(var S=this.tryEntries.length-1;S>=0;--S){var C=this.tryEntries[S],X=C.completion;if(C.tryLoc==="root")return d("end");if(C.tryLoc<=this.prev){var oe=R.call(C,"catchLoc"),Y=R.call(C,"finallyLoc");if(oe&&Y){if(this.prev<C.catchLoc)return d(C.catchLoc,!0);if(this.prev<C.finallyLoc)return d(C.finallyLoc)}else if(oe){if(this.prev<C.catchLoc)return d(C.catchLoc,!0)}else if(Y){if(this.prev<C.finallyLoc)return d(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,s){for(var d=this.tryEntries.length-1;d>=0;--d){var S=this.tryEntries[d];if(S.tryLoc<=this.prev&&R.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var C=S;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=s&&s<=C.finallyLoc&&(C=null);var X=C?C.completion:{};return X.type=f,X.arg=s,C?(this.method="next",this.next=C.finallyLoc,N):this.complete(X)},complete:function(f,s){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&s&&(this.next=s),N},finish:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.finallyLoc===f)return this.complete(d.completion,d.afterLoc),V(d),N}},catch:function(f){for(var s=this.tryEntries.length-1;s>=0;--s){var d=this.tryEntries[s];if(d.tryLoc===f){var S=d.completion;if(S.type==="throw"){var C=S.arg;V(d)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,s,d){return this.delegate={iterator:ee(f),resultName:s,nextLoc:d},this.method==="next"&&(this.arg=x),N}},_}(j.exports);try{regeneratorRuntime=L}catch(_){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},695:function(j,L,_){"use strict";_.d(L,{Z:function(){return M}});function M(R){if(R.geometry&&R.geometry.dispose(),R.material){var x=Array.isArray(R.material)?R.material:[R.material];x.forEach(function(p){var T,D,G,P,B,b,I,$,re,Q,N,Z,W;(T=p.map)===null||T===void 0||T.dispose(),(D=p.lightMap)===null||D===void 0||D.dispose(),(G=p.bumpMap)===null||G===void 0||G.dispose(),(P=p.normalMap)===null||P===void 0||P.dispose(),(B=p.specularMap)===null||B===void 0||B.dispose(),(b=p.envMap)===null||b===void 0||b.dispose(),(I=p.alphaMap)===null||I===void 0||I.dispose(),($=p.aoMap)===null||$===void 0||$.dispose(),(re=p.displacementMap)===null||re===void 0||re.dispose(),(Q=p.emissiveMap)===null||Q===void 0||Q.dispose(),(N=p.gradientMap)===null||N===void 0||N.dispose(),(Z=p.metalnessMap)===null||Z===void 0||Z.dispose(),(W=p.roughnessMap)===null||W===void 0||W.dispose(),p.dispose()})}}},584:function(j,L,_){"use strict";_.d(L,{disposeMesh:function(){return p.Z},isPlainObject:function(){return G.Z}});var M=_(666),R=_.n(M),x=null,p=_(695),T=_(644);function D(Z){if(Z.material){var W=Array.isArray(Z.material)?Z.material:[Z.material];W.forEach(function(O){var a,o;(a=O.color)===null||a===void 0||a.convertSRGBToLinear(),(o=O.emissive)===null||o===void 0||o.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var G=_(738),P=_(568),B=_(924),b=_(360),I=_(484),$=null,re=null,Q=function(){var Z=(0,P.Z)(R().mark(function W(O,a){var o,l,h,m,E,w,F,ne,V;return R().wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return o=a.type,l=o===void 0?"blob":o,h=a.version,m=h===void 0?"1":h,ee.next=4,(0,b.get)(O);case 4:if(w=ee.sent,!(w&&w[m])){ee.next=9;break}E=w[m],ee.next=15;break;case 9:return ee.next=11,(0,I.Z)(fetch(O).then(function(le){if(le.ok)return le[l]();throw new Error}));case 11:F=ee.sent,ne=F.res,V=F.err,V||(E=ne,(0,b.set)(O,(0,B.Z)({},m,ne)));case 15:return ee.abrupt("return",E?{url:l==="json"?O:URL.createObjectURL(E),store:E}:{url:O});case 16:case"end":return ee.stop()}},W)}));return function(O,a){return Z.apply(this,arguments)}}(),N=_(705)},738:function(j,L,_){"use strict";_.d(L,{Z:function(){return R}});function M(x){return Object.prototype.toString.call(x)==="[object Object]"}function R(x){if(M(x)===!1)return!1;var p=x.constructor;if(p===void 0)return!0;var T=p.prototype;return!(M(T)===!1||T.hasOwnProperty("isPrototypeOf")===!1)}},484:function(j,L,_){"use strict";_.d(L,{Z:function(){return R}});var M=_(42);function R(x){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x.then(function(T){return(0,M.Z)({err:null,res:T},p)}).catch(function(T){return(0,M.Z)({err:T,res:void 0},p)})}},705:function(j,L,_){"use strict";var M=_(644),R=_.n(M),x=new Map,p=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(G,P,B,b,I){var $=P[B*3],re=P[B*3+1],Q=P[b*3],N=P[b*3+1],Z=P[I*3],W=P[I*3+1],O;if(x.has(G))O=x.get(G);else{var a=D.box3||new THREE.Box3;if(!D.box3){var o=G.parameters.shapes.getPoints();a.setFromArray(o.map(function(w){return[w.x,w.y,0]}).flat())}var l=a.getSize(new THREE.Vector3);D.split&&(l.y/=D.split),O={box:a,size:l},x.set(G,O)}var h=O.box,m=O.size,E=D.split?1-D.split:0;return[new THREE.Vector2(($-h.min.x)/m.x,(re-h.min.y)/m.y+E),new THREE.Vector2((Q-h.min.x)/m.x,(N-h.min.y)/m.y+E),new THREE.Vector2((Z-h.min.x)/m.x,(W-h.min.y)/m.y+E)]},generateSideWallUV:function(G,P,B,b,I,$){var re=P[B*3],Q=P[B*3+1],N=P[B*3+2],Z=P[b*3],W=P[b*3+1],O=P[b*3+2],a=P[I*3],o=P[I*3+1],l=P[I*3+2],h=P[$*3],m=P[$*3+1],E=P[$*3+2],w;if(x.has(P))w=x.get(P);else{var F=new THREE.Box3;F.setFromArray(P);var ne=F.getSize(new THREE.Vector3);D.split&&(ne.z/=1-D.split),w={box:F,size:ne},x.set(P,w)}var V=w.box,H=w.size;return Math.abs(Q-W)<Math.abs(re-Z)?[new THREE.Vector2((re-V.min.x)/H.x,(N-V.min.z)/H.z),new THREE.Vector2((Z-V.min.x)/H.x,(O-V.min.z)/H.z),new THREE.Vector2((a-V.min.x)/H.x,(l-V.min.z)/H.z),new THREE.Vector2((h-V.min.x)/H.x,(E-V.min.z)/H.z)]:[new THREE.Vector2((Q-V.min.y)/H.y,(N-V.min.z)/H.z),new THREE.Vector2((W-V.min.y)/H.y,(O-V.min.z)/H.z),new THREE.Vector2((o-V.min.y)/H.y,(l-V.min.z)/H.z),new THREE.Vector2((m-V.min.y)/H.y,(E-V.min.z)/H.z)]}}},T=function(){x.clear()}},360:function(j){"use strict";j.exports=require("idb-keyval")},644:function(j){"use strict";j.exports=require("three")},568:function(j,L,_){"use strict";_.d(L,{Z:function(){return R}});function M(x,p,T,D,G,P,B){try{var b=x[P](B),I=b.value}catch($){T($);return}b.done?p(I):Promise.resolve(I).then(D,G)}function R(x){return function(){var p=this,T=arguments;return new Promise(function(D,G){var P=x.apply(p,T);function B(I){M(P,D,G,B,b,"next",I)}function b(I){M(P,D,G,B,b,"throw",I)}B(void 0)})}}},924:function(j,L,_){"use strict";_.d(L,{Z:function(){return M}});function M(R,x,p){return x in R?Object.defineProperty(R,x,{value:p,enumerable:!0,configurable:!0,writable:!0}):R[x]=p,R}},42:function(j,L,_){"use strict";_.d(L,{Z:function(){return R}});var M=_(924);function R(x){for(var p=1;p<arguments.length;p++){var T=arguments[p]!=null?arguments[p]:{},D=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(T).filter(function(G){return Object.getOwnPropertyDescriptor(T,G).enumerable}))),D.forEach(function(G){(0,M.Z)(x,G,T[G])})}return x}}},be={};function J(j){var L=be[j];if(L!==void 0)return L.exports;var _=be[j]={exports:{}};return Pe[j](_,_.exports,J),_.exports}(function(){J.n=function(j){var L=j&&j.__esModule?function(){return j.default}:function(){return j};return J.d(L,{a:L}),L}})(),function(){J.d=function(j,L){for(var _ in L)J.o(L,_)&&!J.o(j,_)&&Object.defineProperty(j,_,{enumerable:!0,get:L[_]})}}(),function(){J.o=function(j,L){return Object.prototype.hasOwnProperty.call(j,L)}}(),function(){J.r=function(j){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})}}();var ye={};(function(){"use strict";J.r(ye),J.d(ye,{BaseObject:function(){return Oe},GUIObject:function(){return O},Pencil:function(){return te},default:function(){return te}});function j(u,i){if(!(u instanceof i))throw new TypeError("Cannot call a class as a function")}function L(u,i){for(var t=0;t<i.length;t++){var e=i[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(u,e.key,e)}}function _(u,i,t){return i&&L(u.prototype,i),t&&L(u,t),u}var M=J(42);function R(u,i){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(u);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),t.push.apply(t,e)}return t}function x(u,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(i,t))}),u}function p(u,i){(i==null||i>u.length)&&(i=u.length);for(var t=0,e=new Array(i);t<i;t++)e[t]=u[t];return e}function T(u){if(Array.isArray(u))return p(u)}function D(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function G(){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 P(u,i){if(!!u){if(typeof u=="string")return p(u,i);var t=Object.prototype.toString.call(u).slice(8,-1);if(t==="Object"&&u.constructor&&(t=u.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(u,i)}}function B(u){return T(u)||D(u)||P(u)||G()}var b=J(644),I=J(187),$=require("deepmerge"),re=J.n($),Q=require("three/examples/jsm/libs/stats.module"),N=J.n(Q),Z=require("lil-gui"),W=J.n(Z),O=function(){"use strict";function u(t){j(this,u),this.guiParams={},t&&(this.guiParams=t)}var i=u.prototype;return i.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(n){var c=e.addFolder(n),v=r.guiParams[n];Object.keys(v).forEach(function(g){var y=v[g],z=y.min,A=y.max,k=y.step,K=y.name,q=y.paramMap,ue=y.items,se=y.value,ie=y.target,he=g.toLowerCase().indexOf("color")>-1,U,pe=typeof se=="undefined"&&ie,me=pe?ie():v[g],ge=pe?g:"value";ue?U=c.add(me,ge,ue):he?U=c.addColor(me,ge):U=c.add(me,ge),U=U.name(K||g),typeof z!="undefined"&&(U=U.min(z)),typeof A!="undefined"&&(U=U.max(A)),typeof k!="undefined"&&(U=U.step(k)),U=U.onChange(function(){r.setTargetValue(n,g,me[ge],q)}),pe&&U.listen()})})},i.setTargetValue=function(e,r,n,c){var v=this.guiParams[e][r],g=v.onChange,y=v.target,z=v.value,A=r.toLowerCase().indexOf("color")>-1,k=typeof z=="undefined"&&y;if(y&&!k){var K=y();Array.isArray(K)||(K=[K]),K.forEach(function(q){if(!!q)if(A)try{q[c||r].set(n)}catch(ue){r!=="color"&&!c&&console.warn("".concat(r," is not a color,set paramMap"))}else q[c||r]=n})}g&&g(n)},i.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(n){var c=e.guiParams[r][n];typeof c.value!="undefined"&&e.setTargetValue(r,n,c.value,c.paramMap)})})},u}(),a={None:b.NoToneMapping,Linear:b.LinearToneMapping,Reinhard:b.ReinhardToneMapping,Cineon:b.CineonToneMapping,ACESFilmic:b.ACESFilmicToneMapping},o={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:b.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},l=function(){"use strict";function u(t){j(this,u),this.options=t;var e=t.width,r=t.height,n=t.rendererParams,c=n.context,v=n.alpha,g=n.devicePixelRatio,y=n.antialias,z=n.powerPreference,A=n.toneMapping,k=n.toneMappingExposure,K=n.outputEncoding,q=n.logarithmicDepthBuffer,ue=n.preserveDrawingBuffer,se=n.stencil,ie=n.depth,he=n.physicallyCorrectLights,U=new b.WebGLRenderer({context:c,alpha:v,antialias:y,powerPreference:z,logarithmicDepthBuffer:q,preserveDrawingBuffer:ue,stencil:se,depth:ie});U.setSize(e,r),U.setPixelRatio(g),U.toneMapping=a[A],U.toneMappingExposure=k,U.outputEncoding=K,U.physicallyCorrectLights=he,this.renderer=U}var i=u.prototype;return i.setSize=function(e,r){this.renderer.setSize(e,r)},i.render=function(){var e=this.options,r=e.scene,n=e.camera;this.renderer.render(r,n)},i.setGui=function(e){var r=this,n=new O({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:a,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});n.showGui(e)},i.dispose=function(){var e,r,n;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(n=this.renderer)===null||n===void 0||n.renderLists.dispose()},u}(),h={fov:45,near:1,far:1e3},m=function(){"use strict";function u(t){j(this,u),this.oldCameraPosition=new b.Vector3,this.oldCameraRotation=new b.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,n=t.cameraParams;if(n instanceof b.Camera)this.camera=n,this.customCamera=!0;else{var c=n.fov,v=n.far,g=n.near,y=new b.PerspectiveCamera(c,e/r,g,v);y.position.set(0,0,400),y.lookAt(0,0,0),this.camera=y}}var i=u.prototype;return i.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},i.setSize=function(e,r){this.camera instanceof b.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},i.setGui=function(e){var r=this,n=new O({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}}});this.camera instanceof b.PerspectiveCamera&&(n.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(c){r.camera.updateProjectionMatrix()}}),n.showGui(e)},u}(),E=J(584),w={background:null},F=function(){"use strict";function u(t){j(this,u),this.options=t;var e=t.camera,r=t.sceneParams,n=r.background,c=new b.Scene;n&&(c.background=n),c.add(e),this.scene=c}var i=u.prototype;return i.addAxesHelper=function(){var e,r=new b.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},i.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,E.disposeMesh)(r)})},u}(),ne=require("three/examples/jsm/controls/OrbitControls"),V={},H=function(){"use strict";function u(t){j(this,u),this.options=t;var e=t.camera,r=t.controlParams,n=t.mapControl,c=r.domElement,v=n?new ne.MapControls(e,c):new ne.OrbitControls(e,c);v.minPolarAngle=Math.PI*.15,v.maxPolarAngle=Math.PI*.85,v.enableDamping=!0,v.dampingFactor=.063,v.autoRotate=!1,v.autoRotateSpeed=-60,v.enableZoom=!0,v.zoomSpeed=.2,this.control=v}var i=u.prototype;return i.limitPan=function(e){var r=e.maxX,n=r===void 0?1/0:r,c=e.minX,v=c===void 0?-1/0:c,g=e.maxZ,y=g===void 0?1/0:g,z=e.minZ,A=z===void 0?-1/0:z,k=e.maxY,K=k===void 0?1/0:k,q=e.minY,ue=q===void 0?-1/0:q,se=this.limitPanV||new b.Vector3,ie=this.control,he=this.options.camera,U=new b.Vector3(v,ue,A),pe=new b.Vector3(n,K,y);this.limitPanV=se,se.copy(ie.target),ie.target.clamp(U,pe),se.sub(ie.target),he.position.sub(se)},i.update=function(){this.control.update()},i.dispose=function(){this.control.dispose()},u}(),ee=require("three/examples/jsm/renderers/CSS3DRenderer"),le=require("three/examples/jsm/renderers/CSS2DRenderer"),f={zIndex:"auto"},s=function(){"use strict";function u(t){j(this,u),this.container=t}var i=u.prototype;return i.addRenderer=function(e,r){var n=this.container,c=n.offsetWidth,v=n.offsetHeight,g=e==="css2d"?new le.CSS2DRenderer:new ee.CSS3DRenderer;g.domElement.style.position="absolute",g.domElement.style.top="0",g.domElement.style.pointerEvents="none",g.domElement.style.zIndex=r.zIndex,g.setSize(c,v),n.appendChild(g.domElement),e==="css2d"?this.css2Drenderer=g:e==="css3d"&&(this.css3Drenderer=g)},i.setSize=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.setSize(e,r),(c=this.css3Drenderer)===null||c===void 0||c.setSize(e,r)},i.render=function(e,r){var n,c;(n=this.css2Drenderer)===null||n===void 0||n.render(e,r),(c=this.css3Drenderer)===null||c===void 0||c.render(e,r)},i.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},u}(),d=require("postprocessing"),S={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},C=function(){"use strict";function u(t){j(this,u),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,n=t.camera,c=t.composerParams,v=c.multisampling,g=e.capabilities.maxSamples,y=new d.EffectComposer(e,{multisampling:Math.min(v,g)});y.addPass(new d.RenderPass(r,n)),this.finalComposer=y,this.renderer=e,this.scene=r,this.camera=n}var i=u.prototype;return i.addCopyPass=function(){var e=new d.CopyPass;e.renderToScreen=!0,this.finalComposer.addPass(e),this.copyPass=e},i.addFXAAPass=function(){var e=this.camera,r=new d.FXAAEffect({blendFunction:d.BlendFunction.NORMAL}),n=new d.EffectPass(e,r);this.finalComposer.addPass(n),this.fxaaPass=n},i.addBloomPass=function(e){var r=this,n=r.camera,c=r.scene,v=new d.SelectiveBloomEffect(c,n,(0,M.Z)({},e)),g=new d.EffectPass(n,v);g.enabled=!1,this.finalComposer.addPass(g),this.bloomPass=g,this.bloomEffect=v},i.addBloomGui=function(e){var r=this;if(!!this.bloomEffect){var n=new O({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(c){r.bloomEffect.luminancePass.enabled=c}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});n.showGui(e)}},i.toggleBloomSelection=function(e){if(!this.bloomEffect||!this.bloomPass){console.warn("err:pencil.options.bloom");return}this.bloomEffect.selection.toggle(e),this.bloomPass.enabled=!!this.bloomEffect.selection.size},i.getSize=function(){var e=this.options.renderer;return e.getSize(new b.Vector2)},i.enable=function(){this.active||(this.active=!0)},i.disable=function(){!this.active||(this.active=!1)},i.setSize=function(e,r){this.finalComposer.setSize(e,r)},i.render=function(){!this.active||this.finalComposer.render()},i.dispose=function(){this.finalComposer.dispose()},u}(),X=function(){try{var u=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&u.getContext("webgl2"))}catch(i){return!1}},oe=0,Y=!1,ae=X()!==!1,te=function(){"use strict";function u(t){j(this,u),this.raycaster=new b.Raycaster,this.installPlugins=new Map,this.event=new I.EventEmitter,this.clock=new b.Clock,this.userData={},this.options=re()(u.options,t,{isMergeableObject:E.isPlainObject});var e=this.options,r=e.container,n=e.stats,c=e.gui,v=e.resizeObserver;if(c){var g=new(W());g.open(!1),this.gui=g}if(n){var y=new(N());y.showPanel(0),y.dom.style.position="absolute",r.appendChild(y.dom),this.stats=y}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),v&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var i=u.prototype;return i.use=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),c=1;c<r;c++)n[c-1]=arguments[c];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var v;(v=e).install.apply(v,[this].concat(B(n))),this.installPlugins.set(e,!0)}},i.init=function(){var e=this.options,r=e.container,n=e.isdev,c=e.axesHelper,v=e.renderer,g=e.scene,y=e.camera,z=this.getSize(),A=z.width,k=z.height,K=new m({isdev:n,width:A,height:k,cameraParams:y});this.gui&&K.setGui(this.gui);var q=K.camera,ue=new F({camera:q,sceneParams:g}),se=ue.scene,ie=new l({width:A,height:k,scene:se,camera:q,isdev:n,rendererParams:x((0,M.Z)({},v),{antialias:!1})});this.gui&&ie.setGui(this.gui);var he=ie.renderer;c&&ue.addAxesHelper(),this.sceneController=ue,this.rendererController=ie,this.cameraController=K,r.appendChild(he.domElement)},i.initComposer=function(){var e=this.options,r=e.bloom,n=e.bloomParams,c=e.renderer,v=e.multisampling,g=e.passes,y=c.antialias;y==="msaa"&&!ae&&(y=!1,console.warn("MSAA is not supported on this browser"));var z=new C({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:y==="msaa"?v:0,type:b.UnsignedByteType,encoding:c.outputEncoding}});this.composerController=z,r&&(z.addBloomPass(n),this.gui&&z.addBloomGui(this.gui)),y==="fxaa"&&z.addFXAAPass(),g&&g.forEach(function(A){z.finalComposer.addPass(A)}),z.addCopyPass()},i.initCSSRenderer=function(){var e=this.options,r=e.container,n=e.css2DRenderer,c=e.css3DRenderer,v=e.css2DRendererParams,g=e.css3DRendererParams;if(n||c){var y=new s(r);n&&y.addRenderer("css2d",v),c&&y.addRenderer("css3d",g),this.cssRendererController=y}},i.initControl=function(){var e=this.options,r=e.control,n=e.mapControl,c=e.controlParams;if(r){var v=new H({camera:this.camera,controlParams:{domElement:(c==null?void 0:c.domElement)||this.renderer.domElement},mapControl:n});this.controlController=v}},i.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},i.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var n=new ResizeObserver(function(c){var v=!0,g=!1,y=void 0;try{for(var z=c[Symbol.iterator](),A;!(v=(A=z.next()).done);v=!0){var k=A.value,K=k.contentRect;e.handeleResize(K.width,K.height),e.render()}}catch(q){g=!0,y=q}finally{try{!v&&z.return!=null&&z.return()}finally{if(g)throw y}}});n.observe(r),this.resizeObserver=n}},i.handeleResize=function(e,r){var n=this,c=n.rendererController,v=n.cameraController,g=n.composerController,y=n.cssRendererController;v==null||v.setSize(e,r),c==null||c.setSize(e,r),g==null||g.setSize(e,r),y==null||y.setSize(e,r),this.installPlugins.forEach(function(z,A){var k;(k=A.setSize)===null||k===void 0||k.call(A,e,r)}),this.event.emit("resize",{width:e,height:r})},i.pick=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=this,v=c.raycaster,g=c.options,y=g.container,z=new b.Vector2,A=y.getBoundingClientRect();if(z.x=(e.clientX-A.left)/(A.right-A.left)*2-1,z.y=-((e.clientY-A.top)/(A.bottom-A.top))*2+1,this.camera&&this.scene){v.setFromCamera(z,this.camera);var k=v.intersectObjects(r||this.scene.children,n);if(k.length)return{object:k[0].object,intersects:k}}},i.render=function(){var e,r,n,c,v=this,g=v.renderer,y=v.scene,z=v.camera,A=v.clock;if(!(!g||!y||!z||this.options.staticRender&&!this.cameraController.checkCameraChange())){var k=A.getDelta(),K=A.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(ue,se){var ie;(ie=se.update)===null||ie===void 0||ie.call(se,k,K)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var q;(q=this.rendererController)===null||q===void 0||q.render()}(n=this.cssRendererController)===null||n===void 0||n.render(y,z),(c=this.stats)===null||c===void 0||c.update(),this.event.emit("render",{delta:k,elapsed:K})}},i.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},i.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},i.dispose=function(){var e,r,n,c,v,g,y;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(z,A){var k;(k=A.dispose)===null||k===void 0||k.call(A)}),(r=this.controlController)===null||r===void 0||r.dispose(),(n=this.cssRendererController)===null||n===void 0||n.dispose(),(c=this.sceneController)===null||c===void 0||c.dispose(),(v=this.composerController)===null||v===void 0||v.dispose(),(g=this.rendererController)===null||g===void 0||g.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},_(u,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),u}();te.options={isdev:Y,stats:Y,gui:Y,axesHelper:Y,control:Y,resizeObserver:!0,renderer:x((0,M.Z)({},o),{antialias:ae?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:w,camera:h,bloom:!1,bloomParams:S,css2DRenderer:!1,css2DRendererParams:(0,M.Z)({},f),css3DRenderer:!1,css3DRendererParams:(0,M.Z)({},f)};function fe(u,i){return fe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},fe(u,i)}function de(u,i){return fe(u,i)}function ce(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(u){return!1}}function ve(u,i,t){return ce()?ve=Reflect.construct:ve=function(r,n,c){var v=[null];v.push.apply(v,n);var g=Function.bind.apply(r,v),y=new g;return c&&de(y,c.prototype),y},ve.apply(null,arguments)}function _e(u,i,t){return ve.apply(null,arguments)}var Ce=J(484);function Ee(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),u&&(t.promise=(0,Ce.Z)(t.promise,i)),t}var we=function(u){u&&((0,E.disposeMesh)(u),u.children.forEach(function(i){i.userData.BaseObject_||we(i)}))},Oe=function(){"use strict";function u(){j(this,u),this.objecttype__="BaseObject",this.userData={},this.pm=Ee(),this.visible=!1}var i=u.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(e,r){},i.resize=function(e,r){},i.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},i.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},i.isVisible=function(){return this.visible},i.createMesh=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=_e(b.Mesh,B(r)),this},i.createGroup=function(){return this.object3d=new b.Group,this},i.createPoints=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.object3d=_e(b.Points,B(r)),this},i.createCSS2DObject=function(e){return this.object3d=new le.CSS2DObject(e),this},i.createCSS3DObject=function(e){return this.object3d=new ee.CSS3DObject(e),this},i.createCSS3DSprite=function(e){return this.object3d=new ee.CSS3DSprite(e),this},i.createSprite=function(e){return this.object3d=new b.Sprite(e),this},i.add=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).add.apply(c,B(r)),this},i.remove=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var c;return(c=this.object3d).remove.apply(c,B(r)),this},i.getSize=function(){var e=new b.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new b.Vector3)}},i.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},i.dispose=function(){we(this.object3d)},_(u,[{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})}}]),u}()})(),module.exports=ye})();
|
package/dist/index.module.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as Re from"idb-keyval";import*as $ from"three";import*as Ue from"deepmerge";import*as Ze from"three/examples/jsm/libs/stats.module";import*as Xe from"lil-gui";import*as Me from"three/examples/jsm/controls/OrbitControls";import*as xe from"three/examples/jsm/renderers/CSS3DRenderer";import*as me from"postprocessing";import*as Ke from"three/examples/jsm/renderers/CSS2DRenderer";var Ye={187:function(j){var R=typeof Reflect=="object"?Reflect:null,b=R&&typeof R.apply=="function"?R.apply:function(a,c,h){return Function.prototype.apply.call(a,c,h)},B;R&&typeof R.ownKeys=="function"?B=R.ownKeys:Object.getOwnPropertySymbols?B=function(a){return Object.getOwnPropertyNames(a).concat(Object.getOwnPropertySymbols(a))}:B=function(a){return Object.getOwnPropertyNames(a)};function L(s){console&&console.warn&&console.warn(s)}var S=Number.isNaN||function(a){return a!==a};function d(){d.init.call(this)}j.exports=d,j.exports.once=J,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var T=10;function W(s){if(typeof s!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof s)}Object.defineProperty(d,"defaultMaxListeners",{enumerable:!0,get:function(){return T},set:function(s){if(typeof s!="number"||s<0||S(s))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+s+".");T=s}}),d.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},d.prototype.setMaxListeners=function(a){if(typeof a!="number"||a<0||S(a))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+a+".");return this._maxListeners=a,this};function E(s){return s._maxListeners===void 0?d.defaultMaxListeners:s._maxListeners}d.prototype.getMaxListeners=function(){return E(this)},d.prototype.emit=function(a){for(var c=[],h=1;h<arguments.length;h++)c.push(arguments[h]);var g=a==="error",w=this._events;if(w!==void 0)g=g&&w.error===void 0;else if(!g)return!1;if(g){var P;if(c.length>0&&(P=c[0]),P instanceof Error)throw P;var Q=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw Q.context=P,Q}var k=w[a];if(k===void 0)return!1;if(typeof k=="function")b(k,this,c);else for(var F=k.length,de=ae(k,F),h=0;h<F;++h)b(de[h],this,c);return!0};function G(s,a,c,h){var g,w,P;if(W(c),w=s._events,w===void 0?(w=s._events=Object.create(null),s._eventsCount=0):(w.newListener!==void 0&&(s.emit("newListener",a,c.listener?c.listener:c),w=s._events),P=w[a]),P===void 0)P=w[a]=c,++s._eventsCount;else if(typeof P=="function"?P=w[a]=h?[c,P]:[P,c]:h?P.unshift(c):P.push(c),g=E(s),g>0&&P.length>g&&!P.warned){P.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=s,Q.type=a,Q.count=P.length,L(Q)}return s}d.prototype.addListener=function(a,c){return G(this,a,c,!1)},d.prototype.on=d.prototype.addListener,d.prototype.prependListener=function(a,c){return G(this,a,c,!0)};function V(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(s,a,c){var h={fired:!1,wrapFn:void 0,target:s,type:a,listener:c},g=V.bind(h);return g.listener=c,h.wrapFn=g,g}d.prototype.once=function(a,c){return W(c),this.on(a,m(this,a,c)),this},d.prototype.prependOnceListener=function(a,c){return W(c),this.prependListener(a,m(this,a,c)),this},d.prototype.removeListener=function(a,c){var h,g,w,P,Q;if(W(c),g=this._events,g===void 0)return this;if(h=g[a],h===void 0)return this;if(h===c||h.listener===c)--this._eventsCount===0?this._events=Object.create(null):(delete g[a],g.removeListener&&this.emit("removeListener",a,h.listener||c));else if(typeof h!="function"){for(w=-1,P=h.length-1;P>=0;P--)if(h[P]===c||h[P].listener===c){Q=h[P].listener,w=P;break}if(w<0)return this;w===0?h.shift():ne(h,w),h.length===1&&(g[a]=h[0]),g.removeListener!==void 0&&this.emit("removeListener",a,Q||c)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(a){var c,h,g;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[a]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[a]),this;if(arguments.length===0){var w=Object.keys(h),P;for(g=0;g<w.length;++g)P=w[g],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(c=h[a],typeof c=="function")this.removeListener(a,c);else if(c!==void 0)for(g=c.length-1;g>=0;g--)this.removeListener(a,c[g]);return this};function Z(s,a,c){var h=s._events;if(h===void 0)return[];var g=h[a];return g===void 0?[]:typeof g=="function"?c?[g.listener||g]:[g]:c?K(g):ae(g,g.length)}d.prototype.listeners=function(a){return Z(this,a,!0)},d.prototype.rawListeners=function(a){return Z(this,a,!1)},d.listenerCount=function(s,a){return typeof s.listenerCount=="function"?s.listenerCount(a):re.call(s,a)},d.prototype.listenerCount=re;function re(s){var a=this._events;if(a!==void 0){var c=a[s];if(typeof c=="function")return 1;if(c!==void 0)return c.length}return 0}d.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function ae(s,a){for(var c=new Array(a),h=0;h<a;++h)c[h]=s[h];return c}function ne(s,a){for(;a+1<s.length;a++)s[a]=s[a+1];s.pop()}function K(s){for(var a=new Array(s.length),c=0;c<a.length;++c)a[c]=s[c].listener||s[c];return a}function J(s,a){return new Promise(function(c,h){function g(P){s.removeListener(a,w),h(P)}function w(){typeof s.removeListener=="function"&&s.removeListener("error",g),c([].slice.call(arguments))}M(s,a,w,{once:!0}),a!=="error"&&U(s,g,{once:!0})})}function U(s,a,c){typeof s.on=="function"&&M(s,"error",a,c)}function M(s,a,c,h){if(typeof s.on=="function")h.once?s.once(a,c):s.on(a,c);else if(typeof s.addEventListener=="function")s.addEventListener(a,function g(w){h.once&&s.removeEventListener(a,g),c(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof s)}},666:function(j){var R=function(b){"use strict";var B=Object.prototype,L=B.hasOwnProperty,S,d=typeof Symbol=="function"?Symbol:{},T=d.iterator||"@@iterator",W=d.asyncIterator||"@@asyncIterator",E=d.toStringTag||"@@toStringTag";function G(f,u,v){return Object.defineProperty(f,u,{value:v,enumerable:!0,configurable:!0,writable:!0}),f[u]}try{G({},"")}catch(f){G=function(u,v,O){return u[v]=O}}function V(f,u,v,O){var C=u&&u.prototype instanceof J?u:J,Y=Object.create(C.prototype),q=new de(O||[]);return Y._invoke=P(f,v,q),Y}b.wrap=V;function m(f,u,v){try{return{type:"normal",arg:f.call(u,v)}}catch(O){return{type:"throw",arg:O}}}var Z="suspendedStart",re="suspendedYield",ae="executing",ne="completed",K={};function J(){}function U(){}function M(){}var s={};G(s,T,function(){return this});var a=Object.getPrototypeOf,c=a&&a(a(se([])));c&&c!==B&&L.call(c,T)&&(s=c);var h=M.prototype=J.prototype=Object.create(s);U.prototype=M,G(h,"constructor",M),G(M,"constructor",U),U.displayName=G(M,E,"GeneratorFunction");function g(f){["next","throw","return"].forEach(function(u){G(f,u,function(v){return this._invoke(u,v)})})}b.isGeneratorFunction=function(f){var u=typeof f=="function"&&f.constructor;return u?u===U||(u.displayName||u.name)==="GeneratorFunction":!1},b.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,M):(f.__proto__=M,G(f,E,"GeneratorFunction")),f.prototype=Object.create(h),f},b.awrap=function(f){return{__await:f}};function w(f,u){function v(Y,q,ie,ue){var oe=m(f[Y],f,q);if(oe.type==="throw")ue(oe.arg);else{var _e=oe.arg,ve=_e.value;return ve&&typeof ve=="object"&&L.call(ve,"__await")?u.resolve(ve.__await).then(function(fe){v("next",fe,ie,ue)},function(fe){v("throw",fe,ie,ue)}):u.resolve(ve).then(function(fe){_e.value=fe,ie(_e)},function(fe){return v("throw",fe,ie,ue)})}}var O;function C(Y,q){function ie(){return new u(function(ue,oe){v(Y,q,ue,oe)})}return O=O?O.then(ie,ie):ie()}this._invoke=C}g(w.prototype),G(w.prototype,W,function(){return this}),b.AsyncIterator=w,b.async=function(f,u,v,O,C){C===void 0&&(C=Promise);var Y=new w(V(f,u,v,O),C);return b.isGeneratorFunction(u)?Y:Y.next().then(function(q){return q.done?q.value:Y.next()})};function P(f,u,v){var O=Z;return function(Y,q){if(O===ae)throw new Error("Generator is already running");if(O===ne){if(Y==="throw")throw q;return ge()}for(v.method=Y,v.arg=q;;){var ie=v.delegate;if(ie){var ue=Q(ie,v);if(ue){if(ue===K)continue;return ue}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(O===Z)throw O=ne,v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);O=ae;var oe=m(f,u,v);if(oe.type==="normal"){if(O=v.done?ne:re,oe.arg===K)continue;return{value:oe.arg,done:v.done}}else oe.type==="throw"&&(O=ne,v.method="throw",v.arg=oe.arg)}}}function Q(f,u){var v=f.iterator[u.method];if(v===S){if(u.delegate=null,u.method==="throw"){if(f.iterator.return&&(u.method="return",u.arg=S,Q(f,u),u.method==="throw"))return K;u.method="throw",u.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var O=m(v,f.iterator,u.arg);if(O.type==="throw")return u.method="throw",u.arg=O.arg,u.delegate=null,K;var C=O.arg;if(!C)return u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,K;if(C.done)u[f.resultName]=C.value,u.next=f.nextLoc,u.method!=="return"&&(u.method="next",u.arg=S);else return C;return u.delegate=null,K}g(h),G(h,E,"Generator"),G(h,T,function(){return this}),G(h,"toString",function(){return"[object Generator]"});function k(f){var u={tryLoc:f[0]};1 in f&&(u.catchLoc=f[1]),2 in f&&(u.finallyLoc=f[2],u.afterLoc=f[3]),this.tryEntries.push(u)}function F(f){var u=f.completion||{};u.type="normal",delete u.arg,f.completion=u}function de(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(k,this),this.reset(!0)}b.keys=function(f){var u=[];for(var v in f)u.push(v);return u.reverse(),function O(){for(;u.length;){var C=u.pop();if(C in f)return O.value=C,O.done=!1,O}return O.done=!0,O}};function se(f){if(f){var u=f[T];if(u)return u.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var v=-1,O=function C(){for(;++v<f.length;)if(L.call(f,v))return C.value=f[v],C.done=!1,C;return C.value=S,C.done=!0,C};return O.next=O}}return{next:ge}}b.values=se;function ge(){return{value:S,done:!0}}return de.prototype={constructor:de,reset:function(f){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(F),!f)for(var u in this)u.charAt(0)==="t"&&L.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=S)},stop:function(){this.done=!0;var f=this.tryEntries[0],u=f.completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var u=this;function v(ue,oe){return Y.type="throw",Y.arg=f,u.next=ue,oe&&(u.method="next",u.arg=S),!!oe}for(var O=this.tryEntries.length-1;O>=0;--O){var C=this.tryEntries[O],Y=C.completion;if(C.tryLoc==="root")return v("end");if(C.tryLoc<=this.prev){var q=L.call(C,"catchLoc"),ie=L.call(C,"finallyLoc");if(q&&ie){if(this.prev<C.catchLoc)return v(C.catchLoc,!0);if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else if(q){if(this.prev<C.catchLoc)return v(C.catchLoc,!0)}else if(ie){if(this.prev<C.finallyLoc)return v(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,u){for(var v=this.tryEntries.length-1;v>=0;--v){var O=this.tryEntries[v];if(O.tryLoc<=this.prev&&L.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var C=O;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=u&&u<=C.finallyLoc&&(C=null);var Y=C?C.completion:{};return Y.type=f,Y.arg=u,C?(this.method="next",this.next=C.finallyLoc,K):this.complete(Y)},complete:function(f,u){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&u&&(this.next=u),K},finish:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var v=this.tryEntries[u];if(v.finallyLoc===f)return this.complete(v.completion,v.afterLoc),F(v),K}},catch:function(f){for(var u=this.tryEntries.length-1;u>=0;--u){var v=this.tryEntries[u];if(v.tryLoc===f){var O=v.completion;if(O.type==="throw"){var C=O.arg;F(v)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,u,v){return this.delegate={iterator:se(f),resultName:u,nextLoc:v},this.method==="next"&&(this.arg=S),K}},b}(j.exports);try{regeneratorRuntime=R}catch(b){typeof globalThis=="object"?globalThis.regeneratorRuntime=R:Function("r","regeneratorRuntime = r")(R)}},695:function(j,R,b){b.d(R,{Z:function(){return B}});function B(L){if(L.geometry&&L.geometry.dispose(),L.material){var S=Array.isArray(L.material)?L.material:[L.material];S.forEach(function(d){var T,W,E,G,V,m,Z,re,ae,ne,K,J,U;(T=d.map)===null||T===void 0||T.dispose(),(W=d.lightMap)===null||W===void 0||W.dispose(),(E=d.bumpMap)===null||E===void 0||E.dispose(),(G=d.normalMap)===null||G===void 0||G.dispose(),(V=d.specularMap)===null||V===void 0||V.dispose(),(m=d.envMap)===null||m===void 0||m.dispose(),(Z=d.alphaMap)===null||Z===void 0||Z.dispose(),(re=d.aoMap)===null||re===void 0||re.dispose(),(ae=d.displacementMap)===null||ae===void 0||ae.dispose(),(ne=d.emissiveMap)===null||ne===void 0||ne.dispose(),(K=d.gradientMap)===null||K===void 0||K.dispose(),(J=d.metalnessMap)===null||J===void 0||J.dispose(),(U=d.roughnessMap)===null||U===void 0||U.dispose(),d.dispose()})}}},584:function(j,R,b){b.d(R,{wf:function(){return d.Z},PO:function(){return E.Z}});var B=b(666),L=b.n(B),S=null,d=b(695),T=b(949);function W(J){if(J.material){var U=Array.isArray(J.material)?J.material:[J.material];U.forEach(function(M){var s,a;(s=M.color)===null||s===void 0||s.convertSRGBToLinear(),(a=M.emissive)===null||a===void 0||a.convertSRGBToLinear(),M.map&&(M.map.encoding=THREE.sRGBEncoding),M.emissiveMap&&(M.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=b(738),G=b(568),V=b(924),m=b(77),Z=b(484),re=null,ae=null,ne=function(){var J=(0,G.Z)(L().mark(function U(M,s){var a,c,h,g,w,P,Q,k,F;return L().wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return a=s.type,c=a===void 0?"blob":a,h=s.version,g=h===void 0?"1":h,se.next=4,(0,m.get)(M);case 4:if(P=se.sent,!(P&&P[g])){se.next=9;break}w=P[g],se.next=15;break;case 9:return se.next=11,(0,Z.Z)(fetch(M).then(function(ge){if(ge.ok)return ge[c]();throw new Error}));case 11:Q=se.sent,k=Q.res,F=Q.err,F||(w=k,(0,m.set)(M,(0,V.Z)({},g,k)));case 15:return se.abrupt("return",w?{url:c==="json"?M:URL.createObjectURL(w),store:w}:{url:M});case 16:case"end":return se.stop()}},U)}));return function(M,s){return J.apply(this,arguments)}}(),K=b(705)},738:function(j,R,b){b.d(R,{Z:function(){return L}});function B(S){return Object.prototype.toString.call(S)==="[object Object]"}function L(S){if(B(S)===!1)return!1;var d=S.constructor;if(d===void 0)return!0;var T=d.prototype;return!(B(T)===!1||T.hasOwnProperty("isPrototypeOf")===!1)}},484:function(j,R,b){b.d(R,{Z:function(){return L}});var B=b(42);function L(S){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return S.then(function(T){return(0,B.Z)({err:null,res:T},d)}).catch(function(T){return(0,B.Z)({err:T,res:void 0},d)})}},705:function(j,R,b){var B=b(949),L=new Map,S=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(W,E,G,V,m){var Z=E[G*3],re=E[G*3+1],ae=E[V*3],ne=E[V*3+1],K=E[m*3],J=E[m*3+1],U;if(L.has(W))U=L.get(W);else{var M=T.box3||new THREE.Box3;if(!T.box3){var s=W.parameters.shapes.getPoints();M.setFromArray(s.map(function(w){return[w.x,w.y,0]}).flat())}var a=M.getSize(new THREE.Vector3);T.split&&(a.y/=T.split),U={box:M,size:a},L.set(W,U)}var c=U.box,h=U.size,g=T.split?1-T.split:0;return[new THREE.Vector2((Z-c.min.x)/h.x,(re-c.min.y)/h.y+g),new THREE.Vector2((ae-c.min.x)/h.x,(ne-c.min.y)/h.y+g),new THREE.Vector2((K-c.min.x)/h.x,(J-c.min.y)/h.y+g)]},generateSideWallUV:function(W,E,G,V,m,Z){var re=E[G*3],ae=E[G*3+1],ne=E[G*3+2],K=E[V*3],J=E[V*3+1],U=E[V*3+2],M=E[m*3],s=E[m*3+1],a=E[m*3+2],c=E[Z*3],h=E[Z*3+1],g=E[Z*3+2],w;if(L.has(E))w=L.get(E);else{var P=new THREE.Box3;P.setFromArray(E);var Q=P.getSize(new THREE.Vector3);T.split&&(Q.z/=1-T.split),w={box:P,size:Q},L.set(E,w)}var k=w.box,F=w.size;return Math.abs(ae-J)<Math.abs(re-K)?[new THREE.Vector2((re-k.min.x)/F.x,(ne-k.min.z)/F.z),new THREE.Vector2((K-k.min.x)/F.x,(U-k.min.z)/F.z),new THREE.Vector2((M-k.min.x)/F.x,(a-k.min.z)/F.z),new THREE.Vector2((c-k.min.x)/F.x,(g-k.min.z)/F.z)]:[new THREE.Vector2((ae-k.min.y)/F.y,(ne-k.min.z)/F.z),new THREE.Vector2((J-k.min.y)/F.y,(U-k.min.z)/F.z),new THREE.Vector2((s-k.min.y)/F.y,(a-k.min.z)/F.z),new THREE.Vector2((h-k.min.y)/F.y,(g-k.min.z)/F.z)]}}},d=function(){L.clear()}},77:function(j,R,b){var B=S=>{var d={};return b.d(d,S),d},L=S=>()=>S;j.exports=B({get:()=>Re.get,set:()=>Re.set})},949:function(j,R,b){var B=S=>{var d={};return b.d(d,S),d},L=S=>()=>S;j.exports=B({ACESFilmicToneMapping:()=>$.ACESFilmicToneMapping,AxesHelper:()=>$.AxesHelper,Box3:()=>$.Box3,Camera:()=>$.Camera,CineonToneMapping:()=>$.CineonToneMapping,Clock:()=>$.Clock,Euler:()=>$.Euler,Group:()=>$.Group,LinearEncoding:()=>$.LinearEncoding,LinearToneMapping:()=>$.LinearToneMapping,Matrix4:()=>$.Matrix4,Mesh:()=>$.Mesh,NoToneMapping:()=>$.NoToneMapping,PerspectiveCamera:()=>$.PerspectiveCamera,Points:()=>$.Points,REVISION:()=>$.REVISION,Raycaster:()=>$.Raycaster,ReinhardToneMapping:()=>$.ReinhardToneMapping,Scene:()=>$.Scene,Sprite:()=>$.Sprite,UnsignedByteType:()=>$.UnsignedByteType,Vector2:()=>$.Vector2,Vector3:()=>$.Vector3,WebGLRenderer:()=>$.WebGLRenderer})},568:function(j,R,b){b.d(R,{Z:function(){return L}});function B(S,d,T,W,E,G,V){try{var m=S[G](V),Z=m.value}catch(re){T(re);return}m.done?d(Z):Promise.resolve(Z).then(W,E)}function L(S){return function(){var d=this,T=arguments;return new Promise(function(W,E){var G=S.apply(d,T);function V(Z){B(G,W,E,V,m,"next",Z)}function m(Z){B(G,W,E,V,m,"throw",Z)}V(void 0)})}}},924:function(j,R,b){b.d(R,{Z:function(){return B}});function B(L,S,d){return S in L?Object.defineProperty(L,S,{value:d,enumerable:!0,configurable:!0,writable:!0}):L[S]=d,L}},42:function(j,R,b){b.d(R,{Z:function(){return L}});var B=b(924);function L(S){for(var d=1;d<arguments.length;d++){var T=arguments[d]!=null?arguments[d]:{},W=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(W=W.concat(Object.getOwnPropertySymbols(T).filter(function(E){return Object.getOwnPropertyDescriptor(T,E).enumerable}))),W.forEach(function(E){(0,B.Z)(S,E,T[E])})}return S}}},je={};function te(j){var R=je[j];if(R!==void 0)return R.exports;var b=je[j]={exports:{}};return Ye[j](b,b.exports,te),b.exports}(function(){te.n=function(j){var R=j&&j.__esModule?function(){return j.default}:function(){return j};return te.d(R,{a:R}),R}})(),function(){te.d=function(j,R){for(var b in R)te.o(R,b)&&!te.o(j,b)&&Object.defineProperty(j,b,{enumerable:!0,get:R[b]})}}(),function(){te.o=function(j,R){return Object.prototype.hasOwnProperty.call(j,R)}}();var we={};(function(){te.d(we,{L6:function(){return Fe},sb:function(){return c},z:function(){return Ee},ZP:function(){return Ee}});function j(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}function R(o,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,e.key,e)}}function b(o,n,t){return n&&R(o.prototype,n),t&&R(o,t),o}var B=te(42);function L(o,n){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,e)}return t}function S(o,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(n,t))}),o}function d(o,n){(n==null||n>o.length)&&(n=o.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=o[t];return e}function T(o){if(Array.isArray(o))return d(o)}function W(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function G(o,n){if(!!o){if(typeof o=="string")return d(o,n);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(o,n)}}function V(o){return T(o)||W(o)||G(o)||E()}var m=te(949),Z=te(187),re=o=>{var n={};return te.d(n,o),n},ae=o=>()=>o,ne=re({default:()=>Ue.default}),K=o=>{var n={};return te.d(n,o),n},J=o=>()=>o,U=K({default:()=>Ze.default}),M=o=>{var n={};return te.d(n,o),n},s=o=>()=>o,a=M({default:()=>Xe.default}),c=function(){"use strict";function o(t){j(this,o),this.guiParams={},t&&(this.guiParams=t)}var n=o.prototype;return n.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(i){var l=e.addFolder(i),p=r.guiParams[i];Object.keys(p).forEach(function(_){var y=p[_],z=y.min,D=y.max,N=y.step,x=y.name,A=y.paramMap,H=y.items,ee=y.value,X=y.target,ce=_.toLowerCase().indexOf("color")>-1,I,le=typeof ee=="undefined"&&X,pe=le?X():p[_],ye=le?_:"value";H?I=l.add(pe,ye,H):ce?I=l.addColor(pe,ye):I=l.add(pe,ye),I=I.name(x||_),typeof z!="undefined"&&(I=I.min(z)),typeof D!="undefined"&&(I=I.max(D)),typeof N!="undefined"&&(I=I.step(N)),I=I.onChange(function(){r.setTargetValue(i,_,pe[ye],A)}),le&&I.listen()})})},n.setTargetValue=function(e,r,i,l){var p=this.guiParams[e][r],_=p.onChange,y=p.target,z=p.value,D=r.toLowerCase().indexOf("color")>-1,N=typeof z=="undefined"&&y;if(y&&!N){var x=y();Array.isArray(x)||(x=[x]),x.forEach(function(A){if(!!A)if(D)try{A[l||r].set(i)}catch(H){r!=="color"&&!l&&console.warn("".concat(r," is not a color,set paramMap"))}else A[l||r]=i})}_&&_(i)},n.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(i){var l=e.guiParams[r][i];typeof l.value!="undefined"&&e.setTargetValue(r,i,l.value,l.paramMap)})})},o}(),h={None:m.NoToneMapping,Linear:m.LinearToneMapping,Reinhard:m.ReinhardToneMapping,Cineon:m.CineonToneMapping,ACESFilmic:m.ACESFilmicToneMapping},g={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:m.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},w=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.width,r=t.height,i=t.rendererParams,l=i.context,p=i.alpha,_=i.devicePixelRatio,y=i.antialias,z=i.powerPreference,D=i.toneMapping,N=i.toneMappingExposure,x=i.outputEncoding,A=i.logarithmicDepthBuffer,H=i.preserveDrawingBuffer,ee=i.stencil,X=i.depth,ce=i.physicallyCorrectLights,I=new m.WebGLRenderer({context:l,alpha:p,antialias:y,powerPreference:z,logarithmicDepthBuffer:A,preserveDrawingBuffer:H,stencil:ee,depth:X});I.setSize(e,r),I.setPixelRatio(_),I.toneMapping=h[D],I.toneMappingExposure=N,I.outputEncoding=x,I.physicallyCorrectLights=ce,this.renderer=I}var n=o.prototype;return n.setSize=function(e,r){this.renderer.setSize(e,r)},n.render=function(){var e=this.options,r=e.scene,i=e.camera;this.renderer.render(r,i)},n.setGui=function(e){var r=this,i=new c({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:h,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});i.showGui(e)},n.dispose=function(){var e,r,i;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},o}(),P={fov:45,near:1,far:1e3},Q=function(){"use strict";function o(t){j(this,o),this.oldCameraPosition=new m.Vector3,this.oldCameraRotation=new m.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,i=t.cameraParams;if(i instanceof m.Camera)this.camera=i,this.customCamera=!0;else{var l=i.fov,p=i.far,_=i.near,y=new m.PerspectiveCamera(l,e/r,_,p);y.position.set(0,0,400),y.lookAt(0,0,0),this.camera=y}}var n=o.prototype;return n.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},n.setSize=function(e,r){this.camera instanceof m.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},n.setGui=function(e){var r=this,i=new c({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}}});this.camera instanceof m.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}),i.showGui(e)},o}(),k=te(584),F={background:null},de=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.sceneParams,i=r.background,l=new m.Scene;i&&(l.background=i),l.add(e),this.scene=l}var n=o.prototype;return n.addAxesHelper=function(){var e,r=new m.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},n.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,k.wf)(r)})},o}(),se=o=>{var n={};return te.d(n,o),n},ge=o=>()=>o,f=se({MapControls:()=>Me.MapControls,OrbitControls:()=>Me.OrbitControls}),u={},v=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.controlParams,i=t.mapControl,l=r.domElement,p=i?new f.MapControls(e,l):new f.OrbitControls(e,l);p.minPolarAngle=Math.PI*.15,p.maxPolarAngle=Math.PI*.85,p.enableDamping=!0,p.dampingFactor=.063,p.autoRotate=!1,p.autoRotateSpeed=-60,p.enableZoom=!0,p.zoomSpeed=.2,this.control=p}var n=o.prototype;return n.limitPan=function(e){var r=e.maxX,i=r===void 0?1/0:r,l=e.minX,p=l===void 0?-1/0:l,_=e.maxZ,y=_===void 0?1/0:_,z=e.minZ,D=z===void 0?-1/0:z,N=e.maxY,x=N===void 0?1/0:N,A=e.minY,H=A===void 0?-1/0:A,ee=this.limitPanV||new m.Vector3,X=this.control,ce=this.options.camera,I=new m.Vector3(p,H,D),le=new m.Vector3(i,x,y);this.limitPanV=ee,ee.copy(X.target),X.target.clamp(I,le),ee.sub(X.target),ce.position.sub(ee)},n.update=function(){this.control.update()},n.dispose=function(){this.control.dispose()},o}(),O=o=>{var n={};return te.d(n,o),n},C=o=>()=>o,Y=O({CSS3DObject:()=>xe.CSS3DObject,CSS3DRenderer:()=>xe.CSS3DRenderer,CSS3DSprite:()=>xe.CSS3DSprite}),q=new m.Vector3,ie=new m.Matrix4,ue=new m.Matrix4,oe=new m.Vector3,_e=new m.Vector3,ve=function o(){"use strict";var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,o);var t=function(A,H){return oe.setFromMatrixPosition(A.matrixWorld),_e.setFromMatrixPosition(H.matrixWorld),oe.distanceToSquared(_e)},e=function(A){var H=[];return A.traverse(function(ee){ee.isCSS2DObject&&H.push(ee)}),H},r=function(A){for(var H=e(A).sort(function(le,pe){if(le.renderOrder!==pe.renderOrder)return pe.renderOrder-le.renderOrder;var ye=z.objects.get(le).distanceToCameraSquared,He=z.objects.get(pe).distanceToCameraSquared;return ye-He}),ee=H.length,X=0,ce=H.length;X<ce;X++){var I=H[X].userData.zIndexFix||0;H[X].element.style.zIndex=ee-X+I}},i=this,l,p,_,y,z={objects:new WeakMap},D=n.element!==void 0?n.element:document.createElement("div");D.style.overflow="hidden",this.domElement=D,this.getSize=function(){return{width:l,height:p}},this.render=function(x,A){+m.REVISION<144?(x.autoUpdate===!0&&x.updateMatrixWorld(),A.parent===null&&A.updateMatrixWorld()):(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld()),ie.copy(A.matrixWorldInverse),ue.multiplyMatrices(A.projectionMatrix,ie),N(x,x,A),r(x)},this.setSize=function(x,A){l=x,p=A,_=l/2,y=p/2,D.style.width="".concat(x,"px"),D.style.height="".concat(A,"px")};function N(x,A,H){if(x.isCSS2DObject){q.setFromMatrixPosition(x.matrixWorld),q.applyMatrix4(ue);var ee=x.visible===!0&&q.z>=-1&&q.z<=1&&x.layers.test(H.layers)===!0;if(x.element.style.display=ee===!0?"":"none",ee===!0){x.onBeforeRender(i,A,H);var X=x.element;X.style.transform="translate(-50%,-50%) translate(".concat(q.x*_+_,"px,").concat(-q.y*y+y,"px)"),X.parentNode!==D&&D.appendChild(X),x.onAfterRender(i,A,H)}var ce={distanceToCameraSquared:t(H,x)};z.objects.set(x,ce)}for(var I=0,le=x.children.length;I<le;I++)N(x.children[I],A,H)}},fe={zIndex:"auto"},Ae=function(){"use strict";function o(t){j(this,o),this.container=t}var n=o.prototype;return n.addRenderer=function(e,r){var i=this.container,l=i.offsetWidth,p=i.offsetHeight,_=e==="css2d"?new ve:new Y.CSS3DRenderer;_.domElement.style.position="absolute",_.domElement.style.top="0",_.domElement.style.pointerEvents="none",_.domElement.style.zIndex=r.zIndex,_.setSize(l,p),i.appendChild(_.domElement),e==="css2d"?this.css2Drenderer=_:e==="css3d"&&(this.css3Drenderer=_)},n.setSize=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,r),(l=this.css3Drenderer)===null||l===void 0||l.setSize(e,r)},n.render=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.render(e,r),(l=this.css3Drenderer)===null||l===void 0||l.render(e,r)},n.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},o}(),Te=o=>{var n={};return te.d(n,o),n},et=o=>()=>o,he=Te({BlendFunction:()=>me.BlendFunction,CopyPass:()=>me.CopyPass,EffectComposer:()=>me.EffectComposer,EffectPass:()=>me.EffectPass,FXAAEffect:()=>me.FXAAEffect,RenderPass:()=>me.RenderPass,SelectiveBloomEffect:()=>me.SelectiveBloomEffect}),De={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},ze=function(){"use strict";function o(t){j(this,o),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,i=t.camera,l=t.composerParams,p=l.multisampling,_=e.capabilities.maxSamples,y=new he.EffectComposer(e,{multisampling:Math.min(p,_)});y.addPass(new he.RenderPass(r,i)),this.finalComposer=y,this.renderer=e,this.scene=r,this.camera=i}var n=o.prototype;return n.addCopyPass=function(){var e=new he.CopyPass;e.renderToScreen=!0,this.finalComposer.addPass(e),this.copyPass=e},n.addFXAAPass=function(){var e=this.camera,r=new he.FXAAEffect({blendFunction:he.BlendFunction.NORMAL}),i=new he.EffectPass(e,r);this.finalComposer.addPass(i),this.fxaaPass=i},n.addBloomPass=function(e){var r=this,i=r.camera,l=r.scene,p=new he.SelectiveBloomEffect(l,i,(0,B.Z)({},e)),_=new he.EffectPass(i,p);_.enabled=!1,this.finalComposer.addPass(_),this.bloomPass=_,this.bloomEffect=p},n.addBloomGui=function(e){var r=this;if(!!this.bloomEffect){var i=new c({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(l){r.bloomEffect.luminancePass.enabled=l}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});i.showGui(e)}},n.toggleBloomSelection=function(e){if(!this.bloomEffect||!this.bloomPass){console.warn("err:pencil.options.bloom");return}this.bloomEffect.selection.toggle(e),this.bloomPass.enabled=!!this.bloomEffect.selection.size},n.getSize=function(){var e=this.options.renderer;return e.getSize(new m.Vector2)},n.enable=function(){this.active||(this.active=!0)},n.disable=function(){!this.active||(this.active=!1)},n.setSize=function(e,r){this.finalComposer.setSize(e,r)},n.render=function(){!this.active||this.finalComposer.render()},n.dispose=function(){this.finalComposer.dispose()},o}(),Be=function(){try{var o=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&o.getContext("webgl2"))}catch(n){return!1}},tt=0,be=!1,Se=Be()!==!1,Ee=function(){"use strict";function o(t){j(this,o),this.raycaster=new m.Raycaster,this.installPlugins=new Map,this.event=new Z.EventEmitter,this.clock=new m.Clock,this.userData={},this.options=(0,ne.default)(o.options,t,{isMergeableObject:k.PO});var e=this.options,r=e.container,i=e.stats,l=e.gui,p=e.resizeObserver;if(l){var _=new a.default;_.open(!1),this.gui=_}if(i){var y=new U.default;y.showPanel(0),y.dom.style.position="absolute",r.appendChild(y.dom),this.stats=y}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),p&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var n=o.prototype;return n.use=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var p;(p=e).install.apply(p,[this].concat(V(i))),this.installPlugins.set(e,!0)}},n.init=function(){var e=this.options,r=e.container,i=e.isdev,l=e.axesHelper,p=e.renderer,_=e.scene,y=e.camera,z=this.getSize(),D=z.width,N=z.height,x=new Q({isdev:i,width:D,height:N,cameraParams:y});this.gui&&x.setGui(this.gui);var A=x.camera,H=new de({camera:A,sceneParams:_}),ee=H.scene,X=new w({width:D,height:N,scene:ee,camera:A,isdev:i,rendererParams:S((0,B.Z)({},p),{antialias:!1})});this.gui&&X.setGui(this.gui);var ce=X.renderer;l&&H.addAxesHelper(),this.sceneController=H,this.rendererController=X,this.cameraController=x,r.appendChild(ce.domElement)},n.initComposer=function(){var e=this.options,r=e.bloom,i=e.bloomParams,l=e.renderer,p=e.multisampling,_=e.passes,y=l.antialias;y==="msaa"&&!Se&&(y=!1,console.warn("MSAA is not supported on this browser"));var z=new ze({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:y==="msaa"?p:0,type:m.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=z,r&&(z.addBloomPass(i),this.gui&&z.addBloomGui(this.gui)),y==="fxaa"&&z.addFXAAPass(),_&&_.forEach(function(D){z.finalComposer.addPass(D)}),z.addCopyPass()},n.initCSSRenderer=function(){var e=this.options,r=e.container,i=e.css2DRenderer,l=e.css3DRenderer,p=e.css2DRendererParams,_=e.css3DRendererParams;if(i||l){var y=new Ae(r);i&&y.addRenderer("css2d",p),l&&y.addRenderer("css3d",_),this.cssRendererController=y}},n.initControl=function(){var e=this.options,r=e.control,i=e.mapControl,l=e.controlParams;if(r){var p=new v({camera:this.camera,controlParams:{domElement:(l==null?void 0:l.domElement)||this.renderer.domElement},mapControl:i});this.controlController=p}},n.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},n.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var i=new ResizeObserver(function(l){var p=!0,_=!1,y=void 0;try{for(var z=l[Symbol.iterator](),D;!(p=(D=z.next()).done);p=!0){var N=D.value,x=N.contentRect;e.handeleResize(x.width,x.height),e.render()}}catch(A){_=!0,y=A}finally{try{!p&&z.return!=null&&z.return()}finally{if(_)throw y}}});i.observe(r),this.resizeObserver=i}},n.handeleResize=function(e,r){var i=this,l=i.rendererController,p=i.cameraController,_=i.composerController,y=i.cssRendererController;p==null||p.setSize(e,r),l==null||l.setSize(e,r),_==null||_.setSize(e,r),y==null||y.setSize(e,r),this.installPlugins.forEach(function(z,D){var N;(N=D.setSize)===null||N===void 0||N.call(D,e,r)}),this.event.emit("resize",{width:e,height:r})},n.pick=function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=this,p=l.raycaster,_=l.options,y=_.container,z=new m.Vector2,D=y.getBoundingClientRect();if(z.x=(e.clientX-D.left)/(D.right-D.left)*2-1,z.y=-((e.clientY-D.top)/(D.bottom-D.top))*2+1,this.camera&&this.scene){p.setFromCamera(z,this.camera);var N=p.intersectObjects(r||this.scene.children,i);if(N.length)return{object:N[0].object,intersects:N}}},n.render=function(){var e,r,i,l,p=this,_=p.renderer,y=p.scene,z=p.camera,D=p.clock;if(!(!_||!y||!z||this.options.staticRender&&!this.cameraController.checkCameraChange())){var N=D.getDelta(),x=D.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(H,ee){var X;(X=ee.update)===null||X===void 0||X.call(ee,N,x)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var A;(A=this.rendererController)===null||A===void 0||A.render()}(i=this.cssRendererController)===null||i===void 0||i.render(y,z),(l=this.stats)===null||l===void 0||l.update(),this.event.emit("render",{delta:N,elapsed:x})}},n.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},n.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},n.dispose=function(){var e,r,i,l,p,_,y;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(z,D){var N;(N=D.dispose)===null||N===void 0||N.call(D)}),(r=this.controlController)===null||r===void 0||r.dispose(),(i=this.cssRendererController)===null||i===void 0||i.dispose(),(l=this.sceneController)===null||l===void 0||l.dispose(),(p=this.composerController)===null||p===void 0||p.dispose(),(_=this.rendererController)===null||_===void 0||_.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},b(o,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),o}();Ee.options={isdev:be,stats:be,gui:be,axesHelper:be,control:be,resizeObserver:!0,renderer:S((0,B.Z)({},g),{antialias:Se?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:F,camera:P,bloom:!1,bloomParams:De,css2DRenderer:!1,css2DRendererParams:(0,B.Z)({},fe),css3DRenderer:!1,css3DRendererParams:(0,B.Z)({},fe)};function Pe(o,n){return Pe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},Pe(o,n)}function Ge(o,n){return Pe(o,n)}function ke(){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(o){return!1}}function Ce(o,n,t){return ke()?Ce=Reflect.construct:Ce=function(r,i,l){var p=[null];p.push.apply(p,i);var _=Function.bind.apply(r,p),y=new _;return l&&Ge(y,l.prototype),y},Ce.apply(null,arguments)}function Oe(o,n,t){return Ce.apply(null,arguments)}var Ne=te(484);function Ie(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),o&&(t.promise=(0,Ne.Z)(t.promise,n)),t}var Ve=o=>{var n={};return te.d(n,o),n},rt=o=>()=>o,We=Ve({CSS2DObject:()=>Ke.CSS2DObject}),Le=function(o){o&&((0,k.wf)(o),o.children.forEach(function(n){n.userData.BaseObject_||Le(n)}))},Fe=function(){"use strict";function o(){j(this,o),this.objecttype__="BaseObject",this.userData={},this.pm=Ie(),this.visible=!1}var n=o.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,r){},n.resize=function(e,r){},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,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(m.Mesh,V(r)),this},n.createGroup=function(){return this.object3d=new m.Group,this},n.createPoints=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(m.Points,V(r)),this},n.createCSS2DObject=function(e){return this.object3d=new We.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new Y.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new Y.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new m.Sprite(e),this},n.add=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).add.apply(l,V(r)),this},n.remove=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).remove.apply(l,V(r)),this},n.getSize=function(){var e=new m.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new m.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},n.dispose=function(){Le(this.object3d)},b(o,[{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})}}]),o}()})();var $e=we.L6,Je=we.sb,Qe=we.z,qe=we.ZP;export{$e as BaseObject,Je as GUIObject,Qe as Pencil,qe as default};
|
|
1
|
+
import*as Re from"idb-keyval";import*as K from"three";import*as Ie from"deepmerge";import*as He from"three/examples/jsm/libs/stats.module";import*as Ue from"lil-gui";import*as je from"three/examples/jsm/controls/OrbitControls";import*as Se from"three/examples/jsm/renderers/CSS3DRenderer";import*as Me from"three/examples/jsm/renderers/CSS2DRenderer";import*as pe from"postprocessing";var Ze={187:function(j){var L=typeof Reflect=="object"?Reflect:null,g=L&&typeof L.apply=="function"?L.apply:function(a,u,h){return Function.prototype.apply.call(a,u,h)},A;L&&typeof L.ownKeys=="function"?A=L.ownKeys:Object.getOwnPropertySymbols?A=function(a){return Object.getOwnPropertyNames(a).concat(Object.getOwnPropertySymbols(a))}:A=function(a){return Object.getOwnPropertyNames(a)};function O(s){console&&console.warn&&console.warn(s)}var S=Number.isNaN||function(a){return a!==a};function d(){d.init.call(this)}j.exports=d,j.exports.once=F,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var M=10;function N(s){if(typeof s!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof s)}Object.defineProperty(d,"defaultMaxListeners",{enumerable:!0,get:function(){return M},set:function(s){if(typeof s!="number"||s<0||S(s))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+s+".");M=s}}),d.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},d.prototype.setMaxListeners=function(a){if(typeof a!="number"||a<0||S(a))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+a+".");return this._maxListeners=a,this};function E(s){return s._maxListeners===void 0?d.defaultMaxListeners:s._maxListeners}d.prototype.getMaxListeners=function(){return E(this)},d.prototype.emit=function(a){for(var u=[],h=1;h<arguments.length;h++)u.push(arguments[h]);var m=a==="error",w=this._events;if(w!==void 0)m=m&&w.error===void 0;else if(!m)return!1;if(m){var P;if(u.length>0&&(P=u[0]),P instanceof Error)throw P;var X=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw X.context=P,X}var D=w[a];if(D===void 0)return!1;if(typeof D=="function")g(D,this,u);else for(var V=D.length,ue=te(D,V),h=0;h<V;++h)g(ue[h],this,u);return!0};function T(s,a,u,h){var m,w,P;if(N(u),w=s._events,w===void 0?(w=s._events=Object.create(null),s._eventsCount=0):(w.newListener!==void 0&&(s.emit("newListener",a,u.listener?u.listener:u),w=s._events),P=w[a]),P===void 0)P=w[a]=u,++s._eventsCount;else if(typeof P=="function"?P=w[a]=h?[u,P]:[P,u]:h?P.unshift(u):P.push(u),m=E(s),m>0&&P.length>m&&!P.warned){P.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=s,X.type=a,X.count=P.length,O(X)}return s}d.prototype.addListener=function(a,u){return T(this,a,u,!1)},d.prototype.on=d.prototype.addListener,d.prototype.prependListener=function(a,u){return T(this,a,u,!0)};function G(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(s,a,u){var h={fired:!1,wrapFn:void 0,target:s,type:a,listener:u},m=G.bind(h);return m.listener=u,h.wrapFn=m,m}d.prototype.once=function(a,u){return N(u),this.on(a,b(this,a,u)),this},d.prototype.prependOnceListener=function(a,u){return N(u),this.prependListener(a,b(this,a,u)),this},d.prototype.removeListener=function(a,u){var h,m,w,P,X;if(N(u),m=this._events,m===void 0)return this;if(h=m[a],h===void 0)return this;if(h===u||h.listener===u)--this._eventsCount===0?this._events=Object.create(null):(delete m[a],m.removeListener&&this.emit("removeListener",a,h.listener||u));else if(typeof h!="function"){for(w=-1,P=h.length-1;P>=0;P--)if(h[P]===u||h[P].listener===u){X=h[P].listener,w=P;break}if(w<0)return this;w===0?h.shift():q(h,w),h.length===1&&(m[a]=h[0]),m.removeListener!==void 0&&this.emit("removeListener",a,X||u)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(a){var u,h,m;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[a]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[a]),this;if(arguments.length===0){var w=Object.keys(h),P;for(m=0;m<w.length;++m)P=w[m],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(u=h[a],typeof u=="function")this.removeListener(a,u);else if(u!==void 0)for(m=u.length-1;m>=0;m--)this.removeListener(a,u[m]);return this};function H(s,a,u){var h=s._events;if(h===void 0)return[];var m=h[a];return m===void 0?[]:typeof m=="function"?u?[m.listener||m]:[m]:u?U(m):te(m,m.length)}d.prototype.listeners=function(a){return H(this,a,!0)},d.prototype.rawListeners=function(a){return H(this,a,!1)},d.listenerCount=function(s,a){return typeof s.listenerCount=="function"?s.listenerCount(a):Q.call(s,a)},d.prototype.listenerCount=Q;function Q(s){var a=this._events;if(a!==void 0){var u=a[s];if(typeof u=="function")return 1;if(u!==void 0)return u.length}return 0}d.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function te(s,a){for(var u=new Array(a),h=0;h<a;++h)u[h]=s[h];return u}function q(s,a){for(;a+1<s.length;a++)s[a]=s[a+1];s.pop()}function U(s){for(var a=new Array(s.length),u=0;u<a.length;++u)a[u]=s[u].listener||s[u];return a}function F(s,a){return new Promise(function(u,h){function m(P){s.removeListener(a,w),h(P)}function w(){typeof s.removeListener=="function"&&s.removeListener("error",m),u([].slice.call(arguments))}R(s,a,w,{once:!0}),a!=="error"&&I(s,m,{once:!0})})}function I(s,a,u){typeof s.on=="function"&&R(s,"error",a,u)}function R(s,a,u,h){if(typeof s.on=="function")h.once?s.once(a,u):s.on(a,u);else if(typeof s.addEventListener=="function")s.addEventListener(a,function m(w){h.once&&s.removeEventListener(a,m),u(w)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof s)}},666:function(j){var L=function(g){"use strict";var A=Object.prototype,O=A.hasOwnProperty,S,d=typeof Symbol=="function"?Symbol:{},M=d.iterator||"@@iterator",N=d.asyncIterator||"@@asyncIterator",E=d.toStringTag||"@@toStringTag";function T(f,c,p){return Object.defineProperty(f,c,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[c]}try{T({},"")}catch(f){T=function(c,p,x){return c[p]=x}}function G(f,c,p,x){var C=c&&c.prototype instanceof F?c:F,Z=Object.create(C.prototype),ne=new ue(x||[]);return Z._invoke=P(f,p,ne),Z}g.wrap=G;function b(f,c,p){try{return{type:"normal",arg:f.call(c,p)}}catch(x){return{type:"throw",arg:x}}}var H="suspendedStart",Q="suspendedYield",te="executing",q="completed",U={};function F(){}function I(){}function R(){}var s={};T(s,M,function(){return this});var a=Object.getPrototypeOf,u=a&&a(a(re([])));u&&u!==A&&O.call(u,M)&&(s=u);var h=R.prototype=F.prototype=Object.create(s);I.prototype=R,T(h,"constructor",R),T(R,"constructor",I),I.displayName=T(R,E,"GeneratorFunction");function m(f){["next","throw","return"].forEach(function(c){T(f,c,function(p){return this._invoke(c,p)})})}g.isGeneratorFunction=function(f){var c=typeof f=="function"&&f.constructor;return c?c===I||(c.displayName||c.name)==="GeneratorFunction":!1},g.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,R):(f.__proto__=R,T(f,E,"GeneratorFunction")),f.prototype=Object.create(h),f},g.awrap=function(f){return{__await:f}};function w(f,c){function p(Z,ne,oe,ae){var ee=b(f[Z],f,ne);if(ee.type==="throw")ae(ee.arg);else{var me=ee.arg,de=me.value;return de&&typeof de=="object"&&O.call(de,"__await")?c.resolve(de.__await).then(function(le){p("next",le,oe,ae)},function(le){p("throw",le,oe,ae)}):c.resolve(de).then(function(le){me.value=le,oe(me)},function(le){return p("throw",le,oe,ae)})}}var x;function C(Z,ne){function oe(){return new c(function(ae,ee){p(Z,ne,ae,ee)})}return x=x?x.then(oe,oe):oe()}this._invoke=C}m(w.prototype),T(w.prototype,N,function(){return this}),g.AsyncIterator=w,g.async=function(f,c,p,x,C){C===void 0&&(C=Promise);var Z=new w(G(f,c,p,x),C);return g.isGeneratorFunction(c)?Z:Z.next().then(function(ne){return ne.done?ne.value:Z.next()})};function P(f,c,p){var x=H;return function(Z,ne){if(x===te)throw new Error("Generator is already running");if(x===q){if(Z==="throw")throw ne;return ve()}for(p.method=Z,p.arg=ne;;){var oe=p.delegate;if(oe){var ae=X(oe,p);if(ae){if(ae===U)continue;return ae}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(x===H)throw x=q,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);x=te;var ee=b(f,c,p);if(ee.type==="normal"){if(x=p.done?q:Q,ee.arg===U)continue;return{value:ee.arg,done:p.done}}else ee.type==="throw"&&(x=q,p.method="throw",p.arg=ee.arg)}}}function X(f,c){var p=f.iterator[c.method];if(p===S){if(c.delegate=null,c.method==="throw"){if(f.iterator.return&&(c.method="return",c.arg=S,X(f,c),c.method==="throw"))return U;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return U}var x=b(p,f.iterator,c.arg);if(x.type==="throw")return c.method="throw",c.arg=x.arg,c.delegate=null,U;var C=x.arg;if(!C)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,U;if(C.done)c[f.resultName]=C.value,c.next=f.nextLoc,c.method!=="return"&&(c.method="next",c.arg=S);else return C;return c.delegate=null,U}m(h),T(h,E,"Generator"),T(h,M,function(){return this}),T(h,"toString",function(){return"[object Generator]"});function D(f){var c={tryLoc:f[0]};1 in f&&(c.catchLoc=f[1]),2 in f&&(c.finallyLoc=f[2],c.afterLoc=f[3]),this.tryEntries.push(c)}function V(f){var c=f.completion||{};c.type="normal",delete c.arg,f.completion=c}function ue(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(D,this),this.reset(!0)}g.keys=function(f){var c=[];for(var p in f)c.push(p);return c.reverse(),function x(){for(;c.length;){var C=c.pop();if(C in f)return x.value=C,x.done=!1,x}return x.done=!0,x}};function re(f){if(f){var c=f[M];if(c)return c.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,x=function C(){for(;++p<f.length;)if(O.call(f,p))return C.value=f[p],C.done=!1,C;return C.value=S,C.done=!0,C};return x.next=x}}return{next:ve}}g.values=re;function ve(){return{value:S,done:!0}}return ue.prototype={constructor:ue,reset:function(f){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(V),!f)for(var c in this)c.charAt(0)==="t"&&O.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=S)},stop:function(){this.done=!0;var f=this.tryEntries[0],c=f.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var c=this;function p(ae,ee){return Z.type="throw",Z.arg=f,c.next=ae,ee&&(c.method="next",c.arg=S),!!ee}for(var x=this.tryEntries.length-1;x>=0;--x){var C=this.tryEntries[x],Z=C.completion;if(C.tryLoc==="root")return p("end");if(C.tryLoc<=this.prev){var ne=O.call(C,"catchLoc"),oe=O.call(C,"finallyLoc");if(ne&&oe){if(this.prev<C.catchLoc)return p(C.catchLoc,!0);if(this.prev<C.finallyLoc)return p(C.finallyLoc)}else if(ne){if(this.prev<C.catchLoc)return p(C.catchLoc,!0)}else if(oe){if(this.prev<C.finallyLoc)return p(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,c){for(var p=this.tryEntries.length-1;p>=0;--p){var x=this.tryEntries[p];if(x.tryLoc<=this.prev&&O.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var C=x;break}}C&&(f==="break"||f==="continue")&&C.tryLoc<=c&&c<=C.finallyLoc&&(C=null);var Z=C?C.completion:{};return Z.type=f,Z.arg=c,C?(this.method="next",this.next=C.finallyLoc,U):this.complete(Z)},complete:function(f,c){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&c&&(this.next=c),U},finish:function(f){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),V(p),U}},catch:function(f){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.tryLoc===f){var x=p.completion;if(x.type==="throw"){var C=x.arg;V(p)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(f,c,p){return this.delegate={iterator:re(f),resultName:c,nextLoc:p},this.method==="next"&&(this.arg=S),U}},g}(j.exports);try{regeneratorRuntime=L}catch(g){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},695:function(j,L,g){g.d(L,{Z:function(){return A}});function A(O){if(O.geometry&&O.geometry.dispose(),O.material){var S=Array.isArray(O.material)?O.material:[O.material];S.forEach(function(d){var M,N,E,T,G,b,H,Q,te,q,U,F,I;(M=d.map)===null||M===void 0||M.dispose(),(N=d.lightMap)===null||N===void 0||N.dispose(),(E=d.bumpMap)===null||E===void 0||E.dispose(),(T=d.normalMap)===null||T===void 0||T.dispose(),(G=d.specularMap)===null||G===void 0||G.dispose(),(b=d.envMap)===null||b===void 0||b.dispose(),(H=d.alphaMap)===null||H===void 0||H.dispose(),(Q=d.aoMap)===null||Q===void 0||Q.dispose(),(te=d.displacementMap)===null||te===void 0||te.dispose(),(q=d.emissiveMap)===null||q===void 0||q.dispose(),(U=d.gradientMap)===null||U===void 0||U.dispose(),(F=d.metalnessMap)===null||F===void 0||F.dispose(),(I=d.roughnessMap)===null||I===void 0||I.dispose(),d.dispose()})}}},584:function(j,L,g){g.d(L,{wf:function(){return d.Z},PO:function(){return E.Z}});var A=g(666),O=g.n(A),S=null,d=g(695),M=g(949);function N(F){if(F.material){var I=Array.isArray(F.material)?F.material:[F.material];I.forEach(function(R){var s,a;(s=R.color)===null||s===void 0||s.convertSRGBToLinear(),(a=R.emissive)===null||a===void 0||a.convertSRGBToLinear(),R.map&&(R.map.encoding=THREE.sRGBEncoding),R.emissiveMap&&(R.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=g(738),T=g(568),G=g(924),b=g(77),H=g(484),Q=null,te=null,q=function(){var F=(0,T.Z)(O().mark(function I(R,s){var a,u,h,m,w,P,X,D,V;return O().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return a=s.type,u=a===void 0?"blob":a,h=s.version,m=h===void 0?"1":h,re.next=4,(0,b.get)(R);case 4:if(P=re.sent,!(P&&P[m])){re.next=9;break}w=P[m],re.next=15;break;case 9:return re.next=11,(0,H.Z)(fetch(R).then(function(ve){if(ve.ok)return ve[u]();throw new Error}));case 11:X=re.sent,D=X.res,V=X.err,V||(w=D,(0,b.set)(R,(0,G.Z)({},m,D)));case 15:return re.abrupt("return",w?{url:u==="json"?R:URL.createObjectURL(w),store:w}:{url:R});case 16:case"end":return re.stop()}},I)}));return function(R,s){return F.apply(this,arguments)}}(),U=g(705)},738:function(j,L,g){g.d(L,{Z:function(){return O}});function A(S){return Object.prototype.toString.call(S)==="[object Object]"}function O(S){if(A(S)===!1)return!1;var d=S.constructor;if(d===void 0)return!0;var M=d.prototype;return!(A(M)===!1||M.hasOwnProperty("isPrototypeOf")===!1)}},484:function(j,L,g){g.d(L,{Z:function(){return O}});var A=g(42);function O(S){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return S.then(function(M){return(0,A.Z)({err:null,res:M},d)}).catch(function(M){return(0,A.Z)({err:M,res:void 0},d)})}},705:function(j,L,g){var A=g(949),O=new Map,S=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(N,E,T,G,b){var H=E[T*3],Q=E[T*3+1],te=E[G*3],q=E[G*3+1],U=E[b*3],F=E[b*3+1],I;if(O.has(N))I=O.get(N);else{var R=M.box3||new THREE.Box3;if(!M.box3){var s=N.parameters.shapes.getPoints();R.setFromArray(s.map(function(w){return[w.x,w.y,0]}).flat())}var a=R.getSize(new THREE.Vector3);M.split&&(a.y/=M.split),I={box:R,size:a},O.set(N,I)}var u=I.box,h=I.size,m=M.split?1-M.split:0;return[new THREE.Vector2((H-u.min.x)/h.x,(Q-u.min.y)/h.y+m),new THREE.Vector2((te-u.min.x)/h.x,(q-u.min.y)/h.y+m),new THREE.Vector2((U-u.min.x)/h.x,(F-u.min.y)/h.y+m)]},generateSideWallUV:function(N,E,T,G,b,H){var Q=E[T*3],te=E[T*3+1],q=E[T*3+2],U=E[G*3],F=E[G*3+1],I=E[G*3+2],R=E[b*3],s=E[b*3+1],a=E[b*3+2],u=E[H*3],h=E[H*3+1],m=E[H*3+2],w;if(O.has(E))w=O.get(E);else{var P=new THREE.Box3;P.setFromArray(E);var X=P.getSize(new THREE.Vector3);M.split&&(X.z/=1-M.split),w={box:P,size:X},O.set(E,w)}var D=w.box,V=w.size;return Math.abs(te-F)<Math.abs(Q-U)?[new THREE.Vector2((Q-D.min.x)/V.x,(q-D.min.z)/V.z),new THREE.Vector2((U-D.min.x)/V.x,(I-D.min.z)/V.z),new THREE.Vector2((R-D.min.x)/V.x,(a-D.min.z)/V.z),new THREE.Vector2((u-D.min.x)/V.x,(m-D.min.z)/V.z)]:[new THREE.Vector2((te-D.min.y)/V.y,(q-D.min.z)/V.z),new THREE.Vector2((F-D.min.y)/V.y,(I-D.min.z)/V.z),new THREE.Vector2((s-D.min.y)/V.y,(a-D.min.z)/V.z),new THREE.Vector2((h-D.min.y)/V.y,(m-D.min.z)/V.z)]}}},d=function(){O.clear()}},77:function(j,L,g){var A=S=>{var d={};return g.d(d,S),d},O=S=>()=>S;j.exports=A({get:()=>Re.get,set:()=>Re.set})},949:function(j,L,g){var A=S=>{var d={};return g.d(d,S),d},O=S=>()=>S;j.exports=A({ACESFilmicToneMapping:()=>K.ACESFilmicToneMapping,AxesHelper:()=>K.AxesHelper,Box3:()=>K.Box3,Camera:()=>K.Camera,CineonToneMapping:()=>K.CineonToneMapping,Clock:()=>K.Clock,Euler:()=>K.Euler,Group:()=>K.Group,LinearEncoding:()=>K.LinearEncoding,LinearToneMapping:()=>K.LinearToneMapping,Mesh:()=>K.Mesh,NoToneMapping:()=>K.NoToneMapping,PerspectiveCamera:()=>K.PerspectiveCamera,Points:()=>K.Points,Raycaster:()=>K.Raycaster,ReinhardToneMapping:()=>K.ReinhardToneMapping,Scene:()=>K.Scene,Sprite:()=>K.Sprite,UnsignedByteType:()=>K.UnsignedByteType,Vector2:()=>K.Vector2,Vector3:()=>K.Vector3,WebGLRenderer:()=>K.WebGLRenderer})},568:function(j,L,g){g.d(L,{Z:function(){return O}});function A(S,d,M,N,E,T,G){try{var b=S[T](G),H=b.value}catch(Q){M(Q);return}b.done?d(H):Promise.resolve(H).then(N,E)}function O(S){return function(){var d=this,M=arguments;return new Promise(function(N,E){var T=S.apply(d,M);function G(H){A(T,N,E,G,b,"next",H)}function b(H){A(T,N,E,G,b,"throw",H)}G(void 0)})}}},924:function(j,L,g){g.d(L,{Z:function(){return A}});function A(O,S,d){return S in O?Object.defineProperty(O,S,{value:d,enumerable:!0,configurable:!0,writable:!0}):O[S]=d,O}},42:function(j,L,g){g.d(L,{Z:function(){return O}});var A=g(924);function O(S){for(var d=1;d<arguments.length;d++){var M=arguments[d]!=null?arguments[d]:{},N=Object.keys(M);typeof Object.getOwnPropertySymbols=="function"&&(N=N.concat(Object.getOwnPropertySymbols(M).filter(function(E){return Object.getOwnPropertyDescriptor(M,E).enumerable}))),N.forEach(function(E){(0,A.Z)(S,E,M[E])})}return S}}},Ae={};function $(j){var L=Ae[j];if(L!==void 0)return L.exports;var g=Ae[j]={exports:{}};return Ze[j](g,g.exports,$),g.exports}(function(){$.n=function(j){var L=j&&j.__esModule?function(){return j.default}:function(){return j};return $.d(L,{a:L}),L}})(),function(){$.d=function(j,L){for(var g in L)$.o(L,g)&&!$.o(j,g)&&Object.defineProperty(j,g,{enumerable:!0,get:L[g]})}}(),function(){$.o=function(j,L){return Object.prototype.hasOwnProperty.call(j,L)}}();var ye={};(function(){$.d(ye,{L6:function(){return Ve},sb:function(){return u},z:function(){return Ee},ZP:function(){return Ee}});function j(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}function L(o,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,e.key,e)}}function g(o,n,t){return n&&L(o.prototype,n),t&&L(o,t),o}var A=$(42);function O(o,n){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,e)}return t}function S(o,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(n,t))}),o}function d(o,n){(n==null||n>o.length)&&(n=o.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=o[t];return e}function M(o){if(Array.isArray(o))return d(o)}function N(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(o,n){if(!!o){if(typeof o=="string")return d(o,n);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(o,n)}}function G(o){return M(o)||N(o)||T(o)||E()}var b=$(949),H=$(187),Q=o=>{var n={};return $.d(n,o),n},te=o=>()=>o,q=Q({default:()=>Ie.default}),U=o=>{var n={};return $.d(n,o),n},F=o=>()=>o,I=U({default:()=>He.default}),R=o=>{var n={};return $.d(n,o),n},s=o=>()=>o,a=R({default:()=>Ue.default}),u=function(){"use strict";function o(t){j(this,o),this.guiParams={},t&&(this.guiParams=t)}var n=o.prototype;return n.showGui=function(e){var r=this;!e||Object.keys(this.guiParams).forEach(function(i){var l=e.addFolder(i),v=r.guiParams[i];Object.keys(v).forEach(function(_){var y=v[_],z=y.min,B=y.max,k=y.step,Y=y.name,J=y.paramMap,ce=y.items,se=y.value,ie=y.target,he=_.toLowerCase().indexOf("color")>-1,W,_e=typeof se=="undefined"&&ie,we=_e?ie():v[_],Ce=_e?_:"value";ce?W=l.add(we,Ce,ce):he?W=l.addColor(we,Ce):W=l.add(we,Ce),W=W.name(Y||_),typeof z!="undefined"&&(W=W.min(z)),typeof B!="undefined"&&(W=W.max(B)),typeof k!="undefined"&&(W=W.step(k)),W=W.onChange(function(){r.setTargetValue(i,_,we[Ce],J)}),_e&&W.listen()})})},n.setTargetValue=function(e,r,i,l){var v=this.guiParams[e][r],_=v.onChange,y=v.target,z=v.value,B=r.toLowerCase().indexOf("color")>-1,k=typeof z=="undefined"&&y;if(y&&!k){var Y=y();Array.isArray(Y)||(Y=[Y]),Y.forEach(function(J){if(!!J)if(B)try{J[l||r].set(i)}catch(ce){r!=="color"&&!l&&console.warn("".concat(r," is not a color,set paramMap"))}else J[l||r]=i})}_&&_(i)},n.setTargetValueByParams=function(){var e=this;Object.keys(this.guiParams).forEach(function(r){Object.keys(e.guiParams[r]).forEach(function(i){var l=e.guiParams[r][i];typeof l.value!="undefined"&&e.setTargetValue(r,i,l.value,l.paramMap)})})},o}(),h={None:b.NoToneMapping,Linear:b.LinearToneMapping,Reinhard:b.ReinhardToneMapping,Cineon:b.CineonToneMapping,ACESFilmic:b.ACESFilmicToneMapping},m={antialias:!1,devicePixelRatio:window.devicePixelRatio,powerPreference:"high-performance",toneMapping:"None",toneMappingExposure:1,alpha:!1,outputEncoding:b.LinearEncoding,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,context:null,stencil:!1,depth:!1,physicallyCorrectLights:!1},w=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.width,r=t.height,i=t.rendererParams,l=i.context,v=i.alpha,_=i.devicePixelRatio,y=i.antialias,z=i.powerPreference,B=i.toneMapping,k=i.toneMappingExposure,Y=i.outputEncoding,J=i.logarithmicDepthBuffer,ce=i.preserveDrawingBuffer,se=i.stencil,ie=i.depth,he=i.physicallyCorrectLights,W=new b.WebGLRenderer({context:l,alpha:v,antialias:y,powerPreference:z,logarithmicDepthBuffer:J,preserveDrawingBuffer:ce,stencil:se,depth:ie});W.setSize(e,r),W.setPixelRatio(_),W.toneMapping=h[B],W.toneMappingExposure=k,W.outputEncoding=Y,W.physicallyCorrectLights=he,this.renderer=W}var n=o.prototype;return n.setSize=function(e,r){this.renderer.setSize(e,r)},n.render=function(){var e=this.options,r=e.scene,i=e.camera;this.renderer.render(r,i)},n.setGui=function(e){var r=this,i=new u({renderer:{toneMapping:{value:this.options.rendererParams.toneMapping,items:h,target:function(){return r.renderer}},toneMappingExposure:{value:this.options.rendererParams.toneMappingExposure,min:0,max:Math.pow(2,4),target:function(){return r.renderer}}}});i.showGui(e)},n.dispose=function(){var e,r,i;(e=this.renderer)===null||e===void 0||e.clear(),(r=this.renderer)===null||r===void 0||r.dispose(),(i=this.renderer)===null||i===void 0||i.renderLists.dispose()},o}(),P={fov:45,near:1,far:1e3},X=function(){"use strict";function o(t){j(this,o),this.oldCameraPosition=new b.Vector3,this.oldCameraRotation=new b.Euler,this.customCamera=!1,this.options=t;var e=t.width,r=t.height,i=t.cameraParams;if(i instanceof b.Camera)this.camera=i,this.customCamera=!0;else{var l=i.fov,v=i.far,_=i.near,y=new b.PerspectiveCamera(l,e/r,_,v);y.position.set(0,0,400),y.lookAt(0,0,0),this.camera=y}}var n=o.prototype;return n.checkCameraChange=function(){var e=this.camera,r=this.oldCameraPosition.equals(e.position)&&this.oldCameraRotation.equals(e.rotation);return this.oldCameraPosition=e.position.clone(),this.oldCameraRotation=e.rotation.clone(),!r},n.setSize=function(e,r){this.camera instanceof b.PerspectiveCamera&&(this.camera.aspect=e/r),this.camera.updateProjectionMatrix()},n.setGui=function(e){var r=this,i=new u({camera:{x:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},y:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},z:{min:-1e4,max:1e4,step:1,target:function(){return r.camera.position}},near:{min:0,max:1e3,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}},far:{min:0,max:2e4,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}}});this.camera instanceof b.PerspectiveCamera&&(i.guiParams.camera.fov={min:0,max:90,step:1,target:function(){return r.camera},onChange:function(l){r.camera.updateProjectionMatrix()}}),i.showGui(e)},o}(),D=$(584),V={background:null},ue=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.sceneParams,i=r.background,l=new b.Scene;i&&(l.background=i),l.add(e),this.scene=l}var n=o.prototype;return n.addAxesHelper=function(){var e,r=new b.AxesHelper(100);(e=this.scene)===null||e===void 0||e.add(r)},n.dispose=function(){var e;(e=this.scene)===null||e===void 0||e.traverse(function(r){(0,D.wf)(r)})},o}(),re=o=>{var n={};return $.d(n,o),n},ve=o=>()=>o,f=re({MapControls:()=>je.MapControls,OrbitControls:()=>je.OrbitControls}),c={},p=function(){"use strict";function o(t){j(this,o),this.options=t;var e=t.camera,r=t.controlParams,i=t.mapControl,l=r.domElement,v=i?new f.MapControls(e,l):new f.OrbitControls(e,l);v.minPolarAngle=Math.PI*.15,v.maxPolarAngle=Math.PI*.85,v.enableDamping=!0,v.dampingFactor=.063,v.autoRotate=!1,v.autoRotateSpeed=-60,v.enableZoom=!0,v.zoomSpeed=.2,this.control=v}var n=o.prototype;return n.limitPan=function(e){var r=e.maxX,i=r===void 0?1/0:r,l=e.minX,v=l===void 0?-1/0:l,_=e.maxZ,y=_===void 0?1/0:_,z=e.minZ,B=z===void 0?-1/0:z,k=e.maxY,Y=k===void 0?1/0:k,J=e.minY,ce=J===void 0?-1/0:J,se=this.limitPanV||new b.Vector3,ie=this.control,he=this.options.camera,W=new b.Vector3(v,ce,B),_e=new b.Vector3(i,Y,y);this.limitPanV=se,se.copy(ie.target),ie.target.clamp(W,_e),se.sub(ie.target),he.position.sub(se)},n.update=function(){this.control.update()},n.dispose=function(){this.control.dispose()},o}(),x=o=>{var n={};return $.d(n,o),n},C=o=>()=>o,Z=x({CSS3DObject:()=>Se.CSS3DObject,CSS3DRenderer:()=>Se.CSS3DRenderer,CSS3DSprite:()=>Se.CSS3DSprite}),ne=o=>{var n={};return $.d(n,o),n},oe=o=>()=>o,ae=ne({CSS2DObject:()=>Me.CSS2DObject,CSS2DRenderer:()=>Me.CSS2DRenderer}),ee={zIndex:"auto"},me=function(){"use strict";function o(t){j(this,o),this.container=t}var n=o.prototype;return n.addRenderer=function(e,r){var i=this.container,l=i.offsetWidth,v=i.offsetHeight,_=e==="css2d"?new ae.CSS2DRenderer:new Z.CSS3DRenderer;_.domElement.style.position="absolute",_.domElement.style.top="0",_.domElement.style.pointerEvents="none",_.domElement.style.zIndex=r.zIndex,_.setSize(l,v),i.appendChild(_.domElement),e==="css2d"?this.css2Drenderer=_:e==="css3d"&&(this.css3Drenderer=_)},n.setSize=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.setSize(e,r),(l=this.css3Drenderer)===null||l===void 0||l.setSize(e,r)},n.render=function(e,r){var i,l;(i=this.css2Drenderer)===null||i===void 0||i.render(e,r),(l=this.css3Drenderer)===null||l===void 0||l.render(e,r)},n.dispose=function(){this.css2Drenderer=void 0,this.css3Drenderer=void 0},o}(),de=o=>{var n={};return $.d(n,o),n},le=o=>()=>o,fe=de({BlendFunction:()=>pe.BlendFunction,CopyPass:()=>pe.CopyPass,EffectComposer:()=>pe.EffectComposer,EffectPass:()=>pe.EffectPass,FXAAEffect:()=>pe.FXAAEffect,RenderPass:()=>pe.RenderPass,SelectiveBloomEffect:()=>pe.SelectiveBloomEffect}),Te={luminanceThreshold:.1,luminanceSmoothing:.3,mipmapBlur:!0,intensity:4},De=function(){"use strict";function o(t){j(this,o),this.active=!0,this.options=t;var e=t.renderer,r=t.scene,i=t.camera,l=t.composerParams,v=l.multisampling,_=e.capabilities.maxSamples,y=new fe.EffectComposer(e,{multisampling:Math.min(v,_)});y.addPass(new fe.RenderPass(r,i)),this.finalComposer=y,this.renderer=e,this.scene=r,this.camera=i}var n=o.prototype;return n.addCopyPass=function(){var e=new fe.CopyPass;e.renderToScreen=!0,this.finalComposer.addPass(e),this.copyPass=e},n.addFXAAPass=function(){var e=this.camera,r=new fe.FXAAEffect({blendFunction:fe.BlendFunction.NORMAL}),i=new fe.EffectPass(e,r);this.finalComposer.addPass(i),this.fxaaPass=i},n.addBloomPass=function(e){var r=this,i=r.camera,l=r.scene,v=new fe.SelectiveBloomEffect(l,i,(0,A.Z)({},e)),_=new fe.EffectPass(i,v);_.enabled=!1,this.finalComposer.addPass(_),this.bloomPass=_,this.bloomEffect=v},n.addBloomGui=function(e){var r=this;if(!!this.bloomEffect){var i=new u({bloom:{intensity:{min:0,max:10,step:.01,target:function(){return r.bloomEffect}}},bloomLuminanceFilter:{enabled:{value:this.bloomEffect.luminancePass.enabled,onChange:function(l){r.bloomEffect.luminancePass.enabled=l}},threshold:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}},smoothing:{min:0,max:1,step:.01,target:function(){return r.bloomEffect.luminanceMaterial}}}});i.showGui(e)}},n.toggleBloomSelection=function(e){if(!this.bloomEffect||!this.bloomPass){console.warn("err:pencil.options.bloom");return}this.bloomEffect.selection.toggle(e),this.bloomPass.enabled=!!this.bloomEffect.selection.size},n.getSize=function(){var e=this.options.renderer;return e.getSize(new b.Vector2)},n.enable=function(){this.active||(this.active=!0)},n.disable=function(){!this.active||(this.active=!1)},n.setSize=function(e,r){this.finalComposer.setSize(e,r)},n.render=function(){!this.active||this.finalComposer.render()},n.dispose=function(){this.finalComposer.dispose()},o}(),ze=function(){try{var o=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&o.getContext("webgl2"))}catch(n){return!1}},Ye=0,ge=!1,xe=ze()!==!1,Ee=function(){"use strict";function o(t){j(this,o),this.raycaster=new b.Raycaster,this.installPlugins=new Map,this.event=new H.EventEmitter,this.clock=new b.Clock,this.userData={},this.options=(0,q.default)(o.options,t,{isMergeableObject:D.PO});var e=this.options,r=e.container,i=e.stats,l=e.gui,v=e.resizeObserver;if(l){var _=new a.default;_.open(!1),this.gui=_}if(i){var y=new I.default;y.showPanel(0),y.dom.style.position="absolute",r.appendChild(y.dom),this.stats=y}this.init(),this.initComposer(),this.initCSSRenderer(),this.initControl(),v&&this.initResizeObserver(),this.clock.getDelta(),this.clock.getElapsedTime()}var n=o.prototype;return n.use=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];if(this.installPlugins.has(e))console.log("plugin already installed");else if(typeof e.install=="function"){var v;(v=e).install.apply(v,[this].concat(G(i))),this.installPlugins.set(e,!0)}},n.init=function(){var e=this.options,r=e.container,i=e.isdev,l=e.axesHelper,v=e.renderer,_=e.scene,y=e.camera,z=this.getSize(),B=z.width,k=z.height,Y=new X({isdev:i,width:B,height:k,cameraParams:y});this.gui&&Y.setGui(this.gui);var J=Y.camera,ce=new ue({camera:J,sceneParams:_}),se=ce.scene,ie=new w({width:B,height:k,scene:se,camera:J,isdev:i,rendererParams:S((0,A.Z)({},v),{antialias:!1})});this.gui&&ie.setGui(this.gui);var he=ie.renderer;l&&ce.addAxesHelper(),this.sceneController=ce,this.rendererController=ie,this.cameraController=Y,r.appendChild(he.domElement)},n.initComposer=function(){var e=this.options,r=e.bloom,i=e.bloomParams,l=e.renderer,v=e.multisampling,_=e.passes,y=l.antialias;y==="msaa"&&!xe&&(y=!1,console.warn("MSAA is not supported on this browser"));var z=new De({renderer:this.renderer,scene:this.scene,camera:this.camera,composerParams:{multisampling:y==="msaa"?v:0,type:b.UnsignedByteType,encoding:l.outputEncoding}});this.composerController=z,r&&(z.addBloomPass(i),this.gui&&z.addBloomGui(this.gui)),y==="fxaa"&&z.addFXAAPass(),_&&_.forEach(function(B){z.finalComposer.addPass(B)}),z.addCopyPass()},n.initCSSRenderer=function(){var e=this.options,r=e.container,i=e.css2DRenderer,l=e.css3DRenderer,v=e.css2DRendererParams,_=e.css3DRendererParams;if(i||l){var y=new me(r);i&&y.addRenderer("css2d",v),l&&y.addRenderer("css3d",_),this.cssRendererController=y}},n.initControl=function(){var e=this.options,r=e.control,i=e.mapControl,l=e.controlParams;if(r){var v=new p({camera:this.camera,controlParams:{domElement:(l==null?void 0:l.domElement)||this.renderer.domElement},mapControl:i});this.controlController=v}},n.getSize=function(){var e=this.options.container;return{width:e.offsetWidth,height:e.offsetHeight}},n.initResizeObserver=function(){var e=this,r=this.options.container;if(!this.resizeObserver){var i=new ResizeObserver(function(l){var v=!0,_=!1,y=void 0;try{for(var z=l[Symbol.iterator](),B;!(v=(B=z.next()).done);v=!0){var k=B.value,Y=k.contentRect;e.handeleResize(Y.width,Y.height),e.render()}}catch(J){_=!0,y=J}finally{try{!v&&z.return!=null&&z.return()}finally{if(_)throw y}}});i.observe(r),this.resizeObserver=i}},n.handeleResize=function(e,r){var i=this,l=i.rendererController,v=i.cameraController,_=i.composerController,y=i.cssRendererController;v==null||v.setSize(e,r),l==null||l.setSize(e,r),_==null||_.setSize(e,r),y==null||y.setSize(e,r),this.installPlugins.forEach(function(z,B){var k;(k=B.setSize)===null||k===void 0||k.call(B,e,r)}),this.event.emit("resize",{width:e,height:r})},n.pick=function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=this,v=l.raycaster,_=l.options,y=_.container,z=new b.Vector2,B=y.getBoundingClientRect();if(z.x=(e.clientX-B.left)/(B.right-B.left)*2-1,z.y=-((e.clientY-B.top)/(B.bottom-B.top))*2+1,this.camera&&this.scene){v.setFromCamera(z,this.camera);var k=v.intersectObjects(r||this.scene.children,i);if(k.length)return{object:k[0].object,intersects:k}}},n.render=function(){var e,r,i,l,v=this,_=v.renderer,y=v.scene,z=v.camera,B=v.clock;if(!(!_||!y||!z||this.options.staticRender&&!this.cameraController.checkCameraChange())){var k=B.getDelta(),Y=B.getElapsedTime();if((e=this.controlController)===null||e===void 0||e.update(),this.installPlugins.forEach(function(ce,se){var ie;(ie=se.update)===null||ie===void 0||ie.call(se,k,Y)}),!((r=this.composerController)===null||r===void 0)&&r.active)this.composerController.render();else{var J;(J=this.rendererController)===null||J===void 0||J.render()}(i=this.cssRendererController)===null||i===void 0||i.render(y,z),(l=this.stats)===null||l===void 0||l.update(),this.event.emit("render",{delta:k,elapsed:Y})}},n.start=function(){this.renderer.setAnimationLoop(this.render.bind(this)),this.event.emit("start")},n.stop=function(){this.renderer.setAnimationLoop(null),this.event.emit("stop")},n.dispose=function(){var e,r,i,l,v,_,y;this.stop(),this.handeleResize(0,0),(e=this.resizeObserver)===null||e===void 0||e.unobserve(this.options.container),this.installPlugins.forEach(function(z,B){var k;(k=B.dispose)===null||k===void 0||k.call(B)}),(r=this.controlController)===null||r===void 0||r.dispose(),(i=this.cssRendererController)===null||i===void 0||i.dispose(),(l=this.sceneController)===null||l===void 0||l.dispose(),(v=this.composerController)===null||v===void 0||v.dispose(),(_=this.rendererController)===null||_===void 0||_.dispose(),this.controlController=void 0,this.cssRendererController=void 0,(y=this.gui)===null||y===void 0||y.destroy(),this.event.removeAllListeners(),this.installPlugins.clear()},g(o,[{key:"renderer",get:function(){return this.rendererController.renderer}},{key:"control",get:function(){var e;return(e=this.controlController)===null||e===void 0?void 0:e.control}},{key:"camera",get:function(){return this.cameraController.camera}},{key:"scene",get:function(){return this.sceneController.scene}}]),o}();Ee.options={isdev:ge,stats:ge,gui:ge,axesHelper:ge,control:ge,resizeObserver:!0,renderer:S((0,A.Z)({},m),{antialias:xe?"msaa":"fxaa"}),staticRender:!1,multisampling:4,scene:V,camera:P,bloom:!1,bloomParams:Te,css2DRenderer:!1,css2DRendererParams:(0,A.Z)({},ee),css3DRenderer:!1,css3DRendererParams:(0,A.Z)({},ee)};function Pe(o,n){return Pe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},Pe(o,n)}function Be(o,n){return Pe(o,n)}function Ge(){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(o){return!1}}function be(o,n,t){return Ge()?be=Reflect.construct:be=function(r,i,l){var v=[null];v.push.apply(v,i);var _=Function.bind.apply(r,v),y=new _;return l&&Be(y,l.prototype),y},be.apply(null,arguments)}function Oe(o,n,t){return be.apply(null,arguments)}var ke=$(484);function Ne(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),o&&(t.promise=(0,ke.Z)(t.promise,n)),t}var Le=function(o){o&&((0,D.wf)(o),o.children.forEach(function(n){n.userData.BaseObject_||Le(n)}))},Ve=function(){"use strict";function o(){j(this,o),this.objecttype__="BaseObject",this.userData={},this.pm=Ne(),this.visible=!1}var n=o.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(e,r){},n.resize=function(e,r){},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,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(b.Mesh,G(r)),this},n.createGroup=function(){return this.object3d=new b.Group,this},n.createPoints=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return this.object3d=Oe(b.Points,G(r)),this},n.createCSS2DObject=function(e){return this.object3d=new ae.CSS2DObject(e),this},n.createCSS3DObject=function(e){return this.object3d=new Z.CSS3DObject(e),this},n.createCSS3DSprite=function(e){return this.object3d=new Z.CSS3DSprite(e),this},n.createSprite=function(e){return this.object3d=new b.Sprite(e),this},n.add=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).add.apply(l,G(r)),this},n.remove=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var l;return(l=this.object3d).remove.apply(l,G(r)),this},n.getSize=function(){var e=new b.Box3().setFromObject(this.object3d);return{min:e.min,max:e.max,size:e.getSize(new b.Vector3)}},n.traverse=function(e){e(this),this.children.forEach(function(r){r.traverse(e)})},n.dispose=function(){Le(this.object3d)},g(o,[{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})}}]),o}()})();var We=ye.L6,Fe=ye.sb,Xe=ye.z,Ke=ye.ZP;export{We as BaseObject,Fe as GUIObject,Xe as Pencil,Ke as default};
|