gl-draw 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ interface Options {
18
18
  split?: number;
19
19
  useGroups?: boolean;
20
20
  workerController?: WorkerController;
21
+ maxAnisotropy?: number;
21
22
  projection?: {
22
23
  center: [number, number];
23
24
  scale: number;
@@ -1,4 +1,4 @@
1
- (function(){var tt={666:function(L){var T=function(x){"use strict";var P=Object.prototype,O=P.hasOwnProperty,R,C=typeof Symbol=="function"?Symbol:{},U=C.iterator||"@@iterator",D=C.asyncIterator||"@@asyncIterator",G=C.toStringTag||"@@toStringTag";function w(f,l,p){return Object.defineProperty(f,l,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{w({},"")}catch(f){w=function(l,p,A){return l[p]=A}}function F(f,l,p,A){var M=l&&l.prototype instanceof Q?l:Q,q=Object.create(M.prototype),ue=new $(A||[]);return q._invoke=pe(f,p,ue),q}x.wrap=F;function Z(f,l,p){try{return{type:"normal",arg:f.call(l,p)}}catch(A){return{type:"throw",arg:A}}}var V="suspendedStart",u="suspendedYield",he="executing",J="completed",W={};function Q(){}function k(){}function E(){}var N={};w(N,U,function(){return this});var ie=Object.getPrototypeOf,ee=ie&&ie(ie(ye([])));ee&&ee!==P&&O.call(ee,U)&&(N=ee);var H=E.prototype=Q.prototype=Object.create(N);k.prototype=E,w(H,"constructor",E),w(E,"constructor",k),k.displayName=w(E,G,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(l){w(f,l,function(p){return this._invoke(l,p)})})}x.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===k||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,E):(f.__proto__=E,w(f,G,"GeneratorFunction")),f.prototype=Object.create(H),f},x.awrap=function(f){return{__await:f}};function se(f,l){function p(q,ue,ce,ae){var re=Z(f[q],f,ue);if(re.type==="throw")ae(re.arg);else{var je=re.arg,Se=je.value;return Se&&typeof Se=="object"&&O.call(Se,"__await")?l.resolve(Se.__await).then(function(xe){p("next",xe,ce,ae)},function(xe){p("throw",xe,ce,ae)}):l.resolve(Se).then(function(xe){je.value=xe,ce(je)},function(xe){return p("throw",xe,ce,ae)})}}var A;function M(q,ue){function ce(){return new l(function(ae,re){p(q,ue,ae,re)})}return A=A?A.then(ce,ce):ce()}this._invoke=M}I(se.prototype),w(se.prototype,D,function(){return this}),x.AsyncIterator=se,x.async=function(f,l,p,A,M){M===void 0&&(M=Promise);var q=new se(F(f,l,p,A),M);return x.isGeneratorFunction(l)?q:q.next().then(function(ue){return ue.done?ue.value:q.next()})};function pe(f,l,p){var A=V;return function(q,ue){if(A===he)throw new Error("Generator is already running");if(A===J){if(q==="throw")throw ue;return ze()}for(p.method=q,p.arg=ue;;){var ce=p.delegate;if(ce){var ae=te(ce,p);if(ae){if(ae===W)continue;return ae}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(A===V)throw A=J,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);A=he;var re=Z(f,l,p);if(re.type==="normal"){if(A=p.done?J:u,re.arg===W)continue;return{value:re.arg,done:p.done}}else re.type==="throw"&&(A=J,p.method="throw",p.arg=re.arg)}}}function te(f,l){var p=f.iterator[l.method];if(p===R){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=R,te(f,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var A=Z(p,f.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,W;var M=A.arg;if(!M)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(M.done)l[f.resultName]=M.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=R);else return M;return l.delegate=null,W}I(H),w(H,G,"Generator"),w(H,U,function(){return this}),w(H,"toString",function(){return"[object Generator]"});function be(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function X(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function $(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(be,this),this.reset(!0)}x.keys=function(f){var l=[];for(var p in f)l.push(p);return l.reverse(),function A(){for(;l.length;){var M=l.pop();if(M in f)return A.value=M,A.done=!1,A}return A.done=!0,A}};function ye(f){if(f){var l=f[U];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,A=function M(){for(;++p<f.length;)if(O.call(f,p))return M.value=f[p],M.done=!1,M;return M.value=R,M.done=!0,M};return A.next=A}}return{next:ze}}x.values=ye;function ze(){return{value:R,done:!0}}return $.prototype={constructor:$,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(X),!f)for(var l in this)l.charAt(0)==="t"&&O.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=R)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function p(ae,re){return q.type="throw",q.arg=f,l.next=ae,re&&(l.method="next",l.arg=R),!!re}for(var A=this.tryEntries.length-1;A>=0;--A){var M=this.tryEntries[A],q=M.completion;if(M.tryLoc==="root")return p("end");if(M.tryLoc<=this.prev){var ue=O.call(M,"catchLoc"),ce=O.call(M,"finallyLoc");if(ue&&ce){if(this.prev<M.catchLoc)return p(M.catchLoc,!0);if(this.prev<M.finallyLoc)return p(M.finallyLoc)}else if(ue){if(this.prev<M.catchLoc)return p(M.catchLoc,!0)}else if(ce){if(this.prev<M.finallyLoc)return p(M.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var p=this.tryEntries.length-1;p>=0;--p){var A=this.tryEntries[p];if(A.tryLoc<=this.prev&&O.call(A,"finallyLoc")&&this.prev<A.finallyLoc){var M=A;break}}M&&(f==="break"||f==="continue")&&M.tryLoc<=l&&l<=M.finallyLoc&&(M=null);var q=M?M.completion:{};return q.type=f,q.arg=l,M?(this.method="next",this.next=M.finallyLoc,W):this.complete(q)},complete:function(f,l){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"&&l&&(this.next=l),W},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),X(p),W}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.tryLoc===f){var A=p.completion;if(A.type==="throw"){var M=A.arg;X(p)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,p){return this.delegate={iterator:ye(f),resultName:l,nextLoc:p},this.method==="next"&&(this.arg=R),W}},x}(L.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(L,T,x){"use strict";x.d(T,{Z:function(){return P}});function P(O){if(O.geometry&&O.geometry.dispose(),O.material){var R=Array.isArray(O.material)?O.material:[O.material];R.forEach(function(C){var U,D,G,w,F,Z,V,u,he,J,W,Q,k;(U=C.map)===null||U===void 0||U.dispose(),(D=C.lightMap)===null||D===void 0||D.dispose(),(G=C.bumpMap)===null||G===void 0||G.dispose(),(w=C.normalMap)===null||w===void 0||w.dispose(),(F=C.specularMap)===null||F===void 0||F.dispose(),(Z=C.envMap)===null||Z===void 0||Z.dispose(),(V=C.alphaMap)===null||V===void 0||V.dispose(),(u=C.aoMap)===null||u===void 0||u.dispose(),(he=C.displacementMap)===null||he===void 0||he.dispose(),(J=C.emissiveMap)===null||J===void 0||J.dispose(),(W=C.gradientMap)===null||W===void 0||W.dispose(),(Q=C.metalnessMap)===null||Q===void 0||Q.dispose(),(k=C.roughnessMap)===null||k===void 0||k.dispose(),C.dispose()})}}},519:function(L,T,x){"use strict";x.d(T,{disposeMesh:function(){return C.Z}});var P=x(666),O=x.n(P),R=null,C=x(695),U=x(644);function D(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(k){var E,N;(E=k.color)===null||E===void 0||E.convertSRGBToLinear(),(N=k.emissive)===null||N===void 0||N.convertSRGBToLinear(),k.map&&(k.map.encoding=THREE.sRGBEncoding),k.emissiveMap&&(k.emissiveMap.encoding=THREE.sRGBEncoding)})}}var G=x(568),w=x(924),F=require("idb-keyval"),Z=x(484),V=null,u=null,he=function(){var W=(0,G.Z)(O().mark(function Q(k,E){var N,ie,ee,H,I,se;return O().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return N=E.version,te.next=4,(0,F.get)(k);case 4:if(ee=te.sent,!(ee&&ee[N])){te.next=9;break}ie=ee[N],te.next=15;break;case 9:return te.next=11,(0,Z.Z)(fetch(k).then(function(be){if(be.ok)return be.blob();throw new Error}));case 11:H=te.sent,I=H.res,se=H.err,se||(ie=I,(0,F.set)(k,(0,w.Z)({},N,I)));case 15:return te.abrupt("return",ie?{url:URL.createObjectURL(ie)}:{url:k});case 16:case"end":return te.stop()}},Q)}));return function(k,E){return W.apply(this,arguments)}}(),J=x(705)},484:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});var P=x(42);function O(R){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(U){return(0,P.Z)({err:null,res:U},C)}).catch(function(U){return(0,P.Z)({err:U,res:void 0},C)})}},705:function(L,T,x){"use strict";x.d(T,{C:function(){return U},y:function(){return C}});var P=x(644),O=x.n(P),R=new Map,C=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(G,w,F,Z,V){var u=w[F*3],he=w[F*3+1],J=w[Z*3],W=w[Z*3+1],Q=w[V*3],k=w[V*3+1],E;if(R.has(G))E=R.get(G);else{var N=D.box3||new P.Box3;if(!D.box3){var ie=G.parameters.shapes.getPoints();N.setFromArray(ie.map(function(pe){return[pe.x,pe.y,0]}).flat())}var ee=N.getSize(new P.Vector3);D.split&&(ee.y/=D.split),E={box:N,size:ee},R.set(G,E)}var H=E.box,I=E.size,se=D.split?1-D.split:0;return[new P.Vector2((u-H.min.x)/I.x,(he-H.min.y)/I.y+se),new P.Vector2((J-H.min.x)/I.x,(W-H.min.y)/I.y+se),new P.Vector2((Q-H.min.x)/I.x,(k-H.min.y)/I.y+se)]},generateSideWallUV:function(G,w,F,Z,V,u){var he=w[F*3],J=w[F*3+1],W=w[F*3+2],Q=w[Z*3],k=w[Z*3+1],E=w[Z*3+2],N=w[V*3],ie=w[V*3+1],ee=w[V*3+2],H=w[u*3],I=w[u*3+1],se=w[u*3+2],pe;if(R.has(w))pe=R.get(w);else{var te=new P.Box3;te.setFromArray(w);var be=te.getSize(new P.Vector3);D.split&&(be.z/=1-D.split),pe={box:te,size:be},R.set(w,pe)}var X=pe.box,$=pe.size;return Math.abs(J-k)<Math.abs(he-Q)?[new P.Vector2((he-X.min.x)/$.x,(W-X.min.z)/$.z),new P.Vector2((Q-X.min.x)/$.x,(E-X.min.z)/$.z),new P.Vector2((N-X.min.x)/$.x,(ee-X.min.z)/$.z),new P.Vector2((H-X.min.x)/$.x,(se-X.min.z)/$.z)]:[new P.Vector2((J-X.min.y)/$.y,(W-X.min.z)/$.z),new P.Vector2((k-X.min.y)/$.y,(E-X.min.z)/$.z),new P.Vector2((ie-X.min.y)/$.y,(ee-X.min.z)/$.z),new P.Vector2((I-X.min.y)/$.y,(se-X.min.z)/$.z)]}}},U=function(){R.clear()}},644:function(L){"use strict";L.exports=require("three")},568:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});function P(R,C,U,D,G,w,F){try{var Z=R[w](F),V=Z.value}catch(u){U(u);return}Z.done?C(V):Promise.resolve(V).then(D,G)}function O(R){return function(){var C=this,U=arguments;return new Promise(function(D,G){var w=R.apply(C,U);function F(V){P(w,D,G,F,Z,"next",V)}function Z(V){P(w,D,G,F,Z,"throw",V)}F(void 0)})}}},924:function(L,T,x){"use strict";x.d(T,{Z:function(){return P}});function P(O,R,C){return R in O?Object.defineProperty(O,R,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[R]=C,O}},42:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});var P=x(924);function O(R){for(var C=1;C<arguments.length;C++){var U=arguments[C]!=null?arguments[C]:{},D=Object.keys(U);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(U).filter(function(G){return Object.getOwnPropertyDescriptor(U,G).enumerable}))),D.forEach(function(G){(0,P.Z)(R,G,U[G])})}return R}}},Fe={};function K(L){var T=Fe[L];if(T!==void 0)return T.exports;var x=Fe[L]={exports:{}};return tt[L](x,x.exports,K),x.exports}(function(){K.n=function(L){var T=L&&L.__esModule?function(){return L.default}:function(){return L};return K.d(T,{a:T}),T}})(),function(){K.d=function(L,T){for(var x in T)K.o(T,x)&&!K.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:T[x]})}}(),function(){K.o=function(L,T){return Object.prototype.hasOwnProperty.call(L,T)}}(),function(){K.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";K.r(Be),K.d(Be,{ConicPolygon:function(){return Pt},ExtrudePolygon:function(){return St},Image:function(){return ue},Line:function(){return st},MeshLine:function(){return _e},MeshLineMaterial:function(){return Ve},MeshLineRaycast:function(){return Ze},Node:function(){return xe},Text:function(){return ze},Video:function(){return je}});function L(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function T(t,i){return T=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},T(t,i)}function x(t,i){return T(t,i)}function P(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&x(t,i)}var O=K(42);function R(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function C(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function U(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function G(t){return D(t)}function w(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function Z(t,i){return i&&(F(i)==="object"||typeof i=="function")?i:w(t)}function V(t){var i=U();return function(){var n=G(t),a;if(i){var e=G(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return Z(this,a)}}var u=K(644);function he(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function J(t,i,r){return he()?J=Reflect.construct:J=function(a,e,o){var s=[null];s.push.apply(s,e);var h=Function.bind.apply(a,s),v=new h;return o&&x(v,o.prototype),v},J.apply(null,arguments)}function W(t,i,r){return J.apply(null,arguments)}function Q(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function k(t,i,r){return i&&Q(t.prototype,i),r&&Q(t,r),t}function E(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function N(t){if(Array.isArray(t))return E(t)}function ie(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(t,i){if(!!t){if(typeof t=="string")return E(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E(t,i)}}function I(t){return N(t)||ie(t)||H(t)||ee()}var se=K(484);function pe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,se.Z)(r.promise,i)),r}var te=require("three/examples/jsm/renderers/CSS2DRenderer"),be=require("three/examples/jsm/renderers/CSS3DRenderer"),X=K(519),$=function(t){t&&((0,X.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||$(i)}))},ye=function(){"use strict";function t(){L(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=pe(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},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 n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(u.Mesh,I(a)),this},i.createGroup=function(){return this.object3d=new u.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(u.Points,I(a)),this},i.createCSS2DObject=function(n){return this.object3d=new te.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new be.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new be.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new u.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,I(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,I(a)),this},i.getSize=function(){var n=new u.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new u.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){$(this.object3d)},k(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,O.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.lookAt,h=e.sprite,v=e.text,d=e.sizeAttenuation;if(h){var g=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=g}else{var y=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),b=new u.PlaneGeometry(1,1,1,1);this.createMesh(b,y)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(v)},n.setText=function(e,o){var s=(0,O.Z)(C((0,O.Z)({},this.options),{text:e}),o||{}),h=s.text,v=s.fontSize,d=s.fontFamily,g=s.fontWeight,y=s.flipX,b=s.scale,m=this.canvas;m.width=v*h.length*2,m.height=v;var _=m.getContext("2d");_.font="".concat(g," ").concat(v,"px/1 ").concat(d);var c=_.measureText(h).width;m.width=c,this.width=c,_=m.getContext("2d"),_.clearRect(0,0,m.width,m.height),y&&_.scale(-1,1),_.font="".concat(g," ").concat(v,"px/1 ").concat(d),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(h,y?c*-1:0,m.height/2),_.restore();var S=new u.Texture(m);S.anisotropy=16,S.needsUpdate=!0;var j=this.object3d;j.material.map&&j.material.map.dispose(),j.material.map=S,j.material.needsUpdate=!0,j.scale.set(S.image.width*b,S.image.height*b,1)},r}(ye),f=K(568),l=K(666),p=K.n(l),A=+u.REVISION<144,M=A?"ExtrudeBufferGeometry":"ExtrudeGeometry",q=A?"PlaneBufferGeometry":"PlaneGeometry",ue=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,g,y,b,m,_,c;return p().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return s=e.options,h=s.transparent,v=s.blending,d=s.src,g=s.depthWrite,y=s.alphaTest,b=s.sprite,m=s.sizeAttenuation,j.next=3,new u.TextureLoader().loadAsync(d);case 3:return _=j.sent,c=b?new u.SpriteMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:y!=null?y:0,sizeAttenuation:m!=null?m:!0}):new u.MeshBasicMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:y!=null?y:0}),j.abrupt("return",c);case 6:case"end":return j.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,g,y,b,m;return p().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=e.options,h=s.scale,v=s.position,d=s.src,g=s.cache,y=s.sprite,!(g&&!g.get(d))){c.next=7;break}return g.init(d),c.next=5,e.getMaterial();case 5:b=c.sent,g.set(d,b);case 7:if(!g){c.next=13;break}return c.next=10,g.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,e.getMaterial();case 15:c.t0=c.sent;case 16:m=c.t0,e.texture=m.map,y?e.createSprite(m):e.createMesh(new u[q](1,1),m),h&&e.setScale(h),v&&e.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(ye);function ce(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=G(t),t!==null););return t}function ae(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?ae=Reflect.get:ae=function(a,e,o){var s=ce(a,e);if(!!s){var h=Object.getOwnPropertyDescriptor(s,e);return h.get?h.get.call(o||a):h.value}},ae(t,i,r)}function re(t,i,r){return ae(t,i,r)}var je=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,s=e.transparent,h=e.blending,v=e.depthWrite,d=e.format,g=e.autoPlay,y=e.loop,b=e.alphaTest,m=e.sprite,_=pe(),c=document.createElement("video");return c.addEventListener("loadedmetadata",function(){var S=new u.VideoTexture(c);S.format=d!=null?d:u.RGBAFormat,S.needsUpdate=!0;var j=m?new u.SpriteMaterial({map:S,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new u.MeshBasicMaterial({map:S,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});_.resolve(j)},!1),c.src=o,c.muted=!0,c.autoplay=g,c.loop=y,c.preload="auto",_.promise},n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,g,y,b,m;return p().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=e.options,h=s.scale,v=s.position,d=s.src,g=s.cache,y=s.sprite,!(g&&!g.get(d))){c.next=7;break}return g.init(d),c.next=5,e.getMaterial();case 5:b=c.sent,g.set(d,b);case 7:if(!g){c.next=13;break}return c.next=10,g.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,e.getMaterial();case 15:c.t0=c.sent;case 16:m=c.t0,e.video=m.map.image,y?e.createSprite(m):e.createMesh(new u[q](1,1),m),h&&e.setScale(h),v&&e.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),re(G(r.prototype),"dispose",this).call(this)},r}(ye),Se=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,h=e.onClick,v=e.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(g){g.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,f.Z)(p().mark(function o(){var s,h,v,d;return p().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new u.CanvasTexture(s),d=new u.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",d);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,h=e.scale,v=h===void 0?new u.Vector3(1,1,1):h,d=e.position,g=d===void 0?new u.Vector3(0,0,0):d,y=e.cache,b=this;return(0,f.Z)(p().mark(function m(){var _,c,S,j;return p().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(_="node-create-pick-object",!(y&&!y.get(_))){z.next=7;break}return y.init(_),z.next=5,b.getMaterial(s);case 5:c=z.sent,y.set(_,c);case 7:if(!y){z.next=13;break}return z.next=10,y.get(_);case 10:z.t0=z.sent,z.next=16;break;case 13:return z.next=15,b.getMaterial(s);case 15:z.t0=z.sent;case 16:S=z.t0,j=new u.Sprite(S),j.scale.set(S.map.image.width*v.x,S.map.image.height*v.y,1),j.position.copy(g),b.add(j),b.pickObject=j;case 22:case"end":return z.stop()}},m)}))()},n.dispose=function(){var e=this.options.onClick;e&&this.clickTarge.forEach(function(o){o.removeEventListener("click",e)}),re(G(r.prototype),"dispose",this).call(this)},k(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.clickTarge;if(o){var s=o.map(function(h){return I(e.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(ye),xe=Se,rt=`
1
+ (function(){var tt={666:function(L){var T=function(x){"use strict";var S=Object.prototype,O=S.hasOwnProperty,R,C=typeof Symbol=="function"?Symbol:{},U=C.iterator||"@@iterator",D=C.asyncIterator||"@@asyncIterator",G=C.toStringTag||"@@toStringTag";function w(f,l,p){return Object.defineProperty(f,l,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{w({},"")}catch(f){w=function(l,p,P){return l[p]=P}}function F(f,l,p,P){var M=l&&l.prototype instanceof Q?l:Q,q=Object.create(M.prototype),ue=new $(P||[]);return q._invoke=pe(f,p,ue),q}x.wrap=F;function Z(f,l,p){try{return{type:"normal",arg:f.call(l,p)}}catch(P){return{type:"throw",arg:P}}}var V="suspendedStart",u="suspendedYield",he="executing",J="completed",W={};function Q(){}function k(){}function E(){}var N={};w(N,U,function(){return this});var ie=Object.getPrototypeOf,ee=ie&&ie(ie(ye([])));ee&&ee!==S&&O.call(ee,U)&&(N=ee);var H=E.prototype=Q.prototype=Object.create(N);k.prototype=E,w(H,"constructor",E),w(E,"constructor",k),k.displayName=w(E,G,"GeneratorFunction");function I(f){["next","throw","return"].forEach(function(l){w(f,l,function(p){return this._invoke(l,p)})})}x.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===k||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,E):(f.__proto__=E,w(f,G,"GeneratorFunction")),f.prototype=Object.create(H),f},x.awrap=function(f){return{__await:f}};function se(f,l){function p(q,ue,ce,ae){var re=Z(f[q],f,ue);if(re.type==="throw")ae(re.arg);else{var je=re.arg,Se=je.value;return Se&&typeof Se=="object"&&O.call(Se,"__await")?l.resolve(Se.__await).then(function(xe){p("next",xe,ce,ae)},function(xe){p("throw",xe,ce,ae)}):l.resolve(Se).then(function(xe){je.value=xe,ce(je)},function(xe){return p("throw",xe,ce,ae)})}}var P;function M(q,ue){function ce(){return new l(function(ae,re){p(q,ue,ae,re)})}return P=P?P.then(ce,ce):ce()}this._invoke=M}I(se.prototype),w(se.prototype,D,function(){return this}),x.AsyncIterator=se,x.async=function(f,l,p,P,M){M===void 0&&(M=Promise);var q=new se(F(f,l,p,P),M);return x.isGeneratorFunction(l)?q:q.next().then(function(ue){return ue.done?ue.value:q.next()})};function pe(f,l,p){var P=V;return function(q,ue){if(P===he)throw new Error("Generator is already running");if(P===J){if(q==="throw")throw ue;return ze()}for(p.method=q,p.arg=ue;;){var ce=p.delegate;if(ce){var ae=te(ce,p);if(ae){if(ae===W)continue;return ae}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(P===V)throw P=J,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);P=he;var re=Z(f,l,p);if(re.type==="normal"){if(P=p.done?J:u,re.arg===W)continue;return{value:re.arg,done:p.done}}else re.type==="throw"&&(P=J,p.method="throw",p.arg=re.arg)}}}function te(f,l){var p=f.iterator[l.method];if(p===R){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=R,te(f,l),l.method==="throw"))return W;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var P=Z(p,f.iterator,l.arg);if(P.type==="throw")return l.method="throw",l.arg=P.arg,l.delegate=null,W;var M=P.arg;if(!M)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,W;if(M.done)l[f.resultName]=M.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=R);else return M;return l.delegate=null,W}I(H),w(H,G,"Generator"),w(H,U,function(){return this}),w(H,"toString",function(){return"[object Generator]"});function be(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function Y(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function $(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(be,this),this.reset(!0)}x.keys=function(f){var l=[];for(var p in f)l.push(p);return l.reverse(),function P(){for(;l.length;){var M=l.pop();if(M in f)return P.value=M,P.done=!1,P}return P.done=!0,P}};function ye(f){if(f){var l=f[U];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,P=function M(){for(;++p<f.length;)if(O.call(f,p))return M.value=f[p],M.done=!1,M;return M.value=R,M.done=!0,M};return P.next=P}}return{next:ze}}x.values=ye;function ze(){return{value:R,done:!0}}return $.prototype={constructor:$,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(Y),!f)for(var l in this)l.charAt(0)==="t"&&O.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=R)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function p(ae,re){return q.type="throw",q.arg=f,l.next=ae,re&&(l.method="next",l.arg=R),!!re}for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P],q=M.completion;if(M.tryLoc==="root")return p("end");if(M.tryLoc<=this.prev){var ue=O.call(M,"catchLoc"),ce=O.call(M,"finallyLoc");if(ue&&ce){if(this.prev<M.catchLoc)return p(M.catchLoc,!0);if(this.prev<M.finallyLoc)return p(M.finallyLoc)}else if(ue){if(this.prev<M.catchLoc)return p(M.catchLoc,!0)}else if(ce){if(this.prev<M.finallyLoc)return p(M.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var p=this.tryEntries.length-1;p>=0;--p){var P=this.tryEntries[p];if(P.tryLoc<=this.prev&&O.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var M=P;break}}M&&(f==="break"||f==="continue")&&M.tryLoc<=l&&l<=M.finallyLoc&&(M=null);var q=M?M.completion:{};return q.type=f,q.arg=l,M?(this.method="next",this.next=M.finallyLoc,W):this.complete(q)},complete:function(f,l){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"&&l&&(this.next=l),W},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),Y(p),W}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.tryLoc===f){var P=p.completion;if(P.type==="throw"){var M=P.arg;Y(p)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,p){return this.delegate={iterator:ye(f),resultName:l,nextLoc:p},this.method==="next"&&(this.arg=R),W}},x}(L.exports);try{regeneratorRuntime=T}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=T:Function("r","regeneratorRuntime = r")(T)}},695:function(L,T,x){"use strict";x.d(T,{Z:function(){return S}});function S(O){if(O.geometry&&O.geometry.dispose(),O.material){var R=Array.isArray(O.material)?O.material:[O.material];R.forEach(function(C){var U,D,G,w,F,Z,V,u,he,J,W,Q,k;(U=C.map)===null||U===void 0||U.dispose(),(D=C.lightMap)===null||D===void 0||D.dispose(),(G=C.bumpMap)===null||G===void 0||G.dispose(),(w=C.normalMap)===null||w===void 0||w.dispose(),(F=C.specularMap)===null||F===void 0||F.dispose(),(Z=C.envMap)===null||Z===void 0||Z.dispose(),(V=C.alphaMap)===null||V===void 0||V.dispose(),(u=C.aoMap)===null||u===void 0||u.dispose(),(he=C.displacementMap)===null||he===void 0||he.dispose(),(J=C.emissiveMap)===null||J===void 0||J.dispose(),(W=C.gradientMap)===null||W===void 0||W.dispose(),(Q=C.metalnessMap)===null||Q===void 0||Q.dispose(),(k=C.roughnessMap)===null||k===void 0||k.dispose(),C.dispose()})}}},519:function(L,T,x){"use strict";x.d(T,{disposeMesh:function(){return C.Z}});var S=x(666),O=x.n(S),R=null,C=x(695),U=x(644);function D(W){if(W.material){var Q=Array.isArray(W.material)?W.material:[W.material];Q.forEach(function(k){var E,N;(E=k.color)===null||E===void 0||E.convertSRGBToLinear(),(N=k.emissive)===null||N===void 0||N.convertSRGBToLinear(),k.map&&(k.map.encoding=THREE.sRGBEncoding),k.emissiveMap&&(k.emissiveMap.encoding=THREE.sRGBEncoding)})}}var G=x(568),w=x(924),F=require("idb-keyval"),Z=x(484),V=null,u=null,he=function(){var W=(0,G.Z)(O().mark(function Q(k,E){var N,ie,ee,H,I,se;return O().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return N=E.version,te.next=4,(0,F.get)(k);case 4:if(ee=te.sent,!(ee&&ee[N])){te.next=9;break}ie=ee[N],te.next=15;break;case 9:return te.next=11,(0,Z.Z)(fetch(k).then(function(be){if(be.ok)return be.blob();throw new Error}));case 11:H=te.sent,I=H.res,se=H.err,se||(ie=I,(0,F.set)(k,(0,w.Z)({},N,I)));case 15:return te.abrupt("return",ie?{url:URL.createObjectURL(ie)}:{url:k});case 16:case"end":return te.stop()}},Q)}));return function(k,E){return W.apply(this,arguments)}}(),J=x(705)},484:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});var S=x(42);function O(R){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R.then(function(U){return(0,S.Z)({err:null,res:U},C)}).catch(function(U){return(0,S.Z)({err:U,res:void 0},C)})}},705:function(L,T,x){"use strict";x.d(T,{C:function(){return U},y:function(){return C}});var S=x(644),O=x.n(S),R=new Map,C=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(G,w,F,Z,V){var u=w[F*3],he=w[F*3+1],J=w[Z*3],W=w[Z*3+1],Q=w[V*3],k=w[V*3+1],E;if(R.has(G))E=R.get(G);else{var N=D.box3||new S.Box3;if(!D.box3){var ie=G.parameters.shapes.getPoints();N.setFromArray(ie.map(function(pe){return[pe.x,pe.y,0]}).flat())}var ee=N.getSize(new S.Vector3);D.split&&(ee.y/=D.split),E={box:N,size:ee},R.set(G,E)}var H=E.box,I=E.size,se=D.split?1-D.split:0;return[new S.Vector2((u-H.min.x)/I.x,(he-H.min.y)/I.y+se),new S.Vector2((J-H.min.x)/I.x,(W-H.min.y)/I.y+se),new S.Vector2((Q-H.min.x)/I.x,(k-H.min.y)/I.y+se)]},generateSideWallUV:function(G,w,F,Z,V,u){var he=w[F*3],J=w[F*3+1],W=w[F*3+2],Q=w[Z*3],k=w[Z*3+1],E=w[Z*3+2],N=w[V*3],ie=w[V*3+1],ee=w[V*3+2],H=w[u*3],I=w[u*3+1],se=w[u*3+2],pe;if(R.has(w))pe=R.get(w);else{var te=new S.Box3;te.setFromArray(w);var be=te.getSize(new S.Vector3);D.split&&(be.z/=1-D.split),pe={box:te,size:be},R.set(w,pe)}var Y=pe.box,$=pe.size;return Math.abs(J-k)<Math.abs(he-Q)?[new S.Vector2((he-Y.min.x)/$.x,(W-Y.min.z)/$.z),new S.Vector2((Q-Y.min.x)/$.x,(E-Y.min.z)/$.z),new S.Vector2((N-Y.min.x)/$.x,(ee-Y.min.z)/$.z),new S.Vector2((H-Y.min.x)/$.x,(se-Y.min.z)/$.z)]:[new S.Vector2((J-Y.min.y)/$.y,(W-Y.min.z)/$.z),new S.Vector2((k-Y.min.y)/$.y,(E-Y.min.z)/$.z),new S.Vector2((ie-Y.min.y)/$.y,(ee-Y.min.z)/$.z),new S.Vector2((I-Y.min.y)/$.y,(se-Y.min.z)/$.z)]}}},U=function(){R.clear()}},644:function(L){"use strict";L.exports=require("three")},568:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});function S(R,C,U,D,G,w,F){try{var Z=R[w](F),V=Z.value}catch(u){U(u);return}Z.done?C(V):Promise.resolve(V).then(D,G)}function O(R){return function(){var C=this,U=arguments;return new Promise(function(D,G){var w=R.apply(C,U);function F(V){S(w,D,G,F,Z,"next",V)}function Z(V){S(w,D,G,F,Z,"throw",V)}F(void 0)})}}},924:function(L,T,x){"use strict";x.d(T,{Z:function(){return S}});function S(O,R,C){return R in O?Object.defineProperty(O,R,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[R]=C,O}},42:function(L,T,x){"use strict";x.d(T,{Z:function(){return O}});var S=x(924);function O(R){for(var C=1;C<arguments.length;C++){var U=arguments[C]!=null?arguments[C]:{},D=Object.keys(U);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(U).filter(function(G){return Object.getOwnPropertyDescriptor(U,G).enumerable}))),D.forEach(function(G){(0,S.Z)(R,G,U[G])})}return R}}},Fe={};function X(L){var T=Fe[L];if(T!==void 0)return T.exports;var x=Fe[L]={exports:{}};return tt[L](x,x.exports,X),x.exports}(function(){X.n=function(L){var T=L&&L.__esModule?function(){return L.default}:function(){return L};return X.d(T,{a:T}),T}})(),function(){X.d=function(L,T){for(var x in T)X.o(T,x)&&!X.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:T[x]})}}(),function(){X.o=function(L,T){return Object.prototype.hasOwnProperty.call(L,T)}}(),function(){X.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";X.r(Be),X.d(Be,{ConicPolygon:function(){return Pt},ExtrudePolygon:function(){return St},Image:function(){return ue},Line:function(){return st},MeshLine:function(){return _e},MeshLineMaterial:function(){return Ve},MeshLineRaycast:function(){return Ze},Node:function(){return xe},Text:function(){return ze},Video:function(){return je}});function L(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function T(t,i){return T=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},T(t,i)}function x(t,i){return T(t,i)}function S(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&x(t,i)}var O=X(42);function R(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function C(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function U(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function G(t){return D(t)}function w(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return t&&t.constructor===Symbol?"symbol":typeof t}function Z(t,i){return i&&(F(i)==="object"||typeof i=="function")?i:w(t)}function V(t){var i=U();return function(){var n=G(t),a;if(i){var e=G(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return Z(this,a)}}var u=X(644);function he(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function J(t,i,r){return he()?J=Reflect.construct:J=function(a,e,o){var s=[null];s.push.apply(s,e);var h=Function.bind.apply(a,s),v=new h;return o&&x(v,o.prototype),v},J.apply(null,arguments)}function W(t,i,r){return J.apply(null,arguments)}function Q(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function k(t,i,r){return i&&Q(t.prototype,i),r&&Q(t,r),t}function E(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function N(t){if(Array.isArray(t))return E(t)}function ie(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ee(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(t,i){if(!!t){if(typeof t=="string")return E(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E(t,i)}}function I(t){return N(t)||ie(t)||H(t)||ee()}var se=X(484);function pe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(n,a){r.resolve=n,r.reject=a}),t&&(r.promise=(0,se.Z)(r.promise,i)),r}var te=require("three/examples/jsm/renderers/CSS2DRenderer"),be=require("three/examples/jsm/renderers/CSS3DRenderer"),Y=X(519),$=function(t){t&&((0,Y.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||$(i)}))},ye=function(){"use strict";function t(){L(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=pe(),this.visible=!1}var i=t.prototype;return i.init=function(){},i.create=function(){},i.render=function(){},i.update=function(n,a){},i.resize=function(n,a){},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 n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(u.Mesh,I(a)),this},i.createGroup=function(){return this.object3d=new u.Group,this},i.createPoints=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return this.object3d=W(u.Points,I(a)),this},i.createCSS2DObject=function(n){return this.object3d=new te.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new be.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new be.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new u.Sprite(n),this},i.add=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).add.apply(o,I(a)),this},i.remove=function(){for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];var o;return(o=this.object3d).remove.apply(o,I(a)),this},i.getSize=function(){var n=new u.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new u.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){$(this.object3d)},k(t,[{key:"parent",get:function(){var n=this.object3d.parent;return(n==null?void 0:n.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(n){return n.userData.BaseObject_}).filter(function(n){return!!n})}}]),t}(),ze=function(t){"use strict";S(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.width=0,e.canvas=document.createElement("canvas"),e.options=(0,O.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.lookAt,h=e.sprite,v=e.text,d=e.sizeAttenuation;if(h){var m=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var g=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),_=new u.PlaneGeometry(1,1,1,1);this.createMesh(_,g)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(v)},n.setText=function(e,o){var s=(0,O.Z)(C((0,O.Z)({},this.options),{text:e}),o||{}),h=s.text,v=s.fontSize,d=s.fontFamily,m=s.fontWeight,g=s.flipX,_=s.scale,b=this.canvas;b.width=v*h.length*2,b.height=v;var y=b.getContext("2d");y.font="".concat(m," ").concat(v,"px/1 ").concat(d);var c=y.measureText(h).width;b.width=c,this.width=c,y=b.getContext("2d"),y.clearRect(0,0,b.width,b.height),g&&y.scale(-1,1),y.font="".concat(m," ").concat(v,"px/1 ").concat(d),y.textBaseline="middle",y.fillStyle="#ffffff",y.fillText(h,g?c*-1:0,b.height/2),y.restore();var A=new u.Texture(b);A.anisotropy=16,A.needsUpdate=!0;var j=this.object3d;j.material.map&&j.material.map.dispose(),j.material.map=A,j.material.needsUpdate=!0,j.scale.set(A.image.width*_,A.image.height*_,1)},r}(ye),f=X(568),l=X(666),p=X.n(l),P=+u.REVISION<144,M=P?"ExtrudeBufferGeometry":"ExtrudeGeometry",q=P?"PlaneBufferGeometry":"PlaneGeometry",ue=function(t){"use strict";S(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,m,g,_,b,y,c;return p().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return s=e.options,h=s.transparent,v=s.blending,d=s.src,m=s.depthWrite,g=s.alphaTest,_=s.sprite,b=s.sizeAttenuation,j.next=3,new u.TextureLoader().loadAsync(d);case 3:return y=j.sent,c=_?new u.SpriteMaterial({map:y,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:b!=null?b:!0}):new u.MeshBasicMaterial({map:y,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),j.abrupt("return",c);case 6:case"end":return j.stop()}},o)}))()},n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,m,g,_,b;return p().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=e.options,h=s.scale,v=s.position,d=s.src,m=s.cache,g=s.sprite,!(m&&!m.get(d))){c.next=7;break}return m.init(d),c.next=5,e.getMaterial();case 5:_=c.sent,m.set(d,_);case 7:if(!m){c.next=13;break}return c.next=10,m.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,e.getMaterial();case 15:c.t0=c.sent;case 16:b=c.t0,e.texture=b.map,g?e.createSprite(b):e.createMesh(new u[q](1,1),b),h&&e.setScale(h),v&&e.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},r}(ye);function ce(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=G(t),t!==null););return t}function ae(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?ae=Reflect.get:ae=function(a,e,o){var s=ce(a,e);if(!!s){var h=Object.getOwnPropertyDescriptor(s,e);return h.get?h.get.call(o||a):h.value}},ae(t,i,r)}function re(t,i,r){return ae(t,i,r)}var je=function(t){"use strict";S(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},{autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,s=e.transparent,h=e.blending,v=e.depthWrite,d=e.format,m=e.autoPlay,g=e.loop,_=e.alphaTest,b=e.sprite,y=pe(),c=document.createElement("video");return c.addEventListener("loadedmetadata",function(){var A=new u.VideoTexture(c);A.format=d!=null?d:u.RGBAFormat,A.needsUpdate=!0;var j=b?new u.SpriteMaterial({map:A,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:_!=null?_:0}):new u.MeshBasicMaterial({map:A,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:_!=null?_:0});y.resolve(j)},!1),c.src=o,c.muted=!0,c.autoplay=m,c.loop=g,c.preload="auto",y.promise},n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,m,g,_,b;return p().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=e.options,h=s.scale,v=s.position,d=s.src,m=s.cache,g=s.sprite,!(m&&!m.get(d))){c.next=7;break}return m.init(d),c.next=5,e.getMaterial();case 5:_=c.sent,m.set(d,_);case 7:if(!m){c.next=13;break}return c.next=10,m.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,e.getMaterial();case 15:c.t0=c.sent;case 16:b=c.t0,e.video=b.map.image,g?e.createSprite(b):e.createMesh(new u[q](1,1),b),h&&e.setScale(h),v&&e.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},n.setScale=function(e){this.object3d.scale.set(this.video.videoWidth*e,this.video.videoHeight*e,1)},n.render=function(){var e=this.options.autoPlay;e&&this.video.play()},n.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),re(G(r.prototype),"dispose",this).call(this)},r}(ye),Se=function(t){"use strict";S(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,h=e.onClick,v=e.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(m){m.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,f.Z)(p().mark(function o(){var s,h,v,d;return p().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new u.CanvasTexture(s),d=new u.SpriteMaterial({map:v,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",d);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,h=e.scale,v=h===void 0?new u.Vector3(1,1,1):h,d=e.position,m=d===void 0?new u.Vector3(0,0,0):d,g=e.cache,_=this;return(0,f.Z)(p().mark(function b(){var y,c,A,j;return p().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(y="node-create-pick-object",!(g&&!g.get(y))){z.next=7;break}return g.init(y),z.next=5,_.getMaterial(s);case 5:c=z.sent,g.set(y,c);case 7:if(!g){z.next=13;break}return z.next=10,g.get(y);case 10:z.t0=z.sent,z.next=16;break;case 13:return z.next=15,_.getMaterial(s);case 15:z.t0=z.sent;case 16:A=z.t0,j=new u.Sprite(A),j.scale.set(A.map.image.width*v.x,A.map.image.height*v.y,1),j.position.copy(m),_.add(j),_.pickObject=j;case 22:case"end":return z.stop()}},b)}))()},n.dispose=function(){var e=this.options.onClick;e&&this.clickTarge.forEach(function(o){o.removeEventListener("click",e)}),re(G(r.prototype),"dispose",this).call(this)},k(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.clickTarge;if(o){var s=o.map(function(h){return I(e.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(ye),xe=Se,rt=`
2
2
  `.concat(u.ShaderChunk.logdepthbuf_pars_vertex,`
3
3
  `).concat(u.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
@@ -129,4 +129,4 @@ void main() {
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
130
  `).concat(u.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),_e=function(t){"use strict";P(r,t);var i=V(r);function r(){L(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new u.Matrix4,Object.defineProperties(w(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(u.BufferGeometry);_e.prototype.setMatrixWorld=function(t){this.matrixWorld=t},_e.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},_e.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof u.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ze(t,i){var r=new u.Matrix4,n=new u.Ray,a=new u.Sphere,e=new u.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new u.Vector3,h=new u.Vector3,v=new u.Vector3,d=this instanceof u.LineSegments?2:1,g=o.index,y=o.attributes;if(g!==null)for(var b=g.array,m=y.position.array,_=y.width.array,c=0,S=b.length-1;c<S;c+=d){var j=b[c],Y=b[c+1];s.fromArray(m,j*3),h.fromArray(m,Y*3);var z=_[Math.floor(c/3)]!==void 0?_[Math.floor(c/3)]:1,ne=t.params.Line.threshold+this.material.lineWidth*z/2,oe=ne*ne,de=n.distanceSqToSegment(s,h,e,v);if(!(de>oe)){e.applyMatrix4(this.matrixWorld);var fe=t.ray.origin.distanceTo(e);fe<t.near||fe>t.far||(i.push({distance:fe,point:v.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}),c=S)}}}}_e.prototype.raycast=Ze,_e.prototype.compareV3=function(t,i){var r=t*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},_e.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},_e.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new u.BufferAttribute(new Float32Array(this.positions),3),previous:new u.BufferAttribute(new Float32Array(this.previous),3),next:new u.BufferAttribute(new Float32Array(this.next),3),side:new u.BufferAttribute(new Float32Array(this.side),1),width:new u.BufferAttribute(new Float32Array(this.width),1),uv:new u.BufferAttribute(new Float32Array(this.uvs),2),index:new u.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new u.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ge(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}_e.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ge(i,0,r,0,a),Ge(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Ge(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},u.ShaderChunk.meshline_vert=rt,u.ShaderChunk.meshline_frag=nt;var Ve=function(t){"use strict";P(r,t);var i=V(r);function r(n){L(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},u.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new u.Color(16777215)},opacity:{value:1},resolution:{value:new u.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new u.Vector2(1,1)},offset:{value:new u.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new u.Vector2(0,0)},lightColor:{value:new u.Color(16777215)}}),vertexShader:u.ShaderChunk.meshline_vert,fragmentShader:u.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(w(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(u.ShaderMaterial);Ve.prototype.copy=function(t){return u.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function it(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function at(t,i){if(t==null)return{};var r=it(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ne=require("popmotion"),He=require("three/examples/jsm//utils/BufferGeometryUtils");function $e(t){var i=t.setPointWidth,r=t.nodes,n=new u.BufferGeometry,a=new _e;return n.setFromPoints(r),a.setGeometry(n,i),a}var ot={color:new u.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},st=function(t){"use strict";P(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},ot,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,g=o.key,y=o.nodes,b=o.nodesArr,m=o.coordinatesArr,_=o.projection,c=o.workerController,S=o.useGroups,j=at(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),Y=this.pencil.getSize(),z=Y.width,ne=Y.height,oe=new Ve(C((0,O.Z)({},j),{resolution:new u.Vector2(z,ne)}));if(this.material=oe,y)this.createMesh($e({nodes:y,setPointWidth:d}),oe);else if(b){var de=He.mergeBufferGeometries(b.map(function(fe){return $e({nodes:fe,setPointWidth:d})}),S!=null?S:!1);this.createMesh(de,oe)}else if(m&&c)return new Promise(function(fe){c.postMessage({coordinatesArr:m,projection:_,useGroups:S},function(ve){var B=new u.BufferGeometry;Object.keys(ve).forEach(function(le){le==="index"?B.setIndex(new u.BufferAttribute(ve[le].array,ve[le].itemSize)):B.setAttribute(le,new u.BufferAttribute(ve[le].array,ve[le].itemSize))}),e.createMesh(B,oe),fe("")})})},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,h=e.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,g=(0,Ne.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ne.linear,onUpdate:function(y){v.value.x=y.x}});this.tween=g},n.dispose=function(){var e;re(G(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(ye);function ut(t){if(Array.isArray(t))return t}function ct(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(t,i){return ut(t)||ie(t,i)||H(t,i)||ct()}var Ce=require("d3-array"),lt=require("earcut"),We=K.n(lt),ft=require("@turf/boolean-clockwise"),ht=K.n(ft);function pt(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var vt=require("delaunator"),dt=K.n(vt),mt=require("@turf/boolean-point-in-polygon"),gt=K.n(mt),Le=require("d3-geo"),yt=require("d3-geo-voronoi"),qe=require("d3-scale");function bt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Le.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Le.geoInterpolate)(a,e),h=1/Math.ceil(o/i),v=h;v<1;)n.push(s(v)),v+=h}n.push(a=e)}),n})}function _t(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(c){return c/s*360%360-180},v=function(c){return Math.acos(2*c/o-1)/Math.PI*180-90},d=function(c){return o*(Math.cos((c+90)*Math.PI/180)+1)/2},g=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],y=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(c){return c<=n}:n===void 0?function(c){return c>=r}:n>=r?function(c){return c>=r&&c<=n}:function(c){return c>=r||c<=n},b=[],m=g[0];m<=g[1];m++){var _=h(m);y(_)&&b.push([_,v(m)])}return b}function De(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(i,t):gt()(t,i)}function wt(t,i){var r={type:"Polygon",coordinates:t},n=we((0,Le.geoBounds)(r),2),a=we(n[0],2),e=a[0],o=a[1],s=we(n[1],2),h=s[0],v=s[1];if(Math.min(Math.abs(h-e),Math.abs(v-o))<i)return[];var d=e>h||v>=89||o<=-89;return _t(i,{minLng:e,maxLng:h,minLat:o,maxLat:v}).filter(function(g){return De(g,r,d)})}function Mt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=bt(t,n),e=(0,Ce.merge)(a),o=wt(t,n),s=I(e).concat(I(o)),h={type:"Polygon",coordinates:t},v=we((0,Le.geoBounds)(h),2),d=we(v[0],2),g=d[0],y=d[1],b=we(v[1],2),m=b[0],_=b[1],c=g>m||_>=89||y<=-89,S=[];if(c){var j=(0,yt.geoVoronoi)(s).triangles(),Y=new Map(s.map(function(me,Pe){var Ae=we(me,2),ge=Ae[0],Re=Ae[1];return["".concat(ge,"-").concat(Re),Pe]}));j.features.forEach(function(me){var Pe,Ae=me.geometry.coordinates[0].slice(0,3).reverse(),ge=[];if(Ae.forEach(function(Te){var Me=we(Te,2),Ie=Me[0],Ct=Me[1],et="".concat(Ie,"-").concat(Ct);Y.has(et)&&ge.push(Y.get(et))}),ge.length===3){if(ge.some(function(Te){return Te<e.length})){var Re=me.properties.circumcenter;if(!De(Re,h,c))return}(Pe=S).push.apply(Pe,I(ge))}})}else if(o.length)for(var fe=function(me,Pe){var Ae,ge=[2,1,0].map(function(Me){return ve.triangles[me+Me]}),Re=ge.map(function(Me){return s[Me]});if(ge.some(function(Me){return Me<e.length})){var Te=[0,1].map(function(Me){return(0,Ce.mean)(Re,function(Ie){return Ie[Me]})});if(!De(Te,h,c))return"continue"}(Ae=S).push.apply(Ae,I(ge))},ve=dt().from(s),B=0,le=ve.triangles.length;B<le;B+=3)fe(B,le);else{var z=We().flatten(a),ne=z.vertices,oe=z.holes,de=oe===void 0?[]:oe;S=We()(ne,de,2)}var Oe=(0,qe.scaleLinear)((0,Ce.extent)(s,function(me){return me[0]}),[0,1]),Ee=(0,qe.scaleLinear)((0,Ce.extent)(s,function(me){return me[1]}),[0,1]),ke=s.map(function(me){var Pe=we(me,2),Ae=Pe[0],ge=Pe[1];return[Oe(Ae),Ee(ge)]}),Ot={points:s,indices:S,uvs:ke};return{contour:a,triangles:Ot}}var xt=Mt,Ke=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=we(e,2),s=o[0],h=o[1];return r?pt(s,h,i):[s,h,i]})});return We().flatten(n)}function Xe(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ue(t,i,n),e=a.vertices,o=a.holes,s=Ue(t,r,n),h=s.vertices,v=(0,Ce.merge)([h,e]),d=Math.round(h.length/3),g=new Set(o),y=0,b=[],m=0;m<d;m++){var _=m+1;if(_===d)_=y;else if(g.has(_)){var c=_;_=y,y=c}b.push(m,m+d,_+d),b.push(_+d,_,m)}for(var S=[],j=1;j>=0;j--)for(var Y=0;Y<d;Y+=1)S.push(Y/(d-1),j);return{indices:b,vertices:v,uvs:S,topVerts:h}}function Ye(t,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?t.indices:t.indices.slice().reverse(),vertices:Ue([t.points],i,a).vertices,uvs:r}}var At=function(t){"use strict";P(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,O.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,g=o.includeSides,y=o.curvatureResolution,b=o.cartesian,m=o.userDataRsoOffset;ht()(n[0])||n[0].reverse();var _=xt(n,{resolution:y}),c=_.contour,S=_.triangles,j=(0,Ce.merge)(S.uvs),Y=[],z=[],ne=[],oe=0,de=function(ve){var B=Math.round(Y.length/3),le=ne.length;Y=Y.concat(ve.vertices),z=z.concat(ve.uvs),ne=ne.concat(B?ve.indices.map(function(Oe){return Oe+B}):ve.indices),e.addGroup(le,ne.length-le,oe++)};if(g){var fe=Xe(c,s,h,b);de(fe),e.userData.rso=m?Xe(c,s,h+m,b):fe}return v&&de(Ye(S,s,j,!1,b)),d&&de(Ye(S,h,j,!0,b)),e.setIndex(ne),e[Ke]("position",new u.Float32BufferAttribute(Y,3)),e[Ke]("uv",new u.Float32BufferAttribute(z,2)),e.computeVertexNormals(),e}return r}(u.BufferGeometry),Pt=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,h=e.closedBottom,v=e.closedTop,d=e.curvatureResolution,g=e.userDataRsoOffset,y=e.cartesian,b=new At(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:y,userDataRsoOffset:g});this.createMesh(b,this.options.material)},r}(ye),Qe=K(705);function Je(t){var i=t.split,r=t.depth,n=t.points,a=new u[M](new u.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:i})});return(0,Qe.C)(),a}var St=function(t){"use strict";P(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=C((0,O.Z)({},a),{split:.1}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,g,y,b,m,_,c,S,j,Y,z,ne,oe,de,fe;return p().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(s=e.options,h=s.points,v=s.pointsArr,d=s.coordinatesArr,g=s.useGroups,y=s.depth,b=s.material,m=s.workerController,_=s.projection,c=s.cache,S=s.sideMap,j=s.topColor,Y=s.split,z=0,ne=b,!(S&&j)){B.next=22;break}if(z=Y,oe=S+j,!(c&&!c.get(oe))){B.next=12;break}return c.init(oe),B.next=10,e.getMaterial();case 10:de=B.sent,c.set(oe,de);case 12:if(!c){B.next=18;break}return B.next=15,c.get(oe);case 15:B.t0=B.sent,B.next=21;break;case 18:return B.next=20,e.getMaterial();case 20:B.t0=B.sent;case 21:ne=B.t0;case 22:if(!h){B.next=26;break}e.createMesh(Je({points:h,depth:y,split:z}),b),B.next=32;break;case 26:if(!v){B.next=30;break}fe=He.mergeBufferGeometries(v.map(function(le){return Je({points:le,depth:y,split:z})}),g!=null?g:!1),e.createMesh(fe,b),B.next=32;break;case 30:if(!(d&&m)){B.next=32;break}return B.abrupt("return",new Promise(function(le){m.postMessage({coordinatesArr:d,depth:y,split:z,useGroups:g,projection:_},function(Oe){var Ee=new u.BufferGeometry;Object.keys(Oe).forEach(function(ke){Ee.setAttribute(ke,new u.BufferAttribute(Oe[ke].array,Oe[ke].itemSize))}),e.createMesh(Ee,ne),le("")})}));case 32:case"end":return B.stop()}},o)}))()},n.getMaterial=function(){var e=this,o=this.options,s=o.topColor,h=o.sideMap,v=o.materialType,d=o.materialOptions,g=o.createCanvasObjectURL,y=o.split;return new Promise(function(b){var m=document.createElement("img");m.src=h,m.onload=function(){var _=y,c=document.createElement("canvas"),S=c.getContext("2d");c.height=m.height/(1-_),c.width=m.width,_&&(S.fillStyle=s,S.fillRect(0,0,m.width,c.height*_)),S.drawImage(m,0,c.height*_,m.width,m.height),g&&c.toBlob(function(ne){console.log(URL.createObjectURL(ne))});var j=new u.CanvasTexture(c),Y=e.pencil.renderer.capabilities.getMaxAnisotropy();j.anisotropy=Y;var z=new u[v||"MeshBasicMaterial"]((0,O.Z)({map:j},d||{}));b(z)}})},r}(ye)})(),module.exports=Be})();
