gl-draw 0.8.21 → 0.8.23
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.
|
@@ -2,9 +2,7 @@ import * as THREE from 'three';
|
|
|
2
2
|
import BaseObject from '../../core/BaseObject';
|
|
3
3
|
import Cache from '../../plugins/Cache';
|
|
4
4
|
interface Options {
|
|
5
|
-
src
|
|
6
|
-
text?: string;
|
|
7
|
-
textOptions?: Record<string, any>;
|
|
5
|
+
src: string;
|
|
8
6
|
scale?: number;
|
|
9
7
|
position?: THREE.Vector3;
|
|
10
8
|
transparent?: boolean;
|
|
@@ -16,7 +14,9 @@ interface Options {
|
|
|
16
14
|
sizeAttenuation?: boolean;
|
|
17
15
|
}
|
|
18
16
|
export default class extends BaseObject {
|
|
19
|
-
options: Options
|
|
17
|
+
options: Options & {
|
|
18
|
+
scale: number;
|
|
19
|
+
};
|
|
20
20
|
texture: THREE.Texture;
|
|
21
21
|
scale: number;
|
|
22
22
|
constructor(options: Options);
|
|
@@ -24,11 +24,6 @@ export default class extends BaseObject {
|
|
|
24
24
|
create(): Promise<void>;
|
|
25
25
|
setScale(n: number): void;
|
|
26
26
|
setTexture(texture: THREE.Texture): void;
|
|
27
|
-
|
|
28
|
-
fontSize?: number;
|
|
29
|
-
fontFamily?: string;
|
|
30
|
-
fontWeight?: string;
|
|
31
|
-
flipX?: boolean;
|
|
32
|
-
}): THREE.Texture;
|
|
27
|
+
getTexture(): Promise<THREE.Texture>;
|
|
33
28
|
}
|
|
34
29
|
export {};
|
package/dist/objects/index.d.ts
CHANGED
package/dist/objects/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(){var nt={666:function(E){var j=function(x){"use strict";var R=Object.prototype,L=R.hasOwnProperty,O,T=typeof Symbol=="function"?Symbol:{},F=T.iterator||"@@iterator",D=T.asyncIterator||"@@asyncIterator",I=T.toStringTag||"@@toStringTag";function S(p,c,y){return Object.defineProperty(p,c,{value:y,enumerable:!0,configurable:!0,writable:!0}),p[c]}try{S({},"")}catch(p){S=function(c,y,C){return c[y]=C}}function $(p,c,y,C){var P=c&&c.prototype instanceof ee?c:ee,K=Object.create(P.prototype),oe=new W(C||[]);return K._invoke=ce(p,y,oe),K}x.wrap=$;function B(p,c,y){try{return{type:"normal",arg:p.call(c,y)}}catch(C){return{type:"throw",arg:C}}}var Q="suspendedStart",U="suspendedYield",f="executing",ue="completed",V={};function ee(){}function k(){}function z(){}var H={};S(H,F,function(){return this});var pe=Object.getPrototypeOf,ae=pe&&pe(pe(Pe([])));ae&&ae!==R&&L.call(ae,F)&&(H=ae);var q=z.prototype=ee.prototype=Object.create(H);k.prototype=z,S(q,"constructor",z),S(z,"constructor",k),k.displayName=S(z,I,"GeneratorFunction");function te(p){["next","throw","return"].forEach(function(c){S(p,c,function(y){return this._invoke(c,y)})})}x.isGeneratorFunction=function(p){var c=typeof p=="function"&&p.constructor;return c?c===k||(c.displayName||c.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,z):(p.__proto__=z,S(p,I,"GeneratorFunction")),p.prototype=Object.create(q),p},x.awrap=function(p){return{__await:p}};function N(p,c){function y(K,oe,le,ve){var fe=B(p[K],p,oe);if(fe.type==="throw")ve(fe.arg);else{var Te=fe.arg,Ce=Te.value;return Ce&&typeof Ce=="object"&&L.call(Ce,"__await")?c.resolve(Ce.__await).then(function(Se){y("next",Se,le,ve)},function(Se){y("throw",Se,le,ve)}):c.resolve(Ce).then(function(Se){Te.value=Se,le(Te)},function(Se){return y("throw",Se,le,ve)})}}var C;function P(K,oe){function le(){return new c(function(ve,fe){y(K,oe,ve,fe)})}return C=C?C.then(le,le):le()}this._invoke=P}te(N.prototype),S(N.prototype,D,function(){return this}),x.AsyncIterator=N,x.async=function(p,c,y,C,P){P===void 0&&(P=Promise);var K=new N($(p,c,y,C),P);return x.isGeneratorFunction(c)?K:K.next().then(function(oe){return oe.done?oe.value:K.next()})};function ce(p,c,y){var C=Q;return function(K,oe){if(C===f)throw new Error("Generator is already running");if(C===ue){if(K==="throw")throw oe;return we()}for(y.method=K,y.arg=oe;;){var le=y.delegate;if(le){var ve=de(le,y);if(ve){if(ve===V)continue;return ve}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(C===Q)throw C=ue,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);C=f;var fe=B(p,c,y);if(fe.type==="normal"){if(C=y.done?ue:U,fe.arg===V)continue;return{value:fe.arg,done:y.done}}else fe.type==="throw"&&(C=ue,y.method="throw",y.arg=fe.arg)}}}function de(p,c){var y=p.iterator[c.method];if(y===O){if(c.delegate=null,c.method==="throw"){if(p.iterator.return&&(c.method="return",c.arg=O,de(p,c),c.method==="throw"))return V;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return V}var C=B(y,p.iterator,c.arg);if(C.type==="throw")return c.method="throw",c.arg=C.arg,c.delegate=null,V;var P=C.arg;if(!P)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,V;if(P.done)c[p.resultName]=P.value,c.next=p.nextLoc,c.method!=="return"&&(c.method="next",c.arg=O);else return P;return c.delegate=null,V}te(q),S(q,I,"Generator"),S(q,F,function(){return this}),S(q,"toString",function(){return"[object Generator]"});function Ae(p){var c={tryLoc:p[0]};1 in p&&(c.catchLoc=p[1]),2 in p&&(c.finallyLoc=p[2],c.afterLoc=p[3]),this.tryEntries.push(c)}function X(p){var c=p.completion||{};c.type="normal",delete c.arg,p.completion=c}function W(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(Ae,this),this.reset(!0)}x.keys=function(p){var c=[];for(var y in p)c.push(y);return c.reverse(),function C(){for(;c.length;){var P=c.pop();if(P in p)return C.value=P,C.done=!1,C}return C.done=!0,C}};function Pe(p){if(p){var c=p[F];if(c)return c.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var y=-1,C=function P(){for(;++y<p.length;)if(L.call(p,y))return P.value=p[y],P.done=!1,P;return P.value=O,P.done=!0,P};return C.next=C}}return{next:we}}x.values=Pe;function we(){return{value:O,done:!0}}return W.prototype={constructor:W,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=O,this.done=!1,this.delegate=null,this.method="next",this.arg=O,this.tryEntries.forEach(X),!p)for(var c in this)c.charAt(0)==="t"&&L.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=O)},stop:function(){this.done=!0;var p=this.tryEntries[0],c=p.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var c=this;function y(ve,fe){return K.type="throw",K.arg=p,c.next=ve,fe&&(c.method="next",c.arg=O),!!fe}for(var C=this.tryEntries.length-1;C>=0;--C){var P=this.tryEntries[C],K=P.completion;if(P.tryLoc==="root")return y("end");if(P.tryLoc<=this.prev){var oe=L.call(P,"catchLoc"),le=L.call(P,"finallyLoc");if(oe&&le){if(this.prev<P.catchLoc)return y(P.catchLoc,!0);if(this.prev<P.finallyLoc)return y(P.finallyLoc)}else if(oe){if(this.prev<P.catchLoc)return y(P.catchLoc,!0)}else if(le){if(this.prev<P.finallyLoc)return y(P.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,c){for(var y=this.tryEntries.length-1;y>=0;--y){var C=this.tryEntries[y];if(C.tryLoc<=this.prev&&L.call(C,"finallyLoc")&&this.prev<C.finallyLoc){var P=C;break}}P&&(p==="break"||p==="continue")&&P.tryLoc<=c&&c<=P.finallyLoc&&(P=null);var K=P?P.completion:{};return K.type=p,K.arg=c,P?(this.method="next",this.next=P.finallyLoc,V):this.complete(K)},complete:function(p,c){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&c&&(this.next=c),V},finish:function(p){for(var c=this.tryEntries.length-1;c>=0;--c){var y=this.tryEntries[c];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),X(y),V}},catch:function(p){for(var c=this.tryEntries.length-1;c>=0;--c){var y=this.tryEntries[c];if(y.tryLoc===p){var C=y.completion;if(C.type==="throw"){var P=C.arg;X(y)}return P}}throw new Error("illegal catch attempt")},delegateYield:function(p,c,y){return this.delegate={iterator:Pe(p),resultName:c,nextLoc:y},this.method==="next"&&(this.arg=O),V}},x}(E.exports);try{regeneratorRuntime=j}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=j:Function("r","regeneratorRuntime = r")(j)}},695:function(E,j,x){"use strict";x.d(j,{Z:function(){return R}});function R(L){if(L.geometry&&L.geometry.dispose(),L.material){var O=Array.isArray(L.material)?L.material:[L.material];O.forEach(function(T){var F,D,I,S,$,B,Q,U,f,ue,V,ee,k;(F=T.map)===null||F===void 0||F.dispose(),(D=T.lightMap)===null||D===void 0||D.dispose(),(I=T.bumpMap)===null||I===void 0||I.dispose(),(S=T.normalMap)===null||S===void 0||S.dispose(),($=T.specularMap)===null||$===void 0||$.dispose(),(B=T.envMap)===null||B===void 0||B.dispose(),(Q=T.alphaMap)===null||Q===void 0||Q.dispose(),(U=T.aoMap)===null||U===void 0||U.dispose(),(f=T.displacementMap)===null||f===void 0||f.dispose(),(ue=T.emissiveMap)===null||ue===void 0||ue.dispose(),(V=T.gradientMap)===null||V===void 0||V.dispose(),(ee=T.metalnessMap)===null||ee===void 0||ee.dispose(),(k=T.roughnessMap)===null||k===void 0||k.dispose(),T.dispose()})}}},584:function(E,j,x){"use strict";x.d(j,{disposeMesh:function(){return T.Z}});var R=x(666),L=x.n(R),O=null,T=x(695),F=x(644);function D(V){if(V.material){var ee=Array.isArray(V.material)?V.material:[V.material];ee.forEach(function(k){var z,H;(z=k.color)===null||z===void 0||z.convertSRGBToLinear(),(H=k.emissive)===null||H===void 0||H.convertSRGBToLinear(),k.map&&(k.map.encoding=THREE.sRGBEncoding),k.emissiveMap&&(k.emissiveMap.encoding=THREE.sRGBEncoding)})}}var I=x(568),S=x(924),$=x(360),B=x(484),Q=null,U=null,f=function(){var V=(0,I.Z)(L().mark(function ee(k,z){var H,pe,ae,q,te,N,ce,de,Ae;return L().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return H=z.type,pe=H===void 0?"blob":H,ae=z.version,q=ae===void 0?"1":ae,W.next=4,(0,$.get)(k);case 4:if(N=W.sent,!(N&&N[q])){W.next=9;break}te=N[q],W.next=15;break;case 9:return W.next=11,(0,B.Z)(fetch(k).then(function(Pe){if(Pe.ok)return Pe[pe]();throw new Error}));case 11:ce=W.sent,de=ce.res,Ae=ce.err,Ae||(te=de,(0,$.set)(k,(0,S.Z)({},q,de)));case 15:return W.abrupt("return",te?{url:pe==="json"?k:URL.createObjectURL(te),store:te}:{url:k});case 16:case"end":return W.stop()}},ee)}));return function(k,z){return V.apply(this,arguments)}}(),ue=x(705)},484:function(E,j,x){"use strict";x.d(j,{Z:function(){return L}});var R=x(42);function L(O){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O.then(function(F){return(0,R.Z)({err:null,res:F},T)}).catch(function(F){return(0,R.Z)({err:F,res:void 0},T)})}},705:function(E,j,x){"use strict";x.d(j,{C:function(){return F},y:function(){return T}});var R=x(644),L=x.n(R),O=new Map,T=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(I,S,$,B,Q){var U=S[$*3],f=S[$*3+1],ue=S[B*3],V=S[B*3+1],ee=S[Q*3],k=S[Q*3+1],z;if(O.has(I))z=O.get(I);else{var H=D.box3||new R.Box3;if(!D.box3){var pe=I.parameters.shapes.getPoints();H.setFromArray(pe.map(function(ce){return[ce.x,ce.y,0]}).flat())}var ae=H.getSize(new R.Vector3);D.split&&(ae.y/=D.split),z={box:H,size:ae},O.set(I,z)}var q=z.box,te=z.size,N=D.split?1-D.split:0;return[new R.Vector2((U-q.min.x)/te.x,(f-q.min.y)/te.y+N),new R.Vector2((ue-q.min.x)/te.x,(V-q.min.y)/te.y+N),new R.Vector2((ee-q.min.x)/te.x,(k-q.min.y)/te.y+N)]},generateSideWallUV:function(I,S,$,B,Q,U){var f=S[$*3],ue=S[$*3+1],V=S[$*3+2],ee=S[B*3],k=S[B*3+1],z=S[B*3+2],H=S[Q*3],pe=S[Q*3+1],ae=S[Q*3+2],q=S[U*3],te=S[U*3+1],N=S[U*3+2],ce;if(O.has(S))ce=O.get(S);else{var de=new R.Box3;de.setFromArray(S);var Ae=de.getSize(new R.Vector3);D.split&&(Ae.z/=1-D.split),ce={box:de,size:Ae},O.set(S,ce)}var X=ce.box,W=ce.size;return Math.abs(ue-k)<Math.abs(f-ee)?[new R.Vector2((f-X.min.x)/W.x,(V-X.min.z)/W.z),new R.Vector2((ee-X.min.x)/W.x,(z-X.min.z)/W.z),new R.Vector2((H-X.min.x)/W.x,(ae-X.min.z)/W.z),new R.Vector2((q-X.min.x)/W.x,(N-X.min.z)/W.z)]:[new R.Vector2((ue-X.min.y)/W.y,(V-X.min.z)/W.z),new R.Vector2((k-X.min.y)/W.y,(z-X.min.z)/W.z),new R.Vector2((pe-X.min.y)/W.y,(ae-X.min.z)/W.z),new R.Vector2((te-X.min.y)/W.y,(N-X.min.z)/W.z)]}}},F=function(){O.clear()}},360:function(E){"use strict";E.exports=require("idb-keyval")},644:function(E){"use strict";E.exports=require("three")},568:function(E,j,x){"use strict";x.d(j,{Z:function(){return L}});function R(O,T,F,D,I,S,$){try{var B=O[S]($),Q=B.value}catch(U){F(U);return}B.done?T(Q):Promise.resolve(Q).then(D,I)}function L(O){return function(){var T=this,F=arguments;return new Promise(function(D,I){var S=O.apply(T,F);function $(Q){R(S,D,I,$,B,"next",Q)}function B(Q){R(S,D,I,$,B,"throw",Q)}$(void 0)})}}},924:function(E,j,x){"use strict";x.d(j,{Z:function(){return R}});function R(L,O,T){return O in L?Object.defineProperty(L,O,{value:T,enumerable:!0,configurable:!0,writable:!0}):L[O]=T,L}},42:function(E,j,x){"use strict";x.d(j,{Z:function(){return L}});var R=x(924);function L(O){for(var T=1;T<arguments.length;T++){var F=arguments[T]!=null?arguments[T]:{},D=Object.keys(F);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(F).filter(function(I){return Object.getOwnPropertyDescriptor(F,I).enumerable}))),D.forEach(function(I){(0,R.Z)(O,I,F[I])})}return O}}},Fe={};function J(E){var j=Fe[E];if(j!==void 0)return j.exports;var x=Fe[E]={exports:{}};return nt[E](x,x.exports,J),x.exports}(function(){J.n=function(E){var j=E&&E.__esModule?function(){return E.default}:function(){return E};return J.d(j,{a:j}),j}})(),function(){J.d=function(E,j){for(var x in j)J.o(j,x)&&!J.o(E,x)&&Object.defineProperty(E,x,{enumerable:!0,get:j[x]})}}(),function(){J.o=function(E,j){return Object.prototype.hasOwnProperty.call(E,j)}}(),function(){J.r=function(E){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})}}();var Be={};(function(){"use strict";J.r(Be),J.d(Be,{ConicPolygon:function(){return Ot},ExtrudePolygon:function(){return Ct},Group:function(){return Te},Image:function(){return C},Line:function(){return lt},MeshLine:function(){return _e},MeshLineMaterial:function(){return We},MeshLineRaycast:function(){return Ne},Node:function(){return fe},Video:function(){return le},getExtrudePolygonGeometry:function(){return jt},getLineGeometry:function(){return ft}});var E=J(568);function j(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function x(t,i){return x=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},x(t,i)}function R(t,i){return x(t,i)}function L(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&&R(t,i)}var O=J(42);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(t){return!1}}function F(t){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},F(t)}function D(t){return F(t)}function I(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t){return t&&t.constructor===Symbol?"symbol":typeof t}function $(t,i){return i&&(S(i)==="object"||typeof i=="function")?i:I(t)}function B(t){var i=T();return function(){var n=D(t),a;if(i){var e=D(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return $(this,a)}}var Q=J(666),U=J.n(Q),f=J(644);function ue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function V(t,i,r){return ue()?V=Reflect.construct:V=function(a,e,o){var s=[null];s.push.apply(s,e);var l=Function.bind.apply(a,s),h=new l;return o&&R(h,o.prototype),h},V.apply(null,arguments)}function ee(t,i,r){return V.apply(null,arguments)}function k(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 z(t,i,r){return i&&k(t.prototype,i),r&&k(t,r),t}function H(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 pe(t){if(Array.isArray(t))return H(t)}function ae(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function q(){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 te(t,i){if(!!t){if(typeof t=="string")return H(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 H(t,i)}}function N(t){return pe(t)||ae(t)||te(t)||q()}var ce=J(484);function de(){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,ce.Z)(r.promise,i)),r}var Ae=require("three/examples/jsm/renderers/CSS2DRenderer"),X=require("three/examples/jsm/renderers/CSS3DRenderer"),W=J(584),Pe=function(t){t&&((0,W.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||Pe(i)}))},we=function(){"use strict";function t(){j(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=de(),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=ee(f.Mesh,N(a)),this},i.createGroup=function(){return this.object3d=new f.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=ee(f.Points,N(a)),this},i.createCSS2DObject=function(n){return this.object3d=new Ae.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new X.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new X.CSS3DSprite(n),this},i.createSprite=function(n){return this.object3d=new f.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,N(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,N(a)),this},i.getSize=function(){var n=new f.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new f.Vector3)}},i.traverse=function(n){n(this),this.children.forEach(function(a){a.traverse(n)})},i.dispose=function(){Pe(this.object3d)},z(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}(),p=+f.REVISION<144,c=p?"ExtrudeBufferGeometry":"ExtrudeGeometry",y=p?"PlaneBufferGeometry":"PlaneGeometry",C=function(t){"use strict";L(r,t);var i=B(r);function r(a){j(this,r);var e;return e=i.call(this),e.scale=1,e.options=a,e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,E.Z)(U().mark(function o(){var s,l,h,v,d,g,m,w,_,u,A,M;return U().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(s=e.options,l=s.transparent,h=s.blending,v=s.src,d=s.depthWrite,g=s.alphaTest,m=s.sprite,w=s.sizeAttenuation,_=s.text,u=s.textOptions,!v){b.next=7;break}return b.next=4,new f.TextureLoader().loadAsync(v);case 4:b.t0=b.sent,b.next=8;break;case 7:b.t0=e.getTextTexture(_,u);case 8:return A=b.t0,M=m?new f.SpriteMaterial({map:A,transparent:l!=null?l:!1,blending:h!=null?h:f.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0,sizeAttenuation:w!=null?w:!0}):new f.MeshBasicMaterial({map:A,transparent:l!=null?l:!1,blending:h!=null?h:f.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0}),b.abrupt("return",M);case 11:case"end":return b.stop()}},o)}))()},n.create=function(){var e=this;return(0,E.Z)(U().mark(function o(){var s,l,h,v,d,g,m,w,_,u;return U().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(s=e.options,l=s.scale,h=s.position,v=s.src,d=s.cache,g=s.sprite,m=s.text,w=v||m,!(d&&!d.get(w))){M.next=8;break}return d.init(w),M.next=6,e.getMaterial();case 6:_=M.sent,d.set(w,_);case 8:if(!d){M.next=14;break}return M.next=11,d.get(w);case 11:M.t0=M.sent,M.next=17;break;case 14:return M.next=16,e.getMaterial();case 16:M.t0=M.sent;case 17:u=M.t0,e.texture=u.map,g?e.createSprite(u):e.createMesh(new f[y](1,1),u),l&&e.setScale(l),h&&e.object3d.position.copy(h);case 22:case"end":return M.stop()}},o)}))()},n.setScale=function(e){this.scale=e,this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},n.setTexture=function(e){var o=this.object3d;o.material.map&&o.material.map.dispose(),o.material.map=e,o.material.needsUpdate=!0,this.texture=e,this.setScale(this.scale)},n.getTextTexture=function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(0,O.Z)({},{fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1},o),l=s.fontSize,h=s.fontFamily,v=s.fontWeight,d=s.flipX,g=document.createElement("canvas");g.width=l*e.length*2,g.height=l;var m=g.getContext("2d");m.font="".concat(v," ").concat(l,"px/1 ").concat(h);var w=m.measureText(e).width;g.width=w,m=g.getContext("2d"),m.clearRect(0,0,g.width,g.height),d&&m.scale(-1,1),m.font="".concat(v," ").concat(l,"px/1 ").concat(h),m.textBaseline="middle",m.fillStyle="#ffffff",m.fillText(e,d?w*-1:0,g.height/2),m.restore();var _=new f.Texture(g);return _.anisotropy=this.pencil.renderer.capabilities.getMaxAnisotropy(),_.needsUpdate=!0,_},r}(we);function P(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=D(t),t!==null););return t}function K(t,i,r){return typeof Reflect!="undefined"&&Reflect.get?K=Reflect.get:K=function(a,e,o){var s=P(a,e);if(!!s){var l=Object.getOwnPropertyDescriptor(s,e);return l.get?l.get.call(o||a):l.value}},K(t,i,r)}function oe(t,i,r){return K(t,i,r)}var le=function(t){"use strict";L(r,t);var i=B(r);function r(a){j(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,l=e.blending,h=e.depthWrite,v=e.format,d=e.autoPlay,g=e.loop,m=e.alphaTest,w=e.sprite,_=de(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var A=new f.VideoTexture(u);A.format=v!=null?v:f.RGBAFormat,A.needsUpdate=!0;var M=w?new f.SpriteMaterial({map:A,transparent:s!=null?s:!1,blending:l!=null?l:f.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:m!=null?m:0}):new f.MeshBasicMaterial({map:A,transparent:s!=null?s:!1,blending:l!=null?l:f.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:m!=null?m:0});_.resolve(M)},!1),u.src=o,u.muted=!0,u.autoplay=d,u.loop=g,u.preload="auto",_.promise},n.create=function(){var e=this;return(0,E.Z)(U().mark(function o(){var s,l,h,v,d,g,m,w;return U().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,l=s.scale,h=s.position,v=s.src,d=s.cache,g=s.sprite,!(d&&!d.get(v))){u.next=7;break}return d.init(v),u.next=5,e.getMaterial();case 5:m=u.sent,d.set(v,m);case 7:if(!d){u.next=13;break}return u.next=10,d.get(v);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,e.getMaterial();case 15:u.t0=u.sent;case 16:w=u.t0,e.video=w.map.image,g?e.createSprite(w):e.createMesh(new f[y](1,1),w),l&&e.setScale(l),h&&e.object3d.position.copy(h);case 21:case"end":return u.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(),oe(D(r.prototype),"dispose",this).call(this)},r}(we),ve=function(t){"use strict";L(r,t);var i=B(r);function r(a){j(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},{event:"click"},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,l=e.handler,h=e.event,v=e.zIndexFix,d=e.event2,g=e.handler2,m=document.createElement("div");this.element=m,m.appendChild(s),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),l&&h&&this.clickTarge.forEach(function(w){w.addEventListener(h,l),g&&d&&w.addEventListener(d,g)}),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,E.Z)(U().mark(function o(){var s,l,h,v;return U().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,l=s.getContext("2d"),l.fillStyle="#ff0000",l.fillRect(0,0,256,256),h=new f.CanvasTexture(s),v=new f.SpriteMaterial({map:h,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",v);case 9:case"end":return g.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,l=e.scale,h=l===void 0?new f.Vector3(1,1,1):l,v=e.position,d=v===void 0?new f.Vector3(0,0,0):v,g=e.cache,m=this;return(0,E.Z)(U().mark(function w(){var _,u,A,M;return U().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(_="node-create-pick-object",!(g&&!g.get(_))){b.next=7;break}return g.init(_),b.next=5,m.getMaterial(s);case 5:u=b.sent,g.set(_,u);case 7:if(!g){b.next=13;break}return b.next=10,g.get(_);case 10:b.t0=b.sent,b.next=16;break;case 13:return b.next=15,m.getMaterial(s);case 15:b.t0=b.sent;case 16:A=b.t0,M=new f.Sprite(A),M.scale.set(A.map.image.width*h.x,A.map.image.height*h.y,1),M.position.copy(d),m.add(M),m.pickObject=M;case 22:case"end":return b.stop()}},w)}))()},n.dispose=function(){var e=this.options,o=e.handler,s=e.event,l=e.handler2,h=e.event2;o&&s&&this.clickTarge.forEach(function(v){v.removeEventListener(s,o),l&&h&&v.removeEventListener(h,l)}),oe(D(r.prototype),"dispose",this).call(this)},z(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.eventTarge;if(o){var s=o.map(function(l){return N(e.element.querySelectorAll(l))}).flat();return s}return[this.element]}}]),r}(we),fe=ve,Te=function(t){"use strict";L(r,t);var i=B(r);function r(){return j(this,r),i.apply(this,arguments)}var n=r.prototype;return n.create=function(){this.createGroup()},r}(we),Ce=`
|
|
2
|
-
`.concat(
|
|
3
|
-
`).concat(
|
|
1
|
+
(function(){var nt={666:function(L){var z=function(A){"use strict";var j=Object.prototype,C=j.hasOwnProperty,G,k=typeof Symbol=="function"?Symbol:{},I=k.iterator||"@@iterator",Z=k.asyncIterator||"@@asyncIterator",D=k.toStringTag||"@@toStringTag";function M(p,l,m){return Object.defineProperty(p,l,{value:m,enumerable:!0,configurable:!0,writable:!0}),p[l]}try{M({},"")}catch(p){M=function(l,m,S){return l[m]=S}}function F(p,l,m,S){var P=l&&l.prototype instanceof u?l:u,X=Object.create(P.prototype),se=new B(S||[]);return X._invoke=fe(p,m,se),X}A.wrap=F;function H(p,l,m){try{return{type:"normal",arg:p.call(l,m)}}catch(S){return{type:"throw",arg:S}}}var $="suspendedStart",oe="suspendedYield",ve="executing",ce="completed",T={};function u(){}function O(){}function W(){}var E={};M(E,I,function(){return this});var le=Object.getPrototypeOf,te=le&&le(le(Se([])));te&&te!==j&&C.call(te,I)&&(E=te);var N=W.prototype=u.prototype=Object.create(E);O.prototype=W,M(N,"constructor",W),M(W,"constructor",O),O.displayName=M(W,D,"GeneratorFunction");function re(p){["next","throw","return"].forEach(function(l){M(p,l,function(m){return this._invoke(l,m)})})}A.isGeneratorFunction=function(p){var l=typeof p=="function"&&p.constructor;return l?l===O||(l.displayName||l.name)==="GeneratorFunction":!1},A.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,M(p,D,"GeneratorFunction")),p.prototype=Object.create(N),p},A.awrap=function(p){return{__await:p}};function ne(p,l){function m(X,se,he,de){var ae=H(p[X],p,se);if(ae.type==="throw")de(ae.arg);else{var Oe=ae.arg,je=Oe.value;return je&&typeof je=="object"&&C.call(je,"__await")?l.resolve(je.__await).then(function(Ae){m("next",Ae,he,de)},function(Ae){m("throw",Ae,he,de)}):l.resolve(je).then(function(Ae){Oe.value=Ae,he(Oe)},function(Ae){return m("throw",Ae,he,de)})}}var S;function P(X,se){function he(){return new l(function(de,ae){m(X,se,de,ae)})}return S=S?S.then(he,he):he()}this._invoke=P}re(ne.prototype),M(ne.prototype,Z,function(){return this}),A.AsyncIterator=ne,A.async=function(p,l,m,S,P){P===void 0&&(P=Promise);var X=new ne(F(p,l,m,S),P);return A.isGeneratorFunction(l)?X:X.next().then(function(se){return se.done?se.value:X.next()})};function fe(p,l,m){var S=$;return function(X,se){if(S===ve)throw new Error("Generator is already running");if(S===ce){if(X==="throw")throw se;return Te()}for(m.method=X,m.arg=se;;){var he=m.delegate;if(he){var de=me(he,m);if(de){if(de===T)continue;return de}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(S===$)throw S=ce,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);S=ve;var ae=H(p,l,m);if(ae.type==="normal"){if(S=m.done?ce:oe,ae.arg===T)continue;return{value:ae.arg,done:m.done}}else ae.type==="throw"&&(S=ce,m.method="throw",m.arg=ae.arg)}}}function me(p,l){var m=p.iterator[l.method];if(m===G){if(l.delegate=null,l.method==="throw"){if(p.iterator.return&&(l.method="return",l.arg=G,me(p,l),l.method==="throw"))return T;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var S=H(m,p.iterator,l.arg);if(S.type==="throw")return l.method="throw",l.arg=S.arg,l.delegate=null,T;var P=S.arg;if(!P)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,T;if(P.done)l[p.resultName]=P.value,l.next=p.nextLoc,l.method!=="return"&&(l.method="next",l.arg=G);else return P;return l.delegate=null,T}re(N),M(N,D,"Generator"),M(N,I,function(){return this}),M(N,"toString",function(){return"[object Generator]"});function ie(p){var l={tryLoc:p[0]};1 in p&&(l.catchLoc=p[1]),2 in p&&(l.finallyLoc=p[2],l.afterLoc=p[3]),this.tryEntries.push(l)}function q(p){var l=p.completion||{};l.type="normal",delete l.arg,p.completion=l}function B(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ie,this),this.reset(!0)}A.keys=function(p){var l=[];for(var m in p)l.push(m);return l.reverse(),function S(){for(;l.length;){var P=l.pop();if(P in p)return S.value=P,S.done=!1,S}return S.done=!0,S}};function Se(p){if(p){var l=p[I];if(l)return l.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var m=-1,S=function P(){for(;++m<p.length;)if(C.call(p,m))return P.value=p[m],P.done=!1,P;return P.value=G,P.done=!0,P};return S.next=S}}return{next:Te}}A.values=Se;function Te(){return{value:G,done:!0}}return B.prototype={constructor:B,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=G,this.done=!1,this.delegate=null,this.method="next",this.arg=G,this.tryEntries.forEach(q),!p)for(var l in this)l.charAt(0)==="t"&&C.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=G)},stop:function(){this.done=!0;var p=this.tryEntries[0],l=p.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var l=this;function m(de,ae){return X.type="throw",X.arg=p,l.next=de,ae&&(l.method="next",l.arg=G),!!ae}for(var S=this.tryEntries.length-1;S>=0;--S){var P=this.tryEntries[S],X=P.completion;if(P.tryLoc==="root")return m("end");if(P.tryLoc<=this.prev){var se=C.call(P,"catchLoc"),he=C.call(P,"finallyLoc");if(se&&he){if(this.prev<P.catchLoc)return m(P.catchLoc,!0);if(this.prev<P.finallyLoc)return m(P.finallyLoc)}else if(se){if(this.prev<P.catchLoc)return m(P.catchLoc,!0)}else if(he){if(this.prev<P.finallyLoc)return m(P.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,l){for(var m=this.tryEntries.length-1;m>=0;--m){var S=this.tryEntries[m];if(S.tryLoc<=this.prev&&C.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var P=S;break}}P&&(p==="break"||p==="continue")&&P.tryLoc<=l&&l<=P.finallyLoc&&(P=null);var X=P?P.completion:{};return X.type=p,X.arg=l,P?(this.method="next",this.next=P.finallyLoc,T):this.complete(X)},complete:function(p,l){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&l&&(this.next=l),T},finish:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===p)return this.complete(m.completion,m.afterLoc),q(m),T}},catch:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===p){var S=m.completion;if(S.type==="throw"){var P=S.arg;q(m)}return P}}throw new Error("illegal catch attempt")},delegateYield:function(p,l,m){return this.delegate={iterator:Se(p),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=G),T}},A}(L.exports);try{regeneratorRuntime=z}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=z:Function("r","regeneratorRuntime = r")(z)}},695:function(L,z,A){"use strict";A.d(z,{Z:function(){return j}});function j(C){if(C.geometry&&C.geometry.dispose(),C.material){var G=Array.isArray(C.material)?C.material:[C.material];G.forEach(function(k){var I,Z,D,M,F,H,$,oe,ve,ce,T,u,O;(I=k.map)===null||I===void 0||I.dispose(),(Z=k.lightMap)===null||Z===void 0||Z.dispose(),(D=k.bumpMap)===null||D===void 0||D.dispose(),(M=k.normalMap)===null||M===void 0||M.dispose(),(F=k.specularMap)===null||F===void 0||F.dispose(),(H=k.envMap)===null||H===void 0||H.dispose(),($=k.alphaMap)===null||$===void 0||$.dispose(),(oe=k.aoMap)===null||oe===void 0||oe.dispose(),(ve=k.displacementMap)===null||ve===void 0||ve.dispose(),(ce=k.emissiveMap)===null||ce===void 0||ce.dispose(),(T=k.gradientMap)===null||T===void 0||T.dispose(),(u=k.metalnessMap)===null||u===void 0||u.dispose(),(O=k.roughnessMap)===null||O===void 0||O.dispose(),k.dispose()})}}},584:function(L,z,A){"use strict";A.d(z,{disposeMesh:function(){return k.Z}});var j=A(666),C=A.n(j),G=null,k=A(695),I=A(644);function Z(T){if(T.material){var u=Array.isArray(T.material)?T.material:[T.material];u.forEach(function(O){var W,E;(W=O.color)===null||W===void 0||W.convertSRGBToLinear(),(E=O.emissive)===null||E===void 0||E.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var D=A(568),M=A(924),F=A(360),H=A(484),$=null,oe=null,ve=function(){var T=(0,D.Z)(C().mark(function u(O,W){var E,le,te,N,re,ne,fe,me,ie;return C().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return E=W.type,le=E===void 0?"blob":E,te=W.version,N=te===void 0?"1":te,B.next=4,(0,F.get)(O);case 4:if(ne=B.sent,!(ne&&ne[N])){B.next=9;break}re=ne[N],B.next=15;break;case 9:return B.next=11,(0,H.Z)(fetch(O).then(function(Se){if(Se.ok)return Se[le]();throw new Error}));case 11:fe=B.sent,me=fe.res,ie=fe.err,ie||(re=me,(0,F.set)(O,(0,M.Z)({},N,me)));case 15:return B.abrupt("return",re?{url:le==="json"?O:URL.createObjectURL(re),store:re}:{url:O});case 16:case"end":return B.stop()}},u)}));return function(O,W){return T.apply(this,arguments)}}(),ce=A(705)},484:function(L,z,A){"use strict";A.d(z,{Z:function(){return C}});var j=A(42);function C(G){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return G.then(function(I){return(0,j.Z)({err:null,res:I},k)}).catch(function(I){return(0,j.Z)({err:I,res:void 0},k)})}},705:function(L,z,A){"use strict";A.d(z,{C:function(){return I},y:function(){return k}});var j=A(644),C=A.n(j),G=new Map,k=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(D,M,F,H,$){var oe=M[F*3],ve=M[F*3+1],ce=M[H*3],T=M[H*3+1],u=M[$*3],O=M[$*3+1],W;if(G.has(D))W=G.get(D);else{var E=Z.box3||new j.Box3;if(!Z.box3){var le=D.parameters.shapes.getPoints();E.setFromArray(le.map(function(fe){return[fe.x,fe.y,0]}).flat())}var te=E.getSize(new j.Vector3);Z.split&&(te.y/=Z.split),W={box:E,size:te},G.set(D,W)}var N=W.box,re=W.size,ne=Z.split?1-Z.split:0;return[new j.Vector2((oe-N.min.x)/re.x,(ve-N.min.y)/re.y+ne),new j.Vector2((ce-N.min.x)/re.x,(T-N.min.y)/re.y+ne),new j.Vector2((u-N.min.x)/re.x,(O-N.min.y)/re.y+ne)]},generateSideWallUV:function(D,M,F,H,$,oe){var ve=M[F*3],ce=M[F*3+1],T=M[F*3+2],u=M[H*3],O=M[H*3+1],W=M[H*3+2],E=M[$*3],le=M[$*3+1],te=M[$*3+2],N=M[oe*3],re=M[oe*3+1],ne=M[oe*3+2],fe;if(G.has(M))fe=G.get(M);else{var me=new j.Box3;me.setFromArray(M);var ie=me.getSize(new j.Vector3);Z.split&&(ie.z/=1-Z.split),fe={box:me,size:ie},G.set(M,fe)}var q=fe.box,B=fe.size;return Math.abs(ce-O)<Math.abs(ve-u)?[new j.Vector2((ve-q.min.x)/B.x,(T-q.min.z)/B.z),new j.Vector2((u-q.min.x)/B.x,(W-q.min.z)/B.z),new j.Vector2((E-q.min.x)/B.x,(te-q.min.z)/B.z),new j.Vector2((N-q.min.x)/B.x,(ne-q.min.z)/B.z)]:[new j.Vector2((ce-q.min.y)/B.y,(T-q.min.z)/B.z),new j.Vector2((O-q.min.y)/B.y,(W-q.min.z)/B.z),new j.Vector2((le-q.min.y)/B.y,(te-q.min.z)/B.z),new j.Vector2((re-q.min.y)/B.y,(ne-q.min.z)/B.z)]}}},I=function(){G.clear()}},360:function(L){"use strict";L.exports=require("idb-keyval")},644:function(L){"use strict";L.exports=require("three")},568:function(L,z,A){"use strict";A.d(z,{Z:function(){return C}});function j(G,k,I,Z,D,M,F){try{var H=G[M](F),$=H.value}catch(oe){I(oe);return}H.done?k($):Promise.resolve($).then(Z,D)}function C(G){return function(){var k=this,I=arguments;return new Promise(function(Z,D){var M=G.apply(k,I);function F($){j(M,Z,D,F,H,"next",$)}function H($){j(M,Z,D,F,H,"throw",$)}F(void 0)})}}},924:function(L,z,A){"use strict";A.d(z,{Z:function(){return j}});function j(C,G,k){return G in C?Object.defineProperty(C,G,{value:k,enumerable:!0,configurable:!0,writable:!0}):C[G]=k,C}},42:function(L,z,A){"use strict";A.d(z,{Z:function(){return C}});var j=A(924);function C(G){for(var k=1;k<arguments.length;k++){var I=arguments[k]!=null?arguments[k]:{},Z=Object.keys(I);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(I).filter(function(D){return Object.getOwnPropertyDescriptor(I,D).enumerable}))),Z.forEach(function(D){(0,j.Z)(G,D,I[D])})}return G}}},Fe={};function Y(L){var z=Fe[L];if(z!==void 0)return z.exports;var A=Fe[L]={exports:{}};return nt[L](A,A.exports,Y),A.exports}(function(){Y.n=function(L){var z=L&&L.__esModule?function(){return L.default}:function(){return L};return Y.d(z,{a:z}),z}})(),function(){Y.d=function(L,z){for(var A in z)Y.o(z,A)&&!Y.o(L,A)&&Object.defineProperty(L,A,{enumerable:!0,get:z[A]})}}(),function(){Y.o=function(L,z){return Object.prototype.hasOwnProperty.call(L,z)}}(),function(){Y.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";Y.r(Be),Y.d(Be,{ConicPolygon:function(){return kt},ExtrudePolygon:function(){return Tt},Group:function(){return at},Image:function(){return se},Line:function(){return vt},MeshLine:function(){return _e},MeshLineMaterial:function(){return We},MeshLineRaycast:function(){return Ne},Node:function(){return it},Text:function(){return he},Video:function(){return je},getExtrudePolygonGeometry:function(){return Et},getLineGeometry:function(){return dt}});function L(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function z(t,i){return z=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},z(t,i)}function A(t,i){return z(t,i)}function j(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&&A(t,i)}var C=Y(42);function G(){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 k(t,i,r){return G()?k=Reflect.construct:k=function(a,e,o){var s=[null];s.push.apply(s,e);var f=Function.bind.apply(a,s),h=new f;return o&&A(h,o.prototype),h},k.apply(null,arguments)}function I(t,i,r){return k.apply(null,arguments)}function Z(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function D(t){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D(t)}function M(t){return D(t)}function F(t){var i=typeof Map=="function"?new Map:void 0;return F=function(n){if(n===null||!Z(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(n))return i.get(n);i.set(n,a)}function a(){return I(n,arguments,M(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),A(a,n)},F(t)}function H(t){return F(t)}function $(){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 oe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ve(t){return t&&t.constructor===Symbol?"symbol":typeof t}function ce(t,i){return i&&(ve(i)==="object"||typeof i=="function")?i:oe(t)}function T(t){var i=$();return function(){var n=M(t),a;if(i){var e=M(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return ce(this,a)}}var u=Y(644),O=Y(568),W=Y(666),E=Y.n(W);function le(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 te(t,i,r){return i&&le(t.prototype,i),r&&le(t,r),t}function N(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 re(t){if(Array.isArray(t))return N(t)}function ne(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function fe(){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 me(t,i){if(!!t){if(typeof t=="string")return N(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 N(t,i)}}function ie(t){return re(t)||ne(t)||me(t)||fe()}var q=Y(484);function B(){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,q.Z)(r.promise,i)),r}var Se=require("three/examples/jsm/renderers/CSS2DRenderer"),Te=require("three/examples/jsm/renderers/CSS3DRenderer"),p=Y(584),l=function(t){t&&((0,p.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||l(i)}))},m=function(){"use strict";function t(){L(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=B(),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=I(u.Mesh,ie(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=I(u.Points,ie(a)),this},i.createCSS2DObject=function(n){return this.object3d=new Se.CSS2DObject(n),this},i.createCSS3DObject=function(n){return this.object3d=new Te.CSS3DObject(n),this},i.createCSS3DSprite=function(n){return this.object3d=new Te.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,ie(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,ie(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(){l(this.object3d)},te(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}(),S=+u.REVISION<144,P=S?"ExtrudeBufferGeometry":"ExtrudeGeometry",X=S?"PlaneBufferGeometry":"PlaneGeometry",se=function(t){"use strict";j(r,t);var i=T(r);function r(a){L(this,r);var e;return e=i.call(this),e.scale=1,e.options=(0,C.Z)({},{scale:1},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,O.Z)(E().mark(function o(){var s,f,h,v,d,_,y,w,b;return E().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return s=e.options,f=s.transparent,h=s.blending,v=s.depthWrite,d=s.alphaTest,_=s.sprite,y=s.sizeAttenuation,g.next=3,e.getTexture();case 3:return w=g.sent,b=_?new u.SpriteMaterial({map:w,transparent:f!=null?f:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:d!=null?d:0,sizeAttenuation:y!=null?y:!0}):new u.MeshBasicMaterial({map:w,transparent:f!=null?f:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:d!=null?d:0}),g.abrupt("return",b);case 6:case"end":return g.stop()}},o)}))()},n.create=function(){var e=this;return(0,O.Z)(E().mark(function o(){var s,f,h,v,d,_,y,w,b;return E().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(s=e.options,f=s.scale,h=s.position,v=s.src,d=s.cache,_=s.sprite,y=v,!(d&&!d.get(y))){g.next=8;break}return d.init(y),g.next=6,e.getMaterial();case 6:w=g.sent,d.set(y,w);case 8:if(!d){g.next=14;break}return g.next=11,d.get(y);case 11:g.t0=g.sent,g.next=17;break;case 14:return g.next=16,e.getMaterial();case 16:g.t0=g.sent;case 17:b=g.t0,e.texture=b.map,_?e.createSprite(b):e.createMesh(new u[X](1,1),b),e.setScale(f),h&&e.object3d.position.copy(h);case 22:case"end":return g.stop()}},o)}))()},n.setScale=function(e){this.scale=e,this.object3d.scale.set(this.texture.image.width*e,this.texture.image.height*e,1)},n.setTexture=function(e){var o=this.object3d;o.material.map&&o.material.map.dispose(),o.material.map=e,o.material.needsUpdate=!0,this.texture=e,this.setScale(this.scale)},n.getTexture=function(){var e=this.options.src;return new u.TextureLoader().loadAsync(e)},r}(m),he=function(t){"use strict";j(r,t);var i=T(r);function r(a){L(this,r);var e;return e=i.call(this,a),e.canvas=document.createElement("canvas"),e}var n=r.prototype;return n.getTexture=function(){var e=this.options,o=e.text,s=e.textOptions,f=(0,C.Z)({},{fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,color:"#ffffff"},s||{}),h=f.fontSize,v=f.fontFamily,d=f.fontWeight,_=f.flipX,y=f.color,w=this.canvas;w.width=h*o.length*2,w.height=h;var b=w.getContext("2d");b.font="".concat(d," ").concat(h,"px/1 ").concat(v);var c=b.measureText(o).width;w.width=c,b=w.getContext("2d"),b.clearRect(0,0,w.width,w.height),_&&b.scale(-1,1),b.font="".concat(d," ").concat(h,"px/1 ").concat(v),b.textBaseline="middle",b.fillStyle=y,b.fillText(o,_?c*-1:0,w.height/2),b.restore();var g=new u.Texture(w);return g.anisotropy=this.pencil.renderer.capabilities.getMaxAnisotropy(),g.needsUpdate=!0,Promise.resolve(g)},r}(H(se));function de(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=M(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=de(a,e);if(!!s){var f=Object.getOwnPropertyDescriptor(s,e);return f.get?f.get.call(o||a):f.value}},ae(t,i,r)}function Oe(t,i,r){return ae(t,i,r)}var je=function(t){"use strict";j(r,t);var i=T(r);function r(a){L(this,r);var e;return e=i.call(this),e.scale=1,e.options=(0,C.Z)({},{scale:1,autoPlay:!0,loop:!0},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this.options,o=e.src,s=e.transparent,f=e.blending,h=e.depthWrite,v=e.format,d=e.autoPlay,_=e.loop,y=e.alphaTest,w=e.sprite,b=B(),c=document.createElement("video");return c.addEventListener("loadedmetadata",function(){var g=new u.VideoTexture(c);g.format=v!=null?v:u.RGBAFormat,g.needsUpdate=!0;var R=w?new u.SpriteMaterial({map:g,transparent:s!=null?s:!1,blending:f!=null?f:u.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:y!=null?y:0}):new u.MeshBasicMaterial({map:g,transparent:s!=null?s:!1,blending:f!=null?f:u.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:y!=null?y:0});b.resolve(R)},!1),c.src=o,c.muted=!0,c.autoplay=d,c.loop=_,c.preload="auto",b.promise},n.create=function(){var e=this;return(0,O.Z)(E().mark(function o(){var s,f,h,v,d,_,y,w;return E().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=e.options,f=s.scale,h=s.position,v=s.src,d=s.cache,_=s.sprite,!(d&&!d.get(v))){c.next=7;break}return d.init(v),c.next=5,e.getMaterial();case 5:y=c.sent,d.set(v,y);case 7:if(!d){c.next=13;break}return c.next=10,d.get(v);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:w=c.t0,e.video=w.map.image,_?e.createSprite(w):e.createMesh(new u[X](1,1),w),e.setScale(f),h&&e.object3d.position.copy(h);case 21:case"end":return c.stop()}},o)}))()},n.setScale=function(e){this.scale=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(),Oe(M(r.prototype),"dispose",this).call(this)},r}(m),Ae=function(t){"use strict";j(r,t);var i=T(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,C.Z)({},{event:"click"},a),e}var n=r.prototype;return n.create=function(){var e=this.options,o=e.position,s=e.children,f=e.handler,h=e.event,v=e.zIndexFix,d=e.event2,_=e.handler2,y=document.createElement("div");this.element=y,y.appendChild(s),this.createCSS2DObject(y),o&&this.object3d.position.copy(o),f&&h&&this.clickTarge.forEach(function(w){w.addEventListener(h,f),_&&d&&w.addEventListener(d,_)}),v&&(this.object3d.userData.zIndexFix=v)},n.getMaterial=function(e){return(0,O.Z)(E().mark(function o(){var s,f,h,v;return E().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,f=s.getContext("2d"),f.fillStyle="#ff0000",f.fillRect(0,0,256,256),h=new u.CanvasTexture(s),v=new u.SpriteMaterial({map:h,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),_.abrupt("return",v);case 9:case"end":return _.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,f=e.scale,h=f===void 0?new u.Vector3(1,1,1):f,v=e.position,d=v===void 0?new u.Vector3(0,0,0):v,_=e.cache,y=this;return(0,O.Z)(E().mark(function w(){var b,c,g,R;return E().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(b="node-create-pick-object",!(_&&!_.get(b))){x.next=7;break}return _.init(b),x.next=5,y.getMaterial(s);case 5:c=x.sent,_.set(b,c);case 7:if(!_){x.next=13;break}return x.next=10,_.get(b);case 10:x.t0=x.sent,x.next=16;break;case 13:return x.next=15,y.getMaterial(s);case 15:x.t0=x.sent;case 16:g=x.t0,R=new u.Sprite(g),R.scale.set(g.map.image.width*h.x,g.map.image.height*h.y,1),R.position.copy(d),y.add(R),y.pickObject=R;case 22:case"end":return x.stop()}},w)}))()},n.dispose=function(){var e=this.options,o=e.handler,s=e.event,f=e.handler2,h=e.event2;o&&s&&this.clickTarge.forEach(function(v){v.removeEventListener(s,o),f&&h&&v.removeEventListener(h,f)}),Oe(M(r.prototype),"dispose",this).call(this)},te(r,[{key:"clickTarge",get:function(){var e=this,o=this.options.eventTarge;if(o){var s=o.map(function(f){return ie(e.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(m),it=Ae,at=function(t){"use strict";j(r,t);var i=T(r);function r(){return L(this,r),i.apply(this,arguments)}var n=r.prototype;return n.create=function(){this.createGroup()},r}(m),ot=`
|
|
2
|
+
`.concat(u.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(u.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
5
5
|
attribute vec3 next;
|
|
6
6
|
attribute float side;
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
finalPosition.xy+=offset.xy;
|
|
92
92
|
|
|
93
93
|
gl_Position=finalPosition;
|
|
94
|
-
`).concat(
|
|
94
|
+
`).concat(u.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(u.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),st=`
|
|
99
|
+
`.concat(u.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(u.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
uniform sampler2D map;
|
|
@@ -117,7 +117,7 @@ varying vec4 vColor;
|
|
|
117
117
|
varying float vCounters;
|
|
118
118
|
|
|
119
119
|
void main() {
|
|
120
|
-
`).concat(
|
|
120
|
+
`).concat(u.ShaderChunk.logdepthbuf_fragment,`
|
|
121
121
|
vec4 c = vColor;
|
|
122
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
123
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -127,6 +127,6 @@ void main() {
|
|
|
127
127
|
}
|
|
128
128
|
gl_FragColor = c;
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
|
-
`).concat(
|
|
130
|
+
`).concat(u.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),_e=function(t){"use strict";L(r,t);var i=B(r);function r(){j(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 f.Matrix4,Object.defineProperties(I(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}(f.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 f.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 Ne(t,i){var r=new f.Matrix4,n=new f.Ray,a=new f.Sphere,e=new f.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 f.Vector3,l=new f.Vector3,h=new f.Vector3,v=this instanceof f.LineSegments?2:1,d=o.index,g=o.attributes;if(d!==null)for(var m=d.array,w=g.position.array,_=g.width.array,u=0,A=m.length-1;u<A;u+=v){var M=m[u],G=m[u+1];s.fromArray(w,M*3),l.fromArray(w,G*3);var b=_[Math.floor(u/3)]!==void 0?_[Math.floor(u/3)]:1,re=t.params.Line.threshold+this.material.lineWidth*b/2,Y=re*re,ne=n.distanceSqToSegment(s,l,e,h);if(!(ne>Y)){e.applyMatrix4(this.matrixWorld);var se=t.ray.origin.distanceTo(e);se<t.near||se>t.far||(i.push({distance:se,point:h.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=A)}}}}_e.prototype.raycast=Ne,_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 f.BufferAttribute(new Float32Array(this.positions),3),previous:new f.BufferAttribute(new Float32Array(this.previous),3),next:new f.BufferAttribute(new Float32Array(this.next),3),side:new f.BufferAttribute(new Float32Array(this.side),1),width:new f.BufferAttribute(new Float32Array(this.width),1),uv:new f.BufferAttribute(new Float32Array(this.uvs),2),index:new f.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new f.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Ve(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;Ve(i,0,r,0,a),Ve(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,Ve(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},f.ShaderChunk.meshline_vert=Ce,f.ShaderChunk.meshline_frag=Se;var We=function(t){"use strict";L(r,t);var i=B(r);function r(n){j(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},f.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new f.Color(16777215)},opacity:{value:1},resolution:{value:new f.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new f.Vector2(1,1)},offset:{value:new f.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new f.Vector2(0,0)},lightColor:{value:new f.Color(16777215)}}),vertexShader:f.ShaderChunk.meshline_vert,fragmentShader:f.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(I(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}(f.ShaderMaterial);We.prototype.copy=function(t){return f.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){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 He(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):it(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function at(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 ot(t,i){if(t==null)return{};var r=at(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}function st(t){if(Array.isArray(t))return t}function ut(){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 ge(t,i){return st(t)||ae(t,i)||te(t,i)||ut()}var Ke=require("popmotion"),Le=require("three/examples/jsm//utils/BufferGeometryUtils");function $e(t){var i=t.setPointWidth,r=t.nodes,n=new f.BufferGeometry,a=new _e;return n.setFromPoints(r),a.setGeometry(n,i),a}var ct={color:new f.Color("#ffffff"),lineWidth:1},lt=function(t){"use strict";L(r,t);var i=B(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,r);var e;return e=i.call(this),e.options=(0,O.Z)({},ct,a),e}var n=r.prototype;return n.create=function(){var e=this;return(0,E.Z)(U().mark(function o(){var s,l,h,v,d,g,m,w,_,u,A,M,G,b,re,Y,ne,se,me,he;return U().wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:if(s=e.options,l=s.duration,h=s.delay,v=s.onComplete,d=s.setPointWidth,g=s.key,m=s.nodes,w=s.nodesArr,_=s.geometry,u=s.geometryArr,A=s.useGroups,M=s.material,G=s.cache,b=s.cacheKey,re=ot(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),Y=M,ne=_,Y){ie.next=16;break}if(se="LineMaterial:".concat(b),G&&!G.get(se)&&(G.init(se),me=e.getMaterial((0,O.Z)({},re)),G.set(se,me)),!G){ie.next=12;break}return ie.next=9,G.get(se);case 9:ie.t0=ie.sent,ie.next=15;break;case 12:return ie.next=14,e.getMaterial(re);case 14:ie.t0=ie.sent;case 15:Y=ie.t0;case 16:!ne&&m?ne=$e({nodes:m,setPointWidth:d}):!ne&&w?ne=Le.mergeBufferGeometries(w.map(function(je){return $e({nodes:je,setPointWidth:d})}),A!=null?A:!1):!ne&&u&&u.length>1?ne=Le.mergeBufferGeometries(u,A!=null?A:!1):!ne&&u&&u.length===1&&(he=ge(u,1),ne=he[0]),e.createMesh(ne,Y);case 18:case"end":return ie.stop()}},o)}))()},n.getMaterial=function(e){var o=this.pencil.getSize(),s=o.width,l=o.height,h=new We(He((0,O.Z)({},e),{resolution:new f.Vector2(s,l)}));return h},n.addGeometries=function(e){var o=this.object3d,s=Le.mergeBufferGeometries([o.geometry].concat(N(e)),!1);o.geometry=s},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,l=e.onComplete,h=this.material.uniforms.offset,v=s!=null?s:0,d=(0,Ke.animate)({from:h.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-v,repeat:1/0,onComplete:l,ease:Ke.linear,onUpdate:function(g){h.value.x=g.x}});this.tween=d},n.dispose=function(){var e;oe(D(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},z(r,[{key:"material",get:function(){return this.object3d.material}}]),r}(we);function ft(t){var i=t.worker,r=t.workerKey,n=t.coordinatesArr,a=t.lineWidth,e=t.projection,o=t.cacheVersion;return new Promise(function(s,l){i.postMessage({coordinatesArr:n,lineWidth:a,projection:e,workerKey:r},{cb:function(h){try{var v=new f.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?v.setIndex(new f.BufferAttribute(h[d].array,h[d].itemSize)):v.setAttribute(d,new f.BufferAttribute(h[d].array,h[d].itemSize))}),s(v)}catch(d){i.postMessage({delCache:!0,workerKey:r},{cb:l,cacheVersion:o})}},cacheVersion:o})})}var ke=require("d3-array"),ht=require("earcut"),De=J.n(ht),pt=require("@turf/boolean-clockwise"),vt=J.n(pt);function dt(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 mt=require("delaunator"),gt=J.n(mt),yt=require("@turf/boolean-point-in-polygon"),bt=J.n(yt),Ee=require("d3-geo"),wt=require("d3-geo-voronoi"),qe=require("d3-scale");function _t(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Ee.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Ee.geoInterpolate)(a,e),l=1/Math.ceil(o/i),h=l;h<1;)n.push(s(h)),h+=l}n.push(a=e)}),n})}function Mt(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,l=function(u){return u/s*360%360-180},h=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},v=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},d=[e!==void 0?Math.ceil(v(e)):0,a!==void 0?Math.floor(v(a)):o-1],g=r===void 0&&n===void 0?function(){return!0}:r===void 0?function(u){return u<=n}:n===void 0?function(u){return u>=r}:n>=r?function(u){return u>=r&&u<=n}:function(u){return u>=r||u<=n},m=[],w=d[0];w<=d[1];w++){var _=l(w);g(_)&&m.push([_,h(w)])}return m}function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(i,t):bt()(t,i)}function xt(t,i){var r={type:"Polygon",coordinates:t},n=ge((0,Ee.geoBounds)(r),2),a=ge(n[0],2),e=a[0],o=a[1],s=ge(n[1],2),l=s[0],h=s[1];if(Math.min(Math.abs(l-e),Math.abs(h-o))<i)return[];var v=e>l||h>=89||o<=-89;return Mt(i,{minLng:e,maxLng:l,minLat:o,maxLat:h}).filter(function(d){return Ue(d,r,v)})}function At(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=_t(t,n),e=(0,ke.merge)(a),o=xt(t,n),s=N(e).concat(N(o)),l={type:"Polygon",coordinates:t},h=ge((0,Ee.geoBounds)(l),2),v=ge(h[0],2),d=v[0],g=v[1],m=ge(h[1],2),w=m[0],_=m[1],u=d>w||_>=89||g<=-89,A=[];if(u){var M=(0,wt.geoVoronoi)(s).triangles(),G=new Map(s.map(function(Z,Me){var ye=ge(Z,2),be=ye[0],Ge=ye[1];return["".concat(be,"-").concat(Ge),Me]}));M.features.forEach(function(Z){var Me,ye=Z.geometry.coordinates[0].slice(0,3).reverse(),be=[];if(ye.forEach(function(ze){var xe=ge(ze,2),Ze=xe[0],Lt=xe[1],rt="".concat(Ze,"-").concat(Lt);G.has(rt)&&be.push(G.get(rt))}),be.length===3){if(be.some(function(ze){return ze<e.length})){var Ge=Z.properties.circumcenter;if(!Ue(Ge,l,u))return}(Me=A).push.apply(Me,N(be))}})}else if(o.length)for(var se=function(Z,Me){var ye,be=[2,1,0].map(function(xe){return me.triangles[Z+xe]}),Ge=be.map(function(xe){return s[xe]});if(be.some(function(xe){return xe<e.length})){var ze=[0,1].map(function(xe){return(0,ke.mean)(Ge,function(Ze){return Ze[xe]})});if(!Ue(ze,l,u))return"continue"}(ye=A).push.apply(ye,N(be))},me=gt().from(s),he=0,Oe=me.triangles.length;he<Oe;he+=3)se(he,Oe);else{var b=De().flatten(a),re=b.vertices,Y=b.holes,ne=Y===void 0?[]:Y;A=De()(re,ne,2)}var ie=(0,qe.scaleLinear)((0,ke.extent)(s,function(Z){return Z[0]}),[0,1]),je=(0,qe.scaleLinear)((0,ke.extent)(s,function(Z){return Z[1]}),[0,1]),Re=s.map(function(Z){var Me=ge(Z,2),ye=Me[0],be=Me[1];return[ie(ye),je(be)]}),tt={points:s,indices:A,uvs:Re};return{contour:a,triangles:tt}}var Pt=At,Xe=new f.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(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=ge(e,2),s=o[0],l=o[1];return r?dt(s,l,i):[s,l,i]})});return De().flatten(n)}function Ye(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(t,i,n),e=a.vertices,o=a.holes,s=Ie(t,r,n),l=s.vertices,h=(0,ke.merge)([l,e]),v=Math.round(l.length/3),d=new Set(o),g=0,m=[],w=0;w<v;w++){var _=w+1;if(_===v)_=g;else if(d.has(_)){var u=_;_=g,g=u}m.push(w,w+v,_+v),m.push(_+v,_,w)}for(var A=[],M=1;M>=0;M--)for(var G=0;G<v;G+=1)A.push(G/(v-1),M);return{indices:m,vertices:h,uvs:A,topVerts:l}}function Qe(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:Ie([t.points],i,a).vertices,uvs:r}}var St=function(t){"use strict";L(r,t);var i=B(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};j(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,l=o.endHeight,h=o.closedBottom,v=o.closedTop,d=o.includeSides,g=o.curvatureResolution,m=o.cartesian,w=o.userDataRsoOffset;vt()(n[0])||n[0].reverse();var _=Pt(n,{resolution:g}),u=_.contour,A=_.triangles,M=(0,ke.merge)(A.uvs),G=[],b=[],re=[],Y=0,ne=function(me){var he=Math.round(G.length/3),Oe=re.length;G=G.concat(me.vertices),b=b.concat(me.uvs),re=re.concat(he?me.indices.map(function(ie){return ie+he}):me.indices),e.addGroup(Oe,re.length-Oe,Y++)};if(d){var se=Ye(u,s,l,m);ne(se),e.userData.rso=w?Ye(u,s,l+w,m):se}return h&&ne(Qe(A,s,M,!1,m)),v&&ne(Qe(A,l,M,!0,m)),e.setIndex(re),e[Xe]("position",new f.Float32BufferAttribute(G,3)),e[Xe]("uv",new f.Float32BufferAttribute(b,2)),e.computeVertexNormals(),e}return r}(f.BufferGeometry),Ot=function(t){"use strict";L(r,t);var i=B(r);function r(a){j(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,l=e.closedBottom,h=e.closedTop,v=e.curvatureResolution,d=e.userDataRsoOffset,g=e.cartesian,m=new St(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:l,closedTop:h,curvatureResolution:v,cartesian:g,userDataRsoOffset:d});this.createMesh(m,this.options.material)},r}(we),Je=J(705);function et(t){var i=t.split,r=t.depth,n=t.points,a=t.box3,e=new f[c](new f.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Je.y)({split:i,box3:a})});return(0,Je.C)(),e}var Ct=function(t){"use strict";L(r,t);var i=B(r);function r(a){j(this,r);var e;return e=i.call(this),e.options=He((0,O.Z)({depth:1},a),{materialOptions:(0,O.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,E.Z)(U().mark(function o(){var s,l,h,v,d,g,m,w,_,u,A,M,G,b,re,Y,ne,se,me,he,Oe,ie,je,Re;return U().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:if(s=e.options,l=s.points,h=s.pointsArr,v=s.useGroups,d=s.depth,g=s.geometry,m=s.geometryArr,w=s.material,_=s.materialOptions,u=s.cache,A=s.box3,M=0,G=Array.isArray(d)?d:[d],b=Array.isArray(A)?A:[A],re=w,Y=g,!(!re&&_)){Z.next=26;break}if(M=_.split,ne=_.topColor,se=_.sideColor,me=_.sideMap,he="ExtrudePolygonMaterial:".concat(se||me).concat(ne||""),!(u&&!u.get(he))){Z.next=16;break}return u.init(he),Z.next=14,e.getMaterial(_);case 14:Oe=Z.sent,u.set(he,Oe);case 16:if(!u){Z.next=22;break}return Z.next=19,u.get(he);case 19:Z.t0=Z.sent,Z.next=25;break;case 22:return Z.next=24,e.getMaterial(_);case 24:Z.t0=Z.sent;case 25:re=Z.t0;case 26:!Y&&l?Y=et({points:l,depth:G[0],split:M,box3:b[0]}):!Y&&h?Y=Le.mergeBufferGeometries(h.map(function(Me,ye){return et({points:Me,depth:(ie=G[ye])!==null&&ie!==void 0?ie:G[0],split:M,box3:(je=b[ye])!==null&&je!==void 0?je:b[0]})}),v!=null?v:!1):!Y&&m&&m.length>1?Y=Le.mergeBufferGeometries(m,v!=null?v:!1):!Y&&m&&m.length===1&&(Re=ge(m,1),Y=Re[0]),e.createMesh(Y,re);case 28:case"end":return Z.stop()}},o)}))()},n.addGeometries=function(e){var o=this.object3d,s=Le.mergeBufferGeometries([o.geometry].concat(N(e)),!1);o.geometry=s},n.getMaterial=function(e){var o=this,s=e.topColor,l=e.sideColor,h=e.sideMap,v=e.type,d=e.parameters,g=e.createCanvasObjectURL,m=e.split,w=e.maxAnisotropy;return new Promise(function(_){var u=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var A=m,M=document.createElement("canvas"),G=M.getContext("2d");M.height=u.height/(1-A),M.width=u.width,A&&s&&(G.fillStyle=s,G.fillRect(0,0,u.width,M.height*A)),h&&u instanceof HTMLImageElement?G.drawImage(u,0,M.height*A,u.width,u.height):l&&(G.fillStyle=l,G.fillRect(0,M.height*A,u.width,u.height)),g&&M.toBlob(function(Y){console.log(URL.createObjectURL(Y))});var b=new f.CanvasTexture(M);b.anisotropy=w||o.pencil.renderer.capabilities.getMaxAnisotropy();var re=new f[v||"MeshBasicMaterial"]((0,O.Z)({map:b},d||{}));_(re)},h?u.src=h:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,E.Z)(U().mark(function s(){var l,h,v,d,g,m,w,_,u,A,M;return U().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(l=o.options,h=l.materialOptions,v=l.cache,d=h.sideColor,g=h.sideMap,m=h.topColor,w=e.sideColor,_=e.topColor,!(_||w)){b.next=22;break}if(u="ExtrudePolygonMaterial:".concat(w||d||g||"").concat(_||m||""),!(v&&!v.get(u))){b.next=11;break}return v.init(u),b.next=9,o.getMaterial((0,O.Z)({},h,e));case 9:A=b.sent,v.set(u,A);case 11:if(!v){b.next=17;break}return b.next=14,v.get(u);case 14:b.t0=b.sent,b.next=20;break;case 17:return b.next=19,o.getMaterial((0,O.Z)({},h,e));case 19:b.t0=b.sent;case 20:M=b.t0,o.object3d.material=M;case 22:case"end":return b.stop()}},s)}))()},r}(we);function jt(t){var i=t.worker,r=t.workerKey,n=t.coordinatesArr,a=t.depth,e=t.split,o=t.projection,s=t.cacheVersion;return new Promise(function(l,h){i.postMessage({coordinatesArr:n,depth:a,split:e!=null?e:.1,projection:o,workerKey:r},{cb:function(v){try{var d=new f.BufferGeometry;Object.keys(v).forEach(function(g){d.setAttribute(g,new f.BufferAttribute(v[g].array,v[g].itemSize))}),l(d)}catch(g){i.postMessage({delCache:!0,workerKey:r},{cb:h,cacheVersion:s})}},cacheVersion:s})})}})(),module.exports=Be})();
|
|
132
|
+
`),_e=function(t){"use strict";j(r,t);var i=T(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(oe(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 Ne(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,f=new u.Vector3,h=new u.Vector3,v=this instanceof u.LineSegments?2:1,d=o.index,_=o.attributes;if(d!==null)for(var y=d.array,w=_.position.array,b=_.width.array,c=0,g=y.length-1;c<g;c+=v){var R=y[c],V=y[c+1];s.fromArray(w,R*3),f.fromArray(w,V*3);var x=b[Math.floor(c/3)]!==void 0?b[Math.floor(c/3)]:1,Q=t.params.Line.threshold+this.material.lineWidth*x/2,K=Q*Q,J=n.distanceSqToSegment(s,f,e,h);if(!(J>K)){e.applyMatrix4(this.matrixWorld);var ue=t.ray.origin.distanceTo(e);ue<t.near||ue>t.far||(i.push({distance:ue,point:h.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}),c=g)}}}}_e.prototype.raycast=Ne,_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 Ve(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;Ve(i,0,r,0,a),Ve(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,Ve(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=ot,u.ShaderChunk.meshline_frag=st;var We=function(t){"use strict";j(r,t);var i=T(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(oe(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);We.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 ut(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 He(t,i){return i=i!=null?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ut(Object(i)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}),t}function ct(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 lt(t,i){if(t==null)return{};var r=ct(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}function ft(t){if(Array.isArray(t))return t}function ht(){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 ye(t,i){return ft(t)||ne(t,i)||me(t,i)||ht()}var Ke=require("popmotion"),Le=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 pt={color:new u.Color("#ffffff"),lineWidth:1},vt=function(t){"use strict";j(r,t);var i=T(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,C.Z)({},pt,a),e}var n=r.prototype;return n.create=function(){var e=this;return(0,O.Z)(E().mark(function o(){var s,f,h,v,d,_,y,w,b,c,g,R,V,x,Q,K,J,ue,ge,pe;return E().wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:if(s=e.options,f=s.duration,h=s.delay,v=s.onComplete,d=s.setPointWidth,_=s.key,y=s.nodes,w=s.nodesArr,b=s.geometry,c=s.geometryArr,g=s.useGroups,R=s.material,V=s.cache,x=s.cacheKey,Q=lt(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),K=R,J=b,K){ee.next=16;break}if(ue="LineMaterial:".concat(x),V&&!V.get(ue)&&(V.init(ue),ge=e.getMaterial((0,C.Z)({},Q)),V.set(ue,ge)),!V){ee.next=12;break}return ee.next=9,V.get(ue);case 9:ee.t0=ee.sent,ee.next=15;break;case 12:return ee.next=14,e.getMaterial(Q);case 14:ee.t0=ee.sent;case 15:K=ee.t0;case 16:!J&&y?J=$e({nodes:y,setPointWidth:d}):!J&&w?J=Le.mergeBufferGeometries(w.map(function(Ce){return $e({nodes:Ce,setPointWidth:d})}),g!=null?g:!1):!J&&c&&c.length>1?J=Le.mergeBufferGeometries(c,g!=null?g:!1):!J&&c&&c.length===1&&(pe=ye(c,1),J=pe[0]),e.createMesh(J,K);case 18:case"end":return ee.stop()}},o)}))()},n.getMaterial=function(e){var o=this.pencil.getSize(),s=o.width,f=o.height,h=new We(He((0,C.Z)({},e),{resolution:new u.Vector2(s,f)}));return h},n.addGeometries=function(e){var o=this.object3d,s=Le.mergeBufferGeometries([o.geometry].concat(ie(e)),!1);o.geometry=s},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,f=e.onComplete,h=this.material.uniforms.offset,v=s!=null?s:0,d=(0,Ke.animate)({from:h.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-v,repeat:1/0,onComplete:f,ease:Ke.linear,onUpdate:function(_){h.value.x=_.x}});this.tween=d},n.dispose=function(){var e;Oe(M(r.prototype),"dispose",this).call(this),(e=this.tween)===null||e===void 0||e.stop()},te(r,[{key:"material",get:function(){return this.object3d.material}}]),r}(m);function dt(t){var i=t.worker,r=t.workerKey,n=t.coordinatesArr,a=t.lineWidth,e=t.projection,o=t.cacheVersion;return new Promise(function(s,f){i.postMessage({coordinatesArr:n,lineWidth:a,projection:e,workerKey:r},{cb:function(h){try{var v=new u.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?v.setIndex(new u.BufferAttribute(h[d].array,h[d].itemSize)):v.setAttribute(d,new u.BufferAttribute(h[d].array,h[d].itemSize))}),s(v)}catch(d){i.postMessage({delCache:!0,workerKey:r},{cb:f,cacheVersion:o})}},cacheVersion:o})})}var ke=require("d3-array"),mt=require("earcut"),De=Y.n(mt),gt=require("@turf/boolean-clockwise"),yt=Y.n(gt);function bt(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 wt=require("delaunator"),_t=Y.n(wt),Mt=require("@turf/boolean-point-in-polygon"),xt=Y.n(Mt),Ee=require("d3-geo"),At=require("d3-geo-voronoi"),qe=require("d3-scale");function Pt(t,i){return t.map(function(r){var n=[],a;return r.forEach(function(e){if(a){var o=(0,Ee.geoDistance)(e,a)*180/Math.PI;if(o>i)for(var s=(0,Ee.geoInterpolate)(a,e),f=1/Math.ceil(o/i),h=f;h<1;)n.push(s(h)),h+=f}n.push(a=e)}),n})}function St(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,f=function(c){return c/s*360%360-180},h=function(c){return Math.acos(2*c/o-1)/Math.PI*180-90},v=function(c){return o*(Math.cos((c+90)*Math.PI/180)+1)/2},d=[e!==void 0?Math.ceil(v(e)):0,a!==void 0?Math.floor(v(a)):o-1],_=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},y=[],w=d[0];w<=d[1];w++){var b=f(w);_(b)&&y.push([b,h(w)])}return y}function Ue(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Ee.geoContains)(i,t):xt()(t,i)}function Ot(t,i){var r={type:"Polygon",coordinates:t},n=ye((0,Ee.geoBounds)(r),2),a=ye(n[0],2),e=a[0],o=a[1],s=ye(n[1],2),f=s[0],h=s[1];if(Math.min(Math.abs(f-e),Math.abs(h-o))<i)return[];var v=e>f||h>=89||o<=-89;return St(i,{minLng:e,maxLng:f,minLat:o,maxLat:h}).filter(function(d){return Ue(d,r,v)})}function jt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.resolution,n=r===void 0?1/0:r,a=Pt(t,n),e=(0,ke.merge)(a),o=Ot(t,n),s=ie(e).concat(ie(o)),f={type:"Polygon",coordinates:t},h=ye((0,Ee.geoBounds)(f),2),v=ye(h[0],2),d=v[0],_=v[1],y=ye(h[1],2),w=y[0],b=y[1],c=d>w||b>=89||_<=-89,g=[];if(c){var R=(0,At.geoVoronoi)(s).triangles(),V=new Map(s.map(function(U,Me){var be=ye(U,2),we=be[0],Ge=be[1];return["".concat(we,"-").concat(Ge),Me]}));R.features.forEach(function(U){var Me,be=U.geometry.coordinates[0].slice(0,3).reverse(),we=[];if(be.forEach(function(ze){var xe=ye(ze,2),Ze=xe[0],Rt=xe[1],rt="".concat(Ze,"-").concat(Rt);V.has(rt)&&we.push(V.get(rt))}),we.length===3){if(we.some(function(ze){return ze<e.length})){var Ge=U.properties.circumcenter;if(!Ue(Ge,f,c))return}(Me=g).push.apply(Me,ie(we))}})}else if(o.length)for(var ue=function(U,Me){var be,we=[2,1,0].map(function(xe){return ge.triangles[U+xe]}),Ge=we.map(function(xe){return s[xe]});if(we.some(function(xe){return xe<e.length})){var ze=[0,1].map(function(xe){return(0,ke.mean)(Ge,function(Ze){return Ze[xe]})});if(!Ue(ze,f,c))return"continue"}(be=g).push.apply(be,ie(we))},ge=_t().from(s),pe=0,Pe=ge.triangles.length;pe<Pe;pe+=3)ue(pe,Pe);else{var x=De().flatten(a),Q=x.vertices,K=x.holes,J=K===void 0?[]:K;g=De()(Q,J,2)}var ee=(0,qe.scaleLinear)((0,ke.extent)(s,function(U){return U[0]}),[0,1]),Ce=(0,qe.scaleLinear)((0,ke.extent)(s,function(U){return U[1]}),[0,1]),Re=s.map(function(U){var Me=ye(U,2),be=Me[0],we=Me[1];return[ee(be),Ce(we)]}),tt={points:s,indices:g,uvs:Re};return{contour:a,triangles:tt}}var Ct=jt,Xe=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Ie(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=ye(e,2),s=o[0],f=o[1];return r?bt(s,f,i):[s,f,i]})});return De().flatten(n)}function Ye(t,i,r){for(var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Ie(t,i,n),e=a.vertices,o=a.holes,s=Ie(t,r,n),f=s.vertices,h=(0,ke.merge)([f,e]),v=Math.round(f.length/3),d=new Set(o),_=0,y=[],w=0;w<v;w++){var b=w+1;if(b===v)b=_;else if(d.has(b)){var c=b;b=_,_=c}y.push(w,w+v,b+v),y.push(b+v,b,w)}for(var g=[],R=1;R>=0;R--)for(var V=0;V<v;V+=1)g.push(V/(v-1),R);return{indices:y,vertices:h,uvs:g,topVerts:f}}function Qe(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:Ie([t.points],i,a).vertices,uvs:r}}var Lt=function(t){"use strict";j(r,t);var i=T(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,C.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,f=o.endHeight,h=o.closedBottom,v=o.closedTop,d=o.includeSides,_=o.curvatureResolution,y=o.cartesian,w=o.userDataRsoOffset;yt()(n[0])||n[0].reverse();var b=Ct(n,{resolution:_}),c=b.contour,g=b.triangles,R=(0,ke.merge)(g.uvs),V=[],x=[],Q=[],K=0,J=function(ge){var pe=Math.round(V.length/3),Pe=Q.length;V=V.concat(ge.vertices),x=x.concat(ge.uvs),Q=Q.concat(pe?ge.indices.map(function(ee){return ee+pe}):ge.indices),e.addGroup(Pe,Q.length-Pe,K++)};if(d){var ue=Ye(c,s,f,y);J(ue),e.userData.rso=w?Ye(c,s,f+w,y):ue}return h&&J(Qe(g,s,R,!1,y)),v&&J(Qe(g,f,R,!0,y)),e.setIndex(Q),e[Xe]("position",new u.Float32BufferAttribute(V,3)),e[Xe]("uv",new u.Float32BufferAttribute(x,2)),e.computeVertexNormals(),e}return r}(u.BufferGeometry),kt=function(t){"use strict";j(r,t);var i=T(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,C.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,f=e.closedBottom,h=e.closedTop,v=e.curvatureResolution,d=e.userDataRsoOffset,_=e.cartesian,y=new Lt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:h,curvatureResolution:v,cartesian:_,userDataRsoOffset:d});this.createMesh(y,this.options.material)},r}(m),Je=Y(705);function et(t){var i=t.split,r=t.depth,n=t.points,a=t.box3,e=new u[P](new u.Shape(n),{depth:r,bevelEnabled:!1,UVGenerator:(0,Je.y)({split:i,box3:a})});return(0,Je.C)(),e}var Tt=function(t){"use strict";j(r,t);var i=T(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=He((0,C.Z)({depth:1},a),{materialOptions:(0,C.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,O.Z)(E().mark(function o(){var s,f,h,v,d,_,y,w,b,c,g,R,V,x,Q,K,J,ue,ge,pe,Pe,ee,Ce,Re;return E().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(s=e.options,f=s.points,h=s.pointsArr,v=s.useGroups,d=s.depth,_=s.geometry,y=s.geometryArr,w=s.material,b=s.materialOptions,c=s.cache,g=s.box3,R=0,V=Array.isArray(d)?d:[d],x=Array.isArray(g)?g:[g],Q=w,K=_,!(!Q&&b)){U.next=26;break}if(R=b.split,J=b.topColor,ue=b.sideColor,ge=b.sideMap,pe="ExtrudePolygonMaterial:".concat(ue||ge).concat(J||""),!(c&&!c.get(pe))){U.next=16;break}return c.init(pe),U.next=14,e.getMaterial(b);case 14:Pe=U.sent,c.set(pe,Pe);case 16:if(!c){U.next=22;break}return U.next=19,c.get(pe);case 19:U.t0=U.sent,U.next=25;break;case 22:return U.next=24,e.getMaterial(b);case 24:U.t0=U.sent;case 25:Q=U.t0;case 26:!K&&f?K=et({points:f,depth:V[0],split:R,box3:x[0]}):!K&&h?K=Le.mergeBufferGeometries(h.map(function(Me,be){return et({points:Me,depth:(ee=V[be])!==null&&ee!==void 0?ee:V[0],split:R,box3:(Ce=x[be])!==null&&Ce!==void 0?Ce:x[0]})}),v!=null?v:!1):!K&&y&&y.length>1?K=Le.mergeBufferGeometries(y,v!=null?v:!1):!K&&y&&y.length===1&&(Re=ye(y,1),K=Re[0]),e.createMesh(K,Q);case 28:case"end":return U.stop()}},o)}))()},n.addGeometries=function(e){var o=this.object3d,s=Le.mergeBufferGeometries([o.geometry].concat(ie(e)),!1);o.geometry=s},n.getMaterial=function(e){var o=this,s=e.topColor,f=e.sideColor,h=e.sideMap,v=e.type,d=e.parameters,_=e.createCanvasObjectURL,y=e.split,w=e.maxAnisotropy;return new Promise(function(b){var c=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};c.onload=function(){var g=y,R=document.createElement("canvas"),V=R.getContext("2d");R.height=c.height/(1-g),R.width=c.width,g&&s&&(V.fillStyle=s,V.fillRect(0,0,c.width,R.height*g)),h&&c instanceof HTMLImageElement?V.drawImage(c,0,R.height*g,c.width,c.height):f&&(V.fillStyle=f,V.fillRect(0,R.height*g,c.width,c.height)),_&&R.toBlob(function(K){console.log(URL.createObjectURL(K))});var x=new u.CanvasTexture(R);x.anisotropy=w||o.pencil.renderer.capabilities.getMaxAnisotropy();var Q=new u[v||"MeshBasicMaterial"]((0,C.Z)({map:x},d||{}));b(Q)},h?c.src=h:c instanceof HTMLImageElement||c.onload()})},n.setMaterialColor=function(e){var o=this;return(0,O.Z)(E().mark(function s(){var f,h,v,d,_,y,w,b,c,g,R;return E().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(f=o.options,h=f.materialOptions,v=f.cache,d=h.sideColor,_=h.sideMap,y=h.topColor,w=e.sideColor,b=e.topColor,!(b||w)){x.next=22;break}if(c="ExtrudePolygonMaterial:".concat(w||d||_||"").concat(b||y||""),!(v&&!v.get(c))){x.next=11;break}return v.init(c),x.next=9,o.getMaterial((0,C.Z)({},h,e));case 9:g=x.sent,v.set(c,g);case 11:if(!v){x.next=17;break}return x.next=14,v.get(c);case 14:x.t0=x.sent,x.next=20;break;case 17:return x.next=19,o.getMaterial((0,C.Z)({},h,e));case 19:x.t0=x.sent;case 20:R=x.t0,o.object3d.material=R;case 22:case"end":return x.stop()}},s)}))()},r}(m);function Et(t){var i=t.worker,r=t.workerKey,n=t.coordinatesArr,a=t.depth,e=t.split,o=t.projection,s=t.cacheVersion;return new Promise(function(f,h){i.postMessage({coordinatesArr:n,depth:a,split:e!=null?e:.1,projection:o,workerKey:r},{cb:function(v){try{var d=new u.BufferGeometry;Object.keys(v).forEach(function(_){d.setAttribute(_,new u.BufferAttribute(v[_].array,v[_].itemSize))}),f(d)}catch(_){i.postMessage({delCache:!0,workerKey:r},{cb:h,cacheVersion:s})}},cacheVersion:s})})}})(),module.exports=Be})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import*as it from"idb-keyval";import*as Ft from"three";import*as Kt from"three/examples/jsm/renderers/CSS2DRenderer";import*as at from"three/examples/jsm/renderers/CSS3DRenderer";import*as ot from"popmotion";import*as Xt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Fe from"d3-array";import*as Ht from"earcut";import*as $t from"@turf/boolean-clockwise";import*as Yt from"delaunator";import*as Jt from"@turf/boolean-point-in-polygon";import*as We from"d3-geo";import*as Qt from"d3-geo-voronoi";import*as qt from"d3-scale";var er={666:function(R){var L=function(M){"use strict";var T=Object.prototype,P=T.hasOwnProperty,E,k=typeof Symbol=="function"?Symbol:{},B=k.iterator||"@@iterator",F=k.asyncIterator||"@@asyncIterator",C=k.toStringTag||"@@toStringTag";function D(p,c,y){return Object.defineProperty(p,c,{value:y,enumerable:!0,configurable:!0,writable:!0}),p[c]}try{D({},"")}catch(p){D=function(c,y,A){return c[y]=A}}function K(p,c,y,A){var S=c&&c.prototype instanceof te?c:te,ee=Object.create(S.prototype),ue=new fe(A||[]);return ee._invoke=we(p,y,ue),ee}M.wrap=K;function W(p,c,y){try{return{type:"normal",arg:p.call(c,y)}}catch(A){return{type:"throw",arg:A}}}var J="suspendedStart",U="suspendedYield",f="executing",le="completed",z={};function te(){}function j(){}function V(){}var $={};D($,B,function(){return this});var se=Object.getPrototypeOf,Q=se&&se(se(Oe([])));Q&&Q!==T&&P.call(Q,B)&&($=Q);var X=V.prototype=te.prototype=Object.create($);j.prototype=V,D(X,"constructor",V),D(V,"constructor",j),j.displayName=D(V,C,"GeneratorFunction");function ae(p){["next","throw","return"].forEach(function(c){D(p,c,function(y){return this._invoke(c,y)})})}M.isGeneratorFunction=function(p){var c=typeof p=="function"&&p.constructor;return c?c===j||(c.displayName||c.name)==="GeneratorFunction":!1},M.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,V):(p.__proto__=V,D(p,C,"GeneratorFunction")),p.prototype=Object.create(X),p},M.awrap=function(p){return{__await:p}};function N(p,c){function y(ee,ue,he,ve){var oe=W(p[ee],p,ue);if(oe.type==="throw")ve(oe.arg);else{var Ce=oe.arg,Ee=Ce.value;return Ee&&typeof Ee=="object"&&P.call(Ee,"__await")?c.resolve(Ee.__await).then(function(Pe){y("next",Pe,he,ve)},function(Pe){y("throw",Pe,he,ve)}):c.resolve(Ee).then(function(Pe){Ce.value=Pe,he(Ce)},function(Pe){return y("throw",Pe,he,ve)})}}var A;function S(ee,ue){function he(){return new c(function(ve,oe){y(ee,ue,ve,oe)})}return A=A?A.then(he,he):he()}this._invoke=S}ae(N.prototype),D(N.prototype,F,function(){return this}),M.AsyncIterator=N,M.async=function(p,c,y,A,S){S===void 0&&(S=Promise);var ee=new N(K(p,c,y,A),S);return M.isGeneratorFunction(c)?ee:ee.next().then(function(ue){return ue.done?ue.value:ee.next()})};function we(p,c,y){var A=J;return function(ee,ue){if(A===f)throw new Error("Generator is already running");if(A===le){if(ee==="throw")throw ue;return ze()}for(y.method=ee,y.arg=ue;;){var he=y.delegate;if(he){var ve=ge(he,y);if(ve){if(ve===z)continue;return ve}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(A===J)throw A=le,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);A=f;var oe=W(p,c,y);if(oe.type==="normal"){if(A=y.done?le:U,oe.arg===z)continue;return{value:oe.arg,done:y.done}}else oe.type==="throw"&&(A=le,y.method="throw",y.arg=oe.arg)}}}function ge(p,c){var y=p.iterator[c.method];if(y===E){if(c.delegate=null,c.method==="throw"){if(p.iterator.return&&(c.method="return",c.arg=E,ge(p,c),c.method==="throw"))return z;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return z}var A=W(y,p.iterator,c.arg);if(A.type==="throw")return c.method="throw",c.arg=A.arg,c.delegate=null,z;var S=A.arg;if(!S)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,z;if(S.done)c[p.resultName]=S.value,c.next=p.nextLoc,c.method!=="return"&&(c.method="next",c.arg=E);else return S;return c.delegate=null,z}ae(X),D(X,C,"Generator"),D(X,B,function(){return this}),D(X,"toString",function(){return"[object Generator]"});function Y(p){var c={tryLoc:p[0]};1 in p&&(c.catchLoc=p[1]),2 in p&&(c.finallyLoc=p[2],c.afterLoc=p[3]),this.tryEntries.push(c)}function q(p){var c=p.completion||{};c.type="normal",delete c.arg,p.completion=c}function fe(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(Y,this),this.reset(!0)}M.keys=function(p){var c=[];for(var y in p)c.push(y);return c.reverse(),function A(){for(;c.length;){var S=c.pop();if(S in p)return A.value=S,A.done=!1,A}return A.done=!0,A}};function Oe(p){if(p){var c=p[B];if(c)return c.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var y=-1,A=function S(){for(;++y<p.length;)if(P.call(p,y))return S.value=p[y],S.done=!1,S;return S.value=E,S.done=!0,S};return A.next=A}}return{next:ze}}M.values=Oe;function ze(){return{value:E,done:!0}}return fe.prototype={constructor:fe,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(q),!p)for(var c in this)c.charAt(0)==="t"&&P.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=E)},stop:function(){this.done=!0;var p=this.tryEntries[0],c=p.completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var c=this;function y(ve,oe){return ee.type="throw",ee.arg=p,c.next=ve,oe&&(c.method="next",c.arg=E),!!oe}for(var A=this.tryEntries.length-1;A>=0;--A){var S=this.tryEntries[A],ee=S.completion;if(S.tryLoc==="root")return y("end");if(S.tryLoc<=this.prev){var ue=P.call(S,"catchLoc"),he=P.call(S,"finallyLoc");if(ue&&he){if(this.prev<S.catchLoc)return y(S.catchLoc,!0);if(this.prev<S.finallyLoc)return y(S.finallyLoc)}else if(ue){if(this.prev<S.catchLoc)return y(S.catchLoc,!0)}else if(he){if(this.prev<S.finallyLoc)return y(S.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,c){for(var y=this.tryEntries.length-1;y>=0;--y){var A=this.tryEntries[y];if(A.tryLoc<=this.prev&&P.call(A,"finallyLoc")&&this.prev<A.finallyLoc){var S=A;break}}S&&(p==="break"||p==="continue")&&S.tryLoc<=c&&c<=S.finallyLoc&&(S=null);var ee=S?S.completion:{};return ee.type=p,ee.arg=c,S?(this.method="next",this.next=S.finallyLoc,z):this.complete(ee)},complete:function(p,c){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&c&&(this.next=c),z},finish:function(p){for(var c=this.tryEntries.length-1;c>=0;--c){var y=this.tryEntries[c];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),q(y),z}},catch:function(p){for(var c=this.tryEntries.length-1;c>=0;--c){var y=this.tryEntries[c];if(y.tryLoc===p){var A=y.completion;if(A.type==="throw"){var S=A.arg;q(y)}return S}}throw new Error("illegal catch attempt")},delegateYield:function(p,c,y){return this.delegate={iterator:Oe(p),resultName:c,nextLoc:y},this.method==="next"&&(this.arg=E),z}},M}(R.exports);try{regeneratorRuntime=L}catch(M){typeof globalThis=="object"?globalThis.regeneratorRuntime=L:Function("r","regeneratorRuntime = r")(L)}},695:function(R,L,M){M.d(L,{Z:function(){return T}});function T(P){if(P.geometry&&P.geometry.dispose(),P.material){var E=Array.isArray(P.material)?P.material:[P.material];E.forEach(function(k){var B,F,C,D,K,W,J,U,f,le,z,te,j;(B=k.map)===null||B===void 0||B.dispose(),(F=k.lightMap)===null||F===void 0||F.dispose(),(C=k.bumpMap)===null||C===void 0||C.dispose(),(D=k.normalMap)===null||D===void 0||D.dispose(),(K=k.specularMap)===null||K===void 0||K.dispose(),(W=k.envMap)===null||W===void 0||W.dispose(),(J=k.alphaMap)===null||J===void 0||J.dispose(),(U=k.aoMap)===null||U===void 0||U.dispose(),(f=k.displacementMap)===null||f===void 0||f.dispose(),(le=k.emissiveMap)===null||le===void 0||le.dispose(),(z=k.gradientMap)===null||z===void 0||z.dispose(),(te=k.metalnessMap)===null||te===void 0||te.dispose(),(j=k.roughnessMap)===null||j===void 0||j.dispose(),k.dispose()})}}},584:function(R,L,M){M.d(L,{wf:function(){return k.Z}});var T=M(666),P=M.n(T),E=null,k=M(695),B=M(949);function F(z){if(z.material){var te=Array.isArray(z.material)?z.material:[z.material];te.forEach(function(j){var V,$;(V=j.color)===null||V===void 0||V.convertSRGBToLinear(),($=j.emissive)===null||$===void 0||$.convertSRGBToLinear(),j.map&&(j.map.encoding=THREE.sRGBEncoding),j.emissiveMap&&(j.emissiveMap.encoding=THREE.sRGBEncoding)})}}var C=M(568),D=M(924),K=M(77),W=M(484),J=null,U=null,f=function(){var z=(0,C.Z)(P().mark(function te(j,V){var $,se,Q,X,ae,N,we,ge,Y;return P().wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return $=V.type,se=$===void 0?"blob":$,Q=V.version,X=Q===void 0?"1":Q,fe.next=4,(0,K.get)(j);case 4:if(N=fe.sent,!(N&&N[X])){fe.next=9;break}ae=N[X],fe.next=15;break;case 9:return fe.next=11,(0,W.Z)(fetch(j).then(function(Oe){if(Oe.ok)return Oe[se]();throw new Error}));case 11:we=fe.sent,ge=we.res,Y=we.err,Y||(ae=ge,(0,K.set)(j,(0,D.Z)({},X,ge)));case 15:return fe.abrupt("return",ae?{url:se==="json"?j:URL.createObjectURL(ae),store:ae}:{url:j});case 16:case"end":return fe.stop()}},te)}));return function(j,V){return z.apply(this,arguments)}}(),le=M(705)},484:function(R,L,M){M.d(L,{Z:function(){return P}});var T=M(42);function P(E){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E.then(function(B){return(0,T.Z)({err:null,res:B},k)}).catch(function(B){return(0,T.Z)({err:B,res:void 0},k)})}},705:function(R,L,M){M.d(L,{C:function(){return k},y:function(){return E}});var T=M(949),P=new Map,E=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(F,C,D,K,W){var J=C[D*3],U=C[D*3+1],f=C[K*3],le=C[K*3+1],z=C[W*3],te=C[W*3+1],j;if(P.has(F))j=P.get(F);else{var V=B.box3||new T.Box3;if(!B.box3){var $=F.parameters.shapes.getPoints();V.setFromArray($.map(function(N){return[N.x,N.y,0]}).flat())}var se=V.getSize(new T.Vector3);B.split&&(se.y/=B.split),j={box:V,size:se},P.set(F,j)}var Q=j.box,X=j.size,ae=B.split?1-B.split:0;return[new T.Vector2((J-Q.min.x)/X.x,(U-Q.min.y)/X.y+ae),new T.Vector2((f-Q.min.x)/X.x,(le-Q.min.y)/X.y+ae),new T.Vector2((z-Q.min.x)/X.x,(te-Q.min.y)/X.y+ae)]},generateSideWallUV:function(F,C,D,K,W,J){var U=C[D*3],f=C[D*3+1],le=C[D*3+2],z=C[K*3],te=C[K*3+1],j=C[K*3+2],V=C[W*3],$=C[W*3+1],se=C[W*3+2],Q=C[J*3],X=C[J*3+1],ae=C[J*3+2],N;if(P.has(C))N=P.get(C);else{var we=new T.Box3;we.setFromArray(C);var ge=we.getSize(new T.Vector3);B.split&&(ge.z/=1-B.split),N={box:we,size:ge},P.set(C,N)}var Y=N.box,q=N.size;return Math.abs(f-te)<Math.abs(U-z)?[new T.Vector2((U-Y.min.x)/q.x,(le-Y.min.z)/q.z),new T.Vector2((z-Y.min.x)/q.x,(j-Y.min.z)/q.z),new T.Vector2((V-Y.min.x)/q.x,(se-Y.min.z)/q.z),new T.Vector2((Q-Y.min.x)/q.x,(ae-Y.min.z)/q.z)]:[new T.Vector2((f-Y.min.y)/q.y,(le-Y.min.z)/q.z),new T.Vector2((te-Y.min.y)/q.y,(j-Y.min.z)/q.z),new T.Vector2(($-Y.min.y)/q.y,(se-Y.min.z)/q.z),new T.Vector2((X-Y.min.y)/q.y,(ae-Y.min.z)/q.z)]}}},k=function(){P.clear()}},77:function(R,L,M){var T=E=>{var k={};return M.d(k,E),k},P=E=>()=>E;R.exports=T({get:()=>it.get,set:()=>it.set})},949:function(R){var L=T=>{var P={};return Z.d(P,T),P},M=T=>()=>T;R.exports=Ft},568:function(R,L,M){M.d(L,{Z:function(){return P}});function T(E,k,B,F,C,D,K){try{var W=E[D](K),J=W.value}catch(U){B(U);return}W.done?k(J):Promise.resolve(J).then(F,C)}function P(E){return function(){var k=this,B=arguments;return new Promise(function(F,C){var D=E.apply(k,B);function K(J){T(D,F,C,K,W,"next",J)}function W(J){T(D,F,C,K,W,"throw",J)}K(void 0)})}}},924:function(R,L,M){M.d(L,{Z:function(){return T}});function T(P,E,k){return E in P?Object.defineProperty(P,E,{value:k,enumerable:!0,configurable:!0,writable:!0}):P[E]=k,P}},42:function(R,L,M){M.d(L,{Z:function(){return P}});var T=M(924);function P(E){for(var k=1;k<arguments.length;k++){var B=arguments[k]!=null?arguments[k]:{},F=Object.keys(B);typeof Object.getOwnPropertySymbols=="function"&&(F=F.concat(Object.getOwnPropertySymbols(B).filter(function(C){return Object.getOwnPropertyDescriptor(B,C).enumerable}))),F.forEach(function(C){(0,T.Z)(E,C,B[C])})}return E}}},st={};function Z(R){var L=st[R];if(L!==void 0)return L.exports;var M=st[R]={exports:{}};return er[R](M,M.exports,Z),M.exports}(function(){Z.n=function(R){var L=R&&R.__esModule?function(){return R.default}:function(){return R};return Z.d(L,{a:L}),L}})(),function(){Z.d=function(R,L){for(var M in L)Z.o(L,M)&&!Z.o(R,M)&&Object.defineProperty(R,M,{enumerable:!0,get:L[M]})}}(),function(){Z.o=function(R,L){return Object.prototype.hasOwnProperty.call(R,L)}}();var me={};(function(){Z.d(me,{Ei:function(){return Ut},Yo:function(){return Nt},ZA:function(){return ct},Ee:function(){return he},x1:function(){return bt},VJ:function(){return xe},r7:function(){return Ve},XA:function(){return Ke},NB:function(){return ut},nk:function(){return Ee},JX:function(){return It},TQ:function(){return wt}});var R=Z(568);function L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function M(e,n){return M=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},M(e,n)}function T(e,n){return M(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&&T(e,n)}var E=Z(42);function k(){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 B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},B(e)}function F(e){return B(e)}function C(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){return e&&e.constructor===Symbol?"symbol":typeof e}function K(e,n){return n&&(D(n)==="object"||typeof n=="function")?n:C(e)}function W(e){var n=k();return function(){var i=F(e),a;if(n){var t=F(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return K(this,a)}}var J=Z(666),U=Z.n(J),f=Z(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 z(e,n,r){return le()?z=Reflect.construct:z=function(a,t,o){var s=[null];s.push.apply(s,t);var l=Function.bind.apply(a,s),h=new l;return o&&T(h,o.prototype),h},z.apply(null,arguments)}function te(e,n,r){return z.apply(null,arguments)}function j(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 V(e,n,r){return n&&j(e.prototype,n),r&&j(e,r),e}function $(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 se(e){if(Array.isArray(e))return $(e)}function Q(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function X(){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 ae(e,n){if(!!e){if(typeof e=="string")return $(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 $(e,n)}}function N(e){return se(e)||Q(e)||ae(e)||X()}var we=Z(484);function ge(){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,we.Z)(r.promise,n)),r}var Y=e=>{var n={};return Z.d(n,e),n},q=e=>()=>e,fe=Y({CSS2DObject:()=>Kt.CSS2DObject}),Oe=e=>{var n={};return Z.d(n,e),n},ze=e=>()=>e,p=Oe({CSS3DObject:()=>at.CSS3DObject,CSS3DSprite:()=>at.CSS3DSprite}),c=Z(584),y=function(e){e&&((0,c.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||y(n)}))},A=function(){"use strict";function e(){L(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=ge(),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=te(f.Mesh,N(a)),this},n.createGroup=function(){return this.object3d=new f.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=te(f.Points,N(a)),this},n.createCSS2DObject=function(i){return this.object3d=new fe.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new p.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new p.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new f.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,N(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,N(a)),this},n.getSize=function(){var i=new f.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new f.Vector3)}},n.traverse=function(i){i(this),this.children.forEach(function(a){a.traverse(i)})},n.dispose=function(){y(this.object3d)},V(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=+f.REVISION<144,ee=S?"ExtrudeBufferGeometry":"ExtrudeGeometry",ue=S?"PlaneBufferGeometry":"PlaneGeometry",he=function(e){"use strict";P(r,e);var n=W(r);function r(a){L(this,r);var t;return t=n.call(this),t.scale=1,t.options=a,t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,R.Z)(U().mark(function o(){var s,l,h,v,d,g,m,b,w,u,O,x;return U().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(s=t.options,l=s.transparent,h=s.blending,v=s.src,d=s.depthWrite,g=s.alphaTest,m=s.sprite,b=s.sizeAttenuation,w=s.text,u=s.textOptions,!v){_.next=7;break}return _.next=4,new f.TextureLoader().loadAsync(v);case 4:_.t0=_.sent,_.next=8;break;case 7:_.t0=t.getTextTexture(w,u);case 8:return O=_.t0,x=m?new f.SpriteMaterial({map:O,transparent:l!=null?l:!1,blending:h!=null?h:f.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0,sizeAttenuation:b!=null?b:!0}):new f.MeshBasicMaterial({map:O,transparent:l!=null?l:!1,blending:h!=null?h:f.NormalBlending,depthWrite:d!=null?d:!0,alphaTest:g!=null?g:0}),_.abrupt("return",x);case 11:case"end":return _.stop()}},o)}))()},i.create=function(){var t=this;return(0,R.Z)(U().mark(function o(){var s,l,h,v,d,g,m,b,w,u;return U().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(s=t.options,l=s.scale,h=s.position,v=s.src,d=s.cache,g=s.sprite,m=s.text,b=v||m,!(d&&!d.get(b))){x.next=8;break}return d.init(b),x.next=6,t.getMaterial();case 6:w=x.sent,d.set(b,w);case 8:if(!d){x.next=14;break}return x.next=11,d.get(b);case 11:x.t0=x.sent,x.next=17;break;case 14:return x.next=16,t.getMaterial();case 16:x.t0=x.sent;case 17:u=x.t0,t.texture=u.map,g?t.createSprite(u):t.createMesh(new f[ue](1,1),u),l&&t.setScale(l),h&&t.object3d.position.copy(h);case 22:case"end":return x.stop()}},o)}))()},i.setScale=function(t){this.scale=t,this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},i.setTexture=function(t){var o=this.object3d;o.material.map&&o.material.map.dispose(),o.material.map=t,o.material.needsUpdate=!0,this.texture=t,this.setScale(this.scale)},i.getTextTexture=function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(0,E.Z)({},{fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1},o),l=s.fontSize,h=s.fontFamily,v=s.fontWeight,d=s.flipX,g=document.createElement("canvas");g.width=l*t.length*2,g.height=l;var m=g.getContext("2d");m.font="".concat(v," ").concat(l,"px/1 ").concat(h);var b=m.measureText(t).width;g.width=b,m=g.getContext("2d"),m.clearRect(0,0,g.width,g.height),d&&m.scale(-1,1),m.font="".concat(v," ").concat(l,"px/1 ").concat(h),m.textBaseline="middle",m.fillStyle="#ffffff",m.fillText(t,d?b*-1:0,g.height/2),m.restore();var w=new f.Texture(g);return w.anisotropy=this.pencil.renderer.capabilities.getMaxAnisotropy(),w.needsUpdate=!0,w},r}(A);function ve(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=F(e),e!==null););return e}function oe(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?oe=Reflect.get:oe=function(a,t,o){var s=ve(a,t);if(!!s){var l=Object.getOwnPropertyDescriptor(s,t);return l.get?l.get.call(o||a):l.value}},oe(e,n,r)}function Ce(e,n,r){return oe(e,n,r)}var Ee=function(e){"use strict";P(r,e);var n=W(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,E.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,l=t.blending,h=t.depthWrite,v=t.format,d=t.autoPlay,g=t.loop,m=t.alphaTest,b=t.sprite,w=ge(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var O=new f.VideoTexture(u);O.format=v!=null?v:f.RGBAFormat,O.needsUpdate=!0;var x=b?new f.SpriteMaterial({map:O,transparent:s!=null?s:!1,blending:l!=null?l:f.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:m!=null?m:0}):new f.MeshBasicMaterial({map:O,transparent:s!=null?s:!1,blending:l!=null?l:f.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:m!=null?m:0});w.resolve(x)},!1),u.src=o,u.muted=!0,u.autoplay=d,u.loop=g,u.preload="auto",w.promise},i.create=function(){var t=this;return(0,R.Z)(U().mark(function o(){var s,l,h,v,d,g,m,b;return U().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,l=s.scale,h=s.position,v=s.src,d=s.cache,g=s.sprite,!(d&&!d.get(v))){u.next=7;break}return d.init(v),u.next=5,t.getMaterial();case 5:m=u.sent,d.set(v,m);case 7:if(!d){u.next=13;break}return u.next=10,d.get(v);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:b=u.t0,t.video=b.map.image,g?t.createSprite(b):t.createMesh(new f[ue](1,1),b),l&&t.setScale(l),h&&t.object3d.position.copy(h);case 21:case"end":return u.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(),Ce(F(r.prototype),"dispose",this).call(this)},r}(A),Pe=function(e){"use strict";P(r,e);var n=W(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,E.Z)({},{event:"click"},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,l=t.handler,h=t.event,v=t.zIndexFix,d=t.event2,g=t.handler2,m=document.createElement("div");this.element=m,m.appendChild(s),this.createCSS2DObject(m),o&&this.object3d.position.copy(o),l&&h&&this.clickTarge.forEach(function(b){b.addEventListener(h,l),g&&d&&b.addEventListener(d,g)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,R.Z)(U().mark(function o(){var s,l,h,v;return U().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,l=s.getContext("2d"),l.fillStyle="#ff0000",l.fillRect(0,0,256,256),h=new f.CanvasTexture(s),v=new f.SpriteMaterial({map:h,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),g.abrupt("return",v);case 9:case"end":return g.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,l=t.scale,h=l===void 0?new f.Vector3(1,1,1):l,v=t.position,d=v===void 0?new f.Vector3(0,0,0):v,g=t.cache,m=this;return(0,R.Z)(U().mark(function b(){var w,u,O,x;return U().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(w="node-create-pick-object",!(g&&!g.get(w))){_.next=7;break}return g.init(w),_.next=5,m.getMaterial(s);case 5:u=_.sent,g.set(w,u);case 7:if(!g){_.next=13;break}return _.next=10,g.get(w);case 10:_.t0=_.sent,_.next=16;break;case 13:return _.next=15,m.getMaterial(s);case 15:_.t0=_.sent;case 16:O=_.t0,x=new f.Sprite(O),x.scale.set(O.map.image.width*h.x,O.map.image.height*h.y,1),x.position.copy(d),m.add(x),m.pickObject=x;case 22:case"end":return _.stop()}},b)}))()},i.dispose=function(){var t=this.options,o=t.handler,s=t.event,l=t.handler2,h=t.event2;o&&s&&this.clickTarge.forEach(function(v){v.removeEventListener(s,o),l&&h&&v.removeEventListener(h,l)}),Ce(F(r.prototype),"dispose",this).call(this)},V(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.eventTarge;if(o){var s=o.map(function(l){return N(t.element.querySelectorAll(l))}).flat();return s}return[this.element]}}]),r}(A),ut=Pe,ct=function(e){"use strict";P(r,e);var n=W(r);function r(){return L(this,r),n.apply(this,arguments)}var i=r.prototype;return i.create=function(){this.createGroup()},r}(A),lt=`
|
|
2
|
-
`.concat(
|
|
3
|
-
`).concat(
|
|
1
|
+
import*as ot from"idb-keyval";import*as $t from"three";import*as Yt from"three/examples/jsm/renderers/CSS2DRenderer";import*as st from"three/examples/jsm/renderers/CSS3DRenderer";import*as ut from"popmotion";import*as Jt from"three/examples/jsm//utils/BufferGeometryUtils";import*as Xe from"d3-array";import*as Qt from"earcut";import*as qt from"@turf/boolean-clockwise";import*as er from"delaunator";import*as tr from"@turf/boolean-point-in-polygon";import*as ze from"d3-geo";import*as rr from"d3-geo-voronoi";import*as nr from"d3-scale";var ir={666:function(k){var B=function(M){"use strict";var P=Object.prototype,x=P.hasOwnProperty,z,L=typeof Symbol=="function"?Symbol:{},W=L.iterator||"@@iterator",H=L.asyncIterator||"@@asyncIterator",C=L.toStringTag||"@@toStringTag";function T(p,l,y){return Object.defineProperty(p,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),p[l]}try{T({},"")}catch(p){T=function(l,y,E){return l[y]=E}}function Z(p,l,y,E){var O=l&&l.prototype instanceof u?l:u,J=Object.create(O.prototype),q=new se(E||[]);return J._invoke=we(p,y,q),J}M.wrap=Z;function K(p,l,y){try{return{type:"normal",arg:p.call(l,y)}}catch(E){return{type:"throw",arg:E}}}var Q="suspendedStart",oe="suspendedYield",pe="executing",fe="completed",j={};function u(){}function S(){}function U(){}var G={};T(G,W,function(){return this});var ie=Object.getPrototypeOf,$=ie&&ie(ie(Oe([])));$&&$!==P&&x.call($,W)&&(G=$);var F=U.prototype=u.prototype=Object.create(G);S.prototype=U,T(F,"constructor",U),T(U,"constructor",S),S.displayName=T(U,C,"GeneratorFunction");function ae(p){["next","throw","return"].forEach(function(l){T(p,l,function(y){return this._invoke(l,y)})})}M.isGeneratorFunction=function(p){var l=typeof p=="function"&&p.constructor;return l?l===S||(l.displayName||l.name)==="GeneratorFunction":!1},M.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,U):(p.__proto__=U,T(p,C,"GeneratorFunction")),p.prototype=Object.create(F),p},M.awrap=function(p){return{__await:p}};function ee(p,l){function y(J,q,ue,ve){var ce=K(p[J],p,q);if(ce.type==="throw")ve(ce.arg);else{var Le=ce.arg,Ce=Le.value;return Ce&&typeof Ce=="object"&&x.call(Ce,"__await")?l.resolve(Ce.__await).then(function(Pe){y("next",Pe,ue,ve)},function(Pe){y("throw",Pe,ue,ve)}):l.resolve(Ce).then(function(Pe){Le.value=Pe,ue(Le)},function(Pe){return y("throw",Pe,ue,ve)})}}var E;function O(J,q){function ue(){return new l(function(ve,ce){y(J,q,ve,ce)})}return E=E?E.then(ue,ue):ue()}this._invoke=O}ae(ee.prototype),T(ee.prototype,H,function(){return this}),M.AsyncIterator=ee,M.async=function(p,l,y,E,O){O===void 0&&(O=Promise);var J=new ee(Z(p,l,y,E),O);return M.isGeneratorFunction(l)?J:J.next().then(function(q){return q.done?q.value:J.next()})};function we(p,l,y){var E=Q;return function(J,q){if(E===pe)throw new Error("Generator is already running");if(E===fe){if(J==="throw")throw q;return De()}for(y.method=J,y.arg=q;;){var ue=y.delegate;if(ue){var ve=ge(ue,y);if(ve){if(ve===j)continue;return ve}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(E===Q)throw E=fe,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);E=pe;var ce=K(p,l,y);if(ce.type==="normal"){if(E=y.done?fe:oe,ce.arg===j)continue;return{value:ce.arg,done:y.done}}else ce.type==="throw"&&(E=fe,y.method="throw",y.arg=ce.arg)}}}function ge(p,l){var y=p.iterator[l.method];if(y===z){if(l.delegate=null,l.method==="throw"){if(p.iterator.return&&(l.method="return",l.arg=z,ge(p,l),l.method==="throw"))return j;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return j}var E=K(y,p.iterator,l.arg);if(E.type==="throw")return l.method="throw",l.arg=E.arg,l.delegate=null,j;var O=E.arg;if(!O)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,j;if(O.done)l[p.resultName]=O.value,l.next=p.nextLoc,l.method!=="return"&&(l.method="next",l.arg=z);else return O;return l.delegate=null,j}ae(F),T(F,C,"Generator"),T(F,W,function(){return this}),T(F,"toString",function(){return"[object Generator]"});function V(p){var l={tryLoc:p[0]};1 in p&&(l.catchLoc=p[1]),2 in p&&(l.finallyLoc=p[2],l.afterLoc=p[3]),this.tryEntries.push(l)}function Y(p){var l=p.completion||{};l.type="normal",delete l.arg,p.completion=l}function se(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(V,this),this.reset(!0)}M.keys=function(p){var l=[];for(var y in p)l.push(y);return l.reverse(),function E(){for(;l.length;){var O=l.pop();if(O in p)return E.value=O,E.done=!1,E}return E.done=!0,E}};function Oe(p){if(p){var l=p[W];if(l)return l.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var y=-1,E=function O(){for(;++y<p.length;)if(x.call(p,y))return O.value=p[y],O.done=!1,O;return O.value=z,O.done=!0,O};return E.next=E}}return{next:De}}M.values=Oe;function De(){return{value:z,done:!0}}return se.prototype={constructor:se,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=z,this.done=!1,this.delegate=null,this.method="next",this.arg=z,this.tryEntries.forEach(Y),!p)for(var l in this)l.charAt(0)==="t"&&x.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=z)},stop:function(){this.done=!0;var p=this.tryEntries[0],l=p.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var l=this;function y(ve,ce){return J.type="throw",J.arg=p,l.next=ve,ce&&(l.method="next",l.arg=z),!!ce}for(var E=this.tryEntries.length-1;E>=0;--E){var O=this.tryEntries[E],J=O.completion;if(O.tryLoc==="root")return y("end");if(O.tryLoc<=this.prev){var q=x.call(O,"catchLoc"),ue=x.call(O,"finallyLoc");if(q&&ue){if(this.prev<O.catchLoc)return y(O.catchLoc,!0);if(this.prev<O.finallyLoc)return y(O.finallyLoc)}else if(q){if(this.prev<O.catchLoc)return y(O.catchLoc,!0)}else if(ue){if(this.prev<O.finallyLoc)return y(O.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,l){for(var y=this.tryEntries.length-1;y>=0;--y){var E=this.tryEntries[y];if(E.tryLoc<=this.prev&&x.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var O=E;break}}O&&(p==="break"||p==="continue")&&O.tryLoc<=l&&l<=O.finallyLoc&&(O=null);var J=O?O.completion:{};return J.type=p,J.arg=l,O?(this.method="next",this.next=O.finallyLoc,j):this.complete(J)},complete:function(p,l){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&l&&(this.next=l),j},finish:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),Y(y),j}},catch:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===p){var E=y.completion;if(E.type==="throw"){var O=E.arg;Y(y)}return O}}throw new Error("illegal catch attempt")},delegateYield:function(p,l,y){return this.delegate={iterator:Oe(p),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=z),j}},M}(k.exports);try{regeneratorRuntime=B}catch(M){typeof globalThis=="object"?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},695:function(k,B,M){M.d(B,{Z:function(){return P}});function P(x){if(x.geometry&&x.geometry.dispose(),x.material){var z=Array.isArray(x.material)?x.material:[x.material];z.forEach(function(L){var W,H,C,T,Z,K,Q,oe,pe,fe,j,u,S;(W=L.map)===null||W===void 0||W.dispose(),(H=L.lightMap)===null||H===void 0||H.dispose(),(C=L.bumpMap)===null||C===void 0||C.dispose(),(T=L.normalMap)===null||T===void 0||T.dispose(),(Z=L.specularMap)===null||Z===void 0||Z.dispose(),(K=L.envMap)===null||K===void 0||K.dispose(),(Q=L.alphaMap)===null||Q===void 0||Q.dispose(),(oe=L.aoMap)===null||oe===void 0||oe.dispose(),(pe=L.displacementMap)===null||pe===void 0||pe.dispose(),(fe=L.emissiveMap)===null||fe===void 0||fe.dispose(),(j=L.gradientMap)===null||j===void 0||j.dispose(),(u=L.metalnessMap)===null||u===void 0||u.dispose(),(S=L.roughnessMap)===null||S===void 0||S.dispose(),L.dispose()})}}},584:function(k,B,M){M.d(B,{wf:function(){return L.Z}});var P=M(666),x=M.n(P),z=null,L=M(695),W=M(949);function H(j){if(j.material){var u=Array.isArray(j.material)?j.material:[j.material];u.forEach(function(S){var U,G;(U=S.color)===null||U===void 0||U.convertSRGBToLinear(),(G=S.emissive)===null||G===void 0||G.convertSRGBToLinear(),S.map&&(S.map.encoding=THREE.sRGBEncoding),S.emissiveMap&&(S.emissiveMap.encoding=THREE.sRGBEncoding)})}}var C=M(568),T=M(924),Z=M(77),K=M(484),Q=null,oe=null,pe=function(){var j=(0,C.Z)(x().mark(function u(S,U){var G,ie,$,F,ae,ee,we,ge,V;return x().wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return G=U.type,ie=G===void 0?"blob":G,$=U.version,F=$===void 0?"1":$,se.next=4,(0,Z.get)(S);case 4:if(ee=se.sent,!(ee&&ee[F])){se.next=9;break}ae=ee[F],se.next=15;break;case 9:return se.next=11,(0,K.Z)(fetch(S).then(function(Oe){if(Oe.ok)return Oe[ie]();throw new Error}));case 11:we=se.sent,ge=we.res,V=we.err,V||(ae=ge,(0,Z.set)(S,(0,T.Z)({},F,ge)));case 15:return se.abrupt("return",ae?{url:ie==="json"?S:URL.createObjectURL(ae),store:ae}:{url:S});case 16:case"end":return se.stop()}},u)}));return function(S,U){return j.apply(this,arguments)}}(),fe=M(705)},484:function(k,B,M){M.d(B,{Z:function(){return x}});var P=M(42);function x(z){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return z.then(function(W){return(0,P.Z)({err:null,res:W},L)}).catch(function(W){return(0,P.Z)({err:W,res:void 0},L)})}},705:function(k,B,M){M.d(B,{C:function(){return L},y:function(){return z}});var P=M(949),x=new Map,z=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(H,C,T,Z,K){var Q=C[T*3],oe=C[T*3+1],pe=C[Z*3],fe=C[Z*3+1],j=C[K*3],u=C[K*3+1],S;if(x.has(H))S=x.get(H);else{var U=W.box3||new P.Box3;if(!W.box3){var G=H.parameters.shapes.getPoints();U.setFromArray(G.map(function(ee){return[ee.x,ee.y,0]}).flat())}var ie=U.getSize(new P.Vector3);W.split&&(ie.y/=W.split),S={box:U,size:ie},x.set(H,S)}var $=S.box,F=S.size,ae=W.split?1-W.split:0;return[new P.Vector2((Q-$.min.x)/F.x,(oe-$.min.y)/F.y+ae),new P.Vector2((pe-$.min.x)/F.x,(fe-$.min.y)/F.y+ae),new P.Vector2((j-$.min.x)/F.x,(u-$.min.y)/F.y+ae)]},generateSideWallUV:function(H,C,T,Z,K,Q){var oe=C[T*3],pe=C[T*3+1],fe=C[T*3+2],j=C[Z*3],u=C[Z*3+1],S=C[Z*3+2],U=C[K*3],G=C[K*3+1],ie=C[K*3+2],$=C[Q*3],F=C[Q*3+1],ae=C[Q*3+2],ee;if(x.has(C))ee=x.get(C);else{var we=new P.Box3;we.setFromArray(C);var ge=we.getSize(new P.Vector3);W.split&&(ge.z/=1-W.split),ee={box:we,size:ge},x.set(C,ee)}var V=ee.box,Y=ee.size;return Math.abs(pe-u)<Math.abs(oe-j)?[new P.Vector2((oe-V.min.x)/Y.x,(fe-V.min.z)/Y.z),new P.Vector2((j-V.min.x)/Y.x,(S-V.min.z)/Y.z),new P.Vector2((U-V.min.x)/Y.x,(ie-V.min.z)/Y.z),new P.Vector2(($-V.min.x)/Y.x,(ae-V.min.z)/Y.z)]:[new P.Vector2((pe-V.min.y)/Y.y,(fe-V.min.z)/Y.z),new P.Vector2((u-V.min.y)/Y.y,(S-V.min.z)/Y.z),new P.Vector2((G-V.min.y)/Y.y,(ie-V.min.z)/Y.z),new P.Vector2((F-V.min.y)/Y.y,(ae-V.min.z)/Y.z)]}}},L=function(){x.clear()}},77:function(k,B,M){var P=z=>{var L={};return M.d(L,z),L},x=z=>()=>z;k.exports=P({get:()=>ot.get,set:()=>ot.set})},949:function(k){var B=P=>{var x={};return I.d(x,P),x},M=P=>()=>P;k.exports=$t},568:function(k,B,M){M.d(B,{Z:function(){return x}});function P(z,L,W,H,C,T,Z){try{var K=z[T](Z),Q=K.value}catch(oe){W(oe);return}K.done?L(Q):Promise.resolve(Q).then(H,C)}function x(z){return function(){var L=this,W=arguments;return new Promise(function(H,C){var T=z.apply(L,W);function Z(Q){P(T,H,C,Z,K,"next",Q)}function K(Q){P(T,H,C,Z,K,"throw",Q)}Z(void 0)})}}},924:function(k,B,M){M.d(B,{Z:function(){return P}});function P(x,z,L){return z in x?Object.defineProperty(x,z,{value:L,enumerable:!0,configurable:!0,writable:!0}):x[z]=L,x}},42:function(k,B,M){M.d(B,{Z:function(){return x}});var P=M(924);function x(z){for(var L=1;L<arguments.length;L++){var W=arguments[L]!=null?arguments[L]:{},H=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(W).filter(function(C){return Object.getOwnPropertyDescriptor(W,C).enumerable}))),H.forEach(function(C){(0,P.Z)(z,C,W[C])})}return z}}},ct={};function I(k){var B=ct[k];if(B!==void 0)return B.exports;var M=ct[k]={exports:{}};return ir[k](M,M.exports,I),M.exports}(function(){I.n=function(k){var B=k&&k.__esModule?function(){return k.default}:function(){return k};return I.d(B,{a:B}),B}})(),function(){I.d=function(k,B){for(var M in B)I.o(B,M)&&!I.o(k,M)&&Object.defineProperty(k,M,{enumerable:!0,get:B[M]})}}(),function(){I.o=function(k,B){return Object.prototype.hasOwnProperty.call(k,B)}}();var de={};(function(){I.d(de,{Ei:function(){return Ft},Yo:function(){return Kt},ZA:function(){return pt},Ee:function(){return Le},x1:function(){return At},VJ:function(){return xe},r7:function(){return Ne},XA:function(){return He},NB:function(){return ht},xv:function(){return Ce},nk:function(){return lt},JX:function(){return Xt},TQ:function(){return Pt}});function k(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function B(e,n){return B=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},B(e,n)}function M(e,n){return B(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&&M(e,n)}var x=I(42);function z(){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 L(e,n,r){return z()?L=Reflect.construct:L=function(a,t,o){var s=[null];s.push.apply(s,t);var f=Function.bind.apply(a,s),h=new f;return o&&M(h,o.prototype),h},L.apply(null,arguments)}function W(e,n,r){return L.apply(null,arguments)}function H(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},C(e)}function T(e){return C(e)}function Z(e){var n=typeof Map=="function"?new Map:void 0;return Z=function(i){if(i===null||!H(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(i))return n.get(i);n.set(i,a)}function a(){return W(i,arguments,T(this).constructor)}return a.prototype=Object.create(i.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),M(a,i)},Z(e)}function K(e){return Z(e)}function Q(){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 oe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pe(e){return e&&e.constructor===Symbol?"symbol":typeof e}function fe(e,n){return n&&(pe(n)==="object"||typeof n=="function")?n:oe(e)}function j(e){var n=Q();return function(){var i=T(e),a;if(n){var t=T(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return fe(this,a)}}var u=I(949),S=I(568),U=I(666),G=I.n(U);function ie(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 $(e,n,r){return n&&ie(e.prototype,n),r&&ie(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 ae(e){if(Array.isArray(e))return F(e)}function ee(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function we(){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 ge(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 V(e){return ae(e)||ee(e)||ge(e)||we()}var Y=I(484);function se(){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,Y.Z)(r.promise,n)),r}var Oe=e=>{var n={};return I.d(n,e),n},De=e=>()=>e,p=Oe({CSS2DObject:()=>Yt.CSS2DObject}),l=e=>{var n={};return I.d(n,e),n},y=e=>()=>e,E=l({CSS3DObject:()=>st.CSS3DObject,CSS3DSprite:()=>st.CSS3DSprite}),O=I(584),J=function(e){e&&((0,O.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||J(n)}))},q=function(){"use strict";function e(){k(this,e),this.objecttype__="BaseObject",this.userData={},this.pm=se(),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=W(u.Mesh,V(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=W(u.Points,V(a)),this},n.createCSS2DObject=function(i){return this.object3d=new p.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new E.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new E.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,V(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,V(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(){J(this.object3d)},$(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}(),ue=+u.REVISION<144,ve=ue?"ExtrudeBufferGeometry":"ExtrudeGeometry",ce=ue?"PlaneBufferGeometry":"PlaneGeometry",Le=function(e){"use strict";P(r,e);var n=j(r);function r(a){k(this,r);var t;return t=n.call(this),t.scale=1,t.options=(0,x.Z)({},{scale:1},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this;return(0,S.Z)(G().mark(function o(){var s,f,h,v,d,w,g,b,_;return G().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return s=t.options,f=s.transparent,h=s.blending,v=s.depthWrite,d=s.alphaTest,w=s.sprite,g=s.sizeAttenuation,m.next=3,t.getTexture();case 3:return b=m.sent,_=w?new u.SpriteMaterial({map:b,transparent:f!=null?f:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:d!=null?d:0,sizeAttenuation:g!=null?g:!0}):new u.MeshBasicMaterial({map:b,transparent:f!=null?f:!1,blending:h!=null?h:u.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:d!=null?d:0}),m.abrupt("return",_);case 6:case"end":return m.stop()}},o)}))()},i.create=function(){var t=this;return(0,S.Z)(G().mark(function o(){var s,f,h,v,d,w,g,b,_;return G().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(s=t.options,f=s.scale,h=s.position,v=s.src,d=s.cache,w=s.sprite,g=v,!(d&&!d.get(g))){m.next=8;break}return d.init(g),m.next=6,t.getMaterial();case 6:b=m.sent,d.set(g,b);case 8:if(!d){m.next=14;break}return m.next=11,d.get(g);case 11:m.t0=m.sent,m.next=17;break;case 14:return m.next=16,t.getMaterial();case 16:m.t0=m.sent;case 17:_=m.t0,t.texture=_.map,w?t.createSprite(_):t.createMesh(new u[ce](1,1),_),t.setScale(f),h&&t.object3d.position.copy(h);case 22:case"end":return m.stop()}},o)}))()},i.setScale=function(t){this.scale=t,this.object3d.scale.set(this.texture.image.width*t,this.texture.image.height*t,1)},i.setTexture=function(t){var o=this.object3d;o.material.map&&o.material.map.dispose(),o.material.map=t,o.material.needsUpdate=!0,this.texture=t,this.setScale(this.scale)},i.getTexture=function(){var t=this.options.src;return new u.TextureLoader().loadAsync(t)},r}(q),Ce=function(e){"use strict";P(r,e);var n=j(r);function r(a){k(this,r);var t;return t=n.call(this,a),t.canvas=document.createElement("canvas"),t}var i=r.prototype;return i.getTexture=function(){var t=this.options,o=t.text,s=t.textOptions,f=(0,x.Z)({},{fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,color:"#ffffff"},s||{}),h=f.fontSize,v=f.fontFamily,d=f.fontWeight,w=f.flipX,g=f.color,b=this.canvas;b.width=h*o.length*2,b.height=h;var _=b.getContext("2d");_.font="".concat(d," ").concat(h,"px/1 ").concat(v);var c=_.measureText(o).width;b.width=c,_=b.getContext("2d"),_.clearRect(0,0,b.width,b.height),w&&_.scale(-1,1),_.font="".concat(d," ").concat(h,"px/1 ").concat(v),_.textBaseline="middle",_.fillStyle=g,_.fillText(o,w?c*-1:0,b.height/2),_.restore();var m=new u.Texture(b);return m.anisotropy=this.pencil.renderer.capabilities.getMaxAnisotropy(),m.needsUpdate=!0,Promise.resolve(m)},r}(K(Le));function Pe(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=T(e),e!==null););return e}function We(e,n,r){return typeof Reflect!="undefined"&&Reflect.get?We=Reflect.get:We=function(a,t,o){var s=Pe(a,t);if(!!s){var f=Object.getOwnPropertyDescriptor(s,t);return f.get?f.get.call(o||a):f.value}},We(e,n,r)}function Ve(e,n,r){return We(e,n,r)}var lt=function(e){"use strict";P(r,e);var n=j(r);function r(a){k(this,r);var t;return t=n.call(this),t.scale=1,t.options=(0,x.Z)({},{scale:1,autoPlay:!0,loop:!0},a),t}var i=r.prototype;return i.getMaterial=function(){var t=this.options,o=t.src,s=t.transparent,f=t.blending,h=t.depthWrite,v=t.format,d=t.autoPlay,w=t.loop,g=t.alphaTest,b=t.sprite,_=se(),c=document.createElement("video");return c.addEventListener("loadedmetadata",function(){var m=new u.VideoTexture(c);m.format=v!=null?v:u.RGBAFormat,m.needsUpdate=!0;var R=b?new u.SpriteMaterial({map:m,transparent:s!=null?s:!1,blending:f!=null?f:u.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:g!=null?g:0}):new u.MeshBasicMaterial({map:m,transparent:s!=null?s:!1,blending:f!=null?f:u.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:g!=null?g:0});_.resolve(R)},!1),c.src=o,c.muted=!0,c.autoplay=d,c.loop=w,c.preload="auto",_.promise},i.create=function(){var t=this;return(0,S.Z)(G().mark(function o(){var s,f,h,v,d,w,g,b;return G().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=t.options,f=s.scale,h=s.position,v=s.src,d=s.cache,w=s.sprite,!(d&&!d.get(v))){c.next=7;break}return d.init(v),c.next=5,t.getMaterial();case 5:g=c.sent,d.set(v,g);case 7:if(!d){c.next=13;break}return c.next=10,d.get(v);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:b=c.t0,t.video=b.map.image,w?t.createSprite(b):t.createMesh(new u[ce](1,1),b),t.setScale(f),h&&t.object3d.position.copy(h);case 21:case"end":return c.stop()}},o)}))()},i.setScale=function(t){this.scale=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(),Ve(T(r.prototype),"dispose",this).call(this)},r}(q),ft=function(e){"use strict";P(r,e);var n=j(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=(0,x.Z)({},{event:"click"},a),t}var i=r.prototype;return i.create=function(){var t=this.options,o=t.position,s=t.children,f=t.handler,h=t.event,v=t.zIndexFix,d=t.event2,w=t.handler2,g=document.createElement("div");this.element=g,g.appendChild(s),this.createCSS2DObject(g),o&&this.object3d.position.copy(o),f&&h&&this.clickTarge.forEach(function(b){b.addEventListener(h,f),w&&d&&b.addEventListener(d,w)}),v&&(this.object3d.userData.zIndexFix=v)},i.getMaterial=function(t){return(0,S.Z)(G().mark(function o(){var s,f,h,v;return G().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return s=document.createElement("canvas"),s.width=256,s.height=256,f=s.getContext("2d"),f.fillStyle="#ff0000",f.fillRect(0,0,256,256),h=new u.CanvasTexture(s),v=new u.SpriteMaterial({map:h,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),w.abrupt("return",v);case 9:case"end":return w.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,f=t.scale,h=f===void 0?new u.Vector3(1,1,1):f,v=t.position,d=v===void 0?new u.Vector3(0,0,0):v,w=t.cache,g=this;return(0,S.Z)(G().mark(function b(){var _,c,m,R;return G().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(_="node-create-pick-object",!(w&&!w.get(_))){A.next=7;break}return w.init(_),A.next=5,g.getMaterial(s);case 5:c=A.sent,w.set(_,c);case 7:if(!w){A.next=13;break}return A.next=10,w.get(_);case 10:A.t0=A.sent,A.next=16;break;case 13:return A.next=15,g.getMaterial(s);case 15:A.t0=A.sent;case 16:m=A.t0,R=new u.Sprite(m),R.scale.set(m.map.image.width*h.x,m.map.image.height*h.y,1),R.position.copy(d),g.add(R),g.pickObject=R;case 22:case"end":return A.stop()}},b)}))()},i.dispose=function(){var t=this.options,o=t.handler,s=t.event,f=t.handler2,h=t.event2;o&&s&&this.clickTarge.forEach(function(v){v.removeEventListener(s,o),f&&h&&v.removeEventListener(h,f)}),Ve(T(r.prototype),"dispose",this).call(this)},$(r,[{key:"clickTarge",get:function(){var t=this,o=this.options.eventTarge;if(o){var s=o.map(function(f){return V(t.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(q),ht=ft,pt=function(e){"use strict";P(r,e);var n=j(r);function r(){return k(this,r),n.apply(this,arguments)}var i=r.prototype;return i.create=function(){this.createGroup()},r}(q),vt=`
|
|
2
|
+
`.concat(u.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
|
+
`).concat(u.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
5
5
|
attribute vec3 next;
|
|
6
6
|
attribute float side;
|
|
@@ -91,13 +91,13 @@ import*as it from"idb-keyval";import*as Ft from"three";import*as Kt from"three/e
|
|
|
91
91
|
finalPosition.xy+=offset.xy;
|
|
92
92
|
|
|
93
93
|
gl_Position=finalPosition;
|
|
94
|
-
`).concat(
|
|
94
|
+
`).concat(u.ShaderChunk.logdepthbuf_vertex,`
|
|
95
95
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
96
|
-
`).concat(
|
|
96
|
+
`).concat(u.ShaderChunk.fog_vertex,`
|
|
97
97
|
}
|
|
98
|
-
`),
|
|
99
|
-
`.concat(
|
|
100
|
-
`).concat(
|
|
98
|
+
`),dt=`
|
|
99
|
+
`.concat(u.ShaderChunk.fog_pars_fragment,`
|
|
100
|
+
`).concat(u.ShaderChunk.logdepthbuf_pars_fragment,`
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
uniform sampler2D map;
|
|
@@ -117,7 +117,7 @@ varying vec4 vColor;
|
|
|
117
117
|
varying float vCounters;
|
|
118
118
|
|
|
119
119
|
void main() {
|
|
120
|
-
`).concat(
|
|
120
|
+
`).concat(u.ShaderChunk.logdepthbuf_fragment,`
|
|
121
121
|
vec4 c = vColor;
|
|
122
122
|
if( useMap == 1. ) c *= texture2D( map, vUV * repeat );
|
|
123
123
|
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;
|
|
@@ -127,6 +127,6 @@ void main() {
|
|
|
127
127
|
}
|
|
128
128
|
gl_FragColor = c;
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
|
-
`).concat(
|
|
130
|
+
`).concat(u.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),xe=function(e){"use strict";P(r,e);var n=W(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 f.Matrix4,Object.defineProperties(C(i),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}}),i}return r}(f.BufferGeometry);xe.prototype.setMatrixWorld=function(e){this.matrixWorld=e},xe.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},xe.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 f.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 Ke(e,n){var r=new f.Matrix4,i=new f.Ray,a=new f.Sphere,t=new f.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 f.Vector3,l=new f.Vector3,h=new f.Vector3,v=this instanceof f.LineSegments?2:1,d=o.index,g=o.attributes;if(d!==null)for(var m=d.array,b=g.position.array,w=g.width.array,u=0,O=m.length-1;u<O;u+=v){var x=m[u],G=m[u+1];s.fromArray(b,x*3),l.fromArray(b,G*3);var _=w[Math.floor(u/3)]!==void 0?w[Math.floor(u/3)]:1,re=e.params.Line.threshold+this.material.lineWidth*_/2,H=re*re,ne=i.distanceSqToSegment(s,l,t,h);if(!(ne>H)){t.applyMatrix4(this.matrixWorld);var ce=e.ray.origin.distanceTo(t);ce<e.near||ce>e.far||(n.push({distance:ce,point:h.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}),u=O)}}}}xe.prototype.raycast=Ke,xe.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]},xe.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},xe.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 f.BufferAttribute(new Float32Array(this.positions),3),previous:new f.BufferAttribute(new Float32Array(this.previous),3),next:new f.BufferAttribute(new Float32Array(this.next),3),side:new f.BufferAttribute(new Float32Array(this.side),1),width:new f.BufferAttribute(new Float32Array(this.width),1),uv:new f.BufferAttribute(new Float32Array(this.uvs),2),index:new f.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new f.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function De(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}xe.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;De(n,0,r,0,a),De(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,De(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},f.ShaderChunk.meshline_vert=lt,f.ShaderChunk.meshline_frag=ft;var Ve=function(e){"use strict";P(r,e);var n=W(r);function r(i){L(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},f.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new f.Color(16777215)},opacity:{value:1},resolution:{value:new f.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new f.Vector2(1,1)},offset:{value:new f.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new f.Vector2(0,0)},lightColor:{value:new f.Color(16777215)}}),vertexShader:f.ShaderChunk.meshline_vert,fragmentShader:f.ShaderChunk.meshline_frag}),a.isMeshLineMaterial=!0,a.type="MeshLineMaterial",Object.defineProperties(C(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}(f.ShaderMaterial);Ve.prototype.copy=function(e){return f.ShaderMaterial.prototype.copy.call(this,e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this};function ht(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 Xe(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function pt(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 vt(e,n){if(e==null)return{};var r=pt(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}function dt(e){if(Array.isArray(e))return e}function mt(){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 ye(e,n){return dt(e)||Q(e,n)||ae(e,n)||mt()}var gt=e=>{var n={};return Z.d(n,e),n},pr=e=>()=>e,He=gt({animate:()=>ot.animate,linear:()=>ot.linear}),yt=e=>{var n={};return Z.d(n,e),n},vr=e=>()=>e,je=yt({mergeBufferGeometries:()=>Xt.mergeBufferGeometries});function $e(e){var n=e.setPointWidth,r=e.nodes,i=new f.BufferGeometry,a=new xe;return i.setFromPoints(r),a.setGeometry(i,n),a}var _t={color:new f.Color("#ffffff"),lineWidth:1},bt=function(e){"use strict";P(r,e);var n=W(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,E.Z)({},_t,a),t}var i=r.prototype;return i.create=function(){var t=this;return(0,R.Z)(U().mark(function o(){var s,l,h,v,d,g,m,b,w,u,O,x,G,_,re,H,ne,ce,de,pe;return U().wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:if(s=t.options,l=s.duration,h=s.delay,v=s.onComplete,d=s.setPointWidth,g=s.key,m=s.nodes,b=s.nodesArr,w=s.geometry,u=s.geometryArr,O=s.useGroups,x=s.material,G=s.cache,_=s.cacheKey,re=vt(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),H=x,ne=w,H){ie.next=16;break}if(ce="LineMaterial:".concat(_),G&&!G.get(ce)&&(G.init(ce),de=t.getMaterial((0,E.Z)({},re)),G.set(ce,de)),!G){ie.next=12;break}return ie.next=9,G.get(ce);case 9:ie.t0=ie.sent,ie.next=15;break;case 12:return ie.next=14,t.getMaterial(re);case 14:ie.t0=ie.sent;case 15:H=ie.t0;case 16:!ne&&m?ne=$e({nodes:m,setPointWidth:d}):!ne&&b?ne=je.mergeBufferGeometries(b.map(function(Le){return $e({nodes:Le,setPointWidth:d})}),O!=null?O:!1):!ne&&u&&u.length>1?ne=je.mergeBufferGeometries(u,O!=null?O:!1):!ne&&u&&u.length===1&&(pe=ye(u,1),ne=pe[0]),t.createMesh(ne,H);case 18:case"end":return ie.stop()}},o)}))()},i.getMaterial=function(t){var o=this.pencil.getSize(),s=o.width,l=o.height,h=new Ve(Xe((0,E.Z)({},t),{resolution:new f.Vector2(s,l)}));return h},i.addGeometries=function(t){var o=this.object3d,s=je.mergeBufferGeometries([o.geometry].concat(N(t)),!1);o.geometry=s},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,l=t.onComplete,h=this.material.uniforms.offset,v=s!=null?s:0,d=(0,He.animate)({from:h.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-v,repeat:1/0,onComplete:l,ease:He.linear,onUpdate:function(g){h.value.x=g.x}});this.tween=d},i.dispose=function(){var t;Ce(F(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},V(r,[{key:"material",get:function(){return this.object3d.material}}]),r}(A);function wt(e){var n=e.worker,r=e.workerKey,i=e.coordinatesArr,a=e.lineWidth,t=e.projection,o=e.cacheVersion;return new Promise(function(s,l){n.postMessage({coordinatesArr:i,lineWidth:a,projection:t,workerKey:r},{cb:function(h){try{var v=new f.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?v.setIndex(new f.BufferAttribute(h[d].array,h[d].itemSize)):v.setAttribute(d,new f.BufferAttribute(h[d].array,h[d].itemSize))}),s(v)}catch(d){n.postMessage({delCache:!0,workerKey:r},{cb:l,cacheVersion:o})}},cacheVersion:o})})}var xt=e=>{var n={};return Z.d(n,e),n},dr=e=>()=>e,ke=xt({extent:()=>Fe.extent,mean:()=>Fe.mean,merge:()=>Fe.merge}),Mt=e=>{var n={};return Z.d(n,e),n},mr=e=>()=>e,Ue=Mt({default:()=>Ht.default}),At=e=>{var n={};return Z.d(n,e),n},gr=e=>()=>e,Pt=At({default:()=>$t.default});function St(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 Ot=e=>{var n={};return Z.d(n,e),n},yr=e=>()=>e,Ct=Ot({default:()=>Yt.default}),Et=e=>{var n={};return Z.d(n,e),n},_r=e=>()=>e,Lt=Et({default:()=>Jt.default}),jt=e=>{var n={};return Z.d(n,e),n},br=e=>()=>e,Te=jt({geoBounds:()=>We.geoBounds,geoContains:()=>We.geoContains,geoDistance:()=>We.geoDistance,geoInterpolate:()=>We.geoInterpolate}),kt=e=>{var n={};return Z.d(n,e),n},wr=e=>()=>e,Tt=kt({geoVoronoi:()=>Qt.geoVoronoi}),Rt=e=>{var n={};return Z.d(n,e),n},xr=e=>()=>e,Ye=Rt({scaleLinear:()=>qt.scaleLinear});function Bt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Te.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,Te.geoInterpolate)(a,t),l=1/Math.ceil(o/n),h=l;h<1;)i.push(s(h)),h+=l}i.push(a=t)}),i})}function Gt(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,l=function(u){return u/s*360%360-180},h=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},v=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},d=[t!==void 0?Math.ceil(v(t)):0,a!==void 0?Math.floor(v(a)):o-1],g=r===void 0&&i===void 0?function(){return!0}:r===void 0?function(u){return u<=i}:i===void 0?function(u){return u>=r}:i>=r?function(u){return u>=r&&u<=i}:function(u){return u>=r||u<=i},m=[],b=d[0];b<=d[1];b++){var w=l(b);g(w)&&m.push([w,h(b)])}return m}function Ne(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Te.geoContains)(n,e):(0,Lt.default)(e,n)}function Wt(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,Te.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],s=ye(i[1],2),l=s[0],h=s[1];if(Math.min(Math.abs(l-t),Math.abs(h-o))<n)return[];var v=t>l||h>=89||o<=-89;return Gt(n,{minLng:t,maxLng:l,minLat:o,maxLat:h}).filter(function(d){return Ne(d,r,v)})}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=Bt(e,i),t=(0,ke.merge)(a),o=Wt(e,i),s=N(t).concat(N(o)),l={type:"Polygon",coordinates:e},h=ye((0,Te.geoBounds)(l),2),v=ye(h[0],2),d=v[0],g=v[1],m=ye(h[1],2),b=m[0],w=m[1],u=d>b||w>=89||g<=-89,O=[];if(u){var x=(0,Tt.geoVoronoi)(s).triangles(),G=new Map(s.map(function(I,Me){var _e=ye(I,2),be=_e[0],Be=_e[1];return["".concat(be,"-").concat(Be),Me]}));x.features.forEach(function(I){var Me,_e=I.geometry.coordinates[0].slice(0,3).reverse(),be=[];if(_e.forEach(function(Ge){var Ae=ye(Ge,2),Ze=Ae[0],Zt=Ae[1],nt="".concat(Ze,"-").concat(Zt);G.has(nt)&&be.push(G.get(nt))}),be.length===3){if(be.some(function(Ge){return Ge<t.length})){var Be=I.properties.circumcenter;if(!Ne(Be,l,u))return}(Me=O).push.apply(Me,N(be))}})}else if(o.length)for(var ce=function(I,Me){var _e,be=[2,1,0].map(function(Ae){return de.triangles[I+Ae]}),Be=be.map(function(Ae){return s[Ae]});if(be.some(function(Ae){return Ae<t.length})){var Ge=[0,1].map(function(Ae){return(0,ke.mean)(Be,function(Ze){return Ze[Ae]})});if(!Ne(Ge,l,u))return"continue"}(_e=O).push.apply(_e,N(be))},de=Ct.default.from(s),pe=0,Se=de.triangles.length;pe<Se;pe+=3)ce(pe,Se);else{var _=Ue.default.flatten(a),re=_.vertices,H=_.holes,ne=H===void 0?[]:H;O=(0,Ue.default)(re,ne,2)}var ie=(0,Ye.scaleLinear)((0,ke.extent)(s,function(I){return I[0]}),[0,1]),Le=(0,Ye.scaleLinear)((0,ke.extent)(s,function(I){return I[1]}),[0,1]),Re=s.map(function(I){var Me=ye(I,2),_e=Me[0],be=Me[1];return[ie(_e),Le(be)]}),rt={points:s,indices:O,uvs:Re};return{contour:a,triangles:rt}}var Dt=zt,Je=new f.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=ye(t,2),s=o[0],l=o[1];return r?St(s,l,n):[s,l,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),l=s.vertices,h=(0,ke.merge)([l,t]),v=Math.round(l.length/3),d=new Set(o),g=0,m=[],b=0;b<v;b++){var w=b+1;if(w===v)w=g;else if(d.has(w)){var u=w;w=g,g=u}m.push(b,b+v,w+v),m.push(w+v,w,b)}for(var O=[],x=1;x>=0;x--)for(var G=0;G<v;G+=1)O.push(G/(v-1),x);return{indices:m,vertices:h,uvs:O,topVerts:l}}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 Vt=function(e){"use strict";P(r,e);var n=W(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,E.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,l=o.endHeight,h=o.closedBottom,v=o.closedTop,d=o.includeSides,g=o.curvatureResolution,m=o.cartesian,b=o.userDataRsoOffset;(0,Pt.default)(i[0])||i[0].reverse();var w=Dt(i,{resolution:g}),u=w.contour,O=w.triangles,x=(0,ke.merge)(O.uvs),G=[],_=[],re=[],H=0,ne=function(de){var pe=Math.round(G.length/3),Se=re.length;G=G.concat(de.vertices),_=_.concat(de.uvs),re=re.concat(pe?de.indices.map(function(ie){return ie+pe}):de.indices),t.addGroup(Se,re.length-Se,H++)};if(d){var ce=Qe(u,s,l,m);ne(ce),t.userData.rso=b?Qe(u,s,l+b,m):ce}return h&&ne(qe(O,s,x,!1,m)),v&&ne(qe(O,l,x,!0,m)),t.setIndex(re),t[Je]("position",new f.Float32BufferAttribute(G,3)),t[Je]("uv",new f.Float32BufferAttribute(_,2)),t.computeVertexNormals(),t}return r}(f.BufferGeometry),Ut=function(e){"use strict";P(r,e);var n=W(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=(0,E.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,l=t.closedBottom,h=t.closedTop,v=t.curvatureResolution,d=t.userDataRsoOffset,g=t.cartesian,m=new Vt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:l,closedTop:h,curvatureResolution:v,cartesian:g,userDataRsoOffset:d});this.createMesh(m,this.options.material)},r}(A),et=Z(705);function tt(e){var n=e.split,r=e.depth,i=e.points,a=e.box3,t=new f[ee](new f.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,et.y)({split:n,box3:a})});return(0,et.C)(),t}var Nt=function(e){"use strict";P(r,e);var n=W(r);function r(a){L(this,r);var t;return t=n.call(this),t.options=Xe((0,E.Z)({depth:1},a),{materialOptions:(0,E.Z)({},{split:.1},a.materialOptions||{})}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,R.Z)(U().mark(function o(){var s,l,h,v,d,g,m,b,w,u,O,x,G,_,re,H,ne,ce,de,pe,Se,ie,Le,Re;return U().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(s=t.options,l=s.points,h=s.pointsArr,v=s.useGroups,d=s.depth,g=s.geometry,m=s.geometryArr,b=s.material,w=s.materialOptions,u=s.cache,O=s.box3,x=0,G=Array.isArray(d)?d:[d],_=Array.isArray(O)?O:[O],re=b,H=g,!(!re&&w)){I.next=26;break}if(x=w.split,ne=w.topColor,ce=w.sideColor,de=w.sideMap,pe="ExtrudePolygonMaterial:".concat(ce||de).concat(ne||""),!(u&&!u.get(pe))){I.next=16;break}return u.init(pe),I.next=14,t.getMaterial(w);case 14:Se=I.sent,u.set(pe,Se);case 16:if(!u){I.next=22;break}return I.next=19,u.get(pe);case 19:I.t0=I.sent,I.next=25;break;case 22:return I.next=24,t.getMaterial(w);case 24:I.t0=I.sent;case 25:re=I.t0;case 26:!H&&l?H=tt({points:l,depth:G[0],split:x,box3:_[0]}):!H&&h?H=je.mergeBufferGeometries(h.map(function(Me,_e){return tt({points:Me,depth:(ie=G[_e])!==null&&ie!==void 0?ie:G[0],split:x,box3:(Le=_[_e])!==null&&Le!==void 0?Le:_[0]})}),v!=null?v:!1):!H&&m&&m.length>1?H=je.mergeBufferGeometries(m,v!=null?v:!1):!H&&m&&m.length===1&&(Re=ye(m,1),H=Re[0]),t.createMesh(H,re);case 28:case"end":return I.stop()}},o)}))()},i.addGeometries=function(t){var o=this.object3d,s=je.mergeBufferGeometries([o.geometry].concat(N(t)),!1);o.geometry=s},i.getMaterial=function(t){var o=this,s=t.topColor,l=t.sideColor,h=t.sideMap,v=t.type,d=t.parameters,g=t.createCanvasObjectURL,m=t.split,b=t.maxAnisotropy;return new Promise(function(w){var u=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var O=m,x=document.createElement("canvas"),G=x.getContext("2d");x.height=u.height/(1-O),x.width=u.width,O&&s&&(G.fillStyle=s,G.fillRect(0,0,u.width,x.height*O)),h&&u instanceof HTMLImageElement?G.drawImage(u,0,x.height*O,u.width,u.height):l&&(G.fillStyle=l,G.fillRect(0,x.height*O,u.width,u.height)),g&&x.toBlob(function(H){console.log(URL.createObjectURL(H))});var _=new f.CanvasTexture(x);_.anisotropy=b||o.pencil.renderer.capabilities.getMaxAnisotropy();var re=new f[v||"MeshBasicMaterial"]((0,E.Z)({map:_},d||{}));w(re)},h?u.src=h:u instanceof HTMLImageElement||u.onload()})},i.setMaterialColor=function(t){var o=this;return(0,R.Z)(U().mark(function s(){var l,h,v,d,g,m,b,w,u,O,x;return U().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(l=o.options,h=l.materialOptions,v=l.cache,d=h.sideColor,g=h.sideMap,m=h.topColor,b=t.sideColor,w=t.topColor,!(w||b)){_.next=22;break}if(u="ExtrudePolygonMaterial:".concat(b||d||g||"").concat(w||m||""),!(v&&!v.get(u))){_.next=11;break}return v.init(u),_.next=9,o.getMaterial((0,E.Z)({},h,t));case 9:O=_.sent,v.set(u,O);case 11:if(!v){_.next=17;break}return _.next=14,v.get(u);case 14:_.t0=_.sent,_.next=20;break;case 17:return _.next=19,o.getMaterial((0,E.Z)({},h,t));case 19:_.t0=_.sent;case 20:x=_.t0,o.object3d.material=x;case 22:case"end":return _.stop()}},s)}))()},r}(A);function It(e){var n=e.worker,r=e.workerKey,i=e.coordinatesArr,a=e.depth,t=e.split,o=e.projection,s=e.cacheVersion;return new Promise(function(l,h){n.postMessage({coordinatesArr:i,depth:a,split:t!=null?t:.1,projection:o,workerKey:r},{cb:function(v){try{var d=new f.BufferGeometry;Object.keys(v).forEach(function(g){d.setAttribute(g,new f.BufferAttribute(v[g].array,v[g].itemSize))}),l(d)}catch(g){n.postMessage({delCache:!0,workerKey:r},{cb:h,cacheVersion:s})}},cacheVersion:s})})}})();var tr=me.Ei,rr=me.Yo,nr=me.ZA,ir=me.Ee,ar=me.x1,or=me.VJ,sr=me.r7,ur=me.XA,cr=me.NB,lr=me.nk,fr=me.JX,hr=me.TQ;export{tr as ConicPolygon,rr as ExtrudePolygon,nr as Group,ir as Image,ar as Line,or as MeshLine,sr as MeshLineMaterial,ur as MeshLineRaycast,cr as Node,lr as Video,fr as getExtrudePolygonGeometry,hr as getLineGeometry};
|
|
132
|
+
`),xe=function(e){"use strict";P(r,e);var n=j(r);function r(){k(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(oe(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);xe.prototype.setMatrixWorld=function(e){this.matrixWorld=e},xe.prototype.setGeometry=function(e,n){this._geometry=e,this.setPoints(e.getAttribute("position").array,n)},xe.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 He(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,f=new u.Vector3,h=new u.Vector3,v=this instanceof u.LineSegments?2:1,d=o.index,w=o.attributes;if(d!==null)for(var g=d.array,b=w.position.array,_=w.width.array,c=0,m=g.length-1;c<m;c+=v){var R=g[c],D=g[c+1];s.fromArray(b,R*3),f.fromArray(b,D*3);var A=_[Math.floor(c/3)]!==void 0?_[Math.floor(c/3)]:1,te=e.params.Line.threshold+this.material.lineWidth*A/2,X=te*te,re=i.distanceSqToSegment(s,f,t,h);if(!(re>X)){t.applyMatrix4(this.matrixWorld);var le=e.ray.origin.distanceTo(t);le<e.near||le>e.far||(n.push({distance:le,point:h.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}),c=m)}}}}xe.prototype.raycast=He,xe.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]},xe.prototype.copyV3=function(e){var n=e*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]},xe.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 Ue(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}xe.prototype.advance=function(e){var n=this._attributes.position.array,r=this._attributes.previous.array,i=this._attributes.next.array,a=n.length;Ue(n,0,r,0,a),Ue(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,Ue(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=vt,u.ShaderChunk.meshline_frag=dt;var Ne=function(e){"use strict";P(r,e);var n=j(r);function r(i){k(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(oe(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);Ne.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 mt(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 $e(e,n){return n=n!=null?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}),e}function gt(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 yt(e,n){if(e==null)return{};var r=gt(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}function _t(e){if(Array.isArray(e))return e}function bt(){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 ye(e,n){return _t(e)||ee(e,n)||ge(e,n)||bt()}var wt=e=>{var n={};return I.d(n,e),n},yr=e=>()=>e,Ye=wt({animate:()=>ut.animate,linear:()=>ut.linear}),xt=e=>{var n={};return I.d(n,e),n},_r=e=>()=>e,je=xt({mergeBufferGeometries:()=>Jt.mergeBufferGeometries});function Je(e){var n=e.setPointWidth,r=e.nodes,i=new u.BufferGeometry,a=new xe;return i.setFromPoints(r),a.setGeometry(i,n),a}var Mt={color:new u.Color("#ffffff"),lineWidth:1},At=function(e){"use strict";P(r,e);var n=j(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(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;return(0,S.Z)(G().mark(function o(){var s,f,h,v,d,w,g,b,_,c,m,R,D,A,te,X,re,le,me,he;return G().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:if(s=t.options,f=s.duration,h=s.delay,v=s.onComplete,d=s.setPointWidth,w=s.key,g=s.nodes,b=s.nodesArr,_=s.geometry,c=s.geometryArr,m=s.useGroups,R=s.material,D=s.cache,A=s.cacheKey,te=yt(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),X=R,re=_,X){ne.next=16;break}if(le="LineMaterial:".concat(A),D&&!D.get(le)&&(D.init(le),me=t.getMaterial((0,x.Z)({},te)),D.set(le,me)),!D){ne.next=12;break}return ne.next=9,D.get(le);case 9:ne.t0=ne.sent,ne.next=15;break;case 12:return ne.next=14,t.getMaterial(te);case 14:ne.t0=ne.sent;case 15:X=ne.t0;case 16:!re&&g?re=Je({nodes:g,setPointWidth:d}):!re&&b?re=je.mergeBufferGeometries(b.map(function(Ee){return Je({nodes:Ee,setPointWidth:d})}),m!=null?m:!1):!re&&c&&c.length>1?re=je.mergeBufferGeometries(c,m!=null?m:!1):!re&&c&&c.length===1&&(he=ye(c,1),re=he[0]),t.createMesh(re,X);case 18:case"end":return ne.stop()}},o)}))()},i.getMaterial=function(t){var o=this.pencil.getSize(),s=o.width,f=o.height,h=new Ne($e((0,x.Z)({},t),{resolution:new u.Vector2(s,f)}));return h},i.addGeometries=function(t){var o=this.object3d,s=je.mergeBufferGeometries([o.geometry].concat(V(t)),!1);o.geometry=s},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,f=t.onComplete,h=this.material.uniforms.offset,v=s!=null?s:0,d=(0,Ye.animate)({from:h.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-v,repeat:1/0,onComplete:f,ease:Ye.linear,onUpdate:function(w){h.value.x=w.x}});this.tween=d},i.dispose=function(){var t;Ve(T(r.prototype),"dispose",this).call(this),(t=this.tween)===null||t===void 0||t.stop()},$(r,[{key:"material",get:function(){return this.object3d.material}}]),r}(q);function Pt(e){var n=e.worker,r=e.workerKey,i=e.coordinatesArr,a=e.lineWidth,t=e.projection,o=e.cacheVersion;return new Promise(function(s,f){n.postMessage({coordinatesArr:i,lineWidth:a,projection:t,workerKey:r},{cb:function(h){try{var v=new u.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?v.setIndex(new u.BufferAttribute(h[d].array,h[d].itemSize)):v.setAttribute(d,new u.BufferAttribute(h[d].array,h[d].itemSize))}),s(v)}catch(d){n.postMessage({delCache:!0,workerKey:r},{cb:f,cacheVersion:o})}},cacheVersion:o})})}var St=e=>{var n={};return I.d(n,e),n},br=e=>()=>e,ke=St({extent:()=>Xe.extent,mean:()=>Xe.mean,merge:()=>Xe.merge}),Ot=e=>{var n={};return I.d(n,e),n},wr=e=>()=>e,Ie=Ot({default:()=>Qt.default}),Ct=e=>{var n={};return I.d(n,e),n},xr=e=>()=>e,Et=Ct({default:()=>qt.default});function Lt(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 jt=e=>{var n={};return I.d(n,e),n},Mr=e=>()=>e,kt=jt({default:()=>er.default}),Tt=e=>{var n={};return I.d(n,e),n},Ar=e=>()=>e,Rt=Tt({default:()=>tr.default}),Bt=e=>{var n={};return I.d(n,e),n},Pr=e=>()=>e,Te=Bt({geoBounds:()=>ze.geoBounds,geoContains:()=>ze.geoContains,geoDistance:()=>ze.geoDistance,geoInterpolate:()=>ze.geoInterpolate}),Gt=e=>{var n={};return I.d(n,e),n},Sr=e=>()=>e,Wt=Gt({geoVoronoi:()=>rr.geoVoronoi}),zt=e=>{var n={};return I.d(n,e),n},Or=e=>()=>e,Qe=zt({scaleLinear:()=>nr.scaleLinear});function Dt(e,n){return e.map(function(r){var i=[],a;return r.forEach(function(t){if(a){var o=(0,Te.geoDistance)(t,a)*180/Math.PI;if(o>n)for(var s=(0,Te.geoInterpolate)(a,t),f=1/Math.ceil(o/n),h=f;h<1;)i.push(s(h)),h+=f}i.push(a=t)}),i})}function Vt(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,f=function(c){return c/s*360%360-180},h=function(c){return Math.acos(2*c/o-1)/Math.PI*180-90},v=function(c){return o*(Math.cos((c+90)*Math.PI/180)+1)/2},d=[t!==void 0?Math.ceil(v(t)):0,a!==void 0?Math.floor(v(a)):o-1],w=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},g=[],b=d[0];b<=d[1];b++){var _=f(b);w(_)&&g.push([_,h(b)])}return g}function Ze(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?(0,Te.geoContains)(n,e):(0,Rt.default)(e,n)}function Ut(e,n){var r={type:"Polygon",coordinates:e},i=ye((0,Te.geoBounds)(r),2),a=ye(i[0],2),t=a[0],o=a[1],s=ye(i[1],2),f=s[0],h=s[1];if(Math.min(Math.abs(f-t),Math.abs(h-o))<n)return[];var v=t>f||h>=89||o<=-89;return Vt(n,{minLng:t,maxLng:f,minLat:o,maxLat:h}).filter(function(d){return Ze(d,r,v)})}function Nt(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.resolution,i=r===void 0?1/0:r,a=Dt(e,i),t=(0,ke.merge)(a),o=Ut(e,i),s=V(t).concat(V(o)),f={type:"Polygon",coordinates:e},h=ye((0,Te.geoBounds)(f),2),v=ye(h[0],2),d=v[0],w=v[1],g=ye(h[1],2),b=g[0],_=g[1],c=d>b||_>=89||w<=-89,m=[];if(c){var R=(0,Wt.geoVoronoi)(s).triangles(),D=new Map(s.map(function(N,Me){var _e=ye(N,2),be=_e[0],Be=_e[1];return["".concat(be,"-").concat(Be),Me]}));R.features.forEach(function(N){var Me,_e=N.geometry.coordinates[0].slice(0,3).reverse(),be=[];if(_e.forEach(function(Ge){var Ae=ye(Ge,2),Ke=Ae[0],Ht=Ae[1],at="".concat(Ke,"-").concat(Ht);D.has(at)&&be.push(D.get(at))}),be.length===3){if(be.some(function(Ge){return Ge<t.length})){var Be=N.properties.circumcenter;if(!Ze(Be,f,c))return}(Me=m).push.apply(Me,V(be))}})}else if(o.length)for(var le=function(N,Me){var _e,be=[2,1,0].map(function(Ae){return me.triangles[N+Ae]}),Be=be.map(function(Ae){return s[Ae]});if(be.some(function(Ae){return Ae<t.length})){var Ge=[0,1].map(function(Ae){return(0,ke.mean)(Be,function(Ke){return Ke[Ae]})});if(!Ze(Ge,f,c))return"continue"}(_e=m).push.apply(_e,V(be))},me=kt.default.from(s),he=0,Se=me.triangles.length;he<Se;he+=3)le(he,Se);else{var A=Ie.default.flatten(a),te=A.vertices,X=A.holes,re=X===void 0?[]:X;m=(0,Ie.default)(te,re,2)}var ne=(0,Qe.scaleLinear)((0,ke.extent)(s,function(N){return N[0]}),[0,1]),Ee=(0,Qe.scaleLinear)((0,ke.extent)(s,function(N){return N[1]}),[0,1]),Re=s.map(function(N){var Me=ye(N,2),_e=Me[0],be=Me[1];return[ne(_e),Ee(be)]}),it={points:s,indices:m,uvs:Re};return{contour:a,triangles:it}}var It=Nt,qe=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function Fe(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=ye(t,2),s=o[0],f=o[1];return r?Lt(s,f,n):[s,f,n]})});return Ie.default.flatten(i)}function et(e,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Fe(e,n,i),t=a.vertices,o=a.holes,s=Fe(e,r,i),f=s.vertices,h=(0,ke.merge)([f,t]),v=Math.round(f.length/3),d=new Set(o),w=0,g=[],b=0;b<v;b++){var _=b+1;if(_===v)_=w;else if(d.has(_)){var c=_;_=w,w=c}g.push(b,b+v,_+v),g.push(_+v,_,b)}for(var m=[],R=1;R>=0;R--)for(var D=0;D<v;D+=1)m.push(D/(v-1),R);return{indices:g,vertices:h,uvs:m,topVerts:f}}function tt(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:Fe([e.points],n,a).vertices,uvs:r}}var Zt=function(e){"use strict";P(r,e);var n=j(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(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,f=o.endHeight,h=o.closedBottom,v=o.closedTop,d=o.includeSides,w=o.curvatureResolution,g=o.cartesian,b=o.userDataRsoOffset;(0,Et.default)(i[0])||i[0].reverse();var _=It(i,{resolution:w}),c=_.contour,m=_.triangles,R=(0,ke.merge)(m.uvs),D=[],A=[],te=[],X=0,re=function(me){var he=Math.round(D.length/3),Se=te.length;D=D.concat(me.vertices),A=A.concat(me.uvs),te=te.concat(he?me.indices.map(function(ne){return ne+he}):me.indices),t.addGroup(Se,te.length-Se,X++)};if(d){var le=et(c,s,f,g);re(le),t.userData.rso=b?et(c,s,f+b,g):le}return h&&re(tt(m,s,R,!1,g)),v&&re(tt(m,f,R,!0,g)),t.setIndex(te),t[qe]("position",new u.Float32BufferAttribute(D,3)),t[qe]("uv",new u.Float32BufferAttribute(A,2)),t.computeVertexNormals(),t}return r}(u.BufferGeometry),Ft=function(e){"use strict";P(r,e);var n=j(r);function r(a){k(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,f=t.closedBottom,h=t.closedTop,v=t.curvatureResolution,d=t.userDataRsoOffset,w=t.cartesian,g=new Zt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:h,curvatureResolution:v,cartesian:w,userDataRsoOffset:d});this.createMesh(g,this.options.material)},r}(q),rt=I(705);function nt(e){var n=e.split,r=e.depth,i=e.points,a=e.box3,t=new u[ve](new u.Shape(i),{depth:r,bevelEnabled:!1,UVGenerator:(0,rt.y)({split:n,box3:a})});return(0,rt.C)(),t}var Kt=function(e){"use strict";P(r,e);var n=j(r);function r(a){k(this,r);var t;return t=n.call(this),t.options=$e((0,x.Z)({depth:1},a),{materialOptions:(0,x.Z)({},{split:.1},a.materialOptions||{})}),t}var i=r.prototype;return i.create=function(){var t=this;return(0,S.Z)(G().mark(function o(){var s,f,h,v,d,w,g,b,_,c,m,R,D,A,te,X,re,le,me,he,Se,ne,Ee,Re;return G().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(s=t.options,f=s.points,h=s.pointsArr,v=s.useGroups,d=s.depth,w=s.geometry,g=s.geometryArr,b=s.material,_=s.materialOptions,c=s.cache,m=s.box3,R=0,D=Array.isArray(d)?d:[d],A=Array.isArray(m)?m:[m],te=b,X=w,!(!te&&_)){N.next=26;break}if(R=_.split,re=_.topColor,le=_.sideColor,me=_.sideMap,he="ExtrudePolygonMaterial:".concat(le||me).concat(re||""),!(c&&!c.get(he))){N.next=16;break}return c.init(he),N.next=14,t.getMaterial(_);case 14:Se=N.sent,c.set(he,Se);case 16:if(!c){N.next=22;break}return N.next=19,c.get(he);case 19:N.t0=N.sent,N.next=25;break;case 22:return N.next=24,t.getMaterial(_);case 24:N.t0=N.sent;case 25:te=N.t0;case 26:!X&&f?X=nt({points:f,depth:D[0],split:R,box3:A[0]}):!X&&h?X=je.mergeBufferGeometries(h.map(function(Me,_e){return nt({points:Me,depth:(ne=D[_e])!==null&&ne!==void 0?ne:D[0],split:R,box3:(Ee=A[_e])!==null&&Ee!==void 0?Ee:A[0]})}),v!=null?v:!1):!X&&g&&g.length>1?X=je.mergeBufferGeometries(g,v!=null?v:!1):!X&&g&&g.length===1&&(Re=ye(g,1),X=Re[0]),t.createMesh(X,te);case 28:case"end":return N.stop()}},o)}))()},i.addGeometries=function(t){var o=this.object3d,s=je.mergeBufferGeometries([o.geometry].concat(V(t)),!1);o.geometry=s},i.getMaterial=function(t){var o=this,s=t.topColor,f=t.sideColor,h=t.sideMap,v=t.type,d=t.parameters,w=t.createCanvasObjectURL,g=t.split,b=t.maxAnisotropy;return new Promise(function(_){var c=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};c.onload=function(){var m=g,R=document.createElement("canvas"),D=R.getContext("2d");R.height=c.height/(1-m),R.width=c.width,m&&s&&(D.fillStyle=s,D.fillRect(0,0,c.width,R.height*m)),h&&c instanceof HTMLImageElement?D.drawImage(c,0,R.height*m,c.width,c.height):f&&(D.fillStyle=f,D.fillRect(0,R.height*m,c.width,c.height)),w&&R.toBlob(function(X){console.log(URL.createObjectURL(X))});var A=new u.CanvasTexture(R);A.anisotropy=b||o.pencil.renderer.capabilities.getMaxAnisotropy();var te=new u[v||"MeshBasicMaterial"]((0,x.Z)({map:A},d||{}));_(te)},h?c.src=h:c instanceof HTMLImageElement||c.onload()})},i.setMaterialColor=function(t){var o=this;return(0,S.Z)(G().mark(function s(){var f,h,v,d,w,g,b,_,c,m,R;return G().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(f=o.options,h=f.materialOptions,v=f.cache,d=h.sideColor,w=h.sideMap,g=h.topColor,b=t.sideColor,_=t.topColor,!(_||b)){A.next=22;break}if(c="ExtrudePolygonMaterial:".concat(b||d||w||"").concat(_||g||""),!(v&&!v.get(c))){A.next=11;break}return v.init(c),A.next=9,o.getMaterial((0,x.Z)({},h,t));case 9:m=A.sent,v.set(c,m);case 11:if(!v){A.next=17;break}return A.next=14,v.get(c);case 14:A.t0=A.sent,A.next=20;break;case 17:return A.next=19,o.getMaterial((0,x.Z)({},h,t));case 19:A.t0=A.sent;case 20:R=A.t0,o.object3d.material=R;case 22:case"end":return A.stop()}},s)}))()},r}(q);function Xt(e){var n=e.worker,r=e.workerKey,i=e.coordinatesArr,a=e.depth,t=e.split,o=e.projection,s=e.cacheVersion;return new Promise(function(f,h){n.postMessage({coordinatesArr:i,depth:a,split:t!=null?t:.1,projection:o,workerKey:r},{cb:function(v){try{var d=new u.BufferGeometry;Object.keys(v).forEach(function(w){d.setAttribute(w,new u.BufferAttribute(v[w].array,v[w].itemSize))}),f(d)}catch(w){n.postMessage({delCache:!0,workerKey:r},{cb:h,cacheVersion:s})}},cacheVersion:s})})}})();var ar=de.Ei,or=de.Yo,sr=de.ZA,ur=de.Ee,cr=de.x1,lr=de.VJ,fr=de.r7,hr=de.XA,pr=de.NB,vr=de.xv,dr=de.nk,mr=de.JX,gr=de.TQ;export{ar as ConicPolygon,or as ExtrudePolygon,sr as Group,ur as Image,cr as Line,lr as MeshLine,fr as MeshLineMaterial,hr as MeshLineRaycast,pr as Node,vr as Text,dr as Video,mr as getExtrudePolygonGeometry,gr as getLineGeometry};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import Image from '../../objects/image/index';
|
|
3
|
+
declare type Options = Image['options'] & {
|
|
4
|
+
text: string;
|
|
5
|
+
textOptions?: Record<string, any>;
|
|
6
|
+
};
|
|
7
|
+
export default class extends Image {
|
|
8
|
+
options: Options;
|
|
9
|
+
canvas: HTMLCanvasElement;
|
|
10
|
+
constructor(options: Options);
|
|
11
|
+
getTexture(): Promise<THREE.Texture>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -19,8 +19,10 @@ export default class extends BaseObject {
|
|
|
19
19
|
options: Options & {
|
|
20
20
|
autoPlay: boolean;
|
|
21
21
|
loop: boolean;
|
|
22
|
+
scale: number;
|
|
22
23
|
};
|
|
23
24
|
video: HTMLVideoElement;
|
|
25
|
+
scale: number;
|
|
24
26
|
constructor(options: Options);
|
|
25
27
|
getMaterial(): Promise<any>;
|
|
26
28
|
create(): Promise<void>;
|