gl-draw 0.8.26 → 0.8.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/objects/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var nt={666:function(L){var B=function(x){"use strict";var C=Object.prototype,j=C.hasOwnProperty,G,k=typeof Symbol=="function"?Symbol:{},I=k.iterator||"@@iterator",Z=k.asyncIterator||"@@asyncIterator",D=k.toStringTag||"@@toStringTag";function _(p,l,m){return Object.defineProperty(p,l,{value:m,enumerable:!0,configurable:!0,writable:!0}),p[l]}try{_({},"")}catch(p){_=function(l,m,S){return l[m]=S}}function F(p,l,m,S){var P=l&&l.prototype instanceof c?l:c,X=Object.create(P.prototype),se=new V(S||[]);return X._invoke=fe(p,m,se),X}x.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",E={};function c(){}function O(){}function W(){}var R={};_(R,I,function(){return this});var le=Object.getPrototypeOf,te=le&&le(le(Se([])));te&&te!==C&&j.call(te,I)&&(R=te);var N=W.prototype=c.prototype=Object.create(R);O.prototype=W,_(N,"constructor",W),_(W,"constructor",O),O.displayName=_(W,D,"GeneratorFunction");function re(p){["next","throw","return"].forEach(function(l){_(p,l,function(m){return this._invoke(l,m)})})}x.isGeneratorFunction=function(p){var l=typeof p=="function"&&p.constructor;return l?l===O||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,W):(p.__proto__=W,_(p,D,"GeneratorFunction")),p.prototype=Object.create(N),p},x.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,Ce=Oe.value;return Ce&&typeof Ce=="object"&&j.call(Ce,"__await")?l.resolve(Ce.__await).then(function(Ae){m("next",Ae,he,de)},function(Ae){m("throw",Ae,he,de)}):l.resolve(Ce).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),_(ne.prototype,Z,function(){return this}),x.AsyncIterator=ne,x.async=function(p,l,m,S,P){P===void 0&&(P=Promise);var X=new ne(F(p,l,m,S),P);return x.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===E)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===E)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 E;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var S=H(m,p.iterator,l.arg);if(S.type==="throw")return l.method="throw",l.arg=S.arg,l.delegate=null,E;var P=S.arg;if(!P)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,E;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,E}re(N),_(N,D,"Generator"),_(N,I,function(){return this}),_(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 V(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(ie,this),this.reset(!0)}x.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(j.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}}x.values=Se;function Te(){return{value:G,done:!0}}return V.prototype={constructor:V,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"&&j.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=j.call(P,"catchLoc"),he=j.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&&j.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,E):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),E},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),E}},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),E}},x}(L.exports);try{regeneratorRuntime=B}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},695:function(L,B,x){"use strict";x.d(B,{Z:function(){return C}});function C(j){if(j.geometry&&j.geometry.dispose(),j.material){var G=Array.isArray(j.material)?j.material:[j.material];G.forEach(function(k){var I,Z,D,_,F,H,$,oe,ve,ce,E,c,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(),(_=k.normalMap)===null||_===void 0||_.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(),(E=k.gradientMap)===null||E===void 0||E.dispose(),(c=k.metalnessMap)===null||c===void 0||c.dispose(),(O=k.roughnessMap)===null||O===void 0||O.dispose(),k.dispose()})}}},584:function(L,B,x){"use strict";x.d(B,{disposeMesh:function(){return k.Z}});var C=x(666),j=x.n(C),G=null,k=x(695),I=x(644);function Z(E){if(E.material){var c=Array.isArray(E.material)?E.material:[E.material];c.forEach(function(O){var W,R;(W=O.color)===null||W===void 0||W.convertSRGBToLinear(),(R=O.emissive)===null||R===void 0||R.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var D=x(568),_=x(924),F=x(360),H=x(484),$=null,oe=null,ve=function(){var E=(0,D.Z)(j().mark(function c(O,W){var R,le,te,N,re,ne,fe,me,ie;return j().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return R=W.type,le=R===void 0?"blob":R,te=W.version,N=te===void 0?"1":te,V.next=4,(0,F.get)(O);case 4:if(ne=V.sent,!(ne&&ne[N])){V.next=9;break}re=ne[N],V.next=15;break;case 9:return V.next=11,(0,H.Z)(fetch(O).then(function(Se){if(Se.ok)return Se[le]();throw new Error}));case 11:fe=V.sent,me=fe.res,ie=fe.err,ie||(re=me,(0,F.set)(O,(0,_.Z)({},N,me)));case 15:return V.abrupt("return",re?{url:le==="json"?O:URL.createObjectURL(re),store:re}:{url:O});case 16:case"end":return V.stop()}},c)}));return function(O,W){return E.apply(this,arguments)}}(),ce=x(705)},484:function(L,B,x){"use strict";x.d(B,{Z:function(){return j}});var C=x(42);function j(G){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return G.then(function(I){return(0,C.Z)({err:null,res:I},k)}).catch(function(I){return(0,C.Z)({err:I,res:void 0},k)})}},705:function(L,B,x){"use strict";x.d(B,{C:function(){return I},y:function(){return k}});var C=x(644),j=x.n(C),G=new Map,k=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(D,_,F,H,$){var oe=_[F*3],ve=_[F*3+1],ce=_[H*3],E=_[H*3+1],c=_[$*3],O=_[$*3+1],W;if(G.has(D))W=G.get(D);else{var R=Z.box3||new C.Box3;if(!Z.box3){var le=D.parameters.shapes.getPoints();R.setFromArray(le.map(function(fe){return[fe.x,fe.y,0]}).flat())}var te=R.getSize(new C.Vector3);Z.split&&(te.y/=Z.split),W={box:R,size:te},G.set(D,W)}var N=W.box,re=W.size,ne=Z.split?1-Z.split:0;return[new C.Vector2((oe-N.min.x)/re.x,(ve-N.min.y)/re.y+ne),new C.Vector2((ce-N.min.x)/re.x,(E-N.min.y)/re.y+ne),new C.Vector2((c-N.min.x)/re.x,(O-N.min.y)/re.y+ne)]},generateSideWallUV:function(D,_,F,H,$,oe){var ve=_[F*3],ce=_[F*3+1],E=_[F*3+2],c=_[H*3],O=_[H*3+1],W=_[H*3+2],R=_[$*3],le=_[$*3+1],te=_[$*3+2],N=_[oe*3],re=_[oe*3+1],ne=_[oe*3+2],fe;if(G.has(_))fe=G.get(_);else{var me=new C.Box3;me.setFromArray(_);var ie=me.getSize(new C.Vector3);Z.split&&(ie.z/=1-Z.split),fe={box:me,size:ie},G.set(_,fe)}var q=fe.box,V=fe.size;return Math.abs(ce-O)<Math.abs(ve-c)?[new C.Vector2((ve-q.min.x)/V.x,(E-q.min.z)/V.z),new C.Vector2((c-q.min.x)/V.x,(W-q.min.z)/V.z),new C.Vector2((R-q.min.x)/V.x,(te-q.min.z)/V.z),new C.Vector2((N-q.min.x)/V.x,(ne-q.min.z)/V.z)]:[new C.Vector2((ce-q.min.y)/V.y,(E-q.min.z)/V.z),new C.Vector2((O-q.min.y)/V.y,(W-q.min.z)/V.z),new C.Vector2((le-q.min.y)/V.y,(te-q.min.z)/V.z),new C.Vector2((re-q.min.y)/V.y,(ne-q.min.z)/V.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,B,x){"use strict";x.d(B,{Z:function(){return j}});function C(G,k,I,Z,D,_,F){try{var H=G[_](F),$=H.value}catch(oe){I(oe);return}H.done?k($):Promise.resolve($).then(Z,D)}function j(G){return function(){var k=this,I=arguments;return new Promise(function(Z,D){var _=G.apply(k,I);function F($){C(_,Z,D,F,H,"next",$)}function H($){C(_,Z,D,F,H,"throw",$)}F(void 0)})}}},924:function(L,B,x){"use strict";x.d(B,{Z:function(){return C}});function C(j,G,k){return G in j?Object.defineProperty(j,G,{value:k,enumerable:!0,configurable:!0,writable:!0}):j[G]=k,j}},42:function(L,B,x){"use strict";x.d(B,{Z:function(){return j}});var C=x(924);function j(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,C.Z)(G,D,I[D])})}return G}}},Fe={};function Y(L){var B=Fe[L];if(B!==void 0)return B.exports;var x=Fe[L]={exports:{}};return nt[L](x,x.exports,Y),x.exports}(function(){Y.n=function(L){var B=L&&L.__esModule?function(){return L.default}:function(){return L};return Y.d(B,{a:B}),B}})(),function(){Y.d=function(L,B){for(var x in B)Y.o(B,x)&&!Y.o(L,x)&&Object.defineProperty(L,x,{enumerable:!0,get:B[x]})}}(),function(){Y.o=function(L,B){return Object.prototype.hasOwnProperty.call(L,B)}}(),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 Ce},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 B(t,i){return B=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},B(t,i)}function x(t,i){return B(t,i)}function C(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&x(t,i)}var j=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&&x(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 _(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,_(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),x(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 E(t){var i=$();return function(){var n=_(t),a;if(i){var e=_(this).constructor;a=Reflect.construct(n,arguments,e)}else a=n.apply(this,arguments);return ce(this,a)}}var c=Y(644),O=Y(568),W=Y(666),R=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 V(){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=V(),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(c.Mesh,ie(a)),this},i.createGroup=function(){return this.object3d=new c.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(c.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 c.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 c.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new c.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=+c.REVISION<144,P=S?"ExtrudeBufferGeometry":"ExtrudeGeometry",X=S?"PlaneBufferGeometry":"PlaneGeometry",se=function(t){"use strict";C(r,t);var i=E(r);function r(a){L(this,r);var e;return e=i.call(this),e.scale=1,e.options=(0,j.Z)({},{scale:1},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,O.Z)(R().mark(function o(){var s,f,h,v,d,w,y,A,b;return R().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,w=s.sprite,y=s.sizeAttenuation,g.next=3,e.getTexture();case 3:return A=g.sent,b=w?new c.SpriteMaterial({map:A,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:d!=null?d:0,sizeAttenuation:y!=null?y:!0}):new c.MeshBasicMaterial({map:A,transparent:f!=null?f:!1,blending:h!=null?h:c.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)(R().mark(function o(){var s,f,h,v,d,w,y,A,b;return R().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,w=s.sprite,y=v,!(d&&!d.get(y))){g.next=8;break}return d.init(y),g.next=6,e.getMaterial();case 6:A=g.sent,d.set(y,A);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,w?e.createSprite(b):e.createMesh(new c[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 c.TextureLoader().loadAsync(e)},r}(m),he=function(t){"use strict";C(r,t);var i=E(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,j.Z)({},{fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,color:"#ffffff",setCtx:function(z){}},s||{}),h=f.fontSize,v=f.fontFamily,d=f.fontWeight,w=f.flipX,y=f.color,A=f.setCtx,b=this.canvas;b.width=h*o.length*2,b.height=h;var u=b.getContext("2d");u.font="".concat(d," ").concat(h,"px/1 ").concat(v);var g=u.measureText(o).width;b.width=g,u=b.getContext("2d"),u.clearRect(0,0,b.width,b.height),w&&u.scale(-1,1),u.font="".concat(d," ").concat(h,"px/1 ").concat(v),u.textBaseline="middle",u.fillStyle=y,A&&A(u),u.fillText(o,w?g*-1:0,b.height/2),u.restore();var T=new c.Texture(b);return T.anisotropy=this.pencil.renderer.capabilities.getMaxAnisotropy(),T.needsUpdate=!0,Promise.resolve(T)},r}(H(se));function de(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=_(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 Ce=function(t){"use strict";C(r,t);var i=E(r);function r(a){L(this,r);var e;return e=i.call(this),e.scale=1,e.options=(0,j.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,w=e.loop,y=e.alphaTest,A=e.sprite,b=V(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var g=new c.VideoTexture(u);g.format=v!=null?v:c.RGBAFormat,g.needsUpdate=!0;var T=A?new c.SpriteMaterial({map:g,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:y!=null?y:0}):new c.MeshBasicMaterial({map:g,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:y!=null?y:0});b.resolve(T)},!1),u.src=o,u.muted=!0,u.autoplay=d,u.loop=w,u.preload="auto",b.promise},n.create=function(){var e=this;return(0,O.Z)(R().mark(function o(){var s,f,h,v,d,w,y,A;return R().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,f=s.scale,h=s.position,v=s.src,d=s.cache,w=s.sprite,!(d&&!d.get(v))){u.next=7;break}return d.init(v),u.next=5,e.getMaterial();case 5:y=u.sent,d.set(v,y);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:A=u.t0,e.video=A.map.image,w?e.createSprite(A):e.createMesh(new c[X](1,1),A),e.setScale(f),h&&e.object3d.position.copy(h);case 21:case"end":return u.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(_(r.prototype),"dispose",this).call(this)},r}(m),Ae=function(t){"use strict";C(r,t);var i=E(r);function r(a){L(this,r);var e;return e=i.call(this),e.type_="node",e.options=(0,j.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.event2,d=e.handler2,w=document.createElement("div");this.element=w,w.appendChild(s),this.createCSS2DObject(w),o&&this.object3d.position.copy(o),f&&h&&this.clickTarge.forEach(function(y){y.addEventListener(h,f),d&&v&&y.addEventListener(v,d)})},n.getMaterial=function(e){return(0,O.Z)(R().mark(function o(){var s,f,h,v;return R().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 c.CanvasTexture(s),v=new c.SpriteMaterial({map:h,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),w.abrupt("return",v);case 9:case"end":return w.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,f=e.scale,h=f===void 0?new c.Vector3(1,1,1):f,v=e.position,d=v===void 0?new c.Vector3(0,0,0):v,w=e.cache,y=this;return(0,O.Z)(R().mark(function A(){var b,u,g,T;return R().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(b="node-create-pick-object",!(w&&!w.get(b))){M.next=7;break}return w.init(b),M.next=5,y.getMaterial(s);case 5:u=M.sent,w.set(b,u);case 7:if(!w){M.next=13;break}return M.next=10,w.get(b);case 10:M.t0=M.sent,M.next=16;break;case 13:return M.next=15,y.getMaterial(s);case 15:M.t0=M.sent;case 16:g=M.t0,T=new c.Sprite(g),T.scale.set(g.map.image.width*h.x,g.map.image.height*h.y,1),T.position.copy(d),y.add(T),y.pickObject=T;case 22:case"end":return M.stop()}},A)}))()},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(_(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";C(r,t);var i=E(r);function r(){return L(this,r),i.apply(this,arguments)}var n=r.prototype;return n.create=function(){this.createGroup()},r}(m),ot=`
|
|
1
|
+
(function(){var nt={666:function(k){var B=function(P){"use strict";var j=Object.prototype,L=j.hasOwnProperty,z,T=typeof Symbol=="function"?Symbol:{},I=T.iterator||"@@iterator",Z=T.asyncIterator||"@@asyncIterator",D=T.toStringTag||"@@toStringTag";function M(v,l,m){return Object.defineProperty(v,l,{value:m,enumerable:!0,configurable:!0,writable:!0}),v[l]}try{M({},"")}catch(v){M=function(l,m,O){return l[m]=O}}function F(v,l,m,O){var S=l&&l.prototype instanceof c?l:c,X=Object.create(S.prototype),se=new V(O||[]);return X._invoke=fe(v,m,se),X}P.wrap=F;function H(v,l,m){try{return{type:"normal",arg:v.call(l,m)}}catch(O){return{type:"throw",arg:O}}}var $="suspendedStart",oe="suspendedYield",ve="executing",ce="completed",E={};function c(){}function C(){}function W(){}var R={};M(R,I,function(){return this});var le=Object.getPrototypeOf,te=le&&le(le(Se([])));te&&te!==j&&L.call(te,I)&&(R=te);var N=W.prototype=c.prototype=Object.create(R);C.prototype=W,M(N,"constructor",W),M(W,"constructor",C),C.displayName=M(W,D,"GeneratorFunction");function re(v){["next","throw","return"].forEach(function(l){M(v,l,function(m){return this._invoke(l,m)})})}P.isGeneratorFunction=function(v){var l=typeof v=="function"&&v.constructor;return l?l===C||(l.displayName||l.name)==="GeneratorFunction":!1},P.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,W):(v.__proto__=W,M(v,D,"GeneratorFunction")),v.prototype=Object.create(N),v},P.awrap=function(v){return{__await:v}};function ne(v,l){function m(X,se,he,de){var ae=H(v[X],v,se);if(ae.type==="throw")de(ae.arg);else{var Oe=ae.arg,Ce=Oe.value;return Ce&&typeof Ce=="object"&&L.call(Ce,"__await")?l.resolve(Ce.__await).then(function(Ae){m("next",Ae,he,de)},function(Ae){m("throw",Ae,he,de)}):l.resolve(Ce).then(function(Ae){Oe.value=Ae,he(Oe)},function(Ae){return m("throw",Ae,he,de)})}}var O;function S(X,se){function he(){return new l(function(de,ae){m(X,se,de,ae)})}return O=O?O.then(he,he):he()}this._invoke=S}re(ne.prototype),M(ne.prototype,Z,function(){return this}),P.AsyncIterator=ne,P.async=function(v,l,m,O,S){S===void 0&&(S=Promise);var X=new ne(F(v,l,m,O),S);return P.isGeneratorFunction(l)?X:X.next().then(function(se){return se.done?se.value:X.next()})};function fe(v,l,m){var O=$;return function(X,se){if(O===ve)throw new Error("Generator is already running");if(O===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===E)continue;return de}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(O===$)throw O=ce,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);O=ve;var ae=H(v,l,m);if(ae.type==="normal"){if(O=m.done?ce:oe,ae.arg===E)continue;return{value:ae.arg,done:m.done}}else ae.type==="throw"&&(O=ce,m.method="throw",m.arg=ae.arg)}}}function me(v,l){var m=v.iterator[l.method];if(m===z){if(l.delegate=null,l.method==="throw"){if(v.iterator.return&&(l.method="return",l.arg=z,me(v,l),l.method==="throw"))return E;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var O=H(m,v.iterator,l.arg);if(O.type==="throw")return l.method="throw",l.arg=O.arg,l.delegate=null,E;var S=O.arg;if(!S)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,E;if(S.done)l[v.resultName]=S.value,l.next=v.nextLoc,l.method!=="return"&&(l.method="next",l.arg=z);else return S;return l.delegate=null,E}re(N),M(N,D,"Generator"),M(N,I,function(){return this}),M(N,"toString",function(){return"[object Generator]"});function ie(v){var l={tryLoc:v[0]};1 in v&&(l.catchLoc=v[1]),2 in v&&(l.finallyLoc=v[2],l.afterLoc=v[3]),this.tryEntries.push(l)}function q(v){var l=v.completion||{};l.type="normal",delete l.arg,v.completion=l}function V(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(ie,this),this.reset(!0)}P.keys=function(v){var l=[];for(var m in v)l.push(m);return l.reverse(),function O(){for(;l.length;){var S=l.pop();if(S in v)return O.value=S,O.done=!1,O}return O.done=!0,O}};function Se(v){if(v){var l=v[I];if(l)return l.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var m=-1,O=function S(){for(;++m<v.length;)if(L.call(v,m))return S.value=v[m],S.done=!1,S;return S.value=z,S.done=!0,S};return O.next=O}}return{next:Te}}P.values=Se;function Te(){return{value:z,done:!0}}return V.prototype={constructor:V,reset:function(v){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(q),!v)for(var l in this)l.charAt(0)==="t"&&L.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=z)},stop:function(){this.done=!0;var v=this.tryEntries[0],l=v.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var l=this;function m(de,ae){return X.type="throw",X.arg=v,l.next=de,ae&&(l.method="next",l.arg=z),!!ae}for(var O=this.tryEntries.length-1;O>=0;--O){var S=this.tryEntries[O],X=S.completion;if(S.tryLoc==="root")return m("end");if(S.tryLoc<=this.prev){var se=L.call(S,"catchLoc"),he=L.call(S,"finallyLoc");if(se&&he){if(this.prev<S.catchLoc)return m(S.catchLoc,!0);if(this.prev<S.finallyLoc)return m(S.finallyLoc)}else if(se){if(this.prev<S.catchLoc)return m(S.catchLoc,!0)}else if(he){if(this.prev<S.finallyLoc)return m(S.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,l){for(var m=this.tryEntries.length-1;m>=0;--m){var O=this.tryEntries[m];if(O.tryLoc<=this.prev&&L.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var S=O;break}}S&&(v==="break"||v==="continue")&&S.tryLoc<=l&&l<=S.finallyLoc&&(S=null);var X=S?S.completion:{};return X.type=v,X.arg=l,S?(this.method="next",this.next=S.finallyLoc,E):this.complete(X)},complete:function(v,l){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&l&&(this.next=l),E},finish:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===v)return this.complete(m.completion,m.afterLoc),q(m),E}},catch:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===v){var O=m.completion;if(O.type==="throw"){var S=O.arg;q(m)}return S}}throw new Error("illegal catch attempt")},delegateYield:function(v,l,m){return this.delegate={iterator:Se(v),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=z),E}},P}(k.exports);try{regeneratorRuntime=B}catch(P){typeof globalThis=="object"?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},695:function(k,B,P){"use strict";P.d(B,{Z:function(){return j}});function j(L){if(L.geometry&&L.geometry.dispose(),L.material){var z=Array.isArray(L.material)?L.material:[L.material];z.forEach(function(T){var I,Z,D,M,F,H,$,oe,ve,ce,E,c,C;(I=T.map)===null||I===void 0||I.dispose(),(Z=T.lightMap)===null||Z===void 0||Z.dispose(),(D=T.bumpMap)===null||D===void 0||D.dispose(),(M=T.normalMap)===null||M===void 0||M.dispose(),(F=T.specularMap)===null||F===void 0||F.dispose(),(H=T.envMap)===null||H===void 0||H.dispose(),($=T.alphaMap)===null||$===void 0||$.dispose(),(oe=T.aoMap)===null||oe===void 0||oe.dispose(),(ve=T.displacementMap)===null||ve===void 0||ve.dispose(),(ce=T.emissiveMap)===null||ce===void 0||ce.dispose(),(E=T.gradientMap)===null||E===void 0||E.dispose(),(c=T.metalnessMap)===null||c===void 0||c.dispose(),(C=T.roughnessMap)===null||C===void 0||C.dispose(),T.dispose()})}}},584:function(k,B,P){"use strict";P.d(B,{disposeMesh:function(){return T.Z}});var j=P(666),L=P.n(j),z=null,T=P(695),I=P(644);function Z(E){if(E.material){var c=Array.isArray(E.material)?E.material:[E.material];c.forEach(function(C){var W,R;(W=C.color)===null||W===void 0||W.convertSRGBToLinear(),(R=C.emissive)===null||R===void 0||R.convertSRGBToLinear(),C.map&&(C.map.encoding=THREE.sRGBEncoding),C.emissiveMap&&(C.emissiveMap.encoding=THREE.sRGBEncoding)})}}var D=P(568),M=P(924),F=P(360),H=P(484),$=null,oe=null,ve=function(){var E=(0,D.Z)(L().mark(function c(C,W){var R,le,te,N,re,ne,fe,me,ie;return L().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return R=W.type,le=R===void 0?"blob":R,te=W.version,N=te===void 0?"1":te,V.next=4,(0,F.get)(C);case 4:if(ne=V.sent,!(ne&&ne[N])){V.next=9;break}re=ne[N],V.next=15;break;case 9:return V.next=11,(0,H.Z)(fetch(C).then(function(Se){if(Se.ok)return Se[le]();throw new Error}));case 11:fe=V.sent,me=fe.res,ie=fe.err,ie||(re=me,(0,F.set)(C,(0,M.Z)({},N,me)));case 15:return V.abrupt("return",re?{url:le==="json"?C:URL.createObjectURL(re),store:re}:{url:C});case 16:case"end":return V.stop()}},c)}));return function(C,W){return E.apply(this,arguments)}}(),ce=P(705)},484:function(k,B,P){"use strict";P.d(B,{Z:function(){return L}});var j=P(42);function L(z){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return z.then(function(I){return(0,j.Z)({err:null,res:I},T)}).catch(function(I){return(0,j.Z)({err:I,res:void 0},T)})}},705:function(k,B,P){"use strict";P.d(B,{C:function(){return I},y:function(){return T}});var j=P(644),L=P.n(j),z=new Map,T=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],E=M[H*3+1],c=M[$*3],C=M[$*3+1],W;if(z.has(D))W=z.get(D);else{var R=Z.box3||new j.Box3;if(!Z.box3){var le=D.parameters.shapes.getPoints();R.setFromArray(le.map(function(fe){return[fe.x,fe.y,0]}).flat())}var te=R.getSize(new j.Vector3);Z.split&&(te.y/=Z.split),W={box:R,size:te},z.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,(E-N.min.y)/re.y+ne),new j.Vector2((c-N.min.x)/re.x,(C-N.min.y)/re.y+ne)]},generateSideWallUV:function(D,M,F,H,$,oe){var ve=M[F*3],ce=M[F*3+1],E=M[F*3+2],c=M[H*3],C=M[H*3+1],W=M[H*3+2],R=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(z.has(M))fe=z.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},z.set(M,fe)}var q=fe.box,V=fe.size;return Math.abs(ce-C)<Math.abs(ve-c)?[new j.Vector2((ve-q.min.x)/V.x,(E-q.min.z)/V.z),new j.Vector2((c-q.min.x)/V.x,(W-q.min.z)/V.z),new j.Vector2((R-q.min.x)/V.x,(te-q.min.z)/V.z),new j.Vector2((N-q.min.x)/V.x,(ne-q.min.z)/V.z)]:[new j.Vector2((ce-q.min.y)/V.y,(E-q.min.z)/V.z),new j.Vector2((C-q.min.y)/V.y,(W-q.min.z)/V.z),new j.Vector2((le-q.min.y)/V.y,(te-q.min.z)/V.z),new j.Vector2((re-q.min.y)/V.y,(ne-q.min.z)/V.z)]}}},I=function(){z.clear()}},360:function(k){"use strict";k.exports=require("idb-keyval")},644:function(k){"use strict";k.exports=require("three")},568:function(k,B,P){"use strict";P.d(B,{Z:function(){return L}});function j(z,T,I,Z,D,M,F){try{var H=z[M](F),$=H.value}catch(oe){I(oe);return}H.done?T($):Promise.resolve($).then(Z,D)}function L(z){return function(){var T=this,I=arguments;return new Promise(function(Z,D){var M=z.apply(T,I);function F($){j(M,Z,D,F,H,"next",$)}function H($){j(M,Z,D,F,H,"throw",$)}F(void 0)})}}},924:function(k,B,P){"use strict";P.d(B,{Z:function(){return j}});function j(L,z,T){return z in L?Object.defineProperty(L,z,{value:T,enumerable:!0,configurable:!0,writable:!0}):L[z]=T,L}},42:function(k,B,P){"use strict";P.d(B,{Z:function(){return L}});var j=P(924);function L(z){for(var T=1;T<arguments.length;T++){var I=arguments[T]!=null?arguments[T]:{},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)(z,D,I[D])})}return z}}},Fe={};function Y(k){var B=Fe[k];if(B!==void 0)return B.exports;var P=Fe[k]={exports:{}};return nt[k](P,P.exports,Y),P.exports}(function(){Y.n=function(k){var B=k&&k.__esModule?function(){return k.default}:function(){return k};return Y.d(B,{a:B}),B}})(),function(){Y.d=function(k,B){for(var P in B)Y.o(B,P)&&!Y.o(k,P)&&Object.defineProperty(k,P,{enumerable:!0,get:B[P]})}}(),function(){Y.o=function(k,B){return Object.prototype.hasOwnProperty.call(k,B)}}(),function(){Y.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__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 Ce},getExtrudePolygonGeometry:function(){return Et},getLineGeometry:function(){return dt}});function k(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function B(t,i){return B=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},B(t,i)}function P(t,i){return B(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&&P(t,i)}var L=Y(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(t){return!1}}function T(t,i,r){return z()?T=Reflect.construct:T=function(a,e,o){var s=[null];s.push.apply(s,e);var f=Function.bind.apply(a,s),h=new f;return o&&P(h,o.prototype),h},T.apply(null,arguments)}function I(t,i,r){return T.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}}),P(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 E(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 c=Y(644),C=Y(568),W=Y(666),R=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 V(){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"),v=Y(584),l=function(t){t&&((0,v.disposeMesh)(t),t.children.forEach(function(i){i.userData.BaseObject_||l(i)}))},m=function(){"use strict";function t(){k(this,t),this.objecttype__="BaseObject",this.userData={},this.pm=V(),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(c.Mesh,ie(a)),this},i.createGroup=function(){return this.object3d=new c.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(c.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 c.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 c.Box3().setFromObject(this.object3d);return{min:n.min,max:n.max,size:n.getSize(new c.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}(),O=+c.REVISION<144,S=O?"ExtrudeBufferGeometry":"ExtrudeGeometry",X=O?"PlaneBufferGeometry":"PlaneGeometry",se=function(t){"use strict";j(r,t);var i=E(r);function r(a){k(this,r);var e;return e=i.call(this),e.scale=1,e.options=(0,L.Z)({},{scale:1},a),e}var n=r.prototype;return n.getMaterial=function(){var e=this;return(0,C.Z)(R().mark(function o(){var s,f,h,p,d,y,w,_,b,u;return R().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return s=e.options,f=s.transparent,h=s.blending,p=s.depthWrite,d=s.depthTest,y=s.alphaTest,w=s.sprite,_=s.sizeAttenuation,x.next=3,e.getTexture();case 3:return b=x.sent,u=w?new c.SpriteMaterial({map:b,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,depthTest:d!=null?d:!0,alphaTest:y!=null?y:0,sizeAttenuation:_!=null?_:!0}):new c.MeshBasicMaterial({map:b,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,depthTest:d!=null?d:!0,alphaTest:y!=null?y:0}),x.abrupt("return",u);case 6:case"end":return x.stop()}},o)}))()},n.create=function(){var e=this;return(0,C.Z)(R().mark(function o(){var s,f,h,p,d,y,w,_,b;return R().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(s=e.options,f=s.scale,h=s.position,p=s.src,d=s.cache,y=s.sprite,w=p,!(d&&!d.get(w))){g.next=8;break}return d.init(w),g.next=6,e.getMaterial();case 6:_=g.sent,d.set(w,_);case 8:if(!d){g.next=14;break}return g.next=11,d.get(w);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,y?e.createSprite(b):e.createMesh(new c[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 c.TextureLoader().loadAsync(e)},r}(m),he=function(t){"use strict";j(r,t);var i=E(r);function r(a){k(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,L.Z)({},{fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,color:"#ffffff",setCtx:function(G){}},s||{}),h=f.fontSize,p=f.fontFamily,d=f.fontWeight,y=f.flipX,w=f.color,_=f.setCtx,b=this.canvas;b.width=h*o.length*2,b.height=h;var u=b.getContext("2d");u.font="".concat(d," ").concat(h,"px/1 ").concat(p);var g=u.measureText(o).width;b.width=g,u=b.getContext("2d"),u.clearRect(0,0,b.width,b.height),y&&u.scale(-1,1),u.font="".concat(d," ").concat(h,"px/1 ").concat(p),u.textBaseline="middle",u.fillStyle=w,_&&_(u),u.fillText(o,y?g*-1:0,b.height/2),u.restore();var x=new c.Texture(b);return x.anisotropy=this.pencil.renderer.capabilities.getMaxAnisotropy(),x.needsUpdate=!0,Promise.resolve(x)},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 Ce=function(t){"use strict";j(r,t);var i=E(r);function r(a){k(this,r);var e;return e=i.call(this),e.scale=1,e.options=(0,L.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,p=e.depthTest,d=e.format,y=e.autoPlay,w=e.loop,_=e.alphaTest,b=e.sprite,u=V(),g=document.createElement("video");return g.addEventListener("loadedmetadata",function(){var x=new c.VideoTexture(g);x.format=d!=null?d:c.RGBAFormat,x.needsUpdate=!0;var G=b?new c.SpriteMaterial({map:x,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,depthTest:p!=null?p:!0,alphaTest:_!=null?_:0}):new c.MeshBasicMaterial({map:x,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,depthTest:p!=null?p:!0,alphaTest:_!=null?_:0});u.resolve(G)},!1),g.src=o,g.muted=!0,g.autoplay=y,g.loop=w,g.preload="auto",u.promise},n.create=function(){var e=this;return(0,C.Z)(R().mark(function o(){var s,f,h,p,d,y,w,_;return R().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=e.options,f=s.scale,h=s.position,p=s.src,d=s.cache,y=s.sprite,!(d&&!d.get(p))){u.next=7;break}return d.init(p),u.next=5,e.getMaterial();case 5:w=u.sent,d.set(p,w);case 7:if(!d){u.next=13;break}return u.next=10,d.get(p);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:_=u.t0,e.video=_.map.image,y?e.createSprite(_):e.createMesh(new c[X](1,1),_),e.setScale(f),h&&e.object3d.position.copy(h);case 21:case"end":return u.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=E(r);function r(a){k(this,r);var e;return e=i.call(this),e.type_="node",e.options=(0,L.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,p=e.event2,d=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&&p&&w.addEventListener(p,d)})},n.getMaterial=function(e){return(0,C.Z)(R().mark(function o(){var s,f,h,p;return R().wrap(function(y){for(;;)switch(y.prev=y.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 c.CanvasTexture(s),p=new c.SpriteMaterial({map:h,opacity:e?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",p);case 9:case"end":return y.stop()}},o)}))()},n.createPickObject=function(e){var o=e.show,s=o===void 0?!1:o,f=e.scale,h=f===void 0?new c.Vector3(1,1,1):f,p=e.position,d=p===void 0?new c.Vector3(0,0,0):p,y=e.cache,w=this;return(0,C.Z)(R().mark(function _(){var b,u,g,x;return R().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(b="node-create-pick-object",!(y&&!y.get(b))){A.next=7;break}return y.init(b),A.next=5,w.getMaterial(s);case 5:u=A.sent,y.set(b,u);case 7:if(!y){A.next=13;break}return A.next=10,y.get(b);case 10:A.t0=A.sent,A.next=16;break;case 13:return A.next=15,w.getMaterial(s);case 15:A.t0=A.sent;case 16:g=A.t0,x=new c.Sprite(g),x.scale.set(g.map.image.width*h.x,g.map.image.height*h.y,1),x.position.copy(d),w.add(x),w.pickObject=x;case 22:case"end":return A.stop()}},_)}))()},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(p){p.removeEventListener(s,o),f&&h&&p.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=E(r);function r(){return k(this,r),i.apply(this,arguments)}var n=r.prototype;return n.create=function(){this.createGroup()},r}(m),ot=`
|
|
2
2
|
`.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(c.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(c.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),_e=function(t){"use strict";C(r,t);var i=E(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 c.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}(c.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 c.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 c.Matrix4,n=new c.Ray,a=new c.Sphere,e=new c.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 c.Vector3,f=new c.Vector3,h=new c.Vector3,v=this instanceof c.LineSegments?2:1,d=o.index,w=o.attributes;if(d!==null)for(var y=d.array,A=w.position.array,b=w.width.array,u=0,g=y.length-1;u<g;u+=v){var T=y[u],z=y[u+1];s.fromArray(A,T*3),f.fromArray(A,z*3);var M=b[Math.floor(u/3)]!==void 0?b[Math.floor(u/3)]:1,Q=t.params.Line.threshold+this.material.lineWidth*M/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:u,face:null,faceIndex:null,object:this}),u=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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function 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},c.ShaderChunk.meshline_vert=ot,c.ShaderChunk.meshline_frag=st;var We=function(t){"use strict";C(r,t);var i=E(r);function r(n){L(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),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}(c.ShaderMaterial);We.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function 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 c.BufferGeometry,a=new _e;return n.setFromPoints(r),a.setGeometry(n,i),a}var pt={color:new c.Color("#ffffff"),lineWidth:1},vt=function(t){"use strict";C(r,t);var i=E(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,j.Z)({},pt,a),e}var n=r.prototype;return n.create=function(){var e=this;return(0,O.Z)(R().mark(function o(){var s,f,h,v,d,w,y,A,b,u,g,T,z,M,Q,K,J,ue,ge,pe;return R().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,w=s.key,y=s.nodes,A=s.nodesArr,b=s.geometry,u=s.geometryArr,g=s.useGroups,T=s.material,z=s.cache,M=s.cacheKey,Q=lt(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),K=T,J=b,K){ee.next=16;break}if(ue="LineMaterial:".concat(M),z&&!z.get(ue)&&(z.init(ue),ge=e.getMaterial((0,j.Z)({},Q)),z.set(ue,ge)),!z){ee.next=12;break}return ee.next=9,z.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&&A?J=Le.mergeBufferGeometries(A.map(function(je){return $e({nodes:je,setPointWidth:d})}),g!=null?g:!1):!J&&u&&u.length>1?J=Le.mergeBufferGeometries(u,g!=null?g:!1):!J&&u&&u.length===1&&(pe=ye(u,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,j.Z)({},e),{resolution:new c.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(w){h.value.x=w.x}});this.tween=d},n.dispose=function(){var e;Oe(_(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 c.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?v.setIndex(new c.BufferAttribute(h[d].array,h[d].itemSize)):v.setAttribute(d,new c.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(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],w=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},y=[],A=d[0];A<=d[1];A++){var b=f(A);w(b)&&y.push([b,h(A)])}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 Ct(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],w=v[1],y=ye(h[1],2),A=y[0],b=y[1],u=d>A||b>=89||w<=-89,g=[];if(u){var T=(0,At.geoVoronoi)(s).triangles(),z=new Map(s.map(function(U,Me){var be=ye(U,2),we=be[0],Ge=be[1];return["".concat(we,"-").concat(Ge),Me]}));T.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);z.has(rt)&&we.push(z.get(rt))}),we.length===3){if(we.some(function(ze){return ze<e.length})){var Ge=U.properties.circumcenter;if(!Ue(Ge,f,u))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,u))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 M=De().flatten(a),Q=M.vertices,K=M.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]),je=(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),je(we)]}),tt={points:s,indices:g,uvs:Re};return{contour:a,triangles:tt}}var jt=Ct,Xe=new c.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),w=0,y=[],A=0;A<v;A++){var b=A+1;if(b===v)b=w;else if(d.has(b)){var u=b;b=w,w=u}y.push(A,A+v,b+v),y.push(b+v,b,A)}for(var g=[],T=1;T>=0;T--)for(var z=0;z<v;z+=1)g.push(z/(v-1),T);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";C(r,t);var i=E(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,j.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,w=o.curvatureResolution,y=o.cartesian,A=o.userDataRsoOffset;yt()(n[0])||n[0].reverse();var b=jt(n,{resolution:w}),u=b.contour,g=b.triangles,T=(0,ke.merge)(g.uvs),z=[],M=[],Q=[],K=0,J=function(ge){var pe=Math.round(z.length/3),Pe=Q.length;z=z.concat(ge.vertices),M=M.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(u,s,f,y);J(ue),e.userData.rso=A?Ye(u,s,f+A,y):ue}return h&&J(Qe(g,s,T,!1,y)),v&&J(Qe(g,f,T,!0,y)),e.setIndex(Q),e[Xe]("position",new c.Float32BufferAttribute(z,3)),e[Xe]("uv",new c.Float32BufferAttribute(M,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),kt=function(t){"use strict";C(r,t);var i=E(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=(0,j.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,w=e.cartesian,y=new Lt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:h,curvatureResolution:v,cartesian:w,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 c[P](new c.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";C(r,t);var i=E(r);function r(a){L(this,r);var e;return e=i.call(this),e.options=He((0,j.Z)({depth:1},a),{materialOptions:(0,j.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,O.Z)(R().mark(function o(){var s,f,h,v,d,w,y,A,b,u,g,T,z,M,Q,K,J,ue,ge,pe,Pe,ee,je,Re;return R().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,w=s.geometry,y=s.geometryArr,A=s.material,b=s.materialOptions,u=s.cache,g=s.box3,T=0,z=Array.isArray(d)?d:[d],M=Array.isArray(g)?g:[g],Q=A,K=w,!(!Q&&b)){U.next=26;break}if(T=b.split,J=b.topColor,ue=b.sideColor,ge=b.sideMap,pe="ExtrudePolygonMaterial:".concat(ue||ge).concat(J||""),!(u&&!u.get(pe))){U.next=16;break}return u.init(pe),U.next=14,e.getMaterial(b);case 14:Pe=U.sent,u.set(pe,Pe);case 16:if(!u){U.next=22;break}return U.next=19,u.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:z[0],split:T,box3:M[0]}):!K&&h?K=Le.mergeBufferGeometries(h.map(function(Me,be){return et({points:Me,depth:(ee=z[be])!==null&&ee!==void 0?ee:z[0],split:T,box3:(je=M[be])!==null&&je!==void 0?je:M[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,w=e.createCanvasObjectURL,y=e.split,A=e.maxAnisotropy;return new Promise(function(b){var u=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var g=y,T=document.createElement("canvas"),z=T.getContext("2d");T.height=u.height/(1-g),T.width=u.width,g&&s&&(z.fillStyle=s,z.fillRect(0,0,u.width,T.height*g)),h&&u instanceof HTMLImageElement?z.drawImage(u,0,T.height*g,u.width,u.height):f&&(z.fillStyle=f,z.fillRect(0,T.height*g,u.width,u.height)),w&&T.toBlob(function(K){console.log(URL.createObjectURL(K))});var M=new c.CanvasTexture(T);M.anisotropy=A||o.pencil.renderer.capabilities.getMaxAnisotropy();var Q=new c[v||"MeshBasicMaterial"]((0,j.Z)({map:M},d||{}));b(Q)},h?u.src=h:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,O.Z)(R().mark(function s(){var f,h,v,d,w,y,A,b,u,g,T;return R().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(f=o.options,h=f.materialOptions,v=f.cache,d=h.sideColor,w=h.sideMap,y=h.topColor,A=e.sideColor,b=e.topColor,!(b||A)){M.next=22;break}if(u="ExtrudePolygonMaterial:".concat(A||d||w||"").concat(b||y||""),!(v&&!v.get(u))){M.next=11;break}return v.init(u),M.next=9,o.getMaterial((0,j.Z)({},h,e));case 9:g=M.sent,v.set(u,g);case 11:if(!v){M.next=17;break}return M.next=14,v.get(u);case 14:M.t0=M.sent,M.next=20;break;case 17:return M.next=19,o.getMaterial((0,j.Z)({},h,e));case 19:M.t0=M.sent;case 20:T=M.t0,o.object3d.material=T;case 22:case"end":return M.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 c.BufferGeometry;Object.keys(v).forEach(function(w){d.setAttribute(w,new c.BufferAttribute(v[w].array,v[w].itemSize))}),f(d)}catch(w){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=E(r);function r(){k(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 c.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}(c.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 c.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 c.Matrix4,n=new c.Ray,a=new c.Sphere,e=new c.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 c.Vector3,f=new c.Vector3,h=new c.Vector3,p=this instanceof c.LineSegments?2:1,d=o.index,y=o.attributes;if(d!==null)for(var w=d.array,_=y.position.array,b=y.width.array,u=0,g=w.length-1;u<g;u+=p){var x=w[u],G=w[u+1];s.fromArray(_,x*3),f.fromArray(_,G*3);var A=b[Math.floor(u/3)]!==void 0?b[Math.floor(u/3)]:1,Q=t.params.Line.threshold+this.material.lineWidth*A/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:u,face:null,faceIndex:null,object:this}),u=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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function 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},c.ShaderChunk.meshline_vert=ot,c.ShaderChunk.meshline_frag=st;var We=function(t){"use strict";j(r,t);var i=E(r);function r(n){k(this,r);var a;return a=i.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),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}(c.ShaderMaterial);We.prototype.copy=function(t){return c.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};function 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 c.BufferGeometry,a=new _e;return n.setFromPoints(r),a.setGeometry(n,i),a}var pt={color:new c.Color("#ffffff"),lineWidth:1},vt=function(t){"use strict";j(r,t);var i=E(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(this,r);var e;return e=i.call(this),e.options=(0,L.Z)({},pt,a),e}var n=r.prototype;return n.create=function(){var e=this;return(0,C.Z)(R().mark(function o(){var s,f,h,p,d,y,w,_,b,u,g,x,G,A,Q,K,J,ue,ge,pe;return R().wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:if(s=e.options,f=s.duration,h=s.delay,p=s.onComplete,d=s.setPointWidth,y=s.key,w=s.nodes,_=s.nodesArr,b=s.geometry,u=s.geometryArr,g=s.useGroups,x=s.material,G=s.cache,A=s.cacheKey,Q=lt(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),K=x,J=b,K){ee.next=16;break}if(ue="LineMaterial:".concat(A),G&&!G.get(ue)&&(G.init(ue),ge=e.getMaterial((0,L.Z)({},Q)),G.set(ue,ge)),!G){ee.next=12;break}return ee.next=9,G.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&&w?J=$e({nodes:w,setPointWidth:d}):!J&&_?J=Le.mergeBufferGeometries(_.map(function(je){return $e({nodes:je,setPointWidth:d})}),g!=null?g:!1):!J&&u&&u.length>1?J=Le.mergeBufferGeometries(u,g!=null?g:!1):!J&&u&&u.length===1&&(pe=ye(u,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,L.Z)({},e),{resolution:new c.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,p=s!=null?s:0,d=(0,Ke.animate)({from:h.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-p,repeat:1/0,onComplete:f,ease:Ke.linear,onUpdate:function(y){h.value.x=y.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 p=new c.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?p.setIndex(new c.BufferAttribute(h[d].array,h[d].itemSize)):p.setAttribute(d,new c.BufferAttribute(h[d].array,h[d].itemSize))}),s(p)}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(u){return u/s*360%360-180},h=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},p=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},d=[e!==void 0?Math.ceil(p(e)):0,a!==void 0?Math.floor(p(a)):o-1],y=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},w=[],_=d[0];_<=d[1];_++){var b=f(_);y(b)&&w.push([b,h(_)])}return w}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 p=e>f||h>=89||o<=-89;return St(i,{minLng:e,maxLng:f,minLat:o,maxLat:h}).filter(function(d){return Ue(d,r,p)})}function Ct(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),p=ye(h[0],2),d=p[0],y=p[1],w=ye(h[1],2),_=w[0],b=w[1],u=d>_||b>=89||y<=-89,g=[];if(u){var x=(0,At.geoVoronoi)(s).triangles(),G=new Map(s.map(function(U,Me){var be=ye(U,2),we=be[0],Ge=be[1];return["".concat(we,"-").concat(Ge),Me]}));x.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);G.has(rt)&&we.push(G.get(rt))}),we.length===3){if(we.some(function(ze){return ze<e.length})){var Ge=U.properties.circumcenter;if(!Ue(Ge,f,u))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,u))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 A=De().flatten(a),Q=A.vertices,K=A.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]),je=(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),je(we)]}),tt={points:s,indices:g,uvs:Re};return{contour:a,triangles:tt}}var jt=Ct,Xe=new c.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]),p=Math.round(f.length/3),d=new Set(o),y=0,w=[],_=0;_<p;_++){var b=_+1;if(b===p)b=y;else if(d.has(b)){var u=b;b=y,y=u}w.push(_,_+p,b+p),w.push(b+p,b,_)}for(var g=[],x=1;x>=0;x--)for(var G=0;G<p;G+=1)g.push(G/(p-1),x);return{indices:w,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=E(r);function r(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};k(this,r);var e;e=i.call(this),e.type="PolygonBufferGeometry",e.parameters=(0,L.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,p=o.closedTop,d=o.includeSides,y=o.curvatureResolution,w=o.cartesian,_=o.userDataRsoOffset;yt()(n[0])||n[0].reverse();var b=jt(n,{resolution:y}),u=b.contour,g=b.triangles,x=(0,ke.merge)(g.uvs),G=[],A=[],Q=[],K=0,J=function(ge){var pe=Math.round(G.length/3),Pe=Q.length;G=G.concat(ge.vertices),A=A.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(u,s,f,w);J(ue),e.userData.rso=_?Ye(u,s,f+_,w):ue}return h&&J(Qe(g,s,x,!1,w)),p&&J(Qe(g,f,x,!0,w)),e.setIndex(Q),e[Xe]("position",new c.Float32BufferAttribute(G,3)),e[Xe]("uv",new c.Float32BufferAttribute(A,2)),e.computeVertexNormals(),e}return r}(c.BufferGeometry),kt=function(t){"use strict";j(r,t);var i=E(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=(0,L.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,p=e.curvatureResolution,d=e.userDataRsoOffset,y=e.cartesian,w=new Lt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:h,curvatureResolution:p,cartesian:y,userDataRsoOffset:d});this.createMesh(w,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 c[S](new c.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=E(r);function r(a){k(this,r);var e;return e=i.call(this),e.options=He((0,L.Z)({depth:1},a),{materialOptions:(0,L.Z)({},{split:.1},a.materialOptions||{})}),e}var n=r.prototype;return n.create=function(){var e=this;return(0,C.Z)(R().mark(function o(){var s,f,h,p,d,y,w,_,b,u,g,x,G,A,Q,K,J,ue,ge,pe,Pe,ee,je,Re;return R().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:if(s=e.options,f=s.points,h=s.pointsArr,p=s.useGroups,d=s.depth,y=s.geometry,w=s.geometryArr,_=s.material,b=s.materialOptions,u=s.cache,g=s.box3,x=0,G=Array.isArray(d)?d:[d],A=Array.isArray(g)?g:[g],Q=_,K=y,!(!Q&&b)){U.next=26;break}if(x=b.split,J=b.topColor,ue=b.sideColor,ge=b.sideMap,pe="ExtrudePolygonMaterial:".concat(ue||ge).concat(J||""),!(u&&!u.get(pe))){U.next=16;break}return u.init(pe),U.next=14,e.getMaterial(b);case 14:Pe=U.sent,u.set(pe,Pe);case 16:if(!u){U.next=22;break}return U.next=19,u.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:G[0],split:x,box3:A[0]}):!K&&h?K=Le.mergeBufferGeometries(h.map(function(Me,be){return et({points:Me,depth:(ee=G[be])!==null&&ee!==void 0?ee:G[0],split:x,box3:(je=A[be])!==null&&je!==void 0?je:A[0]})}),p!=null?p:!1):!K&&w&&w.length>1?K=Le.mergeBufferGeometries(w,p!=null?p:!1):!K&&w&&w.length===1&&(Re=ye(w,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,p=e.type,d=e.parameters,y=e.createCanvasObjectURL,w=e.split,_=e.maxAnisotropy;return new Promise(function(b){var u=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var g=w,x=document.createElement("canvas"),G=x.getContext("2d");x.height=u.height/(1-g),x.width=u.width,g&&s&&(G.fillStyle=s,G.fillRect(0,0,u.width,x.height*g)),h&&u instanceof HTMLImageElement?G.drawImage(u,0,x.height*g,u.width,u.height):f&&(G.fillStyle=f,G.fillRect(0,x.height*g,u.width,u.height)),y&&x.toBlob(function(K){console.log(URL.createObjectURL(K))});var A=new c.CanvasTexture(x);A.anisotropy=_||o.pencil.renderer.capabilities.getMaxAnisotropy();var Q=new c[p||"MeshBasicMaterial"]((0,L.Z)({map:A},d||{}));b(Q)},h?u.src=h:u instanceof HTMLImageElement||u.onload()})},n.setMaterialColor=function(e){var o=this;return(0,C.Z)(R().mark(function s(){var f,h,p,d,y,w,_,b,u,g,x;return R().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(f=o.options,h=f.materialOptions,p=f.cache,d=h.sideColor,y=h.sideMap,w=h.topColor,_=e.sideColor,b=e.topColor,!(b||_)){A.next=22;break}if(u="ExtrudePolygonMaterial:".concat(_||d||y||"").concat(b||w||""),!(p&&!p.get(u))){A.next=11;break}return p.init(u),A.next=9,o.getMaterial((0,L.Z)({},h,e));case 9:g=A.sent,p.set(u,g);case 11:if(!p){A.next=17;break}return A.next=14,p.get(u);case 14:A.t0=A.sent,A.next=20;break;case 17:return A.next=19,o.getMaterial((0,L.Z)({},h,e));case 19:A.t0=A.sent;case 20:x=A.t0,o.object3d.material=x;case 22:case"end":return A.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(p){try{var d=new c.BufferGeometry;Object.keys(p).forEach(function(y){d.setAttribute(y,new c.BufferAttribute(p[y].array,p[y].itemSize))}),f(d)}catch(y){i.postMessage({delCache:!0,workerKey:r},{cb:h,cacheVersion:s})}},cacheVersion:s})})}})(),module.exports=Be})();
|
|
@@ -1,4 +1,4 @@
|
|
|
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 Ve from"d3-geo";import*as rr from"d3-geo-voronoi";import*as nr from"d3-scale";var ir={666:function(T){var B=function(x){"use strict";var P=Object.prototype,w=P.hasOwnProperty,z,L=typeof Symbol=="function"?Symbol:{},W=L.iterator||"@@iterator",H=L.asyncIterator||"@@asyncIterator",C=L.toStringTag||"@@toStringTag";function R(p,l,g){return Object.defineProperty(p,l,{value:g,enumerable:!0,configurable:!0,writable:!0}),p[l]}try{R({},"")}catch(p){R=function(l,g,E){return l[g]=E}}function Z(p,l,g,E){var O=l&&l.prototype instanceof c?l:c,J=Object.create(O.prototype),q=new se(E||[]);return J._invoke=we(p,g,q),J}x.wrap=Z;function K(p,l,g){try{return{type:"normal",arg:p.call(l,g)}}catch(E){return{type:"throw",arg:E}}}var Q="suspendedStart",oe="suspendedYield",pe="executing",fe="completed",k={};function c(){}function S(){}function U(){}var G={};R(G,W,function(){return this});var ie=Object.getPrototypeOf,$=ie&&ie(ie(Oe([])));$&&$!==P&&w.call($,W)&&(G=$);var F=U.prototype=c.prototype=Object.create(G);S.prototype=U,R(F,"constructor",U),R(U,"constructor",S),S.displayName=R(U,C,"GeneratorFunction");function ae(p){["next","throw","return"].forEach(function(l){R(p,l,function(g){return this._invoke(l,g)})})}x.isGeneratorFunction=function(p){var l=typeof p=="function"&&p.constructor;return l?l===S||(l.displayName||l.name)==="GeneratorFunction":!1},x.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,U):(p.__proto__=U,R(p,C,"GeneratorFunction")),p.prototype=Object.create(F),p},x.awrap=function(p){return{__await:p}};function ee(p,l){function g(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"&&w.call(Ce,"__await")?l.resolve(Ce.__await).then(function(Pe){g("next",Pe,ue,ve)},function(Pe){g("throw",Pe,ue,ve)}):l.resolve(Ce).then(function(Pe){Le.value=Pe,ue(Le)},function(Pe){return g("throw",Pe,ue,ve)})}}var E;function O(J,q){function ue(){return new l(function(ve,ce){g(J,q,ve,ce)})}return E=E?E.then(ue,ue):ue()}this._invoke=O}ae(ee.prototype),R(ee.prototype,H,function(){return this}),x.AsyncIterator=ee,x.async=function(p,l,g,E,O){O===void 0&&(O=Promise);var J=new ee(Z(p,l,g,E),O);return x.isGeneratorFunction(l)?J:J.next().then(function(q){return q.done?q.value:J.next()})};function we(p,l,g){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 ze()}for(g.method=J,g.arg=q;;){var ue=g.delegate;if(ue){var ve=ge(ue,g);if(ve){if(ve===k)continue;return ve}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(E===Q)throw E=fe,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);E=pe;var ce=K(p,l,g);if(ce.type==="normal"){if(E=g.done?fe:oe,ce.arg===k)continue;return{value:ce.arg,done:g.done}}else ce.type==="throw"&&(E=fe,g.method="throw",g.arg=ce.arg)}}}function ge(p,l){var g=p.iterator[l.method];if(g===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 k;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var E=K(g,p.iterator,l.arg);if(E.type==="throw")return l.method="throw",l.arg=E.arg,l.delegate=null,k;var O=E.arg;if(!O)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,k;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,k}ae(F),R(F,C,"Generator"),R(F,W,function(){return this}),R(F,"toString",function(){return"[object Generator]"});function D(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(D,this),this.reset(!0)}x.keys=function(p){var l=[];for(var g in p)l.push(g);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 g=-1,E=function O(){for(;++g<p.length;)if(w.call(p,g))return O.value=p[g],O.done=!1,O;return O.value=z,O.done=!0,O};return E.next=E}}return{next:ze}}x.values=Oe;function ze(){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"&&w.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 g(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 g("end");if(O.tryLoc<=this.prev){var q=w.call(O,"catchLoc"),ue=w.call(O,"finallyLoc");if(q&&ue){if(this.prev<O.catchLoc)return g(O.catchLoc,!0);if(this.prev<O.finallyLoc)return g(O.finallyLoc)}else if(q){if(this.prev<O.catchLoc)return g(O.catchLoc,!0)}else if(ue){if(this.prev<O.finallyLoc)return g(O.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(p,l){for(var g=this.tryEntries.length-1;g>=0;--g){var E=this.tryEntries[g];if(E.tryLoc<=this.prev&&w.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,k):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),k},finish:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.finallyLoc===p)return this.complete(g.completion,g.afterLoc),Y(g),k}},catch:function(p){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.tryLoc===p){var E=g.completion;if(E.type==="throw"){var O=E.arg;Y(g)}return O}}throw new Error("illegal catch attempt")},delegateYield:function(p,l,g){return this.delegate={iterator:Oe(p),resultName:l,nextLoc:g},this.method==="next"&&(this.arg=z),k}},x}(T.exports);try{regeneratorRuntime=B}catch(x){typeof globalThis=="object"?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},695:function(T,B,x){x.d(B,{Z:function(){return P}});function P(w){if(w.geometry&&w.geometry.dispose(),w.material){var z=Array.isArray(w.material)?w.material:[w.material];z.forEach(function(L){var W,H,C,R,Z,K,Q,oe,pe,fe,k,c,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(),(R=L.normalMap)===null||R===void 0||R.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(),(k=L.gradientMap)===null||k===void 0||k.dispose(),(c=L.metalnessMap)===null||c===void 0||c.dispose(),(S=L.roughnessMap)===null||S===void 0||S.dispose(),L.dispose()})}}},584:function(T,B,x){x.d(B,{wf:function(){return L.Z}});var P=x(666),w=x.n(P),z=null,L=x(695),W=x(949);function H(k){if(k.material){var c=Array.isArray(k.material)?k.material:[k.material];c.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=x(568),R=x(924),Z=x(77),K=x(484),Q=null,oe=null,pe=function(){var k=(0,C.Z)(w().mark(function c(S,U){var G,ie,$,F,ae,ee,we,ge,D;return w().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,D=we.err,D||(ae=ge,(0,Z.set)(S,(0,R.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()}},c)}));return function(S,U){return k.apply(this,arguments)}}(),fe=x(705)},484:function(T,B,x){x.d(B,{Z:function(){return w}});var P=x(42);function w(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(T,B,x){x.d(B,{C:function(){return L},y:function(){return z}});var P=x(949),w=new Map,z=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(H,C,R,Z,K){var Q=C[R*3],oe=C[R*3+1],pe=C[Z*3],fe=C[Z*3+1],k=C[K*3],c=C[K*3+1],S;if(w.has(H))S=w.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},w.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((k-$.min.x)/F.x,(c-$.min.y)/F.y+ae)]},generateSideWallUV:function(H,C,R,Z,K,Q){var oe=C[R*3],pe=C[R*3+1],fe=C[R*3+2],k=C[Z*3],c=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(w.has(C))ee=w.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},w.set(C,ee)}var D=ee.box,Y=ee.size;return Math.abs(pe-c)<Math.abs(oe-k)?[new P.Vector2((oe-D.min.x)/Y.x,(fe-D.min.z)/Y.z),new P.Vector2((k-D.min.x)/Y.x,(S-D.min.z)/Y.z),new P.Vector2((U-D.min.x)/Y.x,(ie-D.min.z)/Y.z),new P.Vector2(($-D.min.x)/Y.x,(ae-D.min.z)/Y.z)]:[new P.Vector2((pe-D.min.y)/Y.y,(fe-D.min.z)/Y.z),new P.Vector2((c-D.min.y)/Y.y,(S-D.min.z)/Y.z),new P.Vector2((G-D.min.y)/Y.y,(ie-D.min.z)/Y.z),new P.Vector2((F-D.min.y)/Y.y,(ae-D.min.z)/Y.z)]}}},L=function(){w.clear()}},77:function(T,B,x){var P=z=>{var L={};return x.d(L,z),L},w=z=>()=>z;T.exports=P({get:()=>ot.get,set:()=>ot.set})},949:function(T){var B=P=>{var w={};return I.d(w,P),w},x=P=>()=>P;T.exports=$t},568:function(T,B,x){x.d(B,{Z:function(){return w}});function P(z,L,W,H,C,R,Z){try{var K=z[R](Z),Q=K.value}catch(oe){W(oe);return}K.done?L(Q):Promise.resolve(Q).then(H,C)}function w(z){return function(){var L=this,W=arguments;return new Promise(function(H,C){var R=z.apply(L,W);function Z(Q){P(R,H,C,Z,K,"next",Q)}function K(Q){P(R,H,C,Z,K,"throw",Q)}Z(void 0)})}}},924:function(T,B,x){x.d(B,{Z:function(){return P}});function P(w,z,L){return z in w?Object.defineProperty(w,z,{value:L,enumerable:!0,configurable:!0,writable:!0}):w[z]=L,w}},42:function(T,B,x){x.d(B,{Z:function(){return w}});var P=x(924);function w(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(T){var B=ct[T];if(B!==void 0)return B.exports;var x=ct[T]={exports:{}};return ir[T](x,x.exports,I),x.exports}(function(){I.n=function(T){var B=T&&T.__esModule?function(){return T.default}:function(){return T};return I.d(B,{a:B}),B}})(),function(){I.d=function(T,B){for(var x in B)I.o(B,x)&&!I.o(T,x)&&Object.defineProperty(T,x,{enumerable:!0,get:B[x]})}}(),function(){I.o=function(T,B){return Object.prototype.hasOwnProperty.call(T,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 T(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 x(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&&x(e,n)}var w=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&&x(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 R(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,R(this).constructor)}return a.prototype=Object.create(i.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),x(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 k(e){var n=Q();return function(){var i=R(e),a;if(n){var t=R(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return fe(this,a)}}var c=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 D(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},ze=e=>()=>e,p=Oe({CSS2DObject:()=>Yt.CSS2DObject}),l=e=>{var n={};return I.d(n,e),n},g=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(){T(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(c.Mesh,D(a)),this},n.createGroup=function(){return this.object3d=new c.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(c.Points,D(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 c.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,D(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,D(a)),this},n.getSize=function(){var i=new c.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new c.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=+c.REVISION<144,ve=ue?"ExtrudeBufferGeometry":"ExtrudeGeometry",ce=ue?"PlaneBufferGeometry":"PlaneGeometry",Le=function(e){"use strict";P(r,e);var n=k(r);function r(a){T(this,r);var t;return t=n.call(this),t.scale=1,t.options=(0,w.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,b,y,A,_;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,b=s.sprite,y=s.sizeAttenuation,m.next=3,t.getTexture();case 3:return A=m.sent,_=b?new c.SpriteMaterial({map:A,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:v!=null?v:!0,alphaTest:d!=null?d:0,sizeAttenuation:y!=null?y:!0}):new c.MeshBasicMaterial({map:A,transparent:f!=null?f:!1,blending:h!=null?h:c.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,b,y,A,_;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,b=s.sprite,y=v,!(d&&!d.get(y))){m.next=8;break}return d.init(y),m.next=6,t.getMaterial();case 6:A=m.sent,d.set(y,A);case 8:if(!d){m.next=14;break}return m.next=11,d.get(y);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,b?t.createSprite(_):t.createMesh(new c[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 c.TextureLoader().loadAsync(t)},r}(q),Ce=function(e){"use strict";P(r,e);var n=k(r);function r(a){T(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,w.Z)({},{fontSize:28,fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,sans-serif",fontWeight:"normal",flipX:!1,color:"#ffffff",setCtx:function(V){}},s||{}),h=f.fontSize,v=f.fontFamily,d=f.fontWeight,b=f.flipX,y=f.color,A=f.setCtx,_=this.canvas;_.width=h*o.length*2,_.height=h;var u=_.getContext("2d");u.font="".concat(d," ").concat(h,"px/1 ").concat(v);var m=u.measureText(o).width;_.width=m,u=_.getContext("2d"),u.clearRect(0,0,_.width,_.height),b&&u.scale(-1,1),u.font="".concat(d," ").concat(h,"px/1 ").concat(v),u.textBaseline="middle",u.fillStyle=y,A&&A(u),u.fillText(o,b?m*-1:0,_.height/2),u.restore();var j=new c.Texture(_);return j.anisotropy=this.pencil.renderer.capabilities.getMaxAnisotropy(),j.needsUpdate=!0,Promise.resolve(j)},r}(K(Le));function Pe(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=R(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 De(e,n,r){return We(e,n,r)}var lt=function(e){"use strict";P(r,e);var n=k(r);function r(a){T(this,r);var t;return t=n.call(this),t.scale=1,t.options=(0,w.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,b=t.loop,y=t.alphaTest,A=t.sprite,_=se(),u=document.createElement("video");return u.addEventListener("loadedmetadata",function(){var m=new c.VideoTexture(u);m.format=v!=null?v:c.RGBAFormat,m.needsUpdate=!0;var j=A?new c.SpriteMaterial({map:m,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:y!=null?y:0}):new c.MeshBasicMaterial({map:m,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,alphaTest:y!=null?y:0});_.resolve(j)},!1),u.src=o,u.muted=!0,u.autoplay=d,u.loop=b,u.preload="auto",_.promise},i.create=function(){var t=this;return(0,S.Z)(G().mark(function o(){var s,f,h,v,d,b,y,A;return G().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,h=s.position,v=s.src,d=s.cache,b=s.sprite,!(d&&!d.get(v))){u.next=7;break}return d.init(v),u.next=5,t.getMaterial();case 5:y=u.sent,d.set(v,y);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:A=u.t0,t.video=A.map.image,b?t.createSprite(A):t.createMesh(new c[ce](1,1),A),t.setScale(f),h&&t.object3d.position.copy(h);case 21:case"end":return u.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(),De(R(r.prototype),"dispose",this).call(this)},r}(q),ft=function(e){"use strict";P(r,e);var n=k(r);function r(a){T(this,r);var t;return t=n.call(this),t.type_="node",t.options=(0,w.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.event2,d=t.handler2,b=document.createElement("div");this.element=b,b.appendChild(s),this.createCSS2DObject(b),o&&this.object3d.position.copy(o),f&&h&&this.clickTarge.forEach(function(y){y.addEventListener(h,f),d&&v&&y.addEventListener(v,d)})},i.getMaterial=function(t){return(0,S.Z)(G().mark(function o(){var s,f,h,v;return G().wrap(function(b){for(;;)switch(b.prev=b.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 c.CanvasTexture(s),v=new c.SpriteMaterial({map:h,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),b.abrupt("return",v);case 9:case"end":return b.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,f=t.scale,h=f===void 0?new c.Vector3(1,1,1):f,v=t.position,d=v===void 0?new c.Vector3(0,0,0):v,b=t.cache,y=this;return(0,S.Z)(G().mark(function A(){var _,u,m,j;return G().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(_="node-create-pick-object",!(b&&!b.get(_))){M.next=7;break}return b.init(_),M.next=5,y.getMaterial(s);case 5:u=M.sent,b.set(_,u);case 7:if(!b){M.next=13;break}return M.next=10,b.get(_);case 10:M.t0=M.sent,M.next=16;break;case 13:return M.next=15,y.getMaterial(s);case 15:M.t0=M.sent;case 16:m=M.t0,j=new c.Sprite(m),j.scale.set(m.map.image.width*h.x,m.map.image.height*h.y,1),j.position.copy(d),y.add(j),y.pickObject=j;case 22:case"end":return M.stop()}},A)}))()},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)}),De(R(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 D(t.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(q),ht=ft,pt=function(e){"use strict";P(r,e);var n=k(r);function r(){return T(this,r),n.apply(this,arguments)}var i=r.prototype;return i.create=function(){this.createGroup()},r}(q),vt=`
|
|
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 Ve from"d3-geo";import*as rr from"d3-geo-voronoi";import*as nr from"d3-scale";var ir={666:function(T){var G=function(M){"use strict";var S=Object.prototype,x=S.hasOwnProperty,z,j=typeof Symbol=="function"?Symbol:{},V=j.iterator||"@@iterator",H=j.asyncIterator||"@@asyncIterator",E=j.toStringTag||"@@toStringTag";function R(v,l,g){return Object.defineProperty(v,l,{value:g,enumerable:!0,configurable:!0,writable:!0}),v[l]}try{R({},"")}catch(v){R=function(l,g,L){return l[g]=L}}function Z(v,l,g,L){var C=l&&l.prototype instanceof c?l:c,J=Object.create(C.prototype),q=new se(L||[]);return J._invoke=we(v,g,q),J}M.wrap=Z;function K(v,l,g){try{return{type:"normal",arg:v.call(l,g)}}catch(L){return{type:"throw",arg:L}}}var Q="suspendedStart",oe="suspendedYield",pe="executing",fe="completed",k={};function c(){}function O(){}function U(){}var W={};R(W,V,function(){return this});var ie=Object.getPrototypeOf,$=ie&&ie(ie(Oe([])));$&&$!==S&&x.call($,V)&&(W=$);var F=U.prototype=c.prototype=Object.create(W);O.prototype=U,R(F,"constructor",U),R(U,"constructor",O),O.displayName=R(U,E,"GeneratorFunction");function ae(v){["next","throw","return"].forEach(function(l){R(v,l,function(g){return this._invoke(l,g)})})}M.isGeneratorFunction=function(v){var l=typeof v=="function"&&v.constructor;return l?l===O||(l.displayName||l.name)==="GeneratorFunction":!1},M.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,U):(v.__proto__=U,R(v,E,"GeneratorFunction")),v.prototype=Object.create(F),v},M.awrap=function(v){return{__await:v}};function ee(v,l){function g(J,q,ue,ve){var ce=K(v[J],v,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){g("next",Pe,ue,ve)},function(Pe){g("throw",Pe,ue,ve)}):l.resolve(Ce).then(function(Pe){Le.value=Pe,ue(Le)},function(Pe){return g("throw",Pe,ue,ve)})}}var L;function C(J,q){function ue(){return new l(function(ve,ce){g(J,q,ve,ce)})}return L=L?L.then(ue,ue):ue()}this._invoke=C}ae(ee.prototype),R(ee.prototype,H,function(){return this}),M.AsyncIterator=ee,M.async=function(v,l,g,L,C){C===void 0&&(C=Promise);var J=new ee(Z(v,l,g,L),C);return M.isGeneratorFunction(l)?J:J.next().then(function(q){return q.done?q.value:J.next()})};function we(v,l,g){var L=Q;return function(J,q){if(L===pe)throw new Error("Generator is already running");if(L===fe){if(J==="throw")throw q;return ze()}for(g.method=J,g.arg=q;;){var ue=g.delegate;if(ue){var ve=ge(ue,g);if(ve){if(ve===k)continue;return ve}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(L===Q)throw L=fe,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);L=pe;var ce=K(v,l,g);if(ce.type==="normal"){if(L=g.done?fe:oe,ce.arg===k)continue;return{value:ce.arg,done:g.done}}else ce.type==="throw"&&(L=fe,g.method="throw",g.arg=ce.arg)}}}function ge(v,l){var g=v.iterator[l.method];if(g===z){if(l.delegate=null,l.method==="throw"){if(v.iterator.return&&(l.method="return",l.arg=z,ge(v,l),l.method==="throw"))return k;l.method="throw",l.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var L=K(g,v.iterator,l.arg);if(L.type==="throw")return l.method="throw",l.arg=L.arg,l.delegate=null,k;var C=L.arg;if(!C)return l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,k;if(C.done)l[v.resultName]=C.value,l.next=v.nextLoc,l.method!=="return"&&(l.method="next",l.arg=z);else return C;return l.delegate=null,k}ae(F),R(F,E,"Generator"),R(F,V,function(){return this}),R(F,"toString",function(){return"[object Generator]"});function D(v){var l={tryLoc:v[0]};1 in v&&(l.catchLoc=v[1]),2 in v&&(l.finallyLoc=v[2],l.afterLoc=v[3]),this.tryEntries.push(l)}function Y(v){var l=v.completion||{};l.type="normal",delete l.arg,v.completion=l}function se(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(D,this),this.reset(!0)}M.keys=function(v){var l=[];for(var g in v)l.push(g);return l.reverse(),function L(){for(;l.length;){var C=l.pop();if(C in v)return L.value=C,L.done=!1,L}return L.done=!0,L}};function Oe(v){if(v){var l=v[V];if(l)return l.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var g=-1,L=function C(){for(;++g<v.length;)if(x.call(v,g))return C.value=v[g],C.done=!1,C;return C.value=z,C.done=!0,C};return L.next=L}}return{next:ze}}M.values=Oe;function ze(){return{value:z,done:!0}}return se.prototype={constructor:se,reset:function(v){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),!v)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 v=this.tryEntries[0],l=v.completion;if(l.type==="throw")throw l.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var l=this;function g(ve,ce){return J.type="throw",J.arg=v,l.next=ve,ce&&(l.method="next",l.arg=z),!!ce}for(var L=this.tryEntries.length-1;L>=0;--L){var C=this.tryEntries[L],J=C.completion;if(C.tryLoc==="root")return g("end");if(C.tryLoc<=this.prev){var q=x.call(C,"catchLoc"),ue=x.call(C,"finallyLoc");if(q&&ue){if(this.prev<C.catchLoc)return g(C.catchLoc,!0);if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else if(q){if(this.prev<C.catchLoc)return g(C.catchLoc,!0)}else if(ue){if(this.prev<C.finallyLoc)return g(C.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(v,l){for(var g=this.tryEntries.length-1;g>=0;--g){var L=this.tryEntries[g];if(L.tryLoc<=this.prev&&x.call(L,"finallyLoc")&&this.prev<L.finallyLoc){var C=L;break}}C&&(v==="break"||v==="continue")&&C.tryLoc<=l&&l<=C.finallyLoc&&(C=null);var J=C?C.completion:{};return J.type=v,J.arg=l,C?(this.method="next",this.next=C.finallyLoc,k):this.complete(J)},complete:function(v,l){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&l&&(this.next=l),k},finish:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.finallyLoc===v)return this.complete(g.completion,g.afterLoc),Y(g),k}},catch:function(v){for(var l=this.tryEntries.length-1;l>=0;--l){var g=this.tryEntries[l];if(g.tryLoc===v){var L=g.completion;if(L.type==="throw"){var C=L.arg;Y(g)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(v,l,g){return this.delegate={iterator:Oe(v),resultName:l,nextLoc:g},this.method==="next"&&(this.arg=z),k}},M}(T.exports);try{regeneratorRuntime=G}catch(M){typeof globalThis=="object"?globalThis.regeneratorRuntime=G:Function("r","regeneratorRuntime = r")(G)}},695:function(T,G,M){M.d(G,{Z:function(){return S}});function S(x){if(x.geometry&&x.geometry.dispose(),x.material){var z=Array.isArray(x.material)?x.material:[x.material];z.forEach(function(j){var V,H,E,R,Z,K,Q,oe,pe,fe,k,c,O;(V=j.map)===null||V===void 0||V.dispose(),(H=j.lightMap)===null||H===void 0||H.dispose(),(E=j.bumpMap)===null||E===void 0||E.dispose(),(R=j.normalMap)===null||R===void 0||R.dispose(),(Z=j.specularMap)===null||Z===void 0||Z.dispose(),(K=j.envMap)===null||K===void 0||K.dispose(),(Q=j.alphaMap)===null||Q===void 0||Q.dispose(),(oe=j.aoMap)===null||oe===void 0||oe.dispose(),(pe=j.displacementMap)===null||pe===void 0||pe.dispose(),(fe=j.emissiveMap)===null||fe===void 0||fe.dispose(),(k=j.gradientMap)===null||k===void 0||k.dispose(),(c=j.metalnessMap)===null||c===void 0||c.dispose(),(O=j.roughnessMap)===null||O===void 0||O.dispose(),j.dispose()})}}},584:function(T,G,M){M.d(G,{wf:function(){return j.Z}});var S=M(666),x=M.n(S),z=null,j=M(695),V=M(949);function H(k){if(k.material){var c=Array.isArray(k.material)?k.material:[k.material];c.forEach(function(O){var U,W;(U=O.color)===null||U===void 0||U.convertSRGBToLinear(),(W=O.emissive)===null||W===void 0||W.convertSRGBToLinear(),O.map&&(O.map.encoding=THREE.sRGBEncoding),O.emissiveMap&&(O.emissiveMap.encoding=THREE.sRGBEncoding)})}}var E=M(568),R=M(924),Z=M(77),K=M(484),Q=null,oe=null,pe=function(){var k=(0,E.Z)(x().mark(function c(O,U){var W,ie,$,F,ae,ee,we,ge,D;return x().wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return W=U.type,ie=W===void 0?"blob":W,$=U.version,F=$===void 0?"1":$,se.next=4,(0,Z.get)(O);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(O).then(function(Oe){if(Oe.ok)return Oe[ie]();throw new Error}));case 11:we=se.sent,ge=we.res,D=we.err,D||(ae=ge,(0,Z.set)(O,(0,R.Z)({},F,ge)));case 15:return se.abrupt("return",ae?{url:ie==="json"?O:URL.createObjectURL(ae),store:ae}:{url:O});case 16:case"end":return se.stop()}},c)}));return function(O,U){return k.apply(this,arguments)}}(),fe=M(705)},484:function(T,G,M){M.d(G,{Z:function(){return x}});var S=M(42);function x(z){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return z.then(function(V){return(0,S.Z)({err:null,res:V},j)}).catch(function(V){return(0,S.Z)({err:V,res:void 0},j)})}},705:function(T,G,M){M.d(G,{C:function(){return j},y:function(){return z}});var S=M(949),x=new Map,z=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(H,E,R,Z,K){var Q=E[R*3],oe=E[R*3+1],pe=E[Z*3],fe=E[Z*3+1],k=E[K*3],c=E[K*3+1],O;if(x.has(H))O=x.get(H);else{var U=V.box3||new S.Box3;if(!V.box3){var W=H.parameters.shapes.getPoints();U.setFromArray(W.map(function(ee){return[ee.x,ee.y,0]}).flat())}var ie=U.getSize(new S.Vector3);V.split&&(ie.y/=V.split),O={box:U,size:ie},x.set(H,O)}var $=O.box,F=O.size,ae=V.split?1-V.split:0;return[new S.Vector2((Q-$.min.x)/F.x,(oe-$.min.y)/F.y+ae),new S.Vector2((pe-$.min.x)/F.x,(fe-$.min.y)/F.y+ae),new S.Vector2((k-$.min.x)/F.x,(c-$.min.y)/F.y+ae)]},generateSideWallUV:function(H,E,R,Z,K,Q){var oe=E[R*3],pe=E[R*3+1],fe=E[R*3+2],k=E[Z*3],c=E[Z*3+1],O=E[Z*3+2],U=E[K*3],W=E[K*3+1],ie=E[K*3+2],$=E[Q*3],F=E[Q*3+1],ae=E[Q*3+2],ee;if(x.has(E))ee=x.get(E);else{var we=new S.Box3;we.setFromArray(E);var ge=we.getSize(new S.Vector3);V.split&&(ge.z/=1-V.split),ee={box:we,size:ge},x.set(E,ee)}var D=ee.box,Y=ee.size;return Math.abs(pe-c)<Math.abs(oe-k)?[new S.Vector2((oe-D.min.x)/Y.x,(fe-D.min.z)/Y.z),new S.Vector2((k-D.min.x)/Y.x,(O-D.min.z)/Y.z),new S.Vector2((U-D.min.x)/Y.x,(ie-D.min.z)/Y.z),new S.Vector2(($-D.min.x)/Y.x,(ae-D.min.z)/Y.z)]:[new S.Vector2((pe-D.min.y)/Y.y,(fe-D.min.z)/Y.z),new S.Vector2((c-D.min.y)/Y.y,(O-D.min.z)/Y.z),new S.Vector2((W-D.min.y)/Y.y,(ie-D.min.z)/Y.z),new S.Vector2((F-D.min.y)/Y.y,(ae-D.min.z)/Y.z)]}}},j=function(){x.clear()}},77:function(T,G,M){var S=z=>{var j={};return M.d(j,z),j},x=z=>()=>z;T.exports=S({get:()=>ot.get,set:()=>ot.set})},949:function(T){var G=S=>{var x={};return I.d(x,S),x},M=S=>()=>S;T.exports=$t},568:function(T,G,M){M.d(G,{Z:function(){return x}});function S(z,j,V,H,E,R,Z){try{var K=z[R](Z),Q=K.value}catch(oe){V(oe);return}K.done?j(Q):Promise.resolve(Q).then(H,E)}function x(z){return function(){var j=this,V=arguments;return new Promise(function(H,E){var R=z.apply(j,V);function Z(Q){S(R,H,E,Z,K,"next",Q)}function K(Q){S(R,H,E,Z,K,"throw",Q)}Z(void 0)})}}},924:function(T,G,M){M.d(G,{Z:function(){return S}});function S(x,z,j){return z in x?Object.defineProperty(x,z,{value:j,enumerable:!0,configurable:!0,writable:!0}):x[z]=j,x}},42:function(T,G,M){M.d(G,{Z:function(){return x}});var S=M(924);function x(z){for(var j=1;j<arguments.length;j++){var V=arguments[j]!=null?arguments[j]:{},H=Object.keys(V);typeof Object.getOwnPropertySymbols=="function"&&(H=H.concat(Object.getOwnPropertySymbols(V).filter(function(E){return Object.getOwnPropertyDescriptor(V,E).enumerable}))),H.forEach(function(E){(0,S.Z)(z,E,V[E])})}return z}}},ct={};function I(T){var G=ct[T];if(G!==void 0)return G.exports;var M=ct[T]={exports:{}};return ir[T](M,M.exports,I),M.exports}(function(){I.n=function(T){var G=T&&T.__esModule?function(){return T.default}:function(){return T};return I.d(G,{a:G}),G}})(),function(){I.d=function(T,G){for(var M in G)I.o(G,M)&&!I.o(T,M)&&Object.defineProperty(T,M,{enumerable:!0,get:G[M]})}}(),function(){I.o=function(T,G){return Object.prototype.hasOwnProperty.call(T,G)}}();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 T(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function G(e,n){return G=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},G(e,n)}function M(e,n){return G(e,n)}function S(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&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 j(e,n,r){return z()?j=Reflect.construct:j=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},j.apply(null,arguments)}function V(e,n,r){return j.apply(null,arguments)}function H(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},E(e)}function R(e){return E(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 V(i,arguments,R(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 k(e){var n=Q();return function(){var i=R(e),a;if(n){var t=R(this).constructor;a=Reflect.construct(i,arguments,t)}else a=i.apply(this,arguments);return fe(this,a)}}var c=I(949),O=I(568),U=I(666),W=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 D(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},ze=e=>()=>e,v=Oe({CSS2DObject:()=>Yt.CSS2DObject}),l=e=>{var n={};return I.d(n,e),n},g=e=>()=>e,L=l({CSS3DObject:()=>st.CSS3DObject,CSS3DSprite:()=>st.CSS3DSprite}),C=I(584),J=function(e){e&&((0,C.wf)(e),e.children.forEach(function(n){n.userData.BaseObject_||J(n)}))},q=function(){"use strict";function e(){T(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=V(c.Mesh,D(a)),this},n.createGroup=function(){return this.object3d=new c.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=V(c.Points,D(a)),this},n.createCSS2DObject=function(i){return this.object3d=new v.CSS2DObject(i),this},n.createCSS3DObject=function(i){return this.object3d=new L.CSS3DObject(i),this},n.createCSS3DSprite=function(i){return this.object3d=new L.CSS3DSprite(i),this},n.createSprite=function(i){return this.object3d=new c.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,D(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,D(a)),this},n.getSize=function(){var i=new c.Box3().setFromObject(this.object3d);return{min:i.min,max:i.max,size:i.getSize(new c.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=+c.REVISION<144,ve=ue?"ExtrudeBufferGeometry":"ExtrudeGeometry",ce=ue?"PlaneBufferGeometry":"PlaneGeometry",Le=function(e){"use strict";S(r,e);var n=k(r);function r(a){T(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,O.Z)(W().mark(function o(){var s,f,h,p,d,y,b,w,_,u;return W().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return s=t.options,f=s.transparent,h=s.blending,p=s.depthWrite,d=s.depthTest,y=s.alphaTest,b=s.sprite,w=s.sizeAttenuation,A.next=3,t.getTexture();case 3:return _=A.sent,u=b?new c.SpriteMaterial({map:_,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,depthTest:d!=null?d:!0,alphaTest:y!=null?y:0,sizeAttenuation:w!=null?w:!0}):new c.MeshBasicMaterial({map:_,transparent:f!=null?f:!1,blending:h!=null?h:c.NormalBlending,depthWrite:p!=null?p:!0,depthTest:d!=null?d:!0,alphaTest:y!=null?y:0}),A.abrupt("return",u);case 6:case"end":return A.stop()}},o)}))()},i.create=function(){var t=this;return(0,O.Z)(W().mark(function o(){var s,f,h,p,d,y,b,w,_;return W().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(s=t.options,f=s.scale,h=s.position,p=s.src,d=s.cache,y=s.sprite,b=p,!(d&&!d.get(b))){m.next=8;break}return d.init(b),m.next=6,t.getMaterial();case 6:w=m.sent,d.set(b,w);case 8:if(!d){m.next=14;break}return m.next=11,d.get(b);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,y?t.createSprite(_):t.createMesh(new c[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 c.TextureLoader().loadAsync(t)},r}(q),Ce=function(e){"use strict";S(r,e);var n=k(r);function r(a){T(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",setCtx:function(B){}},s||{}),h=f.fontSize,p=f.fontFamily,d=f.fontWeight,y=f.flipX,b=f.color,w=f.setCtx,_=this.canvas;_.width=h*o.length*2,_.height=h;var u=_.getContext("2d");u.font="".concat(d," ").concat(h,"px/1 ").concat(p);var m=u.measureText(o).width;_.width=m,u=_.getContext("2d"),u.clearRect(0,0,_.width,_.height),y&&u.scale(-1,1),u.font="".concat(d," ").concat(h,"px/1 ").concat(p),u.textBaseline="middle",u.fillStyle=b,w&&w(u),u.fillText(o,y?m*-1:0,_.height/2),u.restore();var A=new c.Texture(_);return A.anisotropy=this.pencil.renderer.capabilities.getMaxAnisotropy(),A.needsUpdate=!0,Promise.resolve(A)},r}(K(Le));function Pe(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&(e=R(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 De(e,n,r){return We(e,n,r)}var lt=function(e){"use strict";S(r,e);var n=k(r);function r(a){T(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,p=t.depthTest,d=t.format,y=t.autoPlay,b=t.loop,w=t.alphaTest,_=t.sprite,u=se(),m=document.createElement("video");return m.addEventListener("loadedmetadata",function(){var A=new c.VideoTexture(m);A.format=d!=null?d:c.RGBAFormat,A.needsUpdate=!0;var B=_?new c.SpriteMaterial({map:A,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,depthTest:p!=null?p:!0,alphaTest:w!=null?w:0}):new c.MeshBasicMaterial({map:A,transparent:s!=null?s:!1,blending:f!=null?f:c.NormalBlending,depthWrite:h!=null?h:!0,depthTest:p!=null?p:!0,alphaTest:w!=null?w:0});u.resolve(B)},!1),m.src=o,m.muted=!0,m.autoplay=y,m.loop=b,m.preload="auto",u.promise},i.create=function(){var t=this;return(0,O.Z)(W().mark(function o(){var s,f,h,p,d,y,b,w;return W().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s=t.options,f=s.scale,h=s.position,p=s.src,d=s.cache,y=s.sprite,!(d&&!d.get(p))){u.next=7;break}return d.init(p),u.next=5,t.getMaterial();case 5:b=u.sent,d.set(p,b);case 7:if(!d){u.next=13;break}return u.next=10,d.get(p);case 10:u.t0=u.sent,u.next=16;break;case 13:return u.next=15,t.getMaterial();case 15:u.t0=u.sent;case 16:w=u.t0,t.video=w.map.image,y?t.createSprite(w):t.createMesh(new c[ce](1,1),w),t.setScale(f),h&&t.object3d.position.copy(h);case 21:case"end":return u.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(),De(R(r.prototype),"dispose",this).call(this)},r}(q),ft=function(e){"use strict";S(r,e);var n=k(r);function r(a){T(this,r);var t;return t=n.call(this),t.type_="node",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,p=t.event2,d=t.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(b){b.addEventListener(h,f),d&&p&&b.addEventListener(p,d)})},i.getMaterial=function(t){return(0,O.Z)(W().mark(function o(){var s,f,h,p;return W().wrap(function(y){for(;;)switch(y.prev=y.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 c.CanvasTexture(s),p=new c.SpriteMaterial({map:h,opacity:t?1:0,transparent:!0,alphaTest:.1,sizeAttenuation:!1}),y.abrupt("return",p);case 9:case"end":return y.stop()}},o)}))()},i.createPickObject=function(t){var o=t.show,s=o===void 0?!1:o,f=t.scale,h=f===void 0?new c.Vector3(1,1,1):f,p=t.position,d=p===void 0?new c.Vector3(0,0,0):p,y=t.cache,b=this;return(0,O.Z)(W().mark(function w(){var _,u,m,A;return W().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(_="node-create-pick-object",!(y&&!y.get(_))){P.next=7;break}return y.init(_),P.next=5,b.getMaterial(s);case 5:u=P.sent,y.set(_,u);case 7:if(!y){P.next=13;break}return P.next=10,y.get(_);case 10:P.t0=P.sent,P.next=16;break;case 13:return P.next=15,b.getMaterial(s);case 15:P.t0=P.sent;case 16:m=P.t0,A=new c.Sprite(m),A.scale.set(m.map.image.width*h.x,m.map.image.height*h.y,1),A.position.copy(d),b.add(A),b.pickObject=A;case 22:case"end":return P.stop()}},w)}))()},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(p){p.removeEventListener(s,o),f&&h&&p.removeEventListener(h,f)}),De(R(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 D(t.element.querySelectorAll(f))}).flat();return s}return[this.element]}}]),r}(q),ht=ft,pt=function(e){"use strict";S(r,e);var n=k(r);function r(){return T(this,r),n.apply(this,arguments)}var i=r.prototype;return i.create=function(){this.createGroup()},r}(q),vt=`
|
|
2
2
|
`.concat(c.ShaderChunk.logdepthbuf_pars_vertex,`
|
|
3
3
|
`).concat(c.ShaderChunk.fog_pars_vertex,`
|
|
4
4
|
attribute vec3 previous;
|
|
@@ -129,4 +129,4 @@ void main() {
|
|
|
129
129
|
gl_FragColor.a *= step(vCounters, visibility);
|
|
130
130
|
`).concat(c.ShaderChunk.fog_fragment,`
|
|
131
131
|
}
|
|
132
|
-
`),xe=function(e){"use strict";P(r,e);var n=k(r);function r(){T(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 c.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}(c.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 c.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 c.Matrix4,i=new c.Ray,a=new c.Sphere,t=new c.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 c.Vector3,f=new c.Vector3,h=new c.Vector3,v=this instanceof c.LineSegments?2:1,d=o.index,b=o.attributes;if(d!==null)for(var y=d.array,A=b.position.array,_=b.width.array,u=0,m=y.length-1;u<m;u+=v){var j=y[u],V=y[u+1];s.fromArray(A,j*3),f.fromArray(A,V*3);var M=_[Math.floor(u/3)]!==void 0?_[Math.floor(u/3)]:1,te=e.params.Line.threshold+this.material.lineWidth*M/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:u,face:null,faceIndex:null,object:this}),u=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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function 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},c.ShaderChunk.meshline_vert=vt,c.ShaderChunk.meshline_frag=dt;var Ne=function(e){"use strict";P(r,e);var n=k(r);function r(i){T(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),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}(c.ShaderMaterial);Ne.prototype.copy=function(e){return c.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 c.BufferGeometry,a=new xe;return i.setFromPoints(r),a.setGeometry(i,n),a}var Mt={color:new c.Color("#ffffff"),lineWidth:1},At=function(e){"use strict";P(r,e);var n=k(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r);var t;return t=n.call(this),t.options=(0,w.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,b,y,A,_,u,m,j,V,M,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,b=s.key,y=s.nodes,A=s.nodesArr,_=s.geometry,u=s.geometryArr,m=s.useGroups,j=s.material,V=s.cache,M=s.cacheKey,te=yt(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),X=j,re=_,X){ne.next=16;break}if(le="LineMaterial:".concat(M),V&&!V.get(le)&&(V.init(le),me=t.getMaterial((0,w.Z)({},te)),V.set(le,me)),!V){ne.next=12;break}return ne.next=9,V.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&&y?re=Je({nodes:y,setPointWidth:d}):!re&&A?re=je.mergeBufferGeometries(A.map(function(Ee){return Je({nodes:Ee,setPointWidth:d})}),m!=null?m:!1):!re&&u&&u.length>1?re=je.mergeBufferGeometries(u,m!=null?m:!1):!re&&u&&u.length===1&&(he=ye(u,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,w.Z)({},t),{resolution:new c.Vector2(s,f)}));return h},i.addGeometries=function(t){var o=this.object3d,s=je.mergeBufferGeometries([o.geometry].concat(D(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(b){h.value.x=b.x}});this.tween=d},i.dispose=function(){var t;De(R(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 c.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?v.setIndex(new c.BufferAttribute(h[d].array,h[d].itemSize)):v.setAttribute(d,new c.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:()=>Ve.geoBounds,geoContains:()=>Ve.geoContains,geoDistance:()=>Ve.geoDistance,geoInterpolate:()=>Ve.geoInterpolate}),Gt=e=>{var n={};return I.d(n,e),n},Sr=e=>()=>e,Wt=Gt({geoVoronoi:()=>rr.geoVoronoi}),Vt=e=>{var n={};return I.d(n,e),n},Or=e=>()=>e,Qe=Vt({scaleLinear:()=>nr.scaleLinear});function zt(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 Dt(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(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],b=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},y=[],A=d[0];A<=d[1];A++){var _=f(A);b(_)&&y.push([_,h(A)])}return y}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 Dt(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=zt(e,i),t=(0,ke.merge)(a),o=Ut(e,i),s=D(t).concat(D(o)),f={type:"Polygon",coordinates:e},h=ye((0,Te.geoBounds)(f),2),v=ye(h[0],2),d=v[0],b=v[1],y=ye(h[1],2),A=y[0],_=y[1],u=d>A||_>=89||b<=-89,m=[];if(u){var j=(0,Wt.geoVoronoi)(s).triangles(),V=new Map(s.map(function(N,Me){var _e=ye(N,2),be=_e[0],Be=_e[1];return["".concat(be,"-").concat(Be),Me]}));j.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);V.has(at)&&be.push(V.get(at))}),be.length===3){if(be.some(function(Ge){return Ge<t.length})){var Be=N.properties.circumcenter;if(!Ze(Be,f,u))return}(Me=m).push.apply(Me,D(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,u))return"continue"}(_e=m).push.apply(_e,D(be))},me=kt.default.from(s),he=0,Se=me.triangles.length;he<Se;he+=3)le(he,Se);else{var M=Ie.default.flatten(a),te=M.vertices,X=M.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 c.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),b=0,y=[],A=0;A<v;A++){var _=A+1;if(_===v)_=b;else if(d.has(_)){var u=_;_=b,b=u}y.push(A,A+v,_+v),y.push(_+v,_,A)}for(var m=[],j=1;j>=0;j--)for(var V=0;V<v;V+=1)m.push(V/(v-1),j);return{indices:y,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=k(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T(this,r);var t;t=n.call(this),t.type="PolygonBufferGeometry",t.parameters=(0,w.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,b=o.curvatureResolution,y=o.cartesian,A=o.userDataRsoOffset;(0,Et.default)(i[0])||i[0].reverse();var _=It(i,{resolution:b}),u=_.contour,m=_.triangles,j=(0,ke.merge)(m.uvs),V=[],M=[],te=[],X=0,re=function(me){var he=Math.round(V.length/3),Se=te.length;V=V.concat(me.vertices),M=M.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(u,s,f,y);re(le),t.userData.rso=A?et(u,s,f+A,y):le}return h&&re(tt(m,s,j,!1,y)),v&&re(tt(m,f,j,!0,y)),t.setIndex(te),t[qe]("position",new c.Float32BufferAttribute(V,3)),t[qe]("uv",new c.Float32BufferAttribute(M,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),Ft=function(e){"use strict";P(r,e);var n=k(r);function r(a){T(this,r);var t;return t=n.call(this),t.options=(0,w.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,b=t.cartesian,y=new Zt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:h,curvatureResolution:v,cartesian:b,userDataRsoOffset:d});this.createMesh(y,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 c[ve](new c.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=k(r);function r(a){T(this,r);var t;return t=n.call(this),t.options=$e((0,w.Z)({depth:1},a),{materialOptions:(0,w.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,b,y,A,_,u,m,j,V,M,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,b=s.geometry,y=s.geometryArr,A=s.material,_=s.materialOptions,u=s.cache,m=s.box3,j=0,V=Array.isArray(d)?d:[d],M=Array.isArray(m)?m:[m],te=A,X=b,!(!te&&_)){N.next=26;break}if(j=_.split,re=_.topColor,le=_.sideColor,me=_.sideMap,he="ExtrudePolygonMaterial:".concat(le||me).concat(re||""),!(u&&!u.get(he))){N.next=16;break}return u.init(he),N.next=14,t.getMaterial(_);case 14:Se=N.sent,u.set(he,Se);case 16:if(!u){N.next=22;break}return N.next=19,u.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:V[0],split:j,box3:M[0]}):!X&&h?X=je.mergeBufferGeometries(h.map(function(Me,_e){return nt({points:Me,depth:(ne=V[_e])!==null&&ne!==void 0?ne:V[0],split:j,box3:(Ee=M[_e])!==null&&Ee!==void 0?Ee:M[0]})}),v!=null?v:!1):!X&&y&&y.length>1?X=je.mergeBufferGeometries(y,v!=null?v:!1):!X&&y&&y.length===1&&(Re=ye(y,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(D(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,b=t.createCanvasObjectURL,y=t.split,A=t.maxAnisotropy;return new Promise(function(_){var u=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var m=y,j=document.createElement("canvas"),V=j.getContext("2d");j.height=u.height/(1-m),j.width=u.width,m&&s&&(V.fillStyle=s,V.fillRect(0,0,u.width,j.height*m)),h&&u instanceof HTMLImageElement?V.drawImage(u,0,j.height*m,u.width,u.height):f&&(V.fillStyle=f,V.fillRect(0,j.height*m,u.width,u.height)),b&&j.toBlob(function(X){console.log(URL.createObjectURL(X))});var M=new c.CanvasTexture(j);M.anisotropy=A||o.pencil.renderer.capabilities.getMaxAnisotropy();var te=new c[v||"MeshBasicMaterial"]((0,w.Z)({map:M},d||{}));_(te)},h?u.src=h:u instanceof HTMLImageElement||u.onload()})},i.setMaterialColor=function(t){var o=this;return(0,S.Z)(G().mark(function s(){var f,h,v,d,b,y,A,_,u,m,j;return G().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(f=o.options,h=f.materialOptions,v=f.cache,d=h.sideColor,b=h.sideMap,y=h.topColor,A=t.sideColor,_=t.topColor,!(_||A)){M.next=22;break}if(u="ExtrudePolygonMaterial:".concat(A||d||b||"").concat(_||y||""),!(v&&!v.get(u))){M.next=11;break}return v.init(u),M.next=9,o.getMaterial((0,w.Z)({},h,t));case 9:m=M.sent,v.set(u,m);case 11:if(!v){M.next=17;break}return M.next=14,v.get(u);case 14:M.t0=M.sent,M.next=20;break;case 17:return M.next=19,o.getMaterial((0,w.Z)({},h,t));case 19:M.t0=M.sent;case 20:j=M.t0,o.object3d.material=j;case 22:case"end":return M.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 c.BufferGeometry;Object.keys(v).forEach(function(b){d.setAttribute(b,new c.BufferAttribute(v[b].array,v[b].itemSize))}),f(d)}catch(b){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};
|
|
132
|
+
`),xe=function(e){"use strict";S(r,e);var n=k(r);function r(){T(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 c.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}(c.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 c.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 c.Matrix4,i=new c.Ray,a=new c.Sphere,t=new c.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 c.Vector3,f=new c.Vector3,h=new c.Vector3,p=this instanceof c.LineSegments?2:1,d=o.index,y=o.attributes;if(d!==null)for(var b=d.array,w=y.position.array,_=y.width.array,u=0,m=b.length-1;u<m;u+=p){var A=b[u],B=b[u+1];s.fromArray(w,A*3),f.fromArray(w,B*3);var P=_[Math.floor(u/3)]!==void 0?_[Math.floor(u/3)]:1,te=e.params.Line.threshold+this.material.lineWidth*P/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:u,face:null,faceIndex:null,object:this}),u=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 c.BufferAttribute(new Float32Array(this.positions),3),previous:new c.BufferAttribute(new Float32Array(this.previous),3),next:new c.BufferAttribute(new Float32Array(this.next),3),side:new c.BufferAttribute(new Float32Array(this.side),1),width:new c.BufferAttribute(new Float32Array(this.width),1),uv:new c.BufferAttribute(new Float32Array(this.uvs),2),index:new c.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new c.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function 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},c.ShaderChunk.meshline_vert=vt,c.ShaderChunk.meshline_frag=dt;var Ne=function(e){"use strict";S(r,e);var n=k(r);function r(i){T(this,r);var a;return a=n.call(this,{uniforms:Object.assign({},c.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new c.Color(16777215)},opacity:{value:1},resolution:{value:new c.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new c.Vector2(1,1)},offset:{value:new c.Vector2(1,1)},lineLightAnimation:{value:1},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new c.Vector2(0,0)},lightColor:{value:new c.Color(16777215)}}),vertexShader:c.ShaderChunk.meshline_vert,fragmentShader:c.ShaderChunk.meshline_frag}),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}(c.ShaderMaterial);Ne.prototype.copy=function(e){return c.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 c.BufferGeometry,a=new xe;return i.setFromPoints(r),a.setGeometry(i,n),a}var Mt={color:new c.Color("#ffffff"),lineWidth:1},At=function(e){"use strict";S(r,e);var n=k(r);function r(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(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,O.Z)(W().mark(function o(){var s,f,h,p,d,y,b,w,_,u,m,A,B,P,te,X,re,le,me,he;return W().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:if(s=t.options,f=s.duration,h=s.delay,p=s.onComplete,d=s.setPointWidth,y=s.key,b=s.nodes,w=s.nodesArr,_=s.geometry,u=s.geometryArr,m=s.useGroups,A=s.material,B=s.cache,P=s.cacheKey,te=yt(s,["duration","delay","onComplete","setPointWidth","key","nodes","nodesArr","geometry","geometryArr","useGroups","material","cache","cacheKey"]),X=A,re=_,X){ne.next=16;break}if(le="LineMaterial:".concat(P),B&&!B.get(le)&&(B.init(le),me=t.getMaterial((0,x.Z)({},te)),B.set(le,me)),!B){ne.next=12;break}return ne.next=9,B.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&&b?re=Je({nodes:b,setPointWidth:d}):!re&&w?re=je.mergeBufferGeometries(w.map(function(Ee){return Je({nodes:Ee,setPointWidth:d})}),m!=null?m:!1):!re&&u&&u.length>1?re=je.mergeBufferGeometries(u,m!=null?m:!1):!re&&u&&u.length===1&&(he=ye(u,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 c.Vector2(s,f)}));return h},i.addGeometries=function(t){var o=this.object3d,s=je.mergeBufferGeometries([o.geometry].concat(D(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,p=s!=null?s:0,d=(0,Ye.animate)({from:h.value,to:{x:0},duration:o!=null?o:1e3,elapsed:-p,repeat:1/0,onComplete:f,ease:Ye.linear,onUpdate:function(y){h.value.x=y.x}});this.tween=d},i.dispose=function(){var t;De(R(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 p=new c.BufferGeometry;Object.keys(h).forEach(function(d){d==="index"?p.setIndex(new c.BufferAttribute(h[d].array,h[d].itemSize)):p.setAttribute(d,new c.BufferAttribute(h[d].array,h[d].itemSize))}),s(p)}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:()=>Ve.geoBounds,geoContains:()=>Ve.geoContains,geoDistance:()=>Ve.geoDistance,geoInterpolate:()=>Ve.geoInterpolate}),Gt=e=>{var n={};return I.d(n,e),n},Sr=e=>()=>e,Wt=Gt({geoVoronoi:()=>rr.geoVoronoi}),Vt=e=>{var n={};return I.d(n,e),n},Or=e=>()=>e,Qe=Vt({scaleLinear:()=>nr.scaleLinear});function zt(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 Dt(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(u){return u/s*360%360-180},h=function(u){return Math.acos(2*u/o-1)/Math.PI*180-90},p=function(u){return o*(Math.cos((u+90)*Math.PI/180)+1)/2},d=[t!==void 0?Math.ceil(p(t)):0,a!==void 0?Math.floor(p(a)):o-1],y=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},b=[],w=d[0];w<=d[1];w++){var _=f(w);y(_)&&b.push([_,h(w)])}return b}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 p=t>f||h>=89||o<=-89;return Dt(n,{minLng:t,maxLng:f,minLat:o,maxLat:h}).filter(function(d){return Ze(d,r,p)})}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=zt(e,i),t=(0,ke.merge)(a),o=Ut(e,i),s=D(t).concat(D(o)),f={type:"Polygon",coordinates:e},h=ye((0,Te.geoBounds)(f),2),p=ye(h[0],2),d=p[0],y=p[1],b=ye(h[1],2),w=b[0],_=b[1],u=d>w||_>=89||y<=-89,m=[];if(u){var A=(0,Wt.geoVoronoi)(s).triangles(),B=new Map(s.map(function(N,Me){var _e=ye(N,2),be=_e[0],Be=_e[1];return["".concat(be,"-").concat(Be),Me]}));A.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);B.has(at)&&be.push(B.get(at))}),be.length===3){if(be.some(function(Ge){return Ge<t.length})){var Be=N.properties.circumcenter;if(!Ze(Be,f,u))return}(Me=m).push.apply(Me,D(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,u))return"continue"}(_e=m).push.apply(_e,D(be))},me=kt.default.from(s),he=0,Se=me.triangles.length;he<Se;he+=3)le(he,Se);else{var P=Ie.default.flatten(a),te=P.vertices,X=P.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 c.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]),p=Math.round(f.length/3),d=new Set(o),y=0,b=[],w=0;w<p;w++){var _=w+1;if(_===p)_=y;else if(d.has(_)){var u=_;_=y,y=u}b.push(w,w+p,_+p),b.push(_+p,_,w)}for(var m=[],A=1;A>=0;A--)for(var B=0;B<p;B+=1)m.push(B/(p-1),A);return{indices:b,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";S(r,e);var n=k(r);function r(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T(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,p=o.closedTop,d=o.includeSides,y=o.curvatureResolution,b=o.cartesian,w=o.userDataRsoOffset;(0,Et.default)(i[0])||i[0].reverse();var _=It(i,{resolution:y}),u=_.contour,m=_.triangles,A=(0,ke.merge)(m.uvs),B=[],P=[],te=[],X=0,re=function(me){var he=Math.round(B.length/3),Se=te.length;B=B.concat(me.vertices),P=P.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(u,s,f,b);re(le),t.userData.rso=w?et(u,s,f+w,b):le}return h&&re(tt(m,s,A,!1,b)),p&&re(tt(m,f,A,!0,b)),t.setIndex(te),t[qe]("position",new c.Float32BufferAttribute(B,3)),t[qe]("uv",new c.Float32BufferAttribute(P,2)),t.computeVertexNormals(),t}return r}(c.BufferGeometry),Ft=function(e){"use strict";S(r,e);var n=k(r);function r(a){T(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,p=t.curvatureResolution,d=t.userDataRsoOffset,y=t.cartesian,b=new Zt(this.options.geojson,{startHeight:o,endHeight:o+s,closedBottom:f,closedTop:h,curvatureResolution:p,cartesian:y,userDataRsoOffset:d});this.createMesh(b,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 c[ve](new c.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";S(r,e);var n=k(r);function r(a){T(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,O.Z)(W().mark(function o(){var s,f,h,p,d,y,b,w,_,u,m,A,B,P,te,X,re,le,me,he,Se,ne,Ee,Re;return W().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(s=t.options,f=s.points,h=s.pointsArr,p=s.useGroups,d=s.depth,y=s.geometry,b=s.geometryArr,w=s.material,_=s.materialOptions,u=s.cache,m=s.box3,A=0,B=Array.isArray(d)?d:[d],P=Array.isArray(m)?m:[m],te=w,X=y,!(!te&&_)){N.next=26;break}if(A=_.split,re=_.topColor,le=_.sideColor,me=_.sideMap,he="ExtrudePolygonMaterial:".concat(le||me).concat(re||""),!(u&&!u.get(he))){N.next=16;break}return u.init(he),N.next=14,t.getMaterial(_);case 14:Se=N.sent,u.set(he,Se);case 16:if(!u){N.next=22;break}return N.next=19,u.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:B[0],split:A,box3:P[0]}):!X&&h?X=je.mergeBufferGeometries(h.map(function(Me,_e){return nt({points:Me,depth:(ne=B[_e])!==null&&ne!==void 0?ne:B[0],split:A,box3:(Ee=P[_e])!==null&&Ee!==void 0?Ee:P[0]})}),p!=null?p:!1):!X&&b&&b.length>1?X=je.mergeBufferGeometries(b,p!=null?p:!1):!X&&b&&b.length===1&&(Re=ye(b,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(D(t)),!1);o.geometry=s},i.getMaterial=function(t){var o=this,s=t.topColor,f=t.sideColor,h=t.sideMap,p=t.type,d=t.parameters,y=t.createCanvasObjectURL,b=t.split,w=t.maxAnisotropy;return new Promise(function(_){var u=h?document.createElement("img"):{src:"",onload:function(){},width:1024,height:1024};u.onload=function(){var m=b,A=document.createElement("canvas"),B=A.getContext("2d");A.height=u.height/(1-m),A.width=u.width,m&&s&&(B.fillStyle=s,B.fillRect(0,0,u.width,A.height*m)),h&&u instanceof HTMLImageElement?B.drawImage(u,0,A.height*m,u.width,u.height):f&&(B.fillStyle=f,B.fillRect(0,A.height*m,u.width,u.height)),y&&A.toBlob(function(X){console.log(URL.createObjectURL(X))});var P=new c.CanvasTexture(A);P.anisotropy=w||o.pencil.renderer.capabilities.getMaxAnisotropy();var te=new c[p||"MeshBasicMaterial"]((0,x.Z)({map:P},d||{}));_(te)},h?u.src=h:u instanceof HTMLImageElement||u.onload()})},i.setMaterialColor=function(t){var o=this;return(0,O.Z)(W().mark(function s(){var f,h,p,d,y,b,w,_,u,m,A;return W().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(f=o.options,h=f.materialOptions,p=f.cache,d=h.sideColor,y=h.sideMap,b=h.topColor,w=t.sideColor,_=t.topColor,!(_||w)){P.next=22;break}if(u="ExtrudePolygonMaterial:".concat(w||d||y||"").concat(_||b||""),!(p&&!p.get(u))){P.next=11;break}return p.init(u),P.next=9,o.getMaterial((0,x.Z)({},h,t));case 9:m=P.sent,p.set(u,m);case 11:if(!p){P.next=17;break}return P.next=14,p.get(u);case 14:P.t0=P.sent,P.next=20;break;case 17:return P.next=19,o.getMaterial((0,x.Z)({},h,t));case 19:P.t0=P.sent;case 20:A=P.t0,o.object3d.material=A;case 22:case"end":return P.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(p){try{var d=new c.BufferGeometry;Object.keys(p).forEach(function(y){d.setAttribute(y,new c.BufferAttribute(p[y].array,p[y].itemSize))}),f(d)}catch(y){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};
|