132
+ `),_e=function(t){"use strict";S(r,t);var i=V(r);function r(){L(this,r);var n;return n=i.call(this),n.isMeshLine=!0,n.type="MeshLine",n.positions=[],n.previous=[],n.next=[],n.side=[],n.width=[],n.indices_array=[],n.uvs=[],n.counters=[],n._points=[],n._geom=null,n.widthCallback=null,n.matrixWorld=new u.Matrix4,Object.defineProperties(w(n),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}}),n}return r}(u.BufferGeometry);_e.prototype.setMatrixWorld=function(t){this.matrixWorld=t},_e.prototype.setGeometry=function(t,i){this._geometry=t,this.setPoints(t.getAttribute("position").array,i)},_e.prototype.setPoints=function(t,i){if(!(t instanceof Float32Array)&&!(t instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=t,this.widthCallback=i,this.positions=[],this.counters=[],t.length&&t[0]instanceof u.Vector3)for(var r=0;r<t.length;r++){var n=t[r],a=r/t.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<t.length;r+=3){var a=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Ze(t,i){var r=new u.Matrix4,n=new u.Ray,a=new u.Sphere,e=new u.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),t.ray.intersectSphere(a,e)!==!1){r.copy(this.matrixWorld).invert(),n.copy(t.ray).applyMatrix4(r);var s=new u.Vector3,h=new u.Vector3,v=new u.Vector3,d=this instanceof u.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var _=m.array,b=g.position.array,y=g.width.array,c=0,A=_.length-1;c<A;c+=d){var j=_[c],K=_[c+1];s.fromArray(b,j*3),h.fromArray(b,K*3);var z=y[Math.floor(c/3)]!==void 0?y[Math.floor(c/3)]:1,ne=t.params.Line.threshold+this.material.lineWidth*z/2,oe=ne*ne,de=n.distanceSqToSegment(s,h,e,v);if(!(de>oe)){e.applyMatrix4(this.matrixWorld);var fe=t.ray.origin.distanceTo(e);fe<t.near||fe>t.far||(i.push({distance:fe,point:v.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}),c=A)}}}}_e.prototype.raycast=Ze,_e.prototype.compareV3=function(t,i){var r=t*6,n=i*6;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},_e.prototype.copyV3=function(t){var i=t*6;return[this.positions[i],this.positions[i+1],this.positions[i+2]]},_e.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var i,r;this.compareV3(0,t-1)?r=this.copyV3(t-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var n=0;n<t;n++){if(this.side.push(1),this.side.push(-1),this.widthCallback?i=this.widthCallback(n/(t-1)):i=1,this.width.push(i),this.width.push(i),this.uvs.push(n/(t-1),0),this.uvs.push(n/(t-1),1),n<t-1){r=this.copyV3(n),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=n*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}n>0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(t-1,0)?r=this.copyV3(1):r=this.copyV3(t-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new u.BufferAttribute(new Float32Array(this.positions),3),previous:new u.BufferAttribute(new Float32Array(this.previous),3),next:new u.BufferAttribute(new Float32Array(this.next),3),side:new u.BufferAttribute(new Float32Array(this.side),1),width:new u.BufferAttribute(new Float32Array(this.width),1),uv:new u.BufferAttribute(new Float32Array(this.uvs),2),index:new u.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new u.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ge(t,i,r,n,a){var e;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=i?t.subarray?t.subarray(i,a&&i+a):t.slice(i,a&&i+a):t,r.set)r.set(t,n);else for(e=0;e<t.length;e++)r[e+n]=t[e];return r}_e.prototype.advance=function(t){var i=this._attributes.position.array,r=this._attributes.previous.array,n=this._attributes.next.array,a=i.length;Ge(i,0,r,0,a),Ge(i,6,i,0,a-6),i[a-6]=t.x,i[a-5]=t.y,i[a-4]=t.z,i[a-3]=t.x,i[a-2]=t.y,i[a-1]=t.z,Ge(i,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},u.ShaderChunk.meshline_vert=rt,u.ShaderChunk.meshline_frag=nt;var Ve=function(t){"use strict";S(r,t);var i=V(r);function r(n){L(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},u.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new u.Color(16777215)},opacity:{value:1},resolution:{value:new u.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new u.Vector2(1,1)},offset:{value:new u.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new u.Vector2(0,0)},lightColor:{value:new u.Color(16777215)}}),vertexShader:u.ShaderChunk.meshline_vert,fragmentShader:u.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(w(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(n),a}return r}(u.ShaderMaterial);Ve.prototype.copy=function(t){return u.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function it(t,i){if(t==null)return{};var r={},n=Object.keys(t),a,e;for(e=0;e<n.length;e++)a=n[e],!(i.indexOf(a)>=0)&&(r[a]=t[a]);return r}function at(t,i){if(t==null)return{};var r=it(t,i),n,a;if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);for(a=0;a<e.length;a++)n=e[a],!(i.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}var Ne=require("popmotion"),He=require("three/examples/jsm//utils/BufferGeometryUtils");function $e(t){var i=t.setPointWidth,r=t.nodes,n=new u.BufferGeometry,a=new _e;return n.setFromPoints(r),a.setGeometry(n,i),a}var ot={color:new u.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},st=function(t){"use strict";S(r,t);var i=V(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},ot,a),e}var n=r.prototype;return n.create=function(){var e=this,o=this.options,s=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,_=o.nodesArr,b=o.coordinatesArr,y=o.projection,c=o.workerController,A=o.useGroups,j=at(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),K=this.pencil.getSize(),z=K.width,ne=K.height,oe=new Ve(C((0,O.Z)({},j),{resolution:new u.Vector2(z,ne)}));if(this.material=oe,g)this.createMesh($e({nodes:g,setPointWidth:d}),oe);else if(_){var de=He.mergeBufferGeometries(_.map(function(fe){return $e({nodes:fe,setPointWidth:d})}),A!=null?A:!1);this.createMesh(de,oe)}else if(b&&c)return new Promise(function(fe){c.postMessage({coordinatesArr:b,projection:y,useGroups:A},function(ve){var B=new u.BufferGeometry;Object.keys(ve).forEach(function(le){le==="index"?B.setIndex(new u.BufferAttribute(ve[le].array,ve[le].itemSize)):B.setAttribute(le,new u.BufferAttribute(ve[le].array,ve[le].itemSize))}),e.createMesh(B,oe),fe("")})})},n.resize=function(e,o){this.material.uniforms.resolution.value.set(e,o)},n.animate=function(){var e=this.options,o=e.duration,s=e.delay,h=e.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,m=(0,Ne.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:Ne.linear,onUpdate:function(g){v.value.x=g.x}});this.tween=m},n.dispose=function(){var e;re(G(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},r}(ye);function ut(t){if(Array.isArray(t))return t}function ct(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(t,i){return ut(t)||ie(t,i)||H(t,i)||ct()}var Ce=require("d3-array"),lt=require("earcut"),We=X.n(lt),ft=require("@turf/boolean-clockwise"),ht=X.n(ft);function pt(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(90-i)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}var vt=require("delaunator"),dt=X.n(vt),mt=require("@turf/boolean-point-in-polygon"),gt=X.n(mt),Le=require("d3-geo"),yt=require("d3-geo-voronoi"),qe=require("d3-scale");function bt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Le.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Le.geoInterpolate)(a,e),h=1/Math.ceil(o/i),v=h;v<1;)n.push(s(v)),v+=h}n.push(a=e)}),n})}function _t(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.minLng,n=i.maxLng,a=i.minLat,e=i.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(c){return c/s*360%360-180},v=function(c){return Math.acos(2*c/o-1)/Math.PI*180-90},d=function(c){return o*(Math.cos((c+90)*Math.PI/180)+1)/2},m=[e!==void 0?Math.ceil(d(e)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(c){return c<=n}:n===void 0?function(c){return c>=r}:n>=r?function(c){return c>=r&&c<=n}:function(c){return c>=r||c<=n},_=[],b=m[0];b<=m[1];b++){var y=h(b);g(y)&&_.push([y,v(b)])}return _}function De(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Le.geoContains)(i,t):gt()(t,i)}function wt(t,i){var r={type:"Polygon",coordinates:t},n=we((0,Le.geoBounds)(r),2),a=we(n[0],2),e=a[0],o=a[1],s=we(n[1],2),h=s[0],v=s[1];if(Math.min(Math.abs(h-e),Math.abs(v-o))<i)return[];var d=e>h||v>=89||o<=-89;return _t(i,{minLng:e,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return De(m,r,d)})}function Mt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=bt(t,n),e=(0,Ce.merge)(a),o=wt(t,n),s=I(e).concat(I(o)),h={type:"Polygon",coordinates:t},v=we((0,Le.geoBounds)(h),2),d=we(v[0],2),m=d[0],g=d[1],_=we(v[1],2),b=_[0],y=_[1],c=m>b||y>=89||g<=-89,A=[];if(c){var j=(0,yt.geoVoronoi)(s).triangles(),K=new Map(s.map(function(me,Pe){var Ae=we(me,2),ge=Ae[0],Re=Ae[1];return["".concat(ge,"-").concat(Re),Pe]}));j.features.forEach(function(me){var Pe,Ae=me.geometry.coordinates[0].slice(0,3).reverse(),ge=[];if(Ae.forEach(function(Te){var Me=we(Te,2),Ie=Me[0],Ct=Me[1],et="".concat(Ie,"-").concat(Ct);K.has(et)&&ge.push(K.get(et))}),ge.length===3){if(ge.some(function(Te){return Te<e.length})){var Re=me.properties.circumcenter;if(!De(Re,h,c))return}(Pe=A).push.apply(Pe,I(ge))}})}else if(o.length)for(var fe=function(me,Pe){var Ae,ge=[2,1,0].map(function(Me){return ve.triangles[me+Me]}),Re=ge.map(function(Me){return s[Me]});if(ge.some(function(Me){return Me<e.length})){var Te=[0,1].map(function(Me){return(0,Ce.mean)(Re,function(Ie){return Ie[Me]})});if(!De(Te,h,c))return"continue"}(Ae=A).push.apply(Ae,I(ge))},ve=dt().from(s),B=0,le=ve.triangles.length;B<le;B+=3)fe(B,le);else{var z=We().flatten(a),ne=z.vertices,oe=z.holes,de=oe===void 0?[]:oe;A=We()(ne,de,2)}var Oe=(0,qe.scaleLinear)((0,Ce.extent)(s,function(me){return me[0]}),[0,1]),Ee=(0,qe.scaleLinear)((0,Ce.extent)(s,function(me){return me[1]}),[0,1]),ke=s.map(function(me){var Pe=we(me,2),Ae=Pe[0],ge=Pe[1];return[Oe(Ae),Ee(ge)]}),Ot={points:s,indices:A,uvs:ke};return{contour:a,triangles:Ot}}var xt=Mt,Ke=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=t.map(function(a){return a.map(function(e){var o=we(e,2),s=o[0],h=o[1];return r?pt(s,h,i):[s,h,i]})});return We().flatten(n)}function Xe(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ue(t,i,n),e=a.vertices,o=a.holes,s=Ue(t,r,n),h=s.vertices,v=(0,Ce.merge)([h,e]),d=Math.round(h.length/3),m=new Set(o),g=0,_=[],b=0;b<d;b++){var y=b+1;if(y===d)y=g;else if(m.has(y)){var c=y;y=g,g=c}_.push(b,b+d,y+d),_.push(y+d,y,b)}for(var A=[],j=1;j>=0;j--)for(var K=0;K<d;K+=1)A.push(K/(d-1),j);return{indices:_,vertices:v,uvs:A,topVerts:h}}function Ye(t,i,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:n?t.indices:t.indices.slice().reverse(),vertices:Ue([t.points],i,a).vertices,uvs:r}}var At=function(t){"use strict";S(r,t);var i=V(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,O.Z)({},{polygonGeoJson:n,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=e.parameters,s=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,_=o.cartesian,b=o.userDataRsoOffset;ht()(n[0])||n[0].reverse();var y=xt(n,{resolution:g}),c=y.contour,A=y.triangles,j=(0,Ce.merge)(A.uvs),K=[],z=[],ne=[],oe=0,de=function(ve){var B=Math.round(K.length/3),le=ne.length;K=K.concat(ve.vertices),z=z.concat(ve.uvs),ne=ne.concat(B?ve.indices.map(function(Oe){return Oe+B}):ve.indices),e.addGroup(le,ne.length-le,oe++)};if(m){var fe=Xe(c,s,h,_);de(fe),e.userData.rso=b?Xe(c,s,h+b,_):fe}return v&&de(Ye(A,s,j,!1,_)),d&&de(Ye(A,h,j,!0,_)),e.setIndex(ne),e[Ke]("position",new u.Float32BufferAttribute(K,3)),e[Ke]("uv",new u.Float32BufferAttribute(z,2)),e.computeVertexNormals(),e}return r}(u.BufferGeometry),Pt=function(t){"use strict";S(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.startHeight,s=e.height,h=e.closedBottom,v=e.closedTop,d=e.curvatureResolution,m=e.userDataRsoOffset,g=e.cartesian,_=new At(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(_,this.options.material)},r}(ye),Qe=X(705);function Je(t){var i=t.split,r=t.depth,n=t.points,a=new u[M](new u.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Qe.y)({split:i})});return(0,Qe.C)(),a}var St=function(t){"use strict";S(r,t);var i=V(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=C((0,O.Z)({},a),{split:.1}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,f.Z)(p().mark(function o(){var s,h,v,d,m,g,_,b,y,c,A,j,K,z,ne,oe,de,fe;return p().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(s=e.options,h=s.points,v=s.pointsArr,d=s.coordinatesArr,m=s.useGroups,g=s.depth,_=s.material,b=s.workerController,y=s.projection,c=s.cache,A=s.sideMap,j=s.topColor,K=s.split,z=0,ne=_,!(A&&j)){B.next=22;break}if(z=K,oe=A+j,!(c&&!c.get(oe))){B.next=12;break}return c.init(oe),B.next=10,e.getMaterial();case 10:de=B.sent,c.set(oe,de);case 12:if(!c){B.next=18;break}return B.next=15,c.get(oe);case 15:B.t0=B.sent,B.next=21;break;case 18:return B.next=20,e.getMaterial();case 20:B.t0=B.sent;case 21:ne=B.t0;case 22:if(!h){B.next=26;break}e.createMesh(Je({points:h,depth:g,split:z}),_),B.next=32;break;case 26:if(!v){B.next=30;break}fe=He.mergeBufferGeometries(v.map(function(le){return Je({points:le,depth:g,split:z})}),m!=null?m:!1),e.createMesh(fe,_),B.next=32;break;case 30:if(!(d&&b)){B.next=32;break}return B.abrupt("return",new Promise(function(le){b.postMessage({coordinatesArr:d,depth:g,split:z,useGroups:m,projection:y},function(Oe){var Ee=new u.BufferGeometry;Object.keys(Oe).forEach(function(ke){Ee.setAttribute(ke,new u.BufferAttribute(Oe[ke].array,Oe[ke].itemSize))}),e.createMesh(Ee,ne),le("")})}));case 32:case"end":return B.stop()}},o)}))()},n.getMaterial=function(){var e=this,o=this.options,s=o.topColor,h=o.sideMap,v=o.materialType,d=o.materialOptions,m=o.createCanvasObjectURL,g=o.split,_=o.maxAnisotropy;return new Promise(function(b){var y=document.createElement("img");y.src=h,y.onload=function(){var c=g,A=document.createElement("canvas"),j=A.getContext("2d");A.height=y.height/(1-c),A.width=y.width,c&&(j.fillStyle=s,j.fillRect(0,0,y.width,A.height*c)),j.drawImage(y,0,A.height*c,y.width,y.height),m&&A.toBlob(function(ne){console.log(URL.createObjectURL(ne))});var K=new u.CanvasTexture(A);K.anisotropy=_||e.pencil.renderer.capabilities.getMaxAnisotropy();var z=new u[v||"MeshBasicMaterial"]((0,O.Z)({map:K},d||{}));b(z)}})},r}(ye)})(),module.exports=Be})();
@@ -1,4 +1,4 @@
1
- import*as nt from"idb-keyval";import*as It from"three";import*as Ft from"three/examples/jsm/renderers/CSS2DRenderer";import*as it from"three/examples/jsm/renderers/CSS3DRenderer";import*as at from"popmotion";import*as Zt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ze from"d3-array";import*as Xt from"earcut";import*as Ht from"@turf/boolean-clockwise";import*as Kt from"delaunator";import*as $t from"@turf/boolean-point-in-polygon";import*as De from"d3-geo";import*as Yt from"d3-geo-voronoi";import*as Jt from"d3-scale";var Qt={666:function(L){var j=function(A){"use strict";var P=Object.prototype,x=P.hasOwnProperty,V,C=typeof Symbol=="function"?Symbol:{},T=C.iterator||"@@iterator",X=C.asyncIterator||"@@asyncIterator",M=C.toStringTag||"@@toStringTag";function k(f,l,p){return Object.defineProperty(f,l,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[l]}try{k({},"")}catch(f){k=function(l,p,S){return l[p]=S}}function Y(f,l,p,S){var b=l&&l.prototype instanceof se?l:se,Q=Object.create(b.prototype),I=new Me(S||[]);return Q._invoke=pe(f,p,I),Q}A.wrap=Y;function J(f,l,p){try{return{type:"normal",arg:f.call(l,p)}}catch(S){return{type:"throw",arg:S}}}var B="suspendedStart",u="suspendedYield",le="executing",re="completed",$={};function se(){}function W(){}function F(){}var G={};k(G,T,function(){return this});var H=Object.getPrototypeOf,N=H&&H(H(Be([])));N&&N!==P&&x.call(N,T)&&(G=N);var K=F.prototype=se.prototype=Object.create(G);W.prototype=F,k(K,"constructor",F),k(F,"constructor",W),W.displayName=k(F,M,"GeneratorFunction");function Z(f){["next","throw","return"].forEach(function(l){k(f,l,function(p){return this._invoke(l,p)})})}A.isGeneratorFunction=function(f){var l=typeof f=="function"&&f.constructor;return l?l===W||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,F):(f.__proto__=F,k(f,M,"GeneratorFunction")),f.prototype=Object.create(K),f},A.awrap=function(f){return{__await:f}};function ee(f,l){function p(Q,I,ie,fe){var ae=J(f[Q],f,I);if(ae.type==="throw")fe(ae.arg);else{var Le=ae.arg,Se=Le.value;return Se&&typeof Se=="object"&&x.call(Se,"__await")?l.resolve(Se.__await).then(function(ve){p("next",ve,ie,fe)},function(ve){p("throw",ve,ie,fe)}):l.resolve(Se).then(function(ve){Le.value=ve,ie(Le)},function(ve){return p("throw",ve,ie,fe)})}}var S;function b(Q,I){function ie(){return new l(function(fe,ae){p(Q,I,fe,ae)})}return S=S?S.then(ie,ie):ie()}this._invoke=b}Z(ee.prototype),k(ee.prototype,X,function(){return this}),A.AsyncIterator=ee,A.async=function(f,l,p,S,b){b===void 0&&(b=Promise);var Q=new ee(Y(f,l,p,S),b);return A.isGeneratorFunction(l)?Q:Q.next().then(function(I){return I.done?I.value:Q.next()})};function pe(f,l,p){var S=B;return function(Q,I){if(S===le)throw new Error("Generator is already running");if(S===re){if(Q==="throw")throw I;return Ee()}for(p.method=Q,p.arg=I;;){var ie=p.delegate;if(ie){var fe=ye(ie,p);if(fe){if(fe===$)continue;return fe}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(S===B)throw S=re,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);S=le;var ae=J(f,l,p);if(ae.type==="normal"){if(S=p.done?re:u,ae.arg===$)continue;return{value:ae.arg,done:p.done}}else ae.type==="throw"&&(S=re,p.method="throw",p.arg=ae.arg)}}}function ye(f,l){var p=f.iterator[l.method];if(p===V){if(l.delegate=null,l.method==="throw"){if(f.iterator.return&&(l.method="return",l.arg=V,ye(f,l),l.method==="throw"))return $;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var S=J(p,f.iterator,l.arg);if(S.type==="throw")return l.method="throw",l.arg=S.arg,l.delegate=null,$;var b=S.arg;if(!b)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,$;if(b.done)l[f.resultName]=b.value,l.next=f.nextLoc,l.method!=="return"&&(l.method="next",l.arg=V);else return b;return l.delegate=null,$}Z(K),k(K,M,"Generator"),k(K,T,function(){return this}),k(K,"toString",function(){return"[object Generator]"});function te(f){var l={tryLoc:f[0]};1 in f&&(l.catchLoc=f[1]),2 in f&&(l.finallyLoc=f[2],l.afterLoc=f[3]),this.tryEntries.push(l)}function z(f){var l=f.completion||{};l.type="normal",delete l.arg,f.completion=l}function Me(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(te,this),this.reset(!0)}A.keys=function(f){var l=[];for(var p in f)l.push(p);return l.reverse(),function S(){for(;l.length;){var b=l.pop();if(b in f)return S.value=b,S.done=!1,S}return S.done=!0,S}};function Be(f){if(f){var l=f[T];if(l)return l.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,S=function b(){for(;++p<f.length;)if(x.call(f,p))return b.value=f[p],b.done=!1,b;return b.value=V,b.done=!0,b};return S.next=S}}return{next:Ee}}A.values=Be;function Ee(){return{value:V,done:!0}}return Me.prototype={constructor:Me,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=V,this.done=!1,this.delegate=null,this.method="next",this.arg=V,this.tryEntries.forEach(z),!f)for(var l in this)l.charAt(0)==="t"&&x.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=V)},stop:function(){this.done=!0;var f=this.tryEntries[0],l=f.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var l=this;function p(fe,ae){return Q.type="throw",Q.arg=f,l.next=fe,ae&&(l.method="next",l.arg=V),!!ae}for(var S=this.tryEntries.length-1;S>=0;--S){var b=this.tryEntries[S],Q=b.completion;if(b.tryLoc==="root")return p("end");if(b.tryLoc<=this.prev){var I=x.call(b,"catchLoc"),ie=x.call(b,"finallyLoc");if(I&&ie){if(this.prev<b.catchLoc)return p(b.catchLoc,!0);if(this.prev<b.finallyLoc)return p(b.finallyLoc)}else if(I){if(this.prev<b.catchLoc)return p(b.catchLoc,!0)}else if(ie){if(this.prev<b.finallyLoc)return p(b.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(f,l){for(var p=this.tryEntries.length-1;p>=0;--p){var S=this.tryEntries[p];if(S.tryLoc<=this.prev&&x.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var b=S;break}}b&&(f==="break"||f==="continue")&&b.tryLoc<=l&&l<=b.finallyLoc&&(b=null);var Q=b?b.completion:{};return Q.type=f,Q.arg=l,b?(this.method="next",this.next=b.finallyLoc,$):this.complete(Q)},complete:function(f,l){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"&&l&&(this.next=l),$},finish:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.finallyLoc===f)return this.complete(p.completion,p.afterLoc),z(p),$}},catch:function(f){for(var l=this.tryEntries.length-1;l>=0;--l){var p=this.tryEntries[l];if(p.tryLoc===f){var S=p.completion;if(S.type==="throw"){var b=S.arg;z(p)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(f,l,p){return this.delegate={iterator:Be(f),resultName:l,nextLoc:p},this.method==="next"&&(this.arg=V),$}},A}(L.exports);try{regeneratorRuntime=j}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(L,j,A){A.d(j,{Z:function(){return P}});function P(x){if(x.geometry&&x.geometry.dispose(),x.material){var V=Array.isArray(x.material)?x.material:[x.material];V.forEach(function(C){var T,X,M,k,Y,J,B,u,le,re,$,se,W;(T=C.map)===null||T===void 0||T.dispose(),(X=C.lightMap)===null||X===void 0||X.dispose(),(M=C.bumpMap)===null||M===void 0||M.dispose(),(k=C.normalMap)===null||k===void 0||k.dispose(),(Y=C.specularMap)===null||Y===void 0||Y.dispose(),(J=C.envMap)===null||J===void 0||J.dispose(),(B=C.alphaMap)===null||B===void 0||B.dispose(),(u=C.aoMap)===null||u===void 0||u.dispose(),(le=C.displacementMap)===null||le===void 0||le.dispose(),(re=C.emissiveMap)===null||re===void 0||re.dispose(),($=C.gradientMap)===null||$===void 0||$.dispose(),(se=C.metalnessMap)===null||se===void 0||se.dispose(),(W=C.roughnessMap)===null||W===void 0||W.dispose(),C.dispose()})}}},521:function(L,j,A){A.d(j,{wf:function(){return C.Z}});var P=A(666),x=A.n(P),V=null,C=A(695),T=A(949);function X(W){if(W.material){var F=Array.isArray(W.material)?W.material:[W.material];F.forEach(function(G){var H,N;(H=G.color)===null||H===void 0||H.convertSRGBToLinear(),(N=G.emissive)===null||N===void 0||N.convertSRGBToLinear(),G.map&&(G.map.encoding=THREE.sRGBEncoding),G.emissiveMap&&(G.emissiveMap.encoding=THREE.sRGBEncoding)})}}var M=A(568),k=A(924),Y=W=>{var F={};return A.d(F,W),F},J=W=>()=>W,B=Y({get:()=>nt.get,set:()=>nt.set}),u=A(484),le=null,re=null,$=function(){var W=(0,M.Z)(x().mark(function F(G,H){var N,K,Z,ee,pe,ye;return x().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return N=H.version,z.next=4,(0,B.get)(G);case 4:if(Z=z.sent,!(Z&&Z[N])){z.next=9;break}K=Z[N],z.next=15;break;case 9:return z.next=11,(0,u.Z)(fetch(G).then(function(Me){if(Me.ok)return Me.blob();throw new Error}));case 11:ee=z.sent,pe=ee.res,ye=ee.err,ye||(K=pe,(0,B.set)(G,(0,k.Z)({},N,pe)));case 15:return z.abrupt("return",K?{url:URL.createObjectURL(K)}:{url:G});case 16:case"end":return z.stop()}},F)}));return function(G,H){return W.apply(this,arguments)}}(),se=A(705)},484:function(L,j,A){A.d(j,{Z:function(){return x}});var P=A(42);function x(V){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return V.then(function(T){return(0,P.Z)({err:null,res:T},C)}).catch(function(T){return(0,P.Z)({err:T,res:void 0},C)})}},705:function(L,j,A){A.d(j,{C:function(){return C},y:function(){return V}});var P=A(949),x=new Map,V=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,M,k,Y,J){var B=M[k*3],u=M[k*3+1],le=M[Y*3],re=M[Y*3+1],$=M[J*3],se=M[J*3+1],W;if(x.has(X))W=x.get(X);else{var F=T.box3||new P.Box3;if(!T.box3){var G=X.parameters.shapes.getPoints();F.setFromArray(G.map(function(ee){return[ee.x,ee.y,0]}).flat())}var H=F.getSize(new P.Vector3);T.split&&(H.y/=T.split),W={box:F,size:H},x.set(X,W)}var N=W.box,K=W.size,Z=T.split?1-T.split:0;return[new P.Vector2((B-N.min.x)/K.x,(u-N.min.y)/K.y+Z),new P.Vector2((le-N.min.x)/K.x,(re-N.min.y)/K.y+Z),new P.Vector2(($-N.min.x)/K.x,(se-N.min.y)/K.y+Z)]},generateSideWallUV:function(X,M,k,Y,J,B){var u=M[k*3],le=M[k*3+1],re=M[k*3+2],$=M[Y*3],se=M[Y*3+1],W=M[Y*3+2],F=M[J*3],G=M[J*3+1],H=M[J*3+2],N=M[B*3],K=M[B*3+1],Z=M[B*3+2],ee;if(x.has(M))ee=x.get(M);else{var pe=new P.Box3;pe.setFromArray(M);var ye=pe.getSize(new P.Vector3);T.split&&(ye.z/=1-T.split),ee={box:pe,size:ye},x.set(M,ee)}var te=ee.box,z=ee.size;return Math.abs(le-se)<Math.abs(u-$)?[new P.Vector2((u-te.min.x)/z.x,(re-te.min.z)/z.z),new P.Vector2(($-te.min.x)/z.x,(W-te.min.z)/z.z),new P.Vector2((F-te.min.x)/z.x,(H-te.min.z)/z.z),new P.Vector2((N-te.min.x)/z.x,(Z-te.min.z)/z.z)]:[new P.Vector2((le-te.min.y)/z.y,(re-te.min.z)/z.z),new P.Vector2((se-te.min.y)/z.y,(W-te.min.z)/z.z),new P.Vector2((G-te.min.y)/z.y,(H-te.min.z)/z.z),new P.Vector2((K-te.min.y)/z.y,(Z-te.min.z)/z.z)]}}},C=function(){x.clear()}},949:function(L){var j=P=>{var x={};return U.d(x,P),x},A=P=>()=>P;L.exports=It},568:function(L,j,A){A.d(j,{Z:function(){return x}});function P(V,C,T,X,M,k,Y){try{var J=V[k](Y),B=J.value}catch(u){T(u);return}J.done?C(B):Promise.resolve(B).then(X,M)}function x(V){return function(){var C=this,T=arguments;return new Promise(function(X,M){var k=V.apply(C,T);function Y(B){P(k,X,M,Y,J,"next",B)}function J(B){P(k,X,M,Y,J,"throw",B)}Y(void 0)})}}},924:function(L,j,A){A.d(j,{Z:function(){return P}});function P(x,V,C){return V in x?Object.defineProperty(x,V,{value:C,enumerable:!0,configurable:!0,writable:!0}):x[V]=C,x}},42:function(L,j,A){A.d(j,{Z:function(){return x}});var P=A(924);function x(V){for(var C=1;C<arguments.length;C++){var T=arguments[C]!=null?arguments[C]:{},X=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(T).filter(function(M){return Object.getOwnPropertyDescriptor(T,M).enumerable}))),X.forEach(function(M){(0,P.Z)(V,M,T[M])})}return V}}},ot={};function U(L){var j=ot[L];if(j!==void 0)return j.exports;var A=ot[L]={exports:{}};return Qt[L](A,A.exports,U),A.exports}(function(){U.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return U.d(j,{a:j}),j}})(),function(){U.d=function(L,j){for(var A in j)U.o(j,A)&&!U.o(L,A)&&Object.defineProperty(L,A,{enumerable:!0,get:j[A]})}}(),function(){U.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var _e={};(function(){U.d(_e,{Ei:function(){return Gt},Yo:function(){return Vt},Ee:function(){return Le},x1:function(){return gt},VJ:function(){return be},r7:function(){return Ve},XA:function(){return Xe},NB:function(){return ct},xv:function(){return S},nk:function(){return st}});function L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function j(e,n){return j=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},j(e,n)}function A(e,n){return j(e,n)}function P(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&A(e,n)}var x=U(42);function V(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function C(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function T(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function X(e){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},X(e)}function M(e){return X(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return e&&e.constructor===Symbol?"symbol":typeof e}function J(e,n){return n&&(Y(n)==="object"||typeof n=="function")?n:k(e)}function B(e){var n=T();return function(){var i=M(e),a;if(n){var t=M(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return J(this,a)}}var u=U(949);function le(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function re(e,n,r){return le()?re=Reflect.construct:re=function(a,t,o){var s=[null];s.push.apply(s,t);var h=Function.bind.apply(a,s),v=new h;return o&&A(v,o.prototype),v},re.apply(null,arguments)}function $(e,n,r){return re.apply(null,arguments)}function se(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function W(e,n,r){return n&&se(e.prototype,n),r&&se(e,r),e}function F(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function G(e){if(Array.isArray(e))return F(e)}function H(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function N(){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 K(e,n){if(!!e){if(typeof e=="string")return F(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(e,n)}}function Z(e){return G(e)||H(e)||K(e)||N()}var ee=U(484);function pe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,ee.Z)(r.promise,n)),r}var ye=e=>{var n={};return U.d(n,e),n},te=e=>()=>e,z=ye({CSS2DObject:()=>Ft.CSS2DObject}),Me=e=>{var n={};return U.d(n,e),n},Be=e=>()=>e,Ee=Me({CSS3DObject:()=>it.CSS3DObject,CSS3DSprite:()=>it.CSS3DSprite}),f=U(521),l=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||l(n)}))},p=function(){"use strict";function e(){L(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=pe(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(u.Mesh,Z(a)),this},n.createGroup=function(){return this.object3d=new u.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(u.Points,Z(a)),this},n.createCSS2DObject=function(i){return this.object3d=new z.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Ee.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Ee.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new u.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,Z(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,Z(a)),this},n.getSize=function(){var i=new u.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new u.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){l(this.object3d)},W(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),S=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var g=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=g}else{var _=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),y=new u.PlaneGeometry(1,1,1,1);this.createMesh(y,_)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(v)},i.setText=function(t,o){var s=(0,x.Z)(C((0,x.Z)({},this.options),{text:t}),o||{}),h=s.text,v=s.fontSize,d=s.fontFamily,g=s.fontWeight,_=s.flipX,y=s.scale,m=this.canvas;m.width=v*h.length*2,m.height=v;var w=m.getContext("2d");w.font="".concat(g," ").concat(v,"px/1 ").concat(d);var c=w.measureText(h).width;m.width=c,this.width=c,w=m.getContext("2d"),w.clearRect(0,0,m.width,m.height),_&&w.scale(-1,1),w.font="".concat(g," ").concat(v,"px/1 ").concat(d),w.textBaseline="middle",w.fillStyle="#ffffff",w.fillText(h,_?c*-1:0,m.height/2),w.restore();var O=new u.Texture(m);O.anisotropy=16,O.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=O,E.material.needsUpdate=!0,E.scale.set(O.image.width*y,O.image.height*y,1)},r}(p),b=U(568),Q=U(666),I=U.n(Q),ie=+u.REVISION<144,fe=ie?"ExtrudeBufferGeometry":"ExtrudeGeometry",ae=ie?"PlaneBufferGeometry":"PlaneGeometry",Le=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,b.Z)(I().mark(function o(){var s,h,v,d,g,_,y,m,w,c;return I().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return s=t.options,h=s.transparent,v=s.blending,d=s.src,g=s.depthWrite,_=s.alphaTest,y=s.sprite,m=s.sizeAttenuation,E.next=3,new u.TextureLoader().loadAsync(d);case 3:return w=E.sent,c=y?new u.SpriteMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:_!=null?_:0,sizeAttenuation:m!=null?m:!0}):new u.MeshBasicMaterial({map:w,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:g!=null?g:!0,alphaTest:_!=null?_:0}),E.abrupt("return",c);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,b.Z)(I().mark(function o(){var s,h,v,d,g,_,y,m;return I().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=t.options,h=s.scale,v=s.position,d=s.src,g=s.cache,_=s.sprite,!(g&&!g.get(d))){c.next=7;break}return g.init(d),c.next=5,t.getMaterial();case 5:y=c.sent,g.set(d,y);case 7:if(!g){c.next=13;break}return c.next=10,g.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,t.getMaterial();case 15:c.t0=c.sent;case 16:m=c.t0,t.texture=m.map,_?t.createSprite(m):t.createMesh(new u[ae](1,1),m),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function Se(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=M(e),e!==null););return e}function ve(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ve=Reflect.get:ve=function(a,t,o){var s=Se(a,t);if(!!s){var h=Object.getOwnPropertyDescriptor(s,t);return h.get?h.get.call(o||a):h.value}},ve(e,n,r)}function We(e,n,r){return ve(e,n,r)}var st=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,g=t.autoPlay,_=t.loop,y=t.alphaTest,m=t.sprite,w=pe(),c=document.createElement("video");return c.addEventListener("loadedmetadata",function(){var O=new u.VideoTexture(c);O.format=d!=null?d:u.RGBAFormat,O.needsUpdate=!0;var E=m?new u.SpriteMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:y!=null?y:0}):new u.MeshBasicMaterial({map:O,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:y!=null?y:0});w.resolve(E)},!1),c.src=o,c.muted=!0,c.autoplay=g,c.loop=_,c.preload="auto",w.promise},i.create=function(){var t=this;return(0,b.Z)(I().mark(function o(){var s,h,v,d,g,_,y,m;return I().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=t.options,h=s.scale,v=s.position,d=s.src,g=s.cache,_=s.sprite,!(g&&!g.get(d))){c.next=7;break}return g.init(d),c.next=5,t.getMaterial();case 5:y=c.sent,g.set(d,y);case 7:if(!g){c.next=13;break}return c.next=10,g.get(d);case 10:c.t0=c.sent,c.next=16;break;case 13:return c.next=15,t.getMaterial();case 15:c.t0=c.sent;case 16:m=c.t0,t.video=m.map.image,_?t.createSprite(m):t.createMesh(new u[ae](1,1),m),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return c.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),We(M(r.prototype),"dispose",this).call(this)},r}(p),ut=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(g){g.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,b.Z)(I().mark(function o(){var s,h,v,d;return I().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new u.CanvasTexture(s),d=new u.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",d);case 9:case"end":return _.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,h=t.scale,v=h===void 0?new u.Vector3(1,1,1):h,d=t.position,g=d===void 0?new u.Vector3(0,0,0):d,_=t.cache,y=this;return(0,b.Z)(I().mark(function m(){var w,c,O,E;return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(w="node-create-pick-object",!(_&&!_.get(w))){R.next=7;break}return _.init(w),R.next=5,y.getMaterial(s);case 5:c=R.sent,_.set(w,c);case 7:if(!_){R.next=13;break}return R.next=10,_.get(w);case 10:R.t0=R.sent,R.next=16;break;case 13:return R.next=15,y.getMaterial(s);case 15:R.t0=R.sent;case 16:O=R.t0,E=new u.Sprite(O),E.scale.set(O.map.image.width*v.x,O.map.image.height*v.y,1),E.position.copy(g),y.add(E),y.pickObject=E;case 22:case"end":return R.stop()}},m)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),We(M(r.prototype),"dispose",this).call(this)},W(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var s=o.map(function(h){return Z(t.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(p),ct=ut,lt=`
1
+ import*as nt from"idb-keyval";import*as It from"three";import*as Ft from"three/examples/jsm/renderers/CSS2DRenderer";import*as it from"three/examples/jsm/renderers/CSS3DRenderer";import*as at from"popmotion";import*as Zt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Ze from"d3-array";import*as Xt from"earcut";import*as Ht from"@turf/boolean-clockwise";import*as Kt from"delaunator";import*as $t from"@turf/boolean-point-in-polygon";import*as De from"d3-geo";import*as Yt from"d3-geo-voronoi";import*as Jt from"d3-scale";var Qt={666:function(L){var j=function(A){"use strict";var S=Object.prototype,x=S.hasOwnProperty,V,C=typeof Symbol=="function"?Symbol:{},T=C.iterator||"@@iterator",X=C.asyncIterator||"@@asyncIterator",M=C.toStringTag||"@@toStringTag";function k(f,c,p){return Object.defineProperty(f,c,{value:p,enumerable:!0,configurable:!0,writable:!0}),f[c]}try{k({},"")}catch(f){k=function(c,p,O){return c[p]=O}}function Y(f,c,p,O){var w=c&&c.prototype instanceof se?c:se,q=Object.create(w.prototype),I=new Me(O||[]);return q._invoke=pe(f,p,I),q}A.wrap=Y;function J(f,c,p){try{return{type:"normal",arg:f.call(c,p)}}catch(O){return{type:"throw",arg:O}}}var B="suspendedStart",u="suspendedYield",le="executing",re="completed",$={};function se(){}function W(){}function F(){}var G={};k(G,T,function(){return this});var H=Object.getPrototypeOf,N=H&&H(H(Be([])));N&&N!==S&&x.call(N,T)&&(G=N);var K=F.prototype=se.prototype=Object.create(G);W.prototype=F,k(K,"constructor",F),k(F,"constructor",W),W.displayName=k(F,M,"GeneratorFunction");function Z(f){["next","throw","return"].forEach(function(c){k(f,c,function(p){return this._invoke(c,p)})})}A.isGeneratorFunction=function(f){var c=typeof f=="function"&&f.constructor;return c?c===W||(c.displayName||c.name)==="GeneratorFunction":!1},A.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,F):(f.__proto__=F,k(f,M,"GeneratorFunction")),f.prototype=Object.create(K),f},A.awrap=function(f){return{__await:f}};function ee(f,c){function p(q,I,ie,fe){var ae=J(f[q],f,I);if(ae.type==="throw")fe(ae.arg);else{var Le=ae.arg,Se=Le.value;return Se&&typeof Se=="object"&&x.call(Se,"__await")?c.resolve(Se.__await).then(function(ve){p("next",ve,ie,fe)},function(ve){p("throw",ve,ie,fe)}):c.resolve(Se).then(function(ve){Le.value=ve,ie(Le)},function(ve){return p("throw",ve,ie,fe)})}}var O;function w(q,I){function ie(){return new c(function(fe,ae){p(q,I,fe,ae)})}return O=O?O.then(ie,ie):ie()}this._invoke=w}Z(ee.prototype),k(ee.prototype,X,function(){return this}),A.AsyncIterator=ee,A.async=function(f,c,p,O,w){w===void 0&&(w=Promise);var q=new ee(Y(f,c,p,O),w);return A.isGeneratorFunction(c)?q:q.next().then(function(I){return I.done?I.value:q.next()})};function pe(f,c,p){var O=B;return function(q,I){if(O===le)throw new Error("Generator is already running");if(O===re){if(q==="throw")throw I;return Ee()}for(p.method=q,p.arg=I;;){var ie=p.delegate;if(ie){var fe=ye(ie,p);if(fe){if(fe===$)continue;return fe}}if(p.method==="next")p.sent=p._sent=p.arg;else if(p.method==="throw"){if(O===B)throw O=re,p.arg;p.dispatchException(p.arg)}else p.method==="return"&&p.abrupt("return",p.arg);O=le;var ae=J(f,c,p);if(ae.type==="normal"){if(O=p.done?re:u,ae.arg===$)continue;return{value:ae.arg,done:p.done}}else ae.type==="throw"&&(O=re,p.method="throw",p.arg=ae.arg)}}}function ye(f,c){var p=f.iterator[c.method];if(p===V){if(c.delegate=null,c.method==="throw"){if(f.iterator.return&&(c.method="return",c.arg=V,ye(f,c),c.method==="throw"))return $;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var O=J(p,f.iterator,c.arg);if(O.type==="throw")return c.method="throw",c.arg=O.arg,c.delegate=null,$;var w=O.arg;if(!w)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,$;if(w.done)c[f.resultName]=w.value,c.next=f.nextLoc,c.method!=="return"&&(c.method="next",c.arg=V);else return w;return c.delegate=null,$}Z(K),k(K,M,"Generator"),k(K,T,function(){return this}),k(K,"toString",function(){return"[object Generator]"});function te(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 z(f){var c=f.completion||{};c.type="normal",delete c.arg,f.completion=c}function Me(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(te,this),this.reset(!0)}A.keys=function(f){var c=[];for(var p in f)c.push(p);return c.reverse(),function O(){for(;c.length;){var w=c.pop();if(w in f)return O.value=w,O.done=!1,O}return O.done=!0,O}};function Be(f){if(f){var c=f[T];if(c)return c.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var p=-1,O=function w(){for(;++p<f.length;)if(x.call(f,p))return w.value=f[p],w.done=!1,w;return w.value=V,w.done=!0,w};return O.next=O}}return{next:Ee}}A.values=Be;function Ee(){return{value:V,done:!0}}return Me.prototype={constructor:Me,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=V,this.done=!1,this.delegate=null,this.method="next",this.arg=V,this.tryEntries.forEach(z),!f)for(var c in this)c.charAt(0)==="t"&&x.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=V)},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(fe,ae){return q.type="throw",q.arg=f,c.next=fe,ae&&(c.method="next",c.arg=V),!!ae}for(var O=this.tryEntries.length-1;O>=0;--O){var w=this.tryEntries[O],q=w.completion;if(w.tryLoc==="root")return p("end");if(w.tryLoc<=this.prev){var I=x.call(w,"catchLoc"),ie=x.call(w,"finallyLoc");if(I&&ie){if(this.prev<w.catchLoc)return p(w.catchLoc,!0);if(this.prev<w.finallyLoc)return p(w.finallyLoc)}else if(I){if(this.prev<w.catchLoc)return p(w.catchLoc,!0)}else if(ie){if(this.prev<w.finallyLoc)return p(w.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 O=this.tryEntries[p];if(O.tryLoc<=this.prev&&x.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var w=O;break}}w&&(f==="break"||f==="continue")&&w.tryLoc<=c&&c<=w.finallyLoc&&(w=null);var q=w?w.completion:{};return q.type=f,q.arg=c,w?(this.method="next",this.next=w.finallyLoc,$):this.complete(q)},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),$},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),z(p),$}},catch:function(f){for(var c=this.tryEntries.length-1;c>=0;--c){var p=this.tryEntries[c];if(p.tryLoc===f){var O=p.completion;if(O.type==="throw"){var w=O.arg;z(p)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(f,c,p){return this.delegate={iterator:Be(f),resultName:c,nextLoc:p},this.method==="next"&&(this.arg=V),$}},A}(L.exports);try{regeneratorRuntime=j}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(L,j,A){A.d(j,{Z:function(){return S}});function S(x){if(x.geometry&&x.geometry.dispose(),x.material){var V=Array.isArray(x.material)?x.material:[x.material];V.forEach(function(C){var T,X,M,k,Y,J,B,u,le,re,$,se,W;(T=C.map)===null||T===void 0||T.dispose(),(X=C.lightMap)===null||X===void 0||X.dispose(),(M=C.bumpMap)===null||M===void 0||M.dispose(),(k=C.normalMap)===null||k===void 0||k.dispose(),(Y=C.specularMap)===null||Y===void 0||Y.dispose(),(J=C.envMap)===null||J===void 0||J.dispose(),(B=C.alphaMap)===null||B===void 0||B.dispose(),(u=C.aoMap)===null||u===void 0||u.dispose(),(le=C.displacementMap)===null||le===void 0||le.dispose(),(re=C.emissiveMap)===null||re===void 0||re.dispose(),($=C.gradientMap)===null||$===void 0||$.dispose(),(se=C.metalnessMap)===null||se===void 0||se.dispose(),(W=C.roughnessMap)===null||W===void 0||W.dispose(),C.dispose()})}}},521:function(L,j,A){A.d(j,{wf:function(){return C.Z}});var S=A(666),x=A.n(S),V=null,C=A(695),T=A(949);function X(W){if(W.material){var F=Array.isArray(W.material)?W.material:[W.material];F.forEach(function(G){var H,N;(H=G.color)===null||H===void 0||H.convertSRGBToLinear(),(N=G.emissive)===null||N===void 0||N.convertSRGBToLinear(),G.map&&(G.map.encoding=THREE.sRGBEncoding),G.emissiveMap&&(G.emissiveMap.encoding=THREE.sRGBEncoding)})}}var M=A(568),k=A(924),Y=W=>{var F={};return A.d(F,W),F},J=W=>()=>W,B=Y({get:()=>nt.get,set:()=>nt.set}),u=A(484),le=null,re=null,$=function(){var W=(0,M.Z)(x().mark(function F(G,H){var N,K,Z,ee,pe,ye;return x().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return N=H.version,z.next=4,(0,B.get)(G);case 4:if(Z=z.sent,!(Z&&Z[N])){z.next=9;break}K=Z[N],z.next=15;break;case 9:return z.next=11,(0,u.Z)(fetch(G).then(function(Me){if(Me.ok)return Me.blob();throw new Error}));case 11:ee=z.sent,pe=ee.res,ye=ee.err,ye||(K=pe,(0,B.set)(G,(0,k.Z)({},N,pe)));case 15:return z.abrupt("return",K?{url:URL.createObjectURL(K)}:{url:G});case 16:case"end":return z.stop()}},F)}));return function(G,H){return W.apply(this,arguments)}}(),se=A(705)},484:function(L,j,A){A.d(j,{Z:function(){return x}});var S=A(42);function x(V){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return V.then(function(T){return(0,S.Z)({err:null,res:T},C)}).catch(function(T){return(0,S.Z)({err:T,res:void 0},C)})}},705:function(L,j,A){A.d(j,{C:function(){return C},y:function(){return V}});var S=A(949),x=new Map,V=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(X,M,k,Y,J){var B=M[k*3],u=M[k*3+1],le=M[Y*3],re=M[Y*3+1],$=M[J*3],se=M[J*3+1],W;if(x.has(X))W=x.get(X);else{var F=T.box3||new S.Box3;if(!T.box3){var G=X.parameters.shapes.getPoints();F.setFromArray(G.map(function(ee){return[ee.x,ee.y,0]}).flat())}var H=F.getSize(new S.Vector3);T.split&&(H.y/=T.split),W={box:F,size:H},x.set(X,W)}var N=W.box,K=W.size,Z=T.split?1-T.split:0;return[new S.Vector2((B-N.min.x)/K.x,(u-N.min.y)/K.y+Z),new S.Vector2((le-N.min.x)/K.x,(re-N.min.y)/K.y+Z),new S.Vector2(($-N.min.x)/K.x,(se-N.min.y)/K.y+Z)]},generateSideWallUV:function(X,M,k,Y,J,B){var u=M[k*3],le=M[k*3+1],re=M[k*3+2],$=M[Y*3],se=M[Y*3+1],W=M[Y*3+2],F=M[J*3],G=M[J*3+1],H=M[J*3+2],N=M[B*3],K=M[B*3+1],Z=M[B*3+2],ee;if(x.has(M))ee=x.get(M);else{var pe=new S.Box3;pe.setFromArray(M);var ye=pe.getSize(new S.Vector3);T.split&&(ye.z/=1-T.split),ee={box:pe,size:ye},x.set(M,ee)}var te=ee.box,z=ee.size;return Math.abs(le-se)<Math.abs(u-$)?[new S.Vector2((u-te.min.x)/z.x,(re-te.min.z)/z.z),new S.Vector2(($-te.min.x)/z.x,(W-te.min.z)/z.z),new S.Vector2((F-te.min.x)/z.x,(H-te.min.z)/z.z),new S.Vector2((N-te.min.x)/z.x,(Z-te.min.z)/z.z)]:[new S.Vector2((le-te.min.y)/z.y,(re-te.min.z)/z.z),new S.Vector2((se-te.min.y)/z.y,(W-te.min.z)/z.z),new S.Vector2((G-te.min.y)/z.y,(H-te.min.z)/z.z),new S.Vector2((K-te.min.y)/z.y,(Z-te.min.z)/z.z)]}}},C=function(){x.clear()}},949:function(L){var j=S=>{var x={};return U.d(x,S),x},A=S=>()=>S;L.exports=It},568:function(L,j,A){A.d(j,{Z:function(){return x}});function S(V,C,T,X,M,k,Y){try{var J=V[k](Y),B=J.value}catch(u){T(u);return}J.done?C(B):Promise.resolve(B).then(X,M)}function x(V){return function(){var C=this,T=arguments;return new Promise(function(X,M){var k=V.apply(C,T);function Y(B){S(k,X,M,Y,J,"next",B)}function J(B){S(k,X,M,Y,J,"throw",B)}Y(void 0)})}}},924:function(L,j,A){A.d(j,{Z:function(){return S}});function S(x,V,C){return V in x?Object.defineProperty(x,V,{value:C,enumerable:!0,configurable:!0,writable:!0}):x[V]=C,x}},42:function(L,j,A){A.d(j,{Z:function(){return x}});var S=A(924);function x(V){for(var C=1;C<arguments.length;C++){var T=arguments[C]!=null?arguments[C]:{},X=Object.keys(T);typeof Object.getOwnPropertySymbols=="function"&&(X=X.concat(Object.getOwnPropertySymbols(T).filter(function(M){return Object.getOwnPropertyDescriptor(T,M).enumerable}))),X.forEach(function(M){(0,S.Z)(V,M,T[M])})}return V}}},ot={};function U(L){var j=ot[L];if(j!==void 0)return j.exports;var A=ot[L]={exports:{}};return Qt[L](A,A.exports,U),A.exports}(function(){U.n=function(L){var j=L&&L.__esModule?function(){return L.default}:function(){return L};return U.d(j,{a:j}),j}})(),function(){U.d=function(L,j){for(var A in j)U.o(j,A)&&!U.o(L,A)&&Object.defineProperty(L,A,{enumerable:!0,get:j[A]})}}(),function(){U.o=function(L,j){return Object.prototype.hasOwnProperty.call(L,j)}}();var _e={};(function(){U.d(_e,{Ei:function(){return Gt},Yo:function(){return Vt},Ee:function(){return Le},x1:function(){return gt},VJ:function(){return be},r7:function(){return Ve},XA:function(){return Xe},NB:function(){return ct},xv:function(){return O},nk:function(){return st}});function L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function j(e,n){return j=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},j(e,n)}function A(e,n){return j(e,n)}function S(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&A(e,n)}var x=U(42);function V(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,i)}return r}function C(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function T(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function X(e){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},X(e)}function M(e){return X(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return e&&e.constructor===Symbol?"symbol":typeof e}function J(e,n){return n&&(Y(n)==="object"||typeof n=="function")?n:k(e)}function B(e){var n=T();return function(){var i=M(e),a;if(n){var t=M(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return J(this,a)}}var u=U(949);function le(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function re(e,n,r){return le()?re=Reflect.construct:re=function(a,t,o){var s=[null];s.push.apply(s,t);var h=Function.bind.apply(a,s),v=new h;return o&&A(v,o.prototype),v},re.apply(null,arguments)}function $(e,n,r){return re.apply(null,arguments)}function se(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function W(e,n,r){return n&&se(e.prototype,n),r&&se(e,r),e}function F(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function G(e){if(Array.isArray(e))return F(e)}function H(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function N(){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 K(e,n){if(!!e){if(typeof e=="string")return F(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(e,n)}}function Z(e){return G(e)||H(e)||K(e)||N()}var ee=U(484);function pe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={};return r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),e&&(r.promise=(0,ee.Z)(r.promise,n)),r}var ye=e=>{var n={};return U.d(n,e),n},te=e=>()=>e,z=ye({CSS2DObject:()=>Ft.CSS2DObject}),Me=e=>{var n={};return U.d(n,e),n},Be=e=>()=>e,Ee=Me({CSS3DObject:()=>it.CSS3DObject,CSS3DSprite:()=>it.CSS3DSprite}),f=U(521),c=function(e){e&&((0,f.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||c(n)}))},p=function(){"use strict";function e(){L(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=pe(),this.visible=!1}var n=e.prototype;return n.init=function(){},n.create=function(){},n.render=function(){},n.update=function(i,a){},n.resize=function(i,a){},n.show=function(){return this.object3d&&(this.object3d.visible=!0),this.visible=!0,this},n.hide=function(){return this.object3d&&(this.object3d.visible=!1),this.visible=!1,this},n.isVisible=function(){return this.visible},n.createMesh=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(u.Mesh,Z(a)),this},n.createGroup=function(){return this.object3d=new u.Group,this},n.createPoints=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];return this.object3d=$(u.Points,Z(a)),this},n.createCSS2DObject=function(i){return this.object3d=new z.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new Ee.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new Ee.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new u.Sprite(i),this},n.add=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).add.apply(o,Z(a)),this},n.remove=function(){for(var i=arguments.length,a=new Array(i),t=0;t<i;t++)a[t]=arguments[t];var o;return(o=this.object3d).remove.apply(o,Z(a)),this},n.getSize=function(){var i=new u.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new u.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){c(this.object3d)},W(e,[{key:"parent",get:function(){var i=this.object3d.parent;return(i==null?void 0:i.userData.BaseObject_)||this.pencil.scene}},{key:"children",get:function(){return this.object3d.children.map(function(i){return i.userData.BaseObject_}).filter(function(i){return!!i})}}]),e}(),O=function(e){"use strict";S(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.width=0,t.canvas=document.createElement("canvas"),t.options=(0,x.Z)({},{scale:.5,fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,sprite:!1,sizeAttenuation:!0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.lookAt,h=t.sprite,v=t.text,d=t.sizeAttenuation;if(h){var m=new u.Sprite(new u.SpriteMaterial({transparent:!0,sizeAttenuation:d}));this.object3d=m}else{var g=new u.MeshBasicMaterial({side:u.DoubleSide,transparent:!0}),b=new u.PlaneGeometry(1,1,1,1);this.createMesh(b,g)}this.object3d.position.copy(o),s&&this.object3d.lookAt(s),this.setText(v)},i.setText=function(t,o){var s=(0,x.Z)(C((0,x.Z)({},this.options),{text:t}),o||{}),h=s.text,v=s.fontSize,d=s.fontFamily,m=s.fontWeight,g=s.flipX,b=s.scale,y=this.canvas;y.width=v*h.length*2,y.height=v;var _=y.getContext("2d");_.font="".concat(m," ").concat(v,"px/1 ").concat(d);var l=_.measureText(h).width;y.width=l,this.width=l,_=y.getContext("2d"),_.clearRect(0,0,y.width,y.height),g&&_.scale(-1,1),_.font="".concat(m," ").concat(v,"px/1 ").concat(d),_.textBaseline="middle",_.fillStyle="#ffffff",_.fillText(h,g?l*-1:0,y.height/2),_.restore();var P=new u.Texture(y);P.anisotropy=16,P.needsUpdate=!0;var E=this.object3d;E.material.map&&E.material.map.dispose(),E.material.map=P,E.material.needsUpdate=!0,E.scale.set(P.image.width*b,P.image.height*b,1)},r}(p),w=U(568),q=U(666),I=U.n(q),ie=+u.REVISION<144,fe=ie?"ExtrudeBufferGeometry":"ExtrudeGeometry",ae=ie?"PlaneBufferGeometry":"PlaneGeometry",Le=function(e){"use strict";S(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,w.Z)(I().mark(function o(){var s,h,v,d,m,g,b,y,_,l;return I().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return s=t.options,h=s.transparent,v=s.blending,d=s.src,m=s.depthWrite,g=s.alphaTest,b=s.sprite,y=s.sizeAttenuation,E.next=3,new u.TextureLoader().loadAsync(d);case 3:return _=E.sent,l=b?new u.SpriteMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0,sizeAttenuation:y!=null?y:!0}):new u.MeshBasicMaterial({map:_,transparent:h!=null?h:!1,blending:v!=null?v:u.NormalBlending,depthWrite:m!=null?m:!0,alphaTest:g!=null?g:0}),E.abrupt("return",l);case 6:case"end":return E.stop()}},o)}))()},i.create=function(){var t=this;return(0,w.Z)(I().mark(function o(){var s,h,v,d,m,g,b,y;return I().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(s=t.options,h=s.scale,v=s.position,d=s.src,m=s.cache,g=s.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.texture=y.map,g?t.createSprite(y):t.createMesh(new u[ae](1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},r}(p);function Se(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=M(e),e!==null););return e}function ve(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?ve=Reflect.get:ve=function(a,t,o){var s=Se(a,t);if(!!s){var h=Object.getOwnPropertyDescriptor(s,t);return h.get?h.get.call(o||a):h.value}},ve(e,n,r)}function We(e,n,r){return ve(e,n,r)}var st=function(e){"use strict";S(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,h=t.blending,v=t.depthWrite,d=t.format,m=t.autoPlay,g=t.loop,b=t.alphaTest,y=t.sprite,_=pe(),l=document.createElement("video");return l.addEventListener("loadedmetadata",function(){var P=new u.VideoTexture(l);P.format=d!=null?d:u.RGBAFormat,P.needsUpdate=!0;var E=y?new u.SpriteMaterial({map:P,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0}):new u.MeshBasicMaterial({map:P,transparent:s!=null?s:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:b!=null?b:0});_.resolve(E)},!1),l.src=o,l.muted=!0,l.autoplay=m,l.loop=g,l.preload="auto",_.promise},i.create=function(){var t=this;return(0,w.Z)(I().mark(function o(){var s,h,v,d,m,g,b,y;return I().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(s=t.options,h=s.scale,v=s.position,d=s.src,m=s.cache,g=s.sprite,!(m&&!m.get(d))){l.next=7;break}return m.init(d),l.next=5,t.getMaterial();case 5:b=l.sent,m.set(d,b);case 7:if(!m){l.next=13;break}return l.next=10,m.get(d);case 10:l.t0=l.sent,l.next=16;break;case 13:return l.next=15,t.getMaterial();case 15:l.t0=l.sent;case 16:y=l.t0,t.video=y.map.image,g?t.createSprite(y):t.createMesh(new u[ae](1,1),y),h&&t.setScale(h),v&&t.object3d.position.copy(v);case 21:case"end":return l.stop()}},o)}))()},i.setScale=function(t){this.object3d.scale.set(this.video.videoWidth*t,this.video.videoHeight*t,1)},i.render=function(){var t=this.options.autoPlay;t&&this.video.play()},i.dispose=function(){this.video.pause(),this.video.src="",this.video.load(),We(M(r.prototype),"dispose",this).call(this)},r}(p),ut=function(e){"use strict";S(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,h=t.onClick,v=t.zIndexFix,d=document.createElement("div");this.element=d,d.appendChild(s),this.createCSS2DObject(d),o&&this.object3d.position.copy(o),h&&this.clickTarge.forEach(function(m){m.addEventListener("click",h)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,w.Z)(I().mark(function o(){var s,h,v,d;return I().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,h=s.getContext("2d"),h.fillStyle="#ff0000",h.fillRect(0,0,256,256),v=new u.CanvasTexture(s),d=new u.SpriteMaterial({map:v,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",d);case 9:case"end":return g.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,h=t.scale,v=h===void 0?new u.Vector3(1,1,1):h,d=t.position,m=d===void 0?new u.Vector3(0,0,0):d,g=t.cache,b=this;return(0,w.Z)(I().mark(function y(){var _,l,P,E;return I().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(_="node-create-pick-object",!(g&&!g.get(_))){R.next=7;break}return g.init(_),R.next=5,b.getMaterial(s);case 5:l=R.sent,g.set(_,l);case 7:if(!g){R.next=13;break}return R.next=10,g.get(_);case 10:R.t0=R.sent,R.next=16;break;case 13:return R.next=15,b.getMaterial(s);case 15:R.t0=R.sent;case 16:P=R.t0,E=new u.Sprite(P),E.scale.set(P.map.image.width*v.x,P.map.image.height*v.y,1),E.position.copy(m),b.add(E),b.pickObject=E;case 22:case"end":return R.stop()}},y)}))()},i.dispose=function(){var t=this.options.onClick;t&&this.clickTarge.forEach(function(o){o.removeEventListener("click",t)}),We(M(r.prototype),"dispose",this).call(this)},W(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.clickTarge;if(o){var s=o.map(function(h){return Z(t.element.querySelectorAll(h))}).flat();return s}return[this.element]}}]),r}(p),ct=ut,lt=`
2
2
  `.concat(u.ShaderChunk.logdepthbuf_pars_vertex,`
3
3
  `).concat(u.ShaderChunk.fog_pars_vertex,`
4
4
  attribute vec3 previous;
@@ -129,4 +129,4 @@ void main() {
129
129
  gl_FragColor.a *= step(vCounters, visibility);
130
130
  `).concat(u.ShaderChunk.fog_fragment,`
131
131
  }
132
- `),be=function(e){"use strict";P(r,e);var n=B(r);function r(){L(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new u.Matrix4,Object.defineProperties(k(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(u.BufferGeometry);be.prototype.setMatrixWorld=function(e){this.matrixWorld=e},be.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},be.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof u.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Xe(e,n){var r=new u.Matrix4,i=new u.Ray,a=new u.Sphere,t=new u.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var s=new u.Vector3,h=new u.Vector3,v=new u.Vector3,d=this instanceof u.LineSegments?2:1,g=o.index,_=o.attributes;if(g!==null)for(var y=g.array,m=_.position.array,w=_.width.array,c=0,O=y.length-1;c<O;c+=d){var E=y[c],q=y[c+1];s.fromArray(m,E*3),h.fromArray(m,q*3);var R=w[Math.floor(c/3)]!==void 0?w[Math.floor(c/3)]:1,ne=e.params.Line.threshold+this.material.lineWidth*R/2,oe=ne*ne,de=i.distanceSqToSegment(s,h,t,v);if(!(de>oe)){t.applyMatrix4(this.matrixWorld);var ce=e.ray.origin.distanceTo(t);ce<e.near||ce>e.far||(n.push({distance:ce,point:v.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}),c=O)}}}}be.prototype.raycast=Xe,be.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},be.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},be.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new u.BufferAttribute(new Float32Array(this.positions),3),previous:new u.BufferAttribute(new Float32Array(this.previous),3),next:new u.BufferAttribute(new Float32Array(this.next),3),side:new u.BufferAttribute(new Float32Array(this.side),1),width:new u.BufferAttribute(new Float32Array(this.width),1),uv:new u.BufferAttribute(new Float32Array(this.uvs),2),index:new u.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new u.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ge(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}be.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ge(n,0,r,0,a),Ge(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,Ge(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},u.ShaderChunk.meshline_vert=lt,u.ShaderChunk.meshline_frag=ft;var Ve=function(e){"use strict";P(r,e);var n=B(r);function r(i){L(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},u.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new u.Color(16777215)},opacity:{value:1},resolution:{value:new u.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new u.Vector2(1,1)},offset:{value:new u.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new u.Vector2(0,0)},lightColor:{value:new u.Color(16777215)}}),vertexShader:u.ShaderChunk.meshline_vert,fragmentShader:u.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(k(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(u.ShaderMaterial);Ve.prototype.copy=function(e){return u.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function ht(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function pt(e,n){if(e==null)return{};var r=ht(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var vt=e=>{var n={};return U.d(n,e),n},cr=e=>()=>e,He=vt({animate:()=>at.animate,linear:()=>at.linear}),dt=e=>{var n={};return U.d(n,e),n},lr=e=>()=>e,Ke=dt({mergeBufferGeometries:()=>Zt.mergeBufferGeometries});function $e(e){var n=e.setPointWidth,r=e.nodes,i=new u.BufferGeometry,a=new be;return i.setFromPoints(r),a.setGeometry(i,n),a}var mt={color:new u.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},gt=function(e){"use strict";P(r,e);var n=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},mt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,g=o.key,_=o.nodes,y=o.nodesArr,m=o.coordinatesArr,w=o.projection,c=o.workerController,O=o.useGroups,E=pt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),q=this.pencil.getSize(),R=q.width,ne=q.height,oe=new Ve(C((0,x.Z)({},E),{resolution:new u.Vector2(R,ne)}));if(this.material=oe,_)this.createMesh($e({nodes:_,setPointWidth:d}),oe);else if(y){var de=Ke.mergeBufferGeometries(y.map(function(ce){return $e({nodes:ce,setPointWidth:d})}),O!=null?O:!1);this.createMesh(de,oe)}else if(m&&c)return new Promise(function(ce){c.postMessage({coordinatesArr:m,projection:w,useGroups:O},function(he){var D=new u.BufferGeometry;Object.keys(he).forEach(function(ue){ue==="index"?D.setIndex(new u.BufferAttribute(he[ue].array,he[ue].itemSize)):D.setAttribute(ue,new u.BufferAttribute(he[ue].array,he[ue].itemSize))}),t.createMesh(D,oe),ce("")})})},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,g=(0,He.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:He.linear,onUpdate:function(_){v.value.x=_.x}});this.tween=g},i.dispose=function(){var t;We(M(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function _t(e){if(Array.isArray(e))return e}function yt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(e,n){return _t(e)||H(e,n)||K(e,n)||yt()}var bt=e=>{var n={};return U.d(n,e),n},fr=e=>()=>e,Ce=bt({extent:()=>Ze.extent,mean:()=>Ze.mean,merge:()=>Ze.merge}),wt=e=>{var n={};return U.d(n,e),n},hr=e=>()=>e,Ue=wt({default:()=>Xt.default}),xt=e=>{var n={};return U.d(n,e),n},pr=e=>()=>e,At=xt({default:()=>Ht.default});function Mt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var Pt=e=>{var n={};return U.d(n,e),n},vr=e=>()=>e,St=Pt({default:()=>Kt.default}),Ot=e=>{var n={};return U.d(n,e),n},dr=e=>()=>e,Ct=Ot({default:()=>$t.default}),Et=e=>{var n={};return U.d(n,e),n},mr=e=>()=>e,je=Et({geoBounds:()=>De.geoBounds,geoContains:()=>De.geoContains,geoDistance:()=>De.geoDistance,geoInterpolate:()=>De.geoInterpolate}),Lt=e=>{var n={};return U.d(n,e),n},gr=e=>()=>e,jt=Lt({geoVoronoi:()=>Yt.geoVoronoi}),kt=e=>{var n={};return U.d(n,e),n},_r=e=>()=>e,Ye=kt({scaleLinear:()=>Jt.scaleLinear});function Rt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,je.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,je.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(s(v)),v+=h}i.push(a=t)}),i})}function Tt(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(c){return c/s*360%360-180},v=function(c){return Math.acos(2*c/o-1)/Math.PI*180-90},d=function(c){return o*(Math.cos((c+90)*Math.PI/180)+1)/2},g=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],_=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(c){return c<=i}:i===void 0?function(c){return c>=r}:i>=r?function(c){return c>=r&&c<=i}:function(c){return c>=r||c<=i},y=[],m=g[0];m<=g[1];m++){var w=h(m);_(w)&&y.push([w,v(m)])}return y}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,je.geoContains)(n,e):(0,Ct.default)(e,n)}function Bt(e,n){var r={type:"Polygon",coordinates:e},i=we((0,je.geoBounds)(r),2),a=we(i[0],2),t=a[0],o=a[1],s=we(i[1],2),h=s[0],v=s[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return Tt(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(g){return Ne(g,r,d)})}function zt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Rt(e,i),t=(0,Ce.merge)(a),o=Bt(e,i),s=Z(t).concat(Z(o)),h={type:"Polygon",coordinates:e},v=we((0,je.geoBounds)(h),2),d=we(v[0],2),g=d[0],_=d[1],y=we(v[1],2),m=y[0],w=y[1],c=g>m||w>=89||_<=-89,O=[];if(c){var E=(0,jt.geoVoronoi)(s).triangles(),q=new Map(s.map(function(me,Pe){var Ae=we(me,2),ge=Ae[0],Re=Ae[1];return["".concat(ge,"-").concat(Re),Pe]}));E.features.forEach(function(me){var Pe,Ae=me.geometry.coordinates[0].slice(0,3).reverse(),ge=[];if(Ae.forEach(function(Te){var xe=we(Te,2),Fe=xe[0],Nt=xe[1],rt="".concat(Fe,"-").concat(Nt);q.has(rt)&&ge.push(q.get(rt))}),ge.length===3){if(ge.some(function(Te){return Te<t.length})){var Re=me.properties.circumcenter;if(!Ne(Re,h,c))return}(Pe=O).push.apply(Pe,Z(ge))}})}else if(o.length)for(var ce=function(me,Pe){var Ae,ge=[2,1,0].map(function(xe){return he.triangles[me+xe]}),Re=ge.map(function(xe){return s[xe]});if(ge.some(function(xe){return xe<t.length})){var Te=[0,1].map(function(xe){return(0,Ce.mean)(Re,function(Fe){return Fe[xe]})});if(!Ne(Te,h,c))return"continue"}(Ae=O).push.apply(Ae,Z(ge))},he=St.default.from(s),D=0,ue=he.triangles.length;D<ue;D+=3)ce(D,ue);else{var R=Ue.default.flatten(a),ne=R.vertices,oe=R.holes,de=oe===void 0?[]:oe;O=(0,Ue.default)(ne,de,2)}var Oe=(0,Ye.scaleLinear)((0,Ce.extent)(s,function(me){return me[0]}),[0,1]),ze=(0,Ye.scaleLinear)((0,Ce.extent)(s,function(me){return me[1]}),[0,1]),ke=s.map(function(me){var Pe=we(me,2),Ae=Pe[0],ge=Pe[1];return[Oe(Ae),ze(ge)]}),Ut={points:s,indices:O,uvs:ke};return{contour:a,triangles:Ut}}var Dt=zt,Je=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=we(t,2),s=o[0],h=o[1];return r?Mt(s,h,n):[s,h,n]})});return Ue.default.flatten(i)}function Qe(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(e,n,i),t=a.vertices,o=a.holes,s=Ie(e,r,i),h=s.vertices,v=(0,Ce.merge)([h,t]),d=Math.round(h.length/3),g=new Set(o),_=0,y=[],m=0;m<d;m++){var w=m+1;if(w===d)w=_;else if(g.has(w)){var c=w;w=_,_=c}y.push(m,m+d,w+d),y.push(w+d,w,m)}for(var O=[],E=1;E>=0;E--)for(var q=0;q<d;q+=1)O.push(q/(d-1),E);return{indices:y,vertices:v,uvs:O,topVerts:h}}function qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ie([e.points],n,a).vertices,uvs:r}}var Wt=function(e){"use strict";P(r,e);var n=B(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,s=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,g=o.includeSides,_=o.curvatureResolution,y=o.cartesian,m=o.userDataRsoOffset;(0,At.default)(i[0])||i[0].reverse();var w=Dt(i,{resolution:_}),c=w.contour,O=w.triangles,E=(0,Ce.merge)(O.uvs),q=[],R=[],ne=[],oe=0,de=function(he){var D=Math.round(q.length/3),ue=ne.length;q=q.concat(he.vertices),R=R.concat(he.uvs),ne=ne.concat(D?he.indices.map(function(Oe){return Oe+D}):he.indices),t.addGroup(ue,ne.length-ue,oe++)};if(g){var ce=Qe(c,s,h,y);de(ce),t.userData.rso=m?Qe(c,s,h+m,y):ce}return v&&de(qe(O,s,E,!1,y)),d&&de(qe(O,h,E,!0,y)),t.setIndex(ne),t[Je]("position",new u.Float32BufferAttribute(q,3)),t[Je]("uv",new u.Float32BufferAttribute(R,2)),t.computeVertexNormals(),t}return r}(u.BufferGeometry),Gt=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,s=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,g=t.userDataRsoOffset,_=t.cartesian,y=new Wt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:_,userDataRsoOffset:g});this.createMesh(y,this.options.material)},r}(p),et=U(705);function tt(e){var n=e.split,r=e.depth,i=e.points,a=new u[fe](new u.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,et.y)({split:n})});return(0,et.C)(),a}var Vt=function(e){"use strict";P(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=C((0,x.Z)({},a),{split:.1}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,b.Z)(I().mark(function o(){var s,h,v,d,g,_,y,m,w,c,O,E,q,R,ne,oe,de,ce;return I().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(s=t.options,h=s.points,v=s.pointsArr,d=s.coordinatesArr,g=s.useGroups,_=s.depth,y=s.material,m=s.workerController,w=s.projection,c=s.cache,O=s.sideMap,E=s.topColor,q=s.split,R=0,ne=y,!(O&&E)){D.next=22;break}if(R=q,oe=O+E,!(c&&!c.get(oe))){D.next=12;break}return c.init(oe),D.next=10,t.getMaterial();case 10:de=D.sent,c.set(oe,de);case 12:if(!c){D.next=18;break}return D.next=15,c.get(oe);case 15:D.t0=D.sent,D.next=21;break;case 18:return D.next=20,t.getMaterial();case 20:D.t0=D.sent;case 21:ne=D.t0;case 22:if(!h){D.next=26;break}t.createMesh(tt({points:h,depth:_,split:R}),y),D.next=32;break;case 26:if(!v){D.next=30;break}ce=Ke.mergeBufferGeometries(v.map(function(ue){return tt({points:ue,depth:_,split:R})}),g!=null?g:!1),t.createMesh(ce,y),D.next=32;break;case 30:if(!(d&&m)){D.next=32;break}return D.abrupt("return",new Promise(function(ue){m.postMessage({coordinatesArr:d,depth:_,split:R,useGroups:g,projection:w},function(Oe){var ze=new u.BufferGeometry;Object.keys(Oe).forEach(function(ke){ze.setAttribute(ke,new u.BufferAttribute(Oe[ke].array,Oe[ke].itemSize))}),t.createMesh(ze,ne),ue("")})}));case 32:case"end":return D.stop()}},o)}))()},i.getMaterial=function(){var t=this,o=this.options,s=o.topColor,h=o.sideMap,v=o.materialType,d=o.materialOptions,g=o.createCanvasObjectURL,_=o.split;return new Promise(function(y){var m=document.createElement("img");m.src=h,m.onload=function(){var w=_,c=document.createElement("canvas"),O=c.getContext("2d");c.height=m.height/(1-w),c.width=m.width,w&&(O.fillStyle=s,O.fillRect(0,0,m.width,c.height*w)),O.drawImage(m,0,c.height*w,m.width,m.height),g&&c.toBlob(function(ne){console.log(URL.createObjectURL(ne))});var E=new u.CanvasTexture(c),q=t.pencil.renderer.capabilities.getMaxAnisotropy();E.anisotropy=q;var R=new u[v||"MeshBasicMaterial"]((0,x.Z)({map:E},d||{}));y(R)}})},r}(p)})();var qt=_e.Ei,er=_e.Yo,tr=_e.Ee,rr=_e.x1,nr=_e.VJ,ir=_e.r7,ar=_e.XA,or=_e.NB,sr=_e.xv,ur=_e.nk;export{qt as ConicPolygon,er as ExtrudePolygon,tr as Image,rr as Line,nr as MeshLine,ir as MeshLineMaterial,ar as MeshLineRaycast,or as Node,sr as Text,ur as Video};
132
+ `),be=function(e){"use strict";S(r,e);var n=B(r);function r(){L(this,r);var i;return i=n.call(this),i.isMeshLine=!0,i.type="MeshLine",i.positions=[],i.previous=[],i.next=[],i.side=[],i.width=[],i.indices_array=[],i.uvs=[],i.counters=[],i._points=[],i._geom=null,i.widthCallback=null,i.matrixWorld=new u.Matrix4,Object.defineProperties(k(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(u.BufferGeometry);be.prototype.setMatrixWorld=function(e){this.matrixWorld=e},be.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},be.prototype.setPoints=function(e,n){if(!(e instanceof Float32Array)&&!(e instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=e,this.widthCallback=n,this.positions=[],this.counters=[],e.length&&e[0]instanceof u.Vector3)for(var r=0;r<e.length;r++){var i=e[r],a=r/e.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(a),this.counters.push(a)}else for(var r=0;r<e.length;r+=3){var a=r/e.length;this.positions.push(e[r],e[r+1],e[r+2]),this.positions.push(e[r],e[r+1],e[r+2]),this.counters.push(a),this.counters.push(a)}this.process()};function Xe(e,n){var r=new u.Matrix4,i=new u.Ray,a=new u.Sphere,t=new u.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),a.copy(o.boundingSphere),a.applyMatrix4(this.matrixWorld),e.ray.intersectSphere(a,t)!==!1){r.copy(this.matrixWorld).invert(),i.copy(e.ray).applyMatrix4(r);var s=new u.Vector3,h=new u.Vector3,v=new u.Vector3,d=this instanceof u.LineSegments?2:1,m=o.index,g=o.attributes;if(m!==null)for(var b=m.array,y=g.position.array,_=g.width.array,l=0,P=b.length-1;l<P;l+=d){var E=b[l],Q=b[l+1];s.fromArray(y,E*3),h.fromArray(y,Q*3);var R=_[Math.floor(l/3)]!==void 0?_[Math.floor(l/3)]:1,ne=e.params.Line.threshold+this.material.lineWidth*R/2,oe=ne*ne,de=i.distanceSqToSegment(s,h,t,v);if(!(de>oe)){t.applyMatrix4(this.matrixWorld);var ce=e.ray.origin.distanceTo(t);ce<e.near||ce>e.far||(n.push({distance:ce,point:v.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}),l=P)}}}}be.prototype.raycast=Xe,be.prototype.compareV3=function(e,n){var r=e*6,i=n*6;return this.positions[r]===this.positions[i]&&this.positions[r+1]===this.positions[i+1]&&this.positions[r+2]===this.positions[i+2]},be.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},be.prototype.process=function(){var e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n,r;this.compareV3(0,e-1)?r=this.copyV3(e-2):r=this.copyV3(0),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);for(var i=0;i<e;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(e-1)):n=1,this.width.push(n),this.width.push(n),this.uvs.push(i/(e-1),0),this.uvs.push(i/(e-1),1),i<e-1){r=this.copyV3(i),this.previous.push(r[0],r[1],r[2]),this.previous.push(r[0],r[1],r[2]);var a=i*2;this.indices_array.push(a,a+1,a+2),this.indices_array.push(a+2,a+1,a+3)}i>0&&(r=this.copyV3(i),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}this.compareV3(e-1,0)?r=this.copyV3(1):r=this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new u.BufferAttribute(new Float32Array(this.positions),3),previous:new u.BufferAttribute(new Float32Array(this.previous),3),next:new u.BufferAttribute(new Float32Array(this.next),3),side:new u.BufferAttribute(new Float32Array(this.side),1),width:new u.BufferAttribute(new Float32Array(this.width),1),uv:new u.BufferAttribute(new Float32Array(this.uvs),2),index:new u.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new u.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ge(e,n,r,i,a){var t;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=n?e.subarray?e.subarray(n,a&&n+a):e.slice(n,a&&n+a):e,r.set)r.set(e,i);else for(t=0;t<e.length;t++)r[t+i]=e[t];return r}be.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ge(n,0,r,0,a),Ge(n,6,n,0,a-6),n[a-6]=e.x,n[a-5]=e.y,n[a-4]=e.z,n[a-3]=e.x,n[a-2]=e.y,n[a-1]=e.z,Ge(n,6,i,0,a-6),i[a-6]=e.x,i[a-5]=e.y,i[a-4]=e.z,i[a-3]=e.x,i[a-2]=e.y,i[a-1]=e.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},u.ShaderChunk.meshline_vert=lt,u.ShaderChunk.meshline_frag=ft;var Ve=function(e){"use strict";S(r,e);var n=B(r);function r(i){L(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},u.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new u.Color(16777215)},opacity:{value:1},resolution:{value:new u.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new u.Vector2(1,1)},offset:{value:new u.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new u.Vector2(0,0)},lightColor:{value:new u.Color(16777215)}}),vertexShader:u.ShaderChunk.meshline_vert,fragmentShader:u.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(k(a),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(o){this.uniforms.lineWidth.value=o}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(o){this.uniforms.lineLightAnimation.value=o}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(o){this.uniforms.map.value=o}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(o){this.uniforms.useMap.value=o}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(o){this.uniforms.alphaMap.value=o}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(o){this.uniforms.useAlphaMap.value=o}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(o){this.uniforms.color.value=o}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(o){this.uniforms.lightColor.value=o}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(o){this.uniforms.time.value=o}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(o){this.uniforms.uCenter.value=o}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(o){this.uniforms.size.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(o){this.uniforms.sizeAttenuation.value=o}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(o){this.uniforms.dashArray.value=o,this.useDash=o!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(o){this.uniforms.dashOffset.value=o}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(o){this.uniforms.dashRatio.value=o}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(o){this.uniforms.useDash.value=o}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(o){this.uniforms.visibility.value=o}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(o){this.uniforms.alphaTest.value=o}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(o){this.uniforms.repeat.value.copy(o)}}}),a.setValues(i),a}return r}(u.ShaderMaterial);Ve.prototype.copy=function(e){return u.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function ht(e,n){if(e==null)return{};var r={},i=Object.keys(e),a,t;for(t=0;t<i.length;t++)a=i[t],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}function pt(e,n){if(e==null)return{};var r=ht(e,n),i,a;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}var vt=e=>{var n={};return U.d(n,e),n},cr=e=>()=>e,He=vt({animate:()=>at.animate,linear:()=>at.linear}),dt=e=>{var n={};return U.d(n,e),n},lr=e=>()=>e,Ke=dt({mergeBufferGeometries:()=>Zt.mergeBufferGeometries});function $e(e){var n=e.setPointWidth,r=e.nodes,i=new u.BufferGeometry,a=new be;return i.setFromPoints(r),a.setGeometry(i,n),a}var mt={color:new u.Color("#ffffff"),lineWidth:3,sizeAttenuation:0},gt=function(e){"use strict";S(r,e);var n=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},mt,a),t}var i=r.prototype;return i.create=function(){var t=this,o=this.options,s=o.duration,h=o.delay,v=o.onComplete,d=o.setPointWidth,m=o.key,g=o.nodes,b=o.nodesArr,y=o.coordinatesArr,_=o.projection,l=o.workerController,P=o.useGroups,E=pt(o,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","coordinatesArr","projection","workerController","useGroups"]),Q=this.pencil.getSize(),R=Q.width,ne=Q.height,oe=new Ve(C((0,x.Z)({},E),{resolution:new u.Vector2(R,ne)}));if(this.material=oe,g)this.createMesh($e({nodes:g,setPointWidth:d}),oe);else if(b){var de=Ke.mergeBufferGeometries(b.map(function(ce){return $e({nodes:ce,setPointWidth:d})}),P!=null?P:!1);this.createMesh(de,oe)}else if(y&&l)return new Promise(function(ce){l.postMessage({coordinatesArr:y,projection:_,useGroups:P},function(he){var D=new u.BufferGeometry;Object.keys(he).forEach(function(ue){ue==="index"?D.setIndex(new u.BufferAttribute(he[ue].array,he[ue].itemSize)):D.setAttribute(ue,new u.BufferAttribute(he[ue].array,he[ue].itemSize))}),t.createMesh(D,oe),ce("")})})},i.resize=function(t,o){this.material.uniforms.resolution.value.set(t,o)},i.animate=function(){var t=this.options,o=t.duration,s=t.delay,h=t.onComplete,v=this.material.uniforms.offset,d=s!=null?s:0,m=(0,He.animate)({from:v.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-d,repeat:1/0,onComplete:h,ease:He.linear,onUpdate:function(g){v.value.x=g.x}});this.tween=m},i.dispose=function(){var t;We(M(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},r}(p);function _t(e){if(Array.isArray(e))return e}function yt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(e,n){return _t(e)||H(e,n)||K(e,n)||yt()}var bt=e=>{var n={};return U.d(n,e),n},fr=e=>()=>e,Ce=bt({extent:()=>Ze.extent,mean:()=>Ze.mean,merge:()=>Ze.merge}),wt=e=>{var n={};return U.d(n,e),n},hr=e=>()=>e,Ue=wt({default:()=>Xt.default}),xt=e=>{var n={};return U.d(n,e),n},pr=e=>()=>e,At=xt({default:()=>Ht.default});function Mt(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=(90-n)*Math.PI/180,a=(90-e)*Math.PI/180;return[r*Math.sin(i)*Math.cos(a),r*Math.cos(i),r*Math.sin(i)*Math.sin(a)]}var Pt=e=>{var n={};return U.d(n,e),n},vr=e=>()=>e,St=Pt({default:()=>Kt.default}),Ot=e=>{var n={};return U.d(n,e),n},dr=e=>()=>e,Ct=Ot({default:()=>$t.default}),Et=e=>{var n={};return U.d(n,e),n},mr=e=>()=>e,je=Et({geoBounds:()=>De.geoBounds,geoContains:()=>De.geoContains,geoDistance:()=>De.geoDistance,geoInterpolate:()=>De.geoInterpolate}),Lt=e=>{var n={};return U.d(n,e),n},gr=e=>()=>e,jt=Lt({geoVoronoi:()=>Yt.geoVoronoi}),kt=e=>{var n={};return U.d(n,e),n},_r=e=>()=>e,Ye=kt({scaleLinear:()=>Jt.scaleLinear});function Rt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,je.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,je.geoInterpolate)(a,t),h=1/Math.ceil(o/n),v=h;v<1;)i.push(s(v)),v+=h}i.push(a=t)}),i})}function Tt(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.minLng,i=n.maxLng,a=n.minLat,t=n.maxLat,o=Math.round(Math.pow(360/e,2)/Math.PI),s=(1+Math.sqrt(5))/2,h=function(l){return l/s*360%360-180},v=function(l){return Math.acos(2*l/o-1)/Math.PI*180-90},d=function(l){return o*(Math.cos((l+90)*Math.PI/180)+1)/2},m=[t!==void 0?Math.ceil(d(t)):0,a!==void 0?Math.floor(d(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(l){return l<=i}:i===void 0?function(l){return l>=r}:i>=r?function(l){return l>=r&&l<=i}:function(l){return l>=r||l<=i},b=[],y=m[0];y<=m[1];y++){var _=h(y);g(_)&&b.push([_,v(y)])}return b}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,je.geoContains)(n,e):(0,Ct.default)(e,n)}function Bt(e,n){var r={type:"Polygon",coordinates:e},i=we((0,je.geoBounds)(r),2),a=we(i[0],2),t=a[0],o=a[1],s=we(i[1],2),h=s[0],v=s[1];if(Math.min(Math.abs(h-t),Math.abs(v-o))<n)return[];var d=t>h||v>=89||o<=-89;return Tt(n,{minLng:t,maxLng:h,minLat:o,maxLat:v}).filter(function(m){return Ne(m,r,d)})}function zt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Rt(e,i),t=(0,Ce.merge)(a),o=Bt(e,i),s=Z(t).concat(Z(o)),h={type:"Polygon",coordinates:e},v=we((0,je.geoBounds)(h),2),d=we(v[0],2),m=d[0],g=d[1],b=we(v[1],2),y=b[0],_=b[1],l=m>y||_>=89||g<=-89,P=[];if(l){var E=(0,jt.geoVoronoi)(s).triangles(),Q=new Map(s.map(function(me,Pe){var Ae=we(me,2),ge=Ae[0],Re=Ae[1];return["".concat(ge,"-").concat(Re),Pe]}));E.features.forEach(function(me){var Pe,Ae=me.geometry.coordinates[0].slice(0,3).reverse(),ge=[];if(Ae.forEach(function(Te){var xe=we(Te,2),Fe=xe[0],Nt=xe[1],rt="".concat(Fe,"-").concat(Nt);Q.has(rt)&&ge.push(Q.get(rt))}),ge.length===3){if(ge.some(function(Te){return Te<t.length})){var Re=me.properties.circumcenter;if(!Ne(Re,h,l))return}(Pe=P).push.apply(Pe,Z(ge))}})}else if(o.length)for(var ce=function(me,Pe){var Ae,ge=[2,1,0].map(function(xe){return he.triangles[me+xe]}),Re=ge.map(function(xe){return s[xe]});if(ge.some(function(xe){return xe<t.length})){var Te=[0,1].map(function(xe){return(0,Ce.mean)(Re,function(Fe){return Fe[xe]})});if(!Ne(Te,h,l))return"continue"}(Ae=P).push.apply(Ae,Z(ge))},he=St.default.from(s),D=0,ue=he.triangles.length;D<ue;D+=3)ce(D,ue);else{var R=Ue.default.flatten(a),ne=R.vertices,oe=R.holes,de=oe===void 0?[]:oe;P=(0,Ue.default)(ne,de,2)}var Oe=(0,Ye.scaleLinear)((0,Ce.extent)(s,function(me){return me[0]}),[0,1]),ze=(0,Ye.scaleLinear)((0,Ce.extent)(s,function(me){return me[1]}),[0,1]),ke=s.map(function(me){var Pe=we(me,2),Ae=Pe[0],ge=Pe[1];return[Oe(Ae),ze(ge)]}),Ut={points:s,indices:P,uvs:ke};return{contour:a,triangles:Ut}}var Dt=zt,Je=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=e.map(function(a){return a.map(function(t){var o=we(t,2),s=o[0],h=o[1];return r?Mt(s,h,n):[s,h,n]})});return Ue.default.flatten(i)}function Qe(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(e,n,i),t=a.vertices,o=a.holes,s=Ie(e,r,i),h=s.vertices,v=(0,Ce.merge)([h,t]),d=Math.round(h.length/3),m=new Set(o),g=0,b=[],y=0;y<d;y++){var _=y+1;if(_===d)_=g;else if(m.has(_)){var l=_;_=g,g=l}b.push(y,y+d,_+d),b.push(_+d,_,y)}for(var P=[],E=1;E>=0;E--)for(var Q=0;Q<d;Q+=1)P.push(Q/(d-1),E);return{indices:b,vertices:v,uvs:P,topVerts:h}}function qe(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return{indices:i?e.indices:e.indices.slice().reverse(),vertices:Ie([e.points],n,a).vertices,uvs:r}}var Wt=function(e){"use strict";S(r,e);var n=B(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};L(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,x.Z)({},{polygonGeoJson:i,startHeight:0,endHeight:1,closedBottom:!0,closedTop:!0,includeSides:!0,curvatureResolution:5,cartesian:!0,userDataRsoOffset:0},a);var o=t.parameters,s=o.startHeight,h=o.endHeight,v=o.closedBottom,d=o.closedTop,m=o.includeSides,g=o.curvatureResolution,b=o.cartesian,y=o.userDataRsoOffset;(0,At.default)(i[0])||i[0].reverse();var _=Dt(i,{resolution:g}),l=_.contour,P=_.triangles,E=(0,Ce.merge)(P.uvs),Q=[],R=[],ne=[],oe=0,de=function(he){var D=Math.round(Q.length/3),ue=ne.length;Q=Q.concat(he.vertices),R=R.concat(he.uvs),ne=ne.concat(D?he.indices.map(function(Oe){return Oe+D}):he.indices),t.addGroup(ue,ne.length-ue,oe++)};if(m){var ce=Qe(l,s,h,b);de(ce),t.userData.rso=y?Qe(l,s,h+y,b):ce}return v&&de(qe(P,s,E,!1,b)),d&&de(qe(P,h,E,!0,b)),t.setIndex(ne),t[Je]("position",new u.Float32BufferAttribute(Q,3)),t[Je]("uv",new u.Float32BufferAttribute(R,2)),t.computeVertexNormals(),t}return r}(u.BufferGeometry),Gt=function(e){"use strict";S(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{geojson:[[[]]],startHeight:0,height:5,closedBottom:!0,closedTop:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.startHeight,s=t.height,h=t.closedBottom,v=t.closedTop,d=t.curvatureResolution,m=t.userDataRsoOffset,g=t.cartesian,b=new Wt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:h,closedTop:v,curvatureResolution:d,cartesian:g,userDataRsoOffset:m});this.createMesh(b,this.options.material)},r}(p),et=U(705);function tt(e){var n=e.split,r=e.depth,i=e.points,a=new u[fe](new u.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,et.y)({split:n})});return(0,et.C)(),a}var Vt=function(e){"use strict";S(r,e);var n=B(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=C((0,x.Z)({},a),{split:.1}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,w.Z)(I().mark(function o(){var s,h,v,d,m,g,b,y,_,l,P,E,Q,R,ne,oe,de,ce;return I().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(s=t.options,h=s.points,v=s.pointsArr,d=s.coordinatesArr,m=s.useGroups,g=s.depth,b=s.material,y=s.workerController,_=s.projection,l=s.cache,P=s.sideMap,E=s.topColor,Q=s.split,R=0,ne=b,!(P&&E)){D.next=22;break}if(R=Q,oe=P+E,!(l&&!l.get(oe))){D.next=12;break}return l.init(oe),D.next=10,t.getMaterial();case 10:de=D.sent,l.set(oe,de);case 12:if(!l){D.next=18;break}return D.next=15,l.get(oe);case 15:D.t0=D.sent,D.next=21;break;case 18:return D.next=20,t.getMaterial();case 20:D.t0=D.sent;case 21:ne=D.t0;case 22:if(!h){D.next=26;break}t.createMesh(tt({points:h,depth:g,split:R}),b),D.next=32;break;case 26:if(!v){D.next=30;break}ce=Ke.mergeBufferGeometries(v.map(function(ue){return tt({points:ue,depth:g,split:R})}),m!=null?m:!1),t.createMesh(ce,b),D.next=32;break;case 30:if(!(d&&y)){D.next=32;break}return D.abrupt("return",new Promise(function(ue){y.postMessage({coordinatesArr:d,depth:g,split:R,useGroups:m,projection:_},function(Oe){var ze=new u.BufferGeometry;Object.keys(Oe).forEach(function(ke){ze.setAttribute(ke,new u.BufferAttribute(Oe[ke].array,Oe[ke].itemSize))}),t.createMesh(ze,ne),ue("")})}));case 32:case"end":return D.stop()}},o)}))()},i.getMaterial=function(){var t=this,o=this.options,s=o.topColor,h=o.sideMap,v=o.materialType,d=o.materialOptions,m=o.createCanvasObjectURL,g=o.split,b=o.maxAnisotropy;return new Promise(function(y){var _=document.createElement("img");_.src=h,_.onload=function(){var l=g,P=document.createElement("canvas"),E=P.getContext("2d");P.height=_.height/(1-l),P.width=_.width,l&&(E.fillStyle=s,E.fillRect(0,0,_.width,P.height*l)),E.drawImage(_,0,P.height*l,_.width,_.height),m&&P.toBlob(function(ne){console.log(URL.createObjectURL(ne))});var Q=new u.CanvasTexture(P);Q.anisotropy=b||t.pencil.renderer.capabilities.getMaxAnisotropy();var R=new u[v||"MeshBasicMaterial"]((0,x.Z)({map:Q},d||{}));y(R)}})},r}(p)})();var qt=_e.Ei,er=_e.Yo,tr=_e.Ee,rr=_e.x1,nr=_e.VJ,ir=_e.r7,ar=_e.XA,or=_e.NB,sr=_e.xv,ur=_e.nk;export{qt as ConicPolygon,er as ExtrudePolygon,tr as Image,rr as Line,nr as MeshLine,ir as MeshLineMaterial,ar as MeshLineRaycast,or as Node,sr as Text,ur as Video};
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
- "start": "PORT=3002 bundler-dev",
6
+ "start": "PORT=3003 bundler-dev",
7
7
  "build": "BUILD_LIBRARY=true PUBLIC_EXCLUDE=true bundler && yarn build:module && yarn build:worker && yarn tsc",
8
8
  "build:module": "EMPTY_DIR=false BUILD_LIBRARY=true ES_MODULES=true PUBLIC_EXCLUDE=true bundler",
9
9
  "build:worker": "EMPTY_DIR=false BUILD_LIBRARY=true BUILD_WORKER=true PUBLIC_EXCLUDE=true bundler",