gl-draw 0.4.5 → 0.4.7

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.
@@ -1 +1 @@
1
- import*as F from"three";import*as Y from"idb-keyval";var Q={666:function(v){var c=function(o){"use strict";var s=Object.prototype,u=s.hasOwnProperty,a,n=typeof Symbol=="function"?Symbol:{},e=n.iterator||"@@iterator",f=n.asyncIterator||"@@asyncIterator",_=n.toStringTag||"@@toStringTag";function d(r,t,i){return Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{d({},"")}catch(r){d=function(t,i,p){return t[i]=p}}function g(r,t,i,p){var l=t&&t.prototype instanceof Z?t:Z,C=Object.create(l.prototype),U=new T(p||[]);return C._invoke=h(r,i,U),C}o.wrap=g;function E(r,t,i){try{return{type:"normal",arg:r.call(t,i)}}catch(p){return{type:"throw",arg:p}}}var O="suspendedStart",V="suspendedYield",z="executing",x="completed",M={};function Z(){}function A(){}function G(){}var K={};d(K,e,function(){return this});var B=Object.getPrototypeOf,j=B&&B(B(W([])));j&&j!==s&&u.call(j,e)&&(K=j);var w=G.prototype=Z.prototype=Object.create(K);A.prototype=G,d(w,"constructor",G),d(G,"constructor",A),A.displayName=d(G,_,"GeneratorFunction");function k(r){["next","throw","return"].forEach(function(t){d(r,t,function(i){return this._invoke(t,i)})})}o.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===A||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,G):(r.__proto__=G,d(r,_,"GeneratorFunction")),r.prototype=Object.create(w),r},o.awrap=function(r){return{__await:r}};function m(r,t){function i(C,U,D,I){var R=E(r[C],r,U);if(R.type==="throw")I(R.arg);else{var J=R.arg,$=J.value;return $&&typeof $=="object"&&u.call($,"__await")?t.resolve($.__await).then(function(N){i("next",N,D,I)},function(N){i("throw",N,D,I)}):t.resolve($).then(function(N){J.value=N,D(J)},function(N){return i("throw",N,D,I)})}}var p;function l(C,U){function D(){return new t(function(I,R){i(C,U,I,R)})}return p=p?p.then(D,D):D()}this._invoke=l}k(m.prototype),d(m.prototype,f,function(){return this}),o.AsyncIterator=m,o.async=function(r,t,i,p,l){l===void 0&&(l=Promise);var C=new m(g(r,t,i,p),l);return o.isGeneratorFunction(t)?C:C.next().then(function(U){return U.done?U.value:C.next()})};function h(r,t,i){var p=O;return function(C,U){if(p===z)throw new Error("Generator is already running");if(p===x){if(C==="throw")throw U;return X()}for(i.method=C,i.arg=U;;){var D=i.delegate;if(D){var I=L(D,i);if(I){if(I===M)continue;return I}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p===O)throw p=x,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p=z;var R=E(r,t,i);if(R.type==="normal"){if(p=i.done?x:V,R.arg===M)continue;return{value:R.arg,done:i.done}}else R.type==="throw"&&(p=x,i.method="throw",i.arg=R.arg)}}}function L(r,t){var i=r.iterator[t.method];if(i===a){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=a,L(r,t),t.method==="throw"))return M;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return M}var p=E(i,r.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,M;var l=p.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,M;if(l.done)t[r.resultName]=l.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return l;return t.delegate=null,M}k(w),d(w,_,"Generator"),d(w,e,function(){return this}),d(w,"toString",function(){return"[object Generator]"});function y(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function b(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function T(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(y,this),this.reset(!0)}o.keys=function(r){var t=[];for(var i in r)t.push(i);return t.reverse(),function p(){for(;t.length;){var l=t.pop();if(l in r)return p.value=l,p.done=!1,p}return p.done=!0,p}};function W(r){if(r){var t=r[e];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var i=-1,p=function l(){for(;++i<r.length;)if(u.call(r,i))return l.value=r[i],l.done=!1,l;return l.value=a,l.done=!0,l};return p.next=p}}return{next:X}}o.values=W;function X(){return{value:a,done:!0}}return T.prototype={constructor:T,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(b),!r)for(var t in this)t.charAt(0)==="t"&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},stop:function(){this.done=!0;var r=this.tryEntries[0],t=r.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function i(I,R){return C.type="throw",C.arg=r,t.next=I,R&&(t.method="next",t.arg=a),!!R}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],C=l.completion;if(l.tryLoc==="root")return i("end");if(l.tryLoc<=this.prev){var U=u.call(l,"catchLoc"),D=u.call(l,"finallyLoc");if(U&&D){if(this.prev<l.catchLoc)return i(l.catchLoc,!0);if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else if(U){if(this.prev<l.catchLoc)return i(l.catchLoc,!0)}else if(D){if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc<=this.prev&&u.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;break}}l&&(r==="break"||r==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var C=l?l.completion:{};return C.type=r,C.arg=t,l?(this.method="next",this.next=l.finallyLoc,M):this.complete(C)},complete:function(r,t){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&t&&(this.next=t),M},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===r)return this.complete(i.completion,i.afterLoc),b(i),M}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===r){var p=i.completion;if(p.type==="throw"){var l=p.arg;b(i)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,i){return this.delegate={iterator:W(r),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=a),M}},o}(v.exports);try{regeneratorRuntime=c}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},695:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(u.geometry&&u.geometry.dispose(),u.material){var a=Array.isArray(u.material)?u.material:[u.material];a.forEach(function(n){var e,f,_,d,g,E,O,V,z,x,M,Z,A;(e=n.map)===null||e===void 0||e.dispose(),(f=n.lightMap)===null||f===void 0||f.dispose(),(_=n.bumpMap)===null||_===void 0||_.dispose(),(d=n.normalMap)===null||d===void 0||d.dispose(),(g=n.specularMap)===null||g===void 0||g.dispose(),(E=n.envMap)===null||E===void 0||E.dispose(),(O=n.alphaMap)===null||O===void 0||O.dispose(),(V=n.aoMap)===null||V===void 0||V.dispose(),(z=n.displacementMap)===null||z===void 0||z.dispose(),(x=n.emissiveMap)===null||x===void 0||x.dispose(),(M=n.gradientMap)===null||M===void 0||M.dispose(),(Z=n.metalnessMap)===null||Z===void 0||Z.dispose(),(A=n.roughnessMap)===null||A===void 0||A.dispose(),n.dispose()})}}},490:function(v,c,o){o.d(c,{U:function(){return u},v:function(){return s}});var s=function(a){for(var n=a.offsetLeft,e=a.offsetParent;e!==null;)n+=e.offsetLeft,e=e.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollLeft:f=document.documentElement.scrollLeft,n-f},u=function(a){for(var n=a.offsetTop,e=a.offsetParent;e!==null;)n+=e.offsetTop,e=e.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollTop:f=document.documentElement.scrollTop,n-f}},738:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a){return Object.prototype.toString.call(a)==="[object Object]"}function u(a){if(s(a)===!1)return!1;var n=a.constructor;if(n===void 0)return!0;var e=n.prototype;return!(s(e)===!1||e.hasOwnProperty("isPrototypeOf")===!1)}},282:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(484);function u(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e={};return e.promise=new Promise(function(f,_){e.resolve=f,e.reject=_}),a&&(e.promise=(0,s.Z)(e.promise,n)),e}},713:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,e=(90-a)*Math.PI/180,f=(90-u)*Math.PI/180;return[n*Math.sin(e)*Math.cos(f),n*Math.cos(e),n*Math.sin(e)*Math.sin(f)]}},618:function(v,c,o){o.d(c,{Z:function(){return a}});var s=o(438),u=function(){"use strict";function n(f){(0,s.Z)(this,n),this.onTick_=f,this.cancelPending_=null}var e=n.prototype;return e.tickAfter=function(_){var d=this;this.stop();var g=!0,E;this.cancelPending_=function(){clearTimeout(E),g=!1};var O=function(){g&&d.onTick_()};return E=window.setTimeout(O,_),this},e.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},n}(),a=function(){"use strict";function n(f){(0,s.Z)(this,n),this.onTick_=f,this.ticker_=null}var e=n.prototype;return e.tickNow=function(){return this.stop(),this.onTick_(),this},e.tickAfter=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){d.onTick_()}).tickAfter(_),this},e.tickEvery=function(_){var d=this;return this.stop(),this.ticker_=new u(function(){var g;(g=d.ticker_)===null||g===void 0||g.tickAfter(_),d.onTick_()}).tickAfter(_),this},e.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},n}()},484:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(42);function u(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(e){return(0,s.Z)({err:null,res:e},n)}).catch(function(e){return(0,s.Z)({err:e,res:void 0},n)})}},705:function(v,c,o){o.d(c,{C:function(){return n},y:function(){return a}});var s=o(949),u=new Map,a=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(f,_,d,g,E){var O=_[d*3],V=_[d*3+1],z=_[g*3],x=_[g*3+1],M=_[E*3],Z=_[E*3+1],A;if(u.has(f))A=u.get(f);else{var G=e.box3||new s.Box3;if(!e.box3){var K=f.parameters.shapes.getPoints();G.setFromArray(K.map(function(m){return[m.x,m.y,0]}).flat())}var B=G.getSize(new s.Vector3);e.split&&(B.y/=e.split),A={box:G,size:B},u.set(f,A)}var j=A.box,w=A.size,k=e.split?1-e.split:0;return[new s.Vector2((O-j.min.x)/w.x,(V-j.min.y)/w.y+k),new s.Vector2((z-j.min.x)/w.x,(x-j.min.y)/w.y+k),new s.Vector2((M-j.min.x)/w.x,(Z-j.min.y)/w.y+k)]},generateSideWallUV:function(f,_,d,g,E,O){var V=_[d*3],z=_[d*3+1],x=_[d*3+2],M=_[g*3],Z=_[g*3+1],A=_[g*3+2],G=_[E*3],K=_[E*3+1],B=_[E*3+2],j=_[O*3],w=_[O*3+1],k=_[O*3+2],m;if(u.has(_))m=u.get(_);else{var h=new s.Box3;h.setFromArray(_);var L=h.getSize(new s.Vector3);e.split&&(L.z/=1-e.split),m={box:h,size:L},u.set(_,m)}var y=m.box,b=m.size;return Math.abs(z-Z)<Math.abs(V-M)?[new s.Vector2((V-y.min.x)/b.x,(x-y.min.z)/b.z),new s.Vector2((M-y.min.x)/b.x,(A-y.min.z)/b.z),new s.Vector2((G-y.min.x)/b.x,(B-y.min.z)/b.z),new s.Vector2((j-y.min.x)/b.x,(k-y.min.z)/b.z)]:[new s.Vector2((z-y.min.y)/b.y,(x-y.min.z)/b.z),new s.Vector2((Z-y.min.y)/b.y,(A-y.min.z)/b.z),new s.Vector2((K-y.min.y)/b.y,(B-y.min.z)/b.z),new s.Vector2((w-y.min.y)/b.y,(k-y.min.z)/b.z)]}}},n=function(){u.clear()}},949:function(v,c,o){var s=a=>{var n={};return o.d(n,a),n},u=a=>()=>a;v.exports=s({Box3:()=>F.Box3,Vector2:()=>F.Vector2,Vector3:()=>F.Vector3,sRGBEncoding:()=>F.sRGBEncoding})},943:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){(a==null||a>u.length)&&(a=u.length);for(var n=0,e=new Array(a);n<a;n++)e[n]=u[n];return e}},982:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a){if(Array.isArray(a))return(0,s.Z)(a)}},568:function(v,c,o){o.d(c,{Z:function(){return u}});function s(a,n,e,f,_,d,g){try{var E=a[d](g),O=E.value}catch(V){e(V);return}E.done?n(O):Promise.resolve(O).then(f,_)}function u(a){return function(){var n=this,e=arguments;return new Promise(function(f,_){var d=a.apply(n,e);function g(O){s(d,f,_,g,E,"next",O)}function E(O){s(d,f,_,g,E,"throw",O)}g(void 0)})}}},438:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a){if(!(u instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u,a,n){return a in u?Object.defineProperty(u,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):u[a]=n,u}},375:function(v,c,o){o.d(c,{Z:function(){return s}});function s(u){if(typeof Symbol!="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}},270:function(v,c,o){o.d(c,{Z:function(){return s}});function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(924);function u(a){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{},f=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(e).filter(function(_){return Object.getOwnPropertyDescriptor(e,_).enumerable}))),f.forEach(function(_){(0,s.Z)(a,_,e[_])})}return a}},342:function(v,c,o){o.d(c,{Z:function(){return e}});var s=o(982),u=o(375),a=o(270),n=o(566);function e(f){return(0,s.Z)(f)||(0,u.Z)(f)||(0,n.Z)(f)||(0,a.Z)()}},566:function(v,c,o){o.d(c,{Z:function(){return u}});var s=o(943);function u(a,n){if(!!a){if(typeof a=="string")return(0,s.Z)(a,n);var e=Object.prototype.toString.call(a).slice(8,-1);if(e==="Object"&&a.constructor&&(e=a.constructor.name),e==="Map"||e==="Set")return Array.from(e);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return(0,s.Z)(a,n)}}}},H={};function P(v){var c=H[v];if(c!==void 0)return c.exports;var o=H[v]={exports:{}};return Q[v](o,o.exports,P),o.exports}(function(){P.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return P.d(c,{a:c}),c}})(),function(){P.d=function(v,c){for(var o in c)P.o(c,o)&&!P.o(v,o)&&Object.defineProperty(v,o,{enumerable:!0,get:c[o]})}}(),function(){P.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)}}();var S={};(function(){P.d(S,{qo:function(){return _},B7:function(){return o.Z},CL:function(){return j.C},eK:function(){return G},LK:function(){return A},ZL:function(){return O},wf:function(){return g.Z},lJ:function(){return K},vP:function(){return B.v},Up:function(){return B.U},y_:function(){return j.y},PO:function(){return V.Z},Mf:function(){return v.Z},Rl:function(){return d.Z},to:function(){return c.Z}});var v=P(282),c=P(484),o=P(618),s=P(568),u=P(438),a=P(42),n=P(342),e=P(666),f=P.n(e),_=function(){"use strict";function w(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,u.Z)(this,w),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},m)}var k=w.prototype;return k.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},k.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},k.stop=function(){return this.traverse(function(h){return h.stop1()}),this},k.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},k.play=function(){var h=this;return(0,s.Z)(f().mark(function L(){var y;return f().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(y=h.chainedList[h.index],!(y&&h.isPlaying)){T.next=9;break}return T.next=4,Promise.all(y.map(function(W){return typeof W=="function"?W(h.repeatCount):W.start()}));case 4:return h.index+=1,T.next=7,h.play();case 7:T.next=17;break;case 9:if(!(!y&&h.isPlaying&&h.repeatCount<h.repeatNum)){T.next=16;break}return h.repeatCount+=1,h.index=0,T.next=14,h.play();case 14:T.next=17;break;case 16:!y&&h.isPlaying&&h.repeatCount===h.repeatNum&&h.stop();case 17:case"end":return T.stop()}},L)}))()},k.chain=function(){for(var h=arguments.length,L=new Array(h),y=0;y<h;y++)L[y]=arguments[y];var b=this;return(0,n.Z)(L).forEach(function(T){T instanceof w&&b.children.push(T)}),this.chainedList.push((0,n.Z)(L)),this},k.repeat=function(h){return this.repeatNum=h,this},k.timeout=function(h){return this.chain(function(){return new Promise(function(L){return setTimeout(L,h)})}),this},k.traverse=function(h){h(this),this.children.forEach(function(L){L.traverse(h)})},w}(),d=P(713),g=P(695),E=P(949);function O(w){if(w.material){var k=Array.isArray(w.material)?w.material:[w.material];k.forEach(function(m){var h,L;(h=m.color)===null||h===void 0||h.convertSRGBToLinear(),(L=m.emissive)===null||L===void 0||L.convertSRGBToLinear(),m.map&&(m.map.encoding=E.sRGBEncoding),m.emissiveMap&&(m.emissiveMap.encoding=E.sRGBEncoding)})}}var V=P(738),z=P(924),x=w=>{var k={};return P.d(k,w),k},M=w=>()=>w,Z=x({clear:()=>Y.clear,del:()=>Y.del,get:()=>Y.get,set:()=>Y.set}),A=Z.del,G=Z.clear,K=function(){var w=(0,s.Z)(f().mark(function k(m,h){var L,y,b,T,W,X;return f().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return L=h.version,t.next=4,(0,Z.get)(m);case 4:if(b=t.sent,!(b&&b[L])){t.next=9;break}y=b[L],t.next=15;break;case 9:return t.next=11,(0,c.Z)(fetch(m).then(function(i){if(i.ok)return i.blob();throw new Error}));case 11:T=t.sent,W=T.res,X=T.err,X||(y=W,(0,Z.set)(m,(0,z.Z)({},L,W)));case 15:return t.abrupt("return",y?{url:URL.createObjectURL(y)}:{url:m});case 16:case"end":return t.stop()}},k)}));return function(m,h){return w.apply(this,arguments)}}(),B=P(490),j=P(705)})();var q=S.qo,tt=S.B7,rt=S.CL,et=S.eK,nt=S.LK,ot=S.ZL,at=S.wf,it=S.lJ,ut=S.vP,st=S.Up,ct=S.y_,ft=S.PO,_t=S.Mf,lt=S.Rl,pt=S.to;export{q as Chain,tt as Timer,rt as claerUVGenerator,et as clearAllCache,nt as clearCache,ot as colorCorrection,at as disposeMesh,it as getCache,ut as getElementViewLeft,st as getElementViewTop,ct as getUVGenerator,ft as isPlainObject,_t as makePromiseCreator,lt as polar2Cartesian,pt as to};
1
+ import*as F from"idb-keyval";import*as Y from"three";var Q={666:function(d){var c=function(i){"use strict";var u=Object.prototype,s=u.hasOwnProperty,a,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",f=n.asyncIterator||"@@asyncIterator",_=n.toStringTag||"@@toStringTag";function m(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{m({},"")}catch(e){m=function(t,r,p){return t[r]=p}}function b(e,t,r,p){var l=t&&t.prototype instanceof G?t:G,C=Object.create(l.prototype),V=new W(p||[]);return C._invoke=T(e,r,V),C}i.wrap=b;function E(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(p){return{type:"throw",arg:p}}}var L="suspendedStart",x="suspendedYield",R="executing",Z="completed",O={};function G(){}function A(){}function j(){}var I={};m(I,o,function(){return this});var M=Object.getPrototypeOf,k=M&&M(M(K([])));k&&k!==u&&s.call(k,o)&&(I=k);var v=j.prototype=G.prototype=Object.create(I);A.prototype=j,m(v,"constructor",j),m(j,"constructor",A),A.displayName=m(j,_,"GeneratorFunction");function h(e){["next","throw","return"].forEach(function(t){m(e,t,function(r){return this._invoke(t,r)})})}i.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===A||(t.displayName||t.name)==="GeneratorFunction":!1},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,j):(e.__proto__=j,m(e,_,"GeneratorFunction")),e.prototype=Object.create(v),e},i.awrap=function(e){return{__await:e}};function w(e,t){function r(C,V,U,B){var D=E(e[C],e,V);if(D.type==="throw")B(D.arg);else{var J=D.arg,$=J.value;return $&&typeof $=="object"&&s.call($,"__await")?t.resolve($.__await).then(function(N){r("next",N,U,B)},function(N){r("throw",N,U,B)}):t.resolve($).then(function(N){J.value=N,U(J)},function(N){return r("throw",N,U,B)})}}var p;function l(C,V){function U(){return new t(function(B,D){r(C,V,B,D)})}return p=p?p.then(U,U):U()}this._invoke=l}h(w.prototype),m(w.prototype,f,function(){return this}),i.AsyncIterator=w,i.async=function(e,t,r,p,l){l===void 0&&(l=Promise);var C=new w(b(e,t,r,p),l);return i.isGeneratorFunction(t)?C:C.next().then(function(V){return V.done?V.value:C.next()})};function T(e,t,r){var p=L;return function(C,V){if(p===R)throw new Error("Generator is already running");if(p===Z){if(C==="throw")throw V;return X()}for(r.method=C,r.arg=V;;){var U=r.delegate;if(U){var B=z(U,r);if(B){if(B===O)continue;return B}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(p===L)throw p=Z,r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);p=R;var D=E(e,t,r);if(D.type==="normal"){if(p=r.done?Z:x,D.arg===O)continue;return{value:D.arg,done:r.done}}else D.type==="throw"&&(p=Z,r.method="throw",r.arg=D.arg)}}}function z(e,t){var r=e.iterator[t.method];if(r===a){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=a,z(e,t),t.method==="throw"))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var p=E(r,e.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,O;var l=p.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=a);else return l;return t.delegate=null,O}h(v),m(v,_,"Generator"),m(v,o,function(){return this}),m(v,"toString",function(){return"[object Generator]"});function y(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function g(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function W(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(y,this),this.reset(!0)}i.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function p(){for(;t.length;){var l=t.pop();if(l in e)return p.value=l,p.done=!1,p}return p.done=!0,p}};function K(e){if(e){var t=e[o];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var r=-1,p=function l(){for(;++r<e.length;)if(s.call(e,r))return l.value=e[r],l.done=!1,l;return l.value=a,l.done=!0,l};return p.next=p}}return{next:X}}i.values=K;function X(){return{value:a,done:!0}}return W.prototype={constructor:W,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(g),!e)for(var t in this)t.charAt(0)==="t"&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(B,D){return C.type="throw",C.arg=e,t.next=B,D&&(t.method="next",t.arg=a),!!D}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],C=l.completion;if(l.tryLoc==="root")return r("end");if(l.tryLoc<=this.prev){var V=s.call(l,"catchLoc"),U=s.call(l,"finallyLoc");if(V&&U){if(this.prev<l.catchLoc)return r(l.catchLoc,!0);if(this.prev<l.finallyLoc)return r(l.finallyLoc)}else if(V){if(this.prev<l.catchLoc)return r(l.catchLoc,!0)}else if(U){if(this.prev<l.finallyLoc)return r(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var p=this.tryEntries[r];if(p.tryLoc<=this.prev&&s.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;break}}l&&(e==="break"||e==="continue")&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var C=l?l.completion:{};return C.type=e,C.arg=t,l?(this.method="next",this.next=l.finallyLoc,O):this.complete(C)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),g(r),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var p=r.completion;if(p.type==="throw"){var l=p.arg;g(r)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:K(e),resultName:t,nextLoc:r},this.method==="next"&&(this.arg=a),O}},i}(d.exports);try{regeneratorRuntime=c}catch(i){typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},695:function(d,c,i){i.d(c,{Z:function(){return u}});function u(s){if(s.geometry&&s.geometry.dispose(),s.material){var a=Array.isArray(s.material)?s.material:[s.material];a.forEach(function(n){var o,f,_,m,b,E,L,x,R,Z,O,G,A;(o=n.map)===null||o===void 0||o.dispose(),(f=n.lightMap)===null||f===void 0||f.dispose(),(_=n.bumpMap)===null||_===void 0||_.dispose(),(m=n.normalMap)===null||m===void 0||m.dispose(),(b=n.specularMap)===null||b===void 0||b.dispose(),(E=n.envMap)===null||E===void 0||E.dispose(),(L=n.alphaMap)===null||L===void 0||L.dispose(),(x=n.aoMap)===null||x===void 0||x.dispose(),(R=n.displacementMap)===null||R===void 0||R.dispose(),(Z=n.emissiveMap)===null||Z===void 0||Z.dispose(),(O=n.gradientMap)===null||O===void 0||O.dispose(),(G=n.metalnessMap)===null||G===void 0||G.dispose(),(A=n.roughnessMap)===null||A===void 0||A.dispose(),n.dispose()})}}},490:function(d,c,i){i.d(c,{U:function(){return s},v:function(){return u}});var u=function(a){for(var n=a.offsetLeft,o=a.offsetParent;o!==null;)n+=o.offsetLeft,o=o.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollLeft:f=document.documentElement.scrollLeft,n-f},s=function(a){for(var n=a.offsetTop,o=a.offsetParent;o!==null;)n+=o.offsetTop,o=o.offsetParent;var f;return document.compatMode==="BackCompat"||document.documentElement.scrollTop===0?f=document.body.scrollTop:f=document.documentElement.scrollTop,n-f}},738:function(d,c,i){i.d(c,{Z:function(){return s}});function u(a){return Object.prototype.toString.call(a)==="[object Object]"}function s(a){if(u(a)===!1)return!1;var n=a.constructor;if(n===void 0)return!0;var o=n.prototype;return!(u(o)===!1||o.hasOwnProperty("isPrototypeOf")===!1)}},282:function(d,c,i){i.d(c,{Z:function(){return s}});var u=i(484);function s(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o={};return o.promise=new Promise(function(f,_){o.resolve=f,o.reject=_}),a&&(o.promise=(0,u.Z)(o.promise,n)),o}},713:function(d,c,i){i.d(c,{Z:function(){return u}});function u(s,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=(90-a)*Math.PI/180,f=(90-s)*Math.PI/180;return[n*Math.sin(o)*Math.cos(f),n*Math.cos(o),n*Math.sin(o)*Math.sin(f)]}},618:function(d,c,i){i.d(c,{Z:function(){return a}});var u=i(438),s=function(){"use strict";function n(f){(0,u.Z)(this,n),this.onTick_=f,this.cancelPending_=null}var o=n.prototype;return o.tickAfter=function(_){var m=this;this.stop();var b=!0,E;this.cancelPending_=function(){clearTimeout(E),b=!1};var L=function(){b&&m.onTick_()};return E=window.setTimeout(L,_),this},o.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)},n}(),a=function(){"use strict";function n(f){(0,u.Z)(this,n),this.onTick_=f,this.ticker_=null}var o=n.prototype;return o.tickNow=function(){return this.stop(),this.onTick_(),this},o.tickAfter=function(_){var m=this;return this.stop(),this.ticker_=new s(function(){m.onTick_()}).tickAfter(_),this},o.tickEvery=function(_){var m=this;return this.stop(),this.ticker_=new s(function(){var b;(b=m.ticker_)===null||b===void 0||b.tickAfter(_),m.onTick_()}).tickAfter(_),this},o.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)},n}()},484:function(d,c,i){i.d(c,{Z:function(){return s}});var u=i(42);function s(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a.then(function(o){return(0,u.Z)({err:null,res:o},n)}).catch(function(o){return(0,u.Z)({err:o,res:void 0},n)})}},705:function(d,c,i){i.d(c,{C:function(){return n},y:function(){return a}});var u=i(949),s=new Map,a=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{generateTopUV:function(f,_,m,b,E){var L=_[m*3],x=_[m*3+1],R=_[b*3],Z=_[b*3+1],O=_[E*3],G=_[E*3+1],A;if(s.has(f))A=s.get(f);else{var j=o.box3||new u.Box3;if(!o.box3){var I=f.parameters.shapes.getPoints();j.setFromArray(I.map(function(w){return[w.x,w.y,0]}).flat())}var M=j.getSize(new u.Vector3);o.split&&(M.y/=o.split),A={box:j,size:M},s.set(f,A)}var k=A.box,v=A.size,h=o.split?1-o.split:0;return[new u.Vector2((L-k.min.x)/v.x,(x-k.min.y)/v.y+h),new u.Vector2((R-k.min.x)/v.x,(Z-k.min.y)/v.y+h),new u.Vector2((O-k.min.x)/v.x,(G-k.min.y)/v.y+h)]},generateSideWallUV:function(f,_,m,b,E,L){var x=_[m*3],R=_[m*3+1],Z=_[m*3+2],O=_[b*3],G=_[b*3+1],A=_[b*3+2],j=_[E*3],I=_[E*3+1],M=_[E*3+2],k=_[L*3],v=_[L*3+1],h=_[L*3+2],w;if(s.has(_))w=s.get(_);else{var T=new u.Box3;T.setFromArray(_);var z=T.getSize(new u.Vector3);o.split&&(z.z/=1-o.split),w={box:T,size:z},s.set(_,w)}var y=w.box,g=w.size;return Math.abs(R-G)<Math.abs(x-O)?[new u.Vector2((x-y.min.x)/g.x,(Z-y.min.z)/g.z),new u.Vector2((O-y.min.x)/g.x,(A-y.min.z)/g.z),new u.Vector2((j-y.min.x)/g.x,(M-y.min.z)/g.z),new u.Vector2((k-y.min.x)/g.x,(h-y.min.z)/g.z)]:[new u.Vector2((R-y.min.y)/g.y,(Z-y.min.z)/g.z),new u.Vector2((G-y.min.y)/g.y,(A-y.min.z)/g.z),new u.Vector2((I-y.min.y)/g.y,(M-y.min.z)/g.z),new u.Vector2((v-y.min.y)/g.y,(h-y.min.z)/g.z)]}}},n=function(){s.clear()}},77:function(d,c,i){var u=a=>{var n={};return i.d(n,a),n},s=a=>()=>a;d.exports=u({clear:()=>F.clear,del:()=>F.del,get:()=>F.get,set:()=>F.set})},949:function(d,c,i){var u=a=>{var n={};return i.d(n,a),n},s=a=>()=>a;d.exports=u({Box3:()=>Y.Box3,Vector2:()=>Y.Vector2,Vector3:()=>Y.Vector3,sRGBEncoding:()=>Y.sRGBEncoding})},943:function(d,c,i){i.d(c,{Z:function(){return u}});function u(s,a){(a==null||a>s.length)&&(a=s.length);for(var n=0,o=new Array(a);n<a;n++)o[n]=s[n];return o}},982:function(d,c,i){i.d(c,{Z:function(){return s}});var u=i(943);function s(a){if(Array.isArray(a))return(0,u.Z)(a)}},568:function(d,c,i){i.d(c,{Z:function(){return s}});function u(a,n,o,f,_,m,b){try{var E=a[m](b),L=E.value}catch(x){o(x);return}E.done?n(L):Promise.resolve(L).then(f,_)}function s(a){return function(){var n=this,o=arguments;return new Promise(function(f,_){var m=a.apply(n,o);function b(L){u(m,f,_,b,E,"next",L)}function E(L){u(m,f,_,b,E,"throw",L)}b(void 0)})}}},438:function(d,c,i){i.d(c,{Z:function(){return u}});function u(s,a){if(!(s instanceof a))throw new TypeError("Cannot call a class as a function")}},924:function(d,c,i){i.d(c,{Z:function(){return u}});function u(s,a,n){return a in s?Object.defineProperty(s,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[a]=n,s}},375:function(d,c,i){i.d(c,{Z:function(){return u}});function u(s){if(typeof Symbol!="undefined"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}},270:function(d,c,i){i.d(c,{Z:function(){return u}});function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},42:function(d,c,i){i.d(c,{Z:function(){return s}});var u=i(924);function s(a){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{},f=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(o).filter(function(_){return Object.getOwnPropertyDescriptor(o,_).enumerable}))),f.forEach(function(_){(0,u.Z)(a,_,o[_])})}return a}},342:function(d,c,i){i.d(c,{Z:function(){return o}});var u=i(982),s=i(375),a=i(270),n=i(566);function o(f){return(0,u.Z)(f)||(0,s.Z)(f)||(0,n.Z)(f)||(0,a.Z)()}},566:function(d,c,i){i.d(c,{Z:function(){return s}});var u=i(943);function s(a,n){if(!!a){if(typeof a=="string")return(0,u.Z)(a,n);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return(0,u.Z)(a,n)}}}},H={};function P(d){var c=H[d];if(c!==void 0)return c.exports;var i=H[d]={exports:{}};return Q[d](i,i.exports,P),i.exports}(function(){P.n=function(d){var c=d&&d.__esModule?function(){return d.default}:function(){return d};return P.d(c,{a:c}),c}})(),function(){P.d=function(d,c){for(var i in c)P.o(c,i)&&!P.o(d,i)&&Object.defineProperty(d,i,{enumerable:!0,get:c[i]})}}(),function(){P.o=function(d,c){return Object.prototype.hasOwnProperty.call(d,c)}}();var S={};(function(){P.d(S,{qo:function(){return _},B7:function(){return i.Z},CL:function(){return I.C},eK:function(){return G},LK:function(){return O},ZL:function(){return L},wf:function(){return b.Z},lJ:function(){return A},vP:function(){return j.v},Up:function(){return j.U},y_:function(){return I.y},PO:function(){return x.Z},Mf:function(){return d.Z},Rl:function(){return m.Z},to:function(){return c.Z}});var d=P(282),c=P(484),i=P(618),u=P(568),s=P(438),a=P(42),n=P(342),o=P(666),f=P.n(o),_=function(){"use strict";function M(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,s.Z)(this,M),this.index=0,this.repeatCount=0,this.repeatNum=0,this.isPlaying=!1,this.chainedList=[],this.children=[],this.options=(0,a.Z)({},{isdev:!1},v)}var k=M.prototype;return k.start=function(){return this.isPlaying?this:(this.index=0,this.isPlaying=!0,this.play())},k.stop1=function(){return this.isPlaying?(this.isPlaying=!1,this.repeatCount=0,this):this},k.stop=function(){return this.traverse(function(h){return h.stop1()}),this},k.dispose=function(){return this.stop(),this.chainedList=[],this.children=[],this},k.play=function(){var h=this;return(0,u.Z)(f().mark(function w(){var T;return f().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(T=h.chainedList[h.index],!(T&&h.isPlaying)){y.next=9;break}return y.next=4,Promise.all(T.map(function(g){return typeof g=="function"?g(h.repeatCount):g.start()}));case 4:return h.index+=1,y.next=7,h.play();case 7:y.next=17;break;case 9:if(!(!T&&h.isPlaying&&h.repeatCount<h.repeatNum)){y.next=16;break}return h.repeatCount+=1,h.index=0,y.next=14,h.play();case 14:y.next=17;break;case 16:!T&&h.isPlaying&&h.repeatCount===h.repeatNum&&h.stop();case 17:case"end":return y.stop()}},w)}))()},k.chain=function(){for(var h=arguments.length,w=new Array(h),T=0;T<h;T++)w[T]=arguments[T];var z=this;return(0,n.Z)(w).forEach(function(y){y instanceof M&&z.children.push(y)}),this.chainedList.push((0,n.Z)(w)),this},k.repeat=function(h){return this.repeatNum=h,this},k.timeout=function(h){return this.chain(function(){return new Promise(function(w){return setTimeout(w,h)})}),this},k.traverse=function(h){h(this),this.children.forEach(function(w){w.traverse(h)})},M}(),m=P(713),b=P(695),E=P(949);function L(M){if(M.material){var k=Array.isArray(M.material)?M.material:[M.material];k.forEach(function(v){var h,w;(h=v.color)===null||h===void 0||h.convertSRGBToLinear(),(w=v.emissive)===null||w===void 0||w.convertSRGBToLinear(),v.map&&(v.map.encoding=E.sRGBEncoding),v.emissiveMap&&(v.emissiveMap.encoding=E.sRGBEncoding)})}}var x=P(738),R=P(924),Z=P(77),O=Z.del,G=Z.clear,A=function(){var M=(0,u.Z)(f().mark(function k(v,h){var w,T,z,y,g,W,K,X,e;return f().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return w=h.type,T=w===void 0?"blob":w,z=h.version,y=z===void 0?"1":z,r.next=4,(0,Z.get)(v);case 4:if(W=r.sent,!(W&&W[y])){r.next=9;break}g=W[y],r.next=15;break;case 9:return r.next=11,(0,c.Z)(fetch(v).then(function(p){if(p.ok)return p[T]();throw new Error}));case 11:K=r.sent,X=K.res,e=K.err,e||(g=X,(0,Z.set)(v,(0,R.Z)({},y,X)));case 15:return r.abrupt("return",g?{url:T==="json"?v:URL.createObjectURL(g),store:g}:{url:v});case 16:case"end":return r.stop()}},k)}));return function(v,h){return M.apply(this,arguments)}}(),j=P(490),I=P(705)})();var q=S.qo,tt=S.B7,et=S.CL,rt=S.eK,nt=S.LK,ot=S.ZL,at=S.wf,it=S.lJ,ut=S.vP,st=S.Up,ct=S.y_,ft=S.PO,_t=S.Mf,lt=S.Rl,pt=S.to;export{q as Chain,tt as Timer,et as claerUVGenerator,rt as clearAllCache,nt as clearCache,ot as colorCorrection,at as disposeMesh,it as getCache,ut as getElementViewLeft,st as getElementViewTop,ct as getUVGenerator,ft as isPlainObject,_t as makePromiseCreator,lt as polar2Cartesian,pt as to};