@abi-software/scaffoldvuer 1.9.1-beta.1 → 1.9.1-beta.3

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.
@@ -4,7 +4,7 @@
4
4
  * @license MIT
5
5
  **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const _o=()=>{},iw=Object.prototype.hasOwnProperty,Zf=(n,e)=>iw.call(n,e),sn=Array.isArray,Yt=n=>typeof n=="function",Qt=n=>typeof n=="string",en=n=>n!==null&&typeof n=="object",rw=Object.prototype.toString,sw=n=>rw.call(n),Zc=n=>sw(n).slice(8,-1),Xc=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},ow=/-(\w)/g,aw=Xc(n=>n.replace(ow,(e,t)=>t?t.toUpperCase():"")),lw=/\B([A-Z])/g,cw=Xc(n=>n.replace(lw,"-$1").toLowerCase()),uw=Xc(n=>n.charAt(0).toUpperCase()+n.slice(1));var Xf=typeof global=="object"&&global&&global.Object===Object&&global,dw=typeof self=="object"&&self&&self.Object===Object&&self,Un=Xf||dw||Function("return this")(),Gn=Un.Symbol,Yf=Object.prototype,hw=Yf.hasOwnProperty,fw=Yf.toString,To=Gn?Gn.toStringTag:void 0;function pw(n){var e=hw.call(n,To),t=n[To];try{n[To]=void 0;var i=!0}catch{}var r=fw.call(n);return i&&(e?n[To]=t:delete n[To]),r}var mw=Object.prototype,gw=mw.toString;function yw(n){return gw.call(n)}var vw="[object Null]",bw="[object Undefined]",Jf=Gn?Gn.toStringTag:void 0;function ss(n){return n==null?n===void 0?bw:vw:Jf&&Jf in Object(n)?pw(n):yw(n)}function os(n){return n!=null&&typeof n=="object"}var xw="[object Symbol]";function ka(n){return typeof n=="symbol"||os(n)&&ss(n)==xw}function ww(n,e){for(var t=-1,i=n==null?0:n.length,r=Array(i);++t<i;)r[t]=e(n[t],t,n);return r}var Tn=Array.isArray,Mw=1/0,Kf=Gn?Gn.prototype:void 0,qf=Kf?Kf.toString:void 0;function Qf(n){if(typeof n=="string")return n;if(Tn(n))return ww(n,Qf)+"";if(ka(n))return qf?qf.call(n):"";var e=n+"";return e=="0"&&1/n==-Mw?"-0":e}var Sw=/\s/;function _w(n){for(var e=n.length;e--&&Sw.test(n.charAt(e)););return e}var Tw=/^\s+/;function Ew(n){return n&&n.slice(0,_w(n)+1).replace(Tw,"")}function Ni(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var ep=NaN,Aw=/^[-+]0x[0-9a-f]+$/i,Cw=/^0b[01]+$/i,Rw=/^0o[0-7]+$/i,Lw=parseInt;function tp(n){if(typeof n=="number")return n;if(ka(n))return ep;if(Ni(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ni(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Ew(n);var t=Cw.test(n);return t||Rw.test(n)?Lw(n.slice(2),t?2:8):Aw.test(n)?ep:+n}function np(n){return n}var Pw="[object AsyncFunction]",Iw="[object Function]",Ow="[object GeneratorFunction]",Nw="[object Proxy]";function ip(n){if(!Ni(n))return!1;var e=ss(n);return e==Iw||e==Ow||e==Pw||e==Nw}var Yc=Un["__core-js_shared__"],rp=function(){var n=/[^.]+$/.exec(Yc&&Yc.keys&&Yc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Dw(n){return!!rp&&rp in n}var Bw=Function.prototype,Fw=Bw.toString;function yr(n){if(n!=null){try{return Fw.call(n)}catch{}try{return n+""}catch{}}return""}var Vw=/[\\^$.*+?()[\]{}|]/g,kw=/^\[object .+?Constructor\]$/,zw=Function.prototype,Uw=Object.prototype,Gw=zw.toString,Hw=Uw.hasOwnProperty,Ww=RegExp("^"+Gw.call(Hw).replace(Vw,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jw(n){if(!Ni(n)||Dw(n))return!1;var e=ip(n)?Ww:kw;return e.test(yr(n))}function $w(n,e){return n==null?void 0:n[e]}function vr(n,e){var t=$w(n,e);return jw(t)?t:void 0}var Jc=vr(Un,"WeakMap");function Zw(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}var Xw=800,Yw=16,Jw=Date.now;function Kw(n){var e=0,t=0;return function(){var i=Jw(),r=Yw-(i-t);if(t=i,r>0){if(++e>=Xw)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function qw(n){return function(){return n}}var za=function(){try{var n=vr(Object,"defineProperty");return n({},"",{}),n}catch{}}(),Qw=za?function(n,e){return za(n,"toString",{configurable:!0,enumerable:!1,value:qw(e),writable:!0})}:np,e1=Kw(Qw);function t1(n,e,t,i){n.length;for(var r=t+1;r--;)if(e(n[r],r,n))return r;return-1}var n1=9007199254740991,i1=/^(?:0|[1-9]\d*)$/;function Kc(n,e){var t=typeof n;return e=e??n1,!!e&&(t=="number"||t!="symbol"&&i1.test(n))&&n>-1&&n%1==0&&n<e}function r1(n,e,t){e=="__proto__"&&za?za(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function qc(n,e){return n===e||n!==n&&e!==e}var s1=Object.prototype,o1=s1.hasOwnProperty;function a1(n,e,t){var i=n[e];(!(o1.call(n,e)&&qc(i,t))||t===void 0&&!(e in n))&&r1(n,e,t)}var sp=Math.max;function l1(n,e,t){return e=sp(e===void 0?n.length-1:e,0),function(){for(var i=arguments,r=-1,s=sp(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=t(o),Zw(n,this,l)}}var c1=9007199254740991;function Qc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=c1}function u1(n){return n!=null&&Qc(n.length)&&!ip(n)}var d1=Object.prototype;function h1(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||d1;return n===t}function f1(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var p1="[object Arguments]";function op(n){return os(n)&&ss(n)==p1}var ap=Object.prototype,m1=ap.hasOwnProperty,g1=ap.propertyIsEnumerable,eu=op(function(){return arguments}())?op:function(n){return os(n)&&m1.call(n,"callee")&&!g1.call(n,"callee")};function y1(){return!1}var lp=typeof Nt=="object"&&Nt&&!Nt.nodeType&&Nt,cp=lp&&typeof module=="object"&&module&&!module.nodeType&&module,v1=cp&&cp.exports===lp,up=v1?Un.Buffer:void 0,b1=up?up.isBuffer:void 0,tu=b1||y1,x1="[object Arguments]",w1="[object Array]",M1="[object Boolean]",S1="[object Date]",_1="[object Error]",T1="[object Function]",E1="[object Map]",A1="[object Number]",C1="[object Object]",R1="[object RegExp]",L1="[object Set]",P1="[object String]",I1="[object WeakMap]",O1="[object ArrayBuffer]",N1="[object DataView]",D1="[object Float32Array]",B1="[object Float64Array]",F1="[object Int8Array]",V1="[object Int16Array]",k1="[object Int32Array]",z1="[object Uint8Array]",U1="[object Uint8ClampedArray]",G1="[object Uint16Array]",H1="[object Uint32Array]",lt={};lt[D1]=lt[B1]=lt[F1]=lt[V1]=lt[k1]=lt[z1]=lt[U1]=lt[G1]=lt[H1]=!0,lt[x1]=lt[w1]=lt[O1]=lt[M1]=lt[N1]=lt[S1]=lt[_1]=lt[T1]=lt[E1]=lt[A1]=lt[C1]=lt[R1]=lt[L1]=lt[P1]=lt[I1]=!1;function W1(n){return os(n)&&Qc(n.length)&&!!lt[ss(n)]}function j1(n){return function(e){return n(e)}}var dp=typeof Nt=="object"&&Nt&&!Nt.nodeType&&Nt,Eo=dp&&typeof module=="object"&&module&&!module.nodeType&&module,$1=Eo&&Eo.exports===dp,nu=$1&&Xf.process,hp=function(){try{var n=Eo&&Eo.require&&Eo.require("util").types;return n||nu&&nu.binding&&nu.binding("util")}catch{}}(),fp=hp&&hp.isTypedArray,pp=fp?j1(fp):W1,Z1=Object.prototype,X1=Z1.hasOwnProperty;function Y1(n,e){var t=Tn(n),i=!t&&eu(n),r=!t&&!i&&tu(n),s=!t&&!i&&!r&&pp(n),o=t||i||r||s,l=o?f1(n.length,String):[],u=l.length;for(var c in n)X1.call(n,c)&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Kc(c,u)))&&l.push(c);return l}function J1(n,e){return function(t){return n(e(t))}}var K1=J1(Object.keys,Object),q1=Object.prototype,Q1=q1.hasOwnProperty;function eM(n){if(!h1(n))return K1(n);var e=[];for(var t in Object(n))Q1.call(n,t)&&t!="constructor"&&e.push(t);return e}function mp(n){return u1(n)?Y1(n):eM(n)}var tM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nM=/^\w*$/;function iu(n,e){if(Tn(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||ka(n)?!0:nM.test(n)||!tM.test(n)||e!=null&&n in Object(e)}var Ao=vr(Object,"create");function iM(){this.__data__=Ao?Ao(null):{},this.size=0}function rM(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var sM="__lodash_hash_undefined__",oM=Object.prototype,aM=oM.hasOwnProperty;function lM(n){var e=this.__data__;if(Ao){var t=e[n];return t===sM?void 0:t}return aM.call(e,n)?e[n]:void 0}var cM=Object.prototype,uM=cM.hasOwnProperty;function dM(n){var e=this.__data__;return Ao?e[n]!==void 0:uM.call(e,n)}var hM="__lodash_hash_undefined__";function fM(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ao&&e===void 0?hM:e,this}function br(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}br.prototype.clear=iM,br.prototype.delete=rM,br.prototype.get=lM,br.prototype.has=dM,br.prototype.set=fM;function pM(){this.__data__=[],this.size=0}function Ua(n,e){for(var t=n.length;t--;)if(qc(n[t][0],e))return t;return-1}var mM=Array.prototype,gM=mM.splice;function yM(n){var e=this.__data__,t=Ua(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():gM.call(e,t,1),--this.size,!0}function vM(n){var e=this.__data__,t=Ua(e,n);return t<0?void 0:e[t][1]}function bM(n){return Ua(this.__data__,n)>-1}function xM(n,e){var t=this.__data__,i=Ua(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function si(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}si.prototype.clear=pM,si.prototype.delete=yM,si.prototype.get=vM,si.prototype.has=bM,si.prototype.set=xM;var Co=vr(Un,"Map");function wM(){this.size=0,this.__data__={hash:new br,map:new(Co||si),string:new br}}function MM(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ga(n,e){var t=n.__data__;return MM(e)?t[typeof e=="string"?"string":"hash"]:t.map}function SM(n){var e=Ga(this,n).delete(n);return this.size-=e?1:0,e}function _M(n){return Ga(this,n).get(n)}function TM(n){return Ga(this,n).has(n)}function EM(n,e){var t=Ga(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function oi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}oi.prototype.clear=wM,oi.prototype.delete=SM,oi.prototype.get=_M,oi.prototype.has=TM,oi.prototype.set=EM;var AM="Expected a function";function ru(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(AM);var t=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=t.cache;if(s.has(r))return s.get(r);var o=n.apply(this,i);return t.cache=s.set(r,o)||s,o};return t.cache=new(ru.Cache||oi),t}ru.Cache=oi;var CM=500;function RM(n){var e=ru(n,function(i){return t.size===CM&&t.clear(),i}),t=e.cache;return e}var LM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,PM=/\\(\\)?/g,IM=RM(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(LM,function(t,i,r,s){e.push(r?s.replace(PM,"$1"):i||t)}),e});function OM(n){return n==null?"":Qf(n)}function Ha(n,e){return Tn(n)?n:iu(n,e)?[n]:IM(OM(n))}var NM=1/0;function Ro(n){if(typeof n=="string"||ka(n))return n;var e=n+"";return e=="0"&&1/n==-NM?"-0":e}function su(n,e){e=Ha(e,n);for(var t=0,i=e.length;n!=null&&t<i;)n=n[Ro(e[t++])];return t&&t==i?n:void 0}function ai(n,e,t){var i=n==null?void 0:su(n,e);return i===void 0?t:i}function gp(n,e){for(var t=-1,i=e.length,r=n.length;++t<i;)n[r+t]=e[t];return n}var yp=Gn?Gn.isConcatSpreadable:void 0;function DM(n){return Tn(n)||eu(n)||!!(yp&&n&&n[yp])}function BM(n,e,t,i,r){var s=-1,o=n.length;for(t||(t=DM),r||(r=[]);++s<o;){var l=n[s];t(l)?gp(r,l):r[r.length]=l}return r}function FM(n){var e=n==null?0:n.length;return e?BM(n):[]}function VM(n){return e1(l1(n,void 0,FM),n+"")}function Hn(){if(!arguments.length)return[];var n=arguments[0];return Tn(n)?n:[n]}function kM(){this.__data__=new si,this.size=0}function zM(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function UM(n){return this.__data__.get(n)}function GM(n){return this.__data__.has(n)}var HM=200;function WM(n,e){var t=this.__data__;if(t instanceof si){var i=t.__data__;if(!Co||i.length<HM-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new oi(i)}return t.set(n,e),this.size=t.size,this}function li(n){var e=this.__data__=new si(n);this.size=e.size}li.prototype.clear=kM,li.prototype.delete=zM,li.prototype.get=UM,li.prototype.has=GM,li.prototype.set=WM;function jM(n,e){for(var t=-1,i=n==null?0:n.length,r=0,s=[];++t<i;){var o=n[t];e(o,t,n)&&(s[r++]=o)}return s}function $M(){return[]}var ZM=Object.prototype,XM=ZM.propertyIsEnumerable,vp=Object.getOwnPropertySymbols,YM=vp?function(n){return n==null?[]:(n=Object(n),jM(vp(n),function(e){return XM.call(n,e)}))}:$M;function JM(n,e,t){var i=e(n);return Tn(n)?i:gp(i,t(n))}function bp(n){return JM(n,mp,YM)}var ou=vr(Un,"DataView"),au=vr(Un,"Promise"),lu=vr(Un,"Set"),xp="[object Map]",KM="[object Object]",wp="[object Promise]",Mp="[object Set]",Sp="[object WeakMap]",_p="[object DataView]",qM=yr(ou),QM=yr(Co),eS=yr(au),tS=yr(lu),nS=yr(Jc),Di=ss;(ou&&Di(new ou(new ArrayBuffer(1)))!=_p||Co&&Di(new Co)!=xp||au&&Di(au.resolve())!=wp||lu&&Di(new lu)!=Mp||Jc&&Di(new Jc)!=Sp)&&(Di=function(n){var e=ss(n),t=e==KM?n.constructor:void 0,i=t?yr(t):"";if(i)switch(i){case qM:return _p;case QM:return xp;case eS:return wp;case tS:return Mp;case nS:return Sp}return e});var Tp=Un.Uint8Array,iS="__lodash_hash_undefined__";function rS(n){return this.__data__.set(n,iS),this}function sS(n){return this.__data__.has(n)}function Wa(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new oi;++e<t;)this.add(n[e])}Wa.prototype.add=Wa.prototype.push=rS,Wa.prototype.has=sS;function oS(n,e){for(var t=-1,i=n==null?0:n.length;++t<i;)if(e(n[t],t,n))return!0;return!1}function aS(n,e){return n.has(e)}var lS=1,cS=2;function Ep(n,e,t,i,r,s){var o=t&lS,l=n.length,u=e.length;if(l!=u&&!(o&&u>l))return!1;var c=s.get(n),f=s.get(e);if(c&&f)return c==e&&f==n;var h=-1,p=!0,y=t&cS?new Wa:void 0;for(s.set(n,e),s.set(e,n);++h<l;){var m=n[h],d=e[h];if(i)var b=o?i(d,m,h,e,n,s):i(m,d,h,n,e,s);if(b!==void 0){if(b)continue;p=!1;break}if(y){if(!oS(e,function(v,g){if(!aS(y,g)&&(m===v||r(m,v,t,i,s)))return y.push(g)})){p=!1;break}}else if(!(m===d||r(m,d,t,i,s))){p=!1;break}}return s.delete(n),s.delete(e),p}function uS(n){var e=-1,t=Array(n.size);return n.forEach(function(i,r){t[++e]=[r,i]}),t}function dS(n){var e=-1,t=Array(n.size);return n.forEach(function(i){t[++e]=i}),t}var hS=1,fS=2,pS="[object Boolean]",mS="[object Date]",gS="[object Error]",yS="[object Map]",vS="[object Number]",bS="[object RegExp]",xS="[object Set]",wS="[object String]",MS="[object Symbol]",SS="[object ArrayBuffer]",_S="[object DataView]",Ap=Gn?Gn.prototype:void 0,cu=Ap?Ap.valueOf:void 0;function TS(n,e,t,i,r,s,o){switch(t){case _S:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case SS:return!(n.byteLength!=e.byteLength||!s(new Tp(n),new Tp(e)));case pS:case mS:case vS:return qc(+n,+e);case gS:return n.name==e.name&&n.message==e.message;case bS:case wS:return n==e+"";case yS:var l=uS;case xS:var u=i&hS;if(l||(l=dS),n.size!=e.size&&!u)return!1;var c=o.get(n);if(c)return c==e;i|=fS,o.set(n,e);var f=Ep(l(n),l(e),i,r,s,o);return o.delete(n),f;case MS:if(cu)return cu.call(n)==cu.call(e)}return!1}var ES=1,AS=Object.prototype,CS=AS.hasOwnProperty;function RS(n,e,t,i,r,s){var o=t&ES,l=bp(n),u=l.length,c=bp(e),f=c.length;if(u!=f&&!o)return!1;for(var h=u;h--;){var p=l[h];if(!(o?p in e:CS.call(e,p)))return!1}var y=s.get(n),m=s.get(e);if(y&&m)return y==e&&m==n;var d=!0;s.set(n,e),s.set(e,n);for(var b=o;++h<u;){p=l[h];var v=n[p],g=e[p];if(i)var w=o?i(g,v,p,e,n,s):i(v,g,p,n,e,s);if(!(w===void 0?v===g||r(v,g,t,i,s):w)){d=!1;break}b||(b=p=="constructor")}if(d&&!b){var S=n.constructor,T=e.constructor;S!=T&&"constructor"in n&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof T=="function"&&T instanceof T)&&(d=!1)}return s.delete(n),s.delete(e),d}var LS=1,Cp="[object Arguments]",Rp="[object Array]",ja="[object Object]",PS=Object.prototype,Lp=PS.hasOwnProperty;function IS(n,e,t,i,r,s){var o=Tn(n),l=Tn(e),u=o?Rp:Di(n),c=l?Rp:Di(e);u=u==Cp?ja:u,c=c==Cp?ja:c;var f=u==ja,h=c==ja,p=u==c;if(p&&tu(n)){if(!tu(e))return!1;o=!0,f=!1}if(p&&!f)return s||(s=new li),o||pp(n)?Ep(n,e,t,i,r,s):TS(n,e,u,t,i,r,s);if(!(t&LS)){var y=f&&Lp.call(n,"__wrapped__"),m=h&&Lp.call(e,"__wrapped__");if(y||m){var d=y?n.value():n,b=m?e.value():e;return s||(s=new li),r(d,b,t,i,s)}}return p?(s||(s=new li),RS(n,e,t,i,r,s)):!1}function $a(n,e,t,i,r){return n===e?!0:n==null||e==null||!os(n)&&!os(e)?n!==n&&e!==e:IS(n,e,t,i,$a,r)}var OS=1,NS=2;function DS(n,e,t,i){var r=t.length,s=r;if(n==null)return!s;for(n=Object(n);r--;){var o=t[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<s;){o=t[r];var l=o[0],u=n[l],c=o[1];if(o[2]){if(u===void 0&&!(l in n))return!1}else{var f=new li,h;if(!(h===void 0?$a(c,u,OS|NS,i,f):h))return!1}}return!0}function Pp(n){return n===n&&!Ni(n)}function BS(n){for(var e=mp(n),t=e.length;t--;){var i=e[t],r=n[i];e[t]=[i,r,Pp(r)]}return e}function Ip(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function FS(n){var e=BS(n);return e.length==1&&e[0][2]?Ip(e[0][0],e[0][1]):function(t){return t===n||DS(t,n,e)}}function VS(n,e){return n!=null&&e in Object(n)}function kS(n,e,t){e=Ha(e,n);for(var i=-1,r=e.length,s=!1;++i<r;){var o=Ro(e[i]);if(!(s=n!=null&&t(n,o)))break;n=n[o]}return s||++i!=r?s:(r=n==null?0:n.length,!!r&&Qc(r)&&Kc(o,r)&&(Tn(n)||eu(n)))}function Op(n,e){return n!=null&&kS(n,e,VS)}var zS=1,US=2;function GS(n,e){return iu(n)&&Pp(e)?Ip(Ro(n),e):function(t){var i=ai(t,n);return i===void 0&&i===e?Op(t,n):$a(e,i,zS|US)}}function HS(n){return function(e){return e==null?void 0:e[n]}}function WS(n){return function(e){return su(e,n)}}function jS(n){return iu(n)?HS(Ro(n)):WS(n)}function $S(n){return typeof n=="function"?n:n==null?np:typeof n=="object"?Tn(n)?GS(n[0],n[1]):FS(n):jS(n)}var uu=function(){return Un.Date.now()},ZS="Expected a function",XS=Math.max,YS=Math.min;function du(n,e,t){var i,r,s,o,l,u,c=0,f=!1,h=!1,p=!0;if(typeof n!="function")throw new TypeError(ZS);e=tp(e)||0,Ni(t)&&(f=!!t.leading,h="maxWait"in t,s=h?XS(tp(t.maxWait)||0,e):s,p="trailing"in t?!!t.trailing:p);function y(M){var C=i,_=r;return i=r=void 0,c=M,o=n.apply(_,C),o}function m(M){return c=M,l=setTimeout(v,e),f?y(M):o}function d(M){var C=M-u,_=M-c,P=e-C;return h?YS(P,s-_):P}function b(M){var C=M-u,_=M-c;return u===void 0||C>=e||C<0||h&&_>=s}function v(){var M=uu();if(b(M))return g(M);l=setTimeout(v,d(M))}function g(M){return l=void 0,p&&i?y(M):(i=r=void 0,o)}function w(){l!==void 0&&clearTimeout(l),c=0,i=u=r=l=void 0}function S(){return l===void 0?o:g(uu())}function T(){var M=uu(),C=b(M);if(i=arguments,r=this,u=M,C){if(l===void 0)return m(u);if(h)return clearTimeout(l),l=setTimeout(v,e),y(u)}return l===void 0&&(l=setTimeout(v,e)),o}return T.cancel=w,T.flush=S,T}function JS(n,e,t){var i=n==null?0:n.length;if(!i)return-1;var r=i-1;return t1(n,$S(e),r)}function Za(n){for(var e=-1,t=n==null?0:n.length,i={};++e<t;){var r=n[e];i[r[0]]=r[1]}return i}function hu(n,e){return $a(n,e)}function ci(n){return n==null}function KS(n){return n===void 0}function qS(n,e,t,i){if(!Ni(n))return n;e=Ha(e,n);for(var r=-1,s=e.length,o=s-1,l=n;l!=null&&++r<s;){var u=Ro(e[r]),c=t;if(u==="__proto__"||u==="constructor"||u==="prototype")return n;if(r!=o){var f=l[u];c=void 0,c===void 0&&(c=Ni(f)?f:Kc(e[r+1])?[]:{})}a1(l,u,c),l=l[u]}return n}function QS(n,e,t){for(var i=-1,r=e.length,s={};++i<r;){var o=e[i],l=su(n,o);t(l,o)&&qS(s,Ha(o,n),l)}return s}function e_(n,e){return QS(n,e,function(t,i){return Op(n,i)})}var t_=VM(function(n,e){return n==null?{}:e_(n,e)});const En=n=>n===void 0,fu=n=>typeof n=="boolean",nt=n=>typeof n=="number",xr=n=>typeof Element>"u"?!1:n instanceof Element,n_=n=>Qt(n)?!Number.isNaN(Number(n)):!1,i_=(n="")=>n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Bi=n=>uw(n),Np=n=>Object.keys(n);class Dp extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function as(n,e){throw new Dp(`[${n}] ${e}`)}function xt(n,e){if(process.env.NODE_ENV!=="production"){const t=Qt(n)?new Dp(`[${n}] ${e}`):n;console.warn(t)}}const r_="utils/dom/style",Bp=(n="")=>n.split(" ").filter(e=>!!e.trim()),Fp=(n,e)=>{!n||!e.trim()||n.classList.add(...Bp(e))},Xa=(n,e)=>{!n||!e.trim()||n.classList.remove(...Bp(e))},Lo=(n,e)=>{var t;if(!Lt||!n||!e)return"";let i=aw(e);i==="float"&&(i="cssFloat");try{const r=n.style[i];if(r)return r;const s=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return s?s[i]:""}catch{return n.style[i]}};function Ya(n,e="px"){if(!n)return"";if(nt(n)||n_(n))return`${n}${e}`;if(Qt(n))return n;xt(r_,"binding value must be a string or number")}function s_(n,e){if(!Lt)return;if(!e){n.scrollTop=0;return}const t=[];let i=e.offsetParent;for(;i!==null&&n!==i&&n.contains(i);)t.push(i),i=i.offsetParent;const r=e.offsetTop+t.reduce((u,c)=>u+c.offsetTop,0),s=r+e.offsetHeight,o=n.scrollTop,l=o+n.clientHeight;r<o?n.scrollTop=r:s>l&&(n.scrollTop=s-n.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var o_=a.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),pu=o_,a_=a.defineComponent({name:"ArrowLeft",__name:"arrow-left",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),Fi=a_,l_=a.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),Vi=l_,c_=a.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),u_=c_,d_=a.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),a.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),h_=d_,f_=a.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),mu=f_,p_=a.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),gu=p_,m_=a.defineComponent({name:"Delete",__name:"delete",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),Ja=m_,g_=a.defineComponent({name:"Hide",__name:"hide",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),a.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),y_=g_,v_=a.defineComponent({name:"Loading",__name:"loading",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Vp=v_,b_=a.defineComponent({name:"Minus",__name:"minus",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),x_=b_,w_=a.defineComponent({name:"Plus",__name:"plus",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),Ka=w_,M_=a.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),S_=M_,__=a.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),kp=__;const zp="__epPropKey",Ve=n=>n,T_=n=>en(n)&&!!n[zp],qa=(n,e)=>{if(!en(n)||T_(n))return n;const{values:t,required:i,default:r,type:s,validator:o}=n,u={type:s,required:!!i,validator:t||o?c=>{let f=!1,h=[];if(t&&(h=Array.from(t),Zf(n,"default")&&h.push(r),f||(f=h.includes(c))),o&&(f||(f=o(c))),!f&&h.length>0){const p=[...new Set(h)].map(y=>JSON.stringify(y)).join(", ");a.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${p}], got value ${JSON.stringify(c)}.`)}return f}:void 0,[zp]:!0};return Zf(n,"default")&&(u.default=r),u},Qe=n=>Za(Object.entries(n).map(([e,t])=>[e,qa(t,e)])),ki=Ve([String,Object,Function]),Up={validating:Vp,success:h_,error:mu},kt=(n,e)=>{if(n.install=t=>{for(const i of[n,...Object.values(e??{})])t.component(i.name,i)},e)for(const[t,i]of Object.entries(e))n[t]=i;return n},E_=(n,e)=>(n.install=t=>{t.directive(e,n)},n),ui=n=>(n.install=_o,n),Wn={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},dt="update:modelValue",zi="change",wr="input",Gp=["","default","small","large"],Qa=n=>{const e=sn(n)?n:[n],t=[];return e.forEach(i=>{var r;sn(i)?t.push(...Qa(i)):a.isVNode(i)&&sn(i.children)?t.push(...Qa(i.children)):(t.push(i),a.isVNode(i)&&((r=i.component)!=null&&r.subTree)&&t.push(...Qa(i.component.subTree)))}),t},A_=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),di=n=>n,C_=["class","style"],R_=/^on[A-Z]/,L_=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,i=a.computed(()=>((t==null?void 0:t.value)||[]).concat(C_)),r=a.getCurrentInstance();return r?a.computed(()=>{var s;return Za(Object.entries((s=r.proxy)==null?void 0:s.$attrs).filter(([o])=>!i.value.includes(o)&&!(e&&R_.test(o))))}):(xt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},P_=({from:n,replacement:e,scope:t,version:i,ref:r,type:s="API"},o)=>{a.watch(()=>a.unref(o),l=>{l&&xt(t,`[${s}] ${n} is about to be deprecated in version ${i}, please use ${e} instead.
6
6
  For more detail, please visit: ${r}
7
- `)},{immediate:!0})};var I_={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const O_=n=>(e,t)=>N_(e,t,a.unref(n)),N_=(n,e,t)=>ai(t,n,n).replace(/\{(\w+)\}/g,(i,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),D_=n=>{const e=a.computed(()=>a.unref(n).name),t=a.isRef(n)?n:a.ref(n);return{lang:e,locale:t,t:O_(n)}},Hp=Symbol("localeContextKey"),el=n=>{const e=n||a.inject(Hp,a.ref());return D_(a.computed(()=>e.value||I_))},tl="el",B_="is-",Mr=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},Wp=Symbol("namespaceContextKey"),yu=n=>{const e=n||(a.getCurrentInstance()?a.inject(Wp,a.ref(tl)):a.ref(tl));return a.computed(()=>a.unref(e)||tl)},We=(n,e)=>{const t=yu(e);return{namespace:t,b:(d="")=>Mr(t.value,n,d,"",""),e:d=>d?Mr(t.value,n,"",d,""):"",m:d=>d?Mr(t.value,n,"","",d):"",be:(d,b)=>d&&b?Mr(t.value,n,d,b,""):"",em:(d,b)=>d&&b?Mr(t.value,n,"",d,b):"",bm:(d,b)=>d&&b?Mr(t.value,n,d,"",b):"",bem:(d,b,v)=>d&&b&&v?Mr(t.value,n,d,b,v):"",is:(d,...b)=>{const v=b.length>=1?b[0]:!0;return d&&v?`${B_}${d}`:""},cssVar:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${v}`]=d[v]);return b},cssVarName:d=>`--${t.value}-${d}`,cssVarBlock:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${n}-${v}`]=d[v]);return b},cssVarBlockName:d=>`--${t.value}-${n}-${d}`}},F_=qa({type:Ve(Boolean),default:null}),V_=qa({type:Ve(Function)}),k_=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:F_,[t]:V_};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:f,onHide:h})=>{const p=a.getCurrentInstance(),{emit:y}=p,m=p.props,d=a.computed(()=>Yt(m[t])),b=a.computed(()=>m[n]===null),v=C=>{o.value!==!0&&(o.value=!0,l&&(l.value=C),Yt(f)&&f(C))},g=C=>{o.value!==!1&&(o.value=!1,l&&(l.value=C),Yt(h)&&h(C))},w=C=>{if(m.disabled===!0||Yt(c)&&!c())return;const _=d.value&&Lt;_&&y(e,!0),(b.value||!_)&&v(C)},S=C=>{if(m.disabled===!0||!Lt)return;const _=d.value&&Lt;_&&y(e,!1),(b.value||!_)&&g(C)},T=C=>{fu(C)&&(m.disabled&&C?d.value&&y(e,!1):o.value!==C&&(C?v():g()))},M=()=>{o.value?S():w()};return a.watch(()=>m[n],T),u&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{u.value&&o.value&&S()}),a.onMounted(()=>{T(m[n])}),{hide:S,show:w,toggle:M,hasUpdateHandler:d}},useModelToggleProps:r,useModelToggleEmits:i}},jp=n=>{const e=a.getCurrentInstance();return a.computed(()=>{var t,i;return(i=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:i[n]})};var on="top",xn="bottom",wn="right",an="left",vu="auto",Po=[on,xn,wn,an],ls="start",Io="end",z_="clippingParents",$p="viewport",Oo="popper",U_="reference",Zp=Po.reduce(function(n,e){return n.concat([e+"-"+ls,e+"-"+Io])},[]),cs=[].concat(Po,[vu]).reduce(function(n,e){return n.concat([e,e+"-"+ls,e+"-"+Io])},[]),G_="beforeRead",H_="read",W_="afterRead",j_="beforeMain",$_="main",Z_="afterMain",X_="beforeWrite",Y_="write",J_="afterWrite",K_=[G_,H_,W_,j_,$_,Z_,X_,Y_,J_];function jn(n){return n?(n.nodeName||"").toLowerCase():null}function An(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function us(n){var e=An(n).Element;return n instanceof e||n instanceof Element}function Mn(n){var e=An(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function bu(n){if(typeof ShadowRoot>"u")return!1;var e=An(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function q_(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!Mn(s)||!jn(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(o){var l=r[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function Q_(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),l=o.reduce(function(u,c){return u[c]="",u},{});!Mn(r)||!jn(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}var Xp={name:"applyStyles",enabled:!0,phase:"write",fn:q_,effect:Q_,requires:["computeStyles"]};function $n(n){return n.split("-")[0]}var Sr=Math.max,nl=Math.min,ds=Math.round;function hs(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(Mn(n)&&e){var s=n.offsetHeight,o=n.offsetWidth;o>0&&(i=ds(t.width)/o||1),s>0&&(r=ds(t.height)/s||1)}return{width:t.width/i,height:t.height/r,top:t.top/r,right:t.right/i,bottom:t.bottom/r,left:t.left/i,x:t.left/i,y:t.top/r}}function xu(n){var e=hs(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function Yp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&bu(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function hi(n){return An(n).getComputedStyle(n)}function eT(n){return["table","td","th"].indexOf(jn(n))>=0}function Ui(n){return((us(n)?n.ownerDocument:n.document)||window.document).documentElement}function il(n){return jn(n)==="html"?n:n.assignedSlot||n.parentNode||(bu(n)?n.host:null)||Ui(n)}function Jp(n){return!Mn(n)||hi(n).position==="fixed"?null:n.offsetParent}function tT(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&Mn(n)){var i=hi(n);if(i.position==="fixed")return null}var r=il(n);for(bu(r)&&(r=r.host);Mn(r)&&["html","body"].indexOf(jn(r))<0;){var s=hi(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function No(n){for(var e=An(n),t=Jp(n);t&&eT(t)&&hi(t).position==="static";)t=Jp(t);return t&&(jn(t)==="html"||jn(t)==="body"&&hi(t).position==="static")?e:t||tT(n)||e}function wu(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Do(n,e,t){return Sr(n,nl(e,t))}function nT(n,e,t){var i=Do(n,e,t);return i>t?t:i}function Kp(){return{top:0,right:0,bottom:0,left:0}}function qp(n){return Object.assign({},Kp(),n)}function Qp(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var iT=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,qp(typeof n!="number"?n:Qp(n,Po))};function rT(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,l=$n(t.placement),u=wu(l),c=[an,wn].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!o)){var h=iT(r.padding,t),p=xu(s),y=u==="y"?on:an,m=u==="y"?xn:wn,d=t.rects.reference[f]+t.rects.reference[u]-o[u]-t.rects.popper[f],b=o[u]-t.rects.reference[u],v=No(s),g=v?u==="y"?v.clientHeight||0:v.clientWidth||0:0,w=d/2-b/2,S=h[y],T=g-p[f]-h[m],M=g/2-p[f]/2+w,C=Do(S,M,T),_=u;t.modifiersData[i]=(e={},e[_]=C,e.centerOffset=C-M,e)}}function sT(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!Yp(e.elements.popper,r)||(e.elements.arrow=r))}var oT={name:"arrow",enabled:!0,phase:"main",fn:rT,effect:sT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fs(n){return n.split("-")[1]}var aT={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lT(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:ds(e*r)/r||0,y:ds(t*r)/r||0}}function em(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,o=n.offsets,l=n.position,u=n.gpuAcceleration,c=n.adaptive,f=n.roundOffsets,h=n.isFixed,p=o.x,y=p===void 0?0:p,m=o.y,d=m===void 0?0:m,b=typeof f=="function"?f({x:y,y:d}):{x:y,y:d};y=b.x,d=b.y;var v=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),w=an,S=on,T=window;if(c){var M=No(t),C="clientHeight",_="clientWidth";if(M===An(t)&&(M=Ui(t),hi(M).position!=="static"&&l==="absolute"&&(C="scrollHeight",_="scrollWidth")),M=M,r===on||(r===an||r===wn)&&s===Io){S=xn;var P=h&&M===T&&T.visualViewport?T.visualViewport.height:M[C];d-=P-i.height,d*=u?1:-1}if(r===an||(r===on||r===xn)&&s===Io){w=wn;var E=h&&M===T&&T.visualViewport?T.visualViewport.width:M[_];y-=E-i.width,y*=u?1:-1}}var O=Object.assign({position:l},c&&aT),A=f===!0?lT({x:y,y:d}):{x:y,y:d};if(y=A.x,d=A.y,u){var L;return Object.assign({},O,(L={},L[S]=g?"0":"",L[w]=v?"0":"",L.transform=(T.devicePixelRatio||1)<=1?"translate("+y+"px, "+d+"px)":"translate3d("+y+"px, "+d+"px, 0)",L))}return Object.assign({},O,(e={},e[S]=g?d+"px":"",e[w]=v?y+"px":"",e.transform="",e))}function cT(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,l=t.roundOffsets,u=l===void 0?!0:l,c={placement:$n(e.placement),variation:fs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,em(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,em(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var tm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cT,data:{}},rl={passive:!0};function uT(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,o=i.resize,l=o===void 0?!0:o,u=An(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",t.update,rl)}),l&&u.addEventListener("resize",t.update,rl),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",t.update,rl)}),l&&u.removeEventListener("resize",t.update,rl)}}var nm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uT,data:{}},dT={left:"right",right:"left",bottom:"top",top:"bottom"};function sl(n){return n.replace(/left|right|bottom|top/g,function(e){return dT[e]})}var hT={start:"end",end:"start"};function im(n){return n.replace(/start|end/g,function(e){return hT[e]})}function Mu(n){var e=An(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Su(n){return hs(Ui(n)).left+Mu(n).scrollLeft}function fT(n){var e=An(n),t=Ui(n),i=e.visualViewport,r=t.clientWidth,s=t.clientHeight,o=0,l=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,l=i.offsetTop)),{width:r,height:s,x:o+Su(n),y:l}}function pT(n){var e,t=Ui(n),i=Mu(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=Sr(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Sr(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Su(n),u=-i.scrollTop;return hi(r||t).direction==="rtl"&&(l+=Sr(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function _u(n){var e=hi(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function rm(n){return["html","body","#document"].indexOf(jn(n))>=0?n.ownerDocument.body:Mn(n)&&_u(n)?n:rm(il(n))}function Bo(n,e){var t;e===void 0&&(e=[]);var i=rm(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=An(i),o=r?[s].concat(s.visualViewport||[],_u(i)?i:[]):i,l=e.concat(o);return r?l:l.concat(Bo(il(o)))}function Tu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function mT(n){var e=hs(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function sm(n,e){return e===$p?Tu(fT(n)):us(e)?mT(e):Tu(pT(Ui(n)))}function gT(n){var e=Bo(il(n)),t=["absolute","fixed"].indexOf(hi(n).position)>=0,i=t&&Mn(n)?No(n):n;return us(i)?e.filter(function(r){return us(r)&&Yp(r,i)&&jn(r)!=="body"}):[]}function yT(n,e,t){var i=e==="clippingParents"?gT(n):[].concat(e),r=[].concat(i,[t]),s=r[0],o=r.reduce(function(l,u){var c=sm(n,u);return l.top=Sr(c.top,l.top),l.right=nl(c.right,l.right),l.bottom=nl(c.bottom,l.bottom),l.left=Sr(c.left,l.left),l},sm(n,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function om(n){var e=n.reference,t=n.element,i=n.placement,r=i?$n(i):null,s=i?fs(i):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,u;switch(r){case on:u={x:o,y:e.y-t.height};break;case xn:u={x:o,y:e.y+e.height};break;case wn:u={x:e.x+e.width,y:l};break;case an:u={x:e.x-t.width,y:l};break;default:u={x:e.x,y:e.y}}var c=r?wu(r):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case ls:u[c]=u[c]-(e[f]/2-t[f]/2);break;case Io:u[c]=u[c]+(e[f]/2-t[f]/2);break}}return u}function Fo(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.boundary,o=s===void 0?z_:s,l=t.rootBoundary,u=l===void 0?$p:l,c=t.elementContext,f=c===void 0?Oo:c,h=t.altBoundary,p=h===void 0?!1:h,y=t.padding,m=y===void 0?0:y,d=qp(typeof m!="number"?m:Qp(m,Po)),b=f===Oo?U_:Oo,v=n.rects.popper,g=n.elements[p?b:f],w=yT(us(g)?g:g.contextElement||Ui(n.elements.popper),o,u),S=hs(n.elements.reference),T=om({reference:S,element:v,strategy:"absolute",placement:r}),M=Tu(Object.assign({},v,T)),C=f===Oo?M:S,_={top:w.top-C.top+d.top,bottom:C.bottom-w.bottom+d.bottom,left:w.left-C.left+d.left,right:C.right-w.right+d.right},P=n.modifiersData.offset;if(f===Oo&&P){var E=P[r];Object.keys(_).forEach(function(O){var A=[wn,xn].indexOf(O)>=0?1:-1,L=[on,xn].indexOf(O)>=0?"y":"x";_[O]+=E[L]*A})}return _}function vT(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,o=t.padding,l=t.flipVariations,u=t.allowedAutoPlacements,c=u===void 0?cs:u,f=fs(i),h=f?l?Zp:Zp.filter(function(m){return fs(m)===f}):Po,p=h.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=h);var y=p.reduce(function(m,d){return m[d]=Fo(n,{placement:d,boundary:r,rootBoundary:s,padding:o})[$n(d)],m},{});return Object.keys(y).sort(function(m,d){return y[m]-y[d]})}function bT(n){if($n(n)===vu)return[];var e=sl(n);return[im(n),e,im(e)]}function xT(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!0:o,u=t.fallbackPlacements,c=t.padding,f=t.boundary,h=t.rootBoundary,p=t.altBoundary,y=t.flipVariations,m=y===void 0?!0:y,d=t.allowedAutoPlacements,b=e.options.placement,v=$n(b),g=v===b,w=u||(g||!m?[sl(b)]:bT(b)),S=[b].concat(w).reduce(function(ne,ae){return ne.concat($n(ae)===vu?vT(e,{placement:ae,boundary:f,rootBoundary:h,padding:c,flipVariations:m,allowedAutoPlacements:d}):ae)},[]),T=e.rects.reference,M=e.rects.popper,C=new Map,_=!0,P=S[0],E=0;E<S.length;E++){var O=S[E],A=$n(O),L=fs(O)===ls,R=[on,xn].indexOf(A)>=0,N=R?"width":"height",x=Fo(e,{placement:O,boundary:f,rootBoundary:h,altBoundary:p,padding:c}),I=R?L?wn:an:L?xn:on;T[N]>M[N]&&(I=sl(I));var B=sl(I),F=[];if(s&&F.push(x[A]<=0),l&&F.push(x[I]<=0,x[B]<=0),F.every(function(ne){return ne})){P=O,_=!1;break}C.set(O,F)}if(_)for(var V=m?3:1,k=function(ne){var ae=S.find(function(ie){var oe=C.get(ie);if(oe)return oe.slice(0,ne).every(function(W){return W})});if(ae)return P=ae,"break"},G=V;G>0;G--){var J=k(G);if(J==="break")break}e.placement!==P&&(e.modifiersData[i]._skip=!0,e.placement=P,e.reset=!0)}}var wT={name:"flip",enabled:!0,phase:"main",fn:xT,requiresIfExists:["offset"],data:{_skip:!1}};function am(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function lm(n){return[on,wn,xn,an].some(function(e){return n[e]>=0})}function MT(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=Fo(e,{elementContext:"reference"}),l=Fo(e,{altBoundary:!0}),u=am(o,i),c=am(l,r,s),f=lm(u),h=lm(c);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var ST={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:MT};function _T(n,e,t){var i=$n(n),r=[an,on].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=s[0],l=s[1];return o=o||0,l=(l||0)*r,[an,wn].indexOf(i)>=0?{x:l,y:o}:{x:o,y:l}}function TT(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=cs.reduce(function(f,h){return f[h]=_T(h,e.rects,s),f},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}var ET={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:TT};function AT(n){var e=n.state,t=n.name;e.modifiersData[t]=om({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var cm={name:"popperOffsets",enabled:!0,phase:"read",fn:AT,data:{}};function CT(n){return n==="x"?"y":"x"}function RT(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!1:o,u=t.boundary,c=t.rootBoundary,f=t.altBoundary,h=t.padding,p=t.tether,y=p===void 0?!0:p,m=t.tetherOffset,d=m===void 0?0:m,b=Fo(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:f}),v=$n(e.placement),g=fs(e.placement),w=!g,S=wu(v),T=CT(S),M=e.modifiersData.popperOffsets,C=e.rects.reference,_=e.rects.popper,P=typeof d=="function"?d(Object.assign({},e.rects,{placement:e.placement})):d,E=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(M){if(s){var L,R=S==="y"?on:an,N=S==="y"?xn:wn,x=S==="y"?"height":"width",I=M[S],B=I+b[R],F=I-b[N],V=y?-_[x]/2:0,k=g===ls?C[x]:_[x],G=g===ls?-_[x]:-C[x],J=e.elements.arrow,ne=y&&J?xu(J):{width:0,height:0},ae=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Kp(),ie=ae[R],oe=ae[N],W=Do(0,C[x],ne[x]),X=w?C[x]/2-V-W-ie-E.mainAxis:k-W-ie-E.mainAxis,j=w?-C[x]/2+V+W+oe+E.mainAxis:G+W+oe+E.mainAxis,re=e.elements.arrow&&No(e.elements.arrow),z=re?S==="y"?re.clientTop||0:re.clientLeft||0:0,H=(L=O==null?void 0:O[S])!=null?L:0,K=I+X-H-z,le=I+j-H,se=Do(y?nl(B,K):B,I,y?Sr(F,le):F);M[S]=se,A[S]=se-I}if(l){var U,D=S==="x"?on:an,$=S==="x"?xn:wn,Y=M[T],ee=T==="y"?"height":"width",ce=Y+b[D],ve=Y-b[$],be=[on,an].indexOf(v)!==-1,ue=(U=O==null?void 0:O[T])!=null?U:0,me=be?ce:Y-C[ee]-_[ee]-ue+E.altAxis,te=be?Y+C[ee]+_[ee]-ue-E.altAxis:ve,he=y&&be?nT(me,Y,te):Do(y?me:ce,Y,y?te:ve);M[T]=he,A[T]=he-Y}e.modifiersData[i]=A}}var LT={name:"preventOverflow",enabled:!0,phase:"main",fn:RT,requiresIfExists:["offset"]};function PT(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function IT(n){return n===An(n)||!Mn(n)?Mu(n):PT(n)}function OT(n){var e=n.getBoundingClientRect(),t=ds(e.width)/n.offsetWidth||1,i=ds(e.height)/n.offsetHeight||1;return t!==1||i!==1}function NT(n,e,t){t===void 0&&(t=!1);var i=Mn(e),r=Mn(e)&&OT(e),s=Ui(e),o=hs(n,r),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!t)&&((jn(e)!=="body"||_u(s))&&(l=IT(e)),Mn(e)?(u=hs(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Su(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function DT(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var u=e.get(l);u&&r(u)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function BT(n){var e=DT(n);return K_.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function FT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function VT(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var um={placement:"bottom",modifiers:[],strategy:"absolute"};function dm(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Eu(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,s=r===void 0?um:r;return function(o,l,u){u===void 0&&(u=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},um,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:c,setOptions:function(d){var b=typeof d=="function"?d(c.options):d;m(),c.options=Object.assign({},s,c.options,b),c.scrollParents={reference:us(o)?Bo(o):o.contextElement?Bo(o.contextElement):[],popper:Bo(l)};var v=BT(VT([].concat(i,c.options.modifiers)));return c.orderedModifiers=v.filter(function(g){return g.enabled}),y(),p.update()},forceUpdate:function(){if(!h){var d=c.elements,b=d.reference,v=d.popper;if(dm(b,v)){c.rects={reference:NT(b,No(v),c.options.strategy==="fixed"),popper:xu(v)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(_){return c.modifiersData[_.name]=Object.assign({},_.data)});for(var g=0;g<c.orderedModifiers.length;g++){if(c.reset===!0){c.reset=!1,g=-1;continue}var w=c.orderedModifiers[g],S=w.fn,T=w.options,M=T===void 0?{}:T,C=w.name;typeof S=="function"&&(c=S({state:c,options:M,name:C,instance:p})||c)}}}},update:FT(function(){return new Promise(function(d){p.forceUpdate(),d(c)})}),destroy:function(){m(),h=!0}};if(!dm(o,l))return p;p.setOptions(u).then(function(d){!h&&u.onFirstUpdate&&u.onFirstUpdate(d)});function y(){c.orderedModifiers.forEach(function(d){var b=d.name,v=d.options,g=v===void 0?{}:v,w=d.effect;if(typeof w=="function"){var S=w({state:c,name:b,instance:p,options:g}),T=function(){};f.push(S||T)}})}function m(){f.forEach(function(d){return d()}),f=[]}return p}}Eu();var kT=[nm,cm,tm,Xp];Eu({defaultModifiers:kT});var zT=[nm,cm,tm,Xp,ET,wT,LT,oT,ST],UT=Eu({defaultModifiers:zT});const GT=(n,e,t={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=HT(u);Object.assign(o.value,c)},requires:["computeStyles"]},r=a.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:f,modifiers:h}=a.unref(t);return{onFirstUpdate:u,placement:c||"bottom",strategy:f||"absolute",modifiers:[...h||[],i,{name:"applyStyles",enabled:!1}]}}),s=a.shallowRef(),o=a.ref({styles:{popper:{position:a.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return a.watch(r,u=>{const c=a.unref(s);c&&c.setOptions(u)},{deep:!0}),a.watch([n,e],([u,c])=>{l(),!(!u||!c)&&(s.value=UT(u,c,a.unref(r)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var u;return{...((u=a.unref(s))==null?void 0:u.state)||{}}}),styles:a.computed(()=>a.unref(o).styles),attributes:a.computed(()=>a.unref(o).attributes),update:()=>{var u;return(u=a.unref(s))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=a.unref(s))==null?void 0:u.forceUpdate()},instanceRef:a.computed(()=>a.unref(s))}};function HT(n){const e=Object.keys(n.elements),t=Za(e.map(r=>[r,n.styles[r]||{}])),i=Za(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}function hm(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return Va(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Au={prefix:Math.floor(Math.random()*1e4),current:0},WT=Symbol("elIdInjection"),Cu=()=>a.getCurrentInstance()?a.inject(WT,Au):Au,ol=n=>{const e=Cu();!Lt&&e===Au&&xt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
7
+ `)},{immediate:!0})};var I_={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const O_=n=>(e,t)=>N_(e,t,a.unref(n)),N_=(n,e,t)=>ai(t,n,n).replace(/\{(\w+)\}/g,(i,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),D_=n=>{const e=a.computed(()=>a.unref(n).name),t=a.isRef(n)?n:a.ref(n);return{lang:e,locale:t,t:O_(n)}},Hp=Symbol("localeContextKey"),el=n=>{const e=n||a.inject(Hp,a.ref());return D_(a.computed(()=>e.value||I_))},tl="el",B_="is-",Mr=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},Wp=Symbol("namespaceContextKey"),yu=n=>{const e=n||(a.getCurrentInstance()?a.inject(Wp,a.ref(tl)):a.ref(tl));return a.computed(()=>a.unref(e)||tl)},We=(n,e)=>{const t=yu(e);return{namespace:t,b:(d="")=>Mr(t.value,n,d,"",""),e:d=>d?Mr(t.value,n,"",d,""):"",m:d=>d?Mr(t.value,n,"","",d):"",be:(d,b)=>d&&b?Mr(t.value,n,d,b,""):"",em:(d,b)=>d&&b?Mr(t.value,n,"",d,b):"",bm:(d,b)=>d&&b?Mr(t.value,n,d,"",b):"",bem:(d,b,v)=>d&&b&&v?Mr(t.value,n,d,b,v):"",is:(d,...b)=>{const v=b.length>=1?b[0]:!0;return d&&v?`${B_}${d}`:""},cssVar:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${v}`]=d[v]);return b},cssVarName:d=>`--${t.value}-${d}`,cssVarBlock:d=>{const b={};for(const v in d)d[v]&&(b[`--${t.value}-${n}-${v}`]=d[v]);return b},cssVarBlockName:d=>`--${t.value}-${n}-${d}`}},F_=qa({type:Ve(Boolean),default:null}),V_=qa({type:Ve(Function)}),k_=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:F_,[t]:V_};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:f,onHide:h})=>{const p=a.getCurrentInstance(),{emit:y}=p,m=p.props,d=a.computed(()=>Yt(m[t])),b=a.computed(()=>m[n]===null),v=C=>{o.value!==!0&&(o.value=!0,l&&(l.value=C),Yt(f)&&f(C))},g=C=>{o.value!==!1&&(o.value=!1,l&&(l.value=C),Yt(h)&&h(C))},w=C=>{if(m.disabled===!0||Yt(c)&&!c())return;const _=d.value&&Lt;_&&y(e,!0),(b.value||!_)&&v(C)},S=C=>{if(m.disabled===!0||!Lt)return;const _=d.value&&Lt;_&&y(e,!1),(b.value||!_)&&g(C)},T=C=>{fu(C)&&(m.disabled&&C?d.value&&y(e,!1):o.value!==C&&(C?v():g()))},M=()=>{o.value?S():w()};return a.watch(()=>m[n],T),u&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{u.value&&o.value&&S()}),a.onMounted(()=>{T(m[n])}),{hide:S,show:w,toggle:M,hasUpdateHandler:d}},useModelToggleProps:r,useModelToggleEmits:i}},jp=n=>{const e=a.getCurrentInstance();return a.computed(()=>{var t,i;return(i=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:i[n]})};var on="top",xn="bottom",wn="right",an="left",vu="auto",Po=[on,xn,wn,an],ls="start",Io="end",z_="clippingParents",$p="viewport",Oo="popper",U_="reference",Zp=Po.reduce(function(n,e){return n.concat([e+"-"+ls,e+"-"+Io])},[]),cs=[].concat(Po,[vu]).reduce(function(n,e){return n.concat([e,e+"-"+ls,e+"-"+Io])},[]),G_="beforeRead",H_="read",W_="afterRead",j_="beforeMain",$_="main",Z_="afterMain",X_="beforeWrite",Y_="write",J_="afterWrite",K_=[G_,H_,W_,j_,$_,Z_,X_,Y_,J_];function jn(n){return n?(n.nodeName||"").toLowerCase():null}function An(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function us(n){var e=An(n).Element;return n instanceof e||n instanceof Element}function Mn(n){var e=An(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function bu(n){if(typeof ShadowRoot>"u")return!1;var e=An(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function q_(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!Mn(s)||!jn(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(o){var l=r[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function Q_(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),l=o.reduce(function(u,c){return u[c]="",u},{});!Mn(r)||!jn(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}var Xp={name:"applyStyles",enabled:!0,phase:"write",fn:q_,effect:Q_,requires:["computeStyles"]};function $n(n){return n.split("-")[0]}var Sr=Math.max,nl=Math.min,ds=Math.round;function hs(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(Mn(n)&&e){var s=n.offsetHeight,o=n.offsetWidth;o>0&&(i=ds(t.width)/o||1),s>0&&(r=ds(t.height)/s||1)}return{width:t.width/i,height:t.height/r,top:t.top/r,right:t.right/i,bottom:t.bottom/r,left:t.left/i,x:t.left/i,y:t.top/r}}function xu(n){var e=hs(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function Yp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&bu(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function hi(n){return An(n).getComputedStyle(n)}function eT(n){return["table","td","th"].indexOf(jn(n))>=0}function Ui(n){return((us(n)?n.ownerDocument:n.document)||window.document).documentElement}function il(n){return jn(n)==="html"?n:n.assignedSlot||n.parentNode||(bu(n)?n.host:null)||Ui(n)}function Jp(n){return!Mn(n)||hi(n).position==="fixed"?null:n.offsetParent}function tT(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&Mn(n)){var i=hi(n);if(i.position==="fixed")return null}var r=il(n);for(bu(r)&&(r=r.host);Mn(r)&&["html","body"].indexOf(jn(r))<0;){var s=hi(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function No(n){for(var e=An(n),t=Jp(n);t&&eT(t)&&hi(t).position==="static";)t=Jp(t);return t&&(jn(t)==="html"||jn(t)==="body"&&hi(t).position==="static")?e:t||tT(n)||e}function wu(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Do(n,e,t){return Sr(n,nl(e,t))}function nT(n,e,t){var i=Do(n,e,t);return i>t?t:i}function Kp(){return{top:0,right:0,bottom:0,left:0}}function qp(n){return Object.assign({},Kp(),n)}function Qp(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var iT=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,qp(typeof n!="number"?n:Qp(n,Po))};function rT(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,l=$n(t.placement),u=wu(l),c=[an,wn].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!o)){var h=iT(r.padding,t),p=xu(s),y=u==="y"?on:an,m=u==="y"?xn:wn,d=t.rects.reference[f]+t.rects.reference[u]-o[u]-t.rects.popper[f],b=o[u]-t.rects.reference[u],v=No(s),g=v?u==="y"?v.clientHeight||0:v.clientWidth||0:0,w=d/2-b/2,S=h[y],T=g-p[f]-h[m],M=g/2-p[f]/2+w,C=Do(S,M,T),_=u;t.modifiersData[i]=(e={},e[_]=C,e.centerOffset=C-M,e)}}function sT(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!Yp(e.elements.popper,r)||(e.elements.arrow=r))}var oT={name:"arrow",enabled:!0,phase:"main",fn:rT,effect:sT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fs(n){return n.split("-")[1]}var aT={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lT(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:ds(e*r)/r||0,y:ds(t*r)/r||0}}function em(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,o=n.offsets,l=n.position,u=n.gpuAcceleration,c=n.adaptive,f=n.roundOffsets,h=n.isFixed,p=o.x,y=p===void 0?0:p,m=o.y,d=m===void 0?0:m,b=typeof f=="function"?f({x:y,y:d}):{x:y,y:d};y=b.x,d=b.y;var v=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),w=an,S=on,T=window;if(c){var M=No(t),C="clientHeight",_="clientWidth";if(M===An(t)&&(M=Ui(t),hi(M).position!=="static"&&l==="absolute"&&(C="scrollHeight",_="scrollWidth")),M=M,r===on||(r===an||r===wn)&&s===Io){S=xn;var P=h&&M===T&&T.visualViewport?T.visualViewport.height:M[C];d-=P-i.height,d*=u?1:-1}if(r===an||(r===on||r===xn)&&s===Io){w=wn;var E=h&&M===T&&T.visualViewport?T.visualViewport.width:M[_];y-=E-i.width,y*=u?1:-1}}var O=Object.assign({position:l},c&&aT),A=f===!0?lT({x:y,y:d}):{x:y,y:d};if(y=A.x,d=A.y,u){var L;return Object.assign({},O,(L={},L[S]=g?"0":"",L[w]=v?"0":"",L.transform=(T.devicePixelRatio||1)<=1?"translate("+y+"px, "+d+"px)":"translate3d("+y+"px, "+d+"px, 0)",L))}return Object.assign({},O,(e={},e[S]=g?d+"px":"",e[w]=v?y+"px":"",e.transform="",e))}function cT(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,l=t.roundOffsets,u=l===void 0?!0:l,c={placement:$n(e.placement),variation:fs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,em(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,em(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var tm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cT,data:{}},rl={passive:!0};function uT(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,o=i.resize,l=o===void 0?!0:o,u=An(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",t.update,rl)}),l&&u.addEventListener("resize",t.update,rl),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",t.update,rl)}),l&&u.removeEventListener("resize",t.update,rl)}}var nm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uT,data:{}},dT={left:"right",right:"left",bottom:"top",top:"bottom"};function sl(n){return n.replace(/left|right|bottom|top/g,function(e){return dT[e]})}var hT={start:"end",end:"start"};function im(n){return n.replace(/start|end/g,function(e){return hT[e]})}function Mu(n){var e=An(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Su(n){return hs(Ui(n)).left+Mu(n).scrollLeft}function fT(n){var e=An(n),t=Ui(n),i=e.visualViewport,r=t.clientWidth,s=t.clientHeight,o=0,l=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,l=i.offsetTop)),{width:r,height:s,x:o+Su(n),y:l}}function pT(n){var e,t=Ui(n),i=Mu(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=Sr(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Sr(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Su(n),u=-i.scrollTop;return hi(r||t).direction==="rtl"&&(l+=Sr(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function _u(n){var e=hi(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function rm(n){return["html","body","#document"].indexOf(jn(n))>=0?n.ownerDocument.body:Mn(n)&&_u(n)?n:rm(il(n))}function Bo(n,e){var t;e===void 0&&(e=[]);var i=rm(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=An(i),o=r?[s].concat(s.visualViewport||[],_u(i)?i:[]):i,l=e.concat(o);return r?l:l.concat(Bo(il(o)))}function Tu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function mT(n){var e=hs(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function sm(n,e){return e===$p?Tu(fT(n)):us(e)?mT(e):Tu(pT(Ui(n)))}function gT(n){var e=Bo(il(n)),t=["absolute","fixed"].indexOf(hi(n).position)>=0,i=t&&Mn(n)?No(n):n;return us(i)?e.filter(function(r){return us(r)&&Yp(r,i)&&jn(r)!=="body"}):[]}function yT(n,e,t){var i=e==="clippingParents"?gT(n):[].concat(e),r=[].concat(i,[t]),s=r[0],o=r.reduce(function(l,u){var c=sm(n,u);return l.top=Sr(c.top,l.top),l.right=nl(c.right,l.right),l.bottom=nl(c.bottom,l.bottom),l.left=Sr(c.left,l.left),l},sm(n,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function om(n){var e=n.reference,t=n.element,i=n.placement,r=i?$n(i):null,s=i?fs(i):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,u;switch(r){case on:u={x:o,y:e.y-t.height};break;case xn:u={x:o,y:e.y+e.height};break;case wn:u={x:e.x+e.width,y:l};break;case an:u={x:e.x-t.width,y:l};break;default:u={x:e.x,y:e.y}}var c=r?wu(r):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case ls:u[c]=u[c]-(e[f]/2-t[f]/2);break;case Io:u[c]=u[c]+(e[f]/2-t[f]/2);break}}return u}function Fo(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.boundary,o=s===void 0?z_:s,l=t.rootBoundary,u=l===void 0?$p:l,c=t.elementContext,f=c===void 0?Oo:c,h=t.altBoundary,p=h===void 0?!1:h,y=t.padding,m=y===void 0?0:y,d=qp(typeof m!="number"?m:Qp(m,Po)),b=f===Oo?U_:Oo,v=n.rects.popper,g=n.elements[p?b:f],w=yT(us(g)?g:g.contextElement||Ui(n.elements.popper),o,u),S=hs(n.elements.reference),T=om({reference:S,element:v,strategy:"absolute",placement:r}),M=Tu(Object.assign({},v,T)),C=f===Oo?M:S,_={top:w.top-C.top+d.top,bottom:C.bottom-w.bottom+d.bottom,left:w.left-C.left+d.left,right:C.right-w.right+d.right},P=n.modifiersData.offset;if(f===Oo&&P){var E=P[r];Object.keys(_).forEach(function(O){var A=[wn,xn].indexOf(O)>=0?1:-1,L=[on,xn].indexOf(O)>=0?"y":"x";_[O]+=E[L]*A})}return _}function vT(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,o=t.padding,l=t.flipVariations,u=t.allowedAutoPlacements,c=u===void 0?cs:u,f=fs(i),h=f?l?Zp:Zp.filter(function(m){return fs(m)===f}):Po,p=h.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=h);var y=p.reduce(function(m,d){return m[d]=Fo(n,{placement:d,boundary:r,rootBoundary:s,padding:o})[$n(d)],m},{});return Object.keys(y).sort(function(m,d){return y[m]-y[d]})}function bT(n){if($n(n)===vu)return[];var e=sl(n);return[im(n),e,im(e)]}function xT(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!0:o,u=t.fallbackPlacements,c=t.padding,f=t.boundary,h=t.rootBoundary,p=t.altBoundary,y=t.flipVariations,m=y===void 0?!0:y,d=t.allowedAutoPlacements,b=e.options.placement,v=$n(b),g=v===b,w=u||(g||!m?[sl(b)]:bT(b)),S=[b].concat(w).reduce(function(ne,ae){return ne.concat($n(ae)===vu?vT(e,{placement:ae,boundary:f,rootBoundary:h,padding:c,flipVariations:m,allowedAutoPlacements:d}):ae)},[]),T=e.rects.reference,M=e.rects.popper,C=new Map,_=!0,P=S[0],E=0;E<S.length;E++){var O=S[E],A=$n(O),L=fs(O)===ls,R=[on,xn].indexOf(A)>=0,N=R?"width":"height",x=Fo(e,{placement:O,boundary:f,rootBoundary:h,altBoundary:p,padding:c}),I=R?L?wn:an:L?xn:on;T[N]>M[N]&&(I=sl(I));var B=sl(I),F=[];if(s&&F.push(x[A]<=0),l&&F.push(x[I]<=0,x[B]<=0),F.every(function(ne){return ne})){P=O,_=!1;break}C.set(O,F)}if(_)for(var V=m?3:1,k=function(ne){var ae=S.find(function(ie){var oe=C.get(ie);if(oe)return oe.slice(0,ne).every(function(W){return W})});if(ae)return P=ae,"break"},G=V;G>0;G--){var J=k(G);if(J==="break")break}e.placement!==P&&(e.modifiersData[i]._skip=!0,e.placement=P,e.reset=!0)}}var wT={name:"flip",enabled:!0,phase:"main",fn:xT,requiresIfExists:["offset"],data:{_skip:!1}};function am(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function lm(n){return[on,wn,xn,an].some(function(e){return n[e]>=0})}function MT(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=Fo(e,{elementContext:"reference"}),l=Fo(e,{altBoundary:!0}),u=am(o,i),c=am(l,r,s),f=lm(u),h=lm(c);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var ST={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:MT};function _T(n,e,t){var i=$n(n),r=[an,on].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=s[0],l=s[1];return o=o||0,l=(l||0)*r,[an,wn].indexOf(i)>=0?{x:l,y:o}:{x:o,y:l}}function TT(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=cs.reduce(function(f,h){return f[h]=_T(h,e.rects,s),f},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}var ET={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:TT};function AT(n){var e=n.state,t=n.name;e.modifiersData[t]=om({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var cm={name:"popperOffsets",enabled:!0,phase:"read",fn:AT,data:{}};function CT(n){return n==="x"?"y":"x"}function RT(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,o=t.altAxis,l=o===void 0?!1:o,u=t.boundary,c=t.rootBoundary,f=t.altBoundary,h=t.padding,p=t.tether,y=p===void 0?!0:p,m=t.tetherOffset,d=m===void 0?0:m,b=Fo(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:f}),v=$n(e.placement),g=fs(e.placement),w=!g,S=wu(v),T=CT(S),M=e.modifiersData.popperOffsets,C=e.rects.reference,_=e.rects.popper,P=typeof d=="function"?d(Object.assign({},e.rects,{placement:e.placement})):d,E=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(M){if(s){var L,R=S==="y"?on:an,N=S==="y"?xn:wn,x=S==="y"?"height":"width",I=M[S],B=I+b[R],F=I-b[N],V=y?-_[x]/2:0,k=g===ls?C[x]:_[x],G=g===ls?-_[x]:-C[x],J=e.elements.arrow,ne=y&&J?xu(J):{width:0,height:0},ae=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Kp(),ie=ae[R],oe=ae[N],W=Do(0,C[x],ne[x]),Z=w?C[x]/2-V-W-ie-E.mainAxis:k-W-ie-E.mainAxis,j=w?-C[x]/2+V+W+oe+E.mainAxis:G+W+oe+E.mainAxis,re=e.elements.arrow&&No(e.elements.arrow),z=re?S==="y"?re.clientTop||0:re.clientLeft||0:0,H=(L=O==null?void 0:O[S])!=null?L:0,K=I+Z-H-z,le=I+j-H,se=Do(y?nl(B,K):B,I,y?Sr(F,le):F);M[S]=se,A[S]=se-I}if(l){var U,D=S==="x"?on:an,$=S==="x"?xn:wn,Y=M[T],ee=T==="y"?"height":"width",ce=Y+b[D],ve=Y-b[$],be=[on,an].indexOf(v)!==-1,ue=(U=O==null?void 0:O[T])!=null?U:0,me=be?ce:Y-C[ee]-_[ee]-ue+E.altAxis,te=be?Y+C[ee]+_[ee]-ue-E.altAxis:ve,he=y&&be?nT(me,Y,te):Do(y?me:ce,Y,y?te:ve);M[T]=he,A[T]=he-Y}e.modifiersData[i]=A}}var LT={name:"preventOverflow",enabled:!0,phase:"main",fn:RT,requiresIfExists:["offset"]};function PT(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function IT(n){return n===An(n)||!Mn(n)?Mu(n):PT(n)}function OT(n){var e=n.getBoundingClientRect(),t=ds(e.width)/n.offsetWidth||1,i=ds(e.height)/n.offsetHeight||1;return t!==1||i!==1}function NT(n,e,t){t===void 0&&(t=!1);var i=Mn(e),r=Mn(e)&&OT(e),s=Ui(e),o=hs(n,r),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!t)&&((jn(e)!=="body"||_u(s))&&(l=IT(e)),Mn(e)?(u=hs(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Su(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function DT(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var u=e.get(l);u&&r(u)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function BT(n){var e=DT(n);return K_.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function FT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function VT(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var um={placement:"bottom",modifiers:[],strategy:"absolute"};function dm(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Eu(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,s=r===void 0?um:r;return function(o,l,u){u===void 0&&(u=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},um,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:c,setOptions:function(d){var b=typeof d=="function"?d(c.options):d;m(),c.options=Object.assign({},s,c.options,b),c.scrollParents={reference:us(o)?Bo(o):o.contextElement?Bo(o.contextElement):[],popper:Bo(l)};var v=BT(VT([].concat(i,c.options.modifiers)));return c.orderedModifiers=v.filter(function(g){return g.enabled}),y(),p.update()},forceUpdate:function(){if(!h){var d=c.elements,b=d.reference,v=d.popper;if(dm(b,v)){c.rects={reference:NT(b,No(v),c.options.strategy==="fixed"),popper:xu(v)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(_){return c.modifiersData[_.name]=Object.assign({},_.data)});for(var g=0;g<c.orderedModifiers.length;g++){if(c.reset===!0){c.reset=!1,g=-1;continue}var w=c.orderedModifiers[g],S=w.fn,T=w.options,M=T===void 0?{}:T,C=w.name;typeof S=="function"&&(c=S({state:c,options:M,name:C,instance:p})||c)}}}},update:FT(function(){return new Promise(function(d){p.forceUpdate(),d(c)})}),destroy:function(){m(),h=!0}};if(!dm(o,l))return p;p.setOptions(u).then(function(d){!h&&u.onFirstUpdate&&u.onFirstUpdate(d)});function y(){c.orderedModifiers.forEach(function(d){var b=d.name,v=d.options,g=v===void 0?{}:v,w=d.effect;if(typeof w=="function"){var S=w({state:c,name:b,instance:p,options:g}),T=function(){};f.push(S||T)}})}function m(){f.forEach(function(d){return d()}),f=[]}return p}}Eu();var kT=[nm,cm,tm,Xp];Eu({defaultModifiers:kT});var zT=[nm,cm,tm,Xp,ET,wT,LT,oT,ST],UT=Eu({defaultModifiers:zT});const GT=(n,e,t={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=HT(u);Object.assign(o.value,c)},requires:["computeStyles"]},r=a.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:f,modifiers:h}=a.unref(t);return{onFirstUpdate:u,placement:c||"bottom",strategy:f||"absolute",modifiers:[...h||[],i,{name:"applyStyles",enabled:!1}]}}),s=a.shallowRef(),o=a.ref({styles:{popper:{position:a.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return a.watch(r,u=>{const c=a.unref(s);c&&c.setOptions(u)},{deep:!0}),a.watch([n,e],([u,c])=>{l(),!(!u||!c)&&(s.value=UT(u,c,a.unref(r)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var u;return{...((u=a.unref(s))==null?void 0:u.state)||{}}}),styles:a.computed(()=>a.unref(o).styles),attributes:a.computed(()=>a.unref(o).attributes),update:()=>{var u;return(u=a.unref(s))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=a.unref(s))==null?void 0:u.forceUpdate()},instanceRef:a.computed(()=>a.unref(s))}};function HT(n){const e=Object.keys(n.elements),t=Za(e.map(r=>[r,n.styles[r]||{}])),i=Za(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}function hm(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return Va(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Au={prefix:Math.floor(Math.random()*1e4),current:0},WT=Symbol("elIdInjection"),Cu=()=>a.getCurrentInstance()?a.inject(WT,Au):Au,ol=n=>{const e=Cu();!Lt&&e===Au&&xt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
8
8
  usage: app.provide(ID_INJECTION_KEY, {
9
9
  prefix: number,
10
10
  current: number,
@@ -17,7 +17,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:i,curr
17
17
  z-index:-1000 !important;
18
18
  top:0 !important;
19
19
  right:0 !important;
20
- `,gE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function yE(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:gE.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function Cm(n,e=1,t){var i;Cn||(Cn=document.createElement("textarea"),document.body.appendChild(Cn));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=yE(n);Cn.setAttribute("style",`${l};${mE}`),Cn.value=n.value||n.placeholder||"";let u=Cn.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),Cn.value="";const f=Cn.scrollHeight-r;if(nt(e)){let h=f*e;o==="border-box"&&(h=h+r+s),u=Math.max(h,u),c.minHeight=`${h}px`}if(nt(t)){let h=f*t;o==="border-box"&&(h=h+r+s),u=Math.min(h,u)}return c.height=`${u}px`,(i=Cn.parentNode)==null||i.removeChild(Cn),Cn=void 0,c}const vE=Qe({id:{type:String,default:void 0},size:ms,disabled:Boolean,modelValue:{type:Ve([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Ve([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:ki},prefixIcon:{type:ki},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ve([Object,Array,String]),default:()=>di({})},autofocus:Boolean,rows:{type:Number,default:2},..._r(["ariaLabel"])}),bE={[dt]:n=>Qt(n),input:n=>Qt(n),change:n=>Qt(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},xE=a.defineComponent({name:"ElInput",inheritAttrs:!1}),wE=a.defineComponent({...xE,props:vE,emits:bE,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const ue={};return i.containerRole==="combobox"&&(ue["aria-haspopup"]=r["aria-haspopup"],ue["aria-owns"]=r["aria-owns"],ue["aria-expanded"]=r["aria-expanded"]),ue}),l=a.computed(()=>[i.type==="textarea"?b.b():d.b(),d.m(y.value),d.is("disabled",m.value),d.is("exceed",J.value),{[d.b("group")]:s.prepend||s.append,[d.m("prefix")]:s.prefix||i.prefixIcon,[d.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[d.bm("suffix","password-clear")]:F.value&&V.value,[d.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[d.e("wrapper"),d.is("focus",P.value)]),c=L_({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:h}=Vo(),{inputId:p}=Pu(i,{formItemContext:h}),y=gs(),m=cl(),d=We("input"),b=We("textarea"),v=a.shallowRef(),g=a.shallowRef(),w=a.ref(!1),S=a.ref(!1),T=a.ref(),M=a.shallowRef(i.inputStyle),C=a.computed(()=>v.value||g.value),{wrapperRef:_,isFocused:P,handleFocus:E,handleBlur:O}=_m(C,{beforeFocus(){return m.value},afterBlur(){var ue;i.validateEvent&&((ue=h==null?void 0:h.validate)==null||ue.call(h,"blur").catch(me=>xt(me)))}}),A=a.computed(()=>{var ue;return(ue=f==null?void 0:f.statusIcon)!=null?ue:!1}),L=a.computed(()=>(h==null?void 0:h.validateState)||""),R=a.computed(()=>L.value&&Up[L.value]),N=a.computed(()=>S.value?S_:y_),x=a.computed(()=>[r.style]),I=a.computed(()=>[i.inputStyle,M.value,{resize:i.resize}]),B=a.computed(()=>ci(i.modelValue)?"":String(i.modelValue)),F=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(P.value||w.value)),V=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||P.value)),k=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),G=a.computed(()=>B.value.length),J=a.computed(()=>!!k.value&&G.value>Number(i.maxlength)),ne=a.computed(()=>!!s.suffix||!!i.suffixIcon||F.value||i.showPassword||k.value||!!L.value&&A.value),[ae,ie]=qT(v);bn(g,ue=>{if(X(),!k.value||i.resize!=="both")return;const me=ue[0],{width:te}=me.contentRect;T.value={right:`calc(100% - ${te+15+6}px)`}});const oe=()=>{const{type:ue,autosize:me}=i;if(!(!Lt||ue!=="textarea"||!g.value))if(me){const te=en(me)?me.minRows:void 0,he=en(me)?me.maxRows:void 0,ge=Cm(g.value,te,he);M.value={overflowY:"hidden",...ge},a.nextTick(()=>{g.value.offsetHeight,M.value=ge})}else M.value={minHeight:Cm(g.value).minHeight}},X=(ue=>{let me=!1;return()=>{var te;if(me||!i.autosize)return;((te=g.value)==null?void 0:te.offsetParent)===null||(ue(),me=!0)}})(oe),j=()=>{const ue=C.value,me=i.formatter?i.formatter(B.value):B.value;!ue||ue.value===me||(ue.value=me)},re=async ue=>{ae();let{value:me}=ue.target;if(i.formatter&&(me=i.parser?i.parser(me):me),!H.value){if(me===B.value){j();return}t(dt,me),t("input",me),await a.nextTick(),j(),ie()}},z=ue=>{t("change",ue.target.value)},{isComposing:H,handleCompositionStart:K,handleCompositionUpdate:le,handleCompositionEnd:se}=Tm({emit:t,afterComposition:re}),U=()=>{S.value=!S.value,D()},D=async()=>{var ue;await a.nextTick(),(ue=C.value)==null||ue.focus()},$=()=>{var ue;return(ue=C.value)==null?void 0:ue.blur()},Y=ue=>{w.value=!1,t("mouseleave",ue)},ee=ue=>{w.value=!0,t("mouseenter",ue)},ce=ue=>{t("keydown",ue)},ve=()=>{var ue;(ue=C.value)==null||ue.select()},be=()=>{t(dt,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var ue;a.nextTick(()=>oe()),i.validateEvent&&((ue=h==null?void 0:h.validate)==null||ue.call(h,"change").catch(me=>xt(me)))}),a.watch(B,()=>j()),a.watch(()=>i.type,async()=>{await a.nextTick(),j(),oe()}),a.onMounted(()=>{!i.formatter&&i.parser&&xt("ElInput","If you set the parser, you also need to set the formatter."),j(),a.nextTick(oe)}),e({input:v,textarea:g,ref:C,textareaStyle:I,autosize:a.toRef(i,"autosize"),isComposing:H,focus:D,blur:$,select:ve,clear:be,resizeTextarea:oe}),(ue,me)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(d).bm("group","append")]:ue.$slots.append,[a.unref(d).bm("group","prepend")]:ue.$slots.prepend}],style:a.unref(x),role:ue.containerRole,onMouseenter:ee,onMouseleave:Y}),[a.createCommentVNode(" input "),ue.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),ue.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(d).be("group","prepend"))},[a.renderSlot(ue.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:_,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),ue.$slots.prefix||ue.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(d).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("prefix-inner"))},[a.renderSlot(ue.$slots,"prefix"),ue.prefixIcon?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:v,class:a.unref(d).e("inner")},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,type:ue.showPassword?S.value?"text":"password":ue.type,disabled:a.unref(m),readonly:ue.readonly,autocomplete:ue.autocomplete,tabindex:ue.tabindex,"aria-label":ue.ariaLabel,placeholder:ue.placeholder,style:ue.inputStyle,form:ue.form,autofocus:ue.autofocus,onCompositionstart:a.unref(K),onCompositionupdate:a.unref(le),onCompositionend:a.unref(se),onInput:re,onChange:z,onKeydown:ce}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(ne)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(d).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("suffix-inner"))},[!a.unref(F)||!a.unref(V)||!a.unref(k)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(ue.$slots,"suffix"),ue.suffixIcon?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(F)?(a.openBlock(),a.createBlock(a.unref(ht),{key:1,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("clear")]),onMousedown:a.withModifiers(a.unref(_o),["prevent"]),onClick:be},{default:a.withCtx(()=>[a.createVNode(a.unref(mu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(V)?(a.openBlock(),a.createBlock(a.unref(ht),{key:2,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("password")]),onClick:U},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(N))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(d).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("count-inner"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(L)&&a.unref(R)&&a.unref(A)?(a.openBlock(),a.createBlock(a.unref(ht),{key:4,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("validateIcon"),a.unref(d).is("loading",a.unref(L)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(R))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),ue.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(d).be("group","append"))},[a.renderSlot(ue.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(p),ref_key:"textarea",ref:g,class:[a.unref(b).e("inner"),a.unref(d).is("focus",a.unref(P))]},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,tabindex:ue.tabindex,disabled:a.unref(m),readonly:ue.readonly,autocomplete:ue.autocomplete,style:a.unref(I),"aria-label":ue.ariaLabel,placeholder:ue.placeholder,form:ue.form,autofocus:ue.autofocus,rows:ue.rows,onCompositionstart:a.unref(K),onCompositionupdate:a.unref(le),onCompositionend:a.unref(se),onInput:re,onFocus:a.unref(E),onBlur:a.unref(O),onChange:z,onKeydown:ce}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(k)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(T.value),class:a.normalizeClass(a.unref(d).e("count"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var ME=$e(wE,[["__file","input.vue"]]);const SE=kt(ME),ys=4,_E={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},TE=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Iu=Symbol("scrollbarContextKey"),EE=Qe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),AE="Thumb";var Rm=$e(a.defineComponent({__name:"thumb",props:EE,setup(n){const e=n,t=a.inject(Iu),i=We("scrollbar");t||as(AE,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Lt?document.onselectstart:null;const h=a.computed(()=>_E[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>TE({size:e.size,move:e.move,bar:h.value})),y=a.computed(()=>r.value[h.value.offset]**2/t.wrapElement[h.value.scrollSize]/e.ratio/s.value[h.value.offset]),m=M=>{var C;if(M.stopPropagation(),M.ctrlKey||[1,2].includes(M.button))return;(C=window.getSelection())==null||C.removeAllRanges(),b(M);const _=M.currentTarget;_&&(o.value[h.value.axis]=_[h.value.offset]-(M[h.value.client]-_.getBoundingClientRect()[h.value.direction]))},d=M=>{if(!s.value||!r.value||!t.wrapElement)return;const C=Math.abs(M.target.getBoundingClientRect()[h.value.direction]-M[h.value.client]),_=s.value[h.value.offset]/2,P=(C-_)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=P*t.wrapElement[h.value.scrollSize]/100},b=M=>{M.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",v),document.addEventListener("mouseup",g),f=document.onselectstart,document.onselectstart=()=>!1},v=M=>{if(!r.value||!s.value||u===!1)return;const C=o.value[h.value.axis];if(!C)return;const _=(r.value.getBoundingClientRect()[h.value.direction]-M[h.value.client])*-1,P=s.value[h.value.offset]-C,E=(_-P)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=E*t.wrapElement[h.value.scrollSize]/100},g=()=>{u=!1,o.value[h.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",g),T(),c&&(l.value=!1)},w=()=>{c=!1,l.value=!!e.size},S=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{T(),document.removeEventListener("mouseup",g)});const T=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return Vt(a.toRef(t,"scrollbarElement"),"mousemove",w),Vt(a.toRef(t,"scrollbarElement"),"mouseleave",S),(M,C)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(h).key)]),onMousedown:d},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,M.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const CE=Qe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var RE=$e(a.defineComponent({__name:"bar",props:CE,setup(n,{expose:e}){const t=n,i=a.inject(Iu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:p=>{if(p){const y=p.offsetHeight-ys,m=p.offsetWidth-ys;s.value=p.scrollTop*100/y*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const y=p.offsetHeight-ys,m=p.offsetWidth-ys,d=y**2/p.scrollHeight,b=m**2/p.scrollWidth,v=Math.max(d,t.minSize),g=Math.max(b,t.minSize);u.value=d/(y-d)/(v/(y-v)),c.value=b/(m-b)/(g/(m-g)),l.value=v+ys<y?`${v}px`:"",o.value=g+ys<m?`${g}px`:""}}),(p,y)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(Rm,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(Rm,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const LE=Qe({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ve([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,..._r(["ariaLabel","ariaOrientation"])}),PE={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(nt)},Ou="ElScrollbar",IE=a.defineComponent({name:Ou}),OE=a.defineComponent({...IE,props:LE,emits:PE,setup(n,{expose:e,emit:t}){const i=n,r=We("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),h=a.ref(),p=a.ref(),y=a.computed(()=>{const T={};return i.height&&(T.height=Ya(i.height)),i.maxHeight&&(T.maxHeight=Ya(i.maxHeight)),[i.wrapStyle,T]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),d=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var T;f.value&&((T=p.value)==null||T.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function v(T,M){en(T)?f.value.scrollTo(T):nt(T)&&nt(M)&&f.value.scrollTo(T,M)}const g=T=>{if(!nt(T)){xt(Ou,"value must be a number");return}f.value.scrollTop=T},w=T=>{if(!nt(T)){xt(Ou,"value must be a number");return}f.value.scrollLeft=T},S=()=>{var T;(T=p.value)==null||T.update()};return a.watch(()=>i.noresize,T=>{T?(s==null||s(),o==null||o()):({stop:s}=bn(h,S),o=Vt("resize",S))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var T;S(),f.value&&((T=p.value)==null||T.handleScroll(f.value))})}),a.provide(Iu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{S()})}),a.onUpdated(()=>S()),e({wrapRef:f,update:S,scrollTo:v,setScrollTop:g,setScrollLeft:w,handleScroll:b}),(T,M)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(m)),style:a.normalizeStyle(a.unref(y)),tabindex:T.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(T.tag),{id:T.id,ref_key:"resizeRef",ref:h,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(T.viewStyle),role:T.role,"aria-label":T.ariaLabel,"aria-orientation":T.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(T.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),T.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(RE,{key:0,ref_key:"barRef",ref:p,always:T.always,"min-size":T.minSize},null,8,["always","min-size"]))],2))}});var NE=$e(OE,[["__file","scrollbar.vue"]]);const DE=kt(NE),Nu=Symbol("popper"),Lm=Symbol("popperContent"),Pm=Qe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),BE=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),FE=a.defineComponent({...BE,props:Pm,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Nu,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var VE=$e(FE,[["__file","popper.vue"]]);const Im=Qe({arrowOffset:{type:Number,default:5}}),kE=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),zE=a.defineComponent({...kE,props:Im,setup(n,{expose:e}){const t=n,i=We("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(Lm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var UE=$e(zE,[["__file","arrow.vue"]]);const Du="ElOnlyChild",GE=a.defineComponent({name:Du,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(gm),s=KT((i=r==null?void 0:r.setForwardRef)!=null?i:_o);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return xt(Du,"requires exact only one valid child."),null;const u=Om(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(xt(Du,"no valid child node found"),null)}}});function Om(n){if(!n)return null;const e=n;for(const t of e){if(en(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return Nm(t);case a.Fragment:return Om(t.children);default:return t}return Nm(t)}return null}function Nm(n){const e=We("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const Dm=Qe({virtualRef:{type:Ve(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ve(Function)},onMouseleave:{type:Ve(Function)},onClick:{type:Ve(Function)},onKeydown:{type:Ve(Function)},onFocus:{type:Ve(Function)},onBlur:{type:Ve(Function)},onContextmenu:{type:Ve(Function)},id:String,open:Boolean}),HE=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),WE=a.defineComponent({...HE,props:Dm,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Nu,void 0);JT(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,h=>{h&&(r.value=ri(h))},{immediate:!0}),a.watch(r,(h,p)=>{c==null||c(),c=void 0,xr(h)&&(f.forEach(y=>{var m;const d=t[y];d&&(h.addEventListener(y.slice(2).toLowerCase(),d),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,y.slice(2).toLowerCase(),d))}),c=a.watch([s,o,l,u],y=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,d)=>{ci(y[d])?h.removeAttribute(m):h.setAttribute(m,y[d])})},{immediate:!0})),xr(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(y=>p.removeAttribute(y))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&xr(r.value)){const h=r.value;f.forEach(p=>{const y=t[p];y&&h.removeEventListener(p.slice(2).toLowerCase(),y)}),r.value=void 0}}),e({triggerRef:r}),(h,p)=>h.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(GE),a.mergeProps({key:0},h.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(h.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var jE=$e(WE,[["__file","trigger.vue"]]);const Bu="focus-trap.focus-after-trapped",Fu="focus-trap.focus-after-released",$E="focus-trap.focusout-prevented",Bm={cancelable:!0,bubbles:!1},ZE={cancelable:!0,bubbles:!1},Fm="focusAfterTrapped",Vm="focusAfterReleased",XE=Symbol("elFocusTrap"),Vu=a.ref(),ul=a.ref(0),ku=a.ref(0);let dl=0;const km=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},zm=(n,e)=>{for(const t of n)if(!YE(t,e))return t},YE=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},JE=n=>{const e=km(n),t=zm(e,n),i=zm(e.reverse(),n);return[t,i]},KE=n=>n instanceof HTMLInputElement&&"select"in n,Gi=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),ku.value=window.performance.now(),n!==t&&KE(n)&&e&&n.select()}};function Um(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const qE=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=Um(n,i),n.unshift(i)},remove:i=>{var r,s;n=Um(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},QE=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(Gi(i,e),document.activeElement!==t)return},Gm=qE(),eA=()=>ul.value>ku.value,hl=()=>{Vu.value="pointer",ul.value=window.performance.now()},Hm=()=>{Vu.value="keyboard",ul.value=window.performance.now()},tA=()=>(a.onMounted(()=>{dl===0&&(document.addEventListener("mousedown",hl),document.addEventListener("touchstart",hl),document.addEventListener("keydown",Hm)),dl++}),a.onBeforeUnmount(()=>{dl--,dl<=0&&(document.removeEventListener("mousedown",hl),document.removeEventListener("touchstart",hl),document.removeEventListener("keydown",Hm))}),{focusReason:Vu,lastUserFocusTimestamp:ul,lastAutomatedFocusTimestamp:ku}),fl=n=>new CustomEvent($E,{...ZE,detail:n}),nA=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Fm,Vm,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=tA();jT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:d,altKey:b,ctrlKey:v,metaKey:g,currentTarget:w,shiftKey:S}=m,{loop:T}=n,M=d===Wn.tab&&!b&&!v&&!g,C=document.activeElement;if(M&&C){const _=w,[P,E]=JE(_);if(P&&E){if(!S&&C===E){const A=fl({focusReason:s.value});e("focusout-prevented",A),A.defaultPrevented||(m.preventDefault(),T&&Gi(P,!0))}else if(S&&[P,_].includes(C)){const A=fl({focusReason:s.value});e("focusout-prevented",A),A.defaultPrevented||(m.preventDefault(),T&&Gi(E,!0))}}else if(C===_){const A=fl({focusReason:s.value});e("focusout-prevented",A),A.defaultPrevented||m.preventDefault()}}};a.provide(XE,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[d])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",h)),d&&(d.removeEventListener("keydown",l),d.removeEventListener("focusin",f),d.removeEventListener("focusout",h))});const u=m=>{e(Fm,m)},c=m=>e(Vm,m),f=m=>{const d=a.unref(t);if(!d)return;const b=m.target,v=m.relatedTarget,g=b&&d.contains(b);n.trapped||v&&d.contains(v)||(i=v),g&&e("focusin",m),!o.paused&&n.trapped&&(g?r=b:Gi(r,!0))},h=m=>{const d=a.unref(t);if(!(o.paused||!d))if(n.trapped){const b=m.relatedTarget;!ci(b)&&!d.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const v=fl({focusReason:s.value});e("focusout-prevented",v),v.defaultPrevented||Gi(r,!0)}},0)}else{const b=m.target;b&&d.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){Gm.push(o);const d=m.contains(document.activeElement)?i:document.activeElement;if(i=d,!m.contains(d)){const v=new Event(Bu,Bm);m.addEventListener(Bu,u),m.dispatchEvent(v),v.defaultPrevented||a.nextTick(()=>{let g=n.focusStartEl;Qt(g)||(Gi(g),document.activeElement!==g&&(g="first")),g==="first"&&QE(km(m),!0),(document.activeElement===d||g==="container")&&Gi(m)})}}}function y(){const m=a.unref(t);if(m){m.removeEventListener(Bu,u);const d=new CustomEvent(Fu,{...Bm,detail:{focusReason:s.value}});m.addEventListener(Fu,c),m.dispatchEvent(d),!d.defaultPrevented&&(s.value=="keyboard"||!eA()||m.contains(document.activeElement))&&Gi(i??document.body),m.removeEventListener(Fu,c),Gm.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():y()})}),a.onBeforeUnmount(()=>{n.trapped&&y(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:l}}});function iA(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var rA=$e(nA,[["render",iA],["__file","focus-trap.vue"]]);const sA=["fixed","absolute"],oA=Qe({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ve(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:cs,default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},strategy:{type:String,values:sA,default:"absolute"}}),Wm=Qe({...oA,id:String,style:{type:Ve([String,Array,Object])},className:{type:Ve([String,Array,Object])},effect:{type:Ve(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ve([String,Array,Object])},popperStyle:{type:Ve([String,Array,Object])},referenceEl:{type:Ve(Object)},triggerTargetEl:{type:Ve(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,..._r(["ariaLabel"])}),aA={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},lA=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...uA(n),...e]};return dA(s,r==null?void 0:r.modifiers),s},cA=n=>{if(Lt)return ri(n)};function uA(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function dA(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const hA=0,fA=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Nu,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var v;const g=a.unref(s),w=(v=a.unref(o))!=null?v:hA;return{name:"arrow",enabled:!KS(g),options:{element:g,padding:w}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...lA(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>cA(n.referenceEl)||a.unref(i)),{attributes:h,state:p,styles:y,update:m,forceUpdate:d,instanceRef:b}=GT(f,t,c);return a.watch(b,v=>e.value=v),a.onMounted(()=>{a.watch(()=>{var v;return(v=a.unref(f))==null?void 0:v.getBoundingClientRect()},()=>{m()})}),{attributes:h,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:y,role:r,forceUpdate:d,update:m}},pA=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=Mm(),s=We("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(nt(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),h=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:h,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=nt(n.zIndex)?n.zIndex:r()}}},mA=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},gA=a.defineComponent({name:"ElPopperContent"}),yA=a.defineComponent({...gA,props:Wm,emits:aA,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=mA(i,t),{attributes:h,arrowRef:p,contentRef:y,styles:m,instanceRef:d,role:b,update:v}=fA(i),{ariaModal:g,arrowStyle:w,contentAttrs:S,contentClass:T,contentStyle:M,updateZIndex:C}=pA(i,{styles:m,attributes:h,role:b}),_=a.inject(ll,void 0),P=a.ref();a.provide(Lm,{arrowStyle:w,arrowRef:p,arrowOffset:P}),_&&a.provide(ll,{..._,addInputId:_o,removeInputId:_o});let E;const O=(L=!0)=>{v(),L&&C()},A=()=>{O(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(L,R)=>{E==null||E(),E=void 0;const N=a.unref(L||y.value),x=a.unref(R||y.value);xr(N)&&(E=a.watch([b,()=>i.ariaLabel,g,()=>i.id],I=>{["role","aria-label","aria-modal","id"].forEach((B,F)=>{ci(I[F])?N.removeAttribute(B):N.setAttribute(B,I[F])})},{immediate:!0})),x!==N&&xr(x)&&["role","aria-label","aria-modal","id"].forEach(I=>{x.removeAttribute(I)})},{immediate:!0}),a.watch(()=>i.visible,A,{immediate:!0})}),a.onBeforeUnmount(()=>{E==null||E(),E=void 0}),e({popperContentRef:y,popperInstanceRef:d,updatePopper:O,contentStyle:M}),(L,R)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:y},a.unref(S),{style:a.unref(M),class:a.unref(T),tabindex:"-1",onMouseenter:N=>L.$emit("mouseenter",N),onMouseleave:N=>L.$emit("mouseleave",N)}),[a.createVNode(a.unref(rA),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(y),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(L.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var vA=$e(yA,[["__file","content.vue"]]);const bA=kt(VE),zu=Symbol("elTooltip"),un=Qe({...XT,...Wm,appendTo:{type:Ve([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ve(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,..._r(["ariaLabel"])}),ko=Qe({...Dm,disabled:Boolean,trigger:{type:Ve([String,Array]),default:"hover"},triggerKeys:{type:Ve(Array),default:()=>[Wn.enter,Wn.space]}}),{useModelToggleProps:xA,useModelToggleEmits:wA,useModelToggle:MA}=k_("visible"),SA=Qe({...Pm,...xA,...un,...ko,...Im,showArrow:{type:Boolean,default:!0}}),_A=[...wA,"before-show","before-hide","show","hide","open","close"],TA=(n,e)=>sn(n)?n.includes(e):n===e,vs=(n,e,t)=>i=>{TA(a.unref(n),e)&&t(i)},EA=a.defineComponent({name:"ElTooltipTrigger"}),AA=a.defineComponent({...EA,props:ko,setup(n,{expose:e}){const t=n,i=We("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(zu,void 0),f=a.ref(null),h=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),y=ii(h,vs(p,"hover",l)),m=ii(h,vs(p,"hover",u)),d=ii(h,vs(p,"click",S=>{S.button===0&&c(S)})),b=ii(h,vs(p,"focus",l)),v=ii(h,vs(p,"focus",u)),g=ii(h,vs(p,"contextmenu",S=>{S.preventDefault(),c(S)})),w=ii(h,S=>{const{code:T}=S;t.triggerKeys.includes(T)&&(S.preventDefault(),c(S))});return e({triggerRef:f}),(S,T)=>(a.openBlock(),a.createBlock(a.unref(jE),{id:a.unref(s),"virtual-ref":S.virtualRef,open:a.unref(o),"virtual-triggering":S.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(v),onClick:a.unref(d),onContextmenu:a.unref(g),onFocus:a.unref(b),onMouseenter:a.unref(y),onMouseleave:a.unref(m),onKeydown:a.unref(w)},{default:a.withCtx(()=>[a.renderSlot(S.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var CA=$e(AA,[["__file","trigger.vue"]]);const RA=Qe({to:{type:Ve([String,Object]),required:!0},disabled:Boolean});var LA=$e(a.defineComponent({__name:"teleport",props:RA,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const PA=kt(LA),IA=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),OA=a.defineComponent({...IA,props:un,setup(n,{expose:e}){const t=n,{selector:i}=mm(),r=We("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:h,onOpen:p,onShow:y,onHide:m,onBeforeShow:d,onBeforeHide:b}=a.inject(zu,void 0),v=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),g=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const w=a.computed(()=>a.unref(g)?!0:a.unref(c)),S=a.computed(()=>t.disabled?!1:a.unref(c)),T=a.computed(()=>t.appendTo||i.value),M=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),C=a.ref(!0),_=()=>{m(),C.value=!0},P=()=>{if(a.unref(l))return!0},E=ii(P,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),O=ii(P,()=>{a.unref(f)==="hover"&&h()}),A=()=>{var x,I;(I=(x=s.value)==null?void 0:x.updatePopper)==null||I.call(x),d==null||d()},L=()=>{b==null||b()},R=()=>{y(),o=Gx(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&h()})},N=()=>{t.virtualTriggering||h()};return a.watch(()=>a.unref(c),x=>{x?C.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,I;(I=(x=s.value)==null?void 0:x.updatePopper)==null||I.call(x)}),e({contentRef:s}),(x,I)=>(a.openBlock(),a.createBlock(a.unref(PA),{disabled:!x.teleported,to:a.unref(T)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(v),onAfterLeave:_,onBeforeEnter:A,onAfterEnter:R,onBeforeLeave:L},{default:a.withCtx(()=>[a.unref(w)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(vA),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":C.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(M)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(S),"z-index":x.zIndex,onMouseenter:a.unref(E),onMouseleave:a.unref(O),onBlur:N,onClose:a.unref(h)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(S)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var NA=$e(OA,[["__file","content.vue"]]);const DA=a.defineComponent({name:"ElTooltip"}),BA=a.defineComponent({...DA,props:SA,emits:_A,setup(n,{expose:e,emit:t}){const i=n;ZT();const r=ol(),s=a.ref(),o=a.ref(),l=()=>{var v;const g=a.unref(s);g&&((v=g.popperInstanceRef)==null||v.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:h,hasUpdateHandler:p}=MA({indicator:u,toggleReason:c}),{onOpen:y,onClose:m}=YT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:h}),d=a.computed(()=>fu(i.visible)&&!p.value);a.provide(zu,{controlled:d,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:v=>{y(v)},onClose:v=>{m(v)},onToggle:v=>{a.unref(u)?m(v):y(v)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,v=>{v&&u.value&&(u.value=!1)});const b=v=>{var g,w;const S=(w=(g=o.value)==null?void 0:g.contentRef)==null?void 0:w.popperContentRef,T=(v==null?void 0:v.relatedTarget)||document.activeElement;return S&&S.contains(T)};return a.onDeactivated(()=>u.value&&h()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:y,onClose:m,hide:h}),(v,g)=>(a.openBlock(),a.createBlock(a.unref(bA),{ref_key:"popperRef",ref:s,role:v.role},{default:a.withCtx(()=>[a.createVNode(CA,{disabled:v.disabled,trigger:v.trigger,"trigger-keys":v.triggerKeys,"virtual-ref":v.virtualRef,"virtual-triggering":v.virtualTriggering},{default:a.withCtx(()=>[v.$slots.default?a.renderSlot(v.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(NA,{ref_key:"contentRef",ref:o,"aria-label":v.ariaLabel,"boundaries-padding":v.boundariesPadding,content:v.content,disabled:v.disabled,effect:v.effect,enterable:v.enterable,"fallback-placements":v.fallbackPlacements,"hide-after":v.hideAfter,"gpu-acceleration":v.gpuAcceleration,offset:v.offset,persistent:v.persistent,"popper-class":v.popperClass,"popper-style":v.popperStyle,placement:v.placement,"popper-options":v.popperOptions,pure:v.pure,"raw-content":v.rawContent,"reference-el":v.referenceEl,"trigger-target-el":v.triggerTargetEl,"show-after":v.showAfter,strategy:v.strategy,teleported:v.teleported,transition:v.transition,"virtual-triggering":v.virtualTriggering,"z-index":v.zIndex,"append-to":v.appendTo},{default:a.withCtx(()=>[a.renderSlot(v.$slots,"content",{},()=>[v.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:v.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(v.content),1))]),v.showArrow?(a.openBlock(),a.createBlock(a.unref(UE),{key:0,"arrow-offset":v.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var FA=$e(BA,[["__file","tooltip.vue"]]);const Uu=kt(FA),jm=Symbol("buttonGroupContextKey"),VA=(n,e)=>{P_({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(jm,void 0),i=Ru("button"),{form:r}=Vo(),s=gs(a.computed(()=>t==null?void 0:t.size)),o=cl(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,d,b;return(b=(d=n.autoInsertSpace)!=null?d:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),h=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const d=(m=u.default)==null?void 0:m.call(u);if(f.value&&(d==null?void 0:d.length)===1){const b=d[0];if((b==null?void 0:b.type)===a.Text){const v=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(v.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:h,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},Gu=Qe({size:ms,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ki},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ki,default:()=>Vp},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Ve([String,Object]),default:"button"}}),kA={click:n=>n instanceof MouseEvent};function Ht(n,e){zA(n)&&(n="100%");var t=UA(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function pl(n){return Math.min(1,Math.max(0,n))}function zA(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function UA(n){return typeof n=="string"&&n.indexOf("%")!==-1}function $m(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function ml(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Tr(n){return n.length===1?"0"+n:String(n)}function GA(n,e,t){return{r:Ht(n,255)*255,g:Ht(e,255)*255,b:Ht(t,255)*255}}function Zm(n,e,t){n=Ht(n,255),e=Ht(e,255),t=Ht(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e<t?6:0);break;case e:s=(t-n)/u+2;break;case t:s=(n-e)/u+4;break}s/=6}return{h:s,s:o,l}}function Hu(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function HA(n,e,t){var i,r,s;if(n=Ht(n,360),e=Ht(e,100),t=Ht(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=Hu(l,o,n+1/3),r=Hu(l,o,n),s=Hu(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function Xm(n,e,t){n=Ht(n,255),e=Ht(e,255),t=Ht(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(i){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:u,v:o}}function WA(n,e,t){n=Ht(n,360)*6,e=Ht(e,100),t=Ht(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),l=t*(1-(1-r)*e),u=i%6,c=[t,o,s,s,l,t][u],f=[l,t,t,o,s,s][u],h=[s,s,l,t,t,o][u];return{r:c*255,g:f*255,b:h*255}}function Ym(n,e,t,i){var r=[Tr(Math.round(n).toString(16)),Tr(Math.round(e).toString(16)),Tr(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function jA(n,e,t,i,r){var s=[Tr(Math.round(n).toString(16)),Tr(Math.round(e).toString(16)),Tr(Math.round(t).toString(16)),Tr($A(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function $A(n){return Math.round(parseFloat(n)*255).toString(16)}function Jm(n){return dn(n)/255}function dn(n){return parseInt(n,16)}function ZA(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var Wu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function XA(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=KA(n)),typeof n=="object"&&(fi(n.r)&&fi(n.g)&&fi(n.b)?(e=GA(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):fi(n.h)&&fi(n.s)&&fi(n.v)?(i=ml(n.s),r=ml(n.v),e=WA(n.h,i,r),o=!0,l="hsv"):fi(n.h)&&fi(n.s)&&fi(n.l)&&(i=ml(n.s),s=ml(n.l),e=HA(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=$m(t),{ok:o,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var YA="[-\\+]?\\d+%?",JA="[-\\+]?\\d*\\.\\d+%?",Hi="(?:".concat(JA,")|(?:").concat(YA,")"),ju="[\\s|\\(]+(".concat(Hi,")[,|\\s]+(").concat(Hi,")[,|\\s]+(").concat(Hi,")\\s*\\)?"),$u="[\\s|\\(]+(".concat(Hi,")[,|\\s]+(").concat(Hi,")[,|\\s]+(").concat(Hi,")[,|\\s]+(").concat(Hi,")\\s*\\)?"),Rn={CSS_UNIT:new RegExp(Hi),rgb:new RegExp("rgb"+ju),rgba:new RegExp("rgba"+$u),hsl:new RegExp("hsl"+ju),hsla:new RegExp("hsla"+$u),hsv:new RegExp("hsv"+ju),hsva:new RegExp("hsva"+$u),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function KA(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(Wu[n])n=Wu[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Rn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Rn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Rn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Rn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Rn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Rn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Rn.hex8.exec(n),t?{r:dn(t[1]),g:dn(t[2]),b:dn(t[3]),a:Jm(t[4]),format:e?"name":"hex8"}:(t=Rn.hex6.exec(n),t?{r:dn(t[1]),g:dn(t[2]),b:dn(t[3]),format:e?"name":"hex"}:(t=Rn.hex4.exec(n),t?{r:dn(t[1]+t[1]),g:dn(t[2]+t[2]),b:dn(t[3]+t[3]),a:Jm(t[4]+t[4]),format:e?"name":"hex8"}:(t=Rn.hex3.exec(n),t?{r:dn(t[1]+t[1]),g:dn(t[2]+t[2]),b:dn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function fi(n){return!!Rn.CSS_UNIT.exec(String(n))}var qA=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=ZA(e)),this.originalInput=e;var r=XA(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,s=e.r/255,o=e.g/255,l=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=$m(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=Xm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=Xm(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=Zm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=Zm(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),Ym(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),jA(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Ht(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Ht(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+Ym(this.r,this.g,this.b,!1),t=0,i=Object.entries(Wu);t<i.length;t++){var r=i[t],s=r[0],o=r[1];if(e===o)return s}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=pl(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=pl(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=pl(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=pl(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),s=t/100,o={r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,s=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(new n(i));return s},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,s=t.v,o=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],s=360/e,o=1;o<e;o++)r.push(new n({h:(i+o*s)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function Wi(n,e=20){return n.mix("#141414",e).toString()}function QA(n){const e=cl(),t=We("button");return a.computed(()=>{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new qA(r),l=n.dark?o.tint(20).toString():Wi(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Wi(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Wi(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?Wi(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Wi(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Wi(o,80):o.tint(80).toString());else{const u=n.dark?Wi(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?Wi(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const eC=a.defineComponent({name:"ElButton"}),tC=a.defineComponent({...eC,props:Gu,emits:kA,setup(n,{expose:e,emit:t}){const i=n,r=QA(i),s=We("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:h,handleClick:p}=VA(i,t),y=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:h}),(m,d)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(y),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(ht),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(ht),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(h)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var nC=$e(tC,[["__file","button.vue"]]);const iC={size:Gu.size,type:Gu.type},rC=a.defineComponent({name:"ElButtonGroup"}),sC=a.defineComponent({...rC,props:iC,setup(n){const e=n;a.provide(jm,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=We("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var Km=$e(sC,[["__file","button-group.vue"]]);const bs=kt(nC,{ButtonGroup:Km});ui(Km);var ji=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function gl(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const $i=new Map;if(Lt){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of $i.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function qm(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:xr(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),h=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),y=s&&(s.contains(o)||s.contains(l));u||c||f||h||p||y||e.value(i,r)}}const aC={beforeMount(n,e){$i.has(n)||$i.set(n,[]),$i.get(n).push({documentHandler:qm(n,e),bindingFn:e.value})},updated(n,e){$i.has(n)||$i.set(n,[]);const t=$i.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:qm(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){$i.delete(n)}},lC=100,cC=600,Qm={beforeMount(n,e){const t=e.value,{interval:i=lC,delay:r=cC}=Yt(t)?{}:t;let s,o;const l=()=>Yt(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},Zu=Qe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Gp},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),uC={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},dC=a.defineComponent({name:"ElTag"}),hC=a.defineComponent({...dC,props:Zu,emits:uC,setup(n,{emit:e}){const t=n,i=gs(),r=We("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:h,closable:p,round:y}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(h),r.is("hit",f),r.is("round",y)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(gu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(gu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var fC=$e(hC,[["__file","tag.vue"]]);const pC=kt(fC),eg=Symbol("rowContextKey"),mC=Qe({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),gC=a.defineComponent({name:"ElRow"}),yC=a.defineComponent({...gC,props:mC,setup(n){const e=n,t=We("row"),i=a.computed(()=>e.gutter);a.provide(eg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var vC=$e(yC,[["__file","row.vue"]]);const Zn=kt(vC),bC=Qe({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Ve([Number,Object]),default:()=>di({})},sm:{type:Ve([Number,Object]),default:()=>di({})},md:{type:Ve([Number,Object]),default:()=>di({})},lg:{type:Ve([Number,Object]),default:()=>di({})},xl:{type:Ve([Number,Object]),default:()=>di({})}}),xC=a.defineComponent({name:"ElCol"}),wC=a.defineComponent({...xC,props:bC,setup(n){const e=n,{gutter:t}=a.inject(eg,{gutter:a.computed(()=>0)}),i=We("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];nt(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{nt(e[c])?o.push(i.b(`${c}-${e[c]}`)):en(e[c])&&Object.entries(e[c]).forEach(([f,h])=>{o.push(f!=="span"?i.b(`${c}-${f}-${h}`):i.b(`${c}-${h}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var MC=$e(wC,[["__file","col.vue"]]);const Ln=kt(MC),tg=n=>nt(n)||Qt(n)||sn(n),SC=Qe({accordion:Boolean,modelValue:{type:Ve([Array,String,Number]),default:()=>di([])}}),_C={[dt]:tg,[zi]:tg},ng=Symbol("collapseContextKey"),TC=(n,e)=>{const t=a.ref(Hn(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(dt,o),e(zi,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Hn(n.modelValue),{deep:!0}),a.provide(ng,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},EC=()=>{const n=We("collapse");return{rootKls:a.computed(()=>n.b())}},AC=a.defineComponent({name:"ElCollapse"}),CC=a.defineComponent({...AC,props:SC,emits:_C,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=TC(i,t),{rootKls:o}=EC();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var RC=$e(CC,[["__file","collapse.vue"]]);const LC=a.defineComponent({name:"ElCollapseTransition"}),PC=a.defineComponent({...LC,setup(n){const e=We("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var IC=$e(PC,[["__file","collapse-transition.vue"]]);const OC=kt(IC),NC=Qe({title:{type:String,default:""},name:{type:Ve([String,Number]),default:void 0},icon:{type:ki,default:Vi},disabled:Boolean}),DC=n=>{const e=a.inject(ng),{namespace:t}=We("collapse"),i=a.ref(!1),r=a.ref(!1),s=Cu(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},BC=(n,{focusing:e,isActive:t,id:i})=>{const r=We("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),h=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:h}},FC=a.defineComponent({name:"ElCollapseItem"}),VC=a.defineComponent({...FC,props:NC,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=DC(t),{arrowKls:c,headKls:f,rootKls:h,itemWrapperKls:p,itemContentKls:y,scopedContentId:m,scopedHeadId:d}=BC(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,v)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(h))},[a.createElementVNode("button",{id:a.unref(d),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:g=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(ht),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(OC),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(d)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(y))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var ig=$e(VC,[["__file","collapse-item.vue"]]);const rg=kt(RC,{CollapseItem:ig}),sg=ui(ig),kC=a.defineComponent({name:"ElContainer"}),zC=a.defineComponent({...kC,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=We("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var UC=$e(zC,[["__file","container.vue"]]);const GC=a.defineComponent({name:"ElAside"}),HC=a.defineComponent({...GC,props:{width:{type:String,default:null}},setup(n){const e=n,t=We("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var og=$e(HC,[["__file","aside.vue"]]);const WC=a.defineComponent({name:"ElFooter"}),jC=a.defineComponent({...WC,props:{height:{type:String,default:null}},setup(n){const e=n,t=We("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var ag=$e(jC,[["__file","footer.vue"]]);const $C=a.defineComponent({name:"ElHeader"}),ZC=a.defineComponent({...$C,props:{height:{type:String,default:null}},setup(n){const e=n,t=We("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var lg=$e(ZC,[["__file","header.vue"]]);const XC=a.defineComponent({name:"ElMain"}),YC=a.defineComponent({...XC,setup(n){const e=We("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var cg=$e(YC,[["__file","main.vue"]]);const Xn=kt(UC,{Aside:og,Footer:ag,Header:lg,Main:cg});ui(og);const ug=ui(ag),JC=ui(lg),pi=ui(cg),KC=a.defineComponent({inheritAttrs:!1});function qC(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var QC=$e(KC,[["render",qC],["__file","collection.vue"]]);const e2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function t2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var n2=$e(e2,[["render",t2],["__file","collection-item.vue"]]);const i2="data-el-collection-item",r2=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...QC,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const h=Array.from(f.querySelectorAll(`[${i2}]`));return[...u.values()].sort((y,m)=>h.indexOf(y.ref)-h.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...n2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const h=a.unref(c);h&&f.itemMap.set(h,{ref:h,...u})}),a.onBeforeUnmount(()=>{const h=a.unref(c);f.itemMap.delete(h)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},Xu=Qe({trigger:ko.trigger,effect:{...un.effect,default:"light"},type:{type:Ve(String)},placement:{type:Ve(String),default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Ve([Number,String]),default:0},maxHeight:{type:Ve([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Ve(Object)},teleported:un.teleported});Qe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:ki}}),Qe({onKeydown:{type:Ve(Function)}}),r2("Dropdown");const s2=Qe({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:ms,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||nt(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},..._r(["ariaLabel"])}),o2={[zi]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[wr]:n=>nt(n)||ci(n),[dt]:n=>nt(n)||ci(n)},a2=a.defineComponent({name:"ElInputNumber"}),l2=a.defineComponent({...a2,props:s2,emits:o2,setup(n,{expose:e,emit:t}){const i=n,{t:r}=el(),s=We("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=Vo(),c=a.computed(()=>nt(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>nt(i.modelValue)&&i.modelValue>=i.max),h=a.computed(()=>{const N=v(i.step);return En(i.precision)?Math.max(v(i.modelValue),N):(N>i.precision&&xt("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),y=gs(),m=cl(),d=a.computed(()=>{if(l.userInput!==null)return l.userInput;let N=l.currentValue;if(ci(N))return"";if(nt(N)){if(Number.isNaN(N))return"";En(i.precision)||(N=N.toFixed(i.precision))}return N}),b=(N,x)=>{if(En(x)&&(x=h.value),x===0)return Math.round(N);let I=String(N);const B=I.indexOf(".");if(B===-1||!I.replace(".","").split("")[B+x])return N;const k=I.length;return I.charAt(k-1)==="5"&&(I=`${I.slice(0,Math.max(0,k-1))}6`),Number.parseFloat(Number(I).toFixed(x))},v=N=>{if(ci(N))return 0;const x=N.toString(),I=x.indexOf(".");let B=0;return I!==-1&&(B=x.length-I-1),B},g=(N,x=1)=>nt(N)?b(N+i.step*x):l.currentValue,w=()=>{if(i.readonly||m.value||f.value)return;const N=Number(d.value)||0,x=g(N);M(x),t(wr,l.currentValue),L()},S=()=>{if(i.readonly||m.value||c.value)return;const N=Number(d.value)||0,x=g(N,-1);M(x),t(wr,l.currentValue),L()},T=(N,x)=>{const{max:I,min:B,step:F,precision:V,stepStrictly:k,valueOnClear:G}=i;I<B&&as("InputNumber","min should not be greater than max.");let J=Number(N);if(ci(N)||Number.isNaN(J))return null;if(N===""){if(G===null)return null;J=Qt(G)?{min:B,max:I}[G]:G}return k&&(J=b(Math.round(J/F)*F,V),J!==N&&x&&t(dt,J)),En(V)||(J=b(J,V)),(J>I||J<B)&&(J=J>I?I:B,x&&t(dt,J)),J},M=(N,x=!0)=>{var I;const B=l.currentValue,F=T(N);if(!x){t(dt,F);return}B===F&&N||(l.userInput=null,t(dt,F),B!==F&&t(zi,F,B),i.validateEvent&&((I=u==null?void 0:u.validate)==null||I.call(u,"change").catch(V=>xt(V))),l.currentValue=F)},C=N=>{l.userInput=N;const x=N===""?null:Number(N);t(wr,x),M(x,!1)},_=N=>{const x=N!==""?Number(N):"";(nt(x)&&!Number.isNaN(x)||N==="")&&M(x),L(),l.userInput=null},P=()=>{var N,x;(x=(N=o.value)==null?void 0:N.focus)==null||x.call(N)},E=()=>{var N,x;(x=(N=o.value)==null?void 0:N.blur)==null||x.call(N)},O=N=>{t("focus",N)},A=N=>{var x;l.userInput=null,t("blur",N),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(I=>xt(I)))},L=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},R=N=>{document.activeElement===N.target&&N.preventDefault()};return a.watch(()=>i.modelValue,(N,x)=>{const I=T(N,!0);l.userInput===null&&I!==x&&(l.currentValue=I)},{immediate:!0}),a.onMounted(()=>{var N;const{min:x,max:I,modelValue:B}=i,F=(N=o.value)==null?void 0:N.input;if(F.setAttribute("role","spinbutton"),Number.isFinite(I)?F.setAttribute("aria-valuemax",String(I)):F.removeAttribute("aria-valuemax"),Number.isFinite(x)?F.setAttribute("aria-valuemin",String(x)):F.removeAttribute("aria-valuemin"),F.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),F.setAttribute("aria-disabled",String(m.value)),!nt(B)&&B!=null){let V=Number(B);Number.isNaN(V)&&(V=null),t(dt,V)}F.addEventListener("wheel",R,{passive:!1})}),a.onUpdated(()=>{var N,x;const I=(N=o.value)==null?void 0:N.input;I==null||I.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:P,blur:E}),(N,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(y)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!N.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[N.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(S,["enter"])},[a.renderSlot(N.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(ht),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(pu),{key:0})):(a.openBlock(),a.createBlock(a.unref(x_),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Qm),S]]):a.createCommentVNode("v-if",!0),N.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(w,["enter"])},[a.renderSlot(N.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(ht),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(u_),{key:0})):(a.openBlock(),a.createBlock(a.unref(Ka),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Qm),w]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(SE),{id:N.id,ref_key:"input",ref:o,type:"number",step:N.step,"model-value":a.unref(d),placeholder:N.placeholder,readonly:N.readonly,disabled:a.unref(m),size:a.unref(y),max:N.max,min:N.min,name:N.name,"aria-label":N.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(w,["prevent"]),["up"]),a.withKeys(a.withModifiers(S,["prevent"]),["down"])],onBlur:A,onFocus:O,onInput:C,onChange:_},a.createSlots({_:2},[N.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(N.$slots,"prefix")])}:void 0,N.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(N.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var c2=$e(l2,[["__file","input-number.vue"]]);const mi=kt(c2),dg=Symbol("ElSelectGroup"),yl=Symbol("ElSelect");function u2(n,e){const t=a.inject(yl),i=a.inject(dg,{disabled:!1}),r=a.computed(()=>f(Hn(t.props.modelValue),n.value)),s=a.computed(()=>{var y;if(t.props.multiple){const m=Hn((y=t.props.modelValue)!=null?y:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(en(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(y=[],m)=>{if(en(n.value)){const d=t.props.valueKey;return y&&y.some(b=>a.toRaw(ai(b,d))===ai(m,d))}else return y&&y.includes(m)},h=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=y=>{const m=new RegExp(i_(y),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(y,m)=>{const{remote:d,valueKey:b}=t.props;if(y!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!d){if(b&&en(y)&&en(m)&&y[b]===m[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:h,updateOption:p}}const d2=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=We("select"),t=ol(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=u2(n,r),{visible:h,hover:p}=a.toRefs(r),y=a.getCurrentInstance().proxy;u.onOptionCreate(y),a.onBeforeUnmount(()=>{const d=y.value,{selected:b}=u.states,g=(u.props.multiple?b:[b]).some(w=>w.value===y.value);a.nextTick(()=>{u.states.cachedOptions.get(d)===y&&!g&&u.states.cachedOptions.delete(d)}),u.onOptionDestroy(d,y)});function m(){l.value||u.handleOptionSelect(y)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:h,hover:p,selectOptionClick:m,states:r}}});function h2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var Yu=$e(d2,[["render",h2],["__file","option.vue"]]);const f2=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(yl),e=We("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),bn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function p2(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var m2=$e(f2,[["render",p2],["__file","select-dropdown.vue"]]);const g2=11,y2=(n,e)=>{const{t}=el(),i=ol(),r=We("select"),s=We("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),h=a.ref(null),p=a.ref(null),y=a.ref(null),m=a.ref(null),d=a.ref(null),b=a.ref(null),v=a.ref(null),g=a.ref(null),{isComposing:w,handleCompositionStart:S,handleCompositionUpdate:T,handleCompositionEnd:M}=Tm({afterComposition:fe=>te(fe)}),{wrapperRef:C,isFocused:_}=_m(h,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!P.value&&(P.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(fe){var xe,_e;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(fe))||((_e=f.value)==null?void 0:_e.isFocusInsideContent(fe))},afterBlur(){P.value=!1,o.menuVisibleOnFocus=!1}}),P=a.ref(!1),E=a.ref(),{form:O,formItem:A}=Vo(),{inputId:L}=Pu(n,{formItemContext:A}),{valueOnClear:R,isEmptyValue:N}=oE(n),x=a.computed(()=>n.disabled||(O==null?void 0:O.disabled)),I=a.computed(()=>sn(n.modelValue)?n.modelValue.length>0:!N(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&I.value),F=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),V=a.computed(()=>r.is("reverse",F.value&&P.value)),k=a.computed(()=>(A==null?void 0:A.validateState)||""),G=a.computed(()=>Up[k.value]),J=a.computed(()=>n.remote?300:0),ne=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&ae.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),ae=a.computed(()=>ie.value.filter(fe=>fe.visible).length),ie=a.computed(()=>{const fe=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(_e=>{const Pe=fe.findIndex(Oe=>Oe.value===_e);Pe>-1&&xe.push(fe[Pe])}),xe.length>=fe.length?xe:fe}),oe=a.computed(()=>Array.from(o.cachedOptions.values())),W=a.computed(()=>{const fe=ie.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!fe}),X=()=>{n.filterable&&Yt(n.filterMethod)||n.filterable&&n.remote&&Yt(n.remoteMethod)||ie.value.forEach(fe=>{var xe;(xe=fe.updateOption)==null||xe.call(fe,o.inputValue)})},j=gs(),re=a.computed(()=>["small"].includes(j.value)?"small":"default"),z=a.computed({get(){return P.value&&ne.value!==!1},set(fe){P.value=fe}}),H=a.computed(()=>{if(n.multiple&&!En(n.modelValue))return Hn(n.modelValue).length===0&&!o.inputValue;const fe=sn(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||En(fe)?!o.inputValue:!0}),K=a.computed(()=>{var fe;const xe=(fe=n.placeholder)!=null?fe:t("el.select.placeholder");return n.multiple||!I.value?xe:o.selectedLabel}),le=a.computed(()=>$c?null:"mouseenter");a.watch(()=>n.modelValue,(fe,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",se("")),D(),!hu(fe,xe)&&n.validateEvent&&(A==null||A.validate("change").catch(_e=>xt(_e)))},{flush:"post",deep:!0}),a.watch(()=>P.value,fe=>{fe?se(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",fe)}),a.watch(()=>o.options.entries(),()=>{var fe;if(!Lt)return;const xe=((fe=l.value)==null?void 0:fe.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!En(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&D(),n.defaultFirstOption&&(n.filterable||n.remote)&&ae.value&&U()},{flush:"post"}),a.watch(()=>o.hoveringIndex,fe=>{nt(fe)&&fe>-1?E.value=ie.value[fe]||{}:E.value={},ie.value.forEach(xe=>{xe.hover=E.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||X()});const se=fe=>{o.previousQuery===fe||w.value||(o.previousQuery=fe,n.filterable&&Yt(n.filterMethod)?n.filterMethod(fe):n.filterable&&n.remote&&Yt(n.remoteMethod)&&n.remoteMethod(fe),n.defaultFirstOption&&(n.filterable||n.remote)&&ae.value?a.nextTick(U):a.nextTick(Y))},U=()=>{const fe=ie.value.filter(Pe=>Pe.visible&&!Pe.disabled&&!Pe.states.groupDisabled),xe=fe.find(Pe=>Pe.created),_e=fe[0];o.hoveringIndex=st(ie.value,xe||_e)},D=()=>{if(n.multiple)o.selectedLabel="";else{const xe=sn(n.modelValue)?n.modelValue[0]:n.modelValue,_e=$(xe);o.selectedLabel=_e.currentLabel,o.selected=[_e];return}const fe=[];En(n.modelValue)||Hn(n.modelValue).forEach(xe=>{fe.push($(xe))}),o.selected=fe},$=fe=>{let xe;const _e=Zc(fe).toLowerCase()==="object",Pe=Zc(fe).toLowerCase()==="null",Oe=Zc(fe).toLowerCase()==="undefined";for(let qe=o.cachedOptions.size-1;qe>=0;qe--){const Rt=oe.value[qe];if(_e?ai(Rt.value,n.valueKey)===ai(fe,n.valueKey):Rt.value===fe){xe={value:fe,currentLabel:Rt.currentLabel,get isDisabled(){return Rt.isDisabled}};break}}if(xe)return xe;const Ue=_e?fe.label:!Pe&&!Oe?fe:"";return{value:fe,currentLabel:Ue}},Y=()=>{o.hoveringIndex=ie.value.findIndex(fe=>o.selected.some(xe=>we(xe)===we(fe)))},ee=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},ce=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},ve=()=>{o.collapseItemWidth=v.value.getBoundingClientRect().width},be=()=>{var fe,xe;(xe=(fe=c.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},ue=()=>{var fe,xe;(xe=(fe=f.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},me=()=>{o.inputValue.length>0&&!P.value&&(P.value=!0),se(o.inputValue)},te=fe=>{if(o.inputValue=fe.target.value,n.remote)he();else return me()},he=du(()=>{me()},J.value),ge=fe=>{hu(n.modelValue,fe)||e(zi,fe)},Ae=fe=>JS(fe,xe=>!o.disabledOptions.has(xe)),Te=fe=>{if(n.multiple&&fe.code!==Wn.delete&&fe.target.value.length<=0){const xe=Hn(n.modelValue).slice(),_e=Ae(xe);if(_e<0)return;const Pe=xe[_e];xe.splice(_e,1),e(dt,xe),ge(xe),e("remove-tag",Pe)}},De=(fe,xe)=>{const _e=o.selected.indexOf(xe);if(_e>-1&&!x.value){const Pe=Hn(n.modelValue).slice();Pe.splice(_e,1),e(dt,Pe),ge(Pe),e("remove-tag",xe.value)}fe.stopPropagation(),mt()},Ye=fe=>{fe.stopPropagation();const xe=n.multiple?[]:R.value;if(n.multiple)for(const _e of o.selected)_e.isDisabled&&xe.push(_e.value);e(dt,xe),ge(xe),o.hoveringIndex=-1,P.value=!1,e("clear"),mt()},ze=fe=>{var xe;if(n.multiple){const _e=Hn((xe=n.modelValue)!=null?xe:[]).slice(),Pe=st(_e,fe.value);Pe>-1?_e.splice(Pe,1):(n.multipleLimit<=0||_e.length<n.multipleLimit)&&_e.push(fe.value),e(dt,_e),ge(_e),fe.created&&se(""),n.filterable&&!n.reserveKeyword&&(o.inputValue="")}else e(dt,fe.value),ge(fe.value),P.value=!1;mt(),!P.value&&a.nextTick(()=>{Ce(fe)})},st=(fe=[],xe)=>{if(!en(xe))return fe.indexOf(xe);const _e=n.valueKey;let Pe=-1;return fe.some((Oe,Ue)=>a.toRaw(ai(Oe,_e))===ai(xe,_e)?(Pe=Ue,!0):!1),Pe},Ce=fe=>{var xe,_e,Pe,Oe,Ue;const Fe=sn(fe)?fe[0]:fe;let qe=null;if(Fe!=null&&Fe.value){const Rt=ie.value.filter(Gt=>Gt.value===Fe.value);Rt.length>0&&(qe=Rt[0].$el)}if(c.value&&qe){const Rt=(Oe=(Pe=(_e=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:_e.contentRef)==null?void 0:Pe.querySelector)==null?void 0:Oe.call(Pe,`.${r.be("dropdown","wrap")}`);Rt&&s_(Rt,qe)}(Ue=g.value)==null||Ue.handleScroll()},He=fe=>{o.options.set(fe.value,fe),o.cachedOptions.set(fe.value,fe),fe.disabled&&o.disabledOptions.set(fe.value,fe)},Ge=(fe,xe)=>{o.options.get(fe)===xe&&o.options.delete(fe)},It=a.computed(()=>{var fe,xe;return(xe=(fe=c.value)==null?void 0:fe.popperRef)==null?void 0:xe.contentRef}),Ot=()=>{o.isBeforeHide=!1,a.nextTick(()=>Ce(o.selected))},mt=()=>{var fe;(fe=h.value)==null||fe.focus()},bt=()=>{var fe;(fe=h.value)==null||fe.blur()},Ii=fe=>{Ye(fe)},Oi=()=>{P.value=!1,_.value&&bt()},zn=()=>{o.inputValue.length>0?o.inputValue="":P.value=!1},ns=()=>{x.value||($c&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:P.value=!P.value)},Q=()=>{P.value?ie.value[o.hoveringIndex]&&ze(ie.value[o.hoveringIndex]):ns()},we=fe=>en(fe.value)?ai(fe.value,n.valueKey):fe.value,Ee=a.computed(()=>ie.value.filter(fe=>fe.visible).every(fe=>fe.disabled)),Be=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),Ke=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),Z=fe=>{if(!P.value){P.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Ee.value){fe==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):fe==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=ie.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&Z(fe),a.nextTick(()=>Ce(E.value))}},pe=()=>{if(!u.value)return 0;const fe=window.getComputedStyle(u.value);return Number.parseFloat(fe.gap||"6px")},de=a.computed(()=>{const fe=pe();return{maxWidth:`${v.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-fe:o.selectionWidth}px`}}),ye=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Me=a.computed(()=>({width:`${Math.max(o.calculatorWidth,g2)}px`}));return bn(u,ee),bn(p,ce),bn(d,be),bn(C,be),bn(b,ue),bn(v,ve),a.onMounted(()=>{D()}),{inputId:L,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:_,expanded:P,optionsArray:ie,hoverOption:E,selectSize:j,filteredOptionsCount:ae,resetCalculatorWidth:ce,updateTooltip:be,updateTagTooltip:ue,debouncedOnInputChange:he,onInput:te,deletePrevTag:Te,deleteTag:De,deleteSelected:Ye,handleOptionSelect:ze,scrollToOption:Ce,hasModelValue:I,shouldShowPlaceholder:H,currentPlaceholder:K,mouseEnterEventName:le,showClose:B,iconComponent:F,iconReverse:V,validateState:k,validateIcon:G,showNewOption:W,updateOptions:X,collapseTagSize:re,setSelected:D,selectDisabled:x,emptyText:ne,handleCompositionStart:S,handleCompositionUpdate:T,handleCompositionEnd:M,onOptionCreate:He,onOptionDestroy:Ge,handleMenuEnter:Ot,focus:mt,blur:bt,handleClearClick:Ii,handleClickOutside:Oi,handleEsc:zn,toggleMenu:ns,selectOption:Q,getValueKey:we,navigateOptions:Z,dropdownMenuVisible:z,showTagList:Be,collapseTagList:Ke,tagStyle:de,collapseTagStyle:ye,inputStyle:Me,popperRef:It,inputRef:h,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:y,suffixRef:m,selectRef:l,wrapperRef:C,selectionRef:u,scrollbarRef:g,menuRef:d,tagMenuRef:b,collapseItemRef:v}};var v2=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(yl);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){sn(c)&&c.forEach(f=>{var h,p,y,m;const d=(h=(f==null?void 0:f.type)||{})==null?void 0:h.name;d==="ElOptionGroup"?u(!Qt(f.children)&&!sn(f.children)&&Yt((p=f.children)==null?void 0:p.default)?(y=f.children)==null?void 0:y.default():f.children):d==="ElOption"?l.push((m=f.props)==null?void 0:m.value):sn(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),hu(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const b2=Qe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:ms,effect:{type:Ve(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ve(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:un.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ki,default:mu},fitInputWidth:Boolean,suffixIcon:{type:ki,default:pu},tagType:{...Zu.type,default:"info"},tagEffect:{...Zu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Ve(String),values:cs,default:"bottom-start"},fallbackPlacements:{type:Ve(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...sE,..._r(["ariaLabel"])}),hg="ElSelect",x2=a.defineComponent({name:hg,componentName:hg,components:{ElSelectMenu:m2,ElOption:Yu,ElOptions:v2,ElTag:pC,ElScrollbar:DE,ElTooltip:Uu,ElIcon:ht},directives:{ClickOutside:aC},props:b2,emits:[dt,zi,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return sn(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=y2(i,e);return a.provide(yl,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function w2(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),y=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:m=>n.states.inputHovering=!0,onMouseleave:m=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":d=>n.states.inputValue=d,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(d=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(d=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(p,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(h,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[y,n.handleClickOutside,n.popperRef]])}var M2=$e(x2,[["render",w2],["__file","select.vue"]]);const S2=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=We("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(dg,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,h;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((h=c.component)!=null&&h.proxy)},l=c=>{const f=Hn(c),h=[];return f.forEach(p=>{var y,m;o(p)?h.push(p.component.proxy):(y=p.children)!=null&&y.length?h.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&h.push(...l(p.component.subTree))}),h},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),Jx(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function _2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var fg=$e(S2,[["render",_2],["__file","option-group.vue"]]);const xs=kt(M2,{Option:Yu,OptionGroup:fg}),ws=ui(Yu);ui(fg);const T2=Qe({trigger:ko.trigger,placement:Xu.placement,disabled:ko.disabled,visible:un.visible,transition:un.transition,popperOptions:Xu.popperOptions,tabindex:Xu.tabindex,content:un.content,popperStyle:un.popperStyle,popperClass:un.popperClass,enterable:{...un.enterable,default:!0},effect:{...un.effect,default:"light"},teleported:un.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),E2={"update:visible":n=>fu(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},A2="onUpdate:visible",C2=a.defineComponent({name:"ElPopover"}),R2=a.defineComponent({...C2,props:T2,emits:E2,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[A2]),s=We("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:Ya(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),h=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},y=()=>{t("before-leave")},m=()=>{t("after-enter")},d=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:h}),(b,v)=>(a.openBlock(),a.createBlock(a.unref(Uu),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:p,onBeforeHide:y,onShow:m,onHide:d}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var L2=$e(R2,[["__file","popover.vue"]]);const pg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var P2={mounted(n,e){pg(n,e)},updated(n,e){pg(n,e)}};const I2=E_(P2,"popover"),vl=kt(L2,{directive:I2}),mg=Symbol("sliderContextKey"),O2=Qe({modelValue:{type:Ve([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:ms,inputSize:ms,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ve(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Ve(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:cs,default:"top"},marks:{type:Ve(Object)},validateEvent:{type:Boolean,default:!0},..._r(["ariaLabel"])}),Ju=n=>nt(n)||sn(n)&&n.every(nt),N2={[dt]:Ju,[wr]:Ju,[zi]:Ju},D2=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),Vt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},B2=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),F2=(n,e,t)=>{const{form:i,formItem:r}=Vo(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),h=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(h.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),y=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),d=a.computed(()=>n.vertical?{height:p.value,bottom:y.value}:{width:p.value,left:y.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},v=A=>{const L=n.min+A*(n.max-n.min)/100;if(!n.range)return o;let R;return Math.abs(f.value-L)<Math.abs(h.value-L)?R=e.firstValue<e.secondValue?"firstButton":"secondButton":R=e.firstValue>e.secondValue?"firstButton":"secondButton",u[R]},g=A=>{const L=v(A);return L.value.setPosition(A),L},w=A=>{e.firstValue=A??n.min,T(n.range?[f.value,h.value]:A??n.min)},S=A=>{e.secondValue=A,n.range&&T([f.value,h.value])},T=A=>{t(dt,A),t(wr,A)},M=async()=>{await a.nextTick(),t(zi,n.range?[f.value,h.value]:n.modelValue)},C=A=>{var L,R,N,x,I,B;if(c.value||e.dragging)return;b();let F=0;if(n.vertical){const V=(N=(R=(L=A.touches)==null?void 0:L.item(0))==null?void 0:R.clientY)!=null?N:A.clientY;F=(s.value.getBoundingClientRect().bottom-V)/e.sliderSize*100}else{const V=(B=(I=(x=A.touches)==null?void 0:x.item(0))==null?void 0:I.clientX)!=null?B:A.clientX,k=s.value.getBoundingClientRect().left;F=(V-k)/e.sliderSize*100}if(!(F<0||F>100))return g(F)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:h,runwayStyle:m,barStyle:d,resetSize:b,setPosition:g,emitChange:M,onSliderWrapperPrevent:A=>{var L,R;((L=u.firstButton.value)!=null&&L.dragging||(R=u.secondButton.value)!=null&&R.dragging)&&A.preventDefault()},onSliderClick:A=>{C(A)&&M()},onSliderDown:async A=>{const L=C(A);L&&(await a.nextTick(),L.value.onButtonDown(A))},onSliderMarkerDown:A=>{c.value||e.dragging||g(A)},setFirstValue:w,setSecondValue:S}},{left:V2,down:k2,right:z2,up:U2,home:G2,end:H2,pageUp:W2,pageDown:j2}=Wn,$2=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=du(()=>{t.value&&(r.value=!0)},50),u=du(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},Z2=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:h,resetSize:p,updateDragging:y}=a.inject(mg),{tooltip:m,tooltipVisible:d,formatValue:b,displayTooltip:v,hideTooltip:g}=$2(n,f,l),w=a.ref(),S=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),T=a.computed(()=>n.vertical?{bottom:S.value}:{left:S.value}),M=()=>{e.hovering=!0,v()},C=()=>{e.hovering=!1,e.dragging||g()},_=G=>{i.value||(G.preventDefault(),B(G),window.addEventListener("mousemove",F),window.addEventListener("touchmove",F),window.addEventListener("mouseup",V),window.addEventListener("touchend",V),window.addEventListener("contextmenu",V),w.value.focus())},P=G=>{i.value||(e.newPosition=Number.parseFloat(S.value)+G/(s.value-r.value)*100,k(e.newPosition),h())},E=()=>{P(-o.value)},O=()=>{P(o.value)},A=()=>{P(-o.value*4)},L=()=>{P(o.value*4)},R=()=>{i.value||(k(0),h())},N=()=>{i.value||(k(100),h())},x=G=>{let J=!0;[V2,k2].includes(G.key)?E():[z2,U2].includes(G.key)?O():G.key===G2?R():G.key===H2?N():G.key===j2?A():G.key===W2?L():J=!1,J&&G.preventDefault()},I=G=>{let J,ne;return G.type.startsWith("touch")?(ne=G.touches[0].clientY,J=G.touches[0].clientX):(ne=G.clientY,J=G.clientX),{clientX:J,clientY:ne}},B=G=>{e.dragging=!0,e.isClick=!0;const{clientX:J,clientY:ne}=I(G);n.vertical?e.startY=ne:e.startX=J,e.startPosition=Number.parseFloat(S.value),e.newPosition=e.startPosition},F=G=>{if(e.dragging){e.isClick=!1,v(),p();let J;const{clientX:ne,clientY:ae}=I(G);n.vertical?(e.currentY=ae,J=(e.startY-e.currentY)/c.value*100):(e.currentX=ne,J=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+J,k(e.newPosition)}},V=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||g(),e.isClick||k(e.newPosition),h()},0),window.removeEventListener("mousemove",F),window.removeEventListener("touchmove",F),window.removeEventListener("mouseup",V),window.removeEventListener("touchend",V),window.removeEventListener("contextmenu",V))},k=async G=>{if(G===null||Number.isNaN(+G))return;G<0?G=0:G>100&&(G=100);const J=100/((s.value-r.value)/o.value);let ae=Math.round(G/J)*J*(s.value-r.value)*.01+r.value;ae=Number.parseFloat(ae.toFixed(u.value)),ae!==n.modelValue&&t(dt,ae),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&v(),m.value.updatePopper()};return a.watch(()=>e.dragging,G=>{y(G)}),Vt(w,"touchstart",_,{passive:!1}),{disabled:i,button:w,tooltip:m,tooltipVisible:d,showTooltip:l,wrapperStyle:T,formatValue:b,handleMouseEnter:M,handleMouseLeave:C,onButtonDown:_,onKeyDown:x,setPosition:k}},X2=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return xt("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),Y2=(n,e,t,i,r,s)=>{const o=c=>{r(dt,c),r(wr,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&as("Slider","min should not be greater than max.");const h=n.modelValue;n.range&&Array.isArray(h)?h[1]<n.min?o([n.min,n.min]):h[0]>n.max?o([n.max,n.max]):h[0]<n.min?o([n.min,h[1]]):h[1]>n.max?o([h[0],n.max]):(e.firstValue=h[0],e.secondValue=h[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>xt(p))),e.oldValue=h.slice())):!n.range&&typeof h=="number"&&!Number.isNaN(h)&&(h<n.min?o(n.min):h>n.max?o(n.max):(e.firstValue=h,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>xt(p))),e.oldValue=h)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((h,p)=>h===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},J2=Qe({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:cs,default:"top"}}),K2={[dt]:n=>nt(n)},q2=a.defineComponent({name:"ElSliderButton"}),Q2=a.defineComponent({...q2,props:J2,emits:K2,setup(n,{expose:e,emit:t}){const i=n,r=We("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:h,formatValue:p,handleMouseEnter:y,handleMouseLeave:m,onButtonDown:d,onKeyDown:b,setPosition:v}=Z2(i,s,t),{hovering:g,dragging:w}=a.toRefs(s);return e({onButtonDown:d,onKeyDown:b,setPosition:v,hovering:g,dragging:w}),(S,T)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(g),dragging:a.unref(w)}]),style:a.normalizeStyle(a.unref(h)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(y),onMouseleave:a.unref(m),onMousedown:a.unref(d),onFocus:a.unref(y),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(Uu),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:S.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":S.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(g),dragging:a.unref(w)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var gg=$e(Q2,[["__file","button.vue"]]);const eR=Qe({mark:{type:Ve([String,Object]),default:void 0}});var tR=a.defineComponent({name:"ElSliderMarker",props:eR,setup(n){const e=We("slider"),t=a.computed(()=>Qt(n.mark)?n.mark:n.mark.label),i=a.computed(()=>Qt(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const nR=a.defineComponent({name:"ElSlider"}),iR=a.defineComponent({...nR,props:O2,emits:N2,setup(n,{expose:e,emit:t}){const i=n,r=We("slider"),{t:s}=el(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:h,minValue:p,maxValue:y,runwayStyle:m,barStyle:d,resetSize:b,emitChange:v,onSliderWrapperPrevent:g,onSliderClick:w,onSliderDown:S,onSliderMarkerDown:T,setFirstValue:M,setSecondValue:C}=F2(i,o,t),{stops:_,getStopStyle:P}=X2(i,o,p,y),{inputId:E,isLabeledByFormItem:O}=Pu(i,{formItemContext:l}),A=gs(),L=a.computed(()=>i.inputSize||A.value),R=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),N=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):R.value),x=a.computed(()=>i.formatValueText?i.formatValueText(J.value):`${J.value}`),I=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(ne.value):`${ne.value}`),F=a.computed(()=>[r.b(),r.m(A.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),V=B2(i);Y2(i,o,p,y,t,l);const k=a.computed(()=>{const oe=[i.min,i.max,i.step].map(W=>{const X=`${W}`.split(".")[1];return X?X.length:0});return Math.max.apply(null,oe)}),{sliderWrapper:G}=D2(i,o,b),{firstValue:J,secondValue:ne,sliderSize:ae}=a.toRefs(o),ie=oe=>{o.dragging=oe};return Vt(G,"touchstart",g,{passive:!1}),Vt(G,"touchmove",g,{passive:!1}),a.provide(mg,{...a.toRefs(i),sliderSize:ae,disabled:h,precision:k,emitChange:v,resetSize:b,updateDragging:ie}),e({onSliderClick:w}),(oe,W)=>{var X,j;return a.openBlock(),a.createElementBlock("div",{id:oe.range?a.unref(E):void 0,ref_key:"sliderWrapper",ref:G,class:a.normalizeClass(a.unref(F)),role:oe.range?"group":void 0,"aria-label":oe.range&&!a.unref(O)?a.unref(R):void 0,"aria-labelledby":oe.range&&a.unref(O)?(X=a.unref(l))==null?void 0:X.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":oe.showInput&&!oe.range},a.unref(r).is("disabled",a.unref(h))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(S),onTouchstartPassive:a.unref(S)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(d))},null,6),a.createVNode(gg,{id:oe.range?void 0:a.unref(E),ref_key:"firstButton",ref:c,"model-value":a.unref(J),vertical:oe.vertical,"tooltip-class":oe.tooltipClass,placement:oe.placement,role:"slider","aria-label":oe.range||!a.unref(O)?a.unref(N):void 0,"aria-labelledby":!oe.range&&a.unref(O)?(j=a.unref(l))==null?void 0:j.labelId:void 0,"aria-valuemin":oe.min,"aria-valuemax":oe.range?a.unref(ne):oe.max,"aria-valuenow":a.unref(J),"aria-valuetext":a.unref(x),"aria-orientation":oe.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(M)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),oe.range?(a.openBlock(),a.createBlock(gg,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(ne),vertical:oe.vertical,"tooltip-class":oe.tooltipClass,placement:oe.placement,role:"slider","aria-label":a.unref(I),"aria-valuemin":a.unref(J),"aria-valuemax":oe.max,"aria-valuenow":a.unref(ne),"aria-valuetext":a.unref(B),"aria-orientation":oe.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(C)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),oe.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(_),(re,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(P)(re))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(V).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(V),(re,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,style:a.normalizeStyle(a.unref(P)(re.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(V),(re,z)=>(a.openBlock(),a.createBlock(a.unref(tR),{key:z,mark:re.mark,style:a.normalizeStyle(a.unref(P)(re.position)),onMousedown:a.withModifiers(H=>a.unref(T)(re.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),oe.showInput&&!oe.range?(a.openBlock(),a.createBlock(a.unref(mi),{key:0,ref:"input","model-value":a.unref(J),class:a.normalizeClass(a.unref(r).e("input")),step:oe.step,disabled:a.unref(h),controls:oe.showInputControls,min:oe.min,max:oe.max,precision:a.unref(k),debounce:oe.debounce,size:a.unref(L),"onUpdate:modelValue":a.unref(M),onChange:a.unref(v)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var rR=$e(iR,[["__file","slider.vue"]]);const Sn=kt(rR),bl=Symbol("tabsRootContextKey"),sR=Qe({tabs:{type:Ve(Array),default:()=>di([])}}),yg="ElTabBar",oR=a.defineComponent({name:yg}),aR=a.defineComponent({...oR,props:sR,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(bl);r||as(yg,"<el-tabs><el-tab-bar /></el-tabs>");const s=We("tabs"),o=a.ref(),l=a.ref(),u=()=>{let y=0,m=0;const d=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=d==="width"?"x":"y",v=b==="x"?"left":"top";return t.tabs.every(g=>{var w,S;const T=(S=(w=i.parent)==null?void 0:w.refs)==null?void 0:S[`tab-${g.uid}`];if(!T)return!1;if(!g.active)return!0;y=T[`offset${Bi(v)}`],m=T[`client${Bi(d)}`];const M=window.getComputedStyle(T);return d==="width"&&(m-=Number.parseFloat(M.paddingLeft)+Number.parseFloat(M.paddingRight),y+=Number.parseFloat(M.paddingLeft)),!1}),{[d]:`${m}px`,transform:`translate${Bi(b)}(${y}px)`}},c=()=>l.value=u(),f=[],h=()=>{var y;f.forEach(d=>d.stop()),f.length=0;const m=(y=i.parent)==null?void 0:y.refs;if(m){for(const d in m)if(d.startsWith("tab-")){const b=m[d];b&&f.push(bn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),h()},{immediate:!0});const p=bn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(y=>y.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(y,m)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var lR=$e(aR,[["__file","tab-bar.vue"]]);const cR=Qe({panes:{type:Ve(Array),default:()=>di([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),uR={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},vg="ElTabNav",dR=a.defineComponent({name:vg,props:cR,emits:uR,setup(n,{expose:e,emit:t}){const i=a.inject(bl);i||as(vg,"<el-tabs><tab-nav /></el-tabs>");const r=We("tabs"),s=Hx(),o=tw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),h=a.ref(!1),p=a.ref(0),y=a.ref(!1),m=a.ref(!0),d=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${d.value==="width"?"X":"Y"}(-${p.value}px)`})),v=()=>{if(!l.value)return;const _=l.value[`offset${Bi(d.value)}`],P=p.value;if(!P)return;const E=P>_?P-_:0;p.value=E},g=()=>{if(!l.value||!u.value)return;const _=u.value[`offset${Bi(d.value)}`],P=l.value[`offset${Bi(d.value)}`],E=p.value;if(_-E<=P)return;const O=_-E>P*2?E+P:_-P;p.value=O},w=async()=>{const _=u.value;if(!h.value||!c.value||!l.value||!_)return;await a.nextTick();const P=c.value.querySelector(".is-active");if(!P)return;const E=l.value,O=["top","bottom"].includes(i.props.tabPosition),A=P.getBoundingClientRect(),L=E.getBoundingClientRect(),R=O?_.offsetWidth-L.width:_.offsetHeight-L.height,N=p.value;let x=N;O?(A.left<L.left&&(x=N-(L.left-A.left)),A.right>L.right&&(x=N+A.right-L.right)):(A.top<L.top&&(x=N-(L.top-A.top)),A.bottom>L.bottom&&(x=N+(A.bottom-L.bottom))),x=Math.max(x,0),p.value=Math.min(x,R)},S=()=>{var _;if(!u.value||!l.value)return;n.stretch&&((_=f.value)==null||_.update());const P=u.value[`offset${Bi(d.value)}`],E=l.value[`offset${Bi(d.value)}`],O=p.value;E<P?(h.value=h.value||{},h.value.prev=O,h.value.next=O+E<P,P-O<E&&(p.value=P-E)):(h.value=!1,O>0&&(p.value=0))},T=_=>{const P=_.code,{up:E,down:O,left:A,right:L}=Wn;if(![E,O,A,L].includes(P))return;const R=Array.from(_.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),N=R.indexOf(_.target);let x;P===A||P===E?N===0?x=R.length-1:x=N-1:N<R.length-1?x=N+1:x=0,R[x].focus({preventScroll:!0}),R[x].click(),M()},M=()=>{m.value&&(y.value=!0)},C=()=>y.value=!1;return a.watch(s,_=>{_==="hidden"?m.value=!1:_==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,_=>{_?setTimeout(()=>m.value=!0,50):m.value=!1}),bn(c,S),a.onMounted(()=>setTimeout(()=>w(),0)),a.onUpdated(()=>S()),e({scrollToActiveTab:w,removeFocus:C}),()=>{const _=h.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!h.value.prev)],onClick:v},[a.createVNode(ht,null,{default:()=>[a.createVNode(Fi,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!h.value.next)],onClick:g},[a.createVNode(ht,null,{default:()=>[a.createVNode(Vi,null,null)]})])]:null,P=n.panes.map((E,O)=>{var A,L,R,N;const x=E.uid,I=E.props.disabled,B=(L=(A=E.props.name)!=null?A:E.index)!=null?L:`${O}`,F=!I&&(E.isClosable||n.editable);E.index=`${O}`;const V=F?a.createVNode(ht,{class:"is-icon-close",onClick:J=>t("tabRemove",E,J)},{default:()=>[a.createVNode(gu,null,null)]}):null,k=((N=(R=E.slots).label)==null?void 0:N.call(R))||E.props.label,G=!I&&E.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",E.active),r.is("disabled",I),r.is("closable",F),r.is("focus",y.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":E.active,tabindex:G,onFocus:()=>M(),onBlur:()=>C(),onClick:J=>{C(),t("tabClick",E,B,J)},onKeydown:J=>{F&&(J.code===Wn.delete||J.code===Wn.backspace)&&t("tabRemove",E,J)}},[k,V])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!h.value),r.is(i.props.tabPosition)]},[_,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:T},[n.type?null:a.createVNode(lR,{ref:f,tabs:[...n.panes]},null),P])])])}}}),hR=Qe({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Ve(Function),default:()=>!0},stretch:Boolean}),Ku=n=>Qt(n)||nt(n),fR={[dt]:n=>Ku(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>Ku(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>Ku(n),tabAdd:()=>!0},pR=a.defineComponent({name:"ElTabs",props:hR,emits:fR,setup(n,{emit:e,slots:t,expose:i}){var r;const s=We("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=eE(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),h=a.ref((r=n.modelValue)!=null?r:"0"),p=async(v,g=!1)=>{var w,S,T;if(!(h.value===v||En(v)))try{await((w=n.beforeLeave)==null?void 0:w.call(n,v,h.value))!==!1&&(h.value=v,g&&(e(dt,v),e("tabChange",v)),(T=(S=f.value)==null?void 0:S.removeFocus)==null||T.call(S))}catch{}},y=(v,g,w)=>{v.props.disabled||(p(g,!0),e("tabClick",v,w))},m=(v,g)=>{v.props.disabled||En(v.props.name)||(g.stopPropagation(),e("edit",v.props.name,"remove"),e("tabRemove",v.props.name))},d=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,v=>p(v)),a.watch(h,async()=>{var v;await a.nextTick(),(v=f.value)==null||v.scrollToActiveTab()}),a.provide(bl,{props:n,currentName:h,registerPane:v=>{l.value.push(v)},sortPane:u,unregisterPane:c}),i({currentName:h});const b=({render:v})=>v();return()=>{const v=t["add-icon"],g=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:d,onKeydown:T=>{T.code===Wn.enter&&d()}},[v?a.renderSlot(t,"add-icon"):a.createVNode(ht,{class:s.is("icon-plus")},{default:()=>[a.createVNode(Ka,null,null)]})]):null,w=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const T=l.value.some(M=>M.slots.label);return a.createVNode(dR,{ref:f,currentName:h.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:y,onTabRemove:m},{$stable:!T})}},null),g]),S=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[S,w])}}}),mR=Qe({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),bg="ElTabPane",gR=a.defineComponent({name:bg}),yR=a.defineComponent({...gR,props:mR,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(bl);r||as(bg,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=We("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=Nf(()=>{var y;return r.currentName.value===((y=e.name)!=null?y:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var y;return(y=e.name)!=null?y:o.value}),h=Nf(()=>!e.lazy||c.value||u.value);a.watch(u,y=>{y&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(y,m)=>a.unref(h)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(y.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var xg=$e(yR,[["__file","tab-pane.vue"]]);const wg=kt(pR,{TabPane:xg}),Mg=ui(xg);function vR(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,y=h.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(Xa(p,y.bm("parent","relative")),p.removeAttribute("loading-number")),Xa(p,y.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,y;(y=(p=h.$el)==null?void 0:p.parentNode)==null||y.removeChild(h.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:y}){const{ns:m,zIndex:d}=lE("loading");return y({ns:m,zIndex:d}),()=>{const b=i.spinner||i.svg,v=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),g=i.text?a.h("p",{class:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[v,g])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),h=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:h,get $el(){return h.$el}}}let xl;const qu=function(n={}){if(!Lt)return;const e=bR(n);if(e.fullscreen&&xl)return xl;const t=vR({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(xl=void 0)}});xR(e,e.parent,t),Sg(e,e.parent,t),e.parent.vLoadingAddClassList=()=>Sg(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(xl=t),t},bR=n=>{var e,t,i,r;let s;return Qt(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},xR=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=Lo(document.body,"position"),t.originalOverflow.value=Lo(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=Lo(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(Lo(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=Lo(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},Sg=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?Xa(e,i.bm("parent","relative")):Fp(e,i.bm("parent","relative")),n.fullscreen&&n.lock?Fp(e,i.bm("parent","hidden")):Xa(e,i.bm("parent","hidden"))},wl=Symbol("ElLoading"),_g=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>en(e.value)?e.value[p]:void 0,u=p=>{const y=Qt(p)&&(o==null?void 0:o[p])||p;return y&&a.ref(y)},c=p=>u(l(p)||n.getAttribute(`element-loading-${cw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,h={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[wl]={options:h,instance:qu(h)}},wR=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},Qu={mounted(n,e){e.value&&_g(n,e)},updated(n,e){const t=n[wl];e.oldValue!==e.value&&(e.value&&!e.oldValue?_g(n,e):e.value&&e.oldValue?en(e.value)&&wR(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[wl])==null||e.instance.close(),n[wl]=null}},MR={install(n){n.directive("loading",Qu),n.config.globalProperties.$loading=qu},directive:Qu,service:qu};var Tg={exports:{}},Eg={},Ag;function SR(){return Ag||(Ag=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var h=c.shift();return{done:h===void 0,value:h}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(h){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof h;if(p!=="undefined")if(p==="string")h!==""&&this._fromString(h);else if(h instanceof c){var y=this;h.forEach(function(v,g){y.append(g,v)})}else if(h!==null&&p==="object")if(Object.prototype.toString.call(h)==="[object Array]")for(var m=0;m<h.length;m++){var d=h[m];if(Object.prototype.toString.call(d)==="[object Array]"||d.length!==2)this.append(d[0],d[1]);else throw new TypeError("Expected [string, any] as entry at index "+m+" of URLSearchParams's input")}else for(var b in h)h.hasOwnProperty(b)&&this.append(b,h[b]);else throw new TypeError("Unsupported input's type for URLSearchParams")},f=c.prototype;f.append=function(h,p){h in this._entries?this._entries[h].push(String(p)):this._entries[h]=[String(p)]},f.delete=function(h){delete this._entries[h]},f.get=function(h){return h in this._entries?this._entries[h][0]:null},f.getAll=function(h){return h in this._entries?this._entries[h].slice(0):[]},f.has=function(h){return h in this._entries},f.set=function(h,p){this._entries[h]=[String(p)]},f.forEach=function(h,p){var y;for(var m in this._entries)if(this._entries.hasOwnProperty(m)){y=this._entries[m];for(var d=0;d<y.length;d++)h.call(p,y[d],m,this)}},f.keys=function(){var h=[];return this.forEach(function(p,y){h.push(y)}),i(h)},f.values=function(){var h=[];return this.forEach(function(p){h.push(p)}),i(h)},f.entries=function(){var h=[];return this.forEach(function(p,y){h.push([y,p])}),i(h)},t&&(f[Symbol.iterator]=f.entries),f.toString=function(){var h=[];return this.forEach(function(p,y){h.push(r(y)+"="+r(p))}),h.join("&")},n.URLSearchParams=c},l=function(){try{var c=n.URLSearchParams;return new c("?a=1").toString()==="a=1"&&typeof c.prototype.set=="function"&&typeof c.prototype.entries=="function"}catch{return!1}};l()||o();var u=n.URLSearchParams.prototype;typeof u.sort!="function"&&(u.sort=function(){var c=this,f=[];this.forEach(function(p,y){f.push([y,p]),c._entries||c.delete(y)}),f.sort(function(p,y){return p[0]<y[0]?-1:p[0]>y[0]?1:0}),c._entries&&(c._entries={});for(var h=0;h<f.length;h++)this.append(f[h][0],f[h][1])}),typeof u._fromString!="function"&&Object.defineProperty(u,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(c){if(this._entries)this._entries={};else{var f=[];this.forEach(function(m,d){f.push(d)});for(var h=0;h<f.length;h++)this.delete(f[h])}c=c.replace(/^\?/,"");for(var p=c.split("&"),y,h=0;h<p.length;h++)y=p[h].split("="),this.append(s(y[0]),y.length>1?s(y[1]):"")}})}(typeof ji<"u"?ji:typeof window<"u"?window:typeof self<"u"?self:ji),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,h;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),h=f.createElement("base"),h.href=c,f.head.appendChild(h);try{if(h.href.indexOf(c)!==0)throw new Error(h.href)}catch(w){throw new Error("URL unable to set base "+c+" due to "+w)}}var p=f.createElement("a");p.href=u,h&&(f.body.appendChild(p),p.href=p.href);var y=f.createElement("input");if(y.type="url",y.value=u,p.protocol===":"||!/:/.test(p.href)||!y.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),d=!0,b=!0,v=this;["append","delete","set"].forEach(function(w){var S=m[w];m[w]=function(){S.apply(m,arguments),d&&(b=!1,v.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,enumerable:!0});var g=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==g&&(g=this.search,b&&(d=!1,this.searchParams._fromString(this.search),d=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof ji<"u"?ji:typeof window<"u"?window:typeof self<"u"?self:ji)),Eg}/**
20
+ `,gE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function yE(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:gE.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function Cm(n,e=1,t){var i;Cn||(Cn=document.createElement("textarea"),document.body.appendChild(Cn));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=yE(n);Cn.setAttribute("style",`${l};${mE}`),Cn.value=n.value||n.placeholder||"";let u=Cn.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),Cn.value="";const f=Cn.scrollHeight-r;if(nt(e)){let h=f*e;o==="border-box"&&(h=h+r+s),u=Math.max(h,u),c.minHeight=`${h}px`}if(nt(t)){let h=f*t;o==="border-box"&&(h=h+r+s),u=Math.min(h,u)}return c.height=`${u}px`,(i=Cn.parentNode)==null||i.removeChild(Cn),Cn=void 0,c}const vE=Qe({id:{type:String,default:void 0},size:ms,disabled:Boolean,modelValue:{type:Ve([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Ve([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:ki},prefixIcon:{type:ki},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ve([Object,Array,String]),default:()=>di({})},autofocus:Boolean,rows:{type:Number,default:2},..._r(["ariaLabel"])}),bE={[dt]:n=>Qt(n),input:n=>Qt(n),change:n=>Qt(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},xE=a.defineComponent({name:"ElInput",inheritAttrs:!1}),wE=a.defineComponent({...xE,props:vE,emits:bE,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const ue={};return i.containerRole==="combobox"&&(ue["aria-haspopup"]=r["aria-haspopup"],ue["aria-owns"]=r["aria-owns"],ue["aria-expanded"]=r["aria-expanded"]),ue}),l=a.computed(()=>[i.type==="textarea"?b.b():d.b(),d.m(y.value),d.is("disabled",m.value),d.is("exceed",J.value),{[d.b("group")]:s.prepend||s.append,[d.m("prefix")]:s.prefix||i.prefixIcon,[d.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[d.bm("suffix","password-clear")]:F.value&&V.value,[d.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[d.e("wrapper"),d.is("focus",P.value)]),c=L_({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:h}=Vo(),{inputId:p}=Pu(i,{formItemContext:h}),y=gs(),m=cl(),d=We("input"),b=We("textarea"),v=a.shallowRef(),g=a.shallowRef(),w=a.ref(!1),S=a.ref(!1),T=a.ref(),M=a.shallowRef(i.inputStyle),C=a.computed(()=>v.value||g.value),{wrapperRef:_,isFocused:P,handleFocus:E,handleBlur:O}=_m(C,{beforeFocus(){return m.value},afterBlur(){var ue;i.validateEvent&&((ue=h==null?void 0:h.validate)==null||ue.call(h,"blur").catch(me=>xt(me)))}}),A=a.computed(()=>{var ue;return(ue=f==null?void 0:f.statusIcon)!=null?ue:!1}),L=a.computed(()=>(h==null?void 0:h.validateState)||""),R=a.computed(()=>L.value&&Up[L.value]),N=a.computed(()=>S.value?S_:y_),x=a.computed(()=>[r.style]),I=a.computed(()=>[i.inputStyle,M.value,{resize:i.resize}]),B=a.computed(()=>ci(i.modelValue)?"":String(i.modelValue)),F=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(P.value||w.value)),V=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||P.value)),k=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),G=a.computed(()=>B.value.length),J=a.computed(()=>!!k.value&&G.value>Number(i.maxlength)),ne=a.computed(()=>!!s.suffix||!!i.suffixIcon||F.value||i.showPassword||k.value||!!L.value&&A.value),[ae,ie]=qT(v);bn(g,ue=>{if(Z(),!k.value||i.resize!=="both")return;const me=ue[0],{width:te}=me.contentRect;T.value={right:`calc(100% - ${te+15+6}px)`}});const oe=()=>{const{type:ue,autosize:me}=i;if(!(!Lt||ue!=="textarea"||!g.value))if(me){const te=en(me)?me.minRows:void 0,he=en(me)?me.maxRows:void 0,ge=Cm(g.value,te,he);M.value={overflowY:"hidden",...ge},a.nextTick(()=>{g.value.offsetHeight,M.value=ge})}else M.value={minHeight:Cm(g.value).minHeight}},Z=(ue=>{let me=!1;return()=>{var te;if(me||!i.autosize)return;((te=g.value)==null?void 0:te.offsetParent)===null||(ue(),me=!0)}})(oe),j=()=>{const ue=C.value,me=i.formatter?i.formatter(B.value):B.value;!ue||ue.value===me||(ue.value=me)},re=async ue=>{ae();let{value:me}=ue.target;if(i.formatter&&(me=i.parser?i.parser(me):me),!H.value){if(me===B.value){j();return}t(dt,me),t("input",me),await a.nextTick(),j(),ie()}},z=ue=>{t("change",ue.target.value)},{isComposing:H,handleCompositionStart:K,handleCompositionUpdate:le,handleCompositionEnd:se}=Tm({emit:t,afterComposition:re}),U=()=>{S.value=!S.value,D()},D=async()=>{var ue;await a.nextTick(),(ue=C.value)==null||ue.focus()},$=()=>{var ue;return(ue=C.value)==null?void 0:ue.blur()},Y=ue=>{w.value=!1,t("mouseleave",ue)},ee=ue=>{w.value=!0,t("mouseenter",ue)},ce=ue=>{t("keydown",ue)},ve=()=>{var ue;(ue=C.value)==null||ue.select()},be=()=>{t(dt,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var ue;a.nextTick(()=>oe()),i.validateEvent&&((ue=h==null?void 0:h.validate)==null||ue.call(h,"change").catch(me=>xt(me)))}),a.watch(B,()=>j()),a.watch(()=>i.type,async()=>{await a.nextTick(),j(),oe()}),a.onMounted(()=>{!i.formatter&&i.parser&&xt("ElInput","If you set the parser, you also need to set the formatter."),j(),a.nextTick(oe)}),e({input:v,textarea:g,ref:C,textareaStyle:I,autosize:a.toRef(i,"autosize"),isComposing:H,focus:D,blur:$,select:ve,clear:be,resizeTextarea:oe}),(ue,me)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(d).bm("group","append")]:ue.$slots.append,[a.unref(d).bm("group","prepend")]:ue.$slots.prepend}],style:a.unref(x),role:ue.containerRole,onMouseenter:ee,onMouseleave:Y}),[a.createCommentVNode(" input "),ue.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),ue.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(d).be("group","prepend"))},[a.renderSlot(ue.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:_,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),ue.$slots.prefix||ue.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(d).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("prefix-inner"))},[a.renderSlot(ue.$slots,"prefix"),ue.prefixIcon?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:v,class:a.unref(d).e("inner")},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,type:ue.showPassword?S.value?"text":"password":ue.type,disabled:a.unref(m),readonly:ue.readonly,autocomplete:ue.autocomplete,tabindex:ue.tabindex,"aria-label":ue.ariaLabel,placeholder:ue.placeholder,style:ue.inputStyle,form:ue.form,autofocus:ue.autofocus,onCompositionstart:a.unref(K),onCompositionupdate:a.unref(le),onCompositionend:a.unref(se),onInput:re,onChange:z,onKeydown:ce}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(ne)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(d).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("suffix-inner"))},[!a.unref(F)||!a.unref(V)||!a.unref(k)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(ue.$slots,"suffix"),ue.suffixIcon?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ue.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(F)?(a.openBlock(),a.createBlock(a.unref(ht),{key:1,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("clear")]),onMousedown:a.withModifiers(a.unref(_o),["prevent"]),onClick:be},{default:a.withCtx(()=>[a.createVNode(a.unref(mu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(V)?(a.openBlock(),a.createBlock(a.unref(ht),{key:2,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("password")]),onClick:U},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(N))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(d).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("count-inner"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(L)&&a.unref(R)&&a.unref(A)?(a.openBlock(),a.createBlock(a.unref(ht),{key:4,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("validateIcon"),a.unref(d).is("loading",a.unref(L)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(R))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),ue.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(d).be("group","append"))},[a.renderSlot(ue.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(p),ref_key:"textarea",ref:g,class:[a.unref(b).e("inner"),a.unref(d).is("focus",a.unref(P))]},a.unref(c),{minlength:ue.minlength,maxlength:ue.maxlength,tabindex:ue.tabindex,disabled:a.unref(m),readonly:ue.readonly,autocomplete:ue.autocomplete,style:a.unref(I),"aria-label":ue.ariaLabel,placeholder:ue.placeholder,form:ue.form,autofocus:ue.autofocus,rows:ue.rows,onCompositionstart:a.unref(K),onCompositionupdate:a.unref(le),onCompositionend:a.unref(se),onInput:re,onFocus:a.unref(E),onBlur:a.unref(O),onChange:z,onKeydown:ce}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(k)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(T.value),class:a.normalizeClass(a.unref(d).e("count"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ue.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var ME=$e(wE,[["__file","input.vue"]]);const SE=kt(ME),ys=4,_E={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},TE=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Iu=Symbol("scrollbarContextKey"),EE=Qe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),AE="Thumb";var Rm=$e(a.defineComponent({__name:"thumb",props:EE,setup(n){const e=n,t=a.inject(Iu),i=We("scrollbar");t||as(AE,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Lt?document.onselectstart:null;const h=a.computed(()=>_E[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>TE({size:e.size,move:e.move,bar:h.value})),y=a.computed(()=>r.value[h.value.offset]**2/t.wrapElement[h.value.scrollSize]/e.ratio/s.value[h.value.offset]),m=M=>{var C;if(M.stopPropagation(),M.ctrlKey||[1,2].includes(M.button))return;(C=window.getSelection())==null||C.removeAllRanges(),b(M);const _=M.currentTarget;_&&(o.value[h.value.axis]=_[h.value.offset]-(M[h.value.client]-_.getBoundingClientRect()[h.value.direction]))},d=M=>{if(!s.value||!r.value||!t.wrapElement)return;const C=Math.abs(M.target.getBoundingClientRect()[h.value.direction]-M[h.value.client]),_=s.value[h.value.offset]/2,P=(C-_)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=P*t.wrapElement[h.value.scrollSize]/100},b=M=>{M.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",v),document.addEventListener("mouseup",g),f=document.onselectstart,document.onselectstart=()=>!1},v=M=>{if(!r.value||!s.value||u===!1)return;const C=o.value[h.value.axis];if(!C)return;const _=(r.value.getBoundingClientRect()[h.value.direction]-M[h.value.client])*-1,P=s.value[h.value.offset]-C,E=(_-P)*100*y.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=E*t.wrapElement[h.value.scrollSize]/100},g=()=>{u=!1,o.value[h.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",g),T(),c&&(l.value=!1)},w=()=>{c=!1,l.value=!!e.size},S=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{T(),document.removeEventListener("mouseup",g)});const T=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return Vt(a.toRef(t,"scrollbarElement"),"mousemove",w),Vt(a.toRef(t,"scrollbarElement"),"mouseleave",S),(M,C)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(h).key)]),onMousedown:d},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,M.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const CE=Qe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var RE=$e(a.defineComponent({__name:"bar",props:CE,setup(n,{expose:e}){const t=n,i=a.inject(Iu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:p=>{if(p){const y=p.offsetHeight-ys,m=p.offsetWidth-ys;s.value=p.scrollTop*100/y*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const y=p.offsetHeight-ys,m=p.offsetWidth-ys,d=y**2/p.scrollHeight,b=m**2/p.scrollWidth,v=Math.max(d,t.minSize),g=Math.max(b,t.minSize);u.value=d/(y-d)/(v/(y-v)),c.value=b/(m-b)/(g/(m-g)),l.value=v+ys<y?`${v}px`:"",o.value=g+ys<m?`${g}px`:""}}),(p,y)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(Rm,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(Rm,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const LE=Qe({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ve([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,..._r(["ariaLabel","ariaOrientation"])}),PE={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(nt)},Ou="ElScrollbar",IE=a.defineComponent({name:Ou}),OE=a.defineComponent({...IE,props:LE,emits:PE,setup(n,{expose:e,emit:t}){const i=n,r=We("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),h=a.ref(),p=a.ref(),y=a.computed(()=>{const T={};return i.height&&(T.height=Ya(i.height)),i.maxHeight&&(T.maxHeight=Ya(i.maxHeight)),[i.wrapStyle,T]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),d=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var T;f.value&&((T=p.value)==null||T.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function v(T,M){en(T)?f.value.scrollTo(T):nt(T)&&nt(M)&&f.value.scrollTo(T,M)}const g=T=>{if(!nt(T)){xt(Ou,"value must be a number");return}f.value.scrollTop=T},w=T=>{if(!nt(T)){xt(Ou,"value must be a number");return}f.value.scrollLeft=T},S=()=>{var T;(T=p.value)==null||T.update()};return a.watch(()=>i.noresize,T=>{T?(s==null||s(),o==null||o()):({stop:s}=bn(h,S),o=Vt("resize",S))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var T;S(),f.value&&((T=p.value)==null||T.handleScroll(f.value))})}),a.provide(Iu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{S()})}),a.onUpdated(()=>S()),e({wrapRef:f,update:S,scrollTo:v,setScrollTop:g,setScrollLeft:w,handleScroll:b}),(T,M)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(m)),style:a.normalizeStyle(a.unref(y)),tabindex:T.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(T.tag),{id:T.id,ref_key:"resizeRef",ref:h,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(T.viewStyle),role:T.role,"aria-label":T.ariaLabel,"aria-orientation":T.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(T.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),T.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(RE,{key:0,ref_key:"barRef",ref:p,always:T.always,"min-size":T.minSize},null,8,["always","min-size"]))],2))}});var NE=$e(OE,[["__file","scrollbar.vue"]]);const DE=kt(NE),Nu=Symbol("popper"),Lm=Symbol("popperContent"),Pm=Qe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),BE=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),FE=a.defineComponent({...BE,props:Pm,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Nu,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var VE=$e(FE,[["__file","popper.vue"]]);const Im=Qe({arrowOffset:{type:Number,default:5}}),kE=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),zE=a.defineComponent({...kE,props:Im,setup(n,{expose:e}){const t=n,i=We("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(Lm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var UE=$e(zE,[["__file","arrow.vue"]]);const Du="ElOnlyChild",GE=a.defineComponent({name:Du,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(gm),s=KT((i=r==null?void 0:r.setForwardRef)!=null?i:_o);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return xt(Du,"requires exact only one valid child."),null;const u=Om(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(xt(Du,"no valid child node found"),null)}}});function Om(n){if(!n)return null;const e=n;for(const t of e){if(en(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return Nm(t);case a.Fragment:return Om(t.children);default:return t}return Nm(t)}return null}function Nm(n){const e=We("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const Dm=Qe({virtualRef:{type:Ve(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ve(Function)},onMouseleave:{type:Ve(Function)},onClick:{type:Ve(Function)},onKeydown:{type:Ve(Function)},onFocus:{type:Ve(Function)},onBlur:{type:Ve(Function)},onContextmenu:{type:Ve(Function)},id:String,open:Boolean}),HE=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),WE=a.defineComponent({...HE,props:Dm,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Nu,void 0);JT(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,h=>{h&&(r.value=ri(h))},{immediate:!0}),a.watch(r,(h,p)=>{c==null||c(),c=void 0,xr(h)&&(f.forEach(y=>{var m;const d=t[y];d&&(h.addEventListener(y.slice(2).toLowerCase(),d),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,y.slice(2).toLowerCase(),d))}),c=a.watch([s,o,l,u],y=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,d)=>{ci(y[d])?h.removeAttribute(m):h.setAttribute(m,y[d])})},{immediate:!0})),xr(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(y=>p.removeAttribute(y))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&xr(r.value)){const h=r.value;f.forEach(p=>{const y=t[p];y&&h.removeEventListener(p.slice(2).toLowerCase(),y)}),r.value=void 0}}),e({triggerRef:r}),(h,p)=>h.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(GE),a.mergeProps({key:0},h.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(h.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var jE=$e(WE,[["__file","trigger.vue"]]);const Bu="focus-trap.focus-after-trapped",Fu="focus-trap.focus-after-released",$E="focus-trap.focusout-prevented",Bm={cancelable:!0,bubbles:!1},ZE={cancelable:!0,bubbles:!1},Fm="focusAfterTrapped",Vm="focusAfterReleased",XE=Symbol("elFocusTrap"),Vu=a.ref(),ul=a.ref(0),ku=a.ref(0);let dl=0;const km=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},zm=(n,e)=>{for(const t of n)if(!YE(t,e))return t},YE=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},JE=n=>{const e=km(n),t=zm(e,n),i=zm(e.reverse(),n);return[t,i]},KE=n=>n instanceof HTMLInputElement&&"select"in n,Gi=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),ku.value=window.performance.now(),n!==t&&KE(n)&&e&&n.select()}};function Um(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const qE=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=Um(n,i),n.unshift(i)},remove:i=>{var r,s;n=Um(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},QE=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(Gi(i,e),document.activeElement!==t)return},Gm=qE(),eA=()=>ul.value>ku.value,hl=()=>{Vu.value="pointer",ul.value=window.performance.now()},Hm=()=>{Vu.value="keyboard",ul.value=window.performance.now()},tA=()=>(a.onMounted(()=>{dl===0&&(document.addEventListener("mousedown",hl),document.addEventListener("touchstart",hl),document.addEventListener("keydown",Hm)),dl++}),a.onBeforeUnmount(()=>{dl--,dl<=0&&(document.removeEventListener("mousedown",hl),document.removeEventListener("touchstart",hl),document.removeEventListener("keydown",Hm))}),{focusReason:Vu,lastUserFocusTimestamp:ul,lastAutomatedFocusTimestamp:ku}),fl=n=>new CustomEvent($E,{...ZE,detail:n}),nA=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Fm,Vm,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=tA();jT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:d,altKey:b,ctrlKey:v,metaKey:g,currentTarget:w,shiftKey:S}=m,{loop:T}=n,M=d===Wn.tab&&!b&&!v&&!g,C=document.activeElement;if(M&&C){const _=w,[P,E]=JE(_);if(P&&E){if(!S&&C===E){const A=fl({focusReason:s.value});e("focusout-prevented",A),A.defaultPrevented||(m.preventDefault(),T&&Gi(P,!0))}else if(S&&[P,_].includes(C)){const A=fl({focusReason:s.value});e("focusout-prevented",A),A.defaultPrevented||(m.preventDefault(),T&&Gi(E,!0))}}else if(C===_){const A=fl({focusReason:s.value});e("focusout-prevented",A),A.defaultPrevented||m.preventDefault()}}};a.provide(XE,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[d])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",h)),d&&(d.removeEventListener("keydown",l),d.removeEventListener("focusin",f),d.removeEventListener("focusout",h))});const u=m=>{e(Fm,m)},c=m=>e(Vm,m),f=m=>{const d=a.unref(t);if(!d)return;const b=m.target,v=m.relatedTarget,g=b&&d.contains(b);n.trapped||v&&d.contains(v)||(i=v),g&&e("focusin",m),!o.paused&&n.trapped&&(g?r=b:Gi(r,!0))},h=m=>{const d=a.unref(t);if(!(o.paused||!d))if(n.trapped){const b=m.relatedTarget;!ci(b)&&!d.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const v=fl({focusReason:s.value});e("focusout-prevented",v),v.defaultPrevented||Gi(r,!0)}},0)}else{const b=m.target;b&&d.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){Gm.push(o);const d=m.contains(document.activeElement)?i:document.activeElement;if(i=d,!m.contains(d)){const v=new Event(Bu,Bm);m.addEventListener(Bu,u),m.dispatchEvent(v),v.defaultPrevented||a.nextTick(()=>{let g=n.focusStartEl;Qt(g)||(Gi(g),document.activeElement!==g&&(g="first")),g==="first"&&QE(km(m),!0),(document.activeElement===d||g==="container")&&Gi(m)})}}}function y(){const m=a.unref(t);if(m){m.removeEventListener(Bu,u);const d=new CustomEvent(Fu,{...Bm,detail:{focusReason:s.value}});m.addEventListener(Fu,c),m.dispatchEvent(d),!d.defaultPrevented&&(s.value=="keyboard"||!eA()||m.contains(document.activeElement))&&Gi(i??document.body),m.removeEventListener(Fu,c),Gm.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():y()})}),a.onBeforeUnmount(()=>{n.trapped&&y(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:l}}});function iA(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var rA=$e(nA,[["render",iA],["__file","focus-trap.vue"]]);const sA=["fixed","absolute"],oA=Qe({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ve(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:cs,default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},strategy:{type:String,values:sA,default:"absolute"}}),Wm=Qe({...oA,id:String,style:{type:Ve([String,Array,Object])},className:{type:Ve([String,Array,Object])},effect:{type:Ve(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ve([String,Array,Object])},popperStyle:{type:Ve([String,Array,Object])},referenceEl:{type:Ve(Object)},triggerTargetEl:{type:Ve(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,..._r(["ariaLabel"])}),aA={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},lA=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...uA(n),...e]};return dA(s,r==null?void 0:r.modifiers),s},cA=n=>{if(Lt)return ri(n)};function uA(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function dA(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const hA=0,fA=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Nu,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var v;const g=a.unref(s),w=(v=a.unref(o))!=null?v:hA;return{name:"arrow",enabled:!KS(g),options:{element:g,padding:w}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...lA(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>cA(n.referenceEl)||a.unref(i)),{attributes:h,state:p,styles:y,update:m,forceUpdate:d,instanceRef:b}=GT(f,t,c);return a.watch(b,v=>e.value=v),a.onMounted(()=>{a.watch(()=>{var v;return(v=a.unref(f))==null?void 0:v.getBoundingClientRect()},()=>{m()})}),{attributes:h,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:y,role:r,forceUpdate:d,update:m}},pA=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=Mm(),s=We("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(nt(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),h=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:h,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=nt(n.zIndex)?n.zIndex:r()}}},mA=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},gA=a.defineComponent({name:"ElPopperContent"}),yA=a.defineComponent({...gA,props:Wm,emits:aA,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=mA(i,t),{attributes:h,arrowRef:p,contentRef:y,styles:m,instanceRef:d,role:b,update:v}=fA(i),{ariaModal:g,arrowStyle:w,contentAttrs:S,contentClass:T,contentStyle:M,updateZIndex:C}=pA(i,{styles:m,attributes:h,role:b}),_=a.inject(ll,void 0),P=a.ref();a.provide(Lm,{arrowStyle:w,arrowRef:p,arrowOffset:P}),_&&a.provide(ll,{..._,addInputId:_o,removeInputId:_o});let E;const O=(L=!0)=>{v(),L&&C()},A=()=>{O(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(L,R)=>{E==null||E(),E=void 0;const N=a.unref(L||y.value),x=a.unref(R||y.value);xr(N)&&(E=a.watch([b,()=>i.ariaLabel,g,()=>i.id],I=>{["role","aria-label","aria-modal","id"].forEach((B,F)=>{ci(I[F])?N.removeAttribute(B):N.setAttribute(B,I[F])})},{immediate:!0})),x!==N&&xr(x)&&["role","aria-label","aria-modal","id"].forEach(I=>{x.removeAttribute(I)})},{immediate:!0}),a.watch(()=>i.visible,A,{immediate:!0})}),a.onBeforeUnmount(()=>{E==null||E(),E=void 0}),e({popperContentRef:y,popperInstanceRef:d,updatePopper:O,contentStyle:M}),(L,R)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:y},a.unref(S),{style:a.unref(M),class:a.unref(T),tabindex:"-1",onMouseenter:N=>L.$emit("mouseenter",N),onMouseleave:N=>L.$emit("mouseleave",N)}),[a.createVNode(a.unref(rA),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(y),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(L.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var vA=$e(yA,[["__file","content.vue"]]);const bA=kt(VE),zu=Symbol("elTooltip"),un=Qe({...XT,...Wm,appendTo:{type:Ve([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ve(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,..._r(["ariaLabel"])}),ko=Qe({...Dm,disabled:Boolean,trigger:{type:Ve([String,Array]),default:"hover"},triggerKeys:{type:Ve(Array),default:()=>[Wn.enter,Wn.space]}}),{useModelToggleProps:xA,useModelToggleEmits:wA,useModelToggle:MA}=k_("visible"),SA=Qe({...Pm,...xA,...un,...ko,...Im,showArrow:{type:Boolean,default:!0}}),_A=[...wA,"before-show","before-hide","show","hide","open","close"],TA=(n,e)=>sn(n)?n.includes(e):n===e,vs=(n,e,t)=>i=>{TA(a.unref(n),e)&&t(i)},EA=a.defineComponent({name:"ElTooltipTrigger"}),AA=a.defineComponent({...EA,props:ko,setup(n,{expose:e}){const t=n,i=We("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(zu,void 0),f=a.ref(null),h=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),y=ii(h,vs(p,"hover",l)),m=ii(h,vs(p,"hover",u)),d=ii(h,vs(p,"click",S=>{S.button===0&&c(S)})),b=ii(h,vs(p,"focus",l)),v=ii(h,vs(p,"focus",u)),g=ii(h,vs(p,"contextmenu",S=>{S.preventDefault(),c(S)})),w=ii(h,S=>{const{code:T}=S;t.triggerKeys.includes(T)&&(S.preventDefault(),c(S))});return e({triggerRef:f}),(S,T)=>(a.openBlock(),a.createBlock(a.unref(jE),{id:a.unref(s),"virtual-ref":S.virtualRef,open:a.unref(o),"virtual-triggering":S.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(v),onClick:a.unref(d),onContextmenu:a.unref(g),onFocus:a.unref(b),onMouseenter:a.unref(y),onMouseleave:a.unref(m),onKeydown:a.unref(w)},{default:a.withCtx(()=>[a.renderSlot(S.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var CA=$e(AA,[["__file","trigger.vue"]]);const RA=Qe({to:{type:Ve([String,Object]),required:!0},disabled:Boolean});var LA=$e(a.defineComponent({__name:"teleport",props:RA,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const PA=kt(LA),IA=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),OA=a.defineComponent({...IA,props:un,setup(n,{expose:e}){const t=n,{selector:i}=mm(),r=We("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:h,onOpen:p,onShow:y,onHide:m,onBeforeShow:d,onBeforeHide:b}=a.inject(zu,void 0),v=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),g=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const w=a.computed(()=>a.unref(g)?!0:a.unref(c)),S=a.computed(()=>t.disabled?!1:a.unref(c)),T=a.computed(()=>t.appendTo||i.value),M=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),C=a.ref(!0),_=()=>{m(),C.value=!0},P=()=>{if(a.unref(l))return!0},E=ii(P,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),O=ii(P,()=>{a.unref(f)==="hover"&&h()}),A=()=>{var x,I;(I=(x=s.value)==null?void 0:x.updatePopper)==null||I.call(x),d==null||d()},L=()=>{b==null||b()},R=()=>{y(),o=Gx(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&h()})},N=()=>{t.virtualTriggering||h()};return a.watch(()=>a.unref(c),x=>{x?C.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,I;(I=(x=s.value)==null?void 0:x.updatePopper)==null||I.call(x)}),e({contentRef:s}),(x,I)=>(a.openBlock(),a.createBlock(a.unref(PA),{disabled:!x.teleported,to:a.unref(T)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(v),onAfterLeave:_,onBeforeEnter:A,onAfterEnter:R,onBeforeLeave:L},{default:a.withCtx(()=>[a.unref(w)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(vA),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":C.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(M)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(S),"z-index":x.zIndex,onMouseenter:a.unref(E),onMouseleave:a.unref(O),onBlur:N,onClose:a.unref(h)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(S)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var NA=$e(OA,[["__file","content.vue"]]);const DA=a.defineComponent({name:"ElTooltip"}),BA=a.defineComponent({...DA,props:SA,emits:_A,setup(n,{expose:e,emit:t}){const i=n;ZT();const r=ol(),s=a.ref(),o=a.ref(),l=()=>{var v;const g=a.unref(s);g&&((v=g.popperInstanceRef)==null||v.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:h,hasUpdateHandler:p}=MA({indicator:u,toggleReason:c}),{onOpen:y,onClose:m}=YT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:h}),d=a.computed(()=>fu(i.visible)&&!p.value);a.provide(zu,{controlled:d,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:v=>{y(v)},onClose:v=>{m(v)},onToggle:v=>{a.unref(u)?m(v):y(v)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,v=>{v&&u.value&&(u.value=!1)});const b=v=>{var g,w;const S=(w=(g=o.value)==null?void 0:g.contentRef)==null?void 0:w.popperContentRef,T=(v==null?void 0:v.relatedTarget)||document.activeElement;return S&&S.contains(T)};return a.onDeactivated(()=>u.value&&h()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:y,onClose:m,hide:h}),(v,g)=>(a.openBlock(),a.createBlock(a.unref(bA),{ref_key:"popperRef",ref:s,role:v.role},{default:a.withCtx(()=>[a.createVNode(CA,{disabled:v.disabled,trigger:v.trigger,"trigger-keys":v.triggerKeys,"virtual-ref":v.virtualRef,"virtual-triggering":v.virtualTriggering},{default:a.withCtx(()=>[v.$slots.default?a.renderSlot(v.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(NA,{ref_key:"contentRef",ref:o,"aria-label":v.ariaLabel,"boundaries-padding":v.boundariesPadding,content:v.content,disabled:v.disabled,effect:v.effect,enterable:v.enterable,"fallback-placements":v.fallbackPlacements,"hide-after":v.hideAfter,"gpu-acceleration":v.gpuAcceleration,offset:v.offset,persistent:v.persistent,"popper-class":v.popperClass,"popper-style":v.popperStyle,placement:v.placement,"popper-options":v.popperOptions,pure:v.pure,"raw-content":v.rawContent,"reference-el":v.referenceEl,"trigger-target-el":v.triggerTargetEl,"show-after":v.showAfter,strategy:v.strategy,teleported:v.teleported,transition:v.transition,"virtual-triggering":v.virtualTriggering,"z-index":v.zIndex,"append-to":v.appendTo},{default:a.withCtx(()=>[a.renderSlot(v.$slots,"content",{},()=>[v.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:v.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(v.content),1))]),v.showArrow?(a.openBlock(),a.createBlock(a.unref(UE),{key:0,"arrow-offset":v.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var FA=$e(BA,[["__file","tooltip.vue"]]);const Uu=kt(FA),jm=Symbol("buttonGroupContextKey"),VA=(n,e)=>{P_({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(jm,void 0),i=Ru("button"),{form:r}=Vo(),s=gs(a.computed(()=>t==null?void 0:t.size)),o=cl(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,d,b;return(b=(d=n.autoInsertSpace)!=null?d:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),h=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const d=(m=u.default)==null?void 0:m.call(u);if(f.value&&(d==null?void 0:d.length)===1){const b=d[0];if((b==null?void 0:b.type)===a.Text){const v=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(v.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:h,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},Gu=Qe({size:ms,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ki},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ki,default:()=>Vp},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Ve([String,Object]),default:"button"}}),kA={click:n=>n instanceof MouseEvent};function Ht(n,e){zA(n)&&(n="100%");var t=UA(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function pl(n){return Math.min(1,Math.max(0,n))}function zA(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function UA(n){return typeof n=="string"&&n.indexOf("%")!==-1}function $m(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function ml(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Tr(n){return n.length===1?"0"+n:String(n)}function GA(n,e,t){return{r:Ht(n,255)*255,g:Ht(e,255)*255,b:Ht(t,255)*255}}function Zm(n,e,t){n=Ht(n,255),e=Ht(e,255),t=Ht(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e<t?6:0);break;case e:s=(t-n)/u+2;break;case t:s=(n-e)/u+4;break}s/=6}return{h:s,s:o,l}}function Hu(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function HA(n,e,t){var i,r,s;if(n=Ht(n,360),e=Ht(e,100),t=Ht(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=Hu(l,o,n+1/3),r=Hu(l,o,n),s=Hu(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function Xm(n,e,t){n=Ht(n,255),e=Ht(e,255),t=Ht(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(i){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:u,v:o}}function WA(n,e,t){n=Ht(n,360)*6,e=Ht(e,100),t=Ht(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),l=t*(1-(1-r)*e),u=i%6,c=[t,o,s,s,l,t][u],f=[l,t,t,o,s,s][u],h=[s,s,l,t,t,o][u];return{r:c*255,g:f*255,b:h*255}}function Ym(n,e,t,i){var r=[Tr(Math.round(n).toString(16)),Tr(Math.round(e).toString(16)),Tr(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function jA(n,e,t,i,r){var s=[Tr(Math.round(n).toString(16)),Tr(Math.round(e).toString(16)),Tr(Math.round(t).toString(16)),Tr($A(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function $A(n){return Math.round(parseFloat(n)*255).toString(16)}function Jm(n){return dn(n)/255}function dn(n){return parseInt(n,16)}function ZA(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var Wu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function XA(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=KA(n)),typeof n=="object"&&(fi(n.r)&&fi(n.g)&&fi(n.b)?(e=GA(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):fi(n.h)&&fi(n.s)&&fi(n.v)?(i=ml(n.s),r=ml(n.v),e=WA(n.h,i,r),o=!0,l="hsv"):fi(n.h)&&fi(n.s)&&fi(n.l)&&(i=ml(n.s),s=ml(n.l),e=HA(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=$m(t),{ok:o,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var YA="[-\\+]?\\d+%?",JA="[-\\+]?\\d*\\.\\d+%?",Hi="(?:".concat(JA,")|(?:").concat(YA,")"),ju="[\\s|\\(]+(".concat(Hi,")[,|\\s]+(").concat(Hi,")[,|\\s]+(").concat(Hi,")\\s*\\)?"),$u="[\\s|\\(]+(".concat(Hi,")[,|\\s]+(").concat(Hi,")[,|\\s]+(").concat(Hi,")[,|\\s]+(").concat(Hi,")\\s*\\)?"),Rn={CSS_UNIT:new RegExp(Hi),rgb:new RegExp("rgb"+ju),rgba:new RegExp("rgba"+$u),hsl:new RegExp("hsl"+ju),hsla:new RegExp("hsla"+$u),hsv:new RegExp("hsv"+ju),hsva:new RegExp("hsva"+$u),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function KA(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(Wu[n])n=Wu[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Rn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Rn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Rn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Rn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Rn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Rn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Rn.hex8.exec(n),t?{r:dn(t[1]),g:dn(t[2]),b:dn(t[3]),a:Jm(t[4]),format:e?"name":"hex8"}:(t=Rn.hex6.exec(n),t?{r:dn(t[1]),g:dn(t[2]),b:dn(t[3]),format:e?"name":"hex"}:(t=Rn.hex4.exec(n),t?{r:dn(t[1]+t[1]),g:dn(t[2]+t[2]),b:dn(t[3]+t[3]),a:Jm(t[4]+t[4]),format:e?"name":"hex8"}:(t=Rn.hex3.exec(n),t?{r:dn(t[1]+t[1]),g:dn(t[2]+t[2]),b:dn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function fi(n){return!!Rn.CSS_UNIT.exec(String(n))}var qA=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=ZA(e)),this.originalInput=e;var r=XA(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,s=e.r/255,o=e.g/255,l=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=$m(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=Xm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=Xm(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=Zm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=Zm(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),Ym(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),jA(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Ht(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Ht(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+Ym(this.r,this.g,this.b,!1),t=0,i=Object.entries(Wu);t<i.length;t++){var r=i[t],s=r[0],o=r[1];if(e===o)return s}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=pl(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=pl(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=pl(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=pl(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),s=t/100,o={r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,s=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(new n(i));return s},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,s=t.v,o=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],s=360/e,o=1;o<e;o++)r.push(new n({h:(i+o*s)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function Wi(n,e=20){return n.mix("#141414",e).toString()}function QA(n){const e=cl(),t=We("button");return a.computed(()=>{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new qA(r),l=n.dark?o.tint(20).toString():Wi(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Wi(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Wi(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?Wi(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Wi(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Wi(o,80):o.tint(80).toString());else{const u=n.dark?Wi(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?Wi(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const eC=a.defineComponent({name:"ElButton"}),tC=a.defineComponent({...eC,props:Gu,emits:kA,setup(n,{expose:e,emit:t}){const i=n,r=QA(i),s=We("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:h,handleClick:p}=VA(i,t),y=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:h}),(m,d)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(y),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(ht),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(ht),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(h)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var nC=$e(tC,[["__file","button.vue"]]);const iC={size:Gu.size,type:Gu.type},rC=a.defineComponent({name:"ElButtonGroup"}),sC=a.defineComponent({...rC,props:iC,setup(n){const e=n;a.provide(jm,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=We("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var Km=$e(sC,[["__file","button-group.vue"]]);const bs=kt(nC,{ButtonGroup:Km});ui(Km);var ji=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function gl(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const $i=new Map;if(Lt){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of $i.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function qm(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:xr(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),h=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),y=s&&(s.contains(o)||s.contains(l));u||c||f||h||p||y||e.value(i,r)}}const aC={beforeMount(n,e){$i.has(n)||$i.set(n,[]),$i.get(n).push({documentHandler:qm(n,e),bindingFn:e.value})},updated(n,e){$i.has(n)||$i.set(n,[]);const t=$i.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:qm(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){$i.delete(n)}},lC=100,cC=600,Qm={beforeMount(n,e){const t=e.value,{interval:i=lC,delay:r=cC}=Yt(t)?{}:t;let s,o;const l=()=>Yt(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},Zu=Qe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Gp},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),uC={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},dC=a.defineComponent({name:"ElTag"}),hC=a.defineComponent({...dC,props:Zu,emits:uC,setup(n,{emit:e}){const t=n,i=gs(),r=We("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:h,closable:p,round:y}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(h),r.is("hit",f),r.is("round",y)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(gu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(gu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var fC=$e(hC,[["__file","tag.vue"]]);const pC=kt(fC),eg=Symbol("rowContextKey"),mC=Qe({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),gC=a.defineComponent({name:"ElRow"}),yC=a.defineComponent({...gC,props:mC,setup(n){const e=n,t=We("row"),i=a.computed(()=>e.gutter);a.provide(eg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var vC=$e(yC,[["__file","row.vue"]]);const Zn=kt(vC),bC=Qe({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Ve([Number,Object]),default:()=>di({})},sm:{type:Ve([Number,Object]),default:()=>di({})},md:{type:Ve([Number,Object]),default:()=>di({})},lg:{type:Ve([Number,Object]),default:()=>di({})},xl:{type:Ve([Number,Object]),default:()=>di({})}}),xC=a.defineComponent({name:"ElCol"}),wC=a.defineComponent({...xC,props:bC,setup(n){const e=n,{gutter:t}=a.inject(eg,{gutter:a.computed(()=>0)}),i=We("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];nt(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{nt(e[c])?o.push(i.b(`${c}-${e[c]}`)):en(e[c])&&Object.entries(e[c]).forEach(([f,h])=>{o.push(f!=="span"?i.b(`${c}-${f}-${h}`):i.b(`${c}-${h}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var MC=$e(wC,[["__file","col.vue"]]);const Ln=kt(MC),tg=n=>nt(n)||Qt(n)||sn(n),SC=Qe({accordion:Boolean,modelValue:{type:Ve([Array,String,Number]),default:()=>di([])}}),_C={[dt]:tg,[zi]:tg},ng=Symbol("collapseContextKey"),TC=(n,e)=>{const t=a.ref(Hn(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(dt,o),e(zi,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Hn(n.modelValue),{deep:!0}),a.provide(ng,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},EC=()=>{const n=We("collapse");return{rootKls:a.computed(()=>n.b())}},AC=a.defineComponent({name:"ElCollapse"}),CC=a.defineComponent({...AC,props:SC,emits:_C,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=TC(i,t),{rootKls:o}=EC();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var RC=$e(CC,[["__file","collapse.vue"]]);const LC=a.defineComponent({name:"ElCollapseTransition"}),PC=a.defineComponent({...LC,setup(n){const e=We("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var IC=$e(PC,[["__file","collapse-transition.vue"]]);const OC=kt(IC),NC=Qe({title:{type:String,default:""},name:{type:Ve([String,Number]),default:void 0},icon:{type:ki,default:Vi},disabled:Boolean}),DC=n=>{const e=a.inject(ng),{namespace:t}=We("collapse"),i=a.ref(!1),r=a.ref(!1),s=Cu(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},BC=(n,{focusing:e,isActive:t,id:i})=>{const r=We("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),h=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:h}},FC=a.defineComponent({name:"ElCollapseItem"}),VC=a.defineComponent({...FC,props:NC,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=DC(t),{arrowKls:c,headKls:f,rootKls:h,itemWrapperKls:p,itemContentKls:y,scopedContentId:m,scopedHeadId:d}=BC(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,v)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(h))},[a.createElementVNode("button",{id:a.unref(d),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:g=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(ht),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(OC),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(d)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(y))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var ig=$e(VC,[["__file","collapse-item.vue"]]);const rg=kt(RC,{CollapseItem:ig}),sg=ui(ig),kC=a.defineComponent({name:"ElContainer"}),zC=a.defineComponent({...kC,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=We("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var UC=$e(zC,[["__file","container.vue"]]);const GC=a.defineComponent({name:"ElAside"}),HC=a.defineComponent({...GC,props:{width:{type:String,default:null}},setup(n){const e=n,t=We("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var og=$e(HC,[["__file","aside.vue"]]);const WC=a.defineComponent({name:"ElFooter"}),jC=a.defineComponent({...WC,props:{height:{type:String,default:null}},setup(n){const e=n,t=We("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var ag=$e(jC,[["__file","footer.vue"]]);const $C=a.defineComponent({name:"ElHeader"}),ZC=a.defineComponent({...$C,props:{height:{type:String,default:null}},setup(n){const e=n,t=We("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var lg=$e(ZC,[["__file","header.vue"]]);const XC=a.defineComponent({name:"ElMain"}),YC=a.defineComponent({...XC,setup(n){const e=We("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var cg=$e(YC,[["__file","main.vue"]]);const Xn=kt(UC,{Aside:og,Footer:ag,Header:lg,Main:cg});ui(og);const ug=ui(ag),JC=ui(lg),pi=ui(cg),KC=a.defineComponent({inheritAttrs:!1});function qC(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var QC=$e(KC,[["render",qC],["__file","collection.vue"]]);const e2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function t2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var n2=$e(e2,[["render",t2],["__file","collection-item.vue"]]);const i2="data-el-collection-item",r2=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...QC,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const h=Array.from(f.querySelectorAll(`[${i2}]`));return[...u.values()].sort((y,m)=>h.indexOf(y.ref)-h.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...n2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const h=a.unref(c);h&&f.itemMap.set(h,{ref:h,...u})}),a.onBeforeUnmount(()=>{const h=a.unref(c);f.itemMap.delete(h)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},Xu=Qe({trigger:ko.trigger,effect:{...un.effect,default:"light"},type:{type:Ve(String)},placement:{type:Ve(String),default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Ve([Number,String]),default:0},maxHeight:{type:Ve([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Ve(Object)},teleported:un.teleported});Qe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:ki}}),Qe({onKeydown:{type:Ve(Function)}}),r2("Dropdown");const s2=Qe({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:ms,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||nt(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},..._r(["ariaLabel"])}),o2={[zi]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[wr]:n=>nt(n)||ci(n),[dt]:n=>nt(n)||ci(n)},a2=a.defineComponent({name:"ElInputNumber"}),l2=a.defineComponent({...a2,props:s2,emits:o2,setup(n,{expose:e,emit:t}){const i=n,{t:r}=el(),s=We("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=Vo(),c=a.computed(()=>nt(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>nt(i.modelValue)&&i.modelValue>=i.max),h=a.computed(()=>{const N=v(i.step);return En(i.precision)?Math.max(v(i.modelValue),N):(N>i.precision&&xt("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),y=gs(),m=cl(),d=a.computed(()=>{if(l.userInput!==null)return l.userInput;let N=l.currentValue;if(ci(N))return"";if(nt(N)){if(Number.isNaN(N))return"";En(i.precision)||(N=N.toFixed(i.precision))}return N}),b=(N,x)=>{if(En(x)&&(x=h.value),x===0)return Math.round(N);let I=String(N);const B=I.indexOf(".");if(B===-1||!I.replace(".","").split("")[B+x])return N;const k=I.length;return I.charAt(k-1)==="5"&&(I=`${I.slice(0,Math.max(0,k-1))}6`),Number.parseFloat(Number(I).toFixed(x))},v=N=>{if(ci(N))return 0;const x=N.toString(),I=x.indexOf(".");let B=0;return I!==-1&&(B=x.length-I-1),B},g=(N,x=1)=>nt(N)?b(N+i.step*x):l.currentValue,w=()=>{if(i.readonly||m.value||f.value)return;const N=Number(d.value)||0,x=g(N);M(x),t(wr,l.currentValue),L()},S=()=>{if(i.readonly||m.value||c.value)return;const N=Number(d.value)||0,x=g(N,-1);M(x),t(wr,l.currentValue),L()},T=(N,x)=>{const{max:I,min:B,step:F,precision:V,stepStrictly:k,valueOnClear:G}=i;I<B&&as("InputNumber","min should not be greater than max.");let J=Number(N);if(ci(N)||Number.isNaN(J))return null;if(N===""){if(G===null)return null;J=Qt(G)?{min:B,max:I}[G]:G}return k&&(J=b(Math.round(J/F)*F,V),J!==N&&x&&t(dt,J)),En(V)||(J=b(J,V)),(J>I||J<B)&&(J=J>I?I:B,x&&t(dt,J)),J},M=(N,x=!0)=>{var I;const B=l.currentValue,F=T(N);if(!x){t(dt,F);return}B===F&&N||(l.userInput=null,t(dt,F),B!==F&&t(zi,F,B),i.validateEvent&&((I=u==null?void 0:u.validate)==null||I.call(u,"change").catch(V=>xt(V))),l.currentValue=F)},C=N=>{l.userInput=N;const x=N===""?null:Number(N);t(wr,x),M(x,!1)},_=N=>{const x=N!==""?Number(N):"";(nt(x)&&!Number.isNaN(x)||N==="")&&M(x),L(),l.userInput=null},P=()=>{var N,x;(x=(N=o.value)==null?void 0:N.focus)==null||x.call(N)},E=()=>{var N,x;(x=(N=o.value)==null?void 0:N.blur)==null||x.call(N)},O=N=>{t("focus",N)},A=N=>{var x;l.userInput=null,t("blur",N),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(I=>xt(I)))},L=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},R=N=>{document.activeElement===N.target&&N.preventDefault()};return a.watch(()=>i.modelValue,(N,x)=>{const I=T(N,!0);l.userInput===null&&I!==x&&(l.currentValue=I)},{immediate:!0}),a.onMounted(()=>{var N;const{min:x,max:I,modelValue:B}=i,F=(N=o.value)==null?void 0:N.input;if(F.setAttribute("role","spinbutton"),Number.isFinite(I)?F.setAttribute("aria-valuemax",String(I)):F.removeAttribute("aria-valuemax"),Number.isFinite(x)?F.setAttribute("aria-valuemin",String(x)):F.removeAttribute("aria-valuemin"),F.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),F.setAttribute("aria-disabled",String(m.value)),!nt(B)&&B!=null){let V=Number(B);Number.isNaN(V)&&(V=null),t(dt,V)}F.addEventListener("wheel",R,{passive:!1})}),a.onUpdated(()=>{var N,x;const I=(N=o.value)==null?void 0:N.input;I==null||I.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:P,blur:E}),(N,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(y)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!N.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[N.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(S,["enter"])},[a.renderSlot(N.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(ht),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(pu),{key:0})):(a.openBlock(),a.createBlock(a.unref(x_),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Qm),S]]):a.createCommentVNode("v-if",!0),N.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(w,["enter"])},[a.renderSlot(N.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(ht),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(u_),{key:0})):(a.openBlock(),a.createBlock(a.unref(Ka),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(Qm),w]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(SE),{id:N.id,ref_key:"input",ref:o,type:"number",step:N.step,"model-value":a.unref(d),placeholder:N.placeholder,readonly:N.readonly,disabled:a.unref(m),size:a.unref(y),max:N.max,min:N.min,name:N.name,"aria-label":N.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(w,["prevent"]),["up"]),a.withKeys(a.withModifiers(S,["prevent"]),["down"])],onBlur:A,onFocus:O,onInput:C,onChange:_},a.createSlots({_:2},[N.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(N.$slots,"prefix")])}:void 0,N.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(N.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var c2=$e(l2,[["__file","input-number.vue"]]);const mi=kt(c2),dg=Symbol("ElSelectGroup"),yl=Symbol("ElSelect");function u2(n,e){const t=a.inject(yl),i=a.inject(dg,{disabled:!1}),r=a.computed(()=>f(Hn(t.props.modelValue),n.value)),s=a.computed(()=>{var y;if(t.props.multiple){const m=Hn((y=t.props.modelValue)!=null?y:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(en(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(y=[],m)=>{if(en(n.value)){const d=t.props.valueKey;return y&&y.some(b=>a.toRaw(ai(b,d))===ai(m,d))}else return y&&y.includes(m)},h=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=y=>{const m=new RegExp(i_(y),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(y,m)=>{const{remote:d,valueKey:b}=t.props;if(y!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!d){if(b&&en(y)&&en(m)&&y[b]===m[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:h,updateOption:p}}const d2=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=We("select"),t=ol(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=u2(n,r),{visible:h,hover:p}=a.toRefs(r),y=a.getCurrentInstance().proxy;u.onOptionCreate(y),a.onBeforeUnmount(()=>{const d=y.value,{selected:b}=u.states,g=(u.props.multiple?b:[b]).some(w=>w.value===y.value);a.nextTick(()=>{u.states.cachedOptions.get(d)===y&&!g&&u.states.cachedOptions.delete(d)}),u.onOptionDestroy(d,y)});function m(){l.value||u.handleOptionSelect(y)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:h,hover:p,selectOptionClick:m,states:r}}});function h2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var Yu=$e(d2,[["render",h2],["__file","option.vue"]]);const f2=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(yl),e=We("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),bn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function p2(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var m2=$e(f2,[["render",p2],["__file","select-dropdown.vue"]]);const g2=11,y2=(n,e)=>{const{t}=el(),i=ol(),r=We("select"),s=We("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),h=a.ref(null),p=a.ref(null),y=a.ref(null),m=a.ref(null),d=a.ref(null),b=a.ref(null),v=a.ref(null),g=a.ref(null),{isComposing:w,handleCompositionStart:S,handleCompositionUpdate:T,handleCompositionEnd:M}=Tm({afterComposition:fe=>te(fe)}),{wrapperRef:C,isFocused:_}=_m(h,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!P.value&&(P.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(fe){var xe,_e;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(fe))||((_e=f.value)==null?void 0:_e.isFocusInsideContent(fe))},afterBlur(){P.value=!1,o.menuVisibleOnFocus=!1}}),P=a.ref(!1),E=a.ref(),{form:O,formItem:A}=Vo(),{inputId:L}=Pu(n,{formItemContext:A}),{valueOnClear:R,isEmptyValue:N}=oE(n),x=a.computed(()=>n.disabled||(O==null?void 0:O.disabled)),I=a.computed(()=>sn(n.modelValue)?n.modelValue.length>0:!N(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&I.value),F=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),V=a.computed(()=>r.is("reverse",F.value&&P.value)),k=a.computed(()=>(A==null?void 0:A.validateState)||""),G=a.computed(()=>Up[k.value]),J=a.computed(()=>n.remote?300:0),ne=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&ae.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),ae=a.computed(()=>ie.value.filter(fe=>fe.visible).length),ie=a.computed(()=>{const fe=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(_e=>{const Pe=fe.findIndex(Oe=>Oe.value===_e);Pe>-1&&xe.push(fe[Pe])}),xe.length>=fe.length?xe:fe}),oe=a.computed(()=>Array.from(o.cachedOptions.values())),W=a.computed(()=>{const fe=ie.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!fe}),Z=()=>{n.filterable&&Yt(n.filterMethod)||n.filterable&&n.remote&&Yt(n.remoteMethod)||ie.value.forEach(fe=>{var xe;(xe=fe.updateOption)==null||xe.call(fe,o.inputValue)})},j=gs(),re=a.computed(()=>["small"].includes(j.value)?"small":"default"),z=a.computed({get(){return P.value&&ne.value!==!1},set(fe){P.value=fe}}),H=a.computed(()=>{if(n.multiple&&!En(n.modelValue))return Hn(n.modelValue).length===0&&!o.inputValue;const fe=sn(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||En(fe)?!o.inputValue:!0}),K=a.computed(()=>{var fe;const xe=(fe=n.placeholder)!=null?fe:t("el.select.placeholder");return n.multiple||!I.value?xe:o.selectedLabel}),le=a.computed(()=>$c?null:"mouseenter");a.watch(()=>n.modelValue,(fe,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",se("")),D(),!hu(fe,xe)&&n.validateEvent&&(A==null||A.validate("change").catch(_e=>xt(_e)))},{flush:"post",deep:!0}),a.watch(()=>P.value,fe=>{fe?se(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",fe)}),a.watch(()=>o.options.entries(),()=>{var fe;if(!Lt)return;const xe=((fe=l.value)==null?void 0:fe.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!En(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&D(),n.defaultFirstOption&&(n.filterable||n.remote)&&ae.value&&U()},{flush:"post"}),a.watch(()=>o.hoveringIndex,fe=>{nt(fe)&&fe>-1?E.value=ie.value[fe]||{}:E.value={},ie.value.forEach(xe=>{xe.hover=E.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||Z()});const se=fe=>{o.previousQuery===fe||w.value||(o.previousQuery=fe,n.filterable&&Yt(n.filterMethod)?n.filterMethod(fe):n.filterable&&n.remote&&Yt(n.remoteMethod)&&n.remoteMethod(fe),n.defaultFirstOption&&(n.filterable||n.remote)&&ae.value?a.nextTick(U):a.nextTick(Y))},U=()=>{const fe=ie.value.filter(Pe=>Pe.visible&&!Pe.disabled&&!Pe.states.groupDisabled),xe=fe.find(Pe=>Pe.created),_e=fe[0];o.hoveringIndex=st(ie.value,xe||_e)},D=()=>{if(n.multiple)o.selectedLabel="";else{const xe=sn(n.modelValue)?n.modelValue[0]:n.modelValue,_e=$(xe);o.selectedLabel=_e.currentLabel,o.selected=[_e];return}const fe=[];En(n.modelValue)||Hn(n.modelValue).forEach(xe=>{fe.push($(xe))}),o.selected=fe},$=fe=>{let xe;const _e=Zc(fe).toLowerCase()==="object",Pe=Zc(fe).toLowerCase()==="null",Oe=Zc(fe).toLowerCase()==="undefined";for(let qe=o.cachedOptions.size-1;qe>=0;qe--){const Rt=oe.value[qe];if(_e?ai(Rt.value,n.valueKey)===ai(fe,n.valueKey):Rt.value===fe){xe={value:fe,currentLabel:Rt.currentLabel,get isDisabled(){return Rt.isDisabled}};break}}if(xe)return xe;const Ue=_e?fe.label:!Pe&&!Oe?fe:"";return{value:fe,currentLabel:Ue}},Y=()=>{o.hoveringIndex=ie.value.findIndex(fe=>o.selected.some(xe=>we(xe)===we(fe)))},ee=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},ce=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},ve=()=>{o.collapseItemWidth=v.value.getBoundingClientRect().width},be=()=>{var fe,xe;(xe=(fe=c.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},ue=()=>{var fe,xe;(xe=(fe=f.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},me=()=>{o.inputValue.length>0&&!P.value&&(P.value=!0),se(o.inputValue)},te=fe=>{if(o.inputValue=fe.target.value,n.remote)he();else return me()},he=du(()=>{me()},J.value),ge=fe=>{hu(n.modelValue,fe)||e(zi,fe)},Ae=fe=>JS(fe,xe=>!o.disabledOptions.has(xe)),Te=fe=>{if(n.multiple&&fe.code!==Wn.delete&&fe.target.value.length<=0){const xe=Hn(n.modelValue).slice(),_e=Ae(xe);if(_e<0)return;const Pe=xe[_e];xe.splice(_e,1),e(dt,xe),ge(xe),e("remove-tag",Pe)}},De=(fe,xe)=>{const _e=o.selected.indexOf(xe);if(_e>-1&&!x.value){const Pe=Hn(n.modelValue).slice();Pe.splice(_e,1),e(dt,Pe),ge(Pe),e("remove-tag",xe.value)}fe.stopPropagation(),mt()},Ye=fe=>{fe.stopPropagation();const xe=n.multiple?[]:R.value;if(n.multiple)for(const _e of o.selected)_e.isDisabled&&xe.push(_e.value);e(dt,xe),ge(xe),o.hoveringIndex=-1,P.value=!1,e("clear"),mt()},ze=fe=>{var xe;if(n.multiple){const _e=Hn((xe=n.modelValue)!=null?xe:[]).slice(),Pe=st(_e,fe.value);Pe>-1?_e.splice(Pe,1):(n.multipleLimit<=0||_e.length<n.multipleLimit)&&_e.push(fe.value),e(dt,_e),ge(_e),fe.created&&se(""),n.filterable&&!n.reserveKeyword&&(o.inputValue="")}else e(dt,fe.value),ge(fe.value),P.value=!1;mt(),!P.value&&a.nextTick(()=>{Ce(fe)})},st=(fe=[],xe)=>{if(!en(xe))return fe.indexOf(xe);const _e=n.valueKey;let Pe=-1;return fe.some((Oe,Ue)=>a.toRaw(ai(Oe,_e))===ai(xe,_e)?(Pe=Ue,!0):!1),Pe},Ce=fe=>{var xe,_e,Pe,Oe,Ue;const Fe=sn(fe)?fe[0]:fe;let qe=null;if(Fe!=null&&Fe.value){const Rt=ie.value.filter(Gt=>Gt.value===Fe.value);Rt.length>0&&(qe=Rt[0].$el)}if(c.value&&qe){const Rt=(Oe=(Pe=(_e=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:_e.contentRef)==null?void 0:Pe.querySelector)==null?void 0:Oe.call(Pe,`.${r.be("dropdown","wrap")}`);Rt&&s_(Rt,qe)}(Ue=g.value)==null||Ue.handleScroll()},He=fe=>{o.options.set(fe.value,fe),o.cachedOptions.set(fe.value,fe),fe.disabled&&o.disabledOptions.set(fe.value,fe)},Ge=(fe,xe)=>{o.options.get(fe)===xe&&o.options.delete(fe)},It=a.computed(()=>{var fe,xe;return(xe=(fe=c.value)==null?void 0:fe.popperRef)==null?void 0:xe.contentRef}),Ot=()=>{o.isBeforeHide=!1,a.nextTick(()=>Ce(o.selected))},mt=()=>{var fe;(fe=h.value)==null||fe.focus()},bt=()=>{var fe;(fe=h.value)==null||fe.blur()},Ii=fe=>{Ye(fe)},Oi=()=>{P.value=!1,_.value&&bt()},zn=()=>{o.inputValue.length>0?o.inputValue="":P.value=!1},ns=()=>{x.value||($c&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:P.value=!P.value)},Q=()=>{P.value?ie.value[o.hoveringIndex]&&ze(ie.value[o.hoveringIndex]):ns()},we=fe=>en(fe.value)?ai(fe.value,n.valueKey):fe.value,Ee=a.computed(()=>ie.value.filter(fe=>fe.visible).every(fe=>fe.disabled)),Be=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),Ke=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),X=fe=>{if(!P.value){P.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Ee.value){fe==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):fe==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=ie.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&X(fe),a.nextTick(()=>Ce(E.value))}},pe=()=>{if(!u.value)return 0;const fe=window.getComputedStyle(u.value);return Number.parseFloat(fe.gap||"6px")},de=a.computed(()=>{const fe=pe();return{maxWidth:`${v.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-fe:o.selectionWidth}px`}}),ye=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Me=a.computed(()=>({width:`${Math.max(o.calculatorWidth,g2)}px`}));return bn(u,ee),bn(p,ce),bn(d,be),bn(C,be),bn(b,ue),bn(v,ve),a.onMounted(()=>{D()}),{inputId:L,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:_,expanded:P,optionsArray:ie,hoverOption:E,selectSize:j,filteredOptionsCount:ae,resetCalculatorWidth:ce,updateTooltip:be,updateTagTooltip:ue,debouncedOnInputChange:he,onInput:te,deletePrevTag:Te,deleteTag:De,deleteSelected:Ye,handleOptionSelect:ze,scrollToOption:Ce,hasModelValue:I,shouldShowPlaceholder:H,currentPlaceholder:K,mouseEnterEventName:le,showClose:B,iconComponent:F,iconReverse:V,validateState:k,validateIcon:G,showNewOption:W,updateOptions:Z,collapseTagSize:re,setSelected:D,selectDisabled:x,emptyText:ne,handleCompositionStart:S,handleCompositionUpdate:T,handleCompositionEnd:M,onOptionCreate:He,onOptionDestroy:Ge,handleMenuEnter:Ot,focus:mt,blur:bt,handleClearClick:Ii,handleClickOutside:Oi,handleEsc:zn,toggleMenu:ns,selectOption:Q,getValueKey:we,navigateOptions:X,dropdownMenuVisible:z,showTagList:Be,collapseTagList:Ke,tagStyle:de,collapseTagStyle:ye,inputStyle:Me,popperRef:It,inputRef:h,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:y,suffixRef:m,selectRef:l,wrapperRef:C,selectionRef:u,scrollbarRef:g,menuRef:d,tagMenuRef:b,collapseItemRef:v}};var v2=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(yl);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){sn(c)&&c.forEach(f=>{var h,p,y,m;const d=(h=(f==null?void 0:f.type)||{})==null?void 0:h.name;d==="ElOptionGroup"?u(!Qt(f.children)&&!sn(f.children)&&Yt((p=f.children)==null?void 0:p.default)?(y=f.children)==null?void 0:y.default():f.children):d==="ElOption"?l.push((m=f.props)==null?void 0:m.value):sn(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),hu(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const b2=Qe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:ms,effect:{type:Ve(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ve(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:un.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ki,default:mu},fitInputWidth:Boolean,suffixIcon:{type:ki,default:pu},tagType:{...Zu.type,default:"info"},tagEffect:{...Zu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Ve(String),values:cs,default:"bottom-start"},fallbackPlacements:{type:Ve(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...sE,..._r(["ariaLabel"])}),hg="ElSelect",x2=a.defineComponent({name:hg,componentName:hg,components:{ElSelectMenu:m2,ElOption:Yu,ElOptions:v2,ElTag:pC,ElScrollbar:DE,ElTooltip:Uu,ElIcon:ht},directives:{ClickOutside:aC},props:b2,emits:[dt,zi,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return sn(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=y2(i,e);return a.provide(yl,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function w2(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),y=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:m=>n.states.inputHovering=!0,onMouseleave:m=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":d=>n.states.inputValue=d,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(d=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(d=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(p,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(h,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[y,n.handleClickOutside,n.popperRef]])}var M2=$e(x2,[["render",w2],["__file","select.vue"]]);const S2=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=We("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(dg,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,h;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((h=c.component)!=null&&h.proxy)},l=c=>{const f=Hn(c),h=[];return f.forEach(p=>{var y,m;o(p)?h.push(p.component.proxy):(y=p.children)!=null&&y.length?h.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&h.push(...l(p.component.subTree))}),h},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),Jx(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function _2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var fg=$e(S2,[["render",_2],["__file","option-group.vue"]]);const xs=kt(M2,{Option:Yu,OptionGroup:fg}),ws=ui(Yu);ui(fg);const T2=Qe({trigger:ko.trigger,placement:Xu.placement,disabled:ko.disabled,visible:un.visible,transition:un.transition,popperOptions:Xu.popperOptions,tabindex:Xu.tabindex,content:un.content,popperStyle:un.popperStyle,popperClass:un.popperClass,enterable:{...un.enterable,default:!0},effect:{...un.effect,default:"light"},teleported:un.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),E2={"update:visible":n=>fu(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},A2="onUpdate:visible",C2=a.defineComponent({name:"ElPopover"}),R2=a.defineComponent({...C2,props:T2,emits:E2,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[A2]),s=We("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:Ya(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),h=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},y=()=>{t("before-leave")},m=()=>{t("after-enter")},d=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:h}),(b,v)=>(a.openBlock(),a.createBlock(a.unref(Uu),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:p,onBeforeHide:y,onShow:m,onHide:d}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var L2=$e(R2,[["__file","popover.vue"]]);const pg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var P2={mounted(n,e){pg(n,e)},updated(n,e){pg(n,e)}};const I2=E_(P2,"popover"),vl=kt(L2,{directive:I2}),mg=Symbol("sliderContextKey"),O2=Qe({modelValue:{type:Ve([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:ms,inputSize:ms,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ve(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Ve(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:cs,default:"top"},marks:{type:Ve(Object)},validateEvent:{type:Boolean,default:!0},..._r(["ariaLabel"])}),Ju=n=>nt(n)||sn(n)&&n.every(nt),N2={[dt]:Ju,[wr]:Ju,[zi]:Ju},D2=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),Vt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},B2=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),F2=(n,e,t)=>{const{form:i,formItem:r}=Vo(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),h=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(h.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),y=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),d=a.computed(()=>n.vertical?{height:p.value,bottom:y.value}:{width:p.value,left:y.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},v=A=>{const L=n.min+A*(n.max-n.min)/100;if(!n.range)return o;let R;return Math.abs(f.value-L)<Math.abs(h.value-L)?R=e.firstValue<e.secondValue?"firstButton":"secondButton":R=e.firstValue>e.secondValue?"firstButton":"secondButton",u[R]},g=A=>{const L=v(A);return L.value.setPosition(A),L},w=A=>{e.firstValue=A??n.min,T(n.range?[f.value,h.value]:A??n.min)},S=A=>{e.secondValue=A,n.range&&T([f.value,h.value])},T=A=>{t(dt,A),t(wr,A)},M=async()=>{await a.nextTick(),t(zi,n.range?[f.value,h.value]:n.modelValue)},C=A=>{var L,R,N,x,I,B;if(c.value||e.dragging)return;b();let F=0;if(n.vertical){const V=(N=(R=(L=A.touches)==null?void 0:L.item(0))==null?void 0:R.clientY)!=null?N:A.clientY;F=(s.value.getBoundingClientRect().bottom-V)/e.sliderSize*100}else{const V=(B=(I=(x=A.touches)==null?void 0:x.item(0))==null?void 0:I.clientX)!=null?B:A.clientX,k=s.value.getBoundingClientRect().left;F=(V-k)/e.sliderSize*100}if(!(F<0||F>100))return g(F)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:h,runwayStyle:m,barStyle:d,resetSize:b,setPosition:g,emitChange:M,onSliderWrapperPrevent:A=>{var L,R;((L=u.firstButton.value)!=null&&L.dragging||(R=u.secondButton.value)!=null&&R.dragging)&&A.preventDefault()},onSliderClick:A=>{C(A)&&M()},onSliderDown:async A=>{const L=C(A);L&&(await a.nextTick(),L.value.onButtonDown(A))},onSliderMarkerDown:A=>{c.value||e.dragging||g(A)},setFirstValue:w,setSecondValue:S}},{left:V2,down:k2,right:z2,up:U2,home:G2,end:H2,pageUp:W2,pageDown:j2}=Wn,$2=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=du(()=>{t.value&&(r.value=!0)},50),u=du(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},Z2=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:h,resetSize:p,updateDragging:y}=a.inject(mg),{tooltip:m,tooltipVisible:d,formatValue:b,displayTooltip:v,hideTooltip:g}=$2(n,f,l),w=a.ref(),S=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),T=a.computed(()=>n.vertical?{bottom:S.value}:{left:S.value}),M=()=>{e.hovering=!0,v()},C=()=>{e.hovering=!1,e.dragging||g()},_=G=>{i.value||(G.preventDefault(),B(G),window.addEventListener("mousemove",F),window.addEventListener("touchmove",F),window.addEventListener("mouseup",V),window.addEventListener("touchend",V),window.addEventListener("contextmenu",V),w.value.focus())},P=G=>{i.value||(e.newPosition=Number.parseFloat(S.value)+G/(s.value-r.value)*100,k(e.newPosition),h())},E=()=>{P(-o.value)},O=()=>{P(o.value)},A=()=>{P(-o.value*4)},L=()=>{P(o.value*4)},R=()=>{i.value||(k(0),h())},N=()=>{i.value||(k(100),h())},x=G=>{let J=!0;[V2,k2].includes(G.key)?E():[z2,U2].includes(G.key)?O():G.key===G2?R():G.key===H2?N():G.key===j2?A():G.key===W2?L():J=!1,J&&G.preventDefault()},I=G=>{let J,ne;return G.type.startsWith("touch")?(ne=G.touches[0].clientY,J=G.touches[0].clientX):(ne=G.clientY,J=G.clientX),{clientX:J,clientY:ne}},B=G=>{e.dragging=!0,e.isClick=!0;const{clientX:J,clientY:ne}=I(G);n.vertical?e.startY=ne:e.startX=J,e.startPosition=Number.parseFloat(S.value),e.newPosition=e.startPosition},F=G=>{if(e.dragging){e.isClick=!1,v(),p();let J;const{clientX:ne,clientY:ae}=I(G);n.vertical?(e.currentY=ae,J=(e.startY-e.currentY)/c.value*100):(e.currentX=ne,J=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+J,k(e.newPosition)}},V=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||g(),e.isClick||k(e.newPosition),h()},0),window.removeEventListener("mousemove",F),window.removeEventListener("touchmove",F),window.removeEventListener("mouseup",V),window.removeEventListener("touchend",V),window.removeEventListener("contextmenu",V))},k=async G=>{if(G===null||Number.isNaN(+G))return;G<0?G=0:G>100&&(G=100);const J=100/((s.value-r.value)/o.value);let ae=Math.round(G/J)*J*(s.value-r.value)*.01+r.value;ae=Number.parseFloat(ae.toFixed(u.value)),ae!==n.modelValue&&t(dt,ae),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&v(),m.value.updatePopper()};return a.watch(()=>e.dragging,G=>{y(G)}),Vt(w,"touchstart",_,{passive:!1}),{disabled:i,button:w,tooltip:m,tooltipVisible:d,showTooltip:l,wrapperStyle:T,formatValue:b,handleMouseEnter:M,handleMouseLeave:C,onButtonDown:_,onKeyDown:x,setPosition:k}},X2=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return xt("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),Y2=(n,e,t,i,r,s)=>{const o=c=>{r(dt,c),r(wr,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&as("Slider","min should not be greater than max.");const h=n.modelValue;n.range&&Array.isArray(h)?h[1]<n.min?o([n.min,n.min]):h[0]>n.max?o([n.max,n.max]):h[0]<n.min?o([n.min,h[1]]):h[1]>n.max?o([h[0],n.max]):(e.firstValue=h[0],e.secondValue=h[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>xt(p))),e.oldValue=h.slice())):!n.range&&typeof h=="number"&&!Number.isNaN(h)&&(h<n.min?o(n.min):h>n.max?o(n.max):(e.firstValue=h,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>xt(p))),e.oldValue=h)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((h,p)=>h===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},J2=Qe({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:cs,default:"top"}}),K2={[dt]:n=>nt(n)},q2=a.defineComponent({name:"ElSliderButton"}),Q2=a.defineComponent({...q2,props:J2,emits:K2,setup(n,{expose:e,emit:t}){const i=n,r=We("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:h,formatValue:p,handleMouseEnter:y,handleMouseLeave:m,onButtonDown:d,onKeyDown:b,setPosition:v}=Z2(i,s,t),{hovering:g,dragging:w}=a.toRefs(s);return e({onButtonDown:d,onKeyDown:b,setPosition:v,hovering:g,dragging:w}),(S,T)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(g),dragging:a.unref(w)}]),style:a.normalizeStyle(a.unref(h)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(y),onMouseleave:a.unref(m),onMousedown:a.unref(d),onFocus:a.unref(y),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(Uu),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:S.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":S.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(g),dragging:a.unref(w)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var gg=$e(Q2,[["__file","button.vue"]]);const eR=Qe({mark:{type:Ve([String,Object]),default:void 0}});var tR=a.defineComponent({name:"ElSliderMarker",props:eR,setup(n){const e=We("slider"),t=a.computed(()=>Qt(n.mark)?n.mark:n.mark.label),i=a.computed(()=>Qt(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const nR=a.defineComponent({name:"ElSlider"}),iR=a.defineComponent({...nR,props:O2,emits:N2,setup(n,{expose:e,emit:t}){const i=n,r=We("slider"),{t:s}=el(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:h,minValue:p,maxValue:y,runwayStyle:m,barStyle:d,resetSize:b,emitChange:v,onSliderWrapperPrevent:g,onSliderClick:w,onSliderDown:S,onSliderMarkerDown:T,setFirstValue:M,setSecondValue:C}=F2(i,o,t),{stops:_,getStopStyle:P}=X2(i,o,p,y),{inputId:E,isLabeledByFormItem:O}=Pu(i,{formItemContext:l}),A=gs(),L=a.computed(()=>i.inputSize||A.value),R=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),N=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):R.value),x=a.computed(()=>i.formatValueText?i.formatValueText(J.value):`${J.value}`),I=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(ne.value):`${ne.value}`),F=a.computed(()=>[r.b(),r.m(A.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),V=B2(i);Y2(i,o,p,y,t,l);const k=a.computed(()=>{const oe=[i.min,i.max,i.step].map(W=>{const Z=`${W}`.split(".")[1];return Z?Z.length:0});return Math.max.apply(null,oe)}),{sliderWrapper:G}=D2(i,o,b),{firstValue:J,secondValue:ne,sliderSize:ae}=a.toRefs(o),ie=oe=>{o.dragging=oe};return Vt(G,"touchstart",g,{passive:!1}),Vt(G,"touchmove",g,{passive:!1}),a.provide(mg,{...a.toRefs(i),sliderSize:ae,disabled:h,precision:k,emitChange:v,resetSize:b,updateDragging:ie}),e({onSliderClick:w}),(oe,W)=>{var Z,j;return a.openBlock(),a.createElementBlock("div",{id:oe.range?a.unref(E):void 0,ref_key:"sliderWrapper",ref:G,class:a.normalizeClass(a.unref(F)),role:oe.range?"group":void 0,"aria-label":oe.range&&!a.unref(O)?a.unref(R):void 0,"aria-labelledby":oe.range&&a.unref(O)?(Z=a.unref(l))==null?void 0:Z.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":oe.showInput&&!oe.range},a.unref(r).is("disabled",a.unref(h))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(S),onTouchstartPassive:a.unref(S)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(d))},null,6),a.createVNode(gg,{id:oe.range?void 0:a.unref(E),ref_key:"firstButton",ref:c,"model-value":a.unref(J),vertical:oe.vertical,"tooltip-class":oe.tooltipClass,placement:oe.placement,role:"slider","aria-label":oe.range||!a.unref(O)?a.unref(N):void 0,"aria-labelledby":!oe.range&&a.unref(O)?(j=a.unref(l))==null?void 0:j.labelId:void 0,"aria-valuemin":oe.min,"aria-valuemax":oe.range?a.unref(ne):oe.max,"aria-valuenow":a.unref(J),"aria-valuetext":a.unref(x),"aria-orientation":oe.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(M)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),oe.range?(a.openBlock(),a.createBlock(gg,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(ne),vertical:oe.vertical,"tooltip-class":oe.tooltipClass,placement:oe.placement,role:"slider","aria-label":a.unref(I),"aria-valuemin":a.unref(J),"aria-valuemax":oe.max,"aria-valuenow":a.unref(ne),"aria-valuetext":a.unref(B),"aria-orientation":oe.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(C)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),oe.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(_),(re,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(P)(re))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(V).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(V),(re,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,style:a.normalizeStyle(a.unref(P)(re.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(V),(re,z)=>(a.openBlock(),a.createBlock(a.unref(tR),{key:z,mark:re.mark,style:a.normalizeStyle(a.unref(P)(re.position)),onMousedown:a.withModifiers(H=>a.unref(T)(re.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),oe.showInput&&!oe.range?(a.openBlock(),a.createBlock(a.unref(mi),{key:0,ref:"input","model-value":a.unref(J),class:a.normalizeClass(a.unref(r).e("input")),step:oe.step,disabled:a.unref(h),controls:oe.showInputControls,min:oe.min,max:oe.max,precision:a.unref(k),debounce:oe.debounce,size:a.unref(L),"onUpdate:modelValue":a.unref(M),onChange:a.unref(v)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var rR=$e(iR,[["__file","slider.vue"]]);const Sn=kt(rR),bl=Symbol("tabsRootContextKey"),sR=Qe({tabs:{type:Ve(Array),default:()=>di([])}}),yg="ElTabBar",oR=a.defineComponent({name:yg}),aR=a.defineComponent({...oR,props:sR,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(bl);r||as(yg,"<el-tabs><el-tab-bar /></el-tabs>");const s=We("tabs"),o=a.ref(),l=a.ref(),u=()=>{let y=0,m=0;const d=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=d==="width"?"x":"y",v=b==="x"?"left":"top";return t.tabs.every(g=>{var w,S;const T=(S=(w=i.parent)==null?void 0:w.refs)==null?void 0:S[`tab-${g.uid}`];if(!T)return!1;if(!g.active)return!0;y=T[`offset${Bi(v)}`],m=T[`client${Bi(d)}`];const M=window.getComputedStyle(T);return d==="width"&&(m-=Number.parseFloat(M.paddingLeft)+Number.parseFloat(M.paddingRight),y+=Number.parseFloat(M.paddingLeft)),!1}),{[d]:`${m}px`,transform:`translate${Bi(b)}(${y}px)`}},c=()=>l.value=u(),f=[],h=()=>{var y;f.forEach(d=>d.stop()),f.length=0;const m=(y=i.parent)==null?void 0:y.refs;if(m){for(const d in m)if(d.startsWith("tab-")){const b=m[d];b&&f.push(bn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),h()},{immediate:!0});const p=bn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(y=>y.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(y,m)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var lR=$e(aR,[["__file","tab-bar.vue"]]);const cR=Qe({panes:{type:Ve(Array),default:()=>di([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),uR={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},vg="ElTabNav",dR=a.defineComponent({name:vg,props:cR,emits:uR,setup(n,{expose:e,emit:t}){const i=a.inject(bl);i||as(vg,"<el-tabs><tab-nav /></el-tabs>");const r=We("tabs"),s=Hx(),o=tw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),h=a.ref(!1),p=a.ref(0),y=a.ref(!1),m=a.ref(!0),d=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${d.value==="width"?"X":"Y"}(-${p.value}px)`})),v=()=>{if(!l.value)return;const _=l.value[`offset${Bi(d.value)}`],P=p.value;if(!P)return;const E=P>_?P-_:0;p.value=E},g=()=>{if(!l.value||!u.value)return;const _=u.value[`offset${Bi(d.value)}`],P=l.value[`offset${Bi(d.value)}`],E=p.value;if(_-E<=P)return;const O=_-E>P*2?E+P:_-P;p.value=O},w=async()=>{const _=u.value;if(!h.value||!c.value||!l.value||!_)return;await a.nextTick();const P=c.value.querySelector(".is-active");if(!P)return;const E=l.value,O=["top","bottom"].includes(i.props.tabPosition),A=P.getBoundingClientRect(),L=E.getBoundingClientRect(),R=O?_.offsetWidth-L.width:_.offsetHeight-L.height,N=p.value;let x=N;O?(A.left<L.left&&(x=N-(L.left-A.left)),A.right>L.right&&(x=N+A.right-L.right)):(A.top<L.top&&(x=N-(L.top-A.top)),A.bottom>L.bottom&&(x=N+(A.bottom-L.bottom))),x=Math.max(x,0),p.value=Math.min(x,R)},S=()=>{var _;if(!u.value||!l.value)return;n.stretch&&((_=f.value)==null||_.update());const P=u.value[`offset${Bi(d.value)}`],E=l.value[`offset${Bi(d.value)}`],O=p.value;E<P?(h.value=h.value||{},h.value.prev=O,h.value.next=O+E<P,P-O<E&&(p.value=P-E)):(h.value=!1,O>0&&(p.value=0))},T=_=>{const P=_.code,{up:E,down:O,left:A,right:L}=Wn;if(![E,O,A,L].includes(P))return;const R=Array.from(_.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),N=R.indexOf(_.target);let x;P===A||P===E?N===0?x=R.length-1:x=N-1:N<R.length-1?x=N+1:x=0,R[x].focus({preventScroll:!0}),R[x].click(),M()},M=()=>{m.value&&(y.value=!0)},C=()=>y.value=!1;return a.watch(s,_=>{_==="hidden"?m.value=!1:_==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,_=>{_?setTimeout(()=>m.value=!0,50):m.value=!1}),bn(c,S),a.onMounted(()=>setTimeout(()=>w(),0)),a.onUpdated(()=>S()),e({scrollToActiveTab:w,removeFocus:C}),()=>{const _=h.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!h.value.prev)],onClick:v},[a.createVNode(ht,null,{default:()=>[a.createVNode(Fi,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!h.value.next)],onClick:g},[a.createVNode(ht,null,{default:()=>[a.createVNode(Vi,null,null)]})])]:null,P=n.panes.map((E,O)=>{var A,L,R,N;const x=E.uid,I=E.props.disabled,B=(L=(A=E.props.name)!=null?A:E.index)!=null?L:`${O}`,F=!I&&(E.isClosable||n.editable);E.index=`${O}`;const V=F?a.createVNode(ht,{class:"is-icon-close",onClick:J=>t("tabRemove",E,J)},{default:()=>[a.createVNode(gu,null,null)]}):null,k=((N=(R=E.slots).label)==null?void 0:N.call(R))||E.props.label,G=!I&&E.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",E.active),r.is("disabled",I),r.is("closable",F),r.is("focus",y.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":E.active,tabindex:G,onFocus:()=>M(),onBlur:()=>C(),onClick:J=>{C(),t("tabClick",E,B,J)},onKeydown:J=>{F&&(J.code===Wn.delete||J.code===Wn.backspace)&&t("tabRemove",E,J)}},[k,V])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!h.value),r.is(i.props.tabPosition)]},[_,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:T},[n.type?null:a.createVNode(lR,{ref:f,tabs:[...n.panes]},null),P])])])}}}),hR=Qe({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Ve(Function),default:()=>!0},stretch:Boolean}),Ku=n=>Qt(n)||nt(n),fR={[dt]:n=>Ku(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>Ku(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>Ku(n),tabAdd:()=>!0},pR=a.defineComponent({name:"ElTabs",props:hR,emits:fR,setup(n,{emit:e,slots:t,expose:i}){var r;const s=We("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=eE(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),h=a.ref((r=n.modelValue)!=null?r:"0"),p=async(v,g=!1)=>{var w,S,T;if(!(h.value===v||En(v)))try{await((w=n.beforeLeave)==null?void 0:w.call(n,v,h.value))!==!1&&(h.value=v,g&&(e(dt,v),e("tabChange",v)),(T=(S=f.value)==null?void 0:S.removeFocus)==null||T.call(S))}catch{}},y=(v,g,w)=>{v.props.disabled||(p(g,!0),e("tabClick",v,w))},m=(v,g)=>{v.props.disabled||En(v.props.name)||(g.stopPropagation(),e("edit",v.props.name,"remove"),e("tabRemove",v.props.name))},d=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,v=>p(v)),a.watch(h,async()=>{var v;await a.nextTick(),(v=f.value)==null||v.scrollToActiveTab()}),a.provide(bl,{props:n,currentName:h,registerPane:v=>{l.value.push(v)},sortPane:u,unregisterPane:c}),i({currentName:h});const b=({render:v})=>v();return()=>{const v=t["add-icon"],g=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:d,onKeydown:T=>{T.code===Wn.enter&&d()}},[v?a.renderSlot(t,"add-icon"):a.createVNode(ht,{class:s.is("icon-plus")},{default:()=>[a.createVNode(Ka,null,null)]})]):null,w=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const T=l.value.some(M=>M.slots.label);return a.createVNode(dR,{ref:f,currentName:h.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:y,onTabRemove:m},{$stable:!T})}},null),g]),S=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[S,w])}}}),mR=Qe({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),bg="ElTabPane",gR=a.defineComponent({name:bg}),yR=a.defineComponent({...gR,props:mR,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(bl);r||as(bg,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=We("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=Nf(()=>{var y;return r.currentName.value===((y=e.name)!=null?y:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var y;return(y=e.name)!=null?y:o.value}),h=Nf(()=>!e.lazy||c.value||u.value);a.watch(u,y=>{y&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(y,m)=>a.unref(h)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(y.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var xg=$e(yR,[["__file","tab-pane.vue"]]);const wg=kt(pR,{TabPane:xg}),Mg=ui(xg);function vR(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,y=h.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(Xa(p,y.bm("parent","relative")),p.removeAttribute("loading-number")),Xa(p,y.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,y;(y=(p=h.$el)==null?void 0:p.parentNode)==null||y.removeChild(h.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:y}){const{ns:m,zIndex:d}=lE("loading");return y({ns:m,zIndex:d}),()=>{const b=i.spinner||i.svg,v=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),g=i.text?a.h("p",{class:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[v,g])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),h=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:h,get $el(){return h.$el}}}let xl;const qu=function(n={}){if(!Lt)return;const e=bR(n);if(e.fullscreen&&xl)return xl;const t=vR({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(xl=void 0)}});xR(e,e.parent,t),Sg(e,e.parent,t),e.parent.vLoadingAddClassList=()=>Sg(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(xl=t),t},bR=n=>{var e,t,i,r;let s;return Qt(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},xR=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=Lo(document.body,"position"),t.originalOverflow.value=Lo(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=Lo(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(Lo(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=Lo(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},Sg=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?Xa(e,i.bm("parent","relative")):Fp(e,i.bm("parent","relative")),n.fullscreen&&n.lock?Fp(e,i.bm("parent","hidden")):Xa(e,i.bm("parent","hidden"))},wl=Symbol("ElLoading"),_g=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>en(e.value)?e.value[p]:void 0,u=p=>{const y=Qt(p)&&(o==null?void 0:o[p])||p;return y&&a.ref(y)},c=p=>u(l(p)||n.getAttribute(`element-loading-${cw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,h={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[wl]={options:h,instance:qu(h)}},wR=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},Qu={mounted(n,e){e.value&&_g(n,e)},updated(n,e){const t=n[wl];e.oldValue!==e.value&&(e.value&&!e.oldValue?_g(n,e):e.value&&e.oldValue?en(e.value)&&wR(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[wl])==null||e.instance.close(),n[wl]=null}},MR={install(n){n.directive("loading",Qu),n.config.globalProperties.$loading=qu},directive:Qu,service:qu};var Tg={exports:{}},Eg={},Ag;function SR(){return Ag||(Ag=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var h=c.shift();return{done:h===void 0,value:h}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(h){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof h;if(p!=="undefined")if(p==="string")h!==""&&this._fromString(h);else if(h instanceof c){var y=this;h.forEach(function(v,g){y.append(g,v)})}else if(h!==null&&p==="object")if(Object.prototype.toString.call(h)==="[object Array]")for(var m=0;m<h.length;m++){var d=h[m];if(Object.prototype.toString.call(d)==="[object Array]"||d.length!==2)this.append(d[0],d[1]);else throw new TypeError("Expected [string, any] as entry at index "+m+" of URLSearchParams's input")}else for(var b in h)h.hasOwnProperty(b)&&this.append(b,h[b]);else throw new TypeError("Unsupported input's type for URLSearchParams")},f=c.prototype;f.append=function(h,p){h in this._entries?this._entries[h].push(String(p)):this._entries[h]=[String(p)]},f.delete=function(h){delete this._entries[h]},f.get=function(h){return h in this._entries?this._entries[h][0]:null},f.getAll=function(h){return h in this._entries?this._entries[h].slice(0):[]},f.has=function(h){return h in this._entries},f.set=function(h,p){this._entries[h]=[String(p)]},f.forEach=function(h,p){var y;for(var m in this._entries)if(this._entries.hasOwnProperty(m)){y=this._entries[m];for(var d=0;d<y.length;d++)h.call(p,y[d],m,this)}},f.keys=function(){var h=[];return this.forEach(function(p,y){h.push(y)}),i(h)},f.values=function(){var h=[];return this.forEach(function(p){h.push(p)}),i(h)},f.entries=function(){var h=[];return this.forEach(function(p,y){h.push([y,p])}),i(h)},t&&(f[Symbol.iterator]=f.entries),f.toString=function(){var h=[];return this.forEach(function(p,y){h.push(r(y)+"="+r(p))}),h.join("&")},n.URLSearchParams=c},l=function(){try{var c=n.URLSearchParams;return new c("?a=1").toString()==="a=1"&&typeof c.prototype.set=="function"&&typeof c.prototype.entries=="function"}catch{return!1}};l()||o();var u=n.URLSearchParams.prototype;typeof u.sort!="function"&&(u.sort=function(){var c=this,f=[];this.forEach(function(p,y){f.push([y,p]),c._entries||c.delete(y)}),f.sort(function(p,y){return p[0]<y[0]?-1:p[0]>y[0]?1:0}),c._entries&&(c._entries={});for(var h=0;h<f.length;h++)this.append(f[h][0],f[h][1])}),typeof u._fromString!="function"&&Object.defineProperty(u,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(c){if(this._entries)this._entries={};else{var f=[];this.forEach(function(m,d){f.push(d)});for(var h=0;h<f.length;h++)this.delete(f[h])}c=c.replace(/^\?/,"");for(var p=c.split("&"),y,h=0;h<p.length;h++)y=p[h].split("="),this.append(s(y[0]),y.length>1?s(y[1]):"")}})}(typeof ji<"u"?ji:typeof window<"u"?window:typeof self<"u"?self:ji),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,h;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),h=f.createElement("base"),h.href=c,f.head.appendChild(h);try{if(h.href.indexOf(c)!==0)throw new Error(h.href)}catch(w){throw new Error("URL unable to set base "+c+" due to "+w)}}var p=f.createElement("a");p.href=u,h&&(f.body.appendChild(p),p.href=p.href);var y=f.createElement("input");if(y.type="url",y.value=u,p.protocol===":"||!/:/.test(p.href)||!y.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),d=!0,b=!0,v=this;["append","delete","set"].forEach(function(w){var S=m[w];m[w]=function(){S.apply(m,arguments),d&&(b=!1,v.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,enumerable:!0});var g=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==g&&(g=this.search,b&&(d=!1,this.searchParams._fromString(this.search),d=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof ji<"u"?ji:typeof window<"u"?window:typeof self<"u"?self:ji)),Eg}/**
21
21
  * @license
22
22
  * Copyright 2010-2021 Three.js Authors
23
23
  * SPDX-License-Identifier: MIT
@@ -2864,7 +2864,7 @@ void main() {
2864
2864
  #include <logdepthbuf_vertex>
2865
2865
  #include <clipping_planes_vertex>
2866
2866
  #include <fog_vertex>
2867
- }`;const Je={alphamap_fragment:PL,alphamap_pars_fragment:IL,alphatest_fragment:OL,aomap_fragment:NL,aomap_pars_fragment:DL,begin_vertex:BL,beginnormal_vertex:FL,bsdfs:VL,bumpmap_pars_fragment:kL,clipping_planes_fragment:zL,clipping_planes_pars_fragment:UL,clipping_planes_pars_vertex:GL,clipping_planes_vertex:HL,color_fragment:WL,color_pars_fragment:jL,color_pars_vertex:$L,color_vertex:ZL,common:XL,cube_uv_reflection_fragment:YL,defaultnormal_vertex:JL,displacementmap_pars_vertex:KL,displacementmap_vertex:qL,emissivemap_fragment:QL,emissivemap_pars_fragment:eP,encodings_fragment:tP,encodings_pars_fragment:nP,envmap_fragment:iP,envmap_common_pars_fragment:rP,envmap_pars_fragment:sP,envmap_pars_vertex:oP,envmap_physical_pars_fragment:yP,envmap_vertex:aP,fog_vertex:lP,fog_pars_vertex:cP,fog_fragment:uP,fog_pars_fragment:dP,gradientmap_pars_fragment:hP,lightmap_fragment:fP,lightmap_pars_fragment:pP,lights_lambert_vertex:mP,lights_pars_begin:gP,lights_toon_fragment:vP,lights_toon_pars_fragment:bP,lights_phong_fragment:xP,lights_phong_pars_fragment:wP,lights_physical_fragment:MP,lights_physical_pars_fragment:SP,lights_fragment_begin:_P,lights_fragment_maps:TP,lights_fragment_end:EP,logdepthbuf_fragment:AP,logdepthbuf_pars_fragment:CP,logdepthbuf_pars_vertex:RP,logdepthbuf_vertex:LP,map_fragment:PP,map_pars_fragment:IP,map_particle_fragment:OP,map_particle_pars_fragment:NP,metalnessmap_fragment:DP,metalnessmap_pars_fragment:BP,morphnormal_vertex:FP,morphtarget_pars_vertex:VP,morphtarget_vertex:kP,normal_fragment_begin:zP,normal_fragment_maps:UP,normalmap_pars_fragment:GP,clearcoat_normal_fragment_begin:HP,clearcoat_normal_fragment_maps:WP,clearcoat_pars_fragment:jP,packing:$P,premultiplied_alpha_fragment:ZP,project_vertex:XP,dithering_fragment:YP,dithering_pars_fragment:JP,roughnessmap_fragment:KP,roughnessmap_pars_fragment:qP,shadowmap_pars_fragment:QP,shadowmap_pars_vertex:eI,shadowmap_vertex:tI,shadowmask_pars_fragment:nI,skinbase_vertex:iI,skinning_pars_vertex:rI,skinning_vertex:sI,skinnormal_vertex:oI,specularmap_fragment:aI,specularmap_pars_fragment:lI,tonemapping_fragment:cI,tonemapping_pars_fragment:uI,transmission_fragment:dI,transmission_pars_fragment:hI,uv_pars_fragment:fI,uv_pars_vertex:pI,uv_vertex:mI,uv2_pars_fragment:gI,uv2_pars_vertex:yI,uv2_vertex:vI,worldpos_vertex:bI,background_frag:xI,background_vert:wI,cube_frag:MI,cube_vert:SI,depth_frag:_I,depth_vert:TI,distanceRGBA_frag:EI,distanceRGBA_vert:AI,equirect_frag:CI,equirect_vert:RI,linedashed_frag:LI,linedashed_vert:PI,meshbasic_frag:II,meshbasic_vert:OI,meshlambert_frag:NI,meshlambert_vert:DI,meshmatcap_frag:BI,meshmatcap_vert:FI,meshtoon_frag:VI,meshtoon_vert:kI,meshphong_frag:zI,meshphong_vert:UI,meshphysical_frag:GI,meshphysical_vert:HI,normal_frag:WI,normal_vert:jI,points_frag:$I,points_vert:ZI,shadow_frag:XI,shadow_vert:YI,sprite_frag:JI,sprite_vert:KI},Le={common:{diffuse:{value:new Re(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Se(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Re(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Re(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new Re(16777215)},opacity:{value:1},center:{value:new Se(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},Dn={basic:{uniforms:Jt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:Je.meshbasic_vert,fragmentShader:Je.meshbasic_frag},lambert:{uniforms:Jt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.fog,Le.lights,{emissive:{value:new Re(0)}}]),vertexShader:Je.meshlambert_vert,fragmentShader:Je.meshlambert_frag},phong:{uniforms:Jt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Re(0)},specular:{value:new Re(1118481)},shininess:{value:30}}]),vertexShader:Je.meshphong_vert,fragmentShader:Je.meshphong_frag},standard:{uniforms:Jt([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new Re(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Je.meshphysical_vert,fragmentShader:Je.meshphysical_frag},toon:{uniforms:Jt([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new Re(0)}}]),vertexShader:Je.meshtoon_vert,fragmentShader:Je.meshtoon_frag},matcap:{uniforms:Jt([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:Je.meshmatcap_vert,fragmentShader:Je.meshmatcap_frag},points:{uniforms:Jt([Le.points,Le.fog]),vertexShader:Je.points_vert,fragmentShader:Je.points_frag},dashed:{uniforms:Jt([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Je.linedashed_vert,fragmentShader:Je.linedashed_frag},depth:{uniforms:Jt([Le.common,Le.displacementmap]),vertexShader:Je.depth_vert,fragmentShader:Je.depth_frag},normal:{uniforms:Jt([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:Je.normal_vert,fragmentShader:Je.normal_frag},sprite:{uniforms:Jt([Le.sprite,Le.fog]),vertexShader:Je.sprite_vert,fragmentShader:Je.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:Je.background_vert,fragmentShader:Je.background_frag},cube:{uniforms:Jt([Le.envmap,{opacity:{value:1}}]),vertexShader:Je.cube_vert,fragmentShader:Je.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Je.equirect_vert,fragmentShader:Je.equirect_frag},distanceRGBA:{uniforms:Jt([Le.common,Le.displacementmap,{referencePosition:{value:new q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Je.distanceRGBA_vert,fragmentShader:Je.distanceRGBA_frag},shadow:{uniforms:Jt([Le.lights,Le.fog,{color:{value:new Re(0)},opacity:{value:1}}]),vertexShader:Je.shadow_vert,fragmentShader:Je.shadow_frag}};Dn.physical={uniforms:Jt([Dn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Se(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Re(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Se},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Re(0)}}]),vertexShader:Je.meshphysical_vert,fragmentShader:Je.meshphysical_frag};function qI(n,e,t,i,r){const s=new Re(0);let o=0,l,u,c=null,f=0,h=null;function p(m,d){let b=!1,v=d.isScene===!0?d.background:null;v&&v.isTexture&&(v=e.get(v));const g=n.xr,w=g.getSession&&g.getSession();w&&w.environmentBlendMode==="additive"&&(v=null),v===null?y(s,o):v&&v.isColor&&(y(v,1),b=!0),(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===_s)?(u===void 0&&(u=new Tt(new Ei(1,1,1),new Ai({name:"BackgroundCubeMaterial",uniforms:Gs(Dn.cube.uniforms),vertexShader:Dn.cube.vertexShader,fragmentShader:Dn.cube.fragmentShader,side:wt,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(S,T,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=v,u.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,(c!==v||f!==v.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),m.unshift(u,u.geometry,u.material,0,0,null)):v&&v.isTexture&&(l===void 0&&(l=new Tt(new kr(2,2),new Ai({name:"BackgroundMaterial",uniforms:Gs(Dn.background.uniforms),vertexShader:Dn.background.vertexShader,fragmentShader:Dn.background.fragmentShader,side:Zi,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=v,v.matrixAutoUpdate===!0&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),(c!==v||f!==v.version||h!==n.toneMapping)&&(l.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),m.unshift(l,l.geometry,l.material,0,0,null))}function y(m,d){t.buffers.color.setClear(m.r,m.g,m.b,d,r)}return{getClearColor:function(){return s},setClearColor:function(m,d=1){s.set(m),o=d,y(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(m){o=m,y(s,o)},render:p}}function QI(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,l={},u=d(null);let c=u;function f(L,R,N,x,I){let B=!1;if(o){const F=m(x,N,R);c!==F&&(c=F,p(c.object)),B=b(x,I),B&&v(x,I)}else{const F=R.wireframe===!0;(c.geometry!==x.id||c.program!==N.id||c.wireframe!==F)&&(c.geometry=x.id,c.program=N.id,c.wireframe=F,B=!0)}L.isInstancedMesh===!0&&(B=!0),I!==null&&t.update(I,34963),B&&(C(L,R,N,x),I!==null&&n.bindBuffer(34963,t.get(I).buffer))}function h(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function p(L){return i.isWebGL2?n.bindVertexArray(L):s.bindVertexArrayOES(L)}function y(L){return i.isWebGL2?n.deleteVertexArray(L):s.deleteVertexArrayOES(L)}function m(L,R,N){const x=N.wireframe===!0;let I=l[L.id];I===void 0&&(I={},l[L.id]=I);let B=I[R.id];B===void 0&&(B={},I[R.id]=B);let F=B[x];return F===void 0&&(F=d(h()),B[x]=F),F}function d(L){const R=[],N=[],x=[];for(let I=0;I<r;I++)R[I]=0,N[I]=0,x[I]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:N,attributeDivisors:x,object:L,attributes:{},index:null}}function b(L,R){const N=c.attributes,x=L.attributes;let I=0;for(const B in x){const F=N[B],V=x[B];if(F===void 0||F.attribute!==V||F.data!==V.data)return!0;I++}return c.attributesNum!==I||c.index!==R}function v(L,R){const N={},x=L.attributes;let I=0;for(const B in x){const F=x[B],V={};V.attribute=F,F.data&&(V.data=F.data),N[B]=V,I++}c.attributes=N,c.attributesNum=I,c.index=R}function g(){const L=c.newAttributes;for(let R=0,N=L.length;R<N;R++)L[R]=0}function w(L){S(L,0)}function S(L,R){const N=c.newAttributes,x=c.enabledAttributes,I=c.attributeDivisors;N[L]=1,x[L]===0&&(n.enableVertexAttribArray(L),x[L]=1),I[L]!==R&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](L,R),I[L]=R)}function T(){const L=c.newAttributes,R=c.enabledAttributes;for(let N=0,x=R.length;N<x;N++)R[N]!==L[N]&&(n.disableVertexAttribArray(N),R[N]=0)}function M(L,R,N,x,I,B){i.isWebGL2===!0&&(N===5124||N===5125)?n.vertexAttribIPointer(L,R,N,I,B):n.vertexAttribPointer(L,R,N,x,I,B)}function C(L,R,N,x){if(i.isWebGL2===!1&&(L.isInstancedMesh||x.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;g();const I=x.attributes,B=N.getAttributes(),F=R.defaultAttributeValues;for(const V in B){const k=B[V];if(k>=0){const G=I[V];if(G!==void 0){const J=G.normalized,ne=G.itemSize,ae=t.get(G);if(ae===void 0)continue;const ie=ae.buffer,oe=ae.type,W=ae.bytesPerElement;if(G.isInterleavedBufferAttribute){const X=G.data,j=X.stride,re=G.offset;X&&X.isInstancedInterleavedBuffer?(S(k,X.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=X.meshPerAttribute*X.count)):w(k),n.bindBuffer(34962,ie),M(k,ne,oe,J,j*W,re*W)}else G.isInstancedBufferAttribute?(S(k,G.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=G.meshPerAttribute*G.count)):w(k),n.bindBuffer(34962,ie),M(k,ne,oe,J,0,0)}else if(V==="instanceMatrix"){const J=t.get(L.instanceMatrix);if(J===void 0)continue;const ne=J.buffer,ae=J.type;S(k+0,1),S(k+1,1),S(k+2,1),S(k+3,1),n.bindBuffer(34962,ne),n.vertexAttribPointer(k+0,4,ae,!1,64,0),n.vertexAttribPointer(k+1,4,ae,!1,64,16),n.vertexAttribPointer(k+2,4,ae,!1,64,32),n.vertexAttribPointer(k+3,4,ae,!1,64,48)}else if(V==="instanceColor"){const J=t.get(L.instanceColor);if(J===void 0)continue;const ne=J.buffer,ae=J.type;S(k,1),n.bindBuffer(34962,ne),n.vertexAttribPointer(k,3,ae,!1,12,0)}else if(F!==void 0){const J=F[V];if(J!==void 0)switch(J.length){case 2:n.vertexAttrib2fv(k,J);break;case 3:n.vertexAttrib3fv(k,J);break;case 4:n.vertexAttrib4fv(k,J);break;default:n.vertexAttrib1fv(k,J)}}}}T()}function _(){O();for(const L in l){const R=l[L];for(const N in R){const x=R[N];for(const I in x)y(x[I].object),delete x[I];delete R[N]}delete l[L]}}function P(L){if(l[L.id]===void 0)return;const R=l[L.id];for(const N in R){const x=R[N];for(const I in x)y(x[I].object),delete x[I];delete R[N]}delete l[L.id]}function E(L){for(const R in l){const N=l[R];if(N[L.id]===void 0)continue;const x=N[L.id];for(const I in x)y(x[I].object),delete x[I];delete N[L.id]}}function O(){A(),c!==u&&(c=u,p(c.object))}function A(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:f,reset:O,resetDefaultState:A,dispose:_,releaseStatesOfGeometry:P,releaseStatesOfProgram:E,initAttributes:g,enableAttribute:w,disableUnusedAttributes:T}}function eO(n,e,t,i){const r=i.isWebGL2;let s;function o(c){s=c}function l(c,f){n.drawArrays(s,c,f),t.update(f,s,1)}function u(c,f,h){if(h===0)return;let p,y;if(r)p=n,y="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),y="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[y](s,c,f,h),t.update(f,s,h)}this.setMode=o,this.render=l,this.renderInstances=u}function tO(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const C=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(C){if(C==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";C="mediump"}return C==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let l=t.precision!==void 0?t.precision:"highp";const u=s(l);u!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",u,"instead."),l=u);const c=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,h=n.getParameter(34930),p=n.getParameter(35660),y=n.getParameter(3379),m=n.getParameter(34076),d=n.getParameter(34921),b=n.getParameter(36347),v=n.getParameter(36348),g=n.getParameter(36349),w=p>0,S=o||e.has("OES_texture_float"),T=w&&S,M=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:p,maxTextureSize:y,maxCubemapSize:m,maxAttributes:d,maxVertexUniforms:b,maxVaryings:v,maxFragmentUniforms:g,vertexTextures:w,floatFragmentTextures:S,floatVertexTextures:T,maxSamples:M}}function nO(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Yn,l=new Dt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p,y){const m=h.length!==0||p||i!==0||r;return r=p,t=f(h,y,0),i=h.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,p,y){const m=h.clippingPlanes,d=h.clipIntersection,b=h.clipShadows,v=n.get(h);if(!r||m===null||m.length===0||s&&!b)s?f(null):c();else{const g=s?0:i,w=g*4;let S=v.clippingState||null;u.value=S,S=f(m,p,w,y);for(let T=0;T!==w;++T)S[T]=t[T];v.clippingState=S,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=g}};function c(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(h,p,y,m){const d=h!==null?h.length:0;let b=null;if(d!==0){if(b=u.value,m!==!0||b===null){const v=y+d*4,g=p.matrixWorldInverse;l.getNormalMatrix(g),(b===null||b.length<v)&&(b=new Float32Array(v));for(let w=0,S=y;w!==d;++w,S+=4)o.copy(h[w]).applyMatrix4(g,l),o.normal.toArray(b,S),b[S+3]=o.constant}u.value=b,u.needsUpdate=!0}return e.numPlanes=d,e.numIntersection=0,b}}function iO(n){let e=new WeakMap;function t(o,l){return l===_l?o.mapping=Uo:l===Tl&&(o.mapping=Go),o}function i(o){if(o&&o.isTexture){const l=o.mapping;if(l===_l||l===Tl)if(e.has(o)){const u=e.get(o).texture;return t(u,o.mapping)}else{const u=o.image;if(u&&u.height>0){const c=n.getRenderTarget(),f=new ql(u.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),n.setRenderTarget(c),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const l=o.target;l.removeEventListener("dispose",r);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}function rO(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function sO(n,e,t,i){const r={},s=new WeakMap;function o(h){const p=h.target;p.index!==null&&e.remove(p.index);for(const m in p.attributes)e.remove(p.attributes[m]);p.removeEventListener("dispose",o),delete r[p.id];const y=s.get(p);y&&(e.remove(y),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(h,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function u(h){const p=h.attributes;for(const m in p)e.update(p[m],34962);const y=h.morphAttributes;for(const m in y){const d=y[m];for(let b=0,v=d.length;b<v;b++)e.update(d[b],34962)}}function c(h){const p=[],y=h.index,m=h.attributes.position;let d=0;if(y!==null){const g=y.array;d=y.version;for(let w=0,S=g.length;w<S;w+=3){const T=g[w+0],M=g[w+1],C=g[w+2];p.push(T,M,M,C,C,T)}}else{const g=m.array;d=m.version;for(let w=0,S=g.length/3-1;w<S;w+=3){const T=w+0,M=w+1,C=w+2;p.push(T,M,M,C,C,T)}}const b=new(Ey(p)>65535?Gl:Ul)(p,1);b.version=d;const v=s.get(h);v&&e.remove(v),s.set(h,b)}function f(h){const p=s.get(h);if(p){const y=h.index;y!==null&&p.version<y.version&&c(h)}else c(h);return s.get(h)}return{get:l,update:u,getWireframeAttribute:f}}function oO(n,e,t,i){const r=i.isWebGL2;let s;function o(p){s=p}let l,u;function c(p){l=p.type,u=p.bytesPerElement}function f(p,y){n.drawElements(s,y,l,p*u),t.update(y,s,1)}function h(p,y,m){if(m===0)return;let d,b;if(r)d=n,b="drawElementsInstanced";else if(d=e.get("ANGLE_instanced_arrays"),b="drawElementsInstancedANGLE",d===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[b](s,y,l,p*u,m),t.update(y,s,m)}this.setMode=o,this.setIndex=c,this.render=f,this.renderInstances=h}function aO(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,l){switch(t.calls++,o){case 4:t.triangles+=l*(s/3);break;case 1:t.lines+=l*(s/2);break;case 3:t.lines+=l*(s-1);break;case 2:t.lines+=l*s;break;case 0:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:i}}function lO(n,e){return n[0]-e[0]}function cO(n,e){return Math.abs(e[1])-Math.abs(n[1])}function uO(n){const e={},t=new Float32Array(8),i=[];for(let s=0;s<8;s++)i[s]=[s,0];function r(s,o,l,u){const c=s.morphTargetInfluences,f=c===void 0?0:c.length;let h=e[o.id];if(h===void 0||h.length!==f){h=[];for(let b=0;b<f;b++)h[b]=[b,0];e[o.id]=h}for(let b=0;b<f;b++){const v=h[b];v[0]=b,v[1]=c[b]}h.sort(cO);for(let b=0;b<8;b++)b<f&&h[b][1]?(i[b][0]=h[b][0],i[b][1]=h[b][1]):(i[b][0]=Number.MAX_SAFE_INTEGER,i[b][1]=0);i.sort(lO);const p=l.morphTargets&&o.morphAttributes.position,y=l.morphNormals&&o.morphAttributes.normal;let m=0;for(let b=0;b<8;b++){const v=i[b],g=v[0],w=v[1];g!==Number.MAX_SAFE_INTEGER&&w?(p&&o.getAttribute("morphTarget"+b)!==p[g]&&o.setAttribute("morphTarget"+b,p[g]),y&&o.getAttribute("morphNormal"+b)!==y[g]&&o.setAttribute("morphNormal"+b,y[g]),t[b]=w,m+=w):(p&&o.hasAttribute("morphTarget"+b)===!0&&o.deleteAttribute("morphTarget"+b),y&&o.hasAttribute("morphNormal"+b)===!0&&o.deleteAttribute("morphNormal"+b),t[b]=0)}const d=o.morphTargetsRelative?1:1-m;u.getUniforms().setValue(n,"morphTargetBaseInfluence",d),u.getUniforms().setValue(n,"morphTargetInfluences",t)}return{update:r}}function dO(n,e,t,i){let r=new WeakMap;function s(u){const c=i.render.frame,f=u.geometry,h=e.get(u,f);return r.get(h)!==c&&(e.update(h),r.set(h,c)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),t.update(u.instanceMatrix,34962),u.instanceColor!==null&&t.update(u.instanceColor,34962)),h}function o(){r=new WeakMap}function l(u){const c=u.target;c.removeEventListener("dispose",l),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}class th extends St{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Mt,this.minFilter=Mt,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}th.prototype.isDataTexture2DArray=!0;class nh extends St{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Mt,this.minFilter=Mt,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}nh.prototype.isDataTexture3D=!0;const Ly=new St,hO=new th,fO=new nh,Py=new js,Iy=[],Oy=[],Ny=new Float32Array(16),Dy=new Float32Array(9),By=new Float32Array(4);function Zs(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=Iy[r];if(s===void 0&&(s=new Float32Array(r),Iy[r]=s),e!==0){i.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(s,l)}return s}function nn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function Kt(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function Fy(n,e){let t=Oy[e];t===void 0&&(t=new Int32Array(e),Oy[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function pO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function mO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(nn(t,e))return;n.uniform2fv(this.addr,e),Kt(t,e)}}function gO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(nn(t,e))return;n.uniform3fv(this.addr,e),Kt(t,e)}}function yO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(nn(t,e))return;n.uniform4fv(this.addr,e),Kt(t,e)}}function vO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Kt(t,e)}else{if(nn(t,i))return;By.set(i),n.uniformMatrix2fv(this.addr,!1,By),Kt(t,i)}}function bO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Kt(t,e)}else{if(nn(t,i))return;Dy.set(i),n.uniformMatrix3fv(this.addr,!1,Dy),Kt(t,i)}}function xO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Kt(t,e)}else{if(nn(t,i))return;Ny.set(i),n.uniformMatrix4fv(this.addr,!1,Ny),Kt(t,i)}}function wO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function MO(n,e){const t=this.cache;nn(t,e)||(n.uniform2iv(this.addr,e),Kt(t,e))}function SO(n,e){const t=this.cache;nn(t,e)||(n.uniform3iv(this.addr,e),Kt(t,e))}function _O(n,e){const t=this.cache;nn(t,e)||(n.uniform4iv(this.addr,e),Kt(t,e))}function TO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function EO(n,e){const t=this.cache;nn(t,e)||(n.uniform2uiv(this.addr,e),Kt(t,e))}function AO(n,e){const t=this.cache;nn(t,e)||(n.uniform3uiv(this.addr,e),Kt(t,e))}function CO(n,e){const t=this.cache;nn(t,e)||(n.uniform4uiv(this.addr,e),Kt(t,e))}function RO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTexture2D(e||Ly,r)}function LO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||fO,r)}function PO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTextureCube(e||Py,r)}function IO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||hO,r)}function OO(n){switch(n){case 5126:return pO;case 35664:return mO;case 35665:return gO;case 35666:return yO;case 35674:return vO;case 35675:return bO;case 35676:return xO;case 5124:case 35670:return wO;case 35667:case 35671:return MO;case 35668:case 35672:return SO;case 35669:case 35673:return _O;case 5125:return TO;case 36294:return EO;case 36295:return AO;case 36296:return CO;case 35678:case 36198:case 36298:case 36306:case 35682:return RO;case 35679:case 36299:case 36307:return LO;case 35680:case 36300:case 36308:case 36293:return PO;case 36289:case 36303:case 36311:case 36292:return IO}}function NO(n,e){n.uniform1fv(this.addr,e)}function DO(n,e){const t=Zs(e,this.size,2);n.uniform2fv(this.addr,t)}function BO(n,e){const t=Zs(e,this.size,3);n.uniform3fv(this.addr,t)}function FO(n,e){const t=Zs(e,this.size,4);n.uniform4fv(this.addr,t)}function VO(n,e){const t=Zs(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function kO(n,e){const t=Zs(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function zO(n,e){const t=Zs(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function UO(n,e){n.uniform1iv(this.addr,e)}function GO(n,e){n.uniform2iv(this.addr,e)}function HO(n,e){n.uniform3iv(this.addr,e)}function WO(n,e){n.uniform4iv(this.addr,e)}function jO(n,e){n.uniform1uiv(this.addr,e)}function $O(n,e){n.uniform2uiv(this.addr,e)}function ZO(n,e){n.uniform3uiv(this.addr,e)}function XO(n,e){n.uniform4uiv(this.addr,e)}function YO(n,e,t){const i=e.length,r=Fy(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTexture2D(e[s]||Ly,r[s])}function JO(n,e,t){const i=e.length,r=Fy(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTextureCube(e[s]||Py,r[s])}function KO(n){switch(n){case 5126:return NO;case 35664:return DO;case 35665:return BO;case 35666:return FO;case 35674:return VO;case 35675:return kO;case 35676:return zO;case 5124:case 35670:return UO;case 35667:case 35671:return GO;case 35668:case 35672:return HO;case 35669:case 35673:return WO;case 5125:return jO;case 36294:return $O;case 36295:return ZO;case 36296:return XO;case 35678:case 36198:case 36298:case 36306:case 35682:return YO;case 35680:case 36300:case 36308:case 36293:return JO}}function qO(n,e,t){this.id=n,this.addr=t,this.cache=[],this.setValue=OO(e.type)}function Vy(n,e,t){this.id=n,this.addr=t,this.cache=[],this.size=e.size,this.setValue=KO(e.type)}Vy.prototype.updateCache=function(n){const e=this.cache;n instanceof Float32Array&&e.length!==n.length&&(this.cache=new Float32Array(n.length)),Kt(e,n)};function ky(n){this.id=n,this.seq=[],this.map={}}ky.prototype.setValue=function(n,e,t){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const o=i[r];o.setValue(n,e[o.id],t)}};const ih=/(\w+)(\])?(\[|\.)?/g;function zy(n,e){n.seq.push(e),n.map[e.id]=e}function QO(n,e,t){const i=n.name,r=i.length;for(ih.lastIndex=0;;){const s=ih.exec(i),o=ih.lastIndex;let l=s[1];const u=s[2]==="]",c=s[3];if(u&&(l=l|0),c===void 0||c==="["&&o+2===r){zy(t,c===void 0?new qO(l,n,e):new Vy(l,n,e));break}else{let h=t.map[l];h===void 0&&(h=new ky(l),zy(t,h)),t=h}}}function ar(n,e){this.seq=[],this.map={};const t=n.getProgramParameter(e,35718);for(let i=0;i<t;++i){const r=n.getActiveUniform(e,i),s=n.getUniformLocation(e,r.name);QO(r,s,this)}}ar.prototype.setValue=function(n,e,t,i){const r=this.map[e];r!==void 0&&r.setValue(n,t,i)},ar.prototype.setOptional=function(n,e,t){const i=e[t];i!==void 0&&this.setValue(n,t,i)},ar.upload=function(n,e,t,i){for(let r=0,s=e.length;r!==s;++r){const o=e[r],l=t[o.id];l.needsUpdate!==!1&&o.setValue(n,l.value,i)}},ar.seqWithValue=function(n,e){const t=[];for(let i=0,r=n.length;i!==r;++i){const s=n[i];s.id in e&&t.push(s)}return t};function Uy(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let e3=0;function t3(n){const e=n.split(`
2867
+ }`;const Je={alphamap_fragment:PL,alphamap_pars_fragment:IL,alphatest_fragment:OL,aomap_fragment:NL,aomap_pars_fragment:DL,begin_vertex:BL,beginnormal_vertex:FL,bsdfs:VL,bumpmap_pars_fragment:kL,clipping_planes_fragment:zL,clipping_planes_pars_fragment:UL,clipping_planes_pars_vertex:GL,clipping_planes_vertex:HL,color_fragment:WL,color_pars_fragment:jL,color_pars_vertex:$L,color_vertex:ZL,common:XL,cube_uv_reflection_fragment:YL,defaultnormal_vertex:JL,displacementmap_pars_vertex:KL,displacementmap_vertex:qL,emissivemap_fragment:QL,emissivemap_pars_fragment:eP,encodings_fragment:tP,encodings_pars_fragment:nP,envmap_fragment:iP,envmap_common_pars_fragment:rP,envmap_pars_fragment:sP,envmap_pars_vertex:oP,envmap_physical_pars_fragment:yP,envmap_vertex:aP,fog_vertex:lP,fog_pars_vertex:cP,fog_fragment:uP,fog_pars_fragment:dP,gradientmap_pars_fragment:hP,lightmap_fragment:fP,lightmap_pars_fragment:pP,lights_lambert_vertex:mP,lights_pars_begin:gP,lights_toon_fragment:vP,lights_toon_pars_fragment:bP,lights_phong_fragment:xP,lights_phong_pars_fragment:wP,lights_physical_fragment:MP,lights_physical_pars_fragment:SP,lights_fragment_begin:_P,lights_fragment_maps:TP,lights_fragment_end:EP,logdepthbuf_fragment:AP,logdepthbuf_pars_fragment:CP,logdepthbuf_pars_vertex:RP,logdepthbuf_vertex:LP,map_fragment:PP,map_pars_fragment:IP,map_particle_fragment:OP,map_particle_pars_fragment:NP,metalnessmap_fragment:DP,metalnessmap_pars_fragment:BP,morphnormal_vertex:FP,morphtarget_pars_vertex:VP,morphtarget_vertex:kP,normal_fragment_begin:zP,normal_fragment_maps:UP,normalmap_pars_fragment:GP,clearcoat_normal_fragment_begin:HP,clearcoat_normal_fragment_maps:WP,clearcoat_pars_fragment:jP,packing:$P,premultiplied_alpha_fragment:ZP,project_vertex:XP,dithering_fragment:YP,dithering_pars_fragment:JP,roughnessmap_fragment:KP,roughnessmap_pars_fragment:qP,shadowmap_pars_fragment:QP,shadowmap_pars_vertex:eI,shadowmap_vertex:tI,shadowmask_pars_fragment:nI,skinbase_vertex:iI,skinning_pars_vertex:rI,skinning_vertex:sI,skinnormal_vertex:oI,specularmap_fragment:aI,specularmap_pars_fragment:lI,tonemapping_fragment:cI,tonemapping_pars_fragment:uI,transmission_fragment:dI,transmission_pars_fragment:hI,uv_pars_fragment:fI,uv_pars_vertex:pI,uv_vertex:mI,uv2_pars_fragment:gI,uv2_pars_vertex:yI,uv2_vertex:vI,worldpos_vertex:bI,background_frag:xI,background_vert:wI,cube_frag:MI,cube_vert:SI,depth_frag:_I,depth_vert:TI,distanceRGBA_frag:EI,distanceRGBA_vert:AI,equirect_frag:CI,equirect_vert:RI,linedashed_frag:LI,linedashed_vert:PI,meshbasic_frag:II,meshbasic_vert:OI,meshlambert_frag:NI,meshlambert_vert:DI,meshmatcap_frag:BI,meshmatcap_vert:FI,meshtoon_frag:VI,meshtoon_vert:kI,meshphong_frag:zI,meshphong_vert:UI,meshphysical_frag:GI,meshphysical_vert:HI,normal_frag:WI,normal_vert:jI,points_frag:$I,points_vert:ZI,shadow_frag:XI,shadow_vert:YI,sprite_frag:JI,sprite_vert:KI},Le={common:{diffuse:{value:new Re(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Se(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Re(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Re(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new Re(16777215)},opacity:{value:1},center:{value:new Se(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},Dn={basic:{uniforms:Jt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:Je.meshbasic_vert,fragmentShader:Je.meshbasic_frag},lambert:{uniforms:Jt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.fog,Le.lights,{emissive:{value:new Re(0)}}]),vertexShader:Je.meshlambert_vert,fragmentShader:Je.meshlambert_frag},phong:{uniforms:Jt([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Re(0)},specular:{value:new Re(1118481)},shininess:{value:30}}]),vertexShader:Je.meshphong_vert,fragmentShader:Je.meshphong_frag},standard:{uniforms:Jt([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new Re(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Je.meshphysical_vert,fragmentShader:Je.meshphysical_frag},toon:{uniforms:Jt([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new Re(0)}}]),vertexShader:Je.meshtoon_vert,fragmentShader:Je.meshtoon_frag},matcap:{uniforms:Jt([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:Je.meshmatcap_vert,fragmentShader:Je.meshmatcap_frag},points:{uniforms:Jt([Le.points,Le.fog]),vertexShader:Je.points_vert,fragmentShader:Je.points_frag},dashed:{uniforms:Jt([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Je.linedashed_vert,fragmentShader:Je.linedashed_frag},depth:{uniforms:Jt([Le.common,Le.displacementmap]),vertexShader:Je.depth_vert,fragmentShader:Je.depth_frag},normal:{uniforms:Jt([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:Je.normal_vert,fragmentShader:Je.normal_frag},sprite:{uniforms:Jt([Le.sprite,Le.fog]),vertexShader:Je.sprite_vert,fragmentShader:Je.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:Je.background_vert,fragmentShader:Je.background_frag},cube:{uniforms:Jt([Le.envmap,{opacity:{value:1}}]),vertexShader:Je.cube_vert,fragmentShader:Je.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Je.equirect_vert,fragmentShader:Je.equirect_frag},distanceRGBA:{uniforms:Jt([Le.common,Le.displacementmap,{referencePosition:{value:new q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Je.distanceRGBA_vert,fragmentShader:Je.distanceRGBA_frag},shadow:{uniforms:Jt([Le.lights,Le.fog,{color:{value:new Re(0)},opacity:{value:1}}]),vertexShader:Je.shadow_vert,fragmentShader:Je.shadow_frag}};Dn.physical={uniforms:Jt([Dn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Se(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Re(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Se},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Re(0)}}]),vertexShader:Je.meshphysical_vert,fragmentShader:Je.meshphysical_frag};function qI(n,e,t,i,r){const s=new Re(0);let o=0,l,u,c=null,f=0,h=null;function p(m,d){let b=!1,v=d.isScene===!0?d.background:null;v&&v.isTexture&&(v=e.get(v));const g=n.xr,w=g.getSession&&g.getSession();w&&w.environmentBlendMode==="additive"&&(v=null),v===null?y(s,o):v&&v.isColor&&(y(v,1),b=!0),(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===_s)?(u===void 0&&(u=new Tt(new Ei(1,1,1),new Ai({name:"BackgroundCubeMaterial",uniforms:Gs(Dn.cube.uniforms),vertexShader:Dn.cube.vertexShader,fragmentShader:Dn.cube.fragmentShader,side:wt,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(S,T,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=v,u.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,(c!==v||f!==v.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),m.unshift(u,u.geometry,u.material,0,0,null)):v&&v.isTexture&&(l===void 0&&(l=new Tt(new kr(2,2),new Ai({name:"BackgroundMaterial",uniforms:Gs(Dn.background.uniforms),vertexShader:Dn.background.vertexShader,fragmentShader:Dn.background.fragmentShader,side:Zi,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=v,v.matrixAutoUpdate===!0&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),(c!==v||f!==v.version||h!==n.toneMapping)&&(l.material.needsUpdate=!0,c=v,f=v.version,h=n.toneMapping),m.unshift(l,l.geometry,l.material,0,0,null))}function y(m,d){t.buffers.color.setClear(m.r,m.g,m.b,d,r)}return{getClearColor:function(){return s},setClearColor:function(m,d=1){s.set(m),o=d,y(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(m){o=m,y(s,o)},render:p}}function QI(n,e,t,i){const r=n.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,l={},u=d(null);let c=u;function f(L,R,N,x,I){let B=!1;if(o){const F=m(x,N,R);c!==F&&(c=F,p(c.object)),B=b(x,I),B&&v(x,I)}else{const F=R.wireframe===!0;(c.geometry!==x.id||c.program!==N.id||c.wireframe!==F)&&(c.geometry=x.id,c.program=N.id,c.wireframe=F,B=!0)}L.isInstancedMesh===!0&&(B=!0),I!==null&&t.update(I,34963),B&&(C(L,R,N,x),I!==null&&n.bindBuffer(34963,t.get(I).buffer))}function h(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function p(L){return i.isWebGL2?n.bindVertexArray(L):s.bindVertexArrayOES(L)}function y(L){return i.isWebGL2?n.deleteVertexArray(L):s.deleteVertexArrayOES(L)}function m(L,R,N){const x=N.wireframe===!0;let I=l[L.id];I===void 0&&(I={},l[L.id]=I);let B=I[R.id];B===void 0&&(B={},I[R.id]=B);let F=B[x];return F===void 0&&(F=d(h()),B[x]=F),F}function d(L){const R=[],N=[],x=[];for(let I=0;I<r;I++)R[I]=0,N[I]=0,x[I]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:N,attributeDivisors:x,object:L,attributes:{},index:null}}function b(L,R){const N=c.attributes,x=L.attributes;let I=0;for(const B in x){const F=N[B],V=x[B];if(F===void 0||F.attribute!==V||F.data!==V.data)return!0;I++}return c.attributesNum!==I||c.index!==R}function v(L,R){const N={},x=L.attributes;let I=0;for(const B in x){const F=x[B],V={};V.attribute=F,F.data&&(V.data=F.data),N[B]=V,I++}c.attributes=N,c.attributesNum=I,c.index=R}function g(){const L=c.newAttributes;for(let R=0,N=L.length;R<N;R++)L[R]=0}function w(L){S(L,0)}function S(L,R){const N=c.newAttributes,x=c.enabledAttributes,I=c.attributeDivisors;N[L]=1,x[L]===0&&(n.enableVertexAttribArray(L),x[L]=1),I[L]!==R&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](L,R),I[L]=R)}function T(){const L=c.newAttributes,R=c.enabledAttributes;for(let N=0,x=R.length;N<x;N++)R[N]!==L[N]&&(n.disableVertexAttribArray(N),R[N]=0)}function M(L,R,N,x,I,B){i.isWebGL2===!0&&(N===5124||N===5125)?n.vertexAttribIPointer(L,R,N,I,B):n.vertexAttribPointer(L,R,N,x,I,B)}function C(L,R,N,x){if(i.isWebGL2===!1&&(L.isInstancedMesh||x.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;g();const I=x.attributes,B=N.getAttributes(),F=R.defaultAttributeValues;for(const V in B){const k=B[V];if(k>=0){const G=I[V];if(G!==void 0){const J=G.normalized,ne=G.itemSize,ae=t.get(G);if(ae===void 0)continue;const ie=ae.buffer,oe=ae.type,W=ae.bytesPerElement;if(G.isInterleavedBufferAttribute){const Z=G.data,j=Z.stride,re=G.offset;Z&&Z.isInstancedInterleavedBuffer?(S(k,Z.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=Z.meshPerAttribute*Z.count)):w(k),n.bindBuffer(34962,ie),M(k,ne,oe,J,j*W,re*W)}else G.isInstancedBufferAttribute?(S(k,G.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=G.meshPerAttribute*G.count)):w(k),n.bindBuffer(34962,ie),M(k,ne,oe,J,0,0)}else if(V==="instanceMatrix"){const J=t.get(L.instanceMatrix);if(J===void 0)continue;const ne=J.buffer,ae=J.type;S(k+0,1),S(k+1,1),S(k+2,1),S(k+3,1),n.bindBuffer(34962,ne),n.vertexAttribPointer(k+0,4,ae,!1,64,0),n.vertexAttribPointer(k+1,4,ae,!1,64,16),n.vertexAttribPointer(k+2,4,ae,!1,64,32),n.vertexAttribPointer(k+3,4,ae,!1,64,48)}else if(V==="instanceColor"){const J=t.get(L.instanceColor);if(J===void 0)continue;const ne=J.buffer,ae=J.type;S(k,1),n.bindBuffer(34962,ne),n.vertexAttribPointer(k,3,ae,!1,12,0)}else if(F!==void 0){const J=F[V];if(J!==void 0)switch(J.length){case 2:n.vertexAttrib2fv(k,J);break;case 3:n.vertexAttrib3fv(k,J);break;case 4:n.vertexAttrib4fv(k,J);break;default:n.vertexAttrib1fv(k,J)}}}}T()}function _(){O();for(const L in l){const R=l[L];for(const N in R){const x=R[N];for(const I in x)y(x[I].object),delete x[I];delete R[N]}delete l[L]}}function P(L){if(l[L.id]===void 0)return;const R=l[L.id];for(const N in R){const x=R[N];for(const I in x)y(x[I].object),delete x[I];delete R[N]}delete l[L.id]}function E(L){for(const R in l){const N=l[R];if(N[L.id]===void 0)continue;const x=N[L.id];for(const I in x)y(x[I].object),delete x[I];delete N[L.id]}}function O(){A(),c!==u&&(c=u,p(c.object))}function A(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:f,reset:O,resetDefaultState:A,dispose:_,releaseStatesOfGeometry:P,releaseStatesOfProgram:E,initAttributes:g,enableAttribute:w,disableUnusedAttributes:T}}function eO(n,e,t,i){const r=i.isWebGL2;let s;function o(c){s=c}function l(c,f){n.drawArrays(s,c,f),t.update(f,s,1)}function u(c,f,h){if(h===0)return;let p,y;if(r)p=n,y="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),y="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[y](s,c,f,h),t.update(f,s,h)}this.setMode=o,this.render=l,this.renderInstances=u}function tO(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const C=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(C){if(C==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";C="mediump"}return C==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let l=t.precision!==void 0?t.precision:"highp";const u=s(l);u!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",u,"instead."),l=u);const c=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,h=n.getParameter(34930),p=n.getParameter(35660),y=n.getParameter(3379),m=n.getParameter(34076),d=n.getParameter(34921),b=n.getParameter(36347),v=n.getParameter(36348),g=n.getParameter(36349),w=p>0,S=o||e.has("OES_texture_float"),T=w&&S,M=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:p,maxTextureSize:y,maxCubemapSize:m,maxAttributes:d,maxVertexUniforms:b,maxVaryings:v,maxFragmentUniforms:g,vertexTextures:w,floatFragmentTextures:S,floatVertexTextures:T,maxSamples:M}}function nO(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Yn,l=new Dt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p,y){const m=h.length!==0||p||i!==0||r;return r=p,t=f(h,y,0),i=h.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,p,y){const m=h.clippingPlanes,d=h.clipIntersection,b=h.clipShadows,v=n.get(h);if(!r||m===null||m.length===0||s&&!b)s?f(null):c();else{const g=s?0:i,w=g*4;let S=v.clippingState||null;u.value=S,S=f(m,p,w,y);for(let T=0;T!==w;++T)S[T]=t[T];v.clippingState=S,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=g}};function c(){u.value!==t&&(u.value=t,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function f(h,p,y,m){const d=h!==null?h.length:0;let b=null;if(d!==0){if(b=u.value,m!==!0||b===null){const v=y+d*4,g=p.matrixWorldInverse;l.getNormalMatrix(g),(b===null||b.length<v)&&(b=new Float32Array(v));for(let w=0,S=y;w!==d;++w,S+=4)o.copy(h[w]).applyMatrix4(g,l),o.normal.toArray(b,S),b[S+3]=o.constant}u.value=b,u.needsUpdate=!0}return e.numPlanes=d,e.numIntersection=0,b}}function iO(n){let e=new WeakMap;function t(o,l){return l===_l?o.mapping=Uo:l===Tl&&(o.mapping=Go),o}function i(o){if(o&&o.isTexture){const l=o.mapping;if(l===_l||l===Tl)if(e.has(o)){const u=e.get(o).texture;return t(u,o.mapping)}else{const u=o.image;if(u&&u.height>0){const c=n.getRenderTarget(),f=new ql(u.height/2);return f.fromEquirectangularTexture(n,o),e.set(o,f),n.setRenderTarget(c),o.addEventListener("dispose",r),t(f.texture,o.mapping)}else return null}}return o}function r(o){const l=o.target;l.removeEventListener("dispose",r);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}function rO(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function sO(n,e,t,i){const r={},s=new WeakMap;function o(h){const p=h.target;p.index!==null&&e.remove(p.index);for(const m in p.attributes)e.remove(p.attributes[m]);p.removeEventListener("dispose",o),delete r[p.id];const y=s.get(p);y&&(e.remove(y),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(h,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function u(h){const p=h.attributes;for(const m in p)e.update(p[m],34962);const y=h.morphAttributes;for(const m in y){const d=y[m];for(let b=0,v=d.length;b<v;b++)e.update(d[b],34962)}}function c(h){const p=[],y=h.index,m=h.attributes.position;let d=0;if(y!==null){const g=y.array;d=y.version;for(let w=0,S=g.length;w<S;w+=3){const T=g[w+0],M=g[w+1],C=g[w+2];p.push(T,M,M,C,C,T)}}else{const g=m.array;d=m.version;for(let w=0,S=g.length/3-1;w<S;w+=3){const T=w+0,M=w+1,C=w+2;p.push(T,M,M,C,C,T)}}const b=new(Ey(p)>65535?Gl:Ul)(p,1);b.version=d;const v=s.get(h);v&&e.remove(v),s.set(h,b)}function f(h){const p=s.get(h);if(p){const y=h.index;y!==null&&p.version<y.version&&c(h)}else c(h);return s.get(h)}return{get:l,update:u,getWireframeAttribute:f}}function oO(n,e,t,i){const r=i.isWebGL2;let s;function o(p){s=p}let l,u;function c(p){l=p.type,u=p.bytesPerElement}function f(p,y){n.drawElements(s,y,l,p*u),t.update(y,s,1)}function h(p,y,m){if(m===0)return;let d,b;if(r)d=n,b="drawElementsInstanced";else if(d=e.get("ANGLE_instanced_arrays"),b="drawElementsInstancedANGLE",d===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[b](s,y,l,p*u,m),t.update(y,s,m)}this.setMode=o,this.setIndex=c,this.render=f,this.renderInstances=h}function aO(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,l){switch(t.calls++,o){case 4:t.triangles+=l*(s/3);break;case 1:t.lines+=l*(s/2);break;case 3:t.lines+=l*(s-1);break;case 2:t.lines+=l*s;break;case 0:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function r(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:i}}function lO(n,e){return n[0]-e[0]}function cO(n,e){return Math.abs(e[1])-Math.abs(n[1])}function uO(n){const e={},t=new Float32Array(8),i=[];for(let s=0;s<8;s++)i[s]=[s,0];function r(s,o,l,u){const c=s.morphTargetInfluences,f=c===void 0?0:c.length;let h=e[o.id];if(h===void 0||h.length!==f){h=[];for(let b=0;b<f;b++)h[b]=[b,0];e[o.id]=h}for(let b=0;b<f;b++){const v=h[b];v[0]=b,v[1]=c[b]}h.sort(cO);for(let b=0;b<8;b++)b<f&&h[b][1]?(i[b][0]=h[b][0],i[b][1]=h[b][1]):(i[b][0]=Number.MAX_SAFE_INTEGER,i[b][1]=0);i.sort(lO);const p=l.morphTargets&&o.morphAttributes.position,y=l.morphNormals&&o.morphAttributes.normal;let m=0;for(let b=0;b<8;b++){const v=i[b],g=v[0],w=v[1];g!==Number.MAX_SAFE_INTEGER&&w?(p&&o.getAttribute("morphTarget"+b)!==p[g]&&o.setAttribute("morphTarget"+b,p[g]),y&&o.getAttribute("morphNormal"+b)!==y[g]&&o.setAttribute("morphNormal"+b,y[g]),t[b]=w,m+=w):(p&&o.hasAttribute("morphTarget"+b)===!0&&o.deleteAttribute("morphTarget"+b),y&&o.hasAttribute("morphNormal"+b)===!0&&o.deleteAttribute("morphNormal"+b),t[b]=0)}const d=o.morphTargetsRelative?1:1-m;u.getUniforms().setValue(n,"morphTargetBaseInfluence",d),u.getUniforms().setValue(n,"morphTargetInfluences",t)}return{update:r}}function dO(n,e,t,i){let r=new WeakMap;function s(u){const c=i.render.frame,f=u.geometry,h=e.get(u,f);return r.get(h)!==c&&(e.update(h),r.set(h,c)),u.isInstancedMesh&&(u.hasEventListener("dispose",l)===!1&&u.addEventListener("dispose",l),t.update(u.instanceMatrix,34962),u.instanceColor!==null&&t.update(u.instanceColor,34962)),h}function o(){r=new WeakMap}function l(u){const c=u.target;c.removeEventListener("dispose",l),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:s,dispose:o}}class th extends St{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Mt,this.minFilter=Mt,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}th.prototype.isDataTexture2DArray=!0;class nh extends St{constructor(e=null,t=1,i=1,r=1){super(null),this.image={data:e,width:t,height:i,depth:r},this.magFilter=Mt,this.minFilter=Mt,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}nh.prototype.isDataTexture3D=!0;const Ly=new St,hO=new th,fO=new nh,Py=new js,Iy=[],Oy=[],Ny=new Float32Array(16),Dy=new Float32Array(9),By=new Float32Array(4);function Zs(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=Iy[r];if(s===void 0&&(s=new Float32Array(r),Iy[r]=s),e!==0){i.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(s,l)}return s}function nn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function Kt(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function Fy(n,e){let t=Oy[e];t===void 0&&(t=new Int32Array(e),Oy[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function pO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function mO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(nn(t,e))return;n.uniform2fv(this.addr,e),Kt(t,e)}}function gO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(nn(t,e))return;n.uniform3fv(this.addr,e),Kt(t,e)}}function yO(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(nn(t,e))return;n.uniform4fv(this.addr,e),Kt(t,e)}}function vO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Kt(t,e)}else{if(nn(t,i))return;By.set(i),n.uniformMatrix2fv(this.addr,!1,By),Kt(t,i)}}function bO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Kt(t,e)}else{if(nn(t,i))return;Dy.set(i),n.uniformMatrix3fv(this.addr,!1,Dy),Kt(t,i)}}function xO(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(nn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Kt(t,e)}else{if(nn(t,i))return;Ny.set(i),n.uniformMatrix4fv(this.addr,!1,Ny),Kt(t,i)}}function wO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function MO(n,e){const t=this.cache;nn(t,e)||(n.uniform2iv(this.addr,e),Kt(t,e))}function SO(n,e){const t=this.cache;nn(t,e)||(n.uniform3iv(this.addr,e),Kt(t,e))}function _O(n,e){const t=this.cache;nn(t,e)||(n.uniform4iv(this.addr,e),Kt(t,e))}function TO(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function EO(n,e){const t=this.cache;nn(t,e)||(n.uniform2uiv(this.addr,e),Kt(t,e))}function AO(n,e){const t=this.cache;nn(t,e)||(n.uniform3uiv(this.addr,e),Kt(t,e))}function CO(n,e){const t=this.cache;nn(t,e)||(n.uniform4uiv(this.addr,e),Kt(t,e))}function RO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTexture2D(e||Ly,r)}function LO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||fO,r)}function PO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.safeSetTextureCube(e||Py,r)}function IO(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||hO,r)}function OO(n){switch(n){case 5126:return pO;case 35664:return mO;case 35665:return gO;case 35666:return yO;case 35674:return vO;case 35675:return bO;case 35676:return xO;case 5124:case 35670:return wO;case 35667:case 35671:return MO;case 35668:case 35672:return SO;case 35669:case 35673:return _O;case 5125:return TO;case 36294:return EO;case 36295:return AO;case 36296:return CO;case 35678:case 36198:case 36298:case 36306:case 35682:return RO;case 35679:case 36299:case 36307:return LO;case 35680:case 36300:case 36308:case 36293:return PO;case 36289:case 36303:case 36311:case 36292:return IO}}function NO(n,e){n.uniform1fv(this.addr,e)}function DO(n,e){const t=Zs(e,this.size,2);n.uniform2fv(this.addr,t)}function BO(n,e){const t=Zs(e,this.size,3);n.uniform3fv(this.addr,t)}function FO(n,e){const t=Zs(e,this.size,4);n.uniform4fv(this.addr,t)}function VO(n,e){const t=Zs(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function kO(n,e){const t=Zs(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function zO(n,e){const t=Zs(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function UO(n,e){n.uniform1iv(this.addr,e)}function GO(n,e){n.uniform2iv(this.addr,e)}function HO(n,e){n.uniform3iv(this.addr,e)}function WO(n,e){n.uniform4iv(this.addr,e)}function jO(n,e){n.uniform1uiv(this.addr,e)}function $O(n,e){n.uniform2uiv(this.addr,e)}function ZO(n,e){n.uniform3uiv(this.addr,e)}function XO(n,e){n.uniform4uiv(this.addr,e)}function YO(n,e,t){const i=e.length,r=Fy(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTexture2D(e[s]||Ly,r[s])}function JO(n,e,t){const i=e.length,r=Fy(t,i);n.uniform1iv(this.addr,r);for(let s=0;s!==i;++s)t.safeSetTextureCube(e[s]||Py,r[s])}function KO(n){switch(n){case 5126:return NO;case 35664:return DO;case 35665:return BO;case 35666:return FO;case 35674:return VO;case 35675:return kO;case 35676:return zO;case 5124:case 35670:return UO;case 35667:case 35671:return GO;case 35668:case 35672:return HO;case 35669:case 35673:return WO;case 5125:return jO;case 36294:return $O;case 36295:return ZO;case 36296:return XO;case 35678:case 36198:case 36298:case 36306:case 35682:return YO;case 35680:case 36300:case 36308:case 36293:return JO}}function qO(n,e,t){this.id=n,this.addr=t,this.cache=[],this.setValue=OO(e.type)}function Vy(n,e,t){this.id=n,this.addr=t,this.cache=[],this.size=e.size,this.setValue=KO(e.type)}Vy.prototype.updateCache=function(n){const e=this.cache;n instanceof Float32Array&&e.length!==n.length&&(this.cache=new Float32Array(n.length)),Kt(e,n)};function ky(n){this.id=n,this.seq=[],this.map={}}ky.prototype.setValue=function(n,e,t){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const o=i[r];o.setValue(n,e[o.id],t)}};const ih=/(\w+)(\])?(\[|\.)?/g;function zy(n,e){n.seq.push(e),n.map[e.id]=e}function QO(n,e,t){const i=n.name,r=i.length;for(ih.lastIndex=0;;){const s=ih.exec(i),o=ih.lastIndex;let l=s[1];const u=s[2]==="]",c=s[3];if(u&&(l=l|0),c===void 0||c==="["&&o+2===r){zy(t,c===void 0?new qO(l,n,e):new Vy(l,n,e));break}else{let h=t.map[l];h===void 0&&(h=new ky(l),zy(t,h)),t=h}}}function ar(n,e){this.seq=[],this.map={};const t=n.getProgramParameter(e,35718);for(let i=0;i<t;++i){const r=n.getActiveUniform(e,i),s=n.getUniformLocation(e,r.name);QO(r,s,this)}}ar.prototype.setValue=function(n,e,t,i){const r=this.map[e];r!==void 0&&r.setValue(n,t,i)},ar.prototype.setOptional=function(n,e,t){const i=e[t];i!==void 0&&this.setValue(n,t,i)},ar.upload=function(n,e,t,i){for(let r=0,s=e.length;r!==s;++r){const o=e[r],l=t[o.id];l.needsUpdate!==!1&&o.setValue(n,l.value,i)}},ar.seqWithValue=function(n,e){const t=[];for(let i=0,r=n.length;i!==r;++i){const s=n[i];s.id in e&&t.push(s)}return t};function Uy(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let e3=0;function t3(n){const e=n.split(`
2868
2868
  `);for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join(`
2869
2869
  `)}function Gy(n){switch(n){case tn:return["Linear","( value )"];case Or:return["sRGB","( value )"];case Ll:return["RGBE","( value )"];case Sd:return["RGBM","( value, 7.0 )"];case _d:return["RGBM","( value, 16.0 )"];case Td:return["RGBD","( value, 256.0 )"];case Rl:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case ey:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function Hy(n,e,t){const i=n.getShaderParameter(e,35713),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=n.getShaderSource(e);return"THREE.WebGLShader: gl.getShaderInfoLog() "+t+`
2870
2870
  `+r+t3(s)}function ia(n,e){const t=Gy(e);return"vec4 "+n+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function n3(n,e){const t=Gy(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function i3(n,e){let t;switch(e){case qg:t="Linear";break;case Qg:t="Reinhard";break;case e0:t="OptimizedCineon";break;case t0:t="ACESFilmic";break;case n0:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function r3(n){return[n.extensionDerivatives||n.envMapCubeUV||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission>0)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ra).join(`
@@ -2912,7 +2912,7 @@ void main() {
2912
2912
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
2913
2913
  }`,C3=`void main() {
2914
2914
  gl_Position = vec4( position, 1.0 );
2915
- }`;function qy(n,e,t){let i=new na;const r=new Se,s=new Se,o=new it,l=[],u=[],c={},f=t.maxTextureSize,h={0:wt,1:Zi,2:Xi},p=new Ai({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Se},radius:{value:4}},vertexShader:C3,fragmentShader:A3}),y=p.clone();y.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new je(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const d=new Tt(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=nd,this.render=function(M,C,_){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||M.length===0)return;const P=n.getRenderTarget(),E=n.getActiveCubeFace(),O=n.getActiveMipmapLevel(),A=n.state;A.setBlending(gi),A.buffers.color.setClear(1,1,1,1),A.buffers.depth.setTest(!0),A.setScissorTest(!1);for(let L=0,R=M.length;L<R;L++){const N=M[L],x=N.shadow;if(x===void 0){console.warn("THREE.WebGLShadowMap:",N,"has no shadow.");continue}if(x.autoUpdate===!1&&x.needsUpdate===!1)continue;r.copy(x.mapSize);const I=x.getFrameExtents();if(r.multiply(I),s.copy(x.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/I.x),r.x=s.x*I.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/I.y),r.y=s.y*I.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Ms){const F={minFilter:gt,magFilter:gt,format:hn};x.map=new Pn(r.x,r.y,F),x.map.texture.name=N.name+".shadowMap",x.mapPass=new Pn(r.x,r.y,F),x.camera.updateProjectionMatrix()}if(x.map===null){const F={minFilter:Mt,magFilter:Mt,format:hn};x.map=new Pn(r.x,r.y,F),x.map.texture.name=N.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let F=0;F<B;F++){const V=x.getViewport(F);o.set(s.x*V.x,s.y*V.y,s.x*V.z,s.y*V.w),A.viewport(o),x.updateMatrices(N,F),i=x.getFrustum(),T(C,_,x.camera,N,this.type)}!x.isPointLightShadow&&this.type===Ms&&v(x,_),x.needsUpdate=!1}b.needsUpdate=!1,n.setRenderTarget(P,E,O)};function v(M,C){const _=e.update(d);p.uniforms.shadow_pass.value=M.map.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,n.setRenderTarget(M.mapPass),n.clear(),n.renderBufferDirect(C,null,_,p,d,null),y.uniforms.shadow_pass.value=M.mapPass.texture,y.uniforms.resolution.value=M.mapSize,y.uniforms.radius.value=M.radius,n.setRenderTarget(M.map),n.clear(),n.renderBufferDirect(C,null,_,y,d,null)}function g(M){const C=M<<0;let _=l[C];return _===void 0&&(_=new ec({depthPacking:ny,morphTargets:M}),l[C]=_),_}function w(M){const C=M<<0;let _=u[C];return _===void 0&&(_=new tc({morphTargets:M}),u[C]=_),_}function S(M,C,_,P,E,O,A){let L=null,R=g,N=M.customDepthMaterial;if(P.isPointLight===!0&&(R=w,N=M.customDistanceMaterial),N===void 0){let x=!1;_.morphTargets===!0&&(x=C.morphAttributes&&C.morphAttributes.position&&C.morphAttributes.position.length>0),L=R(x)}else L=N;if(n.localClippingEnabled&&_.clipShadows===!0&&_.clippingPlanes.length!==0){const x=L.uuid,I=_.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let F=B[I];F===void 0&&(F=L.clone(),B[I]=F),L=F}return L.visible=_.visible,L.wireframe=_.wireframe,A===Ms?L.side=_.shadowSide!==null?_.shadowSide:_.side:L.side=_.shadowSide!==null?_.shadowSide:h[_.side],L.clipShadows=_.clipShadows,L.clippingPlanes=_.clippingPlanes,L.clipIntersection=_.clipIntersection,L.wireframeLinewidth=_.wireframeLinewidth,L.linewidth=_.linewidth,P.isPointLight===!0&&L.isMeshDistanceMaterial===!0&&(L.referencePosition.setFromMatrixPosition(P.matrixWorld),L.nearDistance=E,L.farDistance=O),L}function T(M,C,_,P,E){if(M.visible===!1)return;if(M.layers.test(C.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&E===Ms)&&(!M.frustumCulled||i.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,M.matrixWorld);const L=e.update(M),R=M.material;if(Array.isArray(R)){const N=L.groups;for(let x=0,I=N.length;x<I;x++){const B=N[x],F=R[B.materialIndex];if(F&&F.visible){const V=S(M,L,F,P,_.near,_.far,E);n.renderBufferDirect(_,null,L,V,M,B)}}}else if(R.visible){const N=S(M,L,R,P,_.near,_.far,E);n.renderBufferDirect(_,null,L,N,M,null)}}const A=M.children;for(let L=0,R=A.length;L<R;L++)T(A[L],C,_,P,E)}}function R3(n,e,t){const i=t.isWebGL2;function r(){let te=!1;const he=new it;let ge=null;const Ae=new it(0,0,0,0);return{setMask:function(Te){ge!==Te&&!te&&(n.colorMask(Te,Te,Te,Te),ge=Te)},setLocked:function(Te){te=Te},setClear:function(Te,De,Ye,ze,st){st===!0&&(Te*=ze,De*=ze,Ye*=ze),he.set(Te,De,Ye,ze),Ae.equals(he)===!1&&(n.clearColor(Te,De,Ye,ze),Ae.copy(he))},reset:function(){te=!1,ge=null,Ae.set(-1,0,0,0)}}}function s(){let te=!1,he=null,ge=null,Ae=null;return{setTest:function(Te){Te?ne(2929):ae(2929)},setMask:function(Te){he!==Te&&!te&&(n.depthMask(Te),he=Te)},setFunc:function(Te){if(ge!==Te){if(Te)switch(Te){case Hg:n.depthFunc(512);break;case Wg:n.depthFunc(519);break;case jg:n.depthFunc(513);break;case Ml:n.depthFunc(515);break;case $g:n.depthFunc(514);break;case Zg:n.depthFunc(518);break;case Xg:n.depthFunc(516);break;case Yg:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);ge=Te}},setLocked:function(Te){te=Te},setClear:function(Te){Ae!==Te&&(n.clearDepth(Te),Ae=Te)},reset:function(){te=!1,he=null,ge=null,Ae=null}}}function o(){let te=!1,he=null,ge=null,Ae=null,Te=null,De=null,Ye=null,ze=null,st=null;return{setTest:function(Ce){te||(Ce?ne(2960):ae(2960))},setMask:function(Ce){he!==Ce&&!te&&(n.stencilMask(Ce),he=Ce)},setFunc:function(Ce,He,Ge){(ge!==Ce||Ae!==He||Te!==Ge)&&(n.stencilFunc(Ce,He,Ge),ge=Ce,Ae=He,Te=Ge)},setOp:function(Ce,He,Ge){(De!==Ce||Ye!==He||ze!==Ge)&&(n.stencilOp(Ce,He,Ge),De=Ce,Ye=He,ze=Ge)},setLocked:function(Ce){te=Ce},setClear:function(Ce){st!==Ce&&(n.clearStencil(Ce),st=Ce)},reset:function(){te=!1,he=null,ge=null,Ae=null,Te=null,De=null,Ye=null,ze=null,st=null}}}const l=new r,u=new s,c=new o;let f={},h=null,p={},y=null,m=!1,d=null,b=null,v=null,g=null,w=null,S=null,T=null,M=!1,C=null,_=null,P=null,E=null,O=null;const A=n.getParameter(35661);let L=!1,R=0;const N=n.getParameter(7938);N.indexOf("WebGL")!==-1?(R=parseFloat(/^WebGL (\d)/.exec(N)[1]),L=R>=1):N.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),L=R>=2);let x=null,I={};const B=n.getParameter(3088),F=n.getParameter(2978),V=new it().fromArray(B),k=new it().fromArray(F);function G(te,he,ge){const Ae=new Uint8Array(4),Te=n.createTexture();n.bindTexture(te,Te),n.texParameteri(te,10241,9728),n.texParameteri(te,10240,9728);for(let De=0;De<ge;De++)n.texImage2D(he+De,0,6408,1,1,0,6408,5121,Ae);return Te}const J={};J[3553]=G(3553,3553,1),J[34067]=G(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),ne(2929),u.setFunc(Ml),H(!1),K(td),ne(2884),re(gi);function ne(te){f[te]!==!0&&(n.enable(te),f[te]=!0)}function ae(te){f[te]!==!1&&(n.disable(te),f[te]=!1)}function ie(te){te!==h&&(n.bindFramebuffer(36160,te),h=te)}function oe(te,he){return he===null&&h!==null&&(he=h),p[te]!==he?(n.bindFramebuffer(te,he),p[te]=he,i&&(te===36009&&(p[36160]=he),te===36160&&(p[36009]=he)),!0):!1}function W(te){return y!==te?(n.useProgram(te),y=te,!0):!1}const X={[Er]:32774,[Ig]:32778,[Og]:32779};if(i)X[ad]=32775,X[ld]=32776;else{const te=e.get("EXT_blend_minmax");te!==null&&(X[ad]=te.MIN_EXT,X[ld]=te.MAX_EXT)}const j={[Ng]:0,[Dg]:1,[Bg]:768,[cd]:770,[Gg]:776,[zg]:774,[Vg]:772,[Fg]:769,[ud]:771,[Ug]:775,[kg]:773};function re(te,he,ge,Ae,Te,De,Ye,ze){if(te===gi){m===!0&&(ae(3042),m=!1);return}if(m===!1&&(ne(3042),m=!0),te!==Pg){if(te!==d||ze!==M){if((b!==Er||w!==Er)&&(n.blendEquation(32774),b=Er,w=Er),ze)switch(te){case Ss:n.blendFuncSeparate(1,771,1,771);break;case rd:n.blendFunc(1,1);break;case sd:n.blendFuncSeparate(0,0,769,771);break;case od:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",te);break}else switch(te){case Ss:n.blendFuncSeparate(770,771,1,771);break;case rd:n.blendFunc(770,1);break;case sd:n.blendFunc(0,769);break;case od:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",te);break}v=null,g=null,S=null,T=null,d=te,M=ze}return}Te=Te||he,De=De||ge,Ye=Ye||Ae,(he!==b||Te!==w)&&(n.blendEquationSeparate(X[he],X[Te]),b=he,w=Te),(ge!==v||Ae!==g||De!==S||Ye!==T)&&(n.blendFuncSeparate(j[ge],j[Ae],j[De],j[Ye]),v=ge,g=Ae,S=De,T=Ye),d=te,M=null}function z(te,he){te.side===Xi?ae(2884):ne(2884);let ge=te.side===wt;he&&(ge=!ge),H(ge),te.blending===Ss&&te.transparent===!1?re(gi):re(te.blending,te.blendEquation,te.blendSrc,te.blendDst,te.blendEquationAlpha,te.blendSrcAlpha,te.blendDstAlpha,te.premultipliedAlpha),u.setFunc(te.depthFunc),u.setTest(te.depthTest),u.setMask(te.depthWrite),l.setMask(te.colorWrite);const Ae=te.stencilWrite;c.setTest(Ae),Ae&&(c.setMask(te.stencilWriteMask),c.setFunc(te.stencilFunc,te.stencilRef,te.stencilFuncMask),c.setOp(te.stencilFail,te.stencilZFail,te.stencilZPass)),se(te.polygonOffset,te.polygonOffsetFactor,te.polygonOffsetUnits),te.alphaToCoverage===!0?ne(32926):ae(32926)}function H(te){C!==te&&(te?n.frontFace(2304):n.frontFace(2305),C=te)}function K(te){te!==Cg?(ne(2884),te!==_&&(te===td?n.cullFace(1029):te===Rg?n.cullFace(1028):n.cullFace(1032))):ae(2884),_=te}function le(te){te!==P&&(L&&n.lineWidth(te),P=te)}function se(te,he,ge){te?(ne(32823),(E!==he||O!==ge)&&(n.polygonOffset(he,ge),E=he,O=ge)):ae(32823)}function U(te){te?ne(3089):ae(3089)}function D(te){te===void 0&&(te=33984+A-1),x!==te&&(n.activeTexture(te),x=te)}function $(te,he){x===null&&D();let ge=I[x];ge===void 0&&(ge={type:void 0,texture:void 0},I[x]=ge),(ge.type!==te||ge.texture!==he)&&(n.bindTexture(te,he||J[te]),ge.type=te,ge.texture=he)}function Y(){const te=I[x];te!==void 0&&te.type!==void 0&&(n.bindTexture(te.type,null),te.type=void 0,te.texture=void 0)}function ee(){try{n.compressedTexImage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function ce(){try{n.texImage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function ve(){try{n.texImage3D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function be(te){V.equals(te)===!1&&(n.scissor(te.x,te.y,te.z,te.w),V.copy(te))}function ue(te){k.equals(te)===!1&&(n.viewport(te.x,te.y,te.z,te.w),k.copy(te))}function me(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),f={},x=null,I={},h=null,p={},y=null,m=!1,d=null,b=null,v=null,g=null,w=null,S=null,T=null,M=!1,C=null,_=null,P=null,E=null,O=null,V.set(0,0,n.canvas.width,n.canvas.height),k.set(0,0,n.canvas.width,n.canvas.height),l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},enable:ne,disable:ae,bindFramebuffer:oe,bindXRFramebuffer:ie,useProgram:W,setBlending:re,setMaterial:z,setFlipSided:H,setCullFace:K,setLineWidth:le,setPolygonOffset:se,setScissorTest:U,activeTexture:D,bindTexture:$,unbindTexture:Y,compressedTexImage2D:ee,texImage2D:ce,texImage3D:ve,scissor:be,viewport:ue,reset:me}}function L3(n,e,t,i,r,s,o){const l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,f=r.maxTextureSize,h=r.maxSamples,p=new WeakMap;let y,m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function d(U,D){return m?new OffscreenCanvas(U,D):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(U,D,$,Y){let ee=1;if((U.width>Y||U.height>Y)&&(ee=Y/Math.max(U.width,U.height)),ee<1||D===!0)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap){const ce=D?oy:Math.floor,ve=ce(ee*U.width),be=ce(ee*U.height);y===void 0&&(y=d(ve,be));const ue=$?d(ve,be):y;return ue.width=ve,ue.height=be,ue.getContext("2d").drawImage(U,0,0,ve,be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+U.width+"x"+U.height+") to ("+ve+"x"+be+")."),ue}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+U.width+"x"+U.height+")."),U;return U}function v(U){return Cd(U.width)&&Cd(U.height)}function g(U){return l?!1:U.wrapS!==zt||U.wrapT!==zt||U.minFilter!==Mt&&U.minFilter!==gt}function w(U,D){return U.generateMipmaps&&D&&U.minFilter!==Mt&&U.minFilter!==gt}function S(U,D,$,Y,ee=1){n.generateMipmap(U);const ce=i.get(D);ce.__maxMipLevel=Math.log2(Math.max($,Y,ee))}function T(U,D,$){if(l===!1)return D;if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let Y=D;return D===6403&&($===5126&&(Y=33326),$===5131&&(Y=33325),$===5121&&(Y=33321)),D===6407&&($===5126&&(Y=34837),$===5131&&(Y=34843),$===5121&&(Y=32849)),D===6408&&($===5126&&(Y=34836),$===5131&&(Y=34842),$===5121&&(Y=32856)),(Y===33325||Y===33326||Y===34842||Y===34836)&&e.get("EXT_color_buffer_float"),Y}function M(U){return U===Mt||U===Wo||U===jo?9728:9729}function C(U){const D=U.target;D.removeEventListener("dispose",C),P(D),D.isVideoTexture&&p.delete(D),o.memory.textures--}function _(U){const D=U.target;D.removeEventListener("dispose",_),E(D)}function P(U){const D=i.get(U);D.__webglInit!==void 0&&(n.deleteTexture(D.__webglTexture),i.remove(U))}function E(U){const D=U.texture,$=i.get(U),Y=i.get(D);if(U){if(Y.__webglTexture!==void 0&&(n.deleteTexture(Y.__webglTexture),o.memory.textures--),U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ee=0;ee<6;ee++)n.deleteFramebuffer($.__webglFramebuffer[ee]),$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer[ee]);else n.deleteFramebuffer($.__webglFramebuffer),$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer),$.__webglMultisampledFramebuffer&&n.deleteFramebuffer($.__webglMultisampledFramebuffer),$.__webglColorRenderbuffer&&n.deleteRenderbuffer($.__webglColorRenderbuffer),$.__webglDepthRenderbuffer&&n.deleteRenderbuffer($.__webglDepthRenderbuffer);if(U.isWebGLMultipleRenderTargets)for(let ee=0,ce=D.length;ee<ce;ee++){const ve=i.get(D[ee]);ve.__webglTexture&&(n.deleteTexture(ve.__webglTexture),o.memory.textures--),i.remove(D[ee])}i.remove(D),i.remove(U)}}let O=0;function A(){O=0}function L(){const U=O;return U>=u&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+u),O+=1,U}function R(U,D){const $=i.get(U);if(U.isVideoTexture&&z(U),U.version>0&&$.__version!==U.version){const Y=U.image;if(Y===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G($,U,D);return}}t.activeTexture(33984+D),t.bindTexture(3553,$.__webglTexture)}function N(U,D){const $=i.get(U);if(U.version>0&&$.__version!==U.version){G($,U,D);return}t.activeTexture(33984+D),t.bindTexture(35866,$.__webglTexture)}function x(U,D){const $=i.get(U);if(U.version>0&&$.__version!==U.version){G($,U,D);return}t.activeTexture(33984+D),t.bindTexture(32879,$.__webglTexture)}function I(U,D){const $=i.get(U);if(U.version>0&&$.__version!==U.version){J($,U,D);return}t.activeTexture(33984+D),t.bindTexture(34067,$.__webglTexture)}const B={[Ji]:10497,[zt]:33071,[Ts]:33648},F={[Mt]:9728,[Wo]:9984,[jo]:9986,[gt]:9729,[El]:9985,[yi]:9987};function V(U,D,$){if($?(n.texParameteri(U,10242,B[D.wrapS]),n.texParameteri(U,10243,B[D.wrapT]),(U===32879||U===35866)&&n.texParameteri(U,32882,B[D.wrapR]),n.texParameteri(U,10240,F[D.magFilter]),n.texParameteri(U,10241,F[D.minFilter])):(n.texParameteri(U,10242,33071),n.texParameteri(U,10243,33071),(U===32879||U===35866)&&n.texParameteri(U,32882,33071),(D.wrapS!==zt||D.wrapT!==zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(U,10240,M(D.magFilter)),n.texParameteri(U,10241,M(D.minFilter)),D.minFilter!==Mt&&D.minFilter!==gt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Y=e.get("EXT_texture_filter_anisotropic");if(D.type===vi&&e.has("OES_texture_float_linear")===!1||l===!1&&D.type===Cr&&e.has("OES_texture_half_float_linear")===!1)return;(D.anisotropy>1||i.get(D).__currentAnisotropy)&&(n.texParameterf(U,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(D.anisotropy,r.getMaxAnisotropy())),i.get(D).__currentAnisotropy=D.anisotropy)}}function k(U,D){U.__webglInit===void 0&&(U.__webglInit=!0,D.addEventListener("dispose",C),U.__webglTexture=n.createTexture(),o.memory.textures++)}function G(U,D,$){let Y=3553;D.isDataTexture2DArray&&(Y=35866),D.isDataTexture3D&&(Y=32879),k(U,D),t.activeTexture(33984+$),t.bindTexture(Y,U.__webglTexture),n.pixelStorei(37440,D.flipY),n.pixelStorei(37441,D.premultiplyAlpha),n.pixelStorei(3317,D.unpackAlignment),n.pixelStorei(37443,0);const ee=g(D)&&v(D.image)===!1,ce=b(D.image,ee,!1,f),ve=v(ce)||l,be=s.convert(D.format);let ue=s.convert(D.type),me=T(D.internalFormat,be,ue);V(Y,D,ve);let te;const he=D.mipmaps;if(D.isDepthTexture)me=6402,l?D.type===vi?me=36012:D.type===Zo?me=33190:D.type===Es?me=35056:me=33189:D.type===vi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),D.format===Rr&&me===6402&&D.type!==$o&&D.type!==Zo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),D.type=$o,ue=s.convert(D.type)),D.format===As&&me===6402&&(me=34041,D.type!==Es&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),D.type=Es,ue=s.convert(D.type))),t.texImage2D(3553,0,me,ce.width,ce.height,0,be,ue,null);else if(D.isDataTexture)if(he.length>0&&ve){for(let ge=0,Ae=he.length;ge<Ae;ge++)te=he[ge],t.texImage2D(3553,ge,me,te.width,te.height,0,be,ue,te.data);D.generateMipmaps=!1,U.__maxMipLevel=he.length-1}else t.texImage2D(3553,0,me,ce.width,ce.height,0,be,ue,ce.data),U.__maxMipLevel=0;else if(D.isCompressedTexture){for(let ge=0,Ae=he.length;ge<Ae;ge++)te=he[ge],D.format!==hn&&D.format!==bi?be!==null?t.compressedTexImage2D(3553,ge,me,te.width,te.height,0,te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,ge,me,te.width,te.height,0,be,ue,te.data);U.__maxMipLevel=he.length-1}else if(D.isDataTexture2DArray)t.texImage3D(35866,0,me,ce.width,ce.height,ce.depth,0,be,ue,ce.data),U.__maxMipLevel=0;else if(D.isDataTexture3D)t.texImage3D(32879,0,me,ce.width,ce.height,ce.depth,0,be,ue,ce.data),U.__maxMipLevel=0;else if(he.length>0&&ve){for(let ge=0,Ae=he.length;ge<Ae;ge++)te=he[ge],t.texImage2D(3553,ge,me,be,ue,te);D.generateMipmaps=!1,U.__maxMipLevel=he.length-1}else t.texImage2D(3553,0,me,be,ue,ce),U.__maxMipLevel=0;w(D,ve)&&S(Y,D,ce.width,ce.height),U.__version=D.version,D.onUpdate&&D.onUpdate(D)}function J(U,D,$){if(D.image.length!==6)return;k(U,D),t.activeTexture(33984+$),t.bindTexture(34067,U.__webglTexture),n.pixelStorei(37440,D.flipY),n.pixelStorei(37441,D.premultiplyAlpha),n.pixelStorei(3317,D.unpackAlignment),n.pixelStorei(37443,0);const Y=D&&(D.isCompressedTexture||D.image[0].isCompressedTexture),ee=D.image[0]&&D.image[0].isDataTexture,ce=[];for(let ge=0;ge<6;ge++)!Y&&!ee?ce[ge]=b(D.image[ge],!1,!0,c):ce[ge]=ee?D.image[ge].image:D.image[ge];const ve=ce[0],be=v(ve)||l,ue=s.convert(D.format),me=s.convert(D.type),te=T(D.internalFormat,ue,me);V(34067,D,be);let he;if(Y){for(let ge=0;ge<6;ge++){he=ce[ge].mipmaps;for(let Ae=0;Ae<he.length;Ae++){const Te=he[Ae];D.format!==hn&&D.format!==bi?ue!==null?t.compressedTexImage2D(34069+ge,Ae,te,Te.width,Te.height,0,Te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+ge,Ae,te,Te.width,Te.height,0,ue,me,Te.data)}}U.__maxMipLevel=he.length-1}else{he=D.mipmaps;for(let ge=0;ge<6;ge++)if(ee){t.texImage2D(34069+ge,0,te,ce[ge].width,ce[ge].height,0,ue,me,ce[ge].data);for(let Ae=0;Ae<he.length;Ae++){const De=he[Ae].image[ge].image;t.texImage2D(34069+ge,Ae+1,te,De.width,De.height,0,ue,me,De.data)}}else{t.texImage2D(34069+ge,0,te,ue,me,ce[ge]);for(let Ae=0;Ae<he.length;Ae++){const Te=he[Ae];t.texImage2D(34069+ge,Ae+1,te,ue,me,Te.image[ge])}}U.__maxMipLevel=he.length}w(D,be)&&S(34067,D,ve.width,ve.height),U.__version=D.version,D.onUpdate&&D.onUpdate(D)}function ne(U,D,$,Y,ee){const ce=s.convert($.format),ve=s.convert($.type),be=T($.internalFormat,ce,ve);ee===32879||ee===35866?t.texImage3D(ee,0,be,D.width,D.height,D.depth,0,ce,ve,null):t.texImage2D(ee,0,be,D.width,D.height,0,ce,ve,null),t.bindFramebuffer(36160,U),n.framebufferTexture2D(36160,Y,ee,i.get($).__webglTexture,0),t.bindFramebuffer(36160,null)}function ae(U,D,$){if(n.bindRenderbuffer(36161,U),D.depthBuffer&&!D.stencilBuffer){let Y=33189;if($){const ee=D.depthTexture;ee&&ee.isDepthTexture&&(ee.type===vi?Y=36012:ee.type===Zo&&(Y=33190));const ce=re(D);n.renderbufferStorageMultisample(36161,ce,Y,D.width,D.height)}else n.renderbufferStorage(36161,Y,D.width,D.height);n.framebufferRenderbuffer(36160,36096,36161,U)}else if(D.depthBuffer&&D.stencilBuffer){if($){const Y=re(D);n.renderbufferStorageMultisample(36161,Y,35056,D.width,D.height)}else n.renderbufferStorage(36161,34041,D.width,D.height);n.framebufferRenderbuffer(36160,33306,36161,U)}else{const Y=D.isWebGLMultipleRenderTargets===!0?D.texture[0]:D.texture,ee=s.convert(Y.format),ce=s.convert(Y.type),ve=T(Y.internalFormat,ee,ce);if($){const be=re(D);n.renderbufferStorageMultisample(36161,be,ve,D.width,D.height)}else n.renderbufferStorage(36161,ve,D.width,D.height)}n.bindRenderbuffer(36161,null)}function ie(U,D){if(D&&D.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,U),!(D.depthTexture&&D.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(D.depthTexture).__webglTexture||D.depthTexture.image.width!==D.width||D.depthTexture.image.height!==D.height)&&(D.depthTexture.image.width=D.width,D.depthTexture.image.height=D.height,D.depthTexture.needsUpdate=!0),R(D.depthTexture,0);const Y=i.get(D.depthTexture).__webglTexture;if(D.depthTexture.format===Rr)n.framebufferTexture2D(36160,36096,3553,Y,0);else if(D.depthTexture.format===As)n.framebufferTexture2D(36160,33306,3553,Y,0);else throw new Error("Unknown depthTexture format")}function oe(U){const D=i.get(U),$=U.isWebGLCubeRenderTarget===!0;if(U.depthTexture){if($)throw new Error("target.depthTexture not supported in Cube render targets");ie(D.__webglFramebuffer,U)}else if($){D.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)t.bindFramebuffer(36160,D.__webglFramebuffer[Y]),D.__webglDepthbuffer[Y]=n.createRenderbuffer(),ae(D.__webglDepthbuffer[Y],U,!1)}else t.bindFramebuffer(36160,D.__webglFramebuffer),D.__webglDepthbuffer=n.createRenderbuffer(),ae(D.__webglDepthbuffer,U,!1);t.bindFramebuffer(36160,null)}function W(U){const D=U.texture,$=i.get(U),Y=i.get(D);U.addEventListener("dispose",_),U.isWebGLMultipleRenderTargets!==!0&&(Y.__webglTexture=n.createTexture(),Y.__version=D.version,o.memory.textures++);const ee=U.isWebGLCubeRenderTarget===!0,ce=U.isWebGLMultipleRenderTargets===!0,ve=U.isWebGLMultisampleRenderTarget===!0,be=D.isDataTexture3D||D.isDataTexture2DArray,ue=v(U)||l;if(l&&D.format===bi&&(D.type===vi||D.type===Cr)&&(D.format=hn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),ee){$.__webglFramebuffer=[];for(let me=0;me<6;me++)$.__webglFramebuffer[me]=n.createFramebuffer()}else if($.__webglFramebuffer=n.createFramebuffer(),ce)if(r.drawBuffers){const me=U.texture;for(let te=0,he=me.length;te<he;te++){const ge=i.get(me[te]);ge.__webglTexture===void 0&&(ge.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(ve)if(l){$.__webglMultisampledFramebuffer=n.createFramebuffer(),$.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,$.__webglColorRenderbuffer);const me=s.convert(D.format),te=s.convert(D.type),he=T(D.internalFormat,me,te),ge=re(U);n.renderbufferStorageMultisample(36161,ge,he,U.width,U.height),t.bindFramebuffer(36160,$.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,$.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),U.depthBuffer&&($.__webglDepthRenderbuffer=n.createRenderbuffer(),ae($.__webglDepthRenderbuffer,U,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ee){t.bindTexture(34067,Y.__webglTexture),V(34067,D,ue);for(let me=0;me<6;me++)ne($.__webglFramebuffer[me],U,D,36064,34069+me);w(D,ue)&&S(34067,D,U.width,U.height),t.bindTexture(34067,null)}else if(ce){const me=U.texture;for(let te=0,he=me.length;te<he;te++){const ge=me[te],Ae=i.get(ge);t.bindTexture(3553,Ae.__webglTexture),V(3553,ge,ue),ne($.__webglFramebuffer,U,ge,36064+te,3553),w(ge,ue)&&S(3553,ge,U.width,U.height)}t.bindTexture(3553,null)}else{let me=3553;be&&(l?me=D.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(me,Y.__webglTexture),V(me,D,ue),ne($.__webglFramebuffer,U,D,36064,me),w(D,ue)&&S(me,D,U.width,U.height,U.depth),t.bindTexture(me,null)}U.depthBuffer&&oe(U)}function X(U){const D=v(U)||l,$=U.isWebGLMultipleRenderTargets===!0?U.texture:[U.texture];for(let Y=0,ee=$.length;Y<ee;Y++){const ce=$[Y];if(w(ce,D)){const ve=U.isWebGLCubeRenderTarget?34067:3553,be=i.get(ce).__webglTexture;t.bindTexture(ve,be),S(ve,ce,U.width,U.height),t.bindTexture(ve,null)}}}function j(U){if(U.isWebGLMultisampleRenderTarget)if(l){const D=U.width,$=U.height;let Y=16384;U.depthBuffer&&(Y|=256),U.stencilBuffer&&(Y|=1024);const ee=i.get(U);t.bindFramebuffer(36008,ee.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,ee.__webglFramebuffer),n.blitFramebuffer(0,0,D,$,0,0,D,$,Y,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,ee.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function re(U){return l&&U.isWebGLMultisampleRenderTarget?Math.min(h,U.samples):0}function z(U){const D=o.render.frame;p.get(U)!==D&&(p.set(U,D),U.update())}let H=!1,K=!1;function le(U,D){U&&U.isWebGLRenderTarget&&(H===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),H=!0),U=U.texture),R(U,D)}function se(U,D){U&&U.isWebGLCubeRenderTarget&&(K===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),K=!0),U=U.texture),I(U,D)}this.allocateTextureUnit=L,this.resetTextureUnits=A,this.setTexture2D=R,this.setTexture2DArray=N,this.setTexture3D=x,this.setTextureCube=I,this.setupRenderTarget=W,this.updateRenderTargetMipmap=X,this.updateMultisampleRenderTarget=j,this.safeSetTexture2D=le,this.safeSetTextureCube=se}function Qy(n,e,t){const i=t.isWebGL2;function r(s){let o;if(s===Ar)return 5121;if(s===o0)return 32819;if(s===a0)return 32820;if(s===l0)return 33635;if(s===i0)return 5120;if(s===r0)return 5122;if(s===$o)return 5123;if(s===s0)return 5124;if(s===Zo)return 5125;if(s===vi)return 5126;if(s===Cr)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===c0)return 6406;if(s===bi)return 6407;if(s===hn)return 6408;if(s===u0)return 6409;if(s===d0)return 6410;if(s===Rr)return 6402;if(s===As)return 34041;if(s===f0)return 6403;if(s===p0)return 36244;if(s===m0)return 33319;if(s===g0)return 33320;if(s===y0)return 36248;if(s===v0)return 36249;if(s===dd||s===hd||s===fd||s===pd)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===dd)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===hd)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===fd)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===pd)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===md||s===gd||s===yd||s===vd)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===md)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===gd)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===yd)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===vd)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===b0)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===bd||s===xd)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===bd)return o.COMPRESSED_RGB8_ETC2;if(s===xd)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===x0||s===w0||s===M0||s===S0||s===_0||s===T0||s===E0||s===A0||s===C0||s===R0||s===L0||s===P0||s===I0||s===O0||s===D0||s===B0||s===F0||s===V0||s===k0||s===z0||s===U0||s===G0||s===H0||s===W0||s===j0||s===$0||s===Z0||s===X0)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===N0)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Es)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class sh extends Bt{constructor(e=[]){super(),this.cameras=e}}sh.prototype.isArrayCamera=!0;class Jn extends Ze{constructor(){super(),this.type="Group"}}Jn.prototype.isGroup=!0;const P3={type:"move"};class oh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Jn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Jn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Jn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new q),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const l=this._targetRay,u=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(l!==null&&(r=t.getPose(e.targetRaySpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(P3))),c&&e.hand){o=!0;for(const d of e.hand.values()){const b=t.getJointPose(d,i);if(c.joints[d.jointName]===void 0){const g=new Jn;g.matrixAutoUpdate=!1,g.visible=!1,c.joints[d.jointName]=g,c.add(g)}const v=c.joints[d.jointName];b!==null&&(v.matrix.fromArray(b.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=b.radius),v.visible=b!==null}const f=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],p=f.position.distanceTo(h.position),y=.02,m=.005;c.inputState.pinching&&p>y+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=y-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class I3 extends qi{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,h=null,p=null;const y=[],m=new Map,d=new Bt;d.layers.enable(1),d.viewport=new it;const b=new Bt;b.layers.enable(2),b.viewport=new it;const v=[d,b],g=new sh;g.layers.enable(1),g.layers.enable(2);let w=null,S=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let x=y[N];return x===void 0&&(x=new oh,y[N]=x),x.getTargetRaySpace()},this.getControllerGrip=function(N){let x=y[N];return x===void 0&&(x=new oh,y[N]=x),x.getGripSpace()},this.getHand=function(N){let x=y[N];return x===void 0&&(x=new oh,y[N]=x),x.getHandSpace()};function T(N){const x=m.get(N.inputSource);x&&x.dispatchEvent({type:N.type,data:N.inputSource})}function M(){m.forEach(function(N,x){N.disconnect(x)}),m.clear(),w=null,S=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),R.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(N){o=N,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(N){u=N,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(N){if(s=N,s!==null){s.addEventListener("select",T),s.addEventListener("selectstart",T),s.addEventListener("selectend",T),s.addEventListener("squeeze",T),s.addEventListener("squeezestart",T),s.addEventListener("squeezeend",T),s.addEventListener("end",M),s.addEventListener("inputsourceschange",C);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const I={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,I);s.updateRenderState({baseLayer:B})}else{let I=0;x.depth&&(I=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:I,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),h=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),R.setContext(s),R.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function C(N){const x=s.inputSources;for(let I=0;I<y.length;I++)m.set(x[I],y[I]);for(let I=0;I<N.removed.length;I++){const B=N.removed[I],F=m.get(B);F&&(F.dispatchEvent({type:"disconnected",data:B}),m.delete(B))}for(let I=0;I<N.added.length;I++){const B=N.added[I],F=m.get(B);F&&F.dispatchEvent({type:"connected",data:B})}}const _=new q,P=new q;function E(N,x,I){_.setFromMatrixPosition(x.matrixWorld),P.setFromMatrixPosition(I.matrixWorld);const B=_.distanceTo(P),F=x.projectionMatrix.elements,V=I.projectionMatrix.elements,k=F[14]/(F[10]-1),G=F[14]/(F[10]+1),J=(F[9]+1)/F[5],ne=(F[9]-1)/F[5],ae=(F[8]-1)/F[0],ie=(V[8]+1)/V[0],oe=k*ae,W=k*ie,X=B/(-ae+ie),j=X*-ae;x.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(j),N.translateZ(X),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();const re=k+X,z=G+X,H=oe-j,K=W+(B-j),le=J*G/z*re,se=ne*G/z*re;N.projectionMatrix.makePerspective(H,K,le,se,re,z)}function O(N,x){x===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(x.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(s===null)return;g.near=b.near=d.near=N.near,g.far=b.far=d.far=N.far,(w!==g.near||S!==g.far)&&(s.updateRenderState({depthNear:g.near,depthFar:g.far}),w=g.near,S=g.far);const x=N.parent,I=g.cameras;O(g,x);for(let F=0;F<I.length;F++)O(I[F],x);g.matrixWorld.decompose(g.position,g.quaternion,g.scale),N.position.copy(g.position),N.quaternion.copy(g.quaternion),N.scale.copy(g.scale),N.matrix.copy(g.matrix),N.matrixWorld.copy(g.matrixWorld);const B=N.children;for(let F=0,V=B.length;F<V;F++)B[F].updateMatrixWorld(!0);I.length===2?E(g,d,b):g.projectionMatrix.copy(d.projectionMatrix)},this.getCamera=function(){return g};let A=null;function L(N,x){if(c=x.getViewerPose(l),c!==null){const B=c.views,F=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(F.framebuffer);let V=!1;B.length!==g.cameras.length&&(g.cameras.length=0,V=!0);for(let k=0;k<B.length;k++){const G=B[k];let J=null;if(s.renderState.layers===void 0)J=F.getViewport(G);else{const ae=f.getViewSubImage(p,G);r.bindXRFramebuffer(h),t.framebufferTexture2D(36160,36064,3553,ae.colorTexture,0),ae.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,ae.depthStencilTexture,0),J=ae.viewport}const ne=v[k];ne.matrix.fromArray(G.transform.matrix),ne.projectionMatrix.fromArray(G.projectionMatrix),ne.viewport.set(J.x,J.y,J.width,J.height),k===0&&g.matrix.copy(ne.matrix),V===!0&&g.cameras.push(ne)}}const I=s.inputSources;for(let B=0;B<y.length;B++){const F=y[B],V=I[B];F.update(V,x,l)}A&&A(N,x)}const R=new Ry;R.setAnimationLoop(L),this.setAnimationLoop=function(N){A=N},this.dispose=function(){}}}function O3(n){function e(v,g){v.fogColor.value.copy(g.color),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function t(v,g,w,S,T){g.isMeshBasicMaterial?i(v,g):g.isMeshLambertMaterial?(i(v,g),u(v,g)):g.isMeshToonMaterial?(i(v,g),f(v,g)):g.isMeshPhongMaterial?(i(v,g),c(v,g)):g.isMeshStandardMaterial?(i(v,g),g.isMeshPhysicalMaterial?p(v,g,T):h(v,g)):g.isMeshMatcapMaterial?(i(v,g),y(v,g)):g.isMeshDepthMaterial?(i(v,g),m(v,g)):g.isMeshDistanceMaterial?(i(v,g),d(v,g)):g.isMeshNormalMaterial?(i(v,g),b(v,g)):g.isLineBasicMaterial?(r(v,g),g.isLineDashedMaterial&&s(v,g)):g.isPointsMaterial?o(v,g,w,S):g.isSpriteMaterial?l(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function i(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap),g.specularMap&&(v.specularMap.value=g.specularMap);const w=n.get(g).envMap;if(w){v.envMap.value=w,v.flipEnvMap.value=w.isCubeTexture&&w._needsFlipEnvMap?-1:1,v.reflectivity.value=g.reflectivity,v.refractionRatio.value=g.refractionRatio;const M=n.get(w).__maxMipLevel;M!==void 0&&(v.maxMipLevel.value=M)}g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity);let S;g.map?S=g.map:g.specularMap?S=g.specularMap:g.displacementMap?S=g.displacementMap:g.normalMap?S=g.normalMap:g.bumpMap?S=g.bumpMap:g.roughnessMap?S=g.roughnessMap:g.metalnessMap?S=g.metalnessMap:g.alphaMap?S=g.alphaMap:g.emissiveMap?S=g.emissiveMap:g.clearcoatMap?S=g.clearcoatMap:g.clearcoatNormalMap?S=g.clearcoatNormalMap:g.clearcoatRoughnessMap&&(S=g.clearcoatRoughnessMap),S!==void 0&&(S.isWebGLRenderTarget&&(S=S.texture),S.matrixAutoUpdate===!0&&S.updateMatrix(),v.uvTransform.value.copy(S.matrix));let T;g.aoMap?T=g.aoMap:g.lightMap&&(T=g.lightMap),T!==void 0&&(T.isWebGLRenderTarget&&(T=T.texture),T.matrixAutoUpdate===!0&&T.updateMatrix(),v.uv2Transform.value.copy(T.matrix))}function r(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity}function s(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function o(v,g,w,S){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*w,v.scale.value=S*.5,g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap);let T;g.map?T=g.map:g.alphaMap&&(T=g.alphaMap),T!==void 0&&(T.matrixAutoUpdate===!0&&T.updateMatrix(),v.uvTransform.value.copy(T.matrix))}function l(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap);let w;g.map?w=g.map:g.alphaMap&&(w=g.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),v.uvTransform.value.copy(w.matrix))}function u(v,g){g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap)}function c(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function f(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function h(v,g){v.roughness.value=g.roughness,v.metalness.value=g.metalness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),n.get(g).envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function p(v,g,w){h(v,g),v.reflectivity.value=g.reflectivity,v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.sheen&&v.sheen.value.copy(g.sheen),g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),v.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===wt&&v.clearcoatNormalScale.value.negate()),v.transmission.value=g.transmission,g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap),g.transmission>0&&(v.transmissionSamplerMap.value=w.texture,v.transmissionSamplerSize.value.set(w.width,w.height)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)}function y(v,g){g.matcap&&(v.matcap.value=g.matcap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function m(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function d(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),v.referencePosition.value.copy(g.referencePosition),v.nearDistance.value=g.nearDistance,v.farDistance.value=g.farDistance}function b(v,g){g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function N3(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function rt(n={}){const e=n.canvas!==void 0?n.canvas:N3(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h=null,p=null;const y=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=tn,this.physicallyCorrectLights=!1,this.toneMapping=Yi,this.toneMappingExposure=1;const d=this;let b=!1,v=0,g=0,w=null,S=-1,T=null;const M=new it,C=new it;let _=null,P=e.width,E=e.height,O=1,A=null,L=null;const R=new it(0,0,P,E),N=new it(0,0,P,E);let x=!1;const I=[],B=new na;let F=!1,V=!1,k=null;const G=new Ne,J=new q,ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ae(){return w===null?O:1}let ie=t;function oe(Z,pe){for(let de=0;de<Z.length;de++){const ye=Z[de],Me=e.getContext(ye,pe);if(Me!==null)return Me}return null}try{const Z={alpha:i,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:f};if(e.addEventListener("webglcontextlost",De,!1),e.addEventListener("webglcontextrestored",Ye,!1),ie===null){const pe=["webgl2","webgl","experimental-webgl"];if(d.isWebGL1Renderer===!0&&pe.shift(),ie=oe(pe,Z),ie===null)throw oe(pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}ie.getShaderPrecisionFormat===void 0&&(ie.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let W,X,j,re,z,H,K,le,se,U,D,$,Y,ee,ce,ve,be,ue,me,te,he,ge;function Ae(){W=new rO(ie),X=new tO(ie,W,n),W.init(X),he=new Qy(ie,W,X),j=new R3(ie,W,X),I[0]=1029,re=new aO,z=new v3,H=new L3(ie,W,j,z,X,he,re),K=new iO(d),le=new LL(ie,X),ge=new QI(ie,W,le,X),se=new sO(ie,le,re,ge),U=new dO(ie,se,le,re),ue=new uO(ie),ce=new nO(z),D=new y3(d,K,W,X,ge,ce),$=new O3(z),Y=new x3(z),ee=new E3(W,X),be=new qI(d,K,j,U,l),ve=new qy(d,U,X),me=new eO(ie,W,re,X),te=new oO(ie,W,re,X),re.programs=D.programs,d.capabilities=X,d.extensions=W,d.properties=z,d.renderLists=Y,d.shadowMap=ve,d.state=j,d.info=re}Ae();const Te=new I3(d,ie);this.xr=Te,this.getContext=function(){return ie},this.getContextAttributes=function(){return ie.getContextAttributes()},this.forceContextLoss=function(){const Z=W.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){const Z=W.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return O},this.setPixelRatio=function(Z){Z!==void 0&&(O=Z,this.setSize(P,E,!1))},this.getSize=function(Z){return Z.set(P,E)},this.setSize=function(Z,pe,de){if(Te.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}P=Z,E=pe,e.width=Math.floor(Z*O),e.height=Math.floor(pe*O),de!==!1&&(e.style.width=Z+"px",e.style.height=pe+"px"),this.setViewport(0,0,Z,pe)},this.getDrawingBufferSize=function(Z){return Z.set(P*O,E*O).floor()},this.setDrawingBufferSize=function(Z,pe,de){P=Z,E=pe,O=de,e.width=Math.floor(Z*de),e.height=Math.floor(pe*de),this.setViewport(0,0,Z,pe)},this.getCurrentViewport=function(Z){return Z.copy(M)},this.getViewport=function(Z){return Z.copy(R)},this.setViewport=function(Z,pe,de,ye){Z.isVector4?R.set(Z.x,Z.y,Z.z,Z.w):R.set(Z,pe,de,ye),j.viewport(M.copy(R).multiplyScalar(O).floor())},this.getScissor=function(Z){return Z.copy(N)},this.setScissor=function(Z,pe,de,ye){Z.isVector4?N.set(Z.x,Z.y,Z.z,Z.w):N.set(Z,pe,de,ye),j.scissor(C.copy(N).multiplyScalar(O).floor())},this.getScissorTest=function(){return x},this.setScissorTest=function(Z){j.setScissorTest(x=Z)},this.setOpaqueSort=function(Z){A=Z},this.setTransparentSort=function(Z){L=Z},this.getClearColor=function(Z){return Z.copy(be.getClearColor())},this.setClearColor=function(){be.setClearColor.apply(be,arguments)},this.getClearAlpha=function(){return be.getClearAlpha()},this.setClearAlpha=function(){be.setClearAlpha.apply(be,arguments)},this.clear=function(Z,pe,de){let ye=0;(Z===void 0||Z)&&(ye|=16384),(pe===void 0||pe)&&(ye|=256),(de===void 0||de)&&(ye|=1024),ie.clear(ye)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",De,!1),e.removeEventListener("webglcontextrestored",Ye,!1),Y.dispose(),ee.dispose(),z.dispose(),K.dispose(),U.dispose(),ge.dispose(),Te.dispose(),Te.removeEventListener("sessionstart",Ot),Te.removeEventListener("sessionend",mt),k&&(k.dispose(),k=null),bt.stop()};function De(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Ye(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const Z=re.autoReset,pe=ve.enabled,de=ve.autoUpdate,ye=ve.needsUpdate,Me=ve.type;Ae(),re.autoReset=Z,ve.enabled=pe,ve.autoUpdate=de,ve.needsUpdate=ye,ve.type=Me}function ze(Z){const pe=Z.target;pe.removeEventListener("dispose",ze),st(pe)}function st(Z){Ce(Z),z.remove(Z)}function Ce(Z){const pe=z.get(Z).programs;pe!==void 0&&pe.forEach(function(de){D.releaseProgram(de)})}function He(Z,pe){Z.render(function(de){d.renderBufferImmediate(de,pe)})}this.renderBufferImmediate=function(Z,pe){ge.initAttributes();const de=z.get(Z);Z.hasPositions&&!de.position&&(de.position=ie.createBuffer()),Z.hasNormals&&!de.normal&&(de.normal=ie.createBuffer()),Z.hasUvs&&!de.uv&&(de.uv=ie.createBuffer()),Z.hasColors&&!de.color&&(de.color=ie.createBuffer());const ye=pe.getAttributes();Z.hasPositions&&(ie.bindBuffer(34962,de.position),ie.bufferData(34962,Z.positionArray,35048),ge.enableAttribute(ye.position),ie.vertexAttribPointer(ye.position,3,5126,!1,0,0)),Z.hasNormals&&(ie.bindBuffer(34962,de.normal),ie.bufferData(34962,Z.normalArray,35048),ge.enableAttribute(ye.normal),ie.vertexAttribPointer(ye.normal,3,5126,!1,0,0)),Z.hasUvs&&(ie.bindBuffer(34962,de.uv),ie.bufferData(34962,Z.uvArray,35048),ge.enableAttribute(ye.uv),ie.vertexAttribPointer(ye.uv,2,5126,!1,0,0)),Z.hasColors&&(ie.bindBuffer(34962,de.color),ie.bufferData(34962,Z.colorArray,35048),ge.enableAttribute(ye.color),ie.vertexAttribPointer(ye.color,3,5126,!1,0,0)),ge.disableUnusedAttributes(),ie.drawArrays(4,0,Z.count),Z.count=0},this.renderBufferDirect=function(Z,pe,de,ye,Me,fe){pe===null&&(pe=ne);const xe=Me.isMesh&&Me.matrixWorld.determinant()<0,_e=Ee(Z,pe,ye,Me);j.setMaterial(ye,xe);let Pe=de.index;const Oe=de.attributes.position;if(Pe===null){if(Oe===void 0||Oe.count===0)return}else if(Pe.count===0)return;let Ue=1;ye.wireframe===!0&&(Pe=se.getWireframeAttribute(de),Ue=2),(ye.morphTargets||ye.morphNormals)&&ue.update(Me,de,ye,_e),ge.setup(Me,ye,_e,de,Pe);let Fe,qe=me;Pe!==null&&(Fe=le.get(Pe),qe=te,qe.setIndex(Fe));const Rt=Pe!==null?Pe.count:Oe.count,Gt=de.drawRange.start*Ue,is=de.drawRange.count*Ue,ut=fe!==null?fe.start*Ue:0,rs=fe!==null?fe.count*Ue:1/0,qt=Math.max(Gt,ut),jF=Math.min(Rt,Gt+is,ut+rs)-1,Wc=Math.max(0,jF-qt+1);if(Wc!==0){if(Me.isMesh)ye.wireframe===!0?(j.setLineWidth(ye.wireframeLinewidth*ae()),qe.setMode(1)):qe.setMode(4);else if(Me.isLine){let Ba=ye.linewidth;Ba===void 0&&(Ba=1),j.setLineWidth(Ba*ae()),Me.isLineSegments?qe.setMode(1):Me.isLineLoop?qe.setMode(2):qe.setMode(3)}else Me.isPoints?qe.setMode(0):Me.isSprite&&qe.setMode(4);if(Me.isInstancedMesh)qe.renderInstances(qt,Wc,Me.count);else if(de.isInstancedBufferGeometry){const Ba=Math.min(de.instanceCount,de._maxInstanceCount);qe.renderInstances(qt,Wc,Ba)}else qe.render(qt,Wc)}},this.compile=function(Z,pe){p=ee.get(Z),p.init(),Z.traverseVisible(function(de){de.isLight&&de.layers.test(pe.layers)&&(p.pushLight(de),de.castShadow&&p.pushShadow(de))}),p.setupLights(),Z.traverse(function(de){const ye=de.material;if(ye)if(Array.isArray(ye))for(let Me=0;Me<ye.length;Me++){const fe=ye[Me];Q(fe,Z,de)}else Q(ye,Z,de)})};let Ge=null;function It(Z){Ge&&Ge(Z)}function Ot(){bt.stop()}function mt(){bt.start()}const bt=new Ry;bt.setAnimationLoop(It),typeof window<"u"&&bt.setContext(window),this.setAnimationLoop=function(Z){Ge=Z,Te.setAnimationLoop(Z),Z===null?bt.stop():bt.start()},Te.addEventListener("sessionstart",Ot),Te.addEventListener("sessionend",mt),this.render=function(Z,pe){if(pe!==void 0&&pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;Z.autoUpdate===!0&&Z.updateMatrixWorld(),pe.parent===null&&pe.updateMatrixWorld(),Te.enabled===!0&&Te.isPresenting===!0&&(Te.cameraAutoUpdate===!0&&Te.updateCamera(pe),pe=Te.getCamera()),Z.isScene===!0&&Z.onBeforeRender(d,Z,pe,w),p=ee.get(Z,m.length),p.init(),m.push(p),G.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),B.setFromProjectionMatrix(G),V=this.localClippingEnabled,F=ce.init(this.clippingPlanes,V,pe),h=Y.get(Z,y.length),h.init(),y.push(h),Ii(Z,pe,0,d.sortObjects),h.finish(),d.sortObjects===!0&&h.sort(A,L),F===!0&&ce.beginShadows();const de=p.state.shadowsArray;ve.render(de,Z,pe),p.setupLights(),p.setupLightsView(pe),F===!0&&ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),be.render(h,Z);const ye=h.opaque,Me=h.transmissive,fe=h.transparent;ye.length>0&&zn(ye,Z,pe),Me.length>0&&Oi(ye,Me,Z,pe),fe.length>0&&zn(fe,Z,pe),w!==null&&(H.updateMultisampleRenderTarget(w),H.updateRenderTargetMipmap(w)),Z.isScene===!0&&Z.onAfterRender(d,Z,pe),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),ge.resetDefaultState(),S=-1,T=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,y.pop(),y.length>0?h=y[y.length-1]:h=null};function Ii(Z,pe,de,ye){if(Z.visible===!1)return;if(Z.layers.test(pe.layers)){if(Z.isGroup)de=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(pe);else if(Z.isLight)p.pushLight(Z),Z.castShadow&&p.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||B.intersectsSprite(Z)){ye&&J.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(G);const xe=U.update(Z),_e=Z.material;_e.visible&&h.push(Z,xe,_e,de,J.z,null)}}else if(Z.isImmediateRenderObject)ye&&J.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(G),h.push(Z,null,Z.material,de,J.z,null);else if((Z.isMesh||Z.isLine||Z.isPoints)&&(Z.isSkinnedMesh&&Z.skeleton.frame!==re.render.frame&&(Z.skeleton.update(),Z.skeleton.frame=re.render.frame),!Z.frustumCulled||B.intersectsObject(Z))){ye&&J.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(G);const xe=U.update(Z),_e=Z.material;if(Array.isArray(_e)){const Pe=xe.groups;for(let Oe=0,Ue=Pe.length;Oe<Ue;Oe++){const Fe=Pe[Oe],qe=_e[Fe.materialIndex];qe&&qe.visible&&h.push(Z,xe,qe,de,J.z,Fe)}}else _e.visible&&h.push(Z,xe,_e,de,J.z,null)}}const fe=Z.children;for(let xe=0,_e=fe.length;xe<_e;xe++)Ii(fe[xe],pe,de,ye)}function Oi(Z,pe,de,ye){if(k===null){const _e=o===!0&&X.isWebGL2===!0?Pd:Pn;k=new _e(1024,1024,{generateMipmaps:!0,type:he.convert(Cr)!==null?Cr:Ar,minFilter:yi,magFilter:Mt,wrapS:zt,wrapT:zt})}const Me=d.getRenderTarget();d.setRenderTarget(k),d.clear();const fe=d.toneMapping;d.toneMapping=Yi,zn(Z,de,ye),d.toneMapping=fe,H.updateMultisampleRenderTarget(k),H.updateRenderTargetMipmap(k),d.setRenderTarget(Me),zn(pe,de,ye)}function zn(Z,pe,de){const ye=pe.isScene===!0?pe.overrideMaterial:null;for(let Me=0,fe=Z.length;Me<fe;Me++){const xe=Z[Me],_e=xe.object,Pe=xe.geometry,Oe=ye===null?xe.material:ye,Ue=xe.group;if(de.isArrayCamera){const Fe=de.cameras;for(let qe=0,Rt=Fe.length;qe<Rt;qe++){const Gt=Fe[qe];_e.layers.test(Gt.layers)&&(j.viewport(M.copy(Gt.viewport)),p.setupLightsView(Gt),ns(_e,pe,Gt,Pe,Oe,Ue))}}else ns(_e,pe,de,Pe,Oe,Ue)}}function ns(Z,pe,de,ye,Me,fe){if(Z.onBeforeRender(d,pe,de,ye,Me,fe),Z.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),Z.isImmediateRenderObject){const xe=Ee(de,pe,Me,Z);j.setMaterial(Me),ge.reset(),He(Z,xe)}else Me.transparent===!0&&Me.side===Xi?(Me.side=wt,Me.needsUpdate=!0,d.renderBufferDirect(de,pe,ye,Me,Z,fe),Me.side=Zi,Me.needsUpdate=!0,d.renderBufferDirect(de,pe,ye,Me,Z,fe),Me.side=Xi):d.renderBufferDirect(de,pe,ye,Me,Z,fe);Z.onAfterRender(d,pe,de,ye,Me,fe)}function Q(Z,pe,de){pe.isScene!==!0&&(pe=ne);const ye=z.get(Z),Me=p.state.lights,fe=p.state.shadowsArray,xe=Me.state.version,_e=D.getParameters(Z,Me.state,fe,pe,de),Pe=D.getProgramCacheKey(_e);let Oe=ye.programs;ye.environment=Z.isMeshStandardMaterial?pe.environment:null,ye.fog=pe.fog,ye.envMap=K.get(Z.envMap||ye.environment),Oe===void 0&&(Z.addEventListener("dispose",ze),Oe=new Map,ye.programs=Oe);let Ue=Oe.get(Pe);if(Ue!==void 0){if(ye.currentProgram===Ue&&ye.lightsStateVersion===xe)return we(Z,_e),Ue}else _e.uniforms=D.getUniforms(Z),Z.onBuild(_e,d),Z.onBeforeCompile(_e,d),Ue=D.acquireProgram(_e,Pe),Oe.set(Pe,Ue),ye.uniforms=_e.uniforms;const Fe=ye.uniforms;(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Fe.clippingPlanes=ce.uniform),we(Z,_e),ye.needsLights=Ke(Z),ye.lightsStateVersion=xe,ye.needsLights&&(Fe.ambientLightColor.value=Me.state.ambient,Fe.lightProbe.value=Me.state.probe,Fe.directionalLights.value=Me.state.directional,Fe.directionalLightShadows.value=Me.state.directionalShadow,Fe.spotLights.value=Me.state.spot,Fe.spotLightShadows.value=Me.state.spotShadow,Fe.rectAreaLights.value=Me.state.rectArea,Fe.ltc_1.value=Me.state.rectAreaLTC1,Fe.ltc_2.value=Me.state.rectAreaLTC2,Fe.pointLights.value=Me.state.point,Fe.pointLightShadows.value=Me.state.pointShadow,Fe.hemisphereLights.value=Me.state.hemi,Fe.directionalShadowMap.value=Me.state.directionalShadowMap,Fe.directionalShadowMatrix.value=Me.state.directionalShadowMatrix,Fe.spotShadowMap.value=Me.state.spotShadowMap,Fe.spotShadowMatrix.value=Me.state.spotShadowMatrix,Fe.pointShadowMap.value=Me.state.pointShadowMap,Fe.pointShadowMatrix.value=Me.state.pointShadowMatrix);const qe=Ue.getUniforms(),Rt=ar.seqWithValue(qe.seq,Fe);return ye.currentProgram=Ue,ye.uniformsList=Rt,Ue}function we(Z,pe){const de=z.get(Z);de.outputEncoding=pe.outputEncoding,de.instancing=pe.instancing,de.skinning=pe.skinning,de.numClippingPlanes=pe.numClippingPlanes,de.numIntersection=pe.numClipIntersection,de.vertexAlphas=pe.vertexAlphas}function Ee(Z,pe,de,ye){pe.isScene!==!0&&(pe=ne),H.resetTextureUnits();const Me=pe.fog,fe=de.isMeshStandardMaterial?pe.environment:null,xe=w===null?d.outputEncoding:w.texture.encoding,_e=K.get(de.envMap||fe),Pe=de.vertexColors===!0&&ye.geometry&&ye.geometry.attributes.color&&ye.geometry.attributes.color.itemSize===4,Oe=z.get(de),Ue=p.state.lights;if(F===!0&&(V===!0||Z!==T)){const qt=Z===T&&de.id===S;ce.setState(de,Z,qt)}let Fe=!1;de.version===Oe.__version?(Oe.needsLights&&Oe.lightsStateVersion!==Ue.state.version||Oe.outputEncoding!==xe||ye.isInstancedMesh&&Oe.instancing===!1||!ye.isInstancedMesh&&Oe.instancing===!0||ye.isSkinnedMesh&&Oe.skinning===!1||!ye.isSkinnedMesh&&Oe.skinning===!0||Oe.envMap!==_e||de.fog&&Oe.fog!==Me||Oe.numClippingPlanes!==void 0&&(Oe.numClippingPlanes!==ce.numPlanes||Oe.numIntersection!==ce.numIntersection)||Oe.vertexAlphas!==Pe)&&(Fe=!0):(Fe=!0,Oe.__version=de.version);let qe=Oe.currentProgram;Fe===!0&&(qe=Q(de,pe,ye));let Rt=!1,Gt=!1,is=!1;const ut=qe.getUniforms(),rs=Oe.uniforms;if(j.useProgram(qe.program)&&(Rt=!0,Gt=!0,is=!0),de.id!==S&&(S=de.id,Gt=!0),Rt||T!==Z){if(ut.setValue(ie,"projectionMatrix",Z.projectionMatrix),X.logarithmicDepthBuffer&&ut.setValue(ie,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),T!==Z&&(T=Z,Gt=!0,is=!0),de.isShaderMaterial||de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshStandardMaterial||de.envMap){const qt=ut.map.cameraPosition;qt!==void 0&&qt.setValue(ie,J.setFromMatrixPosition(Z.matrixWorld))}(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&ut.setValue(ie,"isOrthographic",Z.isOrthographicCamera===!0),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial||de.isShadowMaterial||ye.isSkinnedMesh)&&ut.setValue(ie,"viewMatrix",Z.matrixWorldInverse)}if(ye.isSkinnedMesh){ut.setOptional(ie,ye,"bindMatrix"),ut.setOptional(ie,ye,"bindMatrixInverse");const qt=ye.skeleton;qt&&(X.floatVertexTextures?(qt.boneTexture===null&&qt.computeBoneTexture(),ut.setValue(ie,"boneTexture",qt.boneTexture,H),ut.setValue(ie,"boneTextureSize",qt.boneTextureSize)):ut.setOptional(ie,qt,"boneMatrices"))}return(Gt||Oe.receiveShadow!==ye.receiveShadow)&&(Oe.receiveShadow=ye.receiveShadow,ut.setValue(ie,"receiveShadow",ye.receiveShadow)),Gt&&(ut.setValue(ie,"toneMappingExposure",d.toneMappingExposure),Oe.needsLights&&Be(rs,is),Me&&de.fog&&$.refreshFogUniforms(rs,Me),$.refreshMaterialUniforms(rs,de,O,E,k),ar.upload(ie,Oe.uniformsList,rs,H)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(ar.upload(ie,Oe.uniformsList,rs,H),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&ut.setValue(ie,"center",ye.center),ut.setValue(ie,"modelViewMatrix",ye.modelViewMatrix),ut.setValue(ie,"normalMatrix",ye.normalMatrix),ut.setValue(ie,"modelMatrix",ye.matrixWorld),qe}function Be(Z,pe){Z.ambientLightColor.needsUpdate=pe,Z.lightProbe.needsUpdate=pe,Z.directionalLights.needsUpdate=pe,Z.directionalLightShadows.needsUpdate=pe,Z.pointLights.needsUpdate=pe,Z.pointLightShadows.needsUpdate=pe,Z.spotLights.needsUpdate=pe,Z.spotLightShadows.needsUpdate=pe,Z.rectAreaLights.needsUpdate=pe,Z.hemisphereLights.needsUpdate=pe}function Ke(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return g},this.getRenderTarget=function(){return w},this.setRenderTarget=function(Z,pe=0,de=0){w=Z,v=pe,g=de,Z&&z.get(Z).__webglFramebuffer===void 0&&H.setupRenderTarget(Z);let ye=null,Me=!1,fe=!1;if(Z){const _e=Z.texture;(_e.isDataTexture3D||_e.isDataTexture2DArray)&&(fe=!0);const Pe=z.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(ye=Pe[pe],Me=!0):Z.isWebGLMultisampleRenderTarget?ye=z.get(Z).__webglMultisampledFramebuffer:ye=Pe,M.copy(Z.viewport),C.copy(Z.scissor),_=Z.scissorTest}else M.copy(R).multiplyScalar(O).floor(),C.copy(N).multiplyScalar(O).floor(),_=x;if(j.bindFramebuffer(36160,ye)&&X.drawBuffers){let _e=!1;if(Z)if(Z.isWebGLMultipleRenderTargets){const Pe=Z.texture;if(I.length!==Pe.length||I[0]!==36064){for(let Oe=0,Ue=Pe.length;Oe<Ue;Oe++)I[Oe]=36064+Oe;I.length=Pe.length,_e=!0}}else(I.length!==1||I[0]!==36064)&&(I[0]=36064,I.length=1,_e=!0);else(I.length!==1||I[0]!==1029)&&(I[0]=1029,I.length=1,_e=!0);_e&&(X.isWebGL2?ie.drawBuffers(I):W.get("WEBGL_draw_buffers").drawBuffersWEBGL(I))}if(j.viewport(M),j.scissor(C),j.setScissorTest(_),Me){const _e=z.get(Z.texture);ie.framebufferTexture2D(36160,36064,34069+pe,_e.__webglTexture,de)}else if(fe){const _e=z.get(Z.texture),Pe=pe||0;ie.framebufferTextureLayer(36160,36064,_e.__webglTexture,de||0,Pe)}},this.readRenderTargetPixels=function(Z,pe,de,ye,Me,fe,xe){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let _e=z.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&xe!==void 0&&(_e=_e[xe]),_e){j.bindFramebuffer(36160,_e);try{const Pe=Z.texture,Oe=Pe.format,Ue=Pe.type;if(Oe!==hn&&he.convert(Oe)!==ie.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Fe=Ue===Cr&&(W.has("EXT_color_buffer_half_float")||X.isWebGL2&&W.has("EXT_color_buffer_float"));if(Ue!==Ar&&he.convert(Ue)!==ie.getParameter(35738)&&!(Ue===vi&&(X.isWebGL2||W.has("OES_texture_float")||W.has("WEBGL_color_buffer_float")))&&!Fe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie.checkFramebufferStatus(36160)===36053?pe>=0&&pe<=Z.width-ye&&de>=0&&de<=Z.height-Me&&ie.readPixels(pe,de,ye,Me,he.convert(Oe),he.convert(Ue),fe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Pe=w!==null?z.get(w).__webglFramebuffer:null;j.bindFramebuffer(36160,Pe)}}},this.copyFramebufferToTexture=function(Z,pe,de=0){const ye=Math.pow(2,-de),Me=Math.floor(pe.image.width*ye),fe=Math.floor(pe.image.height*ye);let xe=he.convert(pe.format);X.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),H.setTexture2D(pe,0),ie.copyTexImage2D(3553,de,xe,Z.x,Z.y,Me,fe,0),j.unbindTexture()},this.copyTextureToTexture=function(Z,pe,de,ye=0){const Me=pe.image.width,fe=pe.image.height,xe=he.convert(de.format),_e=he.convert(de.type);H.setTexture2D(de,0),ie.pixelStorei(37440,de.flipY),ie.pixelStorei(37441,de.premultiplyAlpha),ie.pixelStorei(3317,de.unpackAlignment),pe.isDataTexture?ie.texSubImage2D(3553,ye,Z.x,Z.y,Me,fe,xe,_e,pe.image.data):pe.isCompressedTexture?ie.compressedTexSubImage2D(3553,ye,Z.x,Z.y,pe.mipmaps[0].width,pe.mipmaps[0].height,xe,pe.mipmaps[0].data):ie.texSubImage2D(3553,ye,Z.x,Z.y,xe,_e,pe.image),ye===0&&de.generateMipmaps&&ie.generateMipmap(3553),j.unbindTexture()},this.copyTextureToTexture3D=function(Z,pe,de,ye,Me=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const fe=Z.max.x-Z.min.x+1,xe=Z.max.y-Z.min.y+1,_e=Z.max.z-Z.min.z+1,Pe=he.convert(ye.format),Oe=he.convert(ye.type);let Ue;if(ye.isDataTexture3D)H.setTexture3D(ye,0),Ue=32879;else if(ye.isDataTexture2DArray)H.setTexture2DArray(ye,0),Ue=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ie.pixelStorei(37440,ye.flipY),ie.pixelStorei(37441,ye.premultiplyAlpha),ie.pixelStorei(3317,ye.unpackAlignment);const Fe=ie.getParameter(3314),qe=ie.getParameter(32878),Rt=ie.getParameter(3316),Gt=ie.getParameter(3315),is=ie.getParameter(32877),ut=de.isCompressedTexture?de.mipmaps[0]:de.image;ie.pixelStorei(3314,ut.width),ie.pixelStorei(32878,ut.height),ie.pixelStorei(3316,Z.min.x),ie.pixelStorei(3315,Z.min.y),ie.pixelStorei(32877,Z.min.z),de.isDataTexture||de.isDataTexture3D?ie.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,_e,Pe,Oe,ut.data):de.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ie.compressedTexSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,_e,Pe,ut.data)):ie.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,_e,Pe,Oe,ut),ie.pixelStorei(3314,Fe),ie.pixelStorei(32878,qe),ie.pixelStorei(3316,Rt),ie.pixelStorei(3315,Gt),ie.pixelStorei(32877,is),Me===0&&ye.generateMipmaps&&ie.generateMipmap(Ue),j.unbindTexture()},this.initTexture=function(Z){H.setTexture2D(Z,0),j.unbindTexture()},this.resetState=function(){v=0,g=0,w=null,j.reset(),ge.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class ev extends rt{}ev.prototype.isWebGL1Renderer=!0;class sa{constructor(e,t=25e-5){this.name="",this.color=new Re(e),this.density=t}clone(){return new sa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}sa.prototype.isFogExp2=!0;class oa{constructor(e,t=1,i=1e3){this.name="",this.color=new Re(e),this.near=t,this.far=i}clone(){return new oa(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}oa.prototype.isFog=!0;class nc extends Ze{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}nc.prototype.isScene=!0;class lr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Rs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}lr.prototype.isInterleavedBuffer=!0;const Et=new q;class Ci{constructor(e,t,i,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Et.x=this.getX(t),Et.y=this.getY(t),Et.z=this.getZ(t),Et.applyMatrix4(e),this.setXYZ(t,Et.x,Et.y,Et.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Et.x=this.getX(t),Et.y=this.getY(t),Et.z=this.getZ(t),Et.applyNormalMatrix(e),this.setXYZ(t,Et.x,Et.y,Et.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Et.x=this.getX(t),Et.y=this.getY(t),Et.z=this.getZ(t),Et.transformDirection(e),this.setXYZ(t,Et.x,Et.y,Et.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new je(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ci(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Ci.prototype.isInterleavedBufferAttribute=!0;class aa extends Pt{constructor(e){super(),this.type="SpriteMaterial",this.color=new Re(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}aa.prototype.isSpriteMaterial=!0;let Xs;const la=new q,Ys=new q,Js=new q,Ks=new Se,ca=new Se,tv=new Ne,ic=new q,ua=new q,rc=new q,nv=new Se,ah=new Se,iv=new Se;class da extends Ze{constructor(e){if(super(),this.type="Sprite",Xs===void 0){Xs=new ke;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new lr(t,5);Xs.setIndex([0,1,2,0,2,3]),Xs.setAttribute("position",new Ci(i,3,0,!1)),Xs.setAttribute("uv",new Ci(i,2,3,!1))}this.geometry=Xs,this.material=e!==void 0?e:new aa,this.center=new Se(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ys.setFromMatrixScale(this.matrixWorld),tv.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Js.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ys.multiplyScalar(-Js.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;sc(ic.set(-.5,-.5,0),Js,o,Ys,r,s),sc(ua.set(.5,-.5,0),Js,o,Ys,r,s),sc(rc.set(.5,.5,0),Js,o,Ys,r,s),nv.set(0,0),ah.set(1,0),iv.set(1,1);let l=e.ray.intersectTriangle(ic,ua,rc,!1,la);if(l===null&&(sc(ua.set(-.5,.5,0),Js,o,Ys,r,s),ah.set(0,1),l=e.ray.intersectTriangle(ic,rc,ua,!1,la),l===null))return;const u=e.ray.origin.distanceTo(la);u<e.near||u>e.far||t.push({distance:u,point:la.clone(),uv:_t.getUV(la,ic,ua,rc,nv,ah,iv,new Se),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}da.prototype.isSprite=!0;function sc(n,e,t,i,r,s){Ks.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(ca.x=s*Ks.x-r*Ks.y,ca.y=r*Ks.x+s*Ks.y):ca.copy(Ks),n.copy(e),n.x+=ca.x,n.y+=ca.y,n.applyMatrix4(tv)}const oc=new q,rv=new q;class sv extends Ze{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){oc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(oc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){oc.setFromMatrixPosition(e.matrixWorld),rv.setFromMatrixPosition(this.matrixWorld);const i=oc.distanceTo(rv)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s&&i>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const ov=new q,av=new it,lv=new it,D3=new q,cv=new Ne;class ha extends Tt{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ne,this.bindMatrixInverse=new Ne}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new it,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;av.fromBufferAttribute(r.attributes.skinIndex,e),lv.fromBufferAttribute(r.attributes.skinWeight,e),ov.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=lv.getComponent(s);if(o!==0){const l=av.getComponent(s);cv.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(D3.copy(ov).applyMatrix4(cv),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}ha.prototype.isSkinnedMesh=!0;class fa extends Ze{constructor(){super(),this.type="Bone"}}fa.prototype.isBone=!0;class zr extends St{constructor(e=null,t=1,i=1,r,s,o,l,u,c=Mt,f=Mt,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={data:e,width:t,height:i},this.magFilter=c,this.minFilter=f,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}zr.prototype.isDataTexture=!0;const uv=new Ne,B3=new Ne;class pa{constructor(e=[],t=[]){this.uuid=fn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Ne)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Ne;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:B3;uv.multiplyMatrices(l,t[s]),uv.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new pa(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=sy(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new zr(t,e,e,hn,vi);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new fa),this.bones.push(o),this.boneInverses.push(new Ne().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const l=i[r];e.boneInverses.push(l.toArray())}return e}}const dv=new Ne,hv=new Ne,ac=[],ma=new Tt;class lh extends Tt{constructor(e,t,i){super(e,t),this.instanceMatrix=new je(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(ma.geometry=this.geometry,ma.material=this.material,ma.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,dv),hv.multiplyMatrices(i,dv),ma.matrixWorld=hv,ma.raycast(e,ac);for(let o=0,l=ac.length;o<l;o++){const u=ac[o];u.instanceId=s,u.object=this,t.push(u)}ac.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new je(new Float32Array(this.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}lh.prototype.isInstancedMesh=!0;class Ft extends Pt{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Re(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Ft.prototype.isLineBasicMaterial=!0;const fv=new q,pv=new q,mv=new Ne,ch=new nr,lc=new wi;class Kn extends Ze{constructor(e=new ke,t=new Ft){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)fv.fromBufferAttribute(t,r-1),pv.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=fv.distanceTo(pv);e.setAttribute("lineDistance",new Ie(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),lc.copy(i.boundingSphere),lc.applyMatrix4(r),lc.radius+=s,e.ray.intersectsSphere(lc)===!1)return;mv.copy(r).invert(),ch.copy(e.ray).applyMatrix4(mv);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,c=new q,f=new q,h=new q,p=new q,y=this.isLineSegments?2:1;if(i.isBufferGeometry){const m=i.index,b=i.attributes.position;if(m!==null){const v=Math.max(0,o.start),g=Math.min(m.count,o.start+o.count);for(let w=v,S=g-1;w<S;w+=y){const T=m.getX(w),M=m.getX(w+1);if(c.fromBufferAttribute(b,T),f.fromBufferAttribute(b,M),ch.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const _=e.ray.origin.distanceTo(p);_<e.near||_>e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,o.start),g=Math.min(b.count,o.start+o.count);for(let w=v,S=g-1;w<S;w+=y){if(c.fromBufferAttribute(b,w),f.fromBufferAttribute(b,w+1),ch.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);M<e.near||M>e.far||t.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Kn.prototype.isLine=!0;const gv=new q,yv=new q;class rn extends Kn{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)gv.fromBufferAttribute(t,r),yv.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+gv.distanceTo(yv);e.setAttribute("lineDistance",new Ie(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}rn.prototype.isLineSegments=!0;class cc extends Kn{constructor(e,t){super(e,t),this.type="LineLoop"}}cc.prototype.isLineLoop=!0;class cr extends Pt{constructor(e){super(),this.type="PointsMaterial",this.color=new Re(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}cr.prototype.isPointsMaterial=!0;const vv=new Ne,uh=new nr,uc=new wi,dc=new q;class qs extends Ze{constructor(e=new ke,t=new cr){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),uc.copy(i.boundingSphere),uc.applyMatrix4(r),uc.radius+=s,e.ray.intersectsSphere(uc)===!1)return;vv.copy(r).invert(),uh.copy(e.ray).applyMatrix4(vv);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l;if(i.isBufferGeometry){const c=i.index,h=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),y=Math.min(c.count,o.start+o.count);for(let m=p,d=y;m<d;m++){const b=c.getX(m);dc.fromBufferAttribute(h,b),bv(dc,b,u,r,e,t,this)}}else{const p=Math.max(0,o.start),y=Math.min(h.count,o.start+o.count);for(let m=p,d=y;m<d;m++)dc.fromBufferAttribute(h,m),bv(dc,m,u,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}qs.prototype.isPoints=!0;function bv(n,e,t,i,r,s,o){const l=uh.distanceSqToPoint(n);if(l<t){const u=new q;uh.closestPointToPoint(n,u),u.applyMatrix4(i);const c=r.ray.origin.distanceTo(u);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class xv extends St{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:bi,this.minFilter=o!==void 0?o:gt,this.magFilter=s!==void 0?s:gt,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}xv.prototype.isVideoTexture=!0;class dh extends St{constructor(e,t,i,r,s,o,l,u,c,f,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}dh.prototype.isCompressedTexture=!0;class wv extends St{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}wv.prototype.isCanvasTexture=!0;class Mv extends St{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Rr,f!==Rr&&f!==As)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Rr&&(i=$o),i===void 0&&f===As&&(i=Es),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:Mt,this.minFilter=u!==void 0?u:Mt,this.flipY=!1,this.generateMipmaps=!1}}Mv.prototype.isDepthTexture=!0;class Qs extends ke{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new q,f=new Se;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let h=0,p=3;h<=t;h++,p+=3){const y=i+h/t*r;c.x=e*Math.cos(y),c.y=e*Math.sin(y),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Ie(o,3)),this.setAttribute("normal",new Ie(l,3)),this.setAttribute("uv",new Ie(u,2))}static fromJSON(e){return new Qs(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class ur extends ke{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],h=[],p=[],y=[];let m=0;const d=[],b=i/2;let v=0;g(),o===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(f),this.setAttribute("position",new Ie(h,3)),this.setAttribute("normal",new Ie(p,3)),this.setAttribute("uv",new Ie(y,2));function g(){const S=new q,T=new q;let M=0;const C=(t-e)/i;for(let _=0;_<=s;_++){const P=[],E=_/s,O=E*(t-e)+e;for(let A=0;A<=r;A++){const L=A/r,R=L*u+l,N=Math.sin(R),x=Math.cos(R);T.x=O*N,T.y=-E*i+b,T.z=O*x,h.push(T.x,T.y,T.z),S.set(N,C,x).normalize(),p.push(S.x,S.y,S.z),y.push(L,1-E),P.push(m++)}d.push(P)}for(let _=0;_<r;_++)for(let P=0;P<s;P++){const E=d[P][_],O=d[P+1][_],A=d[P+1][_+1],L=d[P][_+1];f.push(E,O,L),f.push(O,A,L),M+=6}c.addGroup(v,M,0),v+=M}function w(S){const T=m,M=new Se,C=new q;let _=0;const P=S===!0?e:t,E=S===!0?1:-1;for(let A=1;A<=r;A++)h.push(0,b*E,0),p.push(0,E,0),y.push(.5,.5),m++;const O=m;for(let A=0;A<=r;A++){const R=A/r*u+l,N=Math.cos(R),x=Math.sin(R);C.x=P*x,C.y=b*E,C.z=P*N,h.push(C.x,C.y,C.z),p.push(0,E,0),M.x=N*.5+.5,M.y=x*.5*E+.5,y.push(M.x,M.y),m++}for(let A=0;A<r;A++){const L=T+A,R=O+A;S===!0?f.push(R,R+1,L):f.push(R+1,R,L),_+=3}c.addGroup(v,_,S===!0?1:2),v+=_}}static fromJSON(e){return new ur(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class eo extends ur{constructor(e=1,t=1,i=8,r=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,s,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new eo(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class qn extends ke{constructor(e,t,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];l(r),c(i),f(),this.setAttribute("position",new Ie(s,3)),this.setAttribute("normal",new Ie(s.slice(),3)),this.setAttribute("uv",new Ie(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(g){const w=new q,S=new q,T=new q;for(let M=0;M<t.length;M+=3)y(t[M+0],w),y(t[M+1],S),y(t[M+2],T),u(w,S,T,g)}function u(g,w,S,T){const M=T+1,C=[];for(let _=0;_<=M;_++){C[_]=[];const P=g.clone().lerp(S,_/M),E=w.clone().lerp(S,_/M),O=M-_;for(let A=0;A<=O;A++)A===0&&_===M?C[_][A]=P:C[_][A]=P.clone().lerp(E,A/O)}for(let _=0;_<M;_++)for(let P=0;P<2*(M-_)-1;P++){const E=Math.floor(P/2);P%2===0?(p(C[_][E+1]),p(C[_+1][E]),p(C[_][E])):(p(C[_][E+1]),p(C[_+1][E+1]),p(C[_+1][E]))}}function c(g){const w=new q;for(let S=0;S<s.length;S+=3)w.x=s[S+0],w.y=s[S+1],w.z=s[S+2],w.normalize().multiplyScalar(g),s[S+0]=w.x,s[S+1]=w.y,s[S+2]=w.z}function f(){const g=new q;for(let w=0;w<s.length;w+=3){g.x=s[w+0],g.y=s[w+1],g.z=s[w+2];const S=b(g)/2/Math.PI+.5,T=v(g)/Math.PI+.5;o.push(S,1-T)}m(),h()}function h(){for(let g=0;g<o.length;g+=6){const w=o[g+0],S=o[g+2],T=o[g+4],M=Math.max(w,S,T),C=Math.min(w,S,T);M>.9&&C<.1&&(w<.2&&(o[g+0]+=1),S<.2&&(o[g+2]+=1),T<.2&&(o[g+4]+=1))}}function p(g){s.push(g.x,g.y,g.z)}function y(g,w){const S=g*3;w.x=e[S+0],w.y=e[S+1],w.z=e[S+2]}function m(){const g=new q,w=new q,S=new q,T=new q,M=new Se,C=new Se,_=new Se;for(let P=0,E=0;P<s.length;P+=9,E+=6){g.set(s[P+0],s[P+1],s[P+2]),w.set(s[P+3],s[P+4],s[P+5]),S.set(s[P+6],s[P+7],s[P+8]),M.set(o[E+0],o[E+1]),C.set(o[E+2],o[E+3]),_.set(o[E+4],o[E+5]),T.copy(g).add(w).add(S).divideScalar(3);const O=b(T);d(M,E+0,g,O),d(C,E+2,w,O),d(_,E+4,S,O)}}function d(g,w,S,T){T<0&&g.x===1&&(o[w]=g.x-1),S.x===0&&S.z===0&&(o[w]=T/2/Math.PI+.5)}function b(g){return Math.atan2(g.z,-g.x)}function v(g){return Math.atan2(-g.y,Math.sqrt(g.x*g.x+g.z*g.z))}}static fromJSON(e){return new qn(e.vertices,e.indices,e.radius,e.details)}}class to extends qn{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new to(e.radius,e.detail)}}const hc=new q,fc=new q,hh=new q,pc=new _t;class fh extends ke{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0){console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const r=Math.pow(10,4),s=Math.cos(Nr*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,c=[0,0,0],f=["a","b","c"],h=new Array(3),p={},y=[];for(let m=0;m<u;m+=3){o?(c[0]=o.getX(m),c[1]=o.getX(m+1),c[2]=o.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:d,b,c:v}=pc;if(d.fromBufferAttribute(l,c[0]),b.fromBufferAttribute(l,c[1]),v.fromBufferAttribute(l,c[2]),pc.getNormal(hh),h[0]=`${Math.round(d.x*r)},${Math.round(d.y*r)},${Math.round(d.z*r)}`,h[1]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,h[2]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let g=0;g<3;g++){const w=(g+1)%3,S=h[g],T=h[w],M=pc[f[g]],C=pc[f[w]],_=`${S}_${T}`,P=`${T}_${S}`;P in p&&p[P]?(hh.dot(p[P].normal)<=s&&(y.push(M.x,M.y,M.z),y.push(C.x,C.y,C.z)),p[P]=null):_ in p||(p[_]={index0:c[g],index1:c[w],normal:hh.clone()})}}for(const m in p)if(p[m]){const{index0:d,index1:b}=p[m];hc.fromBufferAttribute(l,d),fc.fromBufferAttribute(l,b),y.push(hc.x,hc.y,hc.z),y.push(fc.x,fc.y,fc.z)}this.setAttribute("position",new Ie(y,3))}}class gn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let l=0,u=s-1,c;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),c=i[r]-o,c<0)l=r+1;else if(c>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,y=(o-f)/p;return(r+y)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new Se:new q);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new q,r=[],s=[],o=[],l=new q,u=new Ne;for(let y=0;y<=e;y++){const m=y/e;r[y]=this.getTangentAt(m,new q),r[y].normalize()}s[0]=new q,o[0]=new q;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let y=1;y<=e;y++){if(s[y]=s[y-1].clone(),o[y]=o[y-1].clone(),l.crossVectors(r[y-1],r[y]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos(jt(r[y-1].dot(r[y]),-1,1));s[y].applyMatrix4(u.makeRotationAxis(l,m))}o[y].crossVectors(r[y],s[y])}if(t===!0){let y=Math.acos(jt(s[0].dot(s[e]),-1,1));y/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(y=-y);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],y*m)),o[m].crossVectors(r[m],s[m])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ga extends gn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new Se,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),c=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const f=Math.cos(this.aRotation),h=Math.sin(this.aRotation),p=u-this.aX,y=c-this.aY;u=p*f-y*h+this.aX,c=p*h+y*f+this.aY}return i.set(u,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}ga.prototype.isEllipseCurve=!0;class ph extends ga{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.type="ArcCurve"}}ph.prototype.isArcCurve=!0;function mh(){let n=0,e=0,t=0,i=0;function r(s,o,l,u){n=s,e=l,t=-3*s+3*o-2*l-u,i=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,c){r(o,l,c*(l-s),c*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,c,f,h){let p=(o-s)/c-(l-s)/(c+f)+(l-o)/f,y=(l-o)/f-(u-o)/(f+h)+(u-l)/h;p*=f,y*=f,r(o,l,p,y)},calc:function(s){const o=s*s,l=o*s;return n+e*s+t*o+i*l}}}const mc=new q,gh=new mh,yh=new mh,vh=new mh;class bh extends gn{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new q){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(mc.subVectors(r[0],r[1]).add(r[0]),c=mc);const h=r[l%s],p=r[(l+1)%s];if(this.closed||l+2<s?f=r[(l+2)%s]:(mc.subVectors(r[s-1],r[s-2]).add(r[s-1]),f=mc),this.curveType==="centripetal"||this.curveType==="chordal"){const y=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(h),y),d=Math.pow(h.distanceToSquared(p),y),b=Math.pow(p.distanceToSquared(f),y);d<1e-4&&(d=1),m<1e-4&&(m=d),b<1e-4&&(b=d),gh.initNonuniformCatmullRom(c.x,h.x,p.x,f.x,m,d,b),yh.initNonuniformCatmullRom(c.y,h.y,p.y,f.y,m,d,b),vh.initNonuniformCatmullRom(c.z,h.z,p.z,f.z,m,d,b)}else this.curveType==="catmullrom"&&(gh.initCatmullRom(c.x,h.x,p.x,f.x,this.tension),yh.initCatmullRom(c.y,h.y,p.y,f.y,this.tension),vh.initCatmullRom(c.z,h.z,p.z,f.z,this.tension));return i.set(gh.calc(u),yh.calc(u),vh.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new q().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}bh.prototype.isCatmullRomCurve3=!0;function Sv(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,l=n*n,u=n*l;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*l+s*n+t}function F3(n,e){const t=1-n;return t*t*e}function V3(n,e){return 2*(1-n)*n*e}function k3(n,e){return n*n*e}function ya(n,e,t,i){return F3(n,e)+V3(n,t)+k3(n,i)}function z3(n,e){const t=1-n;return t*t*t*e}function U3(n,e){const t=1-n;return 3*t*t*n*e}function G3(n,e){return 3*(1-n)*n*n*e}function H3(n,e){return n*n*n*e}function va(n,e,t,i,r){return z3(n,e)+U3(n,t)+G3(n,i)+H3(n,r)}class gc extends gn{constructor(e=new Se,t=new Se,i=new Se,r=new Se){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Se){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(va(e,r.x,s.x,o.x,l.x),va(e,r.y,s.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}gc.prototype.isCubicBezierCurve=!0;class xh extends gn{constructor(e=new q,t=new q,i=new q,r=new q){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new q){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(va(e,r.x,s.x,o.x,l.x),va(e,r.y,s.y,o.y,l.y),va(e,r.z,s.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}xh.prototype.isCubicBezierCurve3=!0;class ba extends gn{constructor(e=new Se,t=new Se){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Se){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new Se;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}ba.prototype.isLineCurve=!0;class _v extends gn{constructor(e=new q,t=new q){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new q){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class yc extends gn{constructor(e=new Se,t=new Se,i=new Se){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Se){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(ya(e,r.x,s.x,o.x),ya(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}yc.prototype.isQuadraticBezierCurve=!0;class wh extends gn{constructor(e=new q,t=new q,i=new q){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new q){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(ya(e,r.x,s.x,o.x),ya(e,r.y,s.y,o.y),ya(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}wh.prototype.isQuadraticBezierCurve3=!0;class vc extends gn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Se){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),l=s-o,u=r[o===0?o:o-1],c=r[o],f=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(Sv(l,u.x,c.x,f.x,h.x),Sv(l,u.y,c.y,f.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Se().fromArray(r))}return this}}vc.prototype.isSplineCurve=!0;var Mh=Object.freeze({__proto__:null,ArcCurve:ph,CatmullRomCurve3:bh,CubicBezierCurve:gc,CubicBezierCurve3:xh,EllipseCurve:ga,LineCurve:ba,LineCurve3:_v,QuadraticBezierCurve:yc,QuadraticBezierCurve3:wh,SplineCurve:vc});const W3={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=Tv(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,c,f,h,p,y;if(i&&(s=Y3(n,e,s,t)),n.length>80*t){l=c=n[0],u=f=n[1];for(let m=t;m<r;m+=t)h=n[m],p=n[m+1],h<l&&(l=h),p<u&&(u=p),h>c&&(c=h),p>f&&(f=p);y=Math.max(c-l,f-u),y=y!==0?1/y:0}return xa(s,o,t,l,u,y),o}};function Tv(n,e,t,i,r){let s,o;if(r===oN(n,e,t,i)>0)for(s=e;s<t;s+=i)o=Cv(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=Cv(s,n[s],n[s+1],o);return o&&bc(o,o.next)&&(Ma(o),o=o.next),o}function dr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(bc(t,t.next)||ft(t.prev,t,t.next)===0)){if(Ma(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function xa(n,e,t,i,r,s,o){if(!n)return;!o&&s&&eN(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?$3(n,i,r,s):j3(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Ma(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=Z3(dr(n),e,t),xa(n,e,t,i,r,s,2)):o===2&&X3(n,e,t,i,r,s):xa(dr(n),e,t,i,r,s,1);break}}}function j3(n){const e=n.prev,t=n,i=n.next;if(ft(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(no(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&ft(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function $3(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ft(r,s,o)>=0)return!1;const l=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,u=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,h=Sh(l,u,e,t,i),p=Sh(c,f,e,t,i);let y=n.prevZ,m=n.nextZ;for(;y&&y.z>=h&&m&&m.z<=p;){if(y!==n.prev&&y!==n.next&&no(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&ft(y.prev,y,y.next)>=0||(y=y.prevZ,m!==n.prev&&m!==n.next&&no(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;y&&y.z>=h;){if(y!==n.prev&&y!==n.next&&no(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&ft(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&no(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Z3(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!bc(r,s)&&Ev(r,i,i.next,s)&&wa(r,s)&&wa(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Ma(i),Ma(i.next),i=n=s),i=i.next}while(i!==n);return dr(i)}function X3(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&iN(o,l)){let u=Av(o,l);o=dr(o,o.next),u=dr(u,u.next),xa(o,e,t,i,r,s),xa(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function Y3(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s<o;s++)l=e[s]*i,u=s<o-1?e[s+1]*i:n.length,c=Tv(n,l,u,i,!1),c===c.next&&(c.steiner=!0),r.push(nN(c));for(r.sort(J3),s=0;s<r.length;s++)K3(r[s],t),t=dr(t,t.next);return t}function J3(n,e){return n.x-e.x}function K3(n,e){if(e=q3(n,e),e){const t=Av(e,n);dr(e,e.next),dr(t,t.next)}}function q3(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===s)return o;const l=o,u=o.x,c=o.y;let f=1/0,h;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&no(r<c?i:s,r,u,c,r<c?s:i,r,t.x,t.y)&&(h=Math.abs(r-t.y)/(i-t.x),wa(t,n)&&(h<f||h===f&&(t.x>o.x||t.x===o.x&&Q3(o,t)))&&(o=t,f=h)),t=t.next;while(t!==l);return o}function Q3(n,e){return ft(n.prev,n,e.prev)<0&&ft(e.next,n,n.next)<0}function eN(n,e,t,i){let r=n;do r.z===null&&(r.z=Sh(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,tN(r)}function tN(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e<c&&(l++,i=i.nextZ,!!i);e++);for(u=c;l>0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Sh(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function nN(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function no(n,e,t,i,r,s,o,l){return(r-o)*(e-l)-(n-o)*(s-l)>=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function iN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!rN(n,e)&&(wa(n,e)&&wa(e,n)&&sN(n,e)&&(ft(n.prev,n,e.prev)||ft(n,e.prev,e))||bc(n,e)&&ft(n.prev,n,n.next)>0&&ft(e.prev,e,e.next)>0)}function ft(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function bc(n,e){return n.x===e.x&&n.y===e.y}function Ev(n,e,t,i){const r=wc(ft(n,e,t)),s=wc(ft(n,e,i)),o=wc(ft(t,i,n)),l=wc(ft(t,i,e));return!!(r!==s&&o!==l||r===0&&xc(n,t,e)||s===0&&xc(n,i,e)||o===0&&xc(t,n,i)||l===0&&xc(t,e,i))}function xc(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function wc(n){return n>0?1:n<0?-1:0}function rN(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&Ev(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function wa(n,e){return ft(n.prev,n,n.next)<0?ft(n,e,n.next)>=0&&ft(n,n.prev,e)>=0:ft(n,e,n.prev)<0||ft(n,n.next,e)<0}function sN(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Av(n,e){const t=new _h(n.i,n.x,n.y),i=new _h(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Cv(n,e,t,i){const r=new _h(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Ma(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function _h(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function oN(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class Qn{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return Qn.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];Rv(e),Lv(i,e);let o=e.length;t.forEach(Rv);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,Lv(i,t[u]);const l=W3.triangulate(i,r);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function Rv(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Lv(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Bn extends ke{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];o(c)}this.setAttribute("position",new Ie(r,3)),this.setAttribute("uv",new Ie(s,2)),this.computeVertexNormals();function o(l){const u=[],c=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1;let h=t.depth!==void 0?t.depth:100,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,y=t.bevelThickness!==void 0?t.bevelThickness:6,m=t.bevelSize!==void 0?t.bevelSize:y-2,d=t.bevelOffset!==void 0?t.bevelOffset:0,b=t.bevelSegments!==void 0?t.bevelSegments:3;const v=t.extrudePath,g=t.UVGenerator!==void 0?t.UVGenerator:aN;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=t.amount);let w,S=!1,T,M,C,_;v&&(w=v.getSpacedPoints(f),S=!0,p=!1,T=v.computeFrenetFrames(f,!1),M=new q,C=new q,_=new q),p||(b=0,y=0,m=0,d=0);const P=l.extractPoints(c);let E=P.shape;const O=P.holes;if(!Qn.isClockWise(E)){E=E.reverse();for(let z=0,H=O.length;z<H;z++){const K=O[z];Qn.isClockWise(K)&&(O[z]=K.reverse())}}const L=Qn.triangulateShape(E,O),R=E;for(let z=0,H=O.length;z<H;z++){const K=O[z];E=E.concat(K)}function N(z,H,K){return H||console.error("THREE.ExtrudeGeometry: vec does not exist"),H.clone().multiplyScalar(K).add(z)}const x=E.length,I=L.length;function B(z,H,K){let le,se,U;const D=z.x-H.x,$=z.y-H.y,Y=K.x-z.x,ee=K.y-z.y,ce=D*D+$*$,ve=D*ee-$*Y;if(Math.abs(ve)>Number.EPSILON){const be=Math.sqrt(ce),ue=Math.sqrt(Y*Y+ee*ee),me=H.x-$/be,te=H.y+D/be,he=K.x-ee/ue,ge=K.y+Y/ue,Ae=((he-me)*ee-(ge-te)*Y)/(D*ee-$*Y);le=me+D*Ae-z.x,se=te+$*Ae-z.y;const Te=le*le+se*se;if(Te<=2)return new Se(le,se);U=Math.sqrt(Te/2)}else{let be=!1;D>Number.EPSILON?Y>Number.EPSILON&&(be=!0):D<-Number.EPSILON?Y<-Number.EPSILON&&(be=!0):Math.sign($)===Math.sign(ee)&&(be=!0),be?(le=-$,se=D,U=Math.sqrt(ce)):(le=D,se=$,U=Math.sqrt(ce/2))}return new Se(le/U,se/U)}const F=[];for(let z=0,H=R.length,K=H-1,le=z+1;z<H;z++,K++,le++)K===H&&(K=0),le===H&&(le=0),F[z]=B(R[z],R[K],R[le]);const V=[];let k,G=F.concat();for(let z=0,H=O.length;z<H;z++){const K=O[z];k=[];for(let le=0,se=K.length,U=se-1,D=le+1;le<se;le++,U++,D++)U===se&&(U=0),D===se&&(D=0),k[le]=B(K[le],K[U],K[D]);V.push(k),G=G.concat(k)}for(let z=0;z<b;z++){const H=z/b,K=y*Math.cos(H*Math.PI/2),le=m*Math.sin(H*Math.PI/2)+d;for(let se=0,U=R.length;se<U;se++){const D=N(R[se],F[se],le);oe(D.x,D.y,-K)}for(let se=0,U=O.length;se<U;se++){const D=O[se];k=V[se];for(let $=0,Y=D.length;$<Y;$++){const ee=N(D[$],k[$],le);oe(ee.x,ee.y,-K)}}}const J=m+d;for(let z=0;z<x;z++){const H=p?N(E[z],G[z],J):E[z];S?(C.copy(T.normals[0]).multiplyScalar(H.x),M.copy(T.binormals[0]).multiplyScalar(H.y),_.copy(w[0]).add(C).add(M),oe(_.x,_.y,_.z)):oe(H.x,H.y,0)}for(let z=1;z<=f;z++)for(let H=0;H<x;H++){const K=p?N(E[H],G[H],J):E[H];S?(C.copy(T.normals[z]).multiplyScalar(K.x),M.copy(T.binormals[z]).multiplyScalar(K.y),_.copy(w[z]).add(C).add(M),oe(_.x,_.y,_.z)):oe(K.x,K.y,h/f*z)}for(let z=b-1;z>=0;z--){const H=z/b,K=y*Math.cos(H*Math.PI/2),le=m*Math.sin(H*Math.PI/2)+d;for(let se=0,U=R.length;se<U;se++){const D=N(R[se],F[se],le);oe(D.x,D.y,h+K)}for(let se=0,U=O.length;se<U;se++){const D=O[se];k=V[se];for(let $=0,Y=D.length;$<Y;$++){const ee=N(D[$],k[$],le);S?oe(ee.x,ee.y+w[f-1].y,w[f-1].x+K):oe(ee.x,ee.y,h+K)}}}ne(),ae();function ne(){const z=r.length/3;if(p){let H=0,K=x*H;for(let le=0;le<I;le++){const se=L[le];W(se[2]+K,se[1]+K,se[0]+K)}H=f+b*2,K=x*H;for(let le=0;le<I;le++){const se=L[le];W(se[0]+K,se[1]+K,se[2]+K)}}else{for(let H=0;H<I;H++){const K=L[H];W(K[2],K[1],K[0])}for(let H=0;H<I;H++){const K=L[H];W(K[0]+x*f,K[1]+x*f,K[2]+x*f)}}i.addGroup(z,r.length/3-z,0)}function ae(){const z=r.length/3;let H=0;ie(R,H),H+=R.length;for(let K=0,le=O.length;K<le;K++){const se=O[K];ie(se,H),H+=se.length}i.addGroup(z,r.length/3-z,1)}function ie(z,H){let K=z.length;for(;--K>=0;){const le=K;let se=K-1;se<0&&(se=z.length-1);for(let U=0,D=f+b*2;U<D;U++){const $=x*U,Y=x*(U+1),ee=H+le+$,ce=H+se+$,ve=H+se+Y,be=H+le+Y;X(ee,ce,ve,be)}}}function oe(z,H,K){u.push(z),u.push(H),u.push(K)}function W(z,H,K){j(z),j(H),j(K);const le=r.length/3,se=g.generateTopUV(i,r,le-3,le-2,le-1);re(se[0]),re(se[1]),re(se[2])}function X(z,H,K,le){j(z),j(H),j(le),j(H),j(K),j(le);const se=r.length/3,U=g.generateSideWallUV(i,r,se-6,se-3,se-2,se-1);re(U[0]),re(U[1]),re(U[3]),re(U[1]),re(U[2]),re(U[3])}function j(z){r.push(u[z*3+0]),r.push(u[z*3+1]),r.push(u[z*3+2])}function re(z){s.push(z.x),s.push(z.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return lN(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];i.push(l)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Mh[r.type]().fromJSON(r)),new Bn(i,e.options)}}const aN={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],l=e[i*3],u=e[i*3+1],c=e[r*3],f=e[r*3+1];return[new Se(s,o),new Se(l,u),new Se(c,f)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],c=e[i*3],f=e[i*3+1],h=e[i*3+2],p=e[r*3],y=e[r*3+1],m=e[r*3+2],d=e[s*3],b=e[s*3+1],v=e[s*3+2];return Math.abs(l-f)<Math.abs(o-c)?[new Se(o,1-u),new Se(c,1-h),new Se(p,1-m),new Se(d,1-v)]:[new Se(l,1-u),new Se(f,1-h),new Se(y,1-m),new Se(b,1-v)]}};function lN(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class io extends qn{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new io(e.radius,e.detail)}}class ro extends ke{constructor(e,t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=jt(r,0,Math.PI*2);const s=[],o=[],l=[],u=1/t,c=new q,f=new Se;for(let h=0;h<=t;h++){const p=i+h*u*r,y=Math.sin(p),m=Math.cos(p);for(let d=0;d<=e.length-1;d++)c.x=e[d].x*y,c.y=e[d].y,c.z=e[d].x*m,o.push(c.x,c.y,c.z),f.x=h/t,f.y=d/(e.length-1),l.push(f.x,f.y)}for(let h=0;h<t;h++)for(let p=0;p<e.length-1;p++){const y=p+h*e.length,m=y,d=y+e.length,b=y+e.length+1,v=y+1;s.push(m,d,v),s.push(d,b,v)}if(this.setIndex(s),this.setAttribute("position",new Ie(o,3)),this.setAttribute("uv",new Ie(l,2)),this.computeVertexNormals(),r===Math.PI*2){const h=this.attributes.normal.array,p=new q,y=new q,m=new q,d=t*e.length*3;for(let b=0,v=0;b<e.length;b++,v+=3)p.x=h[v+0],p.y=h[v+1],p.z=h[v+2],y.x=h[d+v+0],y.y=h[d+v+1],y.z=h[d+v+2],m.addVectors(p,y).normalize(),h[v+0]=h[d+v+0]=m.x,h[v+1]=h[d+v+1]=m.y,h[v+2]=h[d+v+2]=m.z}}static fromJSON(e){return new ro(e.points,e.segments,e.phiStart,e.phiLength)}}class Ur extends qn{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Ur(e.radius,e.detail)}}class Mc extends ke{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};const r=[],s=[],o=[],l=[],u=1e-5,c=new q,f=new q,h=new q,p=new q,y=new q;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const m=t+1;for(let d=0;d<=i;d++){const b=d/i;for(let v=0;v<=t;v++){const g=v/t;e(g,b,f),s.push(f.x,f.y,f.z),g-u>=0?(e(g-u,b,h),p.subVectors(f,h)):(e(g+u,b,h),p.subVectors(h,f)),b-u>=0?(e(g,b-u,h),y.subVectors(f,h)):(e(g,b+u,h),y.subVectors(h,f)),c.crossVectors(p,y).normalize(),o.push(c.x,c.y,c.z),l.push(g,b)}}for(let d=0;d<i;d++)for(let b=0;b<t;b++){const v=d*m+b,g=d*m+b+1,w=(d+1)*m+b+1,S=(d+1)*m+b;r.push(v,g,S),r.push(g,w,S)}this.setIndex(r),this.setAttribute("position",new Ie(s,3)),this.setAttribute("normal",new Ie(o,3)),this.setAttribute("uv",new Ie(l,2))}}class so extends ke{constructor(e=.5,t=1,i=8,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const l=[],u=[],c=[],f=[];let h=e;const p=(t-e)/r,y=new q,m=new Se;for(let d=0;d<=r;d++){for(let b=0;b<=i;b++){const v=s+b/i*o;y.x=h*Math.cos(v),y.y=h*Math.sin(v),u.push(y.x,y.y,y.z),c.push(0,0,1),m.x=(y.x/t+1)/2,m.y=(y.y/t+1)/2,f.push(m.x,m.y)}h+=p}for(let d=0;d<r;d++){const b=d*(i+1);for(let v=0;v<i;v++){const g=v+b,w=g,S=g+i+1,T=g+i+2,M=g+1;l.push(w,S,M),l.push(S,T,M)}}this.setIndex(l),this.setAttribute("position",new Ie(u,3)),this.setAttribute("normal",new Ie(c,3)),this.setAttribute("uv",new Ie(f,2))}static fromJSON(e){return new so(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Gr extends ke{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)c(e);else for(let f=0;f<e.length;f++)c(e[f]),this.addGroup(l,u,f),l+=u,u=0;this.setIndex(i),this.setAttribute("position",new Ie(r,3)),this.setAttribute("normal",new Ie(s,3)),this.setAttribute("uv",new Ie(o,2));function c(f){const h=r.length/3,p=f.extractPoints(t);let y=p.shape;const m=p.holes;Qn.isClockWise(y)===!1&&(y=y.reverse());for(let b=0,v=m.length;b<v;b++){const g=m[b];Qn.isClockWise(g)===!0&&(m[b]=g.reverse())}const d=Qn.triangulateShape(y,m);for(let b=0,v=m.length;b<v;b++){const g=m[b];y=y.concat(g)}for(let b=0,v=y.length;b<v;b++){const g=y[b];r.push(g.x,g.y,0),s.push(0,0,1),o.push(g.x,g.y)}for(let b=0,v=d.length;b<v;b++){const g=d[b],w=g[0]+h,S=g[1]+h,T=g[2]+h;i.push(w,S,T),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return cN(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new Gr(i,e.curveSegments)}}function cN(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Hr extends ke{constructor(e=1,t=8,i=6,r=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(o+l,Math.PI);let c=0;const f=[],h=new q,p=new q,y=[],m=[],d=[],b=[];for(let v=0;v<=i;v++){const g=[],w=v/i;let S=0;v==0&&o==0?S=.5/t:v==i&&u==Math.PI&&(S=-.5/t);for(let T=0;T<=t;T++){const M=T/t;h.x=-e*Math.cos(r+M*s)*Math.sin(o+w*l),h.y=e*Math.cos(o+w*l),h.z=e*Math.sin(r+M*s)*Math.sin(o+w*l),m.push(h.x,h.y,h.z),p.copy(h).normalize(),d.push(p.x,p.y,p.z),b.push(M+S,1-w),g.push(c++)}f.push(g)}for(let v=0;v<i;v++)for(let g=0;g<t;g++){const w=f[v][g+1],S=f[v][g],T=f[v+1][g],M=f[v+1][g+1];(v!==0||o>0)&&y.push(w,S,M),(v!==i-1||u<Math.PI)&&y.push(S,T,M)}this.setIndex(y),this.setAttribute("position",new Ie(m,3)),this.setAttribute("normal",new Ie(d,3)),this.setAttribute("uv",new Ie(b,2))}static fromJSON(e){return new Hr(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class oo extends qn{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new oo(e.radius,e.detail)}}class Sc extends Bn{constructor(e,t={}){const i=t.font;if(!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ke;const r=i.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class ao extends ke{constructor(e=1,t=.4,i=8,r=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[],f=new q,h=new q,p=new q;for(let y=0;y<=i;y++)for(let m=0;m<=r;m++){const d=m/r*s,b=y/i*Math.PI*2;h.x=(e+t*Math.cos(b))*Math.cos(d),h.y=(e+t*Math.cos(b))*Math.sin(d),h.z=t*Math.sin(b),l.push(h.x,h.y,h.z),f.x=e*Math.cos(d),f.y=e*Math.sin(d),p.subVectors(h,f).normalize(),u.push(p.x,p.y,p.z),c.push(m/r),c.push(y/i)}for(let y=1;y<=i;y++)for(let m=1;m<=r;m++){const d=(r+1)*y+m-1,b=(r+1)*(y-1)+m-1,v=(r+1)*(y-1)+m,g=(r+1)*y+m;o.push(d,b,g),o.push(b,v,g)}this.setIndex(o),this.setAttribute("position",new Ie(l,3)),this.setAttribute("normal",new Ie(u,3)),this.setAttribute("uv",new Ie(c,2))}static fromJSON(e){return new ao(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class lo extends ke{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const l=[],u=[],c=[],f=[],h=new q,p=new q,y=new q,m=new q,d=new q,b=new q,v=new q;for(let w=0;w<=i;++w){const S=w/i*s*Math.PI*2;g(S,s,o,e,y),g(S+.01,s,o,e,m),b.subVectors(m,y),v.addVectors(m,y),d.crossVectors(b,v),v.crossVectors(d,b),d.normalize(),v.normalize();for(let T=0;T<=r;++T){const M=T/r*Math.PI*2,C=-t*Math.cos(M),_=t*Math.sin(M);h.x=y.x+(C*v.x+_*d.x),h.y=y.y+(C*v.y+_*d.y),h.z=y.z+(C*v.z+_*d.z),u.push(h.x,h.y,h.z),p.subVectors(h,y).normalize(),c.push(p.x,p.y,p.z),f.push(w/i),f.push(T/r)}}for(let w=1;w<=i;w++)for(let S=1;S<=r;S++){const T=(r+1)*(w-1)+(S-1),M=(r+1)*w+(S-1),C=(r+1)*w+S,_=(r+1)*(w-1)+S;l.push(T,M,_),l.push(M,C,_)}this.setIndex(l),this.setAttribute("position",new Ie(u,3)),this.setAttribute("normal",new Ie(c,3)),this.setAttribute("uv",new Ie(f,2));function g(w,S,T,M,C){const _=Math.cos(w),P=Math.sin(w),E=T/S*w,O=Math.cos(E);C.x=M*(2+O)*.5*_,C.y=M*(2+O)*P*.5,C.z=M*Math.sin(E)*.5}}static fromJSON(e){return new lo(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class co extends ke{constructor(e,t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new q,u=new q,c=new Se;let f=new q;const h=[],p=[],y=[],m=[];d(),this.setIndex(m),this.setAttribute("position",new Ie(h,3)),this.setAttribute("normal",new Ie(p,3)),this.setAttribute("uv",new Ie(y,2));function d(){for(let w=0;w<t;w++)b(w);b(s===!1?t:0),g(),v()}function b(w){f=e.getPointAt(w/t,f);const S=o.normals[w],T=o.binormals[w];for(let M=0;M<=r;M++){const C=M/r*Math.PI*2,_=Math.sin(C),P=-Math.cos(C);u.x=P*S.x+_*T.x,u.y=P*S.y+_*T.y,u.z=P*S.z+_*T.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=f.x+i*u.x,l.y=f.y+i*u.y,l.z=f.z+i*u.z,h.push(l.x,l.y,l.z)}}function v(){for(let w=1;w<=t;w++)for(let S=1;S<=r;S++){const T=(r+1)*(w-1)+(S-1),M=(r+1)*w+(S-1),C=(r+1)*w+S,_=(r+1)*(w-1)+S;m.push(T,M,_),m.push(M,C,_)}}function g(){for(let w=0;w<=t;w++)for(let S=0;S<=r;S++)c.x=w/t,c.y=S/r,y.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new co(new Mh[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Th extends ke{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0){console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const t=[],i=[0,0],r={},s=new q;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let c=0,f=u.length;c<f;++c){const h=u[c],p=h.start,y=h.count;for(let m=p,d=p+y;m<d;m+=3)for(let b=0;b<3;b++){const v=l.getX(m+b),g=l.getX(m+(b+1)%3);i[0]=Math.min(v,g),i[1]=Math.max(v,g);const w=i[0]+","+i[1];r[w]===void 0&&(r[w]={index1:i[0],index2:i[1]})}}for(const c in r){const f=r[c];s.fromBufferAttribute(o,f.index1),t.push(s.x,s.y,s.z),s.fromBufferAttribute(o,f.index2),t.push(s.x,s.y,s.z)}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let c=0;c<3;c++){const f=3*l+c;s.fromBufferAttribute(o,f),t.push(s.x,s.y,s.z);const h=3*l+(c+1)%3;s.fromBufferAttribute(o,h),t.push(s.x,s.y,s.z)}}this.setAttribute("position",new Ie(t,3))}}var Pv=Object.freeze({__proto__:null,BoxGeometry:Ei,BoxBufferGeometry:Ei,CircleGeometry:Qs,CircleBufferGeometry:Qs,ConeGeometry:eo,ConeBufferGeometry:eo,CylinderGeometry:ur,CylinderBufferGeometry:ur,DodecahedronGeometry:to,DodecahedronBufferGeometry:to,EdgesGeometry:fh,ExtrudeGeometry:Bn,ExtrudeBufferGeometry:Bn,IcosahedronGeometry:io,IcosahedronBufferGeometry:io,LatheGeometry:ro,LatheBufferGeometry:ro,OctahedronGeometry:Ur,OctahedronBufferGeometry:Ur,ParametricGeometry:Mc,ParametricBufferGeometry:Mc,PlaneGeometry:kr,PlaneBufferGeometry:kr,PolyhedronGeometry:qn,PolyhedronBufferGeometry:qn,RingGeometry:so,RingBufferGeometry:so,ShapeGeometry:Gr,ShapeBufferGeometry:Gr,SphereGeometry:Hr,SphereBufferGeometry:Hr,TetrahedronGeometry:oo,TetrahedronBufferGeometry:oo,TextGeometry:Sc,TextBufferGeometry:Sc,TorusGeometry:ao,TorusBufferGeometry:ao,TorusKnotGeometry:lo,TorusKnotBufferGeometry:lo,TubeGeometry:co,TubeBufferGeometry:co,WireframeGeometry:Th});class Eh extends Pt{constructor(e){super(),this.type="ShadowMaterial",this.color=new Re(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Eh.prototype.isShadowMaterial=!0;class uo extends Ai{constructor(e){super(e),this.type="RawShaderMaterial"}}uo.prototype.isRawShaderMaterial=!0;class Wr extends Pt{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Re(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}Wr.prototype.isMeshStandardMaterial=!0;class Sa extends Wr{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Se(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=jt(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Re(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Re).copy(e.sheen):this.sheen=null,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this}}Sa.prototype.isMeshPhysicalMaterial=!0;class Ah extends Pt{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Re(16777215),this.specular=new Re(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=zo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ah.prototype.isMeshPhongMaterial=!0;class Ch extends Pt{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Re(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Ch.prototype.isMeshToonMaterial=!0;class Rh extends Pt{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Rh.prototype.isMeshNormalMaterial=!0;class Lh extends Pt{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Re(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=zo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Lh.prototype.isMeshLambertMaterial=!0;class Ph extends Pt{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Re(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ph.prototype.isMeshMatcapMaterial=!0;class Ih extends Ft{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}Ih.prototype.isLineDashedMaterial=!0;var uN=Object.freeze({__proto__:null,ShadowMaterial:Eh,SpriteMaterial:aa,RawShaderMaterial:uo,ShaderMaterial:Ai,PointsMaterial:cr,MeshPhysicalMaterial:Sa,MeshStandardMaterial:Wr,MeshPhongMaterial:Ah,MeshToonMaterial:Ch,MeshNormalMaterial:Rh,MeshLambertMaterial:Lh,MeshDepthMaterial:ec,MeshDistanceMaterial:tc,MeshBasicMaterial:cn,MeshMatcapMaterial:Ph,LineDashedMaterial:Ih,LineBasicMaterial:Ft,Material:Pt});const ct={arraySlice:function(n,e,t){return ct.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i},sortedArray:function(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[l+u]}return r},flattenJSON:function(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)},subclip:function(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const c=s.tracks[u],f=c.getValueSize(),h=[],p=[];for(let y=0;y<c.times.length;++y){const m=c.times[y]*r;if(!(m<t||m>=i)){h.push(c.times[y]);for(let d=0;d<f;++d)p.push(c.values[y*f+d])}}h.length!==0&&(c.times=ct.convertArray(h,c.times.constructor),c.values=ct.convertArray(p,c.values.constructor),o.push(c))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const c=n.tracks.find(function(v){return v.name===l.name&&v.ValueTypeName===u});if(c===void 0)continue;let f=0;const h=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=h/3);let p=0;const y=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=y/3);const m=l.times.length-1;let d;if(s<=l.times[0]){const v=f,g=h-f;d=ct.arraySlice(l.values,v,g)}else if(s>=l.times[m]){const v=m*h+f,g=v+h-f;d=ct.arraySlice(l.values,v,g)}else{const v=l.createInterpolant(),g=f,w=h-f;v.evaluate(s),d=ct.arraySlice(v.resultBuffer,g,w)}u==="quaternion"&&new $t().fromArray(d).normalize().conjugate().toArray(d);const b=c.times.length;for(let v=0;v<b;++v){const g=v*y+p;if(u==="quaternion")$t.multiplyQuaternionsFlat(c.values,g,d,0,c.values,g);else{const w=y-p*2;for(let S=0;S<w;++S)c.values[g+S]-=d[S]}}}return n.blendMode=wd,n}};class ei{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let l=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,s)}if(i===l)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(i=2,s=l);for(let u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===u)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,s,e)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ei.prototype.beforeStart_=ei.prototype.copySampleValue_,ei.prototype.afterEnd_=ei.prototype.copySampleValue_;class Iv extends ei{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Pr,endingEnd:Pr}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,l=r[s],u=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case Ir:s=e,l=2*t-i;break;case Xo:s=r.length-2,l=t+r[s]-r[s+1];break;default:s=e,l=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Ir:o=e,u=2*i-t;break;case Xo:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const c=(i-t)*.5,f=this.valueSize;this._weightPrev=c/(t-l),this._weightNext=c/(u-i),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=this._offsetPrev,h=this._offsetNext,p=this._weightPrev,y=this._weightNext,m=(i-t)/(r-t),d=m*m,b=d*m,v=-p*b+2*p*d-p*m,g=(1+p)*b+(-1.5-2*p)*d+(-.5+p)*m+1,w=(-1-y)*b+(1.5+y)*d+.5*m,S=y*b-y*d;for(let T=0;T!==l;++T)s[T]=v*o[f+T]+g*o[c+T]+w*o[u+T]+S*o[h+T];return s}}class Oh extends ei{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=(i-t)/(r-t),h=1-f;for(let p=0;p!==l;++p)s[p]=o[c+p]*h+o[u+p]*f;return s}}class Ov extends ei{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Fn{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ct.convertArray(t,this.TimeBufferType),this.values=ct.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:ct.convertArray(e.times,Array),values:ct.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new Ov(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Oh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Iv(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Cs:t=this.InterpolantFactoryMethodDiscrete;break;case Lr:t=this.InterpolantFactoryMethodLinear;break;case Al:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Cs;case this.InterpolantFactoryMethodLinear:return Lr;case this.InterpolantFactoryMethodSmooth:return Al}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=ct.arraySlice(i,s,o),this.values=ct.arraySlice(this.values,s*l,o*l)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&ct.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=ct.arraySlice(this.times),t=ct.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Al,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const c=e[l],f=e[l+1];if(c!==f&&(l!==1||c!==e[0]))if(r)u=!0;else{const h=l*i,p=h-i,y=h+i;for(let m=0;m!==i;++m){const d=t[h+m];if(d!==t[p+m]||d!==t[y+m]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const h=l*i,p=o*i;for(let y=0;y!==i;++y)t[p+y]=t[h+y]}++o}}if(s>0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=ct.arraySlice(e,0,o),this.values=ct.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ct.arraySlice(this.times,0),t=ct.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Fn.prototype.TimeBufferType=Float32Array,Fn.prototype.ValueBufferType=Float32Array,Fn.prototype.DefaultInterpolation=Lr;class jr extends Fn{}jr.prototype.ValueTypeName="bool",jr.prototype.ValueBufferType=Array,jr.prototype.DefaultInterpolation=Cs,jr.prototype.InterpolantFactoryMethodLinear=void 0,jr.prototype.InterpolantFactoryMethodSmooth=void 0;class Nh extends Fn{}Nh.prototype.ValueTypeName="color";class ho extends Fn{}ho.prototype.ValueTypeName="number";class Nv extends ei{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)$t.slerpFlat(s,0,o,c-l,o,c,u);return s}}class $r extends Fn{InterpolantFactoryMethodLinear(e){return new Nv(this.times,this.values,this.getValueSize(),e)}}$r.prototype.ValueTypeName="quaternion",$r.prototype.DefaultInterpolation=Lr,$r.prototype.InterpolantFactoryMethodSmooth=void 0;class Zr extends Fn{}Zr.prototype.ValueTypeName="string",Zr.prototype.ValueBufferType=Array,Zr.prototype.DefaultInterpolation=Cs,Zr.prototype.InterpolantFactoryMethodLinear=void 0,Zr.prototype.InterpolantFactoryMethodSmooth=void 0;class fo extends Fn{}fo.prototype.ValueTypeName="vector";class po{constructor(e,t=-1,i,r=Cl){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=fn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(hN(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Fn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],c=[];u.push((l+s-1)%s,l,(l+1)%s),c.push(0,1,0);const f=ct.getKeyframeOrder(u);u=ct.sortedArray(u,1,f),c=ct.sortedArray(c,1,f),!r&&u[0]===0&&(u.push(s),c.push(c[0])),o.push(new ho(".morphTargetInfluences["+t[l].name+"]",u,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,u=e.length;l<u;l++){const c=e[l],f=c.name.match(s);if(f&&f.length>1){const h=f[1];let p=r[h];p||(r[h]=p=[]),p.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,y,m,d){if(y.length!==0){const b=[],v=[];ct.flattenJSON(y,b,v,m),b.length!==0&&d.push(new h(p,b,v))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let h=0;h<c.length;h++){const p=c[h].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const y={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let d=0;d<p[m].morphTargets.length;d++)y[p[m].morphTargets[d]]=-1;for(const d in y){const b=[],v=[];for(let g=0;g!==p[m].morphTargets.length;++g){const w=p[m];b.push(w.time),v.push(w.morphTarget===d?1:0)}r.push(new ho(".morphTargetInfluence["+d+"]",b,v))}u=y.length*(o||1)}else{const y=".bones["+t[h].name+"]";i(fo,y+".position",p,"pos",r),i($r,y+".quaternion",p,"rot",r),i(fo,y+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,r,l)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function dN(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ho;case"vector":case"vector2":case"vector3":case"vector4":return fo;case"color":return Nh;case"quaternion":return $r;case"bool":case"boolean":return jr;case"string":return Zr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function hN(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=dN(n.type);if(n.times===void 0){const t=[],i=[];ct.flattenJSON(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Xr={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Dh{constructor(e,t,i){const r=this;let s=!1,o=0,l=0,u;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(f){l++,s===!1&&r.onStart!==void 0&&r.onStart(f,o,l),s=!0},this.itemEnd=function(f){o++,r.onProgress!==void 0&&r.onProgress(f,o,l),o===l&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(f){r.onError!==void 0&&r.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,h){return c.push(f,h),this},this.removeHandler=function(f){const h=c.indexOf(f);return h!==-1&&c.splice(h,2),this},this.getHandler=function(f){for(let h=0,p=c.length;h<p;h+=2){const y=c[h],m=c[h+1];if(y.global&&(y.lastIndex=0),y.test(f))return m}return null}}}const Dv=new Dh;class Zt{constructor(e){this.manager=e!==void 0?e:Dv,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Vn={};class yn extends Zt{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Xr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;if(Vn[e]!==void 0){Vn[e].push({onLoad:t,onProgress:i,onError:r});return}const l=/^data:(.*?)(;base64)?,(.*)$/,u=e.match(l);let c;if(u){const f=u[1],h=!!u[2];let p=u[3];p=decodeURIComponent(p),h&&(p=atob(p));try{let y;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const d=new Uint8Array(p.length);for(let v=0;v<p.length;v++)d[v]=p.charCodeAt(v);m==="blob"?y=new Blob([d.buffer],{type:f}):y=d.buffer;break;case"document":y=new DOMParser().parseFromString(p,f);break;case"json":y=JSON.parse(p);break;default:y=p;break}setTimeout(function(){t&&t(y),s.manager.itemEnd(e)},0)}catch(y){setTimeout(function(){r&&r(y),s.manager.itemError(e),s.manager.itemEnd(e)},0)}}else{Vn[e]=[],Vn[e].push({onLoad:t,onProgress:i,onError:r}),c=new XMLHttpRequest,c.open("GET",e,!0),c.addEventListener("load",function(f){const h=this.response,p=Vn[e];if(delete Vn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Xr.add(e,h);for(let y=0,m=p.length;y<m;y++){const d=p[y];d.onLoad&&d.onLoad(h)}s.manager.itemEnd(e)}else{for(let y=0,m=p.length;y<m;y++){const d=p[y];d.onError&&d.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)}},!1),c.addEventListener("progress",function(f){const h=Vn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onProgress&&m.onProgress(f)}},!1),c.addEventListener("error",function(f){const h=Vn[e];delete Vn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),c.addEventListener("abort",function(f){const h=Vn[e];delete Vn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),this.responseType!==void 0&&(c.responseType=this.responseType),this.withCredentials!==void 0&&(c.withCredentials=this.withCredentials),c.overrideMimeType&&c.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const f in this.requestHeader)c.setRequestHeader(f,this.requestHeader[f]);c.send(null)}return s.manager.itemStart(e),c}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class fN extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=po.parse(e[i]);t.push(r)}return t}}class pN extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],l=new dh,u=new yn(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let c=0;function f(h){u.load(e[h],function(p){const y=s.parse(p,!0);o[h]={width:y.width,height:y.height,format:y.format,mipmaps:y.mipmaps},c+=1,c===6&&(y.mipmapCount===1&&(l.minFilter=gt),l.image=o,l.format=y.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let h=0,p=e.length;h<p;++h)f(h);else u.load(e,function(h){const p=s.parse(h,!0);if(p.isCubemap){const y=p.mipmaps.length/p.mipmapCount;for(let m=0;m<y;m++){o[m]={mipmaps:[]};for(let d=0;d<p.mipmapCount;d++)o[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+d]),o[m].format=p.format,o[m].width=p.width,o[m].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=gt),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}}class _a extends Zt{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Xr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=document.createElementNS("http://www.w3.org/1999/xhtml","img");function u(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),Xr.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(f){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),r&&r(f),s.manager.itemError(e),s.manager.itemEnd(e)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class Bv extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=new js,o=new _a(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(c){o.load(e[c],function(f){s.images[c]=f,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)u(c);return s}}class Fv extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new zr,l=new yn(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){const c=s.parse(u);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:zt,o.wrapT=c.wrapT!==void 0?c.wrapT:zt,o.magFilter=c.magFilter!==void 0?c.magFilter:gt,o.minFilter=c.minFilter!==void 0?c.minFilter:gt,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=yi),c.mipmapCount===1&&(o.minFilter=gt),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},i,r),o}}class Bh extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=new St,o=new _a(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l;const u=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;s.format=u?bi:hn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class Vv extends gn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ba(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],l=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(l);for(let c=0;c<u.length;c++){const f=u[c];i&&i.equals(f)||(t.push(f),i=f)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Mh[r.type]().fromJSON(r))}return this}}class Ta extends Vv{constructor(e){super(),this.type="Path",this.currentPoint=new Se,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new ba(this.currentPoint.clone(),new Se(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new yc(this.currentPoint.clone(),new Se(e,t),new Se(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const l=new gc(this.currentPoint.clone(),new Se(e,t),new Se(i,r),new Se(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new vc(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,l,u){const c=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+c,t+f,i,r,s,o,l,u),this}absellipse(e,t,i,r,s,o,l,u){const c=new ga(e,t,i,r,s,o,l,u);if(this.curves.length>0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class hr extends Ta{constructor(e){super(e),this.uuid=fn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new Ta().fromJSON(r))}return this}}class kn extends Ze{constructor(e,t=1){super(),this.type="Light",this.color=new Re(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}kn.prototype.isLight=!0;class Fh extends kn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(Ze.DefaultUp),this.updateMatrix(),this.groundColor=new Re(t)}copy(e){return kn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Fh.prototype.isHemisphereLight=!0;const kv=new Ne,zv=new q,Uv=new q;class Vh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Se(512,512),this.map=null,this.mapPass=null,this.matrix=new Ne,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new na,this._frameExtents=new Se(1,1),this._viewportCount=1,this._viewports=[new it(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;zv.setFromMatrixPosition(e.matrixWorld),t.position.copy(zv),Uv.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Uv),t.updateMatrixWorld(),kv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(kv),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Gv extends Vh{constructor(){super(new Bt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=Yo*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Gv.prototype.isSpotLightShadow=!0;class _c extends kn{constructor(e,t,i=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(Ze.DefaultUp),this.updateMatrix(),this.target=new Ze,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new Gv}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}_c.prototype.isSpotLight=!0;const Hv=new Ne,Ea=new q,kh=new q;class Wv extends Vh{constructor(){super(new Bt(90,1,.5,500)),this._frameExtents=new Se(4,2),this._viewportCount=6,this._viewports=[new it(2,1,1,1),new it(0,1,1,1),new it(3,1,1,1),new it(1,1,1,1),new it(3,0,1,1),new it(1,0,1,1)],this._cubeDirections=[new q(1,0,0),new q(-1,0,0),new q(0,0,1),new q(0,0,-1),new q(0,1,0),new q(0,-1,0)],this._cubeUps=[new q(0,1,0),new q(0,1,0),new q(0,1,0),new q(0,1,0),new q(0,0,1),new q(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Ea.setFromMatrixPosition(e.matrixWorld),i.position.copy(Ea),kh.copy(i.position),kh.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(kh),i.updateMatrixWorld(),r.makeTranslation(-Ea.x,-Ea.y,-Ea.z),Hv.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Hv)}}Wv.prototype.isPointLightShadow=!0;class Tc extends kn{constructor(e,t,i=0,r=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Wv}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Tc.prototype.isPointLight=!0;class mo extends ta{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,l=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,l-=f*this.view.offsetY,u=l-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,u,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}mo.prototype.isOrthographicCamera=!0;class jv extends Vh{constructor(){super(new mo(-5,5,5,-5,.5,500))}}jv.prototype.isDirectionalLightShadow=!0;class Ec extends kn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Ze.DefaultUp),this.updateMatrix(),this.target=new Ze,this.shadow=new jv}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Ec.prototype.isDirectionalLight=!0;class zh extends kn{constructor(e,t){super(e,t),this.type="AmbientLight"}}zh.prototype.isAmbientLight=!0;class Uh extends kn{constructor(e,t,i=10,r=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Uh.prototype.isRectAreaLight=!0;class Gh{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new q)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}Gh.prototype.isSphericalHarmonics3=!0;class Aa extends kn{constructor(e=new Gh,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Aa.prototype.isLightProbe=!0;class $v extends Zt{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new yn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=new uN[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Re().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Re().setHex(o.value);break;case"v2":r.uniforms[s].value=new Se().fromArray(o.value);break;case"v3":r.uniforms[s].value=new q().fromArray(o.value);break;case"v4":r.uniforms[s].value=new it().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Ne().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Se().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Se().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Ri{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class Hh extends ke{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Hh.prototype.isInstancedBufferGeometry=!0;class Wh extends je{constructor(e,t,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Wh.prototype.isInstancedBufferAttribute=!0;class Zv extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(y,m){if(t[m]!==void 0)return t[m];const b=y.interleavedBuffers[m],v=s(y,b.buffer),g=ks(b.type,v),w=new lr(g,b.stride);return w.uuid=b.uuid,t[m]=w,w}function s(y,m){if(i[m]!==void 0)return i[m];const b=y.arrayBuffers[m],v=new Uint32Array(b).buffer;return i[m]=v,v}const o=e.isInstancedBufferGeometry?new Hh:new ke,l=e.data.index;if(l!==void 0){const y=ks(l.type,l.array);o.setIndex(new je(y,1))}const u=e.data.attributes;for(const y in u){const m=u[y];let d;if(m.isInterleavedBufferAttribute){const b=r(e.data,m.data);d=new Ci(b,m.itemSize,m.offset,m.normalized)}else{const b=ks(m.type,m.array),v=m.isInstancedBufferAttribute?Wh:je;d=new v(b,m.itemSize,m.normalized)}m.name!==void 0&&(d.name=m.name),m.usage!==void 0&&d.setUsage(m.usage),m.updateRange!==void 0&&(d.updateRange.offset=m.updateRange.offset,d.updateRange.count=m.updateRange.count),o.setAttribute(y,d)}const c=e.data.morphAttributes;if(c)for(const y in c){const m=c[y],d=[];for(let b=0,v=m.length;b<v;b++){const g=m[b];let w;if(g.isInterleavedBufferAttribute){const S=r(e.data,g.data);w=new Ci(S,g.itemSize,g.offset,g.normalized)}else{const S=ks(g.type,g.array);w=new je(S,g.itemSize,g.normalized)}g.name!==void 0&&(w.name=g.name),d.push(w)}o.morphAttributes[y]=d}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let y=0,m=h.length;y!==m;++y){const d=h[y];o.addGroup(d.start,d.count,d.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const y=new q;p.center!==void 0&&y.fromArray(p.center),o.boundingSphere=new wi(y,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class mN extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Ri.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new yn(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let c=null;try{c=JSON.parse(u)}catch(h){r!==void 0&&r(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const f=c.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Ri.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new yn(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),c=this.parseObject(e.object,s,u,l,i),f=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,f),t!==void 0){let h=!1;for(const p in o)if(o[p]instanceof HTMLImageElement){h=!0;break}h===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,r,l,o,t),c=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,c),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new hr().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new pa().fromJSON(e[s],r);i[l.uuid]=l}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new Zv;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in Pv?l=Pv[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),l.isBufferGeometry===!0&&u.userData!==void 0&&(l.userData=u.userData),i[u.uuid]=l}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new $v;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];if(u.type==="MultiMaterial"){const c=[];for(let f=0;f<u.materials.length;f++){const h=u.materials[f];i[h.uuid]===void 0&&(i[h.uuid]=s.parse(h)),c.push(i[h.uuid])}r[u.uuid]=c}else i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=po.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const c=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(f)}else return u.data?{data:ks(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new Dh(t);s=new _a(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c<f;c++){const h=e[c],p=h.url;if(Array.isArray(p)){r[h.uuid]=[];for(let y=0,m=p.length;y<m;y++){const d=p[y],b=l(d);b!==null&&(b instanceof HTMLImageElement?r[h.uuid].push(b):r[h.uuid].push(new zr(b.data,b.width,b.height)))}}else{const y=l(h.url);y!==null&&(r[h.uuid]=y)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(u)}else return o.data?{data:ks(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new _a(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.url;if(Array.isArray(c)){i[u.uuid]=[];for(let f=0,h=c.length;f<h;f++){const p=c[f],y=await s(p);y!==null&&(y instanceof HTMLImageElement?i[u.uuid].push(y):i[u.uuid].push(new zr(y.data,y.width,y.height)))}}else{const f=await s(u.url);f!==null&&(i[u.uuid]=f)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);let u;const c=t[l.image];Array.isArray(c)?(u=new js(c),c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new zr(c.data,c.width,c.height):u=new St(c),c&&(u.needsUpdate=!0)),u.uuid=l.uuid,l.name!==void 0&&(u.name=l.name),l.mapping!==void 0&&(u.mapping=i(l.mapping,gN)),l.offset!==void 0&&u.offset.fromArray(l.offset),l.repeat!==void 0&&u.repeat.fromArray(l.repeat),l.center!==void 0&&u.center.fromArray(l.center),l.rotation!==void 0&&(u.rotation=l.rotation),l.wrap!==void 0&&(u.wrapS=i(l.wrap[0],Xv),u.wrapT=i(l.wrap[1],Xv)),l.format!==void 0&&(u.format=l.format),l.type!==void 0&&(u.type=l.type),l.encoding!==void 0&&(u.encoding=l.encoding),l.minFilter!==void 0&&(u.minFilter=i(l.minFilter,Yv)),l.magFilter!==void 0&&(u.magFilter=i(l.magFilter,Yv)),l.anisotropy!==void 0&&(u.anisotropy=l.anisotropy),l.flipY!==void 0&&(u.flipY=l.flipY),l.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(u.unpackAlignment=l.unpackAlignment),r[l.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function l(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function u(p){if(p!==void 0){if(Array.isArray(p)){const y=[];for(let m=0,d=p.length;m<d;m++){const b=p[m];i[b]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",b),y.push(i[b])}return y}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let f,h;switch(e.type){case"Scene":o=new nc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Re(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new oa(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new sa(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Bt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new mo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new zh(e.color,e.intensity);break;case"DirectionalLight":o=new Ec(e.color,e.intensity);break;case"PointLight":o=new Tc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Uh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new _c(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new Fh(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Aa().fromJSON(e);break;case"SkinnedMesh":f=l(e.geometry),h=u(e.material),o=new ha(f,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=l(e.geometry),h=u(e.material),o=new Tt(f,h);break;case"InstancedMesh":f=l(e.geometry),h=u(e.material);const p=e.count,y=e.instanceMatrix,m=e.instanceColor;o=new lh(f,h,p),o.instanceMatrix=new je(new Float32Array(y.array),16),m!==void 0&&(o.instanceColor=new je(new Float32Array(m.array),m.itemSize));break;case"LOD":o=new sv;break;case"Line":o=new Kn(l(e.geometry),u(e.material));break;case"LineLoop":o=new cc(l(e.geometry),u(e.material));break;case"LineSegments":o=new rn(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new qs(l(e.geometry),u(e.material));break;case"Sprite":o=new da(u(e.material));break;case"Group":o=new Jn;break;case"Bone":o=new fa;break;default:o=new Ze}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let y=0;y<p.length;y++)o.add(this.parseObject(p[y],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let y=0;y<p.length;y++){const m=p[y];o.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let y=0;y<p.length;y++){const m=p[y],d=o.getObjectByProperty("uuid",m.object);d!==void 0&&o.addLevel(d,m.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const gN={UVMapping:Sl,CubeReflectionMapping:Uo,CubeRefractionMapping:Go,EquirectangularReflectionMapping:_l,EquirectangularRefractionMapping:Tl,CubeUVReflectionMapping:_s,CubeUVRefractionMapping:Ho},Xv={RepeatWrapping:Ji,ClampToEdgeWrapping:zt,MirroredRepeatWrapping:Ts},Yv={NearestFilter:Mt,NearestMipmapNearestFilter:Wo,NearestMipmapLinearFilter:jo,LinearFilter:gt,LinearMipmapNearestFilter:El,LinearMipmapLinearFilter:yi};class jh extends Zt{constructor(e){super(e),typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Xr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){Xr.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}jh.prototype.isImageBitmapLoader=!0;class Jv{constructor(){this.type="ShapePath",this.color=new Re,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ta,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function i(g){const w=[];for(let S=0,T=g.length;S<T;S++){const M=g[S],C=new hr;C.curves=M.curves,w.push(C)}return w}function r(g,w){const S=w.length;let T=!1;for(let M=S-1,C=0;C<S;M=C++){let _=w[M],P=w[C],E=P.x-_.x,O=P.y-_.y;if(Math.abs(O)>Number.EPSILON){if(O<0&&(_=w[C],E=-E,P=w[M],O=-O),g.y<_.y||g.y>P.y)continue;if(g.y===_.y){if(g.x===_.x)return!0}else{const A=O*(g.x-_.x)-E*(g.y-_.y);if(A===0)return!0;if(A<0)continue;T=!T}}else{if(g.y!==_.y)continue;if(P.x<=g.x&&g.x<=_.x||_.x<=g.x&&g.x<=P.x)return!0}}return T}const s=Qn.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new hr,c.curves=u.curves,f.push(c),f;let h=!s(o[0].getPoints());h=e?!h:h;const p=[],y=[];let m=[],d=0,b;y[d]=void 0,m[d]=[];for(let g=0,w=o.length;g<w;g++)u=o[g],b=u.getPoints(),l=s(b),l=e?!l:l,l?(!h&&y[d]&&d++,y[d]={s:new hr,p:b},y[d].s.curves=u.curves,h&&d++,m[d]=[]):m[d].push({h:u,p:b[0]});if(!y[0])return i(o);if(y.length>1){let g=!1;const w=[];for(let S=0,T=y.length;S<T;S++)p[S]=[];for(let S=0,T=y.length;S<T;S++){const M=m[S];for(let C=0;C<M.length;C++){const _=M[C];let P=!0;for(let E=0;E<y.length;E++)r(_.p,y[E].p)&&(S!==E&&w.push({froms:S,tos:E,hole:C}),P?(P=!1,p[E].push(_)):g=!0);P&&p[S].push(_)}}w.length>0&&(g||(m=p))}let v;for(let g=0,w=y.length;g<w;g++){c=y[g].s,f.push(c),v=m[g];for(let S=0,T=v.length;S<T;S++)c.holes.push(v[S].h)}return f}}class $h{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],r=yN(e,t,this.data);for(let s=0,o=r.length;s<o;s++)Array.prototype.push.apply(i,r[s].toShapes());return i}}function yN(n,e,t){const i=Array.from(n),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let l=0,u=0;for(let c=0;c<i.length;c++){const f=i[c];if(f===`
2915
+ }`;function qy(n,e,t){let i=new na;const r=new Se,s=new Se,o=new it,l=[],u=[],c={},f=t.maxTextureSize,h={0:wt,1:Zi,2:Xi},p=new Ai({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Se},radius:{value:4}},vertexShader:C3,fragmentShader:A3}),y=p.clone();y.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new je(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const d=new Tt(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=nd,this.render=function(M,C,_){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||M.length===0)return;const P=n.getRenderTarget(),E=n.getActiveCubeFace(),O=n.getActiveMipmapLevel(),A=n.state;A.setBlending(gi),A.buffers.color.setClear(1,1,1,1),A.buffers.depth.setTest(!0),A.setScissorTest(!1);for(let L=0,R=M.length;L<R;L++){const N=M[L],x=N.shadow;if(x===void 0){console.warn("THREE.WebGLShadowMap:",N,"has no shadow.");continue}if(x.autoUpdate===!1&&x.needsUpdate===!1)continue;r.copy(x.mapSize);const I=x.getFrameExtents();if(r.multiply(I),s.copy(x.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/I.x),r.x=s.x*I.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/I.y),r.y=s.y*I.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Ms){const F={minFilter:gt,magFilter:gt,format:hn};x.map=new Pn(r.x,r.y,F),x.map.texture.name=N.name+".shadowMap",x.mapPass=new Pn(r.x,r.y,F),x.camera.updateProjectionMatrix()}if(x.map===null){const F={minFilter:Mt,magFilter:Mt,format:hn};x.map=new Pn(r.x,r.y,F),x.map.texture.name=N.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let F=0;F<B;F++){const V=x.getViewport(F);o.set(s.x*V.x,s.y*V.y,s.x*V.z,s.y*V.w),A.viewport(o),x.updateMatrices(N,F),i=x.getFrustum(),T(C,_,x.camera,N,this.type)}!x.isPointLightShadow&&this.type===Ms&&v(x,_),x.needsUpdate=!1}b.needsUpdate=!1,n.setRenderTarget(P,E,O)};function v(M,C){const _=e.update(d);p.uniforms.shadow_pass.value=M.map.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,n.setRenderTarget(M.mapPass),n.clear(),n.renderBufferDirect(C,null,_,p,d,null),y.uniforms.shadow_pass.value=M.mapPass.texture,y.uniforms.resolution.value=M.mapSize,y.uniforms.radius.value=M.radius,n.setRenderTarget(M.map),n.clear(),n.renderBufferDirect(C,null,_,y,d,null)}function g(M){const C=M<<0;let _=l[C];return _===void 0&&(_=new ec({depthPacking:ny,morphTargets:M}),l[C]=_),_}function w(M){const C=M<<0;let _=u[C];return _===void 0&&(_=new tc({morphTargets:M}),u[C]=_),_}function S(M,C,_,P,E,O,A){let L=null,R=g,N=M.customDepthMaterial;if(P.isPointLight===!0&&(R=w,N=M.customDistanceMaterial),N===void 0){let x=!1;_.morphTargets===!0&&(x=C.morphAttributes&&C.morphAttributes.position&&C.morphAttributes.position.length>0),L=R(x)}else L=N;if(n.localClippingEnabled&&_.clipShadows===!0&&_.clippingPlanes.length!==0){const x=L.uuid,I=_.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let F=B[I];F===void 0&&(F=L.clone(),B[I]=F),L=F}return L.visible=_.visible,L.wireframe=_.wireframe,A===Ms?L.side=_.shadowSide!==null?_.shadowSide:_.side:L.side=_.shadowSide!==null?_.shadowSide:h[_.side],L.clipShadows=_.clipShadows,L.clippingPlanes=_.clippingPlanes,L.clipIntersection=_.clipIntersection,L.wireframeLinewidth=_.wireframeLinewidth,L.linewidth=_.linewidth,P.isPointLight===!0&&L.isMeshDistanceMaterial===!0&&(L.referencePosition.setFromMatrixPosition(P.matrixWorld),L.nearDistance=E,L.farDistance=O),L}function T(M,C,_,P,E){if(M.visible===!1)return;if(M.layers.test(C.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&E===Ms)&&(!M.frustumCulled||i.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,M.matrixWorld);const L=e.update(M),R=M.material;if(Array.isArray(R)){const N=L.groups;for(let x=0,I=N.length;x<I;x++){const B=N[x],F=R[B.materialIndex];if(F&&F.visible){const V=S(M,L,F,P,_.near,_.far,E);n.renderBufferDirect(_,null,L,V,M,B)}}}else if(R.visible){const N=S(M,L,R,P,_.near,_.far,E);n.renderBufferDirect(_,null,L,N,M,null)}}const A=M.children;for(let L=0,R=A.length;L<R;L++)T(A[L],C,_,P,E)}}function R3(n,e,t){const i=t.isWebGL2;function r(){let te=!1;const he=new it;let ge=null;const Ae=new it(0,0,0,0);return{setMask:function(Te){ge!==Te&&!te&&(n.colorMask(Te,Te,Te,Te),ge=Te)},setLocked:function(Te){te=Te},setClear:function(Te,De,Ye,ze,st){st===!0&&(Te*=ze,De*=ze,Ye*=ze),he.set(Te,De,Ye,ze),Ae.equals(he)===!1&&(n.clearColor(Te,De,Ye,ze),Ae.copy(he))},reset:function(){te=!1,ge=null,Ae.set(-1,0,0,0)}}}function s(){let te=!1,he=null,ge=null,Ae=null;return{setTest:function(Te){Te?ne(2929):ae(2929)},setMask:function(Te){he!==Te&&!te&&(n.depthMask(Te),he=Te)},setFunc:function(Te){if(ge!==Te){if(Te)switch(Te){case Hg:n.depthFunc(512);break;case Wg:n.depthFunc(519);break;case jg:n.depthFunc(513);break;case Ml:n.depthFunc(515);break;case $g:n.depthFunc(514);break;case Zg:n.depthFunc(518);break;case Xg:n.depthFunc(516);break;case Yg:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);ge=Te}},setLocked:function(Te){te=Te},setClear:function(Te){Ae!==Te&&(n.clearDepth(Te),Ae=Te)},reset:function(){te=!1,he=null,ge=null,Ae=null}}}function o(){let te=!1,he=null,ge=null,Ae=null,Te=null,De=null,Ye=null,ze=null,st=null;return{setTest:function(Ce){te||(Ce?ne(2960):ae(2960))},setMask:function(Ce){he!==Ce&&!te&&(n.stencilMask(Ce),he=Ce)},setFunc:function(Ce,He,Ge){(ge!==Ce||Ae!==He||Te!==Ge)&&(n.stencilFunc(Ce,He,Ge),ge=Ce,Ae=He,Te=Ge)},setOp:function(Ce,He,Ge){(De!==Ce||Ye!==He||ze!==Ge)&&(n.stencilOp(Ce,He,Ge),De=Ce,Ye=He,ze=Ge)},setLocked:function(Ce){te=Ce},setClear:function(Ce){st!==Ce&&(n.clearStencil(Ce),st=Ce)},reset:function(){te=!1,he=null,ge=null,Ae=null,Te=null,De=null,Ye=null,ze=null,st=null}}}const l=new r,u=new s,c=new o;let f={},h=null,p={},y=null,m=!1,d=null,b=null,v=null,g=null,w=null,S=null,T=null,M=!1,C=null,_=null,P=null,E=null,O=null;const A=n.getParameter(35661);let L=!1,R=0;const N=n.getParameter(7938);N.indexOf("WebGL")!==-1?(R=parseFloat(/^WebGL (\d)/.exec(N)[1]),L=R>=1):N.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),L=R>=2);let x=null,I={};const B=n.getParameter(3088),F=n.getParameter(2978),V=new it().fromArray(B),k=new it().fromArray(F);function G(te,he,ge){const Ae=new Uint8Array(4),Te=n.createTexture();n.bindTexture(te,Te),n.texParameteri(te,10241,9728),n.texParameteri(te,10240,9728);for(let De=0;De<ge;De++)n.texImage2D(he+De,0,6408,1,1,0,6408,5121,Ae);return Te}const J={};J[3553]=G(3553,3553,1),J[34067]=G(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),ne(2929),u.setFunc(Ml),H(!1),K(td),ne(2884),re(gi);function ne(te){f[te]!==!0&&(n.enable(te),f[te]=!0)}function ae(te){f[te]!==!1&&(n.disable(te),f[te]=!1)}function ie(te){te!==h&&(n.bindFramebuffer(36160,te),h=te)}function oe(te,he){return he===null&&h!==null&&(he=h),p[te]!==he?(n.bindFramebuffer(te,he),p[te]=he,i&&(te===36009&&(p[36160]=he),te===36160&&(p[36009]=he)),!0):!1}function W(te){return y!==te?(n.useProgram(te),y=te,!0):!1}const Z={[Er]:32774,[Ig]:32778,[Og]:32779};if(i)Z[ad]=32775,Z[ld]=32776;else{const te=e.get("EXT_blend_minmax");te!==null&&(Z[ad]=te.MIN_EXT,Z[ld]=te.MAX_EXT)}const j={[Ng]:0,[Dg]:1,[Bg]:768,[cd]:770,[Gg]:776,[zg]:774,[Vg]:772,[Fg]:769,[ud]:771,[Ug]:775,[kg]:773};function re(te,he,ge,Ae,Te,De,Ye,ze){if(te===gi){m===!0&&(ae(3042),m=!1);return}if(m===!1&&(ne(3042),m=!0),te!==Pg){if(te!==d||ze!==M){if((b!==Er||w!==Er)&&(n.blendEquation(32774),b=Er,w=Er),ze)switch(te){case Ss:n.blendFuncSeparate(1,771,1,771);break;case rd:n.blendFunc(1,1);break;case sd:n.blendFuncSeparate(0,0,769,771);break;case od:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",te);break}else switch(te){case Ss:n.blendFuncSeparate(770,771,1,771);break;case rd:n.blendFunc(770,1);break;case sd:n.blendFunc(0,769);break;case od:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",te);break}v=null,g=null,S=null,T=null,d=te,M=ze}return}Te=Te||he,De=De||ge,Ye=Ye||Ae,(he!==b||Te!==w)&&(n.blendEquationSeparate(Z[he],Z[Te]),b=he,w=Te),(ge!==v||Ae!==g||De!==S||Ye!==T)&&(n.blendFuncSeparate(j[ge],j[Ae],j[De],j[Ye]),v=ge,g=Ae,S=De,T=Ye),d=te,M=null}function z(te,he){te.side===Xi?ae(2884):ne(2884);let ge=te.side===wt;he&&(ge=!ge),H(ge),te.blending===Ss&&te.transparent===!1?re(gi):re(te.blending,te.blendEquation,te.blendSrc,te.blendDst,te.blendEquationAlpha,te.blendSrcAlpha,te.blendDstAlpha,te.premultipliedAlpha),u.setFunc(te.depthFunc),u.setTest(te.depthTest),u.setMask(te.depthWrite),l.setMask(te.colorWrite);const Ae=te.stencilWrite;c.setTest(Ae),Ae&&(c.setMask(te.stencilWriteMask),c.setFunc(te.stencilFunc,te.stencilRef,te.stencilFuncMask),c.setOp(te.stencilFail,te.stencilZFail,te.stencilZPass)),se(te.polygonOffset,te.polygonOffsetFactor,te.polygonOffsetUnits),te.alphaToCoverage===!0?ne(32926):ae(32926)}function H(te){C!==te&&(te?n.frontFace(2304):n.frontFace(2305),C=te)}function K(te){te!==Cg?(ne(2884),te!==_&&(te===td?n.cullFace(1029):te===Rg?n.cullFace(1028):n.cullFace(1032))):ae(2884),_=te}function le(te){te!==P&&(L&&n.lineWidth(te),P=te)}function se(te,he,ge){te?(ne(32823),(E!==he||O!==ge)&&(n.polygonOffset(he,ge),E=he,O=ge)):ae(32823)}function U(te){te?ne(3089):ae(3089)}function D(te){te===void 0&&(te=33984+A-1),x!==te&&(n.activeTexture(te),x=te)}function $(te,he){x===null&&D();let ge=I[x];ge===void 0&&(ge={type:void 0,texture:void 0},I[x]=ge),(ge.type!==te||ge.texture!==he)&&(n.bindTexture(te,he||J[te]),ge.type=te,ge.texture=he)}function Y(){const te=I[x];te!==void 0&&te.type!==void 0&&(n.bindTexture(te.type,null),te.type=void 0,te.texture=void 0)}function ee(){try{n.compressedTexImage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function ce(){try{n.texImage2D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function ve(){try{n.texImage3D.apply(n,arguments)}catch(te){console.error("THREE.WebGLState:",te)}}function be(te){V.equals(te)===!1&&(n.scissor(te.x,te.y,te.z,te.w),V.copy(te))}function ue(te){k.equals(te)===!1&&(n.viewport(te.x,te.y,te.z,te.w),k.copy(te))}function me(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),f={},x=null,I={},h=null,p={},y=null,m=!1,d=null,b=null,v=null,g=null,w=null,S=null,T=null,M=!1,C=null,_=null,P=null,E=null,O=null,V.set(0,0,n.canvas.width,n.canvas.height),k.set(0,0,n.canvas.width,n.canvas.height),l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},enable:ne,disable:ae,bindFramebuffer:oe,bindXRFramebuffer:ie,useProgram:W,setBlending:re,setMaterial:z,setFlipSided:H,setCullFace:K,setLineWidth:le,setPolygonOffset:se,setScissorTest:U,activeTexture:D,bindTexture:$,unbindTexture:Y,compressedTexImage2D:ee,texImage2D:ce,texImage3D:ve,scissor:be,viewport:ue,reset:me}}function L3(n,e,t,i,r,s,o){const l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,f=r.maxTextureSize,h=r.maxSamples,p=new WeakMap;let y,m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function d(U,D){return m?new OffscreenCanvas(U,D):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(U,D,$,Y){let ee=1;if((U.width>Y||U.height>Y)&&(ee=Y/Math.max(U.width,U.height)),ee<1||D===!0)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap){const ce=D?oy:Math.floor,ve=ce(ee*U.width),be=ce(ee*U.height);y===void 0&&(y=d(ve,be));const ue=$?d(ve,be):y;return ue.width=ve,ue.height=be,ue.getContext("2d").drawImage(U,0,0,ve,be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+U.width+"x"+U.height+") to ("+ve+"x"+be+")."),ue}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+U.width+"x"+U.height+")."),U;return U}function v(U){return Cd(U.width)&&Cd(U.height)}function g(U){return l?!1:U.wrapS!==zt||U.wrapT!==zt||U.minFilter!==Mt&&U.minFilter!==gt}function w(U,D){return U.generateMipmaps&&D&&U.minFilter!==Mt&&U.minFilter!==gt}function S(U,D,$,Y,ee=1){n.generateMipmap(U);const ce=i.get(D);ce.__maxMipLevel=Math.log2(Math.max($,Y,ee))}function T(U,D,$){if(l===!1)return D;if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let Y=D;return D===6403&&($===5126&&(Y=33326),$===5131&&(Y=33325),$===5121&&(Y=33321)),D===6407&&($===5126&&(Y=34837),$===5131&&(Y=34843),$===5121&&(Y=32849)),D===6408&&($===5126&&(Y=34836),$===5131&&(Y=34842),$===5121&&(Y=32856)),(Y===33325||Y===33326||Y===34842||Y===34836)&&e.get("EXT_color_buffer_float"),Y}function M(U){return U===Mt||U===Wo||U===jo?9728:9729}function C(U){const D=U.target;D.removeEventListener("dispose",C),P(D),D.isVideoTexture&&p.delete(D),o.memory.textures--}function _(U){const D=U.target;D.removeEventListener("dispose",_),E(D)}function P(U){const D=i.get(U);D.__webglInit!==void 0&&(n.deleteTexture(D.__webglTexture),i.remove(U))}function E(U){const D=U.texture,$=i.get(U),Y=i.get(D);if(U){if(Y.__webglTexture!==void 0&&(n.deleteTexture(Y.__webglTexture),o.memory.textures--),U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ee=0;ee<6;ee++)n.deleteFramebuffer($.__webglFramebuffer[ee]),$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer[ee]);else n.deleteFramebuffer($.__webglFramebuffer),$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer),$.__webglMultisampledFramebuffer&&n.deleteFramebuffer($.__webglMultisampledFramebuffer),$.__webglColorRenderbuffer&&n.deleteRenderbuffer($.__webglColorRenderbuffer),$.__webglDepthRenderbuffer&&n.deleteRenderbuffer($.__webglDepthRenderbuffer);if(U.isWebGLMultipleRenderTargets)for(let ee=0,ce=D.length;ee<ce;ee++){const ve=i.get(D[ee]);ve.__webglTexture&&(n.deleteTexture(ve.__webglTexture),o.memory.textures--),i.remove(D[ee])}i.remove(D),i.remove(U)}}let O=0;function A(){O=0}function L(){const U=O;return U>=u&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+u),O+=1,U}function R(U,D){const $=i.get(U);if(U.isVideoTexture&&z(U),U.version>0&&$.__version!==U.version){const Y=U.image;if(Y===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G($,U,D);return}}t.activeTexture(33984+D),t.bindTexture(3553,$.__webglTexture)}function N(U,D){const $=i.get(U);if(U.version>0&&$.__version!==U.version){G($,U,D);return}t.activeTexture(33984+D),t.bindTexture(35866,$.__webglTexture)}function x(U,D){const $=i.get(U);if(U.version>0&&$.__version!==U.version){G($,U,D);return}t.activeTexture(33984+D),t.bindTexture(32879,$.__webglTexture)}function I(U,D){const $=i.get(U);if(U.version>0&&$.__version!==U.version){J($,U,D);return}t.activeTexture(33984+D),t.bindTexture(34067,$.__webglTexture)}const B={[Ji]:10497,[zt]:33071,[Ts]:33648},F={[Mt]:9728,[Wo]:9984,[jo]:9986,[gt]:9729,[El]:9985,[yi]:9987};function V(U,D,$){if($?(n.texParameteri(U,10242,B[D.wrapS]),n.texParameteri(U,10243,B[D.wrapT]),(U===32879||U===35866)&&n.texParameteri(U,32882,B[D.wrapR]),n.texParameteri(U,10240,F[D.magFilter]),n.texParameteri(U,10241,F[D.minFilter])):(n.texParameteri(U,10242,33071),n.texParameteri(U,10243,33071),(U===32879||U===35866)&&n.texParameteri(U,32882,33071),(D.wrapS!==zt||D.wrapT!==zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(U,10240,M(D.magFilter)),n.texParameteri(U,10241,M(D.minFilter)),D.minFilter!==Mt&&D.minFilter!==gt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Y=e.get("EXT_texture_filter_anisotropic");if(D.type===vi&&e.has("OES_texture_float_linear")===!1||l===!1&&D.type===Cr&&e.has("OES_texture_half_float_linear")===!1)return;(D.anisotropy>1||i.get(D).__currentAnisotropy)&&(n.texParameterf(U,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(D.anisotropy,r.getMaxAnisotropy())),i.get(D).__currentAnisotropy=D.anisotropy)}}function k(U,D){U.__webglInit===void 0&&(U.__webglInit=!0,D.addEventListener("dispose",C),U.__webglTexture=n.createTexture(),o.memory.textures++)}function G(U,D,$){let Y=3553;D.isDataTexture2DArray&&(Y=35866),D.isDataTexture3D&&(Y=32879),k(U,D),t.activeTexture(33984+$),t.bindTexture(Y,U.__webglTexture),n.pixelStorei(37440,D.flipY),n.pixelStorei(37441,D.premultiplyAlpha),n.pixelStorei(3317,D.unpackAlignment),n.pixelStorei(37443,0);const ee=g(D)&&v(D.image)===!1,ce=b(D.image,ee,!1,f),ve=v(ce)||l,be=s.convert(D.format);let ue=s.convert(D.type),me=T(D.internalFormat,be,ue);V(Y,D,ve);let te;const he=D.mipmaps;if(D.isDepthTexture)me=6402,l?D.type===vi?me=36012:D.type===Zo?me=33190:D.type===Es?me=35056:me=33189:D.type===vi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),D.format===Rr&&me===6402&&D.type!==$o&&D.type!==Zo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),D.type=$o,ue=s.convert(D.type)),D.format===As&&me===6402&&(me=34041,D.type!==Es&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),D.type=Es,ue=s.convert(D.type))),t.texImage2D(3553,0,me,ce.width,ce.height,0,be,ue,null);else if(D.isDataTexture)if(he.length>0&&ve){for(let ge=0,Ae=he.length;ge<Ae;ge++)te=he[ge],t.texImage2D(3553,ge,me,te.width,te.height,0,be,ue,te.data);D.generateMipmaps=!1,U.__maxMipLevel=he.length-1}else t.texImage2D(3553,0,me,ce.width,ce.height,0,be,ue,ce.data),U.__maxMipLevel=0;else if(D.isCompressedTexture){for(let ge=0,Ae=he.length;ge<Ae;ge++)te=he[ge],D.format!==hn&&D.format!==bi?be!==null?t.compressedTexImage2D(3553,ge,me,te.width,te.height,0,te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,ge,me,te.width,te.height,0,be,ue,te.data);U.__maxMipLevel=he.length-1}else if(D.isDataTexture2DArray)t.texImage3D(35866,0,me,ce.width,ce.height,ce.depth,0,be,ue,ce.data),U.__maxMipLevel=0;else if(D.isDataTexture3D)t.texImage3D(32879,0,me,ce.width,ce.height,ce.depth,0,be,ue,ce.data),U.__maxMipLevel=0;else if(he.length>0&&ve){for(let ge=0,Ae=he.length;ge<Ae;ge++)te=he[ge],t.texImage2D(3553,ge,me,be,ue,te);D.generateMipmaps=!1,U.__maxMipLevel=he.length-1}else t.texImage2D(3553,0,me,be,ue,ce),U.__maxMipLevel=0;w(D,ve)&&S(Y,D,ce.width,ce.height),U.__version=D.version,D.onUpdate&&D.onUpdate(D)}function J(U,D,$){if(D.image.length!==6)return;k(U,D),t.activeTexture(33984+$),t.bindTexture(34067,U.__webglTexture),n.pixelStorei(37440,D.flipY),n.pixelStorei(37441,D.premultiplyAlpha),n.pixelStorei(3317,D.unpackAlignment),n.pixelStorei(37443,0);const Y=D&&(D.isCompressedTexture||D.image[0].isCompressedTexture),ee=D.image[0]&&D.image[0].isDataTexture,ce=[];for(let ge=0;ge<6;ge++)!Y&&!ee?ce[ge]=b(D.image[ge],!1,!0,c):ce[ge]=ee?D.image[ge].image:D.image[ge];const ve=ce[0],be=v(ve)||l,ue=s.convert(D.format),me=s.convert(D.type),te=T(D.internalFormat,ue,me);V(34067,D,be);let he;if(Y){for(let ge=0;ge<6;ge++){he=ce[ge].mipmaps;for(let Ae=0;Ae<he.length;Ae++){const Te=he[Ae];D.format!==hn&&D.format!==bi?ue!==null?t.compressedTexImage2D(34069+ge,Ae,te,Te.width,Te.height,0,Te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+ge,Ae,te,Te.width,Te.height,0,ue,me,Te.data)}}U.__maxMipLevel=he.length-1}else{he=D.mipmaps;for(let ge=0;ge<6;ge++)if(ee){t.texImage2D(34069+ge,0,te,ce[ge].width,ce[ge].height,0,ue,me,ce[ge].data);for(let Ae=0;Ae<he.length;Ae++){const De=he[Ae].image[ge].image;t.texImage2D(34069+ge,Ae+1,te,De.width,De.height,0,ue,me,De.data)}}else{t.texImage2D(34069+ge,0,te,ue,me,ce[ge]);for(let Ae=0;Ae<he.length;Ae++){const Te=he[Ae];t.texImage2D(34069+ge,Ae+1,te,ue,me,Te.image[ge])}}U.__maxMipLevel=he.length}w(D,be)&&S(34067,D,ve.width,ve.height),U.__version=D.version,D.onUpdate&&D.onUpdate(D)}function ne(U,D,$,Y,ee){const ce=s.convert($.format),ve=s.convert($.type),be=T($.internalFormat,ce,ve);ee===32879||ee===35866?t.texImage3D(ee,0,be,D.width,D.height,D.depth,0,ce,ve,null):t.texImage2D(ee,0,be,D.width,D.height,0,ce,ve,null),t.bindFramebuffer(36160,U),n.framebufferTexture2D(36160,Y,ee,i.get($).__webglTexture,0),t.bindFramebuffer(36160,null)}function ae(U,D,$){if(n.bindRenderbuffer(36161,U),D.depthBuffer&&!D.stencilBuffer){let Y=33189;if($){const ee=D.depthTexture;ee&&ee.isDepthTexture&&(ee.type===vi?Y=36012:ee.type===Zo&&(Y=33190));const ce=re(D);n.renderbufferStorageMultisample(36161,ce,Y,D.width,D.height)}else n.renderbufferStorage(36161,Y,D.width,D.height);n.framebufferRenderbuffer(36160,36096,36161,U)}else if(D.depthBuffer&&D.stencilBuffer){if($){const Y=re(D);n.renderbufferStorageMultisample(36161,Y,35056,D.width,D.height)}else n.renderbufferStorage(36161,34041,D.width,D.height);n.framebufferRenderbuffer(36160,33306,36161,U)}else{const Y=D.isWebGLMultipleRenderTargets===!0?D.texture[0]:D.texture,ee=s.convert(Y.format),ce=s.convert(Y.type),ve=T(Y.internalFormat,ee,ce);if($){const be=re(D);n.renderbufferStorageMultisample(36161,be,ve,D.width,D.height)}else n.renderbufferStorage(36161,ve,D.width,D.height)}n.bindRenderbuffer(36161,null)}function ie(U,D){if(D&&D.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,U),!(D.depthTexture&&D.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(D.depthTexture).__webglTexture||D.depthTexture.image.width!==D.width||D.depthTexture.image.height!==D.height)&&(D.depthTexture.image.width=D.width,D.depthTexture.image.height=D.height,D.depthTexture.needsUpdate=!0),R(D.depthTexture,0);const Y=i.get(D.depthTexture).__webglTexture;if(D.depthTexture.format===Rr)n.framebufferTexture2D(36160,36096,3553,Y,0);else if(D.depthTexture.format===As)n.framebufferTexture2D(36160,33306,3553,Y,0);else throw new Error("Unknown depthTexture format")}function oe(U){const D=i.get(U),$=U.isWebGLCubeRenderTarget===!0;if(U.depthTexture){if($)throw new Error("target.depthTexture not supported in Cube render targets");ie(D.__webglFramebuffer,U)}else if($){D.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)t.bindFramebuffer(36160,D.__webglFramebuffer[Y]),D.__webglDepthbuffer[Y]=n.createRenderbuffer(),ae(D.__webglDepthbuffer[Y],U,!1)}else t.bindFramebuffer(36160,D.__webglFramebuffer),D.__webglDepthbuffer=n.createRenderbuffer(),ae(D.__webglDepthbuffer,U,!1);t.bindFramebuffer(36160,null)}function W(U){const D=U.texture,$=i.get(U),Y=i.get(D);U.addEventListener("dispose",_),U.isWebGLMultipleRenderTargets!==!0&&(Y.__webglTexture=n.createTexture(),Y.__version=D.version,o.memory.textures++);const ee=U.isWebGLCubeRenderTarget===!0,ce=U.isWebGLMultipleRenderTargets===!0,ve=U.isWebGLMultisampleRenderTarget===!0,be=D.isDataTexture3D||D.isDataTexture2DArray,ue=v(U)||l;if(l&&D.format===bi&&(D.type===vi||D.type===Cr)&&(D.format=hn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),ee){$.__webglFramebuffer=[];for(let me=0;me<6;me++)$.__webglFramebuffer[me]=n.createFramebuffer()}else if($.__webglFramebuffer=n.createFramebuffer(),ce)if(r.drawBuffers){const me=U.texture;for(let te=0,he=me.length;te<he;te++){const ge=i.get(me[te]);ge.__webglTexture===void 0&&(ge.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(ve)if(l){$.__webglMultisampledFramebuffer=n.createFramebuffer(),$.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,$.__webglColorRenderbuffer);const me=s.convert(D.format),te=s.convert(D.type),he=T(D.internalFormat,me,te),ge=re(U);n.renderbufferStorageMultisample(36161,ge,he,U.width,U.height),t.bindFramebuffer(36160,$.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,$.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),U.depthBuffer&&($.__webglDepthRenderbuffer=n.createRenderbuffer(),ae($.__webglDepthRenderbuffer,U,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ee){t.bindTexture(34067,Y.__webglTexture),V(34067,D,ue);for(let me=0;me<6;me++)ne($.__webglFramebuffer[me],U,D,36064,34069+me);w(D,ue)&&S(34067,D,U.width,U.height),t.bindTexture(34067,null)}else if(ce){const me=U.texture;for(let te=0,he=me.length;te<he;te++){const ge=me[te],Ae=i.get(ge);t.bindTexture(3553,Ae.__webglTexture),V(3553,ge,ue),ne($.__webglFramebuffer,U,ge,36064+te,3553),w(ge,ue)&&S(3553,ge,U.width,U.height)}t.bindTexture(3553,null)}else{let me=3553;be&&(l?me=D.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(me,Y.__webglTexture),V(me,D,ue),ne($.__webglFramebuffer,U,D,36064,me),w(D,ue)&&S(me,D,U.width,U.height,U.depth),t.bindTexture(me,null)}U.depthBuffer&&oe(U)}function Z(U){const D=v(U)||l,$=U.isWebGLMultipleRenderTargets===!0?U.texture:[U.texture];for(let Y=0,ee=$.length;Y<ee;Y++){const ce=$[Y];if(w(ce,D)){const ve=U.isWebGLCubeRenderTarget?34067:3553,be=i.get(ce).__webglTexture;t.bindTexture(ve,be),S(ve,ce,U.width,U.height),t.bindTexture(ve,null)}}}function j(U){if(U.isWebGLMultisampleRenderTarget)if(l){const D=U.width,$=U.height;let Y=16384;U.depthBuffer&&(Y|=256),U.stencilBuffer&&(Y|=1024);const ee=i.get(U);t.bindFramebuffer(36008,ee.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,ee.__webglFramebuffer),n.blitFramebuffer(0,0,D,$,0,0,D,$,Y,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,ee.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function re(U){return l&&U.isWebGLMultisampleRenderTarget?Math.min(h,U.samples):0}function z(U){const D=o.render.frame;p.get(U)!==D&&(p.set(U,D),U.update())}let H=!1,K=!1;function le(U,D){U&&U.isWebGLRenderTarget&&(H===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),H=!0),U=U.texture),R(U,D)}function se(U,D){U&&U.isWebGLCubeRenderTarget&&(K===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),K=!0),U=U.texture),I(U,D)}this.allocateTextureUnit=L,this.resetTextureUnits=A,this.setTexture2D=R,this.setTexture2DArray=N,this.setTexture3D=x,this.setTextureCube=I,this.setupRenderTarget=W,this.updateRenderTargetMipmap=Z,this.updateMultisampleRenderTarget=j,this.safeSetTexture2D=le,this.safeSetTextureCube=se}function Qy(n,e,t){const i=t.isWebGL2;function r(s){let o;if(s===Ar)return 5121;if(s===o0)return 32819;if(s===a0)return 32820;if(s===l0)return 33635;if(s===i0)return 5120;if(s===r0)return 5122;if(s===$o)return 5123;if(s===s0)return 5124;if(s===Zo)return 5125;if(s===vi)return 5126;if(s===Cr)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===c0)return 6406;if(s===bi)return 6407;if(s===hn)return 6408;if(s===u0)return 6409;if(s===d0)return 6410;if(s===Rr)return 6402;if(s===As)return 34041;if(s===f0)return 6403;if(s===p0)return 36244;if(s===m0)return 33319;if(s===g0)return 33320;if(s===y0)return 36248;if(s===v0)return 36249;if(s===dd||s===hd||s===fd||s===pd)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===dd)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===hd)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===fd)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===pd)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===md||s===gd||s===yd||s===vd)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===md)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===gd)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===yd)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===vd)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===b0)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===bd||s===xd)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===bd)return o.COMPRESSED_RGB8_ETC2;if(s===xd)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===x0||s===w0||s===M0||s===S0||s===_0||s===T0||s===E0||s===A0||s===C0||s===R0||s===L0||s===P0||s===I0||s===O0||s===D0||s===B0||s===F0||s===V0||s===k0||s===z0||s===U0||s===G0||s===H0||s===W0||s===j0||s===$0||s===Z0||s===X0)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===N0)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Es)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class sh extends Bt{constructor(e=[]){super(),this.cameras=e}}sh.prototype.isArrayCamera=!0;class Jn extends Ze{constructor(){super(),this.type="Group"}}Jn.prototype.isGroup=!0;const P3={type:"move"};class oh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Jn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Jn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Jn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new q),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const l=this._targetRay,u=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(l!==null&&(r=t.getPose(e.targetRaySpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(P3))),c&&e.hand){o=!0;for(const d of e.hand.values()){const b=t.getJointPose(d,i);if(c.joints[d.jointName]===void 0){const g=new Jn;g.matrixAutoUpdate=!1,g.visible=!1,c.joints[d.jointName]=g,c.add(g)}const v=c.joints[d.jointName];b!==null&&(v.matrix.fromArray(b.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=b.radius),v.visible=b!==null}const f=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],p=f.position.distanceTo(h.position),y=.02,m=.005;c.inputState.pinching&&p>y+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=y-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class I3 extends qi{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,h=null,p=null;const y=[],m=new Map,d=new Bt;d.layers.enable(1),d.viewport=new it;const b=new Bt;b.layers.enable(2),b.viewport=new it;const v=[d,b],g=new sh;g.layers.enable(1),g.layers.enable(2);let w=null,S=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let x=y[N];return x===void 0&&(x=new oh,y[N]=x),x.getTargetRaySpace()},this.getControllerGrip=function(N){let x=y[N];return x===void 0&&(x=new oh,y[N]=x),x.getGripSpace()},this.getHand=function(N){let x=y[N];return x===void 0&&(x=new oh,y[N]=x),x.getHandSpace()};function T(N){const x=m.get(N.inputSource);x&&x.dispatchEvent({type:N.type,data:N.inputSource})}function M(){m.forEach(function(N,x){N.disconnect(x)}),m.clear(),w=null,S=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),R.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(N){o=N,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(N){u=N,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(N){if(s=N,s!==null){s.addEventListener("select",T),s.addEventListener("selectstart",T),s.addEventListener("selectend",T),s.addEventListener("squeeze",T),s.addEventListener("squeezestart",T),s.addEventListener("squeezeend",T),s.addEventListener("end",M),s.addEventListener("inputsourceschange",C);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const I={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,I);s.updateRenderState({baseLayer:B})}else{let I=0;x.depth&&(I=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:I,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),h=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),R.setContext(s),R.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function C(N){const x=s.inputSources;for(let I=0;I<y.length;I++)m.set(x[I],y[I]);for(let I=0;I<N.removed.length;I++){const B=N.removed[I],F=m.get(B);F&&(F.dispatchEvent({type:"disconnected",data:B}),m.delete(B))}for(let I=0;I<N.added.length;I++){const B=N.added[I],F=m.get(B);F&&F.dispatchEvent({type:"connected",data:B})}}const _=new q,P=new q;function E(N,x,I){_.setFromMatrixPosition(x.matrixWorld),P.setFromMatrixPosition(I.matrixWorld);const B=_.distanceTo(P),F=x.projectionMatrix.elements,V=I.projectionMatrix.elements,k=F[14]/(F[10]-1),G=F[14]/(F[10]+1),J=(F[9]+1)/F[5],ne=(F[9]-1)/F[5],ae=(F[8]-1)/F[0],ie=(V[8]+1)/V[0],oe=k*ae,W=k*ie,Z=B/(-ae+ie),j=Z*-ae;x.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(j),N.translateZ(Z),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();const re=k+Z,z=G+Z,H=oe-j,K=W+(B-j),le=J*G/z*re,se=ne*G/z*re;N.projectionMatrix.makePerspective(H,K,le,se,re,z)}function O(N,x){x===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(x.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(s===null)return;g.near=b.near=d.near=N.near,g.far=b.far=d.far=N.far,(w!==g.near||S!==g.far)&&(s.updateRenderState({depthNear:g.near,depthFar:g.far}),w=g.near,S=g.far);const x=N.parent,I=g.cameras;O(g,x);for(let F=0;F<I.length;F++)O(I[F],x);g.matrixWorld.decompose(g.position,g.quaternion,g.scale),N.position.copy(g.position),N.quaternion.copy(g.quaternion),N.scale.copy(g.scale),N.matrix.copy(g.matrix),N.matrixWorld.copy(g.matrixWorld);const B=N.children;for(let F=0,V=B.length;F<V;F++)B[F].updateMatrixWorld(!0);I.length===2?E(g,d,b):g.projectionMatrix.copy(d.projectionMatrix)},this.getCamera=function(){return g};let A=null;function L(N,x){if(c=x.getViewerPose(l),c!==null){const B=c.views,F=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(F.framebuffer);let V=!1;B.length!==g.cameras.length&&(g.cameras.length=0,V=!0);for(let k=0;k<B.length;k++){const G=B[k];let J=null;if(s.renderState.layers===void 0)J=F.getViewport(G);else{const ae=f.getViewSubImage(p,G);r.bindXRFramebuffer(h),t.framebufferTexture2D(36160,36064,3553,ae.colorTexture,0),ae.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,ae.depthStencilTexture,0),J=ae.viewport}const ne=v[k];ne.matrix.fromArray(G.transform.matrix),ne.projectionMatrix.fromArray(G.projectionMatrix),ne.viewport.set(J.x,J.y,J.width,J.height),k===0&&g.matrix.copy(ne.matrix),V===!0&&g.cameras.push(ne)}}const I=s.inputSources;for(let B=0;B<y.length;B++){const F=y[B],V=I[B];F.update(V,x,l)}A&&A(N,x)}const R=new Ry;R.setAnimationLoop(L),this.setAnimationLoop=function(N){A=N},this.dispose=function(){}}}function O3(n){function e(v,g){v.fogColor.value.copy(g.color),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function t(v,g,w,S,T){g.isMeshBasicMaterial?i(v,g):g.isMeshLambertMaterial?(i(v,g),u(v,g)):g.isMeshToonMaterial?(i(v,g),f(v,g)):g.isMeshPhongMaterial?(i(v,g),c(v,g)):g.isMeshStandardMaterial?(i(v,g),g.isMeshPhysicalMaterial?p(v,g,T):h(v,g)):g.isMeshMatcapMaterial?(i(v,g),y(v,g)):g.isMeshDepthMaterial?(i(v,g),m(v,g)):g.isMeshDistanceMaterial?(i(v,g),d(v,g)):g.isMeshNormalMaterial?(i(v,g),b(v,g)):g.isLineBasicMaterial?(r(v,g),g.isLineDashedMaterial&&s(v,g)):g.isPointsMaterial?o(v,g,w,S):g.isSpriteMaterial?l(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function i(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap),g.specularMap&&(v.specularMap.value=g.specularMap);const w=n.get(g).envMap;if(w){v.envMap.value=w,v.flipEnvMap.value=w.isCubeTexture&&w._needsFlipEnvMap?-1:1,v.reflectivity.value=g.reflectivity,v.refractionRatio.value=g.refractionRatio;const M=n.get(w).__maxMipLevel;M!==void 0&&(v.maxMipLevel.value=M)}g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity);let S;g.map?S=g.map:g.specularMap?S=g.specularMap:g.displacementMap?S=g.displacementMap:g.normalMap?S=g.normalMap:g.bumpMap?S=g.bumpMap:g.roughnessMap?S=g.roughnessMap:g.metalnessMap?S=g.metalnessMap:g.alphaMap?S=g.alphaMap:g.emissiveMap?S=g.emissiveMap:g.clearcoatMap?S=g.clearcoatMap:g.clearcoatNormalMap?S=g.clearcoatNormalMap:g.clearcoatRoughnessMap&&(S=g.clearcoatRoughnessMap),S!==void 0&&(S.isWebGLRenderTarget&&(S=S.texture),S.matrixAutoUpdate===!0&&S.updateMatrix(),v.uvTransform.value.copy(S.matrix));let T;g.aoMap?T=g.aoMap:g.lightMap&&(T=g.lightMap),T!==void 0&&(T.isWebGLRenderTarget&&(T=T.texture),T.matrixAutoUpdate===!0&&T.updateMatrix(),v.uv2Transform.value.copy(T.matrix))}function r(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity}function s(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function o(v,g,w,S){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*w,v.scale.value=S*.5,g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap);let T;g.map?T=g.map:g.alphaMap&&(T=g.alphaMap),T!==void 0&&(T.matrixAutoUpdate===!0&&T.updateMatrix(),v.uvTransform.value.copy(T.matrix))}function l(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map),g.alphaMap&&(v.alphaMap.value=g.alphaMap);let w;g.map?w=g.map:g.alphaMap&&(w=g.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),v.uvTransform.value.copy(w.matrix))}function u(v,g){g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap)}function c(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function f(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function h(v,g){v.roughness.value=g.roughness,v.metalness.value=g.metalness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),n.get(g).envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function p(v,g,w){h(v,g),v.reflectivity.value=g.reflectivity,v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.sheen&&v.sheen.value.copy(g.sheen),g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),v.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===wt&&v.clearcoatNormalScale.value.negate()),v.transmission.value=g.transmission,g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap),g.transmission>0&&(v.transmissionSamplerMap.value=w.texture,v.transmissionSamplerSize.value.set(w.width,w.height)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)}function y(v,g){g.matcap&&(v.matcap.value=g.matcap),g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function m(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}function d(v,g){g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),v.referencePosition.value.copy(g.referencePosition),v.nearDistance.value=g.nearDistance,v.farDistance.value=g.farDistance}function b(v,g){g.bumpMap&&(v.bumpMap.value=g.bumpMap,v.bumpScale.value=g.bumpScale,g.side===wt&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,v.normalScale.value.copy(g.normalScale),g.side===wt&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function N3(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function rt(n={}){const e=n.canvas!==void 0?n.canvas:N3(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h=null,p=null;const y=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=tn,this.physicallyCorrectLights=!1,this.toneMapping=Yi,this.toneMappingExposure=1;const d=this;let b=!1,v=0,g=0,w=null,S=-1,T=null;const M=new it,C=new it;let _=null,P=e.width,E=e.height,O=1,A=null,L=null;const R=new it(0,0,P,E),N=new it(0,0,P,E);let x=!1;const I=[],B=new na;let F=!1,V=!1,k=null;const G=new Ne,J=new q,ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ae(){return w===null?O:1}let ie=t;function oe(X,pe){for(let de=0;de<X.length;de++){const ye=X[de],Me=e.getContext(ye,pe);if(Me!==null)return Me}return null}try{const X={alpha:i,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:f};if(e.addEventListener("webglcontextlost",De,!1),e.addEventListener("webglcontextrestored",Ye,!1),ie===null){const pe=["webgl2","webgl","experimental-webgl"];if(d.isWebGL1Renderer===!0&&pe.shift(),ie=oe(pe,X),ie===null)throw oe(pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}ie.getShaderPrecisionFormat===void 0&&(ie.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(X){throw console.error("THREE.WebGLRenderer: "+X.message),X}let W,Z,j,re,z,H,K,le,se,U,D,$,Y,ee,ce,ve,be,ue,me,te,he,ge;function Ae(){W=new rO(ie),Z=new tO(ie,W,n),W.init(Z),he=new Qy(ie,W,Z),j=new R3(ie,W,Z),I[0]=1029,re=new aO,z=new v3,H=new L3(ie,W,j,z,Z,he,re),K=new iO(d),le=new LL(ie,Z),ge=new QI(ie,W,le,Z),se=new sO(ie,le,re,ge),U=new dO(ie,se,le,re),ue=new uO(ie),ce=new nO(z),D=new y3(d,K,W,Z,ge,ce),$=new O3(z),Y=new x3(z),ee=new E3(W,Z),be=new qI(d,K,j,U,l),ve=new qy(d,U,Z),me=new eO(ie,W,re,Z),te=new oO(ie,W,re,Z),re.programs=D.programs,d.capabilities=Z,d.extensions=W,d.properties=z,d.renderLists=Y,d.shadowMap=ve,d.state=j,d.info=re}Ae();const Te=new I3(d,ie);this.xr=Te,this.getContext=function(){return ie},this.getContextAttributes=function(){return ie.getContextAttributes()},this.forceContextLoss=function(){const X=W.get("WEBGL_lose_context");X&&X.loseContext()},this.forceContextRestore=function(){const X=W.get("WEBGL_lose_context");X&&X.restoreContext()},this.getPixelRatio=function(){return O},this.setPixelRatio=function(X){X!==void 0&&(O=X,this.setSize(P,E,!1))},this.getSize=function(X){return X.set(P,E)},this.setSize=function(X,pe,de){if(Te.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}P=X,E=pe,e.width=Math.floor(X*O),e.height=Math.floor(pe*O),de!==!1&&(e.style.width=X+"px",e.style.height=pe+"px"),this.setViewport(0,0,X,pe)},this.getDrawingBufferSize=function(X){return X.set(P*O,E*O).floor()},this.setDrawingBufferSize=function(X,pe,de){P=X,E=pe,O=de,e.width=Math.floor(X*de),e.height=Math.floor(pe*de),this.setViewport(0,0,X,pe)},this.getCurrentViewport=function(X){return X.copy(M)},this.getViewport=function(X){return X.copy(R)},this.setViewport=function(X,pe,de,ye){X.isVector4?R.set(X.x,X.y,X.z,X.w):R.set(X,pe,de,ye),j.viewport(M.copy(R).multiplyScalar(O).floor())},this.getScissor=function(X){return X.copy(N)},this.setScissor=function(X,pe,de,ye){X.isVector4?N.set(X.x,X.y,X.z,X.w):N.set(X,pe,de,ye),j.scissor(C.copy(N).multiplyScalar(O).floor())},this.getScissorTest=function(){return x},this.setScissorTest=function(X){j.setScissorTest(x=X)},this.setOpaqueSort=function(X){A=X},this.setTransparentSort=function(X){L=X},this.getClearColor=function(X){return X.copy(be.getClearColor())},this.setClearColor=function(){be.setClearColor.apply(be,arguments)},this.getClearAlpha=function(){return be.getClearAlpha()},this.setClearAlpha=function(){be.setClearAlpha.apply(be,arguments)},this.clear=function(X,pe,de){let ye=0;(X===void 0||X)&&(ye|=16384),(pe===void 0||pe)&&(ye|=256),(de===void 0||de)&&(ye|=1024),ie.clear(ye)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",De,!1),e.removeEventListener("webglcontextrestored",Ye,!1),Y.dispose(),ee.dispose(),z.dispose(),K.dispose(),U.dispose(),ge.dispose(),Te.dispose(),Te.removeEventListener("sessionstart",Ot),Te.removeEventListener("sessionend",mt),k&&(k.dispose(),k=null),bt.stop()};function De(X){X.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Ye(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const X=re.autoReset,pe=ve.enabled,de=ve.autoUpdate,ye=ve.needsUpdate,Me=ve.type;Ae(),re.autoReset=X,ve.enabled=pe,ve.autoUpdate=de,ve.needsUpdate=ye,ve.type=Me}function ze(X){const pe=X.target;pe.removeEventListener("dispose",ze),st(pe)}function st(X){Ce(X),z.remove(X)}function Ce(X){const pe=z.get(X).programs;pe!==void 0&&pe.forEach(function(de){D.releaseProgram(de)})}function He(X,pe){X.render(function(de){d.renderBufferImmediate(de,pe)})}this.renderBufferImmediate=function(X,pe){ge.initAttributes();const de=z.get(X);X.hasPositions&&!de.position&&(de.position=ie.createBuffer()),X.hasNormals&&!de.normal&&(de.normal=ie.createBuffer()),X.hasUvs&&!de.uv&&(de.uv=ie.createBuffer()),X.hasColors&&!de.color&&(de.color=ie.createBuffer());const ye=pe.getAttributes();X.hasPositions&&(ie.bindBuffer(34962,de.position),ie.bufferData(34962,X.positionArray,35048),ge.enableAttribute(ye.position),ie.vertexAttribPointer(ye.position,3,5126,!1,0,0)),X.hasNormals&&(ie.bindBuffer(34962,de.normal),ie.bufferData(34962,X.normalArray,35048),ge.enableAttribute(ye.normal),ie.vertexAttribPointer(ye.normal,3,5126,!1,0,0)),X.hasUvs&&(ie.bindBuffer(34962,de.uv),ie.bufferData(34962,X.uvArray,35048),ge.enableAttribute(ye.uv),ie.vertexAttribPointer(ye.uv,2,5126,!1,0,0)),X.hasColors&&(ie.bindBuffer(34962,de.color),ie.bufferData(34962,X.colorArray,35048),ge.enableAttribute(ye.color),ie.vertexAttribPointer(ye.color,3,5126,!1,0,0)),ge.disableUnusedAttributes(),ie.drawArrays(4,0,X.count),X.count=0},this.renderBufferDirect=function(X,pe,de,ye,Me,fe){pe===null&&(pe=ne);const xe=Me.isMesh&&Me.matrixWorld.determinant()<0,_e=Ee(X,pe,ye,Me);j.setMaterial(ye,xe);let Pe=de.index;const Oe=de.attributes.position;if(Pe===null){if(Oe===void 0||Oe.count===0)return}else if(Pe.count===0)return;let Ue=1;ye.wireframe===!0&&(Pe=se.getWireframeAttribute(de),Ue=2),(ye.morphTargets||ye.morphNormals)&&ue.update(Me,de,ye,_e),ge.setup(Me,ye,_e,de,Pe);let Fe,qe=me;Pe!==null&&(Fe=le.get(Pe),qe=te,qe.setIndex(Fe));const Rt=Pe!==null?Pe.count:Oe.count,Gt=de.drawRange.start*Ue,is=de.drawRange.count*Ue,ut=fe!==null?fe.start*Ue:0,rs=fe!==null?fe.count*Ue:1/0,qt=Math.max(Gt,ut),jF=Math.min(Rt,Gt+is,ut+rs)-1,Wc=Math.max(0,jF-qt+1);if(Wc!==0){if(Me.isMesh)ye.wireframe===!0?(j.setLineWidth(ye.wireframeLinewidth*ae()),qe.setMode(1)):qe.setMode(4);else if(Me.isLine){let Ba=ye.linewidth;Ba===void 0&&(Ba=1),j.setLineWidth(Ba*ae()),Me.isLineSegments?qe.setMode(1):Me.isLineLoop?qe.setMode(2):qe.setMode(3)}else Me.isPoints?qe.setMode(0):Me.isSprite&&qe.setMode(4);if(Me.isInstancedMesh)qe.renderInstances(qt,Wc,Me.count);else if(de.isInstancedBufferGeometry){const Ba=Math.min(de.instanceCount,de._maxInstanceCount);qe.renderInstances(qt,Wc,Ba)}else qe.render(qt,Wc)}},this.compile=function(X,pe){p=ee.get(X),p.init(),X.traverseVisible(function(de){de.isLight&&de.layers.test(pe.layers)&&(p.pushLight(de),de.castShadow&&p.pushShadow(de))}),p.setupLights(),X.traverse(function(de){const ye=de.material;if(ye)if(Array.isArray(ye))for(let Me=0;Me<ye.length;Me++){const fe=ye[Me];Q(fe,X,de)}else Q(ye,X,de)})};let Ge=null;function It(X){Ge&&Ge(X)}function Ot(){bt.stop()}function mt(){bt.start()}const bt=new Ry;bt.setAnimationLoop(It),typeof window<"u"&&bt.setContext(window),this.setAnimationLoop=function(X){Ge=X,Te.setAnimationLoop(X),X===null?bt.stop():bt.start()},Te.addEventListener("sessionstart",Ot),Te.addEventListener("sessionend",mt),this.render=function(X,pe){if(pe!==void 0&&pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;X.autoUpdate===!0&&X.updateMatrixWorld(),pe.parent===null&&pe.updateMatrixWorld(),Te.enabled===!0&&Te.isPresenting===!0&&(Te.cameraAutoUpdate===!0&&Te.updateCamera(pe),pe=Te.getCamera()),X.isScene===!0&&X.onBeforeRender(d,X,pe,w),p=ee.get(X,m.length),p.init(),m.push(p),G.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),B.setFromProjectionMatrix(G),V=this.localClippingEnabled,F=ce.init(this.clippingPlanes,V,pe),h=Y.get(X,y.length),h.init(),y.push(h),Ii(X,pe,0,d.sortObjects),h.finish(),d.sortObjects===!0&&h.sort(A,L),F===!0&&ce.beginShadows();const de=p.state.shadowsArray;ve.render(de,X,pe),p.setupLights(),p.setupLightsView(pe),F===!0&&ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),be.render(h,X);const ye=h.opaque,Me=h.transmissive,fe=h.transparent;ye.length>0&&zn(ye,X,pe),Me.length>0&&Oi(ye,Me,X,pe),fe.length>0&&zn(fe,X,pe),w!==null&&(H.updateMultisampleRenderTarget(w),H.updateRenderTargetMipmap(w)),X.isScene===!0&&X.onAfterRender(d,X,pe),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),ge.resetDefaultState(),S=-1,T=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,y.pop(),y.length>0?h=y[y.length-1]:h=null};function Ii(X,pe,de,ye){if(X.visible===!1)return;if(X.layers.test(pe.layers)){if(X.isGroup)de=X.renderOrder;else if(X.isLOD)X.autoUpdate===!0&&X.update(pe);else if(X.isLight)p.pushLight(X),X.castShadow&&p.pushShadow(X);else if(X.isSprite){if(!X.frustumCulled||B.intersectsSprite(X)){ye&&J.setFromMatrixPosition(X.matrixWorld).applyMatrix4(G);const xe=U.update(X),_e=X.material;_e.visible&&h.push(X,xe,_e,de,J.z,null)}}else if(X.isImmediateRenderObject)ye&&J.setFromMatrixPosition(X.matrixWorld).applyMatrix4(G),h.push(X,null,X.material,de,J.z,null);else if((X.isMesh||X.isLine||X.isPoints)&&(X.isSkinnedMesh&&X.skeleton.frame!==re.render.frame&&(X.skeleton.update(),X.skeleton.frame=re.render.frame),!X.frustumCulled||B.intersectsObject(X))){ye&&J.setFromMatrixPosition(X.matrixWorld).applyMatrix4(G);const xe=U.update(X),_e=X.material;if(Array.isArray(_e)){const Pe=xe.groups;for(let Oe=0,Ue=Pe.length;Oe<Ue;Oe++){const Fe=Pe[Oe],qe=_e[Fe.materialIndex];qe&&qe.visible&&h.push(X,xe,qe,de,J.z,Fe)}}else _e.visible&&h.push(X,xe,_e,de,J.z,null)}}const fe=X.children;for(let xe=0,_e=fe.length;xe<_e;xe++)Ii(fe[xe],pe,de,ye)}function Oi(X,pe,de,ye){if(k===null){const _e=o===!0&&Z.isWebGL2===!0?Pd:Pn;k=new _e(1024,1024,{generateMipmaps:!0,type:he.convert(Cr)!==null?Cr:Ar,minFilter:yi,magFilter:Mt,wrapS:zt,wrapT:zt})}const Me=d.getRenderTarget();d.setRenderTarget(k),d.clear();const fe=d.toneMapping;d.toneMapping=Yi,zn(X,de,ye),d.toneMapping=fe,H.updateMultisampleRenderTarget(k),H.updateRenderTargetMipmap(k),d.setRenderTarget(Me),zn(pe,de,ye)}function zn(X,pe,de){const ye=pe.isScene===!0?pe.overrideMaterial:null;for(let Me=0,fe=X.length;Me<fe;Me++){const xe=X[Me],_e=xe.object,Pe=xe.geometry,Oe=ye===null?xe.material:ye,Ue=xe.group;if(de.isArrayCamera){const Fe=de.cameras;for(let qe=0,Rt=Fe.length;qe<Rt;qe++){const Gt=Fe[qe];_e.layers.test(Gt.layers)&&(j.viewport(M.copy(Gt.viewport)),p.setupLightsView(Gt),ns(_e,pe,Gt,Pe,Oe,Ue))}}else ns(_e,pe,de,Pe,Oe,Ue)}}function ns(X,pe,de,ye,Me,fe){if(X.onBeforeRender(d,pe,de,ye,Me,fe),X.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse,X.matrixWorld),X.normalMatrix.getNormalMatrix(X.modelViewMatrix),X.isImmediateRenderObject){const xe=Ee(de,pe,Me,X);j.setMaterial(Me),ge.reset(),He(X,xe)}else Me.transparent===!0&&Me.side===Xi?(Me.side=wt,Me.needsUpdate=!0,d.renderBufferDirect(de,pe,ye,Me,X,fe),Me.side=Zi,Me.needsUpdate=!0,d.renderBufferDirect(de,pe,ye,Me,X,fe),Me.side=Xi):d.renderBufferDirect(de,pe,ye,Me,X,fe);X.onAfterRender(d,pe,de,ye,Me,fe)}function Q(X,pe,de){pe.isScene!==!0&&(pe=ne);const ye=z.get(X),Me=p.state.lights,fe=p.state.shadowsArray,xe=Me.state.version,_e=D.getParameters(X,Me.state,fe,pe,de),Pe=D.getProgramCacheKey(_e);let Oe=ye.programs;ye.environment=X.isMeshStandardMaterial?pe.environment:null,ye.fog=pe.fog,ye.envMap=K.get(X.envMap||ye.environment),Oe===void 0&&(X.addEventListener("dispose",ze),Oe=new Map,ye.programs=Oe);let Ue=Oe.get(Pe);if(Ue!==void 0){if(ye.currentProgram===Ue&&ye.lightsStateVersion===xe)return we(X,_e),Ue}else _e.uniforms=D.getUniforms(X),X.onBuild(_e,d),X.onBeforeCompile(_e,d),Ue=D.acquireProgram(_e,Pe),Oe.set(Pe,Ue),ye.uniforms=_e.uniforms;const Fe=ye.uniforms;(!X.isShaderMaterial&&!X.isRawShaderMaterial||X.clipping===!0)&&(Fe.clippingPlanes=ce.uniform),we(X,_e),ye.needsLights=Ke(X),ye.lightsStateVersion=xe,ye.needsLights&&(Fe.ambientLightColor.value=Me.state.ambient,Fe.lightProbe.value=Me.state.probe,Fe.directionalLights.value=Me.state.directional,Fe.directionalLightShadows.value=Me.state.directionalShadow,Fe.spotLights.value=Me.state.spot,Fe.spotLightShadows.value=Me.state.spotShadow,Fe.rectAreaLights.value=Me.state.rectArea,Fe.ltc_1.value=Me.state.rectAreaLTC1,Fe.ltc_2.value=Me.state.rectAreaLTC2,Fe.pointLights.value=Me.state.point,Fe.pointLightShadows.value=Me.state.pointShadow,Fe.hemisphereLights.value=Me.state.hemi,Fe.directionalShadowMap.value=Me.state.directionalShadowMap,Fe.directionalShadowMatrix.value=Me.state.directionalShadowMatrix,Fe.spotShadowMap.value=Me.state.spotShadowMap,Fe.spotShadowMatrix.value=Me.state.spotShadowMatrix,Fe.pointShadowMap.value=Me.state.pointShadowMap,Fe.pointShadowMatrix.value=Me.state.pointShadowMatrix);const qe=Ue.getUniforms(),Rt=ar.seqWithValue(qe.seq,Fe);return ye.currentProgram=Ue,ye.uniformsList=Rt,Ue}function we(X,pe){const de=z.get(X);de.outputEncoding=pe.outputEncoding,de.instancing=pe.instancing,de.skinning=pe.skinning,de.numClippingPlanes=pe.numClippingPlanes,de.numIntersection=pe.numClipIntersection,de.vertexAlphas=pe.vertexAlphas}function Ee(X,pe,de,ye){pe.isScene!==!0&&(pe=ne),H.resetTextureUnits();const Me=pe.fog,fe=de.isMeshStandardMaterial?pe.environment:null,xe=w===null?d.outputEncoding:w.texture.encoding,_e=K.get(de.envMap||fe),Pe=de.vertexColors===!0&&ye.geometry&&ye.geometry.attributes.color&&ye.geometry.attributes.color.itemSize===4,Oe=z.get(de),Ue=p.state.lights;if(F===!0&&(V===!0||X!==T)){const qt=X===T&&de.id===S;ce.setState(de,X,qt)}let Fe=!1;de.version===Oe.__version?(Oe.needsLights&&Oe.lightsStateVersion!==Ue.state.version||Oe.outputEncoding!==xe||ye.isInstancedMesh&&Oe.instancing===!1||!ye.isInstancedMesh&&Oe.instancing===!0||ye.isSkinnedMesh&&Oe.skinning===!1||!ye.isSkinnedMesh&&Oe.skinning===!0||Oe.envMap!==_e||de.fog&&Oe.fog!==Me||Oe.numClippingPlanes!==void 0&&(Oe.numClippingPlanes!==ce.numPlanes||Oe.numIntersection!==ce.numIntersection)||Oe.vertexAlphas!==Pe)&&(Fe=!0):(Fe=!0,Oe.__version=de.version);let qe=Oe.currentProgram;Fe===!0&&(qe=Q(de,pe,ye));let Rt=!1,Gt=!1,is=!1;const ut=qe.getUniforms(),rs=Oe.uniforms;if(j.useProgram(qe.program)&&(Rt=!0,Gt=!0,is=!0),de.id!==S&&(S=de.id,Gt=!0),Rt||T!==X){if(ut.setValue(ie,"projectionMatrix",X.projectionMatrix),Z.logarithmicDepthBuffer&&ut.setValue(ie,"logDepthBufFC",2/(Math.log(X.far+1)/Math.LN2)),T!==X&&(T=X,Gt=!0,is=!0),de.isShaderMaterial||de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshStandardMaterial||de.envMap){const qt=ut.map.cameraPosition;qt!==void 0&&qt.setValue(ie,J.setFromMatrixPosition(X.matrixWorld))}(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&ut.setValue(ie,"isOrthographic",X.isOrthographicCamera===!0),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial||de.isShadowMaterial||ye.isSkinnedMesh)&&ut.setValue(ie,"viewMatrix",X.matrixWorldInverse)}if(ye.isSkinnedMesh){ut.setOptional(ie,ye,"bindMatrix"),ut.setOptional(ie,ye,"bindMatrixInverse");const qt=ye.skeleton;qt&&(Z.floatVertexTextures?(qt.boneTexture===null&&qt.computeBoneTexture(),ut.setValue(ie,"boneTexture",qt.boneTexture,H),ut.setValue(ie,"boneTextureSize",qt.boneTextureSize)):ut.setOptional(ie,qt,"boneMatrices"))}return(Gt||Oe.receiveShadow!==ye.receiveShadow)&&(Oe.receiveShadow=ye.receiveShadow,ut.setValue(ie,"receiveShadow",ye.receiveShadow)),Gt&&(ut.setValue(ie,"toneMappingExposure",d.toneMappingExposure),Oe.needsLights&&Be(rs,is),Me&&de.fog&&$.refreshFogUniforms(rs,Me),$.refreshMaterialUniforms(rs,de,O,E,k),ar.upload(ie,Oe.uniformsList,rs,H)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(ar.upload(ie,Oe.uniformsList,rs,H),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&ut.setValue(ie,"center",ye.center),ut.setValue(ie,"modelViewMatrix",ye.modelViewMatrix),ut.setValue(ie,"normalMatrix",ye.normalMatrix),ut.setValue(ie,"modelMatrix",ye.matrixWorld),qe}function Be(X,pe){X.ambientLightColor.needsUpdate=pe,X.lightProbe.needsUpdate=pe,X.directionalLights.needsUpdate=pe,X.directionalLightShadows.needsUpdate=pe,X.pointLights.needsUpdate=pe,X.pointLightShadows.needsUpdate=pe,X.spotLights.needsUpdate=pe,X.spotLightShadows.needsUpdate=pe,X.rectAreaLights.needsUpdate=pe,X.hemisphereLights.needsUpdate=pe}function Ke(X){return X.isMeshLambertMaterial||X.isMeshToonMaterial||X.isMeshPhongMaterial||X.isMeshStandardMaterial||X.isShadowMaterial||X.isShaderMaterial&&X.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return g},this.getRenderTarget=function(){return w},this.setRenderTarget=function(X,pe=0,de=0){w=X,v=pe,g=de,X&&z.get(X).__webglFramebuffer===void 0&&H.setupRenderTarget(X);let ye=null,Me=!1,fe=!1;if(X){const _e=X.texture;(_e.isDataTexture3D||_e.isDataTexture2DArray)&&(fe=!0);const Pe=z.get(X).__webglFramebuffer;X.isWebGLCubeRenderTarget?(ye=Pe[pe],Me=!0):X.isWebGLMultisampleRenderTarget?ye=z.get(X).__webglMultisampledFramebuffer:ye=Pe,M.copy(X.viewport),C.copy(X.scissor),_=X.scissorTest}else M.copy(R).multiplyScalar(O).floor(),C.copy(N).multiplyScalar(O).floor(),_=x;if(j.bindFramebuffer(36160,ye)&&Z.drawBuffers){let _e=!1;if(X)if(X.isWebGLMultipleRenderTargets){const Pe=X.texture;if(I.length!==Pe.length||I[0]!==36064){for(let Oe=0,Ue=Pe.length;Oe<Ue;Oe++)I[Oe]=36064+Oe;I.length=Pe.length,_e=!0}}else(I.length!==1||I[0]!==36064)&&(I[0]=36064,I.length=1,_e=!0);else(I.length!==1||I[0]!==1029)&&(I[0]=1029,I.length=1,_e=!0);_e&&(Z.isWebGL2?ie.drawBuffers(I):W.get("WEBGL_draw_buffers").drawBuffersWEBGL(I))}if(j.viewport(M),j.scissor(C),j.setScissorTest(_),Me){const _e=z.get(X.texture);ie.framebufferTexture2D(36160,36064,34069+pe,_e.__webglTexture,de)}else if(fe){const _e=z.get(X.texture),Pe=pe||0;ie.framebufferTextureLayer(36160,36064,_e.__webglTexture,de||0,Pe)}},this.readRenderTargetPixels=function(X,pe,de,ye,Me,fe,xe){if(!(X&&X.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let _e=z.get(X).__webglFramebuffer;if(X.isWebGLCubeRenderTarget&&xe!==void 0&&(_e=_e[xe]),_e){j.bindFramebuffer(36160,_e);try{const Pe=X.texture,Oe=Pe.format,Ue=Pe.type;if(Oe!==hn&&he.convert(Oe)!==ie.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Fe=Ue===Cr&&(W.has("EXT_color_buffer_half_float")||Z.isWebGL2&&W.has("EXT_color_buffer_float"));if(Ue!==Ar&&he.convert(Ue)!==ie.getParameter(35738)&&!(Ue===vi&&(Z.isWebGL2||W.has("OES_texture_float")||W.has("WEBGL_color_buffer_float")))&&!Fe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie.checkFramebufferStatus(36160)===36053?pe>=0&&pe<=X.width-ye&&de>=0&&de<=X.height-Me&&ie.readPixels(pe,de,ye,Me,he.convert(Oe),he.convert(Ue),fe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Pe=w!==null?z.get(w).__webglFramebuffer:null;j.bindFramebuffer(36160,Pe)}}},this.copyFramebufferToTexture=function(X,pe,de=0){const ye=Math.pow(2,-de),Me=Math.floor(pe.image.width*ye),fe=Math.floor(pe.image.height*ye);let xe=he.convert(pe.format);Z.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),H.setTexture2D(pe,0),ie.copyTexImage2D(3553,de,xe,X.x,X.y,Me,fe,0),j.unbindTexture()},this.copyTextureToTexture=function(X,pe,de,ye=0){const Me=pe.image.width,fe=pe.image.height,xe=he.convert(de.format),_e=he.convert(de.type);H.setTexture2D(de,0),ie.pixelStorei(37440,de.flipY),ie.pixelStorei(37441,de.premultiplyAlpha),ie.pixelStorei(3317,de.unpackAlignment),pe.isDataTexture?ie.texSubImage2D(3553,ye,X.x,X.y,Me,fe,xe,_e,pe.image.data):pe.isCompressedTexture?ie.compressedTexSubImage2D(3553,ye,X.x,X.y,pe.mipmaps[0].width,pe.mipmaps[0].height,xe,pe.mipmaps[0].data):ie.texSubImage2D(3553,ye,X.x,X.y,xe,_e,pe.image),ye===0&&de.generateMipmaps&&ie.generateMipmap(3553),j.unbindTexture()},this.copyTextureToTexture3D=function(X,pe,de,ye,Me=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const fe=X.max.x-X.min.x+1,xe=X.max.y-X.min.y+1,_e=X.max.z-X.min.z+1,Pe=he.convert(ye.format),Oe=he.convert(ye.type);let Ue;if(ye.isDataTexture3D)H.setTexture3D(ye,0),Ue=32879;else if(ye.isDataTexture2DArray)H.setTexture2DArray(ye,0),Ue=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ie.pixelStorei(37440,ye.flipY),ie.pixelStorei(37441,ye.premultiplyAlpha),ie.pixelStorei(3317,ye.unpackAlignment);const Fe=ie.getParameter(3314),qe=ie.getParameter(32878),Rt=ie.getParameter(3316),Gt=ie.getParameter(3315),is=ie.getParameter(32877),ut=de.isCompressedTexture?de.mipmaps[0]:de.image;ie.pixelStorei(3314,ut.width),ie.pixelStorei(32878,ut.height),ie.pixelStorei(3316,X.min.x),ie.pixelStorei(3315,X.min.y),ie.pixelStorei(32877,X.min.z),de.isDataTexture||de.isDataTexture3D?ie.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,_e,Pe,Oe,ut.data):de.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ie.compressedTexSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,_e,Pe,ut.data)):ie.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,_e,Pe,Oe,ut),ie.pixelStorei(3314,Fe),ie.pixelStorei(32878,qe),ie.pixelStorei(3316,Rt),ie.pixelStorei(3315,Gt),ie.pixelStorei(32877,is),Me===0&&ye.generateMipmaps&&ie.generateMipmap(Ue),j.unbindTexture()},this.initTexture=function(X){H.setTexture2D(X,0),j.unbindTexture()},this.resetState=function(){v=0,g=0,w=null,j.reset(),ge.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class ev extends rt{}ev.prototype.isWebGL1Renderer=!0;class sa{constructor(e,t=25e-5){this.name="",this.color=new Re(e),this.density=t}clone(){return new sa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}sa.prototype.isFogExp2=!0;class oa{constructor(e,t=1,i=1e3){this.name="",this.color=new Re(e),this.near=t,this.far=i}clone(){return new oa(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}oa.prototype.isFog=!0;class nc extends Ze{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}nc.prototype.isScene=!0;class lr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Rs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}lr.prototype.isInterleavedBuffer=!0;const Et=new q;class Ci{constructor(e,t,i,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Et.x=this.getX(t),Et.y=this.getY(t),Et.z=this.getZ(t),Et.applyMatrix4(e),this.setXYZ(t,Et.x,Et.y,Et.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Et.x=this.getX(t),Et.y=this.getY(t),Et.z=this.getZ(t),Et.applyNormalMatrix(e),this.setXYZ(t,Et.x,Et.y,Et.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Et.x=this.getX(t),Et.y=this.getY(t),Et.z=this.getZ(t),Et.transformDirection(e),this.setXYZ(t,Et.x,Et.y,Et.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new je(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ci(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Ci.prototype.isInterleavedBufferAttribute=!0;class aa extends Pt{constructor(e){super(),this.type="SpriteMaterial",this.color=new Re(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}aa.prototype.isSpriteMaterial=!0;let Xs;const la=new q,Ys=new q,Js=new q,Ks=new Se,ca=new Se,tv=new Ne,ic=new q,ua=new q,rc=new q,nv=new Se,ah=new Se,iv=new Se;class da extends Ze{constructor(e){if(super(),this.type="Sprite",Xs===void 0){Xs=new ke;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new lr(t,5);Xs.setIndex([0,1,2,0,2,3]),Xs.setAttribute("position",new Ci(i,3,0,!1)),Xs.setAttribute("uv",new Ci(i,2,3,!1))}this.geometry=Xs,this.material=e!==void 0?e:new aa,this.center=new Se(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ys.setFromMatrixScale(this.matrixWorld),tv.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Js.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ys.multiplyScalar(-Js.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;sc(ic.set(-.5,-.5,0),Js,o,Ys,r,s),sc(ua.set(.5,-.5,0),Js,o,Ys,r,s),sc(rc.set(.5,.5,0),Js,o,Ys,r,s),nv.set(0,0),ah.set(1,0),iv.set(1,1);let l=e.ray.intersectTriangle(ic,ua,rc,!1,la);if(l===null&&(sc(ua.set(-.5,.5,0),Js,o,Ys,r,s),ah.set(0,1),l=e.ray.intersectTriangle(ic,rc,ua,!1,la),l===null))return;const u=e.ray.origin.distanceTo(la);u<e.near||u>e.far||t.push({distance:u,point:la.clone(),uv:_t.getUV(la,ic,ua,rc,nv,ah,iv,new Se),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}da.prototype.isSprite=!0;function sc(n,e,t,i,r,s){Ks.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(ca.x=s*Ks.x-r*Ks.y,ca.y=r*Ks.x+s*Ks.y):ca.copy(Ks),n.copy(e),n.x+=ca.x,n.y+=ca.y,n.applyMatrix4(tv)}const oc=new q,rv=new q;class sv extends Ze{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){oc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(oc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){oc.setFromMatrixPosition(e.matrixWorld),rv.setFromMatrixPosition(this.matrixWorld);const i=oc.distanceTo(rv)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s&&i>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const ov=new q,av=new it,lv=new it,D3=new q,cv=new Ne;class ha extends Tt{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ne,this.bindMatrixInverse=new Ne}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new it,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;av.fromBufferAttribute(r.attributes.skinIndex,e),lv.fromBufferAttribute(r.attributes.skinWeight,e),ov.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=lv.getComponent(s);if(o!==0){const l=av.getComponent(s);cv.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(D3.copy(ov).applyMatrix4(cv),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}ha.prototype.isSkinnedMesh=!0;class fa extends Ze{constructor(){super(),this.type="Bone"}}fa.prototype.isBone=!0;class zr extends St{constructor(e=null,t=1,i=1,r,s,o,l,u,c=Mt,f=Mt,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={data:e,width:t,height:i},this.magFilter=c,this.minFilter=f,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}zr.prototype.isDataTexture=!0;const uv=new Ne,B3=new Ne;class pa{constructor(e=[],t=[]){this.uuid=fn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Ne)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Ne;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:B3;uv.multiplyMatrices(l,t[s]),uv.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new pa(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=sy(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new zr(t,e,e,hn,vi);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new fa),this.bones.push(o),this.boneInverses.push(new Ne().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const l=i[r];e.boneInverses.push(l.toArray())}return e}}const dv=new Ne,hv=new Ne,ac=[],ma=new Tt;class lh extends Tt{constructor(e,t,i){super(e,t),this.instanceMatrix=new je(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(ma.geometry=this.geometry,ma.material=this.material,ma.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,dv),hv.multiplyMatrices(i,dv),ma.matrixWorld=hv,ma.raycast(e,ac);for(let o=0,l=ac.length;o<l;o++){const u=ac[o];u.instanceId=s,u.object=this,t.push(u)}ac.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new je(new Float32Array(this.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}lh.prototype.isInstancedMesh=!0;class Ft extends Pt{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Re(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Ft.prototype.isLineBasicMaterial=!0;const fv=new q,pv=new q,mv=new Ne,ch=new nr,lc=new wi;class Kn extends Ze{constructor(e=new ke,t=new Ft){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)fv.fromBufferAttribute(t,r-1),pv.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=fv.distanceTo(pv);e.setAttribute("lineDistance",new Ie(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),lc.copy(i.boundingSphere),lc.applyMatrix4(r),lc.radius+=s,e.ray.intersectsSphere(lc)===!1)return;mv.copy(r).invert(),ch.copy(e.ray).applyMatrix4(mv);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,c=new q,f=new q,h=new q,p=new q,y=this.isLineSegments?2:1;if(i.isBufferGeometry){const m=i.index,b=i.attributes.position;if(m!==null){const v=Math.max(0,o.start),g=Math.min(m.count,o.start+o.count);for(let w=v,S=g-1;w<S;w+=y){const T=m.getX(w),M=m.getX(w+1);if(c.fromBufferAttribute(b,T),f.fromBufferAttribute(b,M),ch.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const _=e.ray.origin.distanceTo(p);_<e.near||_>e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,o.start),g=Math.min(b.count,o.start+o.count);for(let w=v,S=g-1;w<S;w+=y){if(c.fromBufferAttribute(b,w),f.fromBufferAttribute(b,w+1),ch.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);M<e.near||M>e.far||t.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Kn.prototype.isLine=!0;const gv=new q,yv=new q;class rn extends Kn{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)gv.fromBufferAttribute(t,r),yv.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+gv.distanceTo(yv);e.setAttribute("lineDistance",new Ie(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}rn.prototype.isLineSegments=!0;class cc extends Kn{constructor(e,t){super(e,t),this.type="LineLoop"}}cc.prototype.isLineLoop=!0;class cr extends Pt{constructor(e){super(),this.type="PointsMaterial",this.color=new Re(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}cr.prototype.isPointsMaterial=!0;const vv=new Ne,uh=new nr,uc=new wi,dc=new q;class qs extends Ze{constructor(e=new ke,t=new cr){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),uc.copy(i.boundingSphere),uc.applyMatrix4(r),uc.radius+=s,e.ray.intersectsSphere(uc)===!1)return;vv.copy(r).invert(),uh.copy(e.ray).applyMatrix4(vv);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l;if(i.isBufferGeometry){const c=i.index,h=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),y=Math.min(c.count,o.start+o.count);for(let m=p,d=y;m<d;m++){const b=c.getX(m);dc.fromBufferAttribute(h,b),bv(dc,b,u,r,e,t,this)}}else{const p=Math.max(0,o.start),y=Math.min(h.count,o.start+o.count);for(let m=p,d=y;m<d;m++)dc.fromBufferAttribute(h,m),bv(dc,m,u,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}qs.prototype.isPoints=!0;function bv(n,e,t,i,r,s,o){const l=uh.distanceSqToPoint(n);if(l<t){const u=new q;uh.closestPointToPoint(n,u),u.applyMatrix4(i);const c=r.ray.origin.distanceTo(u);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class xv extends St{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:bi,this.minFilter=o!==void 0?o:gt,this.magFilter=s!==void 0?s:gt,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}xv.prototype.isVideoTexture=!0;class dh extends St{constructor(e,t,i,r,s,o,l,u,c,f,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}dh.prototype.isCompressedTexture=!0;class wv extends St{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}wv.prototype.isCanvasTexture=!0;class Mv extends St{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Rr,f!==Rr&&f!==As)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Rr&&(i=$o),i===void 0&&f===As&&(i=Es),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:Mt,this.minFilter=u!==void 0?u:Mt,this.flipY=!1,this.generateMipmaps=!1}}Mv.prototype.isDepthTexture=!0;class Qs extends ke{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new q,f=new Se;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let h=0,p=3;h<=t;h++,p+=3){const y=i+h/t*r;c.x=e*Math.cos(y),c.y=e*Math.sin(y),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Ie(o,3)),this.setAttribute("normal",new Ie(l,3)),this.setAttribute("uv",new Ie(u,2))}static fromJSON(e){return new Qs(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class ur extends ke{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],h=[],p=[],y=[];let m=0;const d=[],b=i/2;let v=0;g(),o===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(f),this.setAttribute("position",new Ie(h,3)),this.setAttribute("normal",new Ie(p,3)),this.setAttribute("uv",new Ie(y,2));function g(){const S=new q,T=new q;let M=0;const C=(t-e)/i;for(let _=0;_<=s;_++){const P=[],E=_/s,O=E*(t-e)+e;for(let A=0;A<=r;A++){const L=A/r,R=L*u+l,N=Math.sin(R),x=Math.cos(R);T.x=O*N,T.y=-E*i+b,T.z=O*x,h.push(T.x,T.y,T.z),S.set(N,C,x).normalize(),p.push(S.x,S.y,S.z),y.push(L,1-E),P.push(m++)}d.push(P)}for(let _=0;_<r;_++)for(let P=0;P<s;P++){const E=d[P][_],O=d[P+1][_],A=d[P+1][_+1],L=d[P][_+1];f.push(E,O,L),f.push(O,A,L),M+=6}c.addGroup(v,M,0),v+=M}function w(S){const T=m,M=new Se,C=new q;let _=0;const P=S===!0?e:t,E=S===!0?1:-1;for(let A=1;A<=r;A++)h.push(0,b*E,0),p.push(0,E,0),y.push(.5,.5),m++;const O=m;for(let A=0;A<=r;A++){const R=A/r*u+l,N=Math.cos(R),x=Math.sin(R);C.x=P*x,C.y=b*E,C.z=P*N,h.push(C.x,C.y,C.z),p.push(0,E,0),M.x=N*.5+.5,M.y=x*.5*E+.5,y.push(M.x,M.y),m++}for(let A=0;A<r;A++){const L=T+A,R=O+A;S===!0?f.push(R,R+1,L):f.push(R+1,R,L),_+=3}c.addGroup(v,_,S===!0?1:2),v+=_}}static fromJSON(e){return new ur(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class eo extends ur{constructor(e=1,t=1,i=8,r=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,s,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new eo(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class qn extends ke{constructor(e,t,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];l(r),c(i),f(),this.setAttribute("position",new Ie(s,3)),this.setAttribute("normal",new Ie(s.slice(),3)),this.setAttribute("uv",new Ie(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(g){const w=new q,S=new q,T=new q;for(let M=0;M<t.length;M+=3)y(t[M+0],w),y(t[M+1],S),y(t[M+2],T),u(w,S,T,g)}function u(g,w,S,T){const M=T+1,C=[];for(let _=0;_<=M;_++){C[_]=[];const P=g.clone().lerp(S,_/M),E=w.clone().lerp(S,_/M),O=M-_;for(let A=0;A<=O;A++)A===0&&_===M?C[_][A]=P:C[_][A]=P.clone().lerp(E,A/O)}for(let _=0;_<M;_++)for(let P=0;P<2*(M-_)-1;P++){const E=Math.floor(P/2);P%2===0?(p(C[_][E+1]),p(C[_+1][E]),p(C[_][E])):(p(C[_][E+1]),p(C[_+1][E+1]),p(C[_+1][E]))}}function c(g){const w=new q;for(let S=0;S<s.length;S+=3)w.x=s[S+0],w.y=s[S+1],w.z=s[S+2],w.normalize().multiplyScalar(g),s[S+0]=w.x,s[S+1]=w.y,s[S+2]=w.z}function f(){const g=new q;for(let w=0;w<s.length;w+=3){g.x=s[w+0],g.y=s[w+1],g.z=s[w+2];const S=b(g)/2/Math.PI+.5,T=v(g)/Math.PI+.5;o.push(S,1-T)}m(),h()}function h(){for(let g=0;g<o.length;g+=6){const w=o[g+0],S=o[g+2],T=o[g+4],M=Math.max(w,S,T),C=Math.min(w,S,T);M>.9&&C<.1&&(w<.2&&(o[g+0]+=1),S<.2&&(o[g+2]+=1),T<.2&&(o[g+4]+=1))}}function p(g){s.push(g.x,g.y,g.z)}function y(g,w){const S=g*3;w.x=e[S+0],w.y=e[S+1],w.z=e[S+2]}function m(){const g=new q,w=new q,S=new q,T=new q,M=new Se,C=new Se,_=new Se;for(let P=0,E=0;P<s.length;P+=9,E+=6){g.set(s[P+0],s[P+1],s[P+2]),w.set(s[P+3],s[P+4],s[P+5]),S.set(s[P+6],s[P+7],s[P+8]),M.set(o[E+0],o[E+1]),C.set(o[E+2],o[E+3]),_.set(o[E+4],o[E+5]),T.copy(g).add(w).add(S).divideScalar(3);const O=b(T);d(M,E+0,g,O),d(C,E+2,w,O),d(_,E+4,S,O)}}function d(g,w,S,T){T<0&&g.x===1&&(o[w]=g.x-1),S.x===0&&S.z===0&&(o[w]=T/2/Math.PI+.5)}function b(g){return Math.atan2(g.z,-g.x)}function v(g){return Math.atan2(-g.y,Math.sqrt(g.x*g.x+g.z*g.z))}}static fromJSON(e){return new qn(e.vertices,e.indices,e.radius,e.details)}}class to extends qn{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new to(e.radius,e.detail)}}const hc=new q,fc=new q,hh=new q,pc=new _t;class fh extends ke{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0){console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const r=Math.pow(10,4),s=Math.cos(Nr*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,c=[0,0,0],f=["a","b","c"],h=new Array(3),p={},y=[];for(let m=0;m<u;m+=3){o?(c[0]=o.getX(m),c[1]=o.getX(m+1),c[2]=o.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:d,b,c:v}=pc;if(d.fromBufferAttribute(l,c[0]),b.fromBufferAttribute(l,c[1]),v.fromBufferAttribute(l,c[2]),pc.getNormal(hh),h[0]=`${Math.round(d.x*r)},${Math.round(d.y*r)},${Math.round(d.z*r)}`,h[1]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,h[2]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let g=0;g<3;g++){const w=(g+1)%3,S=h[g],T=h[w],M=pc[f[g]],C=pc[f[w]],_=`${S}_${T}`,P=`${T}_${S}`;P in p&&p[P]?(hh.dot(p[P].normal)<=s&&(y.push(M.x,M.y,M.z),y.push(C.x,C.y,C.z)),p[P]=null):_ in p||(p[_]={index0:c[g],index1:c[w],normal:hh.clone()})}}for(const m in p)if(p[m]){const{index0:d,index1:b}=p[m];hc.fromBufferAttribute(l,d),fc.fromBufferAttribute(l,b),y.push(hc.x,hc.y,hc.z),y.push(fc.x,fc.y,fc.z)}this.setAttribute("position",new Ie(y,3))}}class gn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let l=0,u=s-1,c;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),c=i[r]-o,c<0)l=r+1;else if(c>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,y=(o-f)/p;return(r+y)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new Se:new q);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new q,r=[],s=[],o=[],l=new q,u=new Ne;for(let y=0;y<=e;y++){const m=y/e;r[y]=this.getTangentAt(m,new q),r[y].normalize()}s[0]=new q,o[0]=new q;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let y=1;y<=e;y++){if(s[y]=s[y-1].clone(),o[y]=o[y-1].clone(),l.crossVectors(r[y-1],r[y]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos(jt(r[y-1].dot(r[y]),-1,1));s[y].applyMatrix4(u.makeRotationAxis(l,m))}o[y].crossVectors(r[y],s[y])}if(t===!0){let y=Math.acos(jt(s[0].dot(s[e]),-1,1));y/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(y=-y);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],y*m)),o[m].crossVectors(r[m],s[m])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ga extends gn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new Se,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),c=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const f=Math.cos(this.aRotation),h=Math.sin(this.aRotation),p=u-this.aX,y=c-this.aY;u=p*f-y*h+this.aX,c=p*h+y*f+this.aY}return i.set(u,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}ga.prototype.isEllipseCurve=!0;class ph extends ga{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.type="ArcCurve"}}ph.prototype.isArcCurve=!0;function mh(){let n=0,e=0,t=0,i=0;function r(s,o,l,u){n=s,e=l,t=-3*s+3*o-2*l-u,i=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,c){r(o,l,c*(l-s),c*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,c,f,h){let p=(o-s)/c-(l-s)/(c+f)+(l-o)/f,y=(l-o)/f-(u-o)/(f+h)+(u-l)/h;p*=f,y*=f,r(o,l,p,y)},calc:function(s){const o=s*s,l=o*s;return n+e*s+t*o+i*l}}}const mc=new q,gh=new mh,yh=new mh,vh=new mh;class bh extends gn{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new q){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(mc.subVectors(r[0],r[1]).add(r[0]),c=mc);const h=r[l%s],p=r[(l+1)%s];if(this.closed||l+2<s?f=r[(l+2)%s]:(mc.subVectors(r[s-1],r[s-2]).add(r[s-1]),f=mc),this.curveType==="centripetal"||this.curveType==="chordal"){const y=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(h),y),d=Math.pow(h.distanceToSquared(p),y),b=Math.pow(p.distanceToSquared(f),y);d<1e-4&&(d=1),m<1e-4&&(m=d),b<1e-4&&(b=d),gh.initNonuniformCatmullRom(c.x,h.x,p.x,f.x,m,d,b),yh.initNonuniformCatmullRom(c.y,h.y,p.y,f.y,m,d,b),vh.initNonuniformCatmullRom(c.z,h.z,p.z,f.z,m,d,b)}else this.curveType==="catmullrom"&&(gh.initCatmullRom(c.x,h.x,p.x,f.x,this.tension),yh.initCatmullRom(c.y,h.y,p.y,f.y,this.tension),vh.initCatmullRom(c.z,h.z,p.z,f.z,this.tension));return i.set(gh.calc(u),yh.calc(u),vh.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new q().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}bh.prototype.isCatmullRomCurve3=!0;function Sv(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,l=n*n,u=n*l;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*l+s*n+t}function F3(n,e){const t=1-n;return t*t*e}function V3(n,e){return 2*(1-n)*n*e}function k3(n,e){return n*n*e}function ya(n,e,t,i){return F3(n,e)+V3(n,t)+k3(n,i)}function z3(n,e){const t=1-n;return t*t*t*e}function U3(n,e){const t=1-n;return 3*t*t*n*e}function G3(n,e){return 3*(1-n)*n*n*e}function H3(n,e){return n*n*n*e}function va(n,e,t,i,r){return z3(n,e)+U3(n,t)+G3(n,i)+H3(n,r)}class gc extends gn{constructor(e=new Se,t=new Se,i=new Se,r=new Se){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Se){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(va(e,r.x,s.x,o.x,l.x),va(e,r.y,s.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}gc.prototype.isCubicBezierCurve=!0;class xh extends gn{constructor(e=new q,t=new q,i=new q,r=new q){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new q){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(va(e,r.x,s.x,o.x,l.x),va(e,r.y,s.y,o.y,l.y),va(e,r.z,s.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}xh.prototype.isCubicBezierCurve3=!0;class ba extends gn{constructor(e=new Se,t=new Se){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Se){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new Se;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}ba.prototype.isLineCurve=!0;class _v extends gn{constructor(e=new q,t=new q){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new q){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class yc extends gn{constructor(e=new Se,t=new Se,i=new Se){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Se){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(ya(e,r.x,s.x,o.x),ya(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}yc.prototype.isQuadraticBezierCurve=!0;class wh extends gn{constructor(e=new q,t=new q,i=new q){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new q){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(ya(e,r.x,s.x,o.x),ya(e,r.y,s.y,o.y),ya(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}wh.prototype.isQuadraticBezierCurve3=!0;class vc extends gn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Se){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),l=s-o,u=r[o===0?o:o-1],c=r[o],f=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(Sv(l,u.x,c.x,f.x,h.x),Sv(l,u.y,c.y,f.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Se().fromArray(r))}return this}}vc.prototype.isSplineCurve=!0;var Mh=Object.freeze({__proto__:null,ArcCurve:ph,CatmullRomCurve3:bh,CubicBezierCurve:gc,CubicBezierCurve3:xh,EllipseCurve:ga,LineCurve:ba,LineCurve3:_v,QuadraticBezierCurve:yc,QuadraticBezierCurve3:wh,SplineCurve:vc});const W3={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=Tv(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,c,f,h,p,y;if(i&&(s=Y3(n,e,s,t)),n.length>80*t){l=c=n[0],u=f=n[1];for(let m=t;m<r;m+=t)h=n[m],p=n[m+1],h<l&&(l=h),p<u&&(u=p),h>c&&(c=h),p>f&&(f=p);y=Math.max(c-l,f-u),y=y!==0?1/y:0}return xa(s,o,t,l,u,y),o}};function Tv(n,e,t,i,r){let s,o;if(r===oN(n,e,t,i)>0)for(s=e;s<t;s+=i)o=Cv(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=Cv(s,n[s],n[s+1],o);return o&&bc(o,o.next)&&(Ma(o),o=o.next),o}function dr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(bc(t,t.next)||ft(t.prev,t,t.next)===0)){if(Ma(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function xa(n,e,t,i,r,s,o){if(!n)return;!o&&s&&eN(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?$3(n,i,r,s):j3(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Ma(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=Z3(dr(n),e,t),xa(n,e,t,i,r,s,2)):o===2&&X3(n,e,t,i,r,s):xa(dr(n),e,t,i,r,s,1);break}}}function j3(n){const e=n.prev,t=n,i=n.next;if(ft(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(no(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&ft(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function $3(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ft(r,s,o)>=0)return!1;const l=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,u=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,h=Sh(l,u,e,t,i),p=Sh(c,f,e,t,i);let y=n.prevZ,m=n.nextZ;for(;y&&y.z>=h&&m&&m.z<=p;){if(y!==n.prev&&y!==n.next&&no(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&ft(y.prev,y,y.next)>=0||(y=y.prevZ,m!==n.prev&&m!==n.next&&no(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;y&&y.z>=h;){if(y!==n.prev&&y!==n.next&&no(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&ft(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&no(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Z3(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!bc(r,s)&&Ev(r,i,i.next,s)&&wa(r,s)&&wa(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Ma(i),Ma(i.next),i=n=s),i=i.next}while(i!==n);return dr(i)}function X3(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&iN(o,l)){let u=Av(o,l);o=dr(o,o.next),u=dr(u,u.next),xa(o,e,t,i,r,s),xa(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function Y3(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s<o;s++)l=e[s]*i,u=s<o-1?e[s+1]*i:n.length,c=Tv(n,l,u,i,!1),c===c.next&&(c.steiner=!0),r.push(nN(c));for(r.sort(J3),s=0;s<r.length;s++)K3(r[s],t),t=dr(t,t.next);return t}function J3(n,e){return n.x-e.x}function K3(n,e){if(e=q3(n,e),e){const t=Av(e,n);dr(e,e.next),dr(t,t.next)}}function q3(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===s)return o;const l=o,u=o.x,c=o.y;let f=1/0,h;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&no(r<c?i:s,r,u,c,r<c?s:i,r,t.x,t.y)&&(h=Math.abs(r-t.y)/(i-t.x),wa(t,n)&&(h<f||h===f&&(t.x>o.x||t.x===o.x&&Q3(o,t)))&&(o=t,f=h)),t=t.next;while(t!==l);return o}function Q3(n,e){return ft(n.prev,n,e.prev)<0&&ft(e.next,n,n.next)<0}function eN(n,e,t,i){let r=n;do r.z===null&&(r.z=Sh(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,tN(r)}function tN(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e<c&&(l++,i=i.nextZ,!!i);e++);for(u=c;l>0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Sh(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function nN(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function no(n,e,t,i,r,s,o,l){return(r-o)*(e-l)-(n-o)*(s-l)>=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function iN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!rN(n,e)&&(wa(n,e)&&wa(e,n)&&sN(n,e)&&(ft(n.prev,n,e.prev)||ft(n,e.prev,e))||bc(n,e)&&ft(n.prev,n,n.next)>0&&ft(e.prev,e,e.next)>0)}function ft(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function bc(n,e){return n.x===e.x&&n.y===e.y}function Ev(n,e,t,i){const r=wc(ft(n,e,t)),s=wc(ft(n,e,i)),o=wc(ft(t,i,n)),l=wc(ft(t,i,e));return!!(r!==s&&o!==l||r===0&&xc(n,t,e)||s===0&&xc(n,i,e)||o===0&&xc(t,n,i)||l===0&&xc(t,e,i))}function xc(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function wc(n){return n>0?1:n<0?-1:0}function rN(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&Ev(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function wa(n,e){return ft(n.prev,n,n.next)<0?ft(n,e,n.next)>=0&&ft(n,n.prev,e)>=0:ft(n,e,n.prev)<0||ft(n,n.next,e)<0}function sN(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Av(n,e){const t=new _h(n.i,n.x,n.y),i=new _h(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Cv(n,e,t,i){const r=new _h(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Ma(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function _h(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function oN(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class Qn{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return Qn.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];Rv(e),Lv(i,e);let o=e.length;t.forEach(Rv);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,Lv(i,t[u]);const l=W3.triangulate(i,r);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function Rv(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Lv(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Bn extends ke{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];o(c)}this.setAttribute("position",new Ie(r,3)),this.setAttribute("uv",new Ie(s,2)),this.computeVertexNormals();function o(l){const u=[],c=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1;let h=t.depth!==void 0?t.depth:100,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,y=t.bevelThickness!==void 0?t.bevelThickness:6,m=t.bevelSize!==void 0?t.bevelSize:y-2,d=t.bevelOffset!==void 0?t.bevelOffset:0,b=t.bevelSegments!==void 0?t.bevelSegments:3;const v=t.extrudePath,g=t.UVGenerator!==void 0?t.UVGenerator:aN;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=t.amount);let w,S=!1,T,M,C,_;v&&(w=v.getSpacedPoints(f),S=!0,p=!1,T=v.computeFrenetFrames(f,!1),M=new q,C=new q,_=new q),p||(b=0,y=0,m=0,d=0);const P=l.extractPoints(c);let E=P.shape;const O=P.holes;if(!Qn.isClockWise(E)){E=E.reverse();for(let z=0,H=O.length;z<H;z++){const K=O[z];Qn.isClockWise(K)&&(O[z]=K.reverse())}}const L=Qn.triangulateShape(E,O),R=E;for(let z=0,H=O.length;z<H;z++){const K=O[z];E=E.concat(K)}function N(z,H,K){return H||console.error("THREE.ExtrudeGeometry: vec does not exist"),H.clone().multiplyScalar(K).add(z)}const x=E.length,I=L.length;function B(z,H,K){let le,se,U;const D=z.x-H.x,$=z.y-H.y,Y=K.x-z.x,ee=K.y-z.y,ce=D*D+$*$,ve=D*ee-$*Y;if(Math.abs(ve)>Number.EPSILON){const be=Math.sqrt(ce),ue=Math.sqrt(Y*Y+ee*ee),me=H.x-$/be,te=H.y+D/be,he=K.x-ee/ue,ge=K.y+Y/ue,Ae=((he-me)*ee-(ge-te)*Y)/(D*ee-$*Y);le=me+D*Ae-z.x,se=te+$*Ae-z.y;const Te=le*le+se*se;if(Te<=2)return new Se(le,se);U=Math.sqrt(Te/2)}else{let be=!1;D>Number.EPSILON?Y>Number.EPSILON&&(be=!0):D<-Number.EPSILON?Y<-Number.EPSILON&&(be=!0):Math.sign($)===Math.sign(ee)&&(be=!0),be?(le=-$,se=D,U=Math.sqrt(ce)):(le=D,se=$,U=Math.sqrt(ce/2))}return new Se(le/U,se/U)}const F=[];for(let z=0,H=R.length,K=H-1,le=z+1;z<H;z++,K++,le++)K===H&&(K=0),le===H&&(le=0),F[z]=B(R[z],R[K],R[le]);const V=[];let k,G=F.concat();for(let z=0,H=O.length;z<H;z++){const K=O[z];k=[];for(let le=0,se=K.length,U=se-1,D=le+1;le<se;le++,U++,D++)U===se&&(U=0),D===se&&(D=0),k[le]=B(K[le],K[U],K[D]);V.push(k),G=G.concat(k)}for(let z=0;z<b;z++){const H=z/b,K=y*Math.cos(H*Math.PI/2),le=m*Math.sin(H*Math.PI/2)+d;for(let se=0,U=R.length;se<U;se++){const D=N(R[se],F[se],le);oe(D.x,D.y,-K)}for(let se=0,U=O.length;se<U;se++){const D=O[se];k=V[se];for(let $=0,Y=D.length;$<Y;$++){const ee=N(D[$],k[$],le);oe(ee.x,ee.y,-K)}}}const J=m+d;for(let z=0;z<x;z++){const H=p?N(E[z],G[z],J):E[z];S?(C.copy(T.normals[0]).multiplyScalar(H.x),M.copy(T.binormals[0]).multiplyScalar(H.y),_.copy(w[0]).add(C).add(M),oe(_.x,_.y,_.z)):oe(H.x,H.y,0)}for(let z=1;z<=f;z++)for(let H=0;H<x;H++){const K=p?N(E[H],G[H],J):E[H];S?(C.copy(T.normals[z]).multiplyScalar(K.x),M.copy(T.binormals[z]).multiplyScalar(K.y),_.copy(w[z]).add(C).add(M),oe(_.x,_.y,_.z)):oe(K.x,K.y,h/f*z)}for(let z=b-1;z>=0;z--){const H=z/b,K=y*Math.cos(H*Math.PI/2),le=m*Math.sin(H*Math.PI/2)+d;for(let se=0,U=R.length;se<U;se++){const D=N(R[se],F[se],le);oe(D.x,D.y,h+K)}for(let se=0,U=O.length;se<U;se++){const D=O[se];k=V[se];for(let $=0,Y=D.length;$<Y;$++){const ee=N(D[$],k[$],le);S?oe(ee.x,ee.y+w[f-1].y,w[f-1].x+K):oe(ee.x,ee.y,h+K)}}}ne(),ae();function ne(){const z=r.length/3;if(p){let H=0,K=x*H;for(let le=0;le<I;le++){const se=L[le];W(se[2]+K,se[1]+K,se[0]+K)}H=f+b*2,K=x*H;for(let le=0;le<I;le++){const se=L[le];W(se[0]+K,se[1]+K,se[2]+K)}}else{for(let H=0;H<I;H++){const K=L[H];W(K[2],K[1],K[0])}for(let H=0;H<I;H++){const K=L[H];W(K[0]+x*f,K[1]+x*f,K[2]+x*f)}}i.addGroup(z,r.length/3-z,0)}function ae(){const z=r.length/3;let H=0;ie(R,H),H+=R.length;for(let K=0,le=O.length;K<le;K++){const se=O[K];ie(se,H),H+=se.length}i.addGroup(z,r.length/3-z,1)}function ie(z,H){let K=z.length;for(;--K>=0;){const le=K;let se=K-1;se<0&&(se=z.length-1);for(let U=0,D=f+b*2;U<D;U++){const $=x*U,Y=x*(U+1),ee=H+le+$,ce=H+se+$,ve=H+se+Y,be=H+le+Y;Z(ee,ce,ve,be)}}}function oe(z,H,K){u.push(z),u.push(H),u.push(K)}function W(z,H,K){j(z),j(H),j(K);const le=r.length/3,se=g.generateTopUV(i,r,le-3,le-2,le-1);re(se[0]),re(se[1]),re(se[2])}function Z(z,H,K,le){j(z),j(H),j(le),j(H),j(K),j(le);const se=r.length/3,U=g.generateSideWallUV(i,r,se-6,se-3,se-2,se-1);re(U[0]),re(U[1]),re(U[3]),re(U[1]),re(U[2]),re(U[3])}function j(z){r.push(u[z*3+0]),r.push(u[z*3+1]),r.push(u[z*3+2])}function re(z){s.push(z.x),s.push(z.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return lN(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];i.push(l)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Mh[r.type]().fromJSON(r)),new Bn(i,e.options)}}const aN={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],l=e[i*3],u=e[i*3+1],c=e[r*3],f=e[r*3+1];return[new Se(s,o),new Se(l,u),new Se(c,f)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],c=e[i*3],f=e[i*3+1],h=e[i*3+2],p=e[r*3],y=e[r*3+1],m=e[r*3+2],d=e[s*3],b=e[s*3+1],v=e[s*3+2];return Math.abs(l-f)<Math.abs(o-c)?[new Se(o,1-u),new Se(c,1-h),new Se(p,1-m),new Se(d,1-v)]:[new Se(l,1-u),new Se(f,1-h),new Se(y,1-m),new Se(b,1-v)]}};function lN(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class io extends qn{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new io(e.radius,e.detail)}}class ro extends ke{constructor(e,t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=jt(r,0,Math.PI*2);const s=[],o=[],l=[],u=1/t,c=new q,f=new Se;for(let h=0;h<=t;h++){const p=i+h*u*r,y=Math.sin(p),m=Math.cos(p);for(let d=0;d<=e.length-1;d++)c.x=e[d].x*y,c.y=e[d].y,c.z=e[d].x*m,o.push(c.x,c.y,c.z),f.x=h/t,f.y=d/(e.length-1),l.push(f.x,f.y)}for(let h=0;h<t;h++)for(let p=0;p<e.length-1;p++){const y=p+h*e.length,m=y,d=y+e.length,b=y+e.length+1,v=y+1;s.push(m,d,v),s.push(d,b,v)}if(this.setIndex(s),this.setAttribute("position",new Ie(o,3)),this.setAttribute("uv",new Ie(l,2)),this.computeVertexNormals(),r===Math.PI*2){const h=this.attributes.normal.array,p=new q,y=new q,m=new q,d=t*e.length*3;for(let b=0,v=0;b<e.length;b++,v+=3)p.x=h[v+0],p.y=h[v+1],p.z=h[v+2],y.x=h[d+v+0],y.y=h[d+v+1],y.z=h[d+v+2],m.addVectors(p,y).normalize(),h[v+0]=h[d+v+0]=m.x,h[v+1]=h[d+v+1]=m.y,h[v+2]=h[d+v+2]=m.z}}static fromJSON(e){return new ro(e.points,e.segments,e.phiStart,e.phiLength)}}class Ur extends qn{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Ur(e.radius,e.detail)}}class Mc extends ke{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};const r=[],s=[],o=[],l=[],u=1e-5,c=new q,f=new q,h=new q,p=new q,y=new q;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const m=t+1;for(let d=0;d<=i;d++){const b=d/i;for(let v=0;v<=t;v++){const g=v/t;e(g,b,f),s.push(f.x,f.y,f.z),g-u>=0?(e(g-u,b,h),p.subVectors(f,h)):(e(g+u,b,h),p.subVectors(h,f)),b-u>=0?(e(g,b-u,h),y.subVectors(f,h)):(e(g,b+u,h),y.subVectors(h,f)),c.crossVectors(p,y).normalize(),o.push(c.x,c.y,c.z),l.push(g,b)}}for(let d=0;d<i;d++)for(let b=0;b<t;b++){const v=d*m+b,g=d*m+b+1,w=(d+1)*m+b+1,S=(d+1)*m+b;r.push(v,g,S),r.push(g,w,S)}this.setIndex(r),this.setAttribute("position",new Ie(s,3)),this.setAttribute("normal",new Ie(o,3)),this.setAttribute("uv",new Ie(l,2))}}class so extends ke{constructor(e=.5,t=1,i=8,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const l=[],u=[],c=[],f=[];let h=e;const p=(t-e)/r,y=new q,m=new Se;for(let d=0;d<=r;d++){for(let b=0;b<=i;b++){const v=s+b/i*o;y.x=h*Math.cos(v),y.y=h*Math.sin(v),u.push(y.x,y.y,y.z),c.push(0,0,1),m.x=(y.x/t+1)/2,m.y=(y.y/t+1)/2,f.push(m.x,m.y)}h+=p}for(let d=0;d<r;d++){const b=d*(i+1);for(let v=0;v<i;v++){const g=v+b,w=g,S=g+i+1,T=g+i+2,M=g+1;l.push(w,S,M),l.push(S,T,M)}}this.setIndex(l),this.setAttribute("position",new Ie(u,3)),this.setAttribute("normal",new Ie(c,3)),this.setAttribute("uv",new Ie(f,2))}static fromJSON(e){return new so(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Gr extends ke{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)c(e);else for(let f=0;f<e.length;f++)c(e[f]),this.addGroup(l,u,f),l+=u,u=0;this.setIndex(i),this.setAttribute("position",new Ie(r,3)),this.setAttribute("normal",new Ie(s,3)),this.setAttribute("uv",new Ie(o,2));function c(f){const h=r.length/3,p=f.extractPoints(t);let y=p.shape;const m=p.holes;Qn.isClockWise(y)===!1&&(y=y.reverse());for(let b=0,v=m.length;b<v;b++){const g=m[b];Qn.isClockWise(g)===!0&&(m[b]=g.reverse())}const d=Qn.triangulateShape(y,m);for(let b=0,v=m.length;b<v;b++){const g=m[b];y=y.concat(g)}for(let b=0,v=y.length;b<v;b++){const g=y[b];r.push(g.x,g.y,0),s.push(0,0,1),o.push(g.x,g.y)}for(let b=0,v=d.length;b<v;b++){const g=d[b],w=g[0]+h,S=g[1]+h,T=g[2]+h;i.push(w,S,T),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return cN(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new Gr(i,e.curveSegments)}}function cN(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Hr extends ke{constructor(e=1,t=8,i=6,r=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(o+l,Math.PI);let c=0;const f=[],h=new q,p=new q,y=[],m=[],d=[],b=[];for(let v=0;v<=i;v++){const g=[],w=v/i;let S=0;v==0&&o==0?S=.5/t:v==i&&u==Math.PI&&(S=-.5/t);for(let T=0;T<=t;T++){const M=T/t;h.x=-e*Math.cos(r+M*s)*Math.sin(o+w*l),h.y=e*Math.cos(o+w*l),h.z=e*Math.sin(r+M*s)*Math.sin(o+w*l),m.push(h.x,h.y,h.z),p.copy(h).normalize(),d.push(p.x,p.y,p.z),b.push(M+S,1-w),g.push(c++)}f.push(g)}for(let v=0;v<i;v++)for(let g=0;g<t;g++){const w=f[v][g+1],S=f[v][g],T=f[v+1][g],M=f[v+1][g+1];(v!==0||o>0)&&y.push(w,S,M),(v!==i-1||u<Math.PI)&&y.push(S,T,M)}this.setIndex(y),this.setAttribute("position",new Ie(m,3)),this.setAttribute("normal",new Ie(d,3)),this.setAttribute("uv",new Ie(b,2))}static fromJSON(e){return new Hr(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class oo extends qn{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new oo(e.radius,e.detail)}}class Sc extends Bn{constructor(e,t={}){const i=t.font;if(!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ke;const r=i.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class ao extends ke{constructor(e=1,t=.4,i=8,r=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[],f=new q,h=new q,p=new q;for(let y=0;y<=i;y++)for(let m=0;m<=r;m++){const d=m/r*s,b=y/i*Math.PI*2;h.x=(e+t*Math.cos(b))*Math.cos(d),h.y=(e+t*Math.cos(b))*Math.sin(d),h.z=t*Math.sin(b),l.push(h.x,h.y,h.z),f.x=e*Math.cos(d),f.y=e*Math.sin(d),p.subVectors(h,f).normalize(),u.push(p.x,p.y,p.z),c.push(m/r),c.push(y/i)}for(let y=1;y<=i;y++)for(let m=1;m<=r;m++){const d=(r+1)*y+m-1,b=(r+1)*(y-1)+m-1,v=(r+1)*(y-1)+m,g=(r+1)*y+m;o.push(d,b,g),o.push(b,v,g)}this.setIndex(o),this.setAttribute("position",new Ie(l,3)),this.setAttribute("normal",new Ie(u,3)),this.setAttribute("uv",new Ie(c,2))}static fromJSON(e){return new ao(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class lo extends ke{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const l=[],u=[],c=[],f=[],h=new q,p=new q,y=new q,m=new q,d=new q,b=new q,v=new q;for(let w=0;w<=i;++w){const S=w/i*s*Math.PI*2;g(S,s,o,e,y),g(S+.01,s,o,e,m),b.subVectors(m,y),v.addVectors(m,y),d.crossVectors(b,v),v.crossVectors(d,b),d.normalize(),v.normalize();for(let T=0;T<=r;++T){const M=T/r*Math.PI*2,C=-t*Math.cos(M),_=t*Math.sin(M);h.x=y.x+(C*v.x+_*d.x),h.y=y.y+(C*v.y+_*d.y),h.z=y.z+(C*v.z+_*d.z),u.push(h.x,h.y,h.z),p.subVectors(h,y).normalize(),c.push(p.x,p.y,p.z),f.push(w/i),f.push(T/r)}}for(let w=1;w<=i;w++)for(let S=1;S<=r;S++){const T=(r+1)*(w-1)+(S-1),M=(r+1)*w+(S-1),C=(r+1)*w+S,_=(r+1)*(w-1)+S;l.push(T,M,_),l.push(M,C,_)}this.setIndex(l),this.setAttribute("position",new Ie(u,3)),this.setAttribute("normal",new Ie(c,3)),this.setAttribute("uv",new Ie(f,2));function g(w,S,T,M,C){const _=Math.cos(w),P=Math.sin(w),E=T/S*w,O=Math.cos(E);C.x=M*(2+O)*.5*_,C.y=M*(2+O)*P*.5,C.z=M*Math.sin(E)*.5}}static fromJSON(e){return new lo(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class co extends ke{constructor(e,t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new q,u=new q,c=new Se;let f=new q;const h=[],p=[],y=[],m=[];d(),this.setIndex(m),this.setAttribute("position",new Ie(h,3)),this.setAttribute("normal",new Ie(p,3)),this.setAttribute("uv",new Ie(y,2));function d(){for(let w=0;w<t;w++)b(w);b(s===!1?t:0),g(),v()}function b(w){f=e.getPointAt(w/t,f);const S=o.normals[w],T=o.binormals[w];for(let M=0;M<=r;M++){const C=M/r*Math.PI*2,_=Math.sin(C),P=-Math.cos(C);u.x=P*S.x+_*T.x,u.y=P*S.y+_*T.y,u.z=P*S.z+_*T.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=f.x+i*u.x,l.y=f.y+i*u.y,l.z=f.z+i*u.z,h.push(l.x,l.y,l.z)}}function v(){for(let w=1;w<=t;w++)for(let S=1;S<=r;S++){const T=(r+1)*(w-1)+(S-1),M=(r+1)*w+(S-1),C=(r+1)*w+S,_=(r+1)*(w-1)+S;m.push(T,M,_),m.push(M,C,_)}}function g(){for(let w=0;w<=t;w++)for(let S=0;S<=r;S++)c.x=w/t,c.y=S/r,y.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new co(new Mh[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Th extends ke{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0){console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const t=[],i=[0,0],r={},s=new q;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let c=0,f=u.length;c<f;++c){const h=u[c],p=h.start,y=h.count;for(let m=p,d=p+y;m<d;m+=3)for(let b=0;b<3;b++){const v=l.getX(m+b),g=l.getX(m+(b+1)%3);i[0]=Math.min(v,g),i[1]=Math.max(v,g);const w=i[0]+","+i[1];r[w]===void 0&&(r[w]={index1:i[0],index2:i[1]})}}for(const c in r){const f=r[c];s.fromBufferAttribute(o,f.index1),t.push(s.x,s.y,s.z),s.fromBufferAttribute(o,f.index2),t.push(s.x,s.y,s.z)}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let c=0;c<3;c++){const f=3*l+c;s.fromBufferAttribute(o,f),t.push(s.x,s.y,s.z);const h=3*l+(c+1)%3;s.fromBufferAttribute(o,h),t.push(s.x,s.y,s.z)}}this.setAttribute("position",new Ie(t,3))}}var Pv=Object.freeze({__proto__:null,BoxGeometry:Ei,BoxBufferGeometry:Ei,CircleGeometry:Qs,CircleBufferGeometry:Qs,ConeGeometry:eo,ConeBufferGeometry:eo,CylinderGeometry:ur,CylinderBufferGeometry:ur,DodecahedronGeometry:to,DodecahedronBufferGeometry:to,EdgesGeometry:fh,ExtrudeGeometry:Bn,ExtrudeBufferGeometry:Bn,IcosahedronGeometry:io,IcosahedronBufferGeometry:io,LatheGeometry:ro,LatheBufferGeometry:ro,OctahedronGeometry:Ur,OctahedronBufferGeometry:Ur,ParametricGeometry:Mc,ParametricBufferGeometry:Mc,PlaneGeometry:kr,PlaneBufferGeometry:kr,PolyhedronGeometry:qn,PolyhedronBufferGeometry:qn,RingGeometry:so,RingBufferGeometry:so,ShapeGeometry:Gr,ShapeBufferGeometry:Gr,SphereGeometry:Hr,SphereBufferGeometry:Hr,TetrahedronGeometry:oo,TetrahedronBufferGeometry:oo,TextGeometry:Sc,TextBufferGeometry:Sc,TorusGeometry:ao,TorusBufferGeometry:ao,TorusKnotGeometry:lo,TorusKnotBufferGeometry:lo,TubeGeometry:co,TubeBufferGeometry:co,WireframeGeometry:Th});class Eh extends Pt{constructor(e){super(),this.type="ShadowMaterial",this.color=new Re(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Eh.prototype.isShadowMaterial=!0;class uo extends Ai{constructor(e){super(e),this.type="RawShaderMaterial"}}uo.prototype.isRawShaderMaterial=!0;class Wr extends Pt{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Re(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}Wr.prototype.isMeshStandardMaterial=!0;class Sa extends Wr{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Se(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=jt(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Re(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Re).copy(e.sheen):this.sheen=null,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this}}Sa.prototype.isMeshPhysicalMaterial=!0;class Ah extends Pt{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Re(16777215),this.specular=new Re(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=zo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ah.prototype.isMeshPhongMaterial=!0;class Ch extends Pt{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Re(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Ch.prototype.isMeshToonMaterial=!0;class Rh extends Pt{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Rh.prototype.isMeshNormalMaterial=!0;class Lh extends Pt{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Re(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=zo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Lh.prototype.isMeshLambertMaterial=!0;class Ph extends Pt{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Re(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ki,this.normalScale=new Se(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ph.prototype.isMeshMatcapMaterial=!0;class Ih extends Ft{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}Ih.prototype.isLineDashedMaterial=!0;var uN=Object.freeze({__proto__:null,ShadowMaterial:Eh,SpriteMaterial:aa,RawShaderMaterial:uo,ShaderMaterial:Ai,PointsMaterial:cr,MeshPhysicalMaterial:Sa,MeshStandardMaterial:Wr,MeshPhongMaterial:Ah,MeshToonMaterial:Ch,MeshNormalMaterial:Rh,MeshLambertMaterial:Lh,MeshDepthMaterial:ec,MeshDistanceMaterial:tc,MeshBasicMaterial:cn,MeshMatcapMaterial:Ph,LineDashedMaterial:Ih,LineBasicMaterial:Ft,Material:Pt});const ct={arraySlice:function(n,e,t){return ct.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i},sortedArray:function(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[l+u]}return r},flattenJSON:function(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)},subclip:function(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const c=s.tracks[u],f=c.getValueSize(),h=[],p=[];for(let y=0;y<c.times.length;++y){const m=c.times[y]*r;if(!(m<t||m>=i)){h.push(c.times[y]);for(let d=0;d<f;++d)p.push(c.values[y*f+d])}}h.length!==0&&(c.times=ct.convertArray(h,c.times.constructor),c.values=ct.convertArray(p,c.values.constructor),o.push(c))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const c=n.tracks.find(function(v){return v.name===l.name&&v.ValueTypeName===u});if(c===void 0)continue;let f=0;const h=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=h/3);let p=0;const y=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=y/3);const m=l.times.length-1;let d;if(s<=l.times[0]){const v=f,g=h-f;d=ct.arraySlice(l.values,v,g)}else if(s>=l.times[m]){const v=m*h+f,g=v+h-f;d=ct.arraySlice(l.values,v,g)}else{const v=l.createInterpolant(),g=f,w=h-f;v.evaluate(s),d=ct.arraySlice(v.resultBuffer,g,w)}u==="quaternion"&&new $t().fromArray(d).normalize().conjugate().toArray(d);const b=c.times.length;for(let v=0;v<b;++v){const g=v*y+p;if(u==="quaternion")$t.multiplyQuaternionsFlat(c.values,g,d,0,c.values,g);else{const w=y-p*2;for(let S=0;S<w;++S)c.values[g+S]-=d[S]}}}return n.blendMode=wd,n}};class ei{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let l=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,s)}if(i===l)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(i=2,s=l);for(let u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===u)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,s,e)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ei.prototype.beforeStart_=ei.prototype.copySampleValue_,ei.prototype.afterEnd_=ei.prototype.copySampleValue_;class Iv extends ei{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Pr,endingEnd:Pr}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,l=r[s],u=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case Ir:s=e,l=2*t-i;break;case Xo:s=r.length-2,l=t+r[s]-r[s+1];break;default:s=e,l=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Ir:o=e,u=2*i-t;break;case Xo:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const c=(i-t)*.5,f=this.valueSize;this._weightPrev=c/(t-l),this._weightNext=c/(u-i),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=this._offsetPrev,h=this._offsetNext,p=this._weightPrev,y=this._weightNext,m=(i-t)/(r-t),d=m*m,b=d*m,v=-p*b+2*p*d-p*m,g=(1+p)*b+(-1.5-2*p)*d+(-.5+p)*m+1,w=(-1-y)*b+(1.5+y)*d+.5*m,S=y*b-y*d;for(let T=0;T!==l;++T)s[T]=v*o[f+T]+g*o[c+T]+w*o[u+T]+S*o[h+T];return s}}class Oh extends ei{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=(i-t)/(r-t),h=1-f;for(let p=0;p!==l;++p)s[p]=o[c+p]*h+o[u+p]*f;return s}}class Ov extends ei{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Fn{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ct.convertArray(t,this.TimeBufferType),this.values=ct.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:ct.convertArray(e.times,Array),values:ct.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new Ov(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Oh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Iv(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Cs:t=this.InterpolantFactoryMethodDiscrete;break;case Lr:t=this.InterpolantFactoryMethodLinear;break;case Al:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Cs;case this.InterpolantFactoryMethodLinear:return Lr;case this.InterpolantFactoryMethodSmooth:return Al}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=ct.arraySlice(i,s,o),this.values=ct.arraySlice(this.values,s*l,o*l)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&ct.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=ct.arraySlice(this.times),t=ct.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Al,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const c=e[l],f=e[l+1];if(c!==f&&(l!==1||c!==e[0]))if(r)u=!0;else{const h=l*i,p=h-i,y=h+i;for(let m=0;m!==i;++m){const d=t[h+m];if(d!==t[p+m]||d!==t[y+m]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const h=l*i,p=o*i;for(let y=0;y!==i;++y)t[p+y]=t[h+y]}++o}}if(s>0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=ct.arraySlice(e,0,o),this.values=ct.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ct.arraySlice(this.times,0),t=ct.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Fn.prototype.TimeBufferType=Float32Array,Fn.prototype.ValueBufferType=Float32Array,Fn.prototype.DefaultInterpolation=Lr;class jr extends Fn{}jr.prototype.ValueTypeName="bool",jr.prototype.ValueBufferType=Array,jr.prototype.DefaultInterpolation=Cs,jr.prototype.InterpolantFactoryMethodLinear=void 0,jr.prototype.InterpolantFactoryMethodSmooth=void 0;class Nh extends Fn{}Nh.prototype.ValueTypeName="color";class ho extends Fn{}ho.prototype.ValueTypeName="number";class Nv extends ei{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)$t.slerpFlat(s,0,o,c-l,o,c,u);return s}}class $r extends Fn{InterpolantFactoryMethodLinear(e){return new Nv(this.times,this.values,this.getValueSize(),e)}}$r.prototype.ValueTypeName="quaternion",$r.prototype.DefaultInterpolation=Lr,$r.prototype.InterpolantFactoryMethodSmooth=void 0;class Zr extends Fn{}Zr.prototype.ValueTypeName="string",Zr.prototype.ValueBufferType=Array,Zr.prototype.DefaultInterpolation=Cs,Zr.prototype.InterpolantFactoryMethodLinear=void 0,Zr.prototype.InterpolantFactoryMethodSmooth=void 0;class fo extends Fn{}fo.prototype.ValueTypeName="vector";class po{constructor(e,t=-1,i,r=Cl){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=fn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(hN(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Fn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],c=[];u.push((l+s-1)%s,l,(l+1)%s),c.push(0,1,0);const f=ct.getKeyframeOrder(u);u=ct.sortedArray(u,1,f),c=ct.sortedArray(c,1,f),!r&&u[0]===0&&(u.push(s),c.push(c[0])),o.push(new ho(".morphTargetInfluences["+t[l].name+"]",u,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,u=e.length;l<u;l++){const c=e[l],f=c.name.match(s);if(f&&f.length>1){const h=f[1];let p=r[h];p||(r[h]=p=[]),p.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,y,m,d){if(y.length!==0){const b=[],v=[];ct.flattenJSON(y,b,v,m),b.length!==0&&d.push(new h(p,b,v))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let h=0;h<c.length;h++){const p=c[h].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const y={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let d=0;d<p[m].morphTargets.length;d++)y[p[m].morphTargets[d]]=-1;for(const d in y){const b=[],v=[];for(let g=0;g!==p[m].morphTargets.length;++g){const w=p[m];b.push(w.time),v.push(w.morphTarget===d?1:0)}r.push(new ho(".morphTargetInfluence["+d+"]",b,v))}u=y.length*(o||1)}else{const y=".bones["+t[h].name+"]";i(fo,y+".position",p,"pos",r),i($r,y+".quaternion",p,"rot",r),i(fo,y+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,r,l)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function dN(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ho;case"vector":case"vector2":case"vector3":case"vector4":return fo;case"color":return Nh;case"quaternion":return $r;case"bool":case"boolean":return jr;case"string":return Zr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function hN(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=dN(n.type);if(n.times===void 0){const t=[],i=[];ct.flattenJSON(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Xr={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Dh{constructor(e,t,i){const r=this;let s=!1,o=0,l=0,u;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(f){l++,s===!1&&r.onStart!==void 0&&r.onStart(f,o,l),s=!0},this.itemEnd=function(f){o++,r.onProgress!==void 0&&r.onProgress(f,o,l),o===l&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(f){r.onError!==void 0&&r.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,h){return c.push(f,h),this},this.removeHandler=function(f){const h=c.indexOf(f);return h!==-1&&c.splice(h,2),this},this.getHandler=function(f){for(let h=0,p=c.length;h<p;h+=2){const y=c[h],m=c[h+1];if(y.global&&(y.lastIndex=0),y.test(f))return m}return null}}}const Dv=new Dh;class Zt{constructor(e){this.manager=e!==void 0?e:Dv,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Vn={};class yn extends Zt{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Xr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;if(Vn[e]!==void 0){Vn[e].push({onLoad:t,onProgress:i,onError:r});return}const l=/^data:(.*?)(;base64)?,(.*)$/,u=e.match(l);let c;if(u){const f=u[1],h=!!u[2];let p=u[3];p=decodeURIComponent(p),h&&(p=atob(p));try{let y;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const d=new Uint8Array(p.length);for(let v=0;v<p.length;v++)d[v]=p.charCodeAt(v);m==="blob"?y=new Blob([d.buffer],{type:f}):y=d.buffer;break;case"document":y=new DOMParser().parseFromString(p,f);break;case"json":y=JSON.parse(p);break;default:y=p;break}setTimeout(function(){t&&t(y),s.manager.itemEnd(e)},0)}catch(y){setTimeout(function(){r&&r(y),s.manager.itemError(e),s.manager.itemEnd(e)},0)}}else{Vn[e]=[],Vn[e].push({onLoad:t,onProgress:i,onError:r}),c=new XMLHttpRequest,c.open("GET",e,!0),c.addEventListener("load",function(f){const h=this.response,p=Vn[e];if(delete Vn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Xr.add(e,h);for(let y=0,m=p.length;y<m;y++){const d=p[y];d.onLoad&&d.onLoad(h)}s.manager.itemEnd(e)}else{for(let y=0,m=p.length;y<m;y++){const d=p[y];d.onError&&d.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)}},!1),c.addEventListener("progress",function(f){const h=Vn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onProgress&&m.onProgress(f)}},!1),c.addEventListener("error",function(f){const h=Vn[e];delete Vn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),c.addEventListener("abort",function(f){const h=Vn[e];delete Vn[e];for(let p=0,y=h.length;p<y;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),this.responseType!==void 0&&(c.responseType=this.responseType),this.withCredentials!==void 0&&(c.withCredentials=this.withCredentials),c.overrideMimeType&&c.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const f in this.requestHeader)c.setRequestHeader(f,this.requestHeader[f]);c.send(null)}return s.manager.itemStart(e),c}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class fN extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=po.parse(e[i]);t.push(r)}return t}}class pN extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],l=new dh,u=new yn(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let c=0;function f(h){u.load(e[h],function(p){const y=s.parse(p,!0);o[h]={width:y.width,height:y.height,format:y.format,mipmaps:y.mipmaps},c+=1,c===6&&(y.mipmapCount===1&&(l.minFilter=gt),l.image=o,l.format=y.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let h=0,p=e.length;h<p;++h)f(h);else u.load(e,function(h){const p=s.parse(h,!0);if(p.isCubemap){const y=p.mipmaps.length/p.mipmapCount;for(let m=0;m<y;m++){o[m]={mipmaps:[]};for(let d=0;d<p.mipmapCount;d++)o[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+d]),o[m].format=p.format,o[m].width=p.width,o[m].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=gt),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}}class _a extends Zt{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Xr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=document.createElementNS("http://www.w3.org/1999/xhtml","img");function u(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),Xr.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(f){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),r&&r(f),s.manager.itemError(e),s.manager.itemEnd(e)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class Bv extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=new js,o=new _a(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(c){o.load(e[c],function(f){s.images[c]=f,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)u(c);return s}}class Fv extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new zr,l=new yn(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){const c=s.parse(u);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:zt,o.wrapT=c.wrapT!==void 0?c.wrapT:zt,o.magFilter=c.magFilter!==void 0?c.magFilter:gt,o.minFilter=c.minFilter!==void 0?c.minFilter:gt,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=yi),c.mipmapCount===1&&(o.minFilter=gt),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},i,r),o}}class Bh extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=new St,o=new _a(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l;const u=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;s.format=u?bi:hn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class Vv extends gn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ba(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],l=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(l);for(let c=0;c<u.length;c++){const f=u[c];i&&i.equals(f)||(t.push(f),i=f)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Mh[r.type]().fromJSON(r))}return this}}class Ta extends Vv{constructor(e){super(),this.type="Path",this.currentPoint=new Se,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new ba(this.currentPoint.clone(),new Se(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new yc(this.currentPoint.clone(),new Se(e,t),new Se(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const l=new gc(this.currentPoint.clone(),new Se(e,t),new Se(i,r),new Se(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new vc(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,l,u){const c=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+c,t+f,i,r,s,o,l,u),this}absellipse(e,t,i,r,s,o,l,u){const c=new ga(e,t,i,r,s,o,l,u);if(this.curves.length>0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class hr extends Ta{constructor(e){super(e),this.uuid=fn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new Ta().fromJSON(r))}return this}}class kn extends Ze{constructor(e,t=1){super(),this.type="Light",this.color=new Re(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}kn.prototype.isLight=!0;class Fh extends kn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(Ze.DefaultUp),this.updateMatrix(),this.groundColor=new Re(t)}copy(e){return kn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Fh.prototype.isHemisphereLight=!0;const kv=new Ne,zv=new q,Uv=new q;class Vh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Se(512,512),this.map=null,this.mapPass=null,this.matrix=new Ne,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new na,this._frameExtents=new Se(1,1),this._viewportCount=1,this._viewports=[new it(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;zv.setFromMatrixPosition(e.matrixWorld),t.position.copy(zv),Uv.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Uv),t.updateMatrixWorld(),kv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(kv),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Gv extends Vh{constructor(){super(new Bt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=Yo*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Gv.prototype.isSpotLightShadow=!0;class _c extends kn{constructor(e,t,i=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(Ze.DefaultUp),this.updateMatrix(),this.target=new Ze,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new Gv}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}_c.prototype.isSpotLight=!0;const Hv=new Ne,Ea=new q,kh=new q;class Wv extends Vh{constructor(){super(new Bt(90,1,.5,500)),this._frameExtents=new Se(4,2),this._viewportCount=6,this._viewports=[new it(2,1,1,1),new it(0,1,1,1),new it(3,1,1,1),new it(1,1,1,1),new it(3,0,1,1),new it(1,0,1,1)],this._cubeDirections=[new q(1,0,0),new q(-1,0,0),new q(0,0,1),new q(0,0,-1),new q(0,1,0),new q(0,-1,0)],this._cubeUps=[new q(0,1,0),new q(0,1,0),new q(0,1,0),new q(0,1,0),new q(0,0,1),new q(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Ea.setFromMatrixPosition(e.matrixWorld),i.position.copy(Ea),kh.copy(i.position),kh.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(kh),i.updateMatrixWorld(),r.makeTranslation(-Ea.x,-Ea.y,-Ea.z),Hv.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Hv)}}Wv.prototype.isPointLightShadow=!0;class Tc extends kn{constructor(e,t,i=0,r=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Wv}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Tc.prototype.isPointLight=!0;class mo extends ta{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,l=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,l-=f*this.view.offsetY,u=l-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,u,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}mo.prototype.isOrthographicCamera=!0;class jv extends Vh{constructor(){super(new mo(-5,5,5,-5,.5,500))}}jv.prototype.isDirectionalLightShadow=!0;class Ec extends kn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Ze.DefaultUp),this.updateMatrix(),this.target=new Ze,this.shadow=new jv}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Ec.prototype.isDirectionalLight=!0;class zh extends kn{constructor(e,t){super(e,t),this.type="AmbientLight"}}zh.prototype.isAmbientLight=!0;class Uh extends kn{constructor(e,t,i=10,r=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Uh.prototype.isRectAreaLight=!0;class Gh{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new q)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}Gh.prototype.isSphericalHarmonics3=!0;class Aa extends kn{constructor(e=new Gh,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Aa.prototype.isLightProbe=!0;class $v extends Zt{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new yn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=new uN[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Re().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Re().setHex(o.value);break;case"v2":r.uniforms[s].value=new Se().fromArray(o.value);break;case"v3":r.uniforms[s].value=new q().fromArray(o.value);break;case"v4":r.uniforms[s].value=new it().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Ne().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Se().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Se().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Ri{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class Hh extends ke{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Hh.prototype.isInstancedBufferGeometry=!0;class Wh extends je{constructor(e,t,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Wh.prototype.isInstancedBufferAttribute=!0;class Zv extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(y,m){if(t[m]!==void 0)return t[m];const b=y.interleavedBuffers[m],v=s(y,b.buffer),g=ks(b.type,v),w=new lr(g,b.stride);return w.uuid=b.uuid,t[m]=w,w}function s(y,m){if(i[m]!==void 0)return i[m];const b=y.arrayBuffers[m],v=new Uint32Array(b).buffer;return i[m]=v,v}const o=e.isInstancedBufferGeometry?new Hh:new ke,l=e.data.index;if(l!==void 0){const y=ks(l.type,l.array);o.setIndex(new je(y,1))}const u=e.data.attributes;for(const y in u){const m=u[y];let d;if(m.isInterleavedBufferAttribute){const b=r(e.data,m.data);d=new Ci(b,m.itemSize,m.offset,m.normalized)}else{const b=ks(m.type,m.array),v=m.isInstancedBufferAttribute?Wh:je;d=new v(b,m.itemSize,m.normalized)}m.name!==void 0&&(d.name=m.name),m.usage!==void 0&&d.setUsage(m.usage),m.updateRange!==void 0&&(d.updateRange.offset=m.updateRange.offset,d.updateRange.count=m.updateRange.count),o.setAttribute(y,d)}const c=e.data.morphAttributes;if(c)for(const y in c){const m=c[y],d=[];for(let b=0,v=m.length;b<v;b++){const g=m[b];let w;if(g.isInterleavedBufferAttribute){const S=r(e.data,g.data);w=new Ci(S,g.itemSize,g.offset,g.normalized)}else{const S=ks(g.type,g.array);w=new je(S,g.itemSize,g.normalized)}g.name!==void 0&&(w.name=g.name),d.push(w)}o.morphAttributes[y]=d}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let y=0,m=h.length;y!==m;++y){const d=h[y];o.addGroup(d.start,d.count,d.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const y=new q;p.center!==void 0&&y.fromArray(p.center),o.boundingSphere=new wi(y,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class mN extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Ri.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new yn(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let c=null;try{c=JSON.parse(u)}catch(h){r!==void 0&&r(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const f=c.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Ri.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new yn(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),c=this.parseObject(e.object,s,u,l,i),f=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,f),t!==void 0){let h=!1;for(const p in o)if(o[p]instanceof HTMLImageElement){h=!0;break}h===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,r,l,o,t),c=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,c),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new hr().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new pa().fromJSON(e[s],r);i[l.uuid]=l}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new Zv;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in Pv?l=Pv[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),l.isBufferGeometry===!0&&u.userData!==void 0&&(l.userData=u.userData),i[u.uuid]=l}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new $v;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];if(u.type==="MultiMaterial"){const c=[];for(let f=0;f<u.materials.length;f++){const h=u.materials[f];i[h.uuid]===void 0&&(i[h.uuid]=s.parse(h)),c.push(i[h.uuid])}r[u.uuid]=c}else i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=po.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const c=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(f)}else return u.data?{data:ks(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new Dh(t);s=new _a(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c<f;c++){const h=e[c],p=h.url;if(Array.isArray(p)){r[h.uuid]=[];for(let y=0,m=p.length;y<m;y++){const d=p[y],b=l(d);b!==null&&(b instanceof HTMLImageElement?r[h.uuid].push(b):r[h.uuid].push(new zr(b.data,b.width,b.height)))}}else{const y=l(h.url);y!==null&&(r[h.uuid]=y)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(u)}else return o.data?{data:ks(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new _a(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.url;if(Array.isArray(c)){i[u.uuid]=[];for(let f=0,h=c.length;f<h;f++){const p=c[f],y=await s(p);y!==null&&(y instanceof HTMLImageElement?i[u.uuid].push(y):i[u.uuid].push(new zr(y.data,y.width,y.height)))}}else{const f=await s(u.url);f!==null&&(i[u.uuid]=f)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);let u;const c=t[l.image];Array.isArray(c)?(u=new js(c),c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new zr(c.data,c.width,c.height):u=new St(c),c&&(u.needsUpdate=!0)),u.uuid=l.uuid,l.name!==void 0&&(u.name=l.name),l.mapping!==void 0&&(u.mapping=i(l.mapping,gN)),l.offset!==void 0&&u.offset.fromArray(l.offset),l.repeat!==void 0&&u.repeat.fromArray(l.repeat),l.center!==void 0&&u.center.fromArray(l.center),l.rotation!==void 0&&(u.rotation=l.rotation),l.wrap!==void 0&&(u.wrapS=i(l.wrap[0],Xv),u.wrapT=i(l.wrap[1],Xv)),l.format!==void 0&&(u.format=l.format),l.type!==void 0&&(u.type=l.type),l.encoding!==void 0&&(u.encoding=l.encoding),l.minFilter!==void 0&&(u.minFilter=i(l.minFilter,Yv)),l.magFilter!==void 0&&(u.magFilter=i(l.magFilter,Yv)),l.anisotropy!==void 0&&(u.anisotropy=l.anisotropy),l.flipY!==void 0&&(u.flipY=l.flipY),l.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(u.unpackAlignment=l.unpackAlignment),r[l.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function l(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function u(p){if(p!==void 0){if(Array.isArray(p)){const y=[];for(let m=0,d=p.length;m<d;m++){const b=p[m];i[b]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",b),y.push(i[b])}return y}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let f,h;switch(e.type){case"Scene":o=new nc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Re(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new oa(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new sa(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Bt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new mo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new zh(e.color,e.intensity);break;case"DirectionalLight":o=new Ec(e.color,e.intensity);break;case"PointLight":o=new Tc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Uh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new _c(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new Fh(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Aa().fromJSON(e);break;case"SkinnedMesh":f=l(e.geometry),h=u(e.material),o=new ha(f,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=l(e.geometry),h=u(e.material),o=new Tt(f,h);break;case"InstancedMesh":f=l(e.geometry),h=u(e.material);const p=e.count,y=e.instanceMatrix,m=e.instanceColor;o=new lh(f,h,p),o.instanceMatrix=new je(new Float32Array(y.array),16),m!==void 0&&(o.instanceColor=new je(new Float32Array(m.array),m.itemSize));break;case"LOD":o=new sv;break;case"Line":o=new Kn(l(e.geometry),u(e.material));break;case"LineLoop":o=new cc(l(e.geometry),u(e.material));break;case"LineSegments":o=new rn(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new qs(l(e.geometry),u(e.material));break;case"Sprite":o=new da(u(e.material));break;case"Group":o=new Jn;break;case"Bone":o=new fa;break;default:o=new Ze}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let y=0;y<p.length;y++)o.add(this.parseObject(p[y],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let y=0;y<p.length;y++){const m=p[y];o.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let y=0;y<p.length;y++){const m=p[y],d=o.getObjectByProperty("uuid",m.object);d!==void 0&&o.addLevel(d,m.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const gN={UVMapping:Sl,CubeReflectionMapping:Uo,CubeRefractionMapping:Go,EquirectangularReflectionMapping:_l,EquirectangularRefractionMapping:Tl,CubeUVReflectionMapping:_s,CubeUVRefractionMapping:Ho},Xv={RepeatWrapping:Ji,ClampToEdgeWrapping:zt,MirroredRepeatWrapping:Ts},Yv={NearestFilter:Mt,NearestMipmapNearestFilter:Wo,NearestMipmapLinearFilter:jo,LinearFilter:gt,LinearMipmapNearestFilter:El,LinearMipmapLinearFilter:yi};class jh extends Zt{constructor(e){super(e),typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Xr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){Xr.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}jh.prototype.isImageBitmapLoader=!0;class Jv{constructor(){this.type="ShapePath",this.color=new Re,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ta,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function i(g){const w=[];for(let S=0,T=g.length;S<T;S++){const M=g[S],C=new hr;C.curves=M.curves,w.push(C)}return w}function r(g,w){const S=w.length;let T=!1;for(let M=S-1,C=0;C<S;M=C++){let _=w[M],P=w[C],E=P.x-_.x,O=P.y-_.y;if(Math.abs(O)>Number.EPSILON){if(O<0&&(_=w[C],E=-E,P=w[M],O=-O),g.y<_.y||g.y>P.y)continue;if(g.y===_.y){if(g.x===_.x)return!0}else{const A=O*(g.x-_.x)-E*(g.y-_.y);if(A===0)return!0;if(A<0)continue;T=!T}}else{if(g.y!==_.y)continue;if(P.x<=g.x&&g.x<=_.x||_.x<=g.x&&g.x<=P.x)return!0}}return T}const s=Qn.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new hr,c.curves=u.curves,f.push(c),f;let h=!s(o[0].getPoints());h=e?!h:h;const p=[],y=[];let m=[],d=0,b;y[d]=void 0,m[d]=[];for(let g=0,w=o.length;g<w;g++)u=o[g],b=u.getPoints(),l=s(b),l=e?!l:l,l?(!h&&y[d]&&d++,y[d]={s:new hr,p:b},y[d].s.curves=u.curves,h&&d++,m[d]=[]):m[d].push({h:u,p:b[0]});if(!y[0])return i(o);if(y.length>1){let g=!1;const w=[];for(let S=0,T=y.length;S<T;S++)p[S]=[];for(let S=0,T=y.length;S<T;S++){const M=m[S];for(let C=0;C<M.length;C++){const _=M[C];let P=!0;for(let E=0;E<y.length;E++)r(_.p,y[E].p)&&(S!==E&&w.push({froms:S,tos:E,hole:C}),P?(P=!1,p[E].push(_)):g=!0);P&&p[S].push(_)}}w.length>0&&(g||(m=p))}let v;for(let g=0,w=y.length;g<w;g++){c=y[g].s,f.push(c),v=m[g];for(let S=0,T=v.length;S<T;S++)c.holes.push(v[S].h)}return f}}class $h{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],r=yN(e,t,this.data);for(let s=0,o=r.length;s<o;s++)Array.prototype.push.apply(i,r[s].toShapes());return i}}function yN(n,e,t){const i=Array.from(n),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let l=0,u=0;for(let c=0;c<i.length;c++){const f=i[c];if(f===`
2916
2916
  `)l=0,u-=s;else{const h=vN(f,r,l,u,t);l+=h.offsetX,o.push(h.path)}}return o}function vN(n,e,t,i,r){const s=r.glyphs[n]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+n+'" does not exists in font family '+r.familyName+".");return}const o=new Jv;let l,u,c,f,h,p,y,m;if(s.o){const d=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let b=0,v=d.length;b<v;)switch(d[b++]){case"m":l=d[b++]*e+t,u=d[b++]*e+i,o.moveTo(l,u);break;case"l":l=d[b++]*e+t,u=d[b++]*e+i,o.lineTo(l,u);break;case"q":c=d[b++]*e+t,f=d[b++]*e+i,h=d[b++]*e+t,p=d[b++]*e+i,o.quadraticCurveTo(h,p,c,f);break;case"b":c=d[b++]*e+t,f=d[b++]*e+i,h=d[b++]*e+t,p=d[b++]*e+i,y=d[b++]*e+t,m=d[b++]*e+i,o.bezierCurveTo(h,p,y,m,c,f);break}}return{offsetX:s.ha*e,path:o}}$h.prototype.isFont=!0;class bN extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){let u;try{u=JSON.parse(l)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),u=JSON.parse(l.substring(65,l.length-2))}const c=s.parse(u);t&&t(c)},i,r)}parse(e){return new $h(e)}}let Ac;const Zh={getContext:function(){return Ac===void 0&&(Ac=new(window.AudioContext||window.webkitAudioContext)),Ac},setContext:function(n){Ac=n}};class Kv extends Zt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new yn(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);Zh.getContext().decodeAudioData(u,function(f){t(f)})}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}}class qv extends Aa{constructor(e,t,i=1){super(void 0,i);const r=new Re().set(e),s=new Re().set(t),o=new q(r.r,r.g,r.b),l=new q(s.r,s.g,s.b),u=Math.sqrt(Math.PI),c=u*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(l).multiplyScalar(u),this.sh.coefficients[1].copy(o).sub(l).multiplyScalar(c)}}qv.prototype.isHemisphereLightProbe=!0;class Qv extends Aa{constructor(e,t=1){super(void 0,t);const i=new Re().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Qv.prototype.isAmbientLightProbe=!0;const eb=new Ne,tb=new Ne;class xN{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Bt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Bt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;const r=e.projectionMatrix.clone(),s=t.eyeSep/2,o=s*t.near/t.focus,l=t.near*Math.tan(Nr*t.fov*.5)/t.zoom;let u,c;tb.elements[12]=-s,eb.elements[12]=s,u=-l*t.aspect+o,c=l*t.aspect+o,r.elements[0]=2*t.near/(c-u),r.elements[8]=(c+u)/(c-u),this.cameraL.projectionMatrix.copy(r),u=-l*t.aspect-o,c=l*t.aspect-o,r.elements[0]=2*t.near/(c-u),r.elements[8]=(c+u)/(c-u),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(tb),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(eb)}}class nb{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ib(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=ib();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function ib(){return(typeof performance>"u"?Date:performance).now()}const Yr=new q,rb=new $t,wN=new q,Jr=new q;class MN extends Ze{constructor(){super(),this.type="AudioListener",this.context=Zh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new nb}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Yr,rb,wN),Jr.set(0,0,-1).applyQuaternion(rb),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Yr.x,r),t.positionY.linearRampToValueAtTime(Yr.y,r),t.positionZ.linearRampToValueAtTime(Yr.z,r),t.forwardX.linearRampToValueAtTime(Jr.x,r),t.forwardY.linearRampToValueAtTime(Jr.y,r),t.forwardZ.linearRampToValueAtTime(Jr.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Yr.x,Yr.y,Yr.z),t.setOrientation(Jr.x,Jr.y,Jr.z,i.x,i.y,i.z)}}class Xh extends Ze{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Kr=new q,sb=new $t,SN=new q,qr=new q;class _N extends Xh{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Kr,sb,SN),qr.set(0,0,1).applyQuaternion(sb);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Kr.x,i),t.positionY.linearRampToValueAtTime(Kr.y,i),t.positionZ.linearRampToValueAtTime(Kr.z,i),t.orientationX.linearRampToValueAtTime(qr.x,i),t.orientationY.linearRampToValueAtTime(qr.y,i),t.orientationZ.linearRampToValueAtTime(qr.z,i)}else t.setPosition(Kr.x,Kr.y,Kr.z),t.setOrientation(qr.x,qr.y,qr.z)}}class ob{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class ab{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let l=0;l!==r;++l)i[s+l]=i[l];o=t}else{o+=t;const l=t/o;this._mixBufferRegion(i,s,0,l,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,l=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const u=t*this._origIndex;this._mixBufferRegion(i,r,u,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let u=t,c=t+t;u!==c;++u)if(i[u]!==i[u+t]){l.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){$t.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;$t.multiplyQuaternionsFlat(e,o,e,t,e,i),$t.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let l=0;l!==s;++l){const u=t+l;e[u]=e[u]*o+e[i+l]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]+e[i+o]*r}}}const Yh="\\[\\]\\.:\\/",TN=new RegExp("["+Yh+"]","g"),Jh="[^"+Yh+"]",EN="[^"+Yh.replace("\\.","")+"]",AN=/((?:WC+[\/:])*)/.source.replace("WC",Jh),CN=/(WCOD+)?/.source.replace("WCOD",EN),RN=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Jh),LN=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Jh),PN=new RegExp("^"+AN+CN+RN+LN+"$"),IN=["material","materials","bones"];class ON{constructor(e,t,i){const r=i||et.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class et{constructor(e,t,i){this.path=t,this.parsedPath=i||et.parseTrackName(t),this.node=et.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new et.Composite(e,t,i):new et(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(TN,"")}static parseTrackName(e){const t=PN.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);IN.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o<s.length;o++){const l=s[o];if(l.name===t||l.uuid===t)return l;const u=i(l.children);if(u)return u}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.node[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=et.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(i){let c=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let f=0;f<e.length;f++)if(e[f].name===c){c=f;break}break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[r];if(o===void 0){const c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}u=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(u=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}et.Composite=ON,et.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},et.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},et.prototype.GetterByBindingType=[et.prototype._getValue_direct,et.prototype._getValue_array,et.prototype._getValue_arrayElement,et.prototype._getValue_toArray],et.prototype.SetterByBindingTypeAndVersioning=[[et.prototype._setValue_direct,et.prototype._setValue_direct_setNeedsUpdate,et.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[et.prototype._setValue_array,et.prototype._setValue_array_setNeedsUpdate,et.prototype._setValue_array_setMatrixWorldNeedsUpdate],[et.prototype._setValue_arrayElement,et.prototype._setValue_arrayElement_setNeedsUpdate,et.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[et.prototype._setValue_fromArray,et.prototype._setValue_fromArray_setNeedsUpdate,et.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class lb{constructor(){this.uuid=fn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length;let l,u=e.length,c=this.nCachedObjects_;for(let f=0,h=arguments.length;f!==h;++f){const p=arguments[f],y=p.uuid;let m=t[y];if(m===void 0){m=u++,t[y]=m,e.push(p);for(let d=0,b=o;d!==b;++d)s[d].push(new et(p,i[d],r[d]))}else if(m<c){l=e[m];const d=--c,b=e[d];t[b.uuid]=m,e[m]=b,t[y]=d,e[d]=p;for(let v=0,g=o;v!==g;++v){const w=s[v],S=w[d];let T=w[m];w[m]=S,T===void 0&&(T=new et(p,i[v],r[v])),w[d]=T}}else e[m]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_;for(let o=0,l=arguments.length;o!==l;++o){const u=arguments[o],c=u.uuid,f=t[c];if(f!==void 0&&f>=s){const h=s++,p=e[h];t[p.uuid]=f,e[f]=p,t[c]=h,e[h]=u;for(let y=0,m=r;y!==m;++y){const d=i[y],b=d[h],v=d[f];d[f]=b,d[h]=v}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let l=0,u=arguments.length;l!==u;++l){const c=arguments[l],f=c.uuid,h=t[f];if(h!==void 0)if(delete t[f],h<s){const p=--s,y=e[p],m=--o,d=e[m];t[y.uuid]=h,e[h]=y,t[d.uuid]=p,e[p]=d,e.pop();for(let b=0,v=r;b!==v;++b){const g=i[b],w=g[p],S=g[m];g[h]=w,g[p]=S,g.pop()}}else{const p=--o,y=e[p];p>0&&(t[y.uuid]=h),e[h]=y,e.pop();for(let m=0,d=r;m!==d;++m){const b=i[m];b[h]=b[p],b.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,l=this._parsedPaths,u=this._objects,c=u.length,f=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),l.push(t),s.push(h);for(let p=f,y=u.length;p!==y;++p){const m=u[p];h[p]=new et(m,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,l=o.length-1,u=o[l],c=e[l];t[c]=i,o[i]=u,o.pop(),s[i]=s[l],s.pop(),r[i]=r[l],r.pop()}}}lb.prototype.isAnimationObjectGroup=!0;class NN{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,l=new Array(o),u={endingStart:Pr,endingEnd:Pr};for(let c=0;c!==o;++c){const f=s[c].createInterpolant(null);l[c]=f,f.settings=u}this._interpolantSettings=u,this._interpolants=l,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=J0,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,l=r/s;e.warp(1,o,t),this.warp(l,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);const u=l.parameterPositions,c=l.sampleValues;return u[0]=s,u[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const u=(e-s)*i;if(u<0||i===0)return;this._startTime=null,t=i*u}t*=this._updateTimeScale(e);const o=this._updateTime(t),l=this._updateWeight(e);if(l>0){const u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case wd:for(let f=0,h=u.length;f!==h;++f)u[f].evaluate(o),c[f].accumulateAdditive(l);break;case Cl:default:for(let f=0,h=u.length;f!==h;++f)u[f].evaluate(o),c[f].accumulate(r,l)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===K0;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===Y0){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const l=Math.floor(r/t);r-=t*l,s+=Math.abs(l);const u=this.repetitions-s;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Ir,r.endingEnd=Ir):(e?r.endingStart=this.zeroSlopeAtStart?Ir:Pr:r.endingStart=Xo,t?r.endingEnd=this.zeroSlopeAtEnd?Ir:Pr:r.endingEnd=Xo)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=s,u[0]=t,l[1]=s+e,u[1]=i,this}}class cb extends qi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,l=e._interpolants,u=i.uuid,c=this._bindingsByRootAndName;let f=c[u];f===void 0&&(f={},c[u]=f);for(let h=0;h!==s;++h){const p=r[h],y=p.name;let m=f[y];if(m!==void 0)o[h]=m;else{if(m=o[h],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,u,y));continue}const d=t&&t._propertyBindings[h].binding.parsedPath;m=new ab(et.create(i,y,d),p.ValueTypeName,p.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,u,y),o[h]=m}l[h].resultBuffer=m.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const r=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const l=o.knownActions;e._byClipCacheIndex=l.length,l.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,l=o[s],u=l.knownActions,c=u[u.length-1],f=e._byClipCacheIndex;c._byClipCacheIndex=f,u[f]=c,u.pop(),e._byClipCacheIndex=null;const h=l.actionByRoot,p=(e._localRoot||this._root).uuid;delete h[p],u.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,s=i.path,o=this._bindingsByRootAndName,l=o[r],u=t[t.length-1],c=e._cacheIndex;u._cacheIndex=c,t[c]=u,t.pop(),delete l[s],Object.keys(l).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new Oh(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=i,t[i]=s}clipAction(e,t,i){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?po.findByName(r,e):e;const l=o!==null?o.uuid:e,u=this._actionsByClip[l];let c=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Cl),u!==void 0){const h=u.actionByRoot[s];if(h!==void 0&&h.blendMode===i)return h;c=u.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const f=new NN(this,o,t,i);return this._bindAction(f,c),this._addInactiveAction(f,l,s),f}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?po.findByName(i,e):e,o=s?s.uuid:e,l=this._actionsByClip[o];return l!==void 0&&l.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const l=this._bindings,u=this._nActiveBindings;for(let c=0;c!==u;++c)l[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,s=r[i];if(s!==void 0){const o=s.knownActions;for(let l=0,u=o.length;l!==u;++l){const c=o[l];this._deactivateAction(c);const f=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=f,t[f]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const l=i[o].actionByRoot,u=l[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const l=s[o];l.restoreOriginalState(),this._removeInactiveBinding(l)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}cb.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Cc{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Cc(this.value.clone===void 0?this.value:this.value.clone())}}class ub extends lr{constructor(e,t,i=1){super(e,t),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}ub.prototype.isInstancedInterleavedBuffer=!0;class db{constructor(e,t,i,r,s){this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}db.prototype.isGLBufferAttribute=!0;class DN{constructor(e,t,i=0,r=1/0){this.ray=new nr(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new zd,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!1,i=[]){return Kh(e,this,i,t),i.sort(hb),i}intersectObjects(e,t=!1,i=[]){for(let r=0,s=e.length;r<s;r++)Kh(e[r],this,i,t);return i.sort(hb),i}}function hb(n,e){return n.distance-e.distance}function Kh(n,e,t,i){if(n.layers.test(e.layers)&&n.raycast(e,t),i===!0){const r=n.children;for(let s=0,o=r.length;s<o;s++)Kh(r[s],e,t,!0)}}class BN{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(jt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class FN{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}const fb=new Se;class go{constructor(e=new Se(1/0,1/0),t=new Se(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=fb.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return fb.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}go.prototype.isBox2=!0;const pb=new q,Rc=new q;class mb{constructor(e=new q,t=new q){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){pb.subVectors(e,this.start),Rc.subVectors(this.end,this.start);const i=Rc.dot(Rc);let s=Rc.dot(pb)/i;return t&&(s=jt(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class gb extends Ze{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}gb.prototype.isImmediateRenderObject=!0;const yb=new q;class VN extends Ze{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const i=new ke,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,l=1,u=32;o<u;o++,l++){const c=o/u*Math.PI*2,f=l/u*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(f),Math.sin(f),1)}i.setAttribute("position",new Ie(r,3));const s=new Ft({fog:!1,toneMapped:!1});this.cone=new rn(i,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),yb.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(yb),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const fr=new q,Lc=new Ne,qh=new Ne;class vb extends rn{constructor(e){const t=bb(e),i=new ke,r=[],s=[],o=new Re(0,0,1),l=new Re(0,1,0);for(let c=0;c<t.length;c++){const f=t[c];f.parent&&f.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(o.r,o.g,o.b),s.push(l.r,l.g,l.b))}i.setAttribute("position",new Ie(r,3)),i.setAttribute("color",new Ie(s,3));const u=new Ft({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,u),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");qh.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const l=t[s];l.parent&&l.parent.isBone&&(Lc.multiplyMatrices(qh,l.matrixWorld),fr.setFromMatrixPosition(Lc),r.setXYZ(o,fr.x,fr.y,fr.z),Lc.multiplyMatrices(qh,l.parent.matrixWorld),fr.setFromMatrixPosition(Lc),r.setXYZ(o+1,fr.x,fr.y,fr.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function bb(n){const e=[];n&&n.isBone&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,bb(n.children[t]));return e}class kN extends Tt{constructor(e,t,i){const r=new Hr(t,4,2),s=new cn({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const zN=new q,xb=new Re,wb=new Re;class UN extends Ze{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const r=new Ur(t);r.rotateY(Math.PI*.5),this.material=new cn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),o=new Float32Array(s.count*3);r.setAttribute("color",new je(o,3)),this.add(new Tt(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");xb.copy(this.light.color),wb.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?xb:wb;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}e.lookAt(zN.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Mb extends rn{constructor(e=10,t=10,i=4473924,r=8947848){i=new Re(i),r=new Re(r);const s=t/2,o=e/t,l=e/2,u=[],c=[];for(let p=0,y=0,m=-l;p<=t;p++,m+=o){u.push(-l,0,m,l,0,m),u.push(m,0,-l,m,0,l);const d=p===s?i:r;d.toArray(c,y),y+=3,d.toArray(c,y),y+=3,d.toArray(c,y),y+=3,d.toArray(c,y),y+=3}const f=new ke;f.setAttribute("position",new Ie(u,3)),f.setAttribute("color",new Ie(c,3));const h=new Ft({vertexColors:!0,toneMapped:!1});super(f,h),this.type="GridHelper"}}class GN extends rn{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new Re(s),o=new Re(o);const l=[],u=[];for(let h=0;h<=t;h++){const p=h/t*(Math.PI*2),y=Math.sin(p)*e,m=Math.cos(p)*e;l.push(0,0,0),l.push(y,0,m);const d=h&1?s:o;u.push(d.r,d.g,d.b),u.push(d.r,d.g,d.b)}for(let h=0;h<=i;h++){const p=h&1?s:o,y=e-e/i*h;for(let m=0;m<r;m++){let d=m/r*(Math.PI*2),b=Math.sin(d)*y,v=Math.cos(d)*y;l.push(b,0,v),u.push(p.r,p.g,p.b),d=(m+1)/r*(Math.PI*2),b=Math.sin(d)*y,v=Math.cos(d)*y,l.push(b,0,v),u.push(p.r,p.g,p.b)}}const c=new ke;c.setAttribute("position",new Ie(l,3)),c.setAttribute("color",new Ie(u,3));const f=new Ft({vertexColors:!0,toneMapped:!1});super(c,f),this.type="PolarGridHelper"}}const Sb=new q,Pc=new q,_b=new q;class HN extends Ze{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,t===void 0&&(t=1);let r=new ke;r.setAttribute("position",new Ie([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new Ft({fog:!1,toneMapped:!1});this.lightPlane=new Kn(r,s),this.add(this.lightPlane),r=new ke,r.setAttribute("position",new Ie([0,0,0,0,0,1],3)),this.targetLine=new Kn(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Sb.setFromMatrixPosition(this.light.matrixWorld),Pc.setFromMatrixPosition(this.light.target.matrixWorld),_b.subVectors(Pc,Sb),this.lightPlane.lookAt(Pc),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Pc),this.targetLine.scale.z=_b.length()}}const Ic=new q,yt=new ta;class WN extends rn{constructor(e){const t=new ke,i=new Ft({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],o={},l=new Re(16755200),u=new Re(16711680),c=new Re(43775),f=new Re(16777215),h=new Re(3355443);p("n1","n2",l),p("n2","n4",l),p("n4","n3",l),p("n3","n1",l),p("f1","f2",l),p("f2","f4",l),p("f4","f3",l),p("f3","f1",l),p("n1","f1",l),p("n2","f2",l),p("n3","f3",l),p("n4","f4",l),p("p","n1",u),p("p","n2",u),p("p","n3",u),p("p","n4",u),p("u1","u2",c),p("u2","u3",c),p("u3","u1",c),p("c","t",f),p("p","c",h),p("cn1","cn2",h),p("cn3","cn4",h),p("cf1","cf2",h),p("cf3","cf4",h);function p(m,d,b){y(m,b),y(d,b)}function y(m,d){r.push(0,0,0),s.push(d.r,d.g,d.b),o[m]===void 0&&(o[m]=[]),o[m].push(r.length/3-1)}t.setAttribute("position",new Ie(r,3)),t.setAttribute("color",new Ie(s,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;yt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),At("c",t,e,yt,0,0,-1),At("t",t,e,yt,0,0,1),At("n1",t,e,yt,-i,-r,-1),At("n2",t,e,yt,i,-r,-1),At("n3",t,e,yt,-i,r,-1),At("n4",t,e,yt,i,r,-1),At("f1",t,e,yt,-i,-r,1),At("f2",t,e,yt,i,-r,1),At("f3",t,e,yt,-i,r,1),At("f4",t,e,yt,i,r,1),At("u1",t,e,yt,i*.7,r*1.1,-1),At("u2",t,e,yt,-i*.7,r*1.1,-1),At("u3",t,e,yt,0,r*2,-1),At("cf1",t,e,yt,-i,0,1),At("cf2",t,e,yt,i,0,1),At("cf3",t,e,yt,0,-r,1),At("cf4",t,e,yt,0,r,1),At("cn1",t,e,yt,-i,0,-1),At("cn2",t,e,yt,i,0,-1),At("cn3",t,e,yt,0,-r,-1),At("cn4",t,e,yt,0,r,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function At(n,e,t,i,r,s,o){Ic.set(r,s,o).unproject(i);const l=e[n];if(l!==void 0){const u=t.getAttribute("position");for(let c=0,f=l.length;c<f;c++)u.setXYZ(l[c],Ic.x,Ic.y,Ic.z)}}const Oc=new ln;class Tb extends rn{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),s=new ke;s.setIndex(new je(i,1)),s.setAttribute("position",new je(r,3)),super(s,new Ft({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Oc.setFromObject(this.object),Oc.isEmpty())return;const t=Oc.min,i=Oc.max,r=this.geometry.attributes.position,s=r.array;s[0]=i.x,s[1]=i.y,s[2]=i.z,s[3]=t.x,s[4]=i.y,s[5]=i.z,s[6]=t.x,s[7]=t.y,s[8]=i.z,s[9]=i.x,s[10]=t.y,s[11]=i.z,s[12]=i.x,s[13]=i.y,s[14]=t.z,s[15]=t.x,s[16]=i.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=i.x,s[22]=t.y,s[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return rn.prototype.copy.call(this,e),this.object=e.object,this}}class jN extends rn{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new ke;s.setIndex(new je(i,1)),s.setAttribute("position",new Ie(r,3)),super(s,new Ft({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class $N extends Kn{constructor(e,t=1,i=16776960){const r=i,s=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],o=new ke;o.setAttribute("position",new Ie(s,3)),o.computeBoundingSphere(),super(o,new Ft({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const l=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],u=new ke;u.setAttribute("position",new Ie(l,3)),u.computeBoundingSphere(),this.add(new Tt(u,new cn({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?wt:Zi,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const Eb=new q;let Nc,Qh;class ZN extends Ze{constructor(e=new q(0,0,1),t=new q(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",Nc===void 0&&(Nc=new ke,Nc.setAttribute("position",new Ie([0,0,0,0,1,0],3)),Qh=new ur(0,.5,1,5,1),Qh.translate(0,-.5,0)),this.position.copy(t),this.line=new Kn(Nc,new Ft({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Tt(Qh,new cn({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Eb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Eb,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class Ab extends rn{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new ke;r.setAttribute("position",new Ie(t,3)),r.setAttribute("color",new Ie(i,3));const s=new Ft({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Re,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const Cb=new Float32Array(1),XN=new Int32Array(Cb.buffer);class YN{static toHalfFloat(e){Cb[0]=e;const t=XN[0];let i=t>>16&32768,r=t>>12&2047;const s=t>>23&255;return s<103?i:s>142?(i|=31744,i|=(s==255?0:1)&&t&8388607,i):s<113?(r|=2048,i|=(r>>114-s)+(r>>113-s&1),i):(i|=s-112<<10|r>>1,i+=r&1,i)}}const yo=4,pr=8,ti=Math.pow(2,pr),Rb=[.125,.215,.35,.446,.526,.582],Lb=pr-yo+1+Rb.length,vo=20,ni={[tn]:0,[Or]:1,[Ll]:2,[Sd]:3,[_d]:4,[Td]:5,[Rl]:6},Qr=new cn({side:wt,depthWrite:!1,depthTest:!1}),JN=new Tt(new Ei,Qr),ef=new mo,{_lodPlanes:Ca,_sizeLods:Pb,_sigmas:Dc}=QN(),Ib=new Re;let tf=null;const es=(1+Math.sqrt(5))/2,bo=1/es,Ob=[new q(1,1,1),new q(-1,1,1),new q(1,1,-1),new q(-1,1,-1),new q(0,es,bo),new q(0,es,-bo),new q(bo,0,es),new q(-bo,0,es),new q(es,bo,0),new q(-es,bo,0)];function Nb(n){const e=Math.max(n.r,n.g,n.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return n.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class KN{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=eD(vo),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){tf=this._renderer.getRenderTarget();const s=this._allocateTargets();return this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Fb(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=Bb(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<Ca.length;e++)Ca[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(tf),e.scissorTest=!1,Bc(e,0,0,e.width,e.height)}_fromTexture(e){tf=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:Mt,minFilter:Mt,generateMipmaps:!1,type:Ar,format:h0,encoding:qN(e)?e.encoding:Ll,depthBuffer:!1},i=Db(t);return i.depthBuffer=!e,this._pingPongRenderTarget=Db(t),i}_compileMaterial(e){const t=new Tt(Ca[0],e);this._renderer.compile(t,ef)}_sceneToCubeUV(e,t,i,r){const l=new Bt(90,1,t,i),u=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],f=this._renderer,h=f.autoClear,p=f.outputEncoding,y=f.toneMapping;f.getClearColor(Ib),f.toneMapping=Yi,f.outputEncoding=tn,f.autoClear=!1;let m=!1;const d=e.background;if(d){if(d.isColor){Qr.color.copy(d).convertSRGBToLinear(),e.background=null;const b=Nb(Qr.color);Qr.opacity=b,m=!0}}else{Qr.color.copy(Ib).convertSRGBToLinear();const b=Nb(Qr.color);Qr.opacity=b,m=!0}for(let b=0;b<6;b++){const v=b%3;v==0?(l.up.set(0,u[b],0),l.lookAt(c[b],0,0)):v==1?(l.up.set(0,0,u[b]),l.lookAt(0,c[b],0)):(l.up.set(0,u[b],0),l.lookAt(0,0,c[b])),Bc(r,v*ti,b>2?ti:0,ti,ti),f.setRenderTarget(r),m&&f.render(JN,l),f.render(e,l)}f.toneMapping=y,f.outputEncoding=p,f.autoClear=h}_textureToCubeUV(e,t){const i=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Fb()):this._equirectShader==null&&(this._equirectShader=Bb());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new Tt(Ca[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=ni[e.encoding],o.outputEncoding.value=ni[t.texture.encoding],Bc(t,0,0,3*ti,2*ti),i.setRenderTarget(t),i.render(s,ef)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<Lb;r++){const s=Math.sqrt(Dc[r]*Dc[r]-Dc[r-1]*Dc[r-1]),o=Ob[(r-1)%Ob.length];this._blur(e,r-1,r,s,o)}t.autoClear=i}_blur(e,t,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,t,i,r,s,o,l){const u=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const f=3,h=new Tt(Ca[r],c),p=c.uniforms,y=Pb[i]-1,m=isFinite(s)?Math.PI/(2*y):2*Math.PI/(2*vo-1),d=s/m,b=isFinite(s)?1+Math.floor(f*d):vo;b>vo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${vo}`);const v=[];let g=0;for(let M=0;M<vo;++M){const C=M/d,_=Math.exp(-C*C/2);v.push(_),M==0?g+=_:M<b&&(g+=2*_)}for(let M=0;M<v.length;M++)v[M]=v[M]/g;p.envMap.value=e.texture,p.samples.value=b,p.weights.value=v,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l),p.dTheta.value=m,p.mipInt.value=pr-i,p.inputEncoding.value=ni[e.texture.encoding],p.outputEncoding.value=ni[e.texture.encoding];const w=Pb[r],S=3*Math.max(0,ti-2*w),T=(r===0?0:2*ti)+2*w*(r>pr-yo?r-pr+yo:0);Bc(t,S,T,3*w,2*w),u.setRenderTarget(t),u.render(h,ef)}}function qN(n){return n===void 0||n.type!==Ar?!1:n.encoding===tn||n.encoding===Or||n.encoding===Rl}function QN(){const n=[],e=[],t=[];let i=pr;for(let r=0;r<Lb;r++){const s=Math.pow(2,i);e.push(s);let o=1/s;r>pr-yo?o=Rb[r-pr+yo-1]:r==0&&(o=0),t.push(o);const l=1/(s-1),u=-l/2,c=1+l/2,f=[u,u,c,u,c,c,u,u,c,c,u,c],h=6,p=6,y=3,m=2,d=1,b=new Float32Array(y*p*h),v=new Float32Array(m*p*h),g=new Float32Array(d*p*h);for(let S=0;S<h;S++){const T=S%3*2/3-1,M=S>2?0:-1,C=[T,M,0,T+2/3,M,0,T+2/3,M+1,0,T,M,0,T+2/3,M+1,0,T,M+1,0];b.set(C,y*p*S),v.set(f,m*p*S);const _=[S,S,S,S,S,S];g.set(_,d*p*S)}const w=new ke;w.setAttribute("position",new je(b,y)),w.setAttribute("uv",new je(v,m)),w.setAttribute("faceIndex",new je(g,d)),n.push(w),i>yo&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function Db(n){const e=new Pn(3*ti,3*ti,n);return e.texture.mapping=_s,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Bc(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function eD(n){const e=new Float32Array(n),t=new q(0,1,0);return new uo({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:ni[tn]},outputEncoding:{value:ni[tn]}},vertexShader:nf(),fragmentShader:`
2917
2917
 
2918
2918
  precision mediump float;
@@ -3179,9 +3179,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3179
3179
  `),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(`
3180
3180
  `),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join(`
3181
3181
  `),l={specular:{value:new Re().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=l,this.onBeforeCompile=function(u){for(const c in l)u.uniforms[c]=l[c];u.fragmentShader=u.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return l.specular.value},set:function(u){l.specular.value=u}},specularMap:{get:function(){return l.specularMap.value},set:function(u){l.specularMap.value=u,u?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return l.glossiness.value},set:function(u){l.glossiness.value=u}},glossinessMap:{get:function(){return l.glossinessMap.value},set:function(u){l.glossinessMap.value=u,u?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class hB{constructor(){this.name=tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return lf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Re(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Re(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Re(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){const t=new lf(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Ki,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class fB{constructor(){this.name=tt.KHR_MESH_QUANTIZATION}}class xo extends ei{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}}xo.prototype.beforeStart_=xo.prototype.copySampleValue_,xo.prototype.afterEnd_=xo.prototype.copySampleValue_,xo.prototype.interpolate_=function(n,e,t,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-e,f=(t-e)/c,h=f*f,p=h*f,y=n*u,m=y-u,d=-2*p+3*h,b=p-h,v=1-d,g=b-h+f;for(let w=0;w!==o;w++){const S=s[m+w+o],T=s[m+w+l]*c,M=s[y+w+o],C=s[y+w]*c;r[w]=v*S+g*T+d*M+b*C}return r};const Li={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Pa={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Hb={9728:Mt,9729:gt,9984:Wo,9985:El,9986:jo,9987:yi},Wb={33071:zt,33648:Ts,10497:Ji},jb={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cf={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},mr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},pB={CUBICSPLINE:void 0,LINEAR:Lr,STEP:Cs},uf={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function $b(n,e){return typeof n!="string"||n===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(n)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(n)||/^data:.*,.*$/i.test(n)||/^blob:.*$/i.test(n)?n:e+n)}function mB(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Wr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Zi})),n.DefaultMaterial}function Ia(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function ts(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function gB(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l<u;l++){const c=e[l];if(c.POSITION!==void 0&&(i=!0),c.NORMAL!==void 0&&(r=!0),i&&r)break}if(!i&&!r)return Promise.resolve(n);const s=[],o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];if(i){const f=c.POSITION!==void 0?t.getDependency("accessor",c.POSITION):n.attributes.position;s.push(f)}if(r){const f=c.NORMAL!==void 0?t.getDependency("accessor",c.NORMAL):n.attributes.normal;o.push(f)}}return Promise.all([Promise.all(s),Promise.all(o)]).then(function(l){const u=l[0],c=l[1];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=c),n.morphTargetsRelative=!0,n})}function yB(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function vB(n){const e=n.extensions&&n.extensions[tt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+Zb(e.attributes):t=n.indices+":"+Zb(n.attributes)+":"+n.mode,t}function Zb(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function df(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class bB{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new tB,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},typeof createImageBitmap<"u"&&/Firefox/.test(navigator.userAgent)===!1?this.textureLoader=new jh(this.options.manager):this.textureLoader=new Bh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new yn(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const l={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};Ia(s,l,r),ts(l,r),Promise.all(i._invokeAll(function(u){return u.afterRoot&&u.afterRoot(l)})).then(function(){e(l)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let l=0,u=o.length;l<u;l++)e[o[l]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone();return r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[tt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load($b(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0)return Promise.resolve(null);const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const l=o[0],u=jb[r.type],c=Pa[r.componentType],f=c.BYTES_PER_ELEMENT,h=f*u,p=r.byteOffset||0,y=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,m=r.normalized===!0;let d,b;if(y&&y!==h){const v=Math.floor(p/y),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+v+":"+r.count;let w=t.cache.get(g);w||(d=new c(l,v*y,r.count*y/f),w=new lr(d,y/f),t.cache.add(g,w)),b=new Ci(w,u,p%y/f,m)}else l===null?d=new c(r.count*u):d=new c(l,p,r.count*u),b=new je(d,u,m);if(r.sparse!==void 0){const v=jb.SCALAR,g=Pa[r.sparse.indices.componentType],w=r.sparse.indices.byteOffset||0,S=r.sparse.values.byteOffset||0,T=new g(o[1],w,r.sparse.count*v),M=new c(o[2],S,r.sparse.count*u);l!==null&&(b=new je(b.array.slice(),b.itemSize,b.normalized));for(let C=0,_=T.length;C<_;C++){const P=T[C];if(b.setX(P,M[C*u]),u>=2&&b.setY(P,M[C*u+1]),u>=3&&b.setZ(P,M[C*u+2]),u>=4&&b.setW(P,M[C*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e],s=t.images[r.source];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,i){const r=this,s=this.json,o=this.options,l=s.textures[e],u=(t.uri||t.bufferView)+":"+l.sampler;if(this.textureCache[u])return this.textureCache[u];const c=self.URL||self.webkitURL;let f=t.uri||"",h=!1,p=!0;const y=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||y)&&(p=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(d){if(t.mimeType==="image/png"){const v=new DataView(d,25,1).getUint8(0,!1);p=v===6||v===4||v===3}h=!0;const b=new Blob([d],{type:t.mimeType});return f=c.createObjectURL(b),f});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const m=Promise.resolve(f).then(function(d){return new Promise(function(b,v){let g=b;i.isImageBitmapLoader===!0&&(g=function(w){const S=new St(w);S.needsUpdate=!0,b(S)}),i.load($b(d,o.path),g,void 0,v)})}).then(function(d){h===!0&&c.revokeObjectURL(f),d.flipY=!1,l.name&&(d.name=l.name),p||(d.format=bi);const v=(s.samplers||{})[l.sampler]||{};return d.magFilter=Hb[v.magFilter]||gt,d.minFilter=Hb[v.minFilter]||yi,d.wrapS=Wb[v.wrapS]||Ji,d.wrapT=Wb[v.wrapT]||Ji,r.associations.set(d,{type:"textures",index:e}),d}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=m,m}assignTexture(e,t,i){const r=this;return this.getDependency("texture",i.index).then(function(s){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[tt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[tt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[tt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,l)}}e[t]=s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0,l=Object.keys(t.morphAttributes).length>0,u=l&&t.morphAttributes.normal!==void 0;if(e.isPoints){const c="PointsMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new cr,Pt.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(c,f)),i=f}else if(e.isLine){const c="LineBasicMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new Ft,Pt.prototype.copy.call(f,i),f.color.copy(i.color),this.cache.add(c,f)),i=f}if(r||s||o||l){let c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");let f=this.cache.get(c);f||(f=i.clone(),s&&(f.vertexColors=!0),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(i))),i=f}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Wr}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const l={},u=s.extensions||{},c=[];if(u[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const h=r[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else if(u[tt.KHR_MATERIALS_UNLIT]){const h=r[tt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else{const h=s.pbrMetallicRoughness||{};if(l.color=new Re(1,1,1),l.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;l.color.fromArray(p),l.opacity=p[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",h.baseColorTexture)),l.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,l.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=Xi);const f=s.alphaMode||uf.OPAQUE;return f===uf.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===uf.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Se(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==cn&&(l.emissive=new Re().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==cn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===lf?h=r[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):h=new o(l),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Or),h.emissiveMap&&(h.emissiveMap.encoding=Or),ts(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&Ia(r,h,s),h})}createUniqueName(e){const t=et.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(l){return i[tt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return Yb(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=vB(c),h=r[f];if(h)o.push(h.promise);else{let p;c.extensions&&c.extensions[tt.KHR_DRACO_MESH_COMPRESSION]?p=s(c):p=Yb(new ke,c,t),r[f]={primitive:c,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,l=[];for(let u=0,c=o.length;u<c;u++){const f=o[u].material===void 0?mB(this.cache):this.getDependency("material",o[u].material);l.push(f)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(u){const c=u.slice(0,u.length-1),f=u[u.length-1],h=[];for(let y=0,m=f.length;y<m;y++){const d=f[y],b=o[y];let v;const g=c[y];if(b.mode===Li.TRIANGLES||b.mode===Li.TRIANGLE_STRIP||b.mode===Li.TRIANGLE_FAN||b.mode===void 0)v=s.isSkinnedMesh===!0?new ha(d,g):new Tt(d,g),v.isSkinnedMesh===!0&&!v.geometry.attributes.skinWeight.normalized&&v.normalizeSkinWeights(),b.mode===Li.TRIANGLE_STRIP?v.geometry=Jb(v.geometry,Q0):b.mode===Li.TRIANGLE_FAN&&(v.geometry=Jb(v.geometry,Md));else if(b.mode===Li.LINES)v=new rn(d,g);else if(b.mode===Li.LINE_STRIP)v=new Kn(d,g);else if(b.mode===Li.LINE_LOOP)v=new cc(d,g);else if(b.mode===Li.POINTS)v=new qs(d,g);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(v.geometry.morphAttributes).length>0&&yB(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),ts(v,s),b.extensions&&Ia(r,v,b),t.assignFinalMaterial(v),h.push(v)}if(h.length===1)return h[0];const p=new Jn;for(let y=0,m=h.length;y<m;y++)p.add(h[y]);return p})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Bt(Rd.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new mo(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),ts(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(r){return i.inverseBindMatrices=r,i})}loadAnimation(e){const i=this.json.animations[e],r=[],s=[],o=[],l=[],u=[];for(let c=0,f=i.channels.length;c<f;c++){const h=i.channels[c],p=i.samplers[h.sampler],y=h.target,m=y.node!==void 0?y.node:y.id,d=i.parameters!==void 0?i.parameters[p.input]:p.input,b=i.parameters!==void 0?i.parameters[p.output]:p.output;r.push(this.getDependency("node",m)),s.push(this.getDependency("accessor",d)),o.push(this.getDependency("accessor",b)),l.push(p),u.push(y)}return Promise.all([Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(u)]).then(function(c){const f=c[0],h=c[1],p=c[2],y=c[3],m=c[4],d=[];for(let v=0,g=f.length;v<g;v++){const w=f[v],S=h[v],T=p[v],M=y[v],C=m[v];if(w===void 0)continue;w.updateMatrix(),w.matrixAutoUpdate=!0;let _;switch(mr[C.path]){case mr.weights:_=ho;break;case mr.rotation:_=$r;break;case mr.position:case mr.scale:default:_=fo;break}const P=w.name?w.name:w.uuid,E=M.interpolation!==void 0?pB[M.interpolation]:Lr,O=[];mr[C.path]===mr.weights?w.traverse(function(L){L.isMesh===!0&&L.morphTargetInfluences&&O.push(L.name?L.name:L.uuid)}):O.push(P);let A=T.array;if(T.normalized){const L=df(A.constructor),R=new Float32Array(A.length);for(let N=0,x=A.length;N<x;N++)R[N]=A[N]*L;A=R}for(let L=0,R=O.length;L<R;L++){const N=new _(O[L]+"."+mr[C.path],S.array,A,E);M.interpolation==="CUBICSPLINE"&&(N.createInterpolant=function(I){return new xo(this.times,this.values,this.getValueSize()/3,I)},N.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),d.push(N)}}const b=i.name?i.name:"animation_"+e;return new po(b,void 0,d)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(l){if(l.isMesh)for(let u=0,c=r.weights.length;u<c;u++)l.morphTargetInfluences[u]=r.weights[u]}),o})}loadNode(e){const t=this.json,i=this.extensions,r=this,s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"";return function(){const l=[],u=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return u&&l.push(u),s.camera!==void 0&&l.push(r.getDependency("camera",s.camera).then(function(c){return r._getNodeRef(r.cameraCache,s.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){l.push(c)}),Promise.all(l)}().then(function(l){let u;if(s.isBone===!0?u=new fa:l.length>1?u=new Jn:l.length===1?u=l[0]:u=new Ze,u!==l[0])for(let c=0,f=l.length;c<f;c++)u.add(l[c]);if(s.name&&(u.userData.name=s.name,u.name=o),ts(u,s),s.extensions&&Ia(i,u,s),s.matrix!==void 0){const c=new Ne;c.fromArray(s.matrix),u.applyMatrix4(c)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);return r.associations.set(u,{type:"nodes",index:e}),u})}loadScene(e){const t=this.json,i=this.extensions,r=this.json.scenes[e],s=this,o=new Jn;r.name&&(o.name=s.createUniqueName(r.name)),ts(o,r),r.extensions&&Ia(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(Xb(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function Xb(n,e,t,i){const r=t.nodes[n];return i.getDependency("node",n).then(function(s){if(r.skin===void 0)return s;let o;return i.getDependency("skin",r.skin).then(function(l){o=l;const u=[];for(let c=0,f=o.joints.length;c<f;c++)u.push(i.getDependency("node",o.joints[c]));return Promise.all(u)}).then(function(l){return s.traverse(function(u){if(!u.isMesh)return;const c=[],f=[];for(let h=0,p=l.length;h<p;h++){const y=l[h];if(y){c.push(y);const m=new Ne;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,h*16),f.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}u.bind(new pa(c,f),u.matrixWorld)}),s})}).then(function(s){e.add(s);const o=[];if(r.children){const l=r.children;for(let u=0,c=l.length;u<c;u++){const f=l[u];o.push(Xb(f,s,t,i))}}return Promise.all(o)})}function xB(n,e,t){const i=e.attributes,r=new ln;if(i.POSITION!==void 0){const l=t.json.accessors[i.POSITION],u=l.min,c=l.max;if(u!==void 0&&c!==void 0){if(r.set(new q(u[0],u[1],u[2]),new q(c[0],c[1],c[2])),l.normalized){const f=df(Pa[l.componentType]);r.min.multiplyScalar(f),r.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new q,u=new q;for(let c=0,f=s.length;c<f;c++){const h=s[c];if(h.POSITION!==void 0){const p=t.json.accessors[h.POSITION],y=p.min,m=p.max;if(y!==void 0&&m!==void 0){if(u.setX(Math.max(Math.abs(y[0]),Math.abs(m[0]))),u.setY(Math.max(Math.abs(y[1]),Math.abs(m[1]))),u.setZ(Math.max(Math.abs(y[2]),Math.abs(m[2]))),p.normalized){const d=df(Pa[p.componentType]);u.multiplyScalar(d)}l.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(l)}n.boundingBox=r;const o=new wi;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function Yb(n,e,t){const i=e.attributes,r=[];function s(o,l){return t.getDependency("accessor",o).then(function(u){n.setAttribute(l,u)})}for(const o in i){const l=cf[o]||o.toLowerCase();l in n.attributes||r.push(s(i[o],l))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(l){n.setIndex(l)});r.push(o)}return ts(n,e),xB(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?gB(n,e.targets,t):n})}function Jb(n,e){let t=n.getIndex();if(t===null){const o=[],l=n.getAttribute("position");if(l!==void 0){for(let u=0;u<l.count;u++)o.push(u);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===Md)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s}const wB=gl(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:eB},Symbol.toStringTag,{value:"Module"})));var hf={exports:{}},Kb;function MB(){return Kb||(Kb=1,function(n){function e(c){var f={};function h(y){if(f[y])return f[y].exports;var m=f[y]={i:y,l:!1,exports:{}};return c[y].call(m.exports,m,m.exports,h),m.l=!0,m.exports}h.m=c,h.c=f,h.i=function(y){return y},h.d=function(y,m,d){h.o(y,m)||Object.defineProperty(y,m,{configurable:!1,enumerable:!0,get:d})},h.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},h.n=function(y){var m=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(m,"a",m),m},h.o=function(y,m){return Object.prototype.hasOwnProperty.call(y,m)},h.p="/",h.oe=function(y){throw console.error(y),y};var p=h(h.s=ENTRY_MODULE);return p.default||p}var t="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+t+").*?\\)";function r(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(c){return!isNaN(1*c)}function o(c,f,h){var p={};p[h]=[];var y=f.toString(),m=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return p;for(var d=m[1],b=new RegExp("(\\\\n|\\W)"+r(d)+i,"g"),v;v=b.exec(y);)v[3]!=="dll-reference"&&p[h].push(v[3]);for(b=new RegExp("\\("+r(d)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");v=b.exec(y);)c[v[2]]||(p[h].push(v[1]),c[v[2]]=__webpack_require__(v[1]).m),p[v[2]]=p[v[2]]||[],p[v[2]].push(v[4]);for(var g=Object.keys(p),w=0;w<g.length;w++)for(var S=0;S<p[g[w]].length;S++)s(p[g[w]][S])&&(p[g[w]][S]=1*p[g[w]][S]);return p}function l(c){var f=Object.keys(c);return f.reduce(function(h,p){return h||c[p].length>0},!1)}function u(c,f){for(var h={main:[f]},p={main:[]},y={main:{}};l(h);)for(var m=Object.keys(h),d=0;d<m.length;d++){var b=m[d],v=h[b],g=v.pop();if(y[b]=y[b]||{},!(y[b][g]||!c[b][g])){y[b][g]=!0,p[b]=p[b]||[],p[b].push(g);for(var w=o(c,c[b][g],b),S=Object.keys(w),T=0;T<S.length;T++)h[S[T]]=h[S[T]]||[],h[S[T]]=h[S[T]].concat(w[S[T]])}}return p}n.exports=function(c,f){f=f||{};var h={main:__webpack_modules__},p=f.all?{main:Object.keys(h.main)}:u(h,c),y="";Object.keys(p).filter(function(g){return g!=="main"}).forEach(function(g){for(var w=0;p[g][w];)w++;p[g].push(w),h[g][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+g+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+p[g].map(function(S){return""+JSON.stringify(S)+": "+h[g][S].toString()}).join(",")+`});
3182
- `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([y],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),v=new window.Worker(b);return v.objectURL=b,v}}(hf)),hf.exports}function SB(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function _B(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function qb(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}qb.prototype=Error.prototype;function TB(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new qb(s,"All promises were rejected"))})}catch(l){i(l)}})}var EB=setTimeout;function Qb(n){return!!(n&&typeof n.length<"u")}function AB(){}function CB(n,e){return function(){n.apply(e,arguments)}}function pt(n){if(!(this instanceof pt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],tx(n,this)}function ex(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,pt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?ff:Oa)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Oa(e.promise,r);return}ff(e.promise,i)})}function ff(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof pt){n._state=3,n._value=e,pf(n);return}else if(typeof t=="function"){tx(CB(t,e),n);return}}n._state=1,n._value=e,pf(n)}catch(i){Oa(n,i)}}function Oa(n,e){n._state=2,n._value=e,pf(n)}function pf(n){n._state===2&&n._deferreds.length===0&&pt._immediateFn(function(){n._handled||pt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)ex(n,n._deferreds[e]);n._deferreds=null}function RB(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function tx(n,e){var t=!1;try{n(function(i){t||(t=!0,ff(e,i))},function(i){t||(t=!0,Oa(e,i))})}catch(i){if(t)return;t=!0,Oa(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(AB);return ex(this,new RB(n,e,t)),t},pt.prototype.finally=SB,pt.all=function(n){return new pt(function(e,t){if(!Qb(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},pt.any=TB,pt.allSettled=_B,pt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===pt?n:new pt(function(e){e(n)})},pt.reject=function(n){return new pt(function(e,t){t(n)})},pt.race=function(n){return new pt(function(e,t){if(!Qb(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)pt.resolve(n[i]).then(e,t)})},pt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){EB(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const LB=gl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(ji,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=SR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.13.1","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,m,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var w=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var S=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:S,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,m,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(y.x-m.x,y.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],w=this.geometry.vertices[this.geometry.faces[v].b],S=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((w.x+d.x)/b.x,(w.y+d.y)/b.y),new c.Vector2((S.x+d.x)/b.x,(S.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,m){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var v=3*m;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=BD},(o,l,u)=>{function c(_){throw new TypeError('"'+_+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function y(_){var P=_,E=u(0).modelPrefix;return E&&(E[E.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(_)||(P=E+_)),P}function m(_,P){var E=(A,L)=>{try{var R=new URL(A,L).href;if(A&&2>A.split("?").length){var N=L.split("?");N.length===2&&(R=R+"?"+N[1])}return R}catch{console.error("There is an issue creating the url link with: ".concat(A,"."))}};if(!Array.isArray(_))return E(_,P);var O=[];return _.forEach(A=>{O.push(E(A,P))}),O}function d(_,P,E,O,A){var L=_.morphTargetInfluences,R=void 0;_.geometry&&(R=_.geometry.morphAttributes);var N=!1;if(L&&R&&R.position){O.set(0,0,0),A.set(0,0,0);for(var x=0;x<L.length;x++)0<L[x]&&(N=!0,E.setFromArray(R.position[x].array),O.add(E.min.multiplyScalar(L[x])),A.add(E.max.multiplyScalar(L[x])));N&&P.set(O,A)}N||P.setFromBufferAttribute(_.geometry.attributes.position),_.updateWorldMatrix(!0,!0),P.applyMatrix4(_.matrixWorld)}function b(_,P,E,O){var A=new XMLHttpRequest;A.open("GET",y(_),!0),A.onreadystatechange=()=>{A.readyState==4&&(A.status==200?E(A.responseText,P):O(_))},A.send(null)}function v(_,P,E){function O(x,I){R[I]=x,L++,L==A&&P(R)}for(var A=_.length,L=0,R=[],N=0;N<A;N++)b(_[N],N,O,E)}l.getColorsRGB=(_,P)=>{var E=Math.floor(P/3),O=P%3,A=0;O==0?A=_[E].r:O==1?A=_[E].g:O==2&&(A=_[E].b);var L=new f.Color(A);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(_,P){if(P&&_&&_.morphAttributes&&_.morphAttributes.color){var E=_.morphAttributes.color,O=P.morphTargetInfluences,A=O.length;_.deleteAttribute("morphColor0"),_.deleteAttribute("morphColor1");for(var L=0,R=[],N=0;1>L||N<A;N++)0<O[N]&&(L++,R.push([N,O[N]]));R.length==2?(_.setAttribute("morphColor0",E[R[0][0]]),_.setAttribute("morphColor1",E[R[1][0]])):R.length==1&&(_.setAttribute("morphColor0",E[R[0][0]]),_.setAttribute("morphColor1",E[R[0][0]]))}},l.toBufferGeometry=(_,P)=>{var E;return _ instanceof h?(P.localTimeEnabled&&!_.morphNormalsReady&&(_.morphNormals==null||_.morphNormals.length==0)&&_.computeMorphNormals(),E=_.toIndexedBufferGeometry(),P.localMorphColour&&g(_,E)):_ instanceof f.BufferGeometry&&(E=_.clone()),E.colorsNeedUpdate=!0,E.computeBoundingBox(),E.computeBoundingSphere(),_._video&&(E._video=_._video),E},l.copyMorphColorsToBufferGeometry=(_,P)=>{if(_&&_.morphColors&&0<_.morphColors.length){for(var E=[],O=_.morphColors,A=u(5).getColorsRGB,L=0,R=O.length;L<R;L++){for(var N=O[L],x=[],I=0;I<_.faces.length;I++){var B=_.faces[I],F=A(N.colors,B.a);x.push(F[0],F[1],F[2]),F=A(N.colors,B.b),x.push(F[0],F[1],F[2]),F=A(N.colors,B.c),x.push(F[0],F[1],F[2])}var V=new f.Float32BufferAttribute(3*(3*_.faces.length),3);V.name=N.name,E.push(V.copyArray(x))}P.morphAttributes.color=E}};var g=(_,P)=>{if(_&&_.morphColors&&0<_.morphColors.length){for(var E=[],O=_.morphColors,A=u(5).getColorsRGB,L=0,R=O.length;L<R;L++){for(var N,x=O[L],I=[],B=0;B<3*x.colors.length;B++)N=A(x.colors,B),I.push(N[0],N[1],N[2]);var F=new f.Float32BufferAttribute(I,3);F.name=x.name,E.push(F)}P.morphAttributes.color=E}};l.mergeVertices=function(_){var P=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;P=Math.max(P,Number.EPSILON);for(var E,O={},A=_.getIndex(),L=_.getAttribute("position"),R=A?A.count:L.count,N=0,x=Object.keys(_.attributes),I={},B={},ce=[],F=["getX","getY","getZ","getW"],V=0,k=x.length;V<k;V++){E=x[V],I[E]=[];var G=_.morphAttributes[E];G&&(B[E]=Array(G.length).fill().map(()=>[]))}for(var J=Math.log10(1/P),ne=Math.pow(10,J),V=0;V<R;V++){for(var ae=A?A.getX(V):V,ie="",oe=0,k=x.length;oe<k;oe++)for(var E=x[oe],W=_.getAttribute(E),X=W.itemSize,j=0;j<X;j++)ie+="".concat(~~(W[F[j]](ae)*ne),",");if(ie in O)ce.push(O[ie]);else{for(var oe=0,k=x.length;oe<k;oe++)for(var re,E=x[oe],W=_.getAttribute(E),G=_.morphAttributes[E],X=W.itemSize,z=I[E],H=B[E],j=0;j<X;j++)if(re=F[j],z.push(W[re](ae)),G)for(var K=0,le=G.length;K<le;K++)H[K].push(G[K][re](ae));O[ie]=N,ce.push(N),N++}}for(var se=_.clone(),V=0,k=x.length;V<k;V++){var W,E=x[V],U=_.getAttribute(E),D=new U.array.constructor(I[E]);if(U.isInterleavedBufferAttribute?W=new f.BufferAttribute(D,U.itemSize,U.itemSize):(W=_.getAttribute(E).clone(),W.setArray(D)),se.setAttribute(E,W),E in B)for(var $,oe=0;oe<B[E].length;oe++)$=_.morphAttributes[E][oe].clone(),$.setArray(new $.array.constructor(B[E][oe])),se.morphAttributes[E][oe]=$}var Y=Uint8Array;ce.length>=Math.pow(2,8)&&(Y=Uint16Array),ce.length>=Math.pow(2,16)&&(Y=Uint32Array);var ee=new Y(ce),ce=null;return A===null?ce=new f.BufferAttribute(ee,1):(ce=_.getIndex().clone(),ce.setArray(ee)),se.setIndex(ce),se};function w(_){if(_.isMeshPhongMaterial){var P=new f.MeshToonMaterial({color:_.color.clone(),morphTargets:_.morphTargets,morphNormals:_.morphNormals,vertexColors:_.vertexColors,transparent:_.transparent,opacity:_.opacity,side:_.side});return _.map&&(P.map=_.map),P}return _}function S(_,P){if(P&&_>=P.length){var E=new f.BufferGeometry,O=new Float32Array(3*_),A=0;return P.forEach(L=>{O[A++]=L[0],O[A++]=L[1],O[A++]=L[2]}),E.setAttribute("position",new f.BufferAttribute(O,3)),E.setDrawRange(0,P.length),E}}function T(){var _=new Image;_.src=u(8);var P=new f.Texture;return P.image=_,P.needsUpdate=!0,P}function M(_,P,E,O,A,L){var R=new p(_,P,E,O,A,L);return R.fontFace=O,R.fontSize=A,R.fontWeight=L,R.material.map.generateMipmaps=!1,R.material.map.anisotropy=4,R.material.sizeAttenuation=!1,R.material.alphaTest=.5,R.material.transparent=!0,R.material.depthWrite=!1,R.material.depthTest=!1,R.center.set(.5,-1.2),R.renderOrder=1e4,R}function C(_,P,E){if(E){var O=_||"",A=P||"",L=E.lastIndexOf("/");if(-1<L){var R=void 0,N=void 0;if(R=E.substring(0,L),N=E.substring(L+1),(R==="*"||R==="**"||R.toLowerCase()===O.toLowerCase())&&(N==="*"||N==="**"||N.toLowerCase()===A.toLowerCase()))return!0}else if(O.toLowerCase()===E.toLowerCase()||A.toLowerCase()===E.toLowerCase())return!0}return!1}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=T,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=w,l.createNewSpriteText=M,l.isRegionGroup=C},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,y=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,S=new c.Matrix3().getNormalMatrix(g),T=0,M=this.vertices.length;T<M;T++)w=this.vertices[T],w.applyMatrix4(g);for(var C,_=0,P=this.faces.length;_<P;_++){C=this.faces[_],C.normal.applyMatrix3(S).normalize();for(var E=0,O=C.vertexNormals.length;E<O;E++)C.vertexNormals[E].applyMatrix3(S).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,w,S){return f.makeTranslation(g,w,S),this.applyMatrix4(f),this},scale:function(g,w,S){return f.makeScale(g,w,S),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function w(G,J,ne,ae){var ie=P===void 0?[]:[S.colors[G].clone(),S.colors[J].clone(),S.colors[ne].clone()],oe=_===void 0?[]:[new c.Vector3().fromBufferAttribute(_,G),new c.Vector3().fromBufferAttribute(_,J),new c.Vector3().fromBufferAttribute(_,ne)],W=new b(G,J,ne,oe,ie,ae);S.faces.push(W),E!==void 0&&S.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(E,G),new c.Vector2().fromBufferAttribute(E,J),new c.Vector2().fromBufferAttribute(E,ne)]),O!==void 0&&S.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(O,G),new c.Vector2().fromBufferAttribute(O,J),new c.Vector2().fromBufferAttribute(O,ne)])}var S=this,T=g.index===null?void 0:g.index,M=g.attributes;if(M.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var C=M.position,_=M.normal,P=M.color,E=M.uv,O=M.uv2;O!==void 0&&(this.faceVertexUvs[1]=[]);for(var A=0;A<C.count;A++)S.vertices.push(new c.Vector3().fromBufferAttribute(C,A)),P!==void 0&&S.colors.push(new c.Color().fromBufferAttribute(P,A));var L=g.groups;if(0<L.length)for(var R=0;R<L.length;R++)for(var N=L[R],x=N.start,I=N.count,B=x,F=x+I;B<F;B+=3)T===void 0?w(B,B+1,B+2,N.materialIndex):w(T.getX(B),T.getX(B+1),T.getX(B+2),N.materialIndex);else if(T!==void 0)for(var V=0;V<T.count;V+=3)w(T.getX(V),T.getX(V+1),T.getX(V+2));else for(var k=0;k<C.count;k+=3)w(k,k+1,k+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,w=this.boundingSphere.radius,S=w===0?1:1/w,T=new c.Matrix4;return T.set(S,0,0,-S*g.x,0,S,0,-S*g.y,0,0,S,-S*g.z,0,0,0,1),this.applyMatrix4(T),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,S=0,T=this.faces.length;S<T;S++){var M=this.faces[S],C=this.vertices[M.a],_=this.vertices[M.b],P=this.vertices[M.c];g.subVectors(P,_),w.subVectors(C,_),g.cross(w),g.normalize(),M.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],w=Array(this.vertices.length),S=0,T=this.vertices.length;S<T;S++)w[S]=new c.Vector3;if(g)for(var M=new c.Vector3,C=new c.Vector3,_=0,P=this.faces.length;_<P;_++){var E=this.faces[_],O=this.vertices[E.a],A=this.vertices[E.b],L=this.vertices[E.c];M.subVectors(L,A),C.subVectors(O,A),M.cross(C),w[E.a].add(M),w[E.b].add(M),w[E.c].add(M)}else{this.computeFaceNormals();for(var R,N=0,x=this.faces.length;N<x;N++)R=this.faces[N],w[R.a].add(R.normal),w[R.b].add(R.normal),w[R.c].add(R.normal)}for(var I=0,B=this.vertices.length;I<B;I++)w[I].normalize();for(var F=0,V=this.faces.length;F<V;F++){var k=this.faces[F],G=k.vertexNormals;G.length===3?(G[0].copy(w[k.a]),G[1].copy(w[k.b]),G[2].copy(w[k.c])):(G[0]=w[k.a].clone(),G[1]=w[k.b].clone(),G[2]=w[k.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),w},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,w=this.faces.length;g<w;g++){var S=this.faces[g],T=S.vertexNormals;T.length===3?(T[0].copy(S.normal),T[1].copy(S.normal),T[2].copy(S.normal)):(T[0]=S.normal.clone(),T[1]=S.normal.clone(),T[2]=S.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,S=this.faces.length;w<S;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var T=0,M=g.vertexNormals.length;T<M;T++)g.__originalVertexNormals[T]?g.__originalVertexNormals[T].copy(g.vertexNormals[T]):g.__originalVertexNormals[T]=g.vertexNormals[T].clone()}var C=new m;C.faces=this.faces;for(var _=0,P=this.morphTargets.length;_<P;_++){if(!this.morphNormals[_]){this.morphNormals[_]={},this.morphNormals[_].faceNormals=[],this.morphNormals[_].vertexNormals=[];for(var E=this.morphNormals[_].faceNormals,O=this.morphNormals[_].vertexNormals,A=0,L=this.faces.length;A<L;A++){var R=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};E.push(R),O.push(N)}}var x=this.morphNormals[_];C.vertices=this.morphTargets[_].vertices,C.computeFaceNormals();var I=C.computeVertexNormals();if(I&&0<I.length){this.morphTargets[_].normals=Array(this.vertices.length);for(var B=0;B<I.length;B++)this.morphTargets[_].normals[B]=I[B].clone()}for(var F=0,V=this.faces.length;F<V;F++){var k=this.faces[F],G=x.faceNormals[F],J=x.vertexNormals[F];G.copy(k.normal),J.a.copy(k.vertexNormals[0]),J.b.copy(k.vertexNormals[1]),J.c.copy(k.vertexNormals[2])}}for(var ne,ae=0,ie=this.faces.length;ae<ie;ae++)ne=this.faces[ae],ne.normal=ne.__originalFaceNormal,ne.vertexNormals=ne.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,w){var S=this.morphTargets.length,T=this.morphTargets,M=g.morphTargets,C=this.morphColors.length,_=this.morphColors,P=g.morphColors;if(0<S&&S==M.length)for(var E=0,O=T.length;E<O;E++){for(var A=T[E],L=M[E],R=0,N=L.vertices.length;R<N;R++){var x=L.vertices[R],I=x.clone();w!==void 0&&I.applyMatrix4(w),A.vertices.push(I)}if(A.normals&&L.normals)for(var B=0;B<L.normals.length;B+=3)y.set(L.normals2[B],L.normals2[B+1],L.normals2[B+2]),w!==void 0&&y.applyMatrix4(w),A.normals.push(y.x,y.y,y.z)}if(0<C&&C==P.length)for(var F=0,V=_.length;F<V;F++)for(var k=_[F],G=P[F],J=0,ne=G.colors;J<ne;J++)k.colors.push(G.colors[J].clone())},merge:function(g,w){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var T,M=this.vertices.length,C=this.vertices,_=g.vertices,P=g.normals,E=this.faces,O=g.faces,A=this.colors,L=g.colors;w!==void 0&&(T=new c.Matrix3().getNormalMatrix(w));for(var R=0,N=_.length;R<N;R++){var x=_[R],I=x.clone();w!==void 0&&I.applyMatrix4(w),C.push(I)}for(var B=0;B<P.length;B+=3)y.set(P[B],P[B+1],P[B+2]),w!==void 0&&y.applyMatrix4(w),this.normals.push(y.x,y.y,y.z);for(var F=0,V=L.length;F<V;F++)typeof L[F]=="number"?A.push(L[F]):A.push(L[F].clone());for(var k=0,G=O.length;k<G;k++){var J=O[k],ne=void 0,ae=void 0,ie=J.vertexNormals,oe=J.vertexColors,W=new b(J.a+M,J.b+M,J.c+M);W.normal.copy(J.normal),T!==void 0&&W.normal.applyMatrix3(T).normalize();for(var X=0,j=ie.length;X<j;X++)ne=ie[X].clone(),T!==void 0&&ne.applyMatrix3(T).normalize(),W.vertexNormals.push(ne);W.color.copy(J.color);for(var re=0,z=oe.length;re<z;re++)ae=oe[re],W.vertexColors.push(ae.clone());W.materialIndex=J.materialIndex+S,E.push(W)}for(var H,K=0,le=g.faceVertexUvs.length;K<le;K++){H=g.faceVertexUvs[K],this.faceVertexUvs[K]===void 0&&(this.faceVertexUvs[K]=[]);for(var se=0,U=H.length;se<U;se++){for(var D=H[se],$=[],Y=0,ee=D.length;Y<ee;Y++)$.push(D[Y].clone());this.faceVertexUvs[K].push($)}}this.mergeMorph(g,w)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,w={},S=[],T=[],M=Math.pow(10,g),C=0,_=this.vertices.length;C<_;C++){var P=this.vertices[C],E=Math.round(P.x*M)+"_"+Math.round(P.y*M)+"_"+Math.round(P.z*M);w[E]===void 0?(w[E]=C,S.push(this.vertices[C]),T[C]=S.length-1):T[C]=T[w[E]]}for(var O,A=[],L=0,R=this.faces.length;L<R;L++){O=this.faces[L],O.a=T[O.a],O.b=T[O.b],O.c=T[O.c];for(var N=[O.a,O.b,O.c],x=0;3>x;x++)if(N[x]===N[(x+1)%3]){A.push(L);break}}for(var I,B=A.length-1;0<=B;B--){I=A[B],this.faces.splice(I,1);for(var F=0,V=this.faceVertexUvs.length;F<V;F++)this.faceVertexUvs[F].splice(I,1)}var k=this.vertices.length-S.length;return this.vertices=S,k},setFromPoints:function(g){this.vertices=[];for(var w,S=0,T=g.length;S<T;S++)w=g[S],this.vertices.push(new c.Vector3(w.x,w.y,w.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,w=g.length,S=0;S<w;S++)g[S]._id=S;g.sort(function(O,A){return O.materialIndex-A.materialIndex});var T,M,C=this.faceVertexUvs[0],_=this.faceVertexUvs[1];C&&C.length===w&&(T=[]),_&&_.length===w&&(M=[]);for(var P,E=0;E<w;E++)P=g[E]._id,T&&T.push(C[P]),M&&M.push(_[P]);T&&(this.faceVertexUvs[0]=T),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(z,H,K){return K?z|1<<H:z&~(1<<H)}function w(z){var H=z.x.toString()+z.y.toString()+z.z.toString();return R[H]===void 0&&(R[H]=L.length/3,L.push(z.x,z.y,z.z)),R[H]}function S(z){var H=z.r.toString()+z.g.toString()+z.b.toString();return x[H]===void 0&&(x[H]=N.length,N.push(z.getHex())),x[H]}function T(z){var H=z.x.toString()+z.y.toString();return B[H]===void 0&&(B[H]=I.length/2,I.push(z.x,z.y)),B[H]}var M={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(M.uuid=this.uuid,M.type=this.type,this.name!==""&&(M.name=this.name),this.parameters!==void 0){var C=this.parameters;for(var _ in C)C[_]!==void 0&&(M[_]=C[_]);return M}for(var P,E=[],O=0;O<this.vertices.length;O++)P=this.vertices[O],E.push(P.x,P.y,P.z);for(var A=[],L=[],R={},N=[],x={},I=[],B={},F=0;F<this.faces.length;F++){var V=this.faces[F],k=!0,G=!1,J=this.faceVertexUvs[0][F]!==void 0,ne=0<V.normal.length(),ae=0<V.vertexNormals.length,ie=V.color.r!==1||V.color.g!==1||V.color.b!==1,oe=0<V.vertexColors.length,W=0;if(W=g(W,0,0),W=g(W,1,k),W=g(W,2,G),W=g(W,3,J),W=g(W,4,ne),W=g(W,5,ae),W=g(W,6,ie),W=g(W,7,oe),A.push(W),A.push(V.a,V.b,V.c),A.push(V.materialIndex),J){var X=this.faceVertexUvs[0][F];A.push(T(X[0]),T(X[1]),T(X[2]))}if(ne&&A.push(w(V.normal)),ae){var j=V.vertexNormals;A.push(w(j[0]),w(j[1]),w(j[2]))}if(ie&&A.push(S(V.color)),oe){var re=V.vertexColors;A.push(S(re[0]),S(re[1]),S(re[2]))}}return M.data={},M.data.vertices=E,M.data.normals=L,0<N.length&&(M.data.colors=N),0<I.length&&(M.data.uvs=[I]),M.data.faces=A,M},clone:function(){return new m().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var w=g.vertices,S=0,T=w.length;S<T;S++)this.vertices.push(w[S].clone());for(var M=g.colors,C=0,_=M.length;C<_;C++)this.colors.push(M[C].clone());for(var P=g.faces,E=0,O=P.length;E<O;E++)this.faces.push(P[E].clone());for(var A,L=0,R=g.faceVertexUvs.length;L<R;L++){A=g.faceVertexUvs[L],this.faceVertexUvs[L]===void 0&&(this.faceVertexUvs[L]=[]);for(var N=0,x=A.length;N<x;N++){for(var I,B=A[N],F=[],V=0,k=B.length;V<k;V++)I=B[V],F.push(I.clone());this.faceVertexUvs[L].push(F)}}for(var G,J=g.morphTargets,ne=0,ae=J.length;ne<ae;ne++){if(G={},G.name=J[ne].name,J[ne].vertices!==void 0){G.vertices=[];for(var ie=0,oe=J[ne].vertices.length;ie<oe;ie++)G.vertices.push(J[ne].vertices[ie].clone())}if(J[ne].normals!==void 0){G.normals=[];for(var W=0,X=J[ne].normals.length;W<X;W++)G.normals.push(J[ne].normals[W].clone())}this.morphTargets.push(G)}for(var j,re=g.morphNormals,z=0,H=re.length;z<H;z++){if(j={},re[z].vertexNormals!==void 0){j.vertexNormals=[];for(var K=0,le=re[z].vertexNormals.length;K<le;K++){var se=re[z].vertexNormals[K],U={};U.a=se.a.clone(),U.b=se.b.clone(),U.c=se.c.clone(),j.vertexNormals.push(U)}}if(re[z].faceNormals!==void 0){j.faceNormals=[];for(var D=0,$=re[z].faceNormals.length;D<$;D++)j.faceNormals.push(re[z].faceNormals[D].clone())}this.morphNormals.push(j)}for(var Y=g.skinWeights,ee=0,ce=Y.length;ee<ce;ee++)this.skinWeights.push(Y[ee].clone());for(var ve=g.skinIndices,be=0,ue=ve.length;be<ue;be++)this.skinIndices.push(ve[be].clone());for(var me=g.lineDistances,te=0,he=me.length;te<he;te++)this.lineDistances.push(me[te]);var ge=g.boundingBox;ge!==null&&(this.boundingBox=ge.clone());var Ae=g.boundingSphere;return Ae!==null&&(this.boundingSphere=Ae.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var v,g,w=[],S=void 0,T=this.faces;for(g=0;g<T.length;g++){var M=T[g];M.materialIndex!==S&&(S=M.materialIndex,v!==void 0&&(v.count=3*g-v.start,w.push(v)),v={start:3*g,materialIndex:S})}return v!==void 0&&(v.count=3*g-v.start,w.push(v)),w},toBufferGeometry:function(){var g=new d().fromGeometry(this),w=new c.BufferGeometry,S=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(S,3).copyVector3sArray(g.vertices)),0<g.normals.length){var T=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(T,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var M=new Float32Array(3*g.colors.length);w.setAttribute("color",new c.BufferAttribute(M,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var C=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(C,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var _=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(_,2).copyVector2sArray(g.uvs2))}for(var P in w.groups=g.groups,g.morphTargets){for(var E=[],O=g.morphTargets[P],A=0,L=O.length;A<L;A++){var R=O[A],N=new c.Float32BufferAttribute(3*R.data.length,3);N.name=R.name,E.push(N.copyVector3sArray(R.data))}w.morphAttributes[P]=E}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);w.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var I=new c.Float32BufferAttribute(4*g.skinWeights.length,4);w.setAttribute("skinWeight",I.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(w.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(w.boundingBox=g.boundingBox.clone()),w},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,w=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(w,3).copyVector3sArray(this.vertices)),0<this.normals.length){var S=new Float32Array(this.normals.length),T=new c.BufferAttribute(S,3).copyArray(this.normals);g.setAttribute("normal",T)}if(0<this.uvs.length&&0<this.uvs[0].length){var M=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(M,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var C=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(C,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var _=[],P=0;P<this.colors.length;P++)_.push(new c.Color(this.colors[P]));var E=new Float32Array(3*_.length);g.setAttribute("color",new c.BufferAttribute(E,3).copyColorsArray(_))}else{for(var O=new Float32Array(3*this.vertices.length),A=0;A<3*this.vertices.length;A++)O[A]=1;g.setAttribute("color",new c.BufferAttribute(O,3))}if(0<this.faces.length){for(var L=[],R=[],N=0;N<this.faces.length;N++){R.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var x=this.faces[N].vertexColors;if(x.length===3)L.push(x[0],x[1],x[2]);else{var I=this.faces[N].color;L.push(I,I,I)}}g.setIndex(R),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],F=[],V=0,k=this.morphTargets.length;V<k;V++){var G=this.morphTargets[V],J=new c.Float32BufferAttribute(3*G.vertices.length,3);if(J.name=G.name,B.push(J.copyVector3sArray(G.vertices)),G.normals){var ne=new c.Float32BufferAttribute(3*G.normals.length,3);ne.name=G.name,F.push(ne.copyVector3sArray(G.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=F}if(0<this.skinIndices.length){var ae=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",ae.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ie=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ie.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,w=v.geometry;if(v.isPoints||v.isLine){var S=new c.Float32BufferAttribute(3*w.vertices.length,3),T=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",S.copyVector3sArray(w.vertices)),g.setAttribute("color",T.copyColorsArray(w.colors)),w.lineDistances&&w.lineDistances.length===w.vertices.length){var M=new c.Float32BufferAttribute(w.lineDistances.length,1);g.setAttribute("lineDistance",M.copyArray(w.lineDistances))}w.boundingSphere!==null&&(g.boundingSphere=w.boundingSphere.clone()),w.boundingBox!==null&&(g.boundingBox=w.boundingBox.clone())}else v.isMesh&&(g=w.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var w,S,T=[],M=void 0,C=g.faces;for(S=0;S<C.length;S++){var _=C[S];_.materialIndex!==M&&(M=_.materialIndex,w!==void 0&&(w.count=3*S-w.start,T.push(w)),w={start:3*S,materialIndex:M})}w!==void 0&&(w.count=3*S-w.start,T.push(w)),this.groups=T}fromGeometry(g){var w,S=g.faces,T=g.vertices,M=g.faceVertexUvs,C=M[0]&&0<M[0].length,_=M[1]&&0<M[1].length,P=g.morphTargets,E=P.length;if(0<E){w=[];for(var O=0;O<E;O++)w[O]={name:P[O].name,data:[]};this.morphTargets.position=w}var A,L=g.morphNormals,R=L.length;if(0<R){A=[];for(var N=0;N<R;N++)A[N]={name:L[N].name,data:[]};this.morphTargets.normal=A}var x=g.skinIndices,I=g.skinWeights,B=x.length===T.length,F=I.length===T.length;0<T.length&&S.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var V,k=0;k<S.length;k++){V=S[k],this.vertices.push(T[V.a],T[V.b],T[V.c]);var G=V.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var J=V.normal;this.normals.push(J,J,J)}var ne=V.vertexColors;if(ne.length===3)this.colors.push(ne[0],ne[1],ne[2]);else{var ae=V.color;this.colors.push(ae,ae,ae)}if(C===!0){var ie=M[0][k];ie===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",k),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ie[0],ie[1],ie[2])}if(_===!0){var oe=M[1][k];oe===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",k),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(oe[0],oe[1],oe[2])}for(var W,X=0;X<E;X++)W=P[X].vertices,w[X].data.push(W[V.a],W[V.b],W[V.c]);for(var j,re=0;re<R;re++)j=L[re].vertexNormals[k],A[re].data.push(j.a,j.b,j.c);B&&this.skinIndices.push(x[V.a],x[V.b],x[V.c]),F&&this.skinWeights.push(I[V.a],I[V.b],I[V.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,w,S,T,M){var C=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=S,this.normal=T&&T.isVector3?T:new c.Vector3,this.vertexNormals=Array.isArray(T)?T:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=C}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var w=0,S=g.vertexNormals.length;w<S;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var T=0,M=g.vertexColors.length;T<M;T++)this.vertexColors[T]=g.vertexColors[T].clone();return this}}},o=>{o.exports=qD},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3182
+ `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([y],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),v=new window.Worker(b);return v.objectURL=b,v}}(hf)),hf.exports}function SB(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function _B(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function qb(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}qb.prototype=Error.prototype;function TB(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new qb(s,"All promises were rejected"))})}catch(l){i(l)}})}var EB=setTimeout;function Qb(n){return!!(n&&typeof n.length<"u")}function AB(){}function CB(n,e){return function(){n.apply(e,arguments)}}function pt(n){if(!(this instanceof pt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],tx(n,this)}function ex(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,pt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?ff:Oa)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Oa(e.promise,r);return}ff(e.promise,i)})}function ff(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof pt){n._state=3,n._value=e,pf(n);return}else if(typeof t=="function"){tx(CB(t,e),n);return}}n._state=1,n._value=e,pf(n)}catch(i){Oa(n,i)}}function Oa(n,e){n._state=2,n._value=e,pf(n)}function pf(n){n._state===2&&n._deferreds.length===0&&pt._immediateFn(function(){n._handled||pt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)ex(n,n._deferreds[e]);n._deferreds=null}function RB(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function tx(n,e){var t=!1;try{n(function(i){t||(t=!0,ff(e,i))},function(i){t||(t=!0,Oa(e,i))})}catch(i){if(t)return;t=!0,Oa(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(AB);return ex(this,new RB(n,e,t)),t},pt.prototype.finally=SB,pt.all=function(n){return new pt(function(e,t){if(!Qb(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},pt.any=TB,pt.allSettled=_B,pt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===pt?n:new pt(function(e){e(n)})},pt.reject=function(n){return new pt(function(e,t){t(n)})},pt.race=function(n){return new pt(function(e,t){if(!Qb(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)pt.resolve(n[i]).then(e,t)})},pt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){EB(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const LB=gl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(ji,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=SR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.13.2","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,m,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var w=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var S=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:S,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,m,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(y.x-m.x,y.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],w=this.geometry.vertices[this.geometry.faces[v].b],S=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((w.x+d.x)/b.x,(w.y+d.y)/b.y),new c.Vector2((S.x+d.x)/b.x,(S.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,m){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var v=3*m;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=BD},(o,l,u)=>{function c(_){throw new TypeError('"'+_+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function y(_){var P=_,E=u(0).modelPrefix;return E&&(E[E.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(_)||(P=E+_)),P}function m(_,P){var E=(A,L)=>{try{var R=new URL(A,L).href;if(A&&2>A.split("?").length){var N=L.split("?");N.length===2&&(R=R+"?"+N[1])}return R}catch{console.error("There is an issue creating the url link with: ".concat(A,"."))}};if(!Array.isArray(_))return E(_,P);var O=[];return _.forEach(A=>{O.push(E(A,P))}),O}function d(_,P,E,O,A){var L=_.morphTargetInfluences,R=void 0;_.geometry&&(R=_.geometry.morphAttributes);var N=!1;if(L&&R&&R.position){O.set(0,0,0),A.set(0,0,0);for(var x=0;x<L.length;x++)0<L[x]&&(N=!0,E.setFromArray(R.position[x].array),O.add(E.min.multiplyScalar(L[x])),A.add(E.max.multiplyScalar(L[x])));N&&P.set(O,A)}N||P.setFromBufferAttribute(_.geometry.attributes.position),_.updateWorldMatrix(!0,!0),P.applyMatrix4(_.matrixWorld)}function b(_,P,E,O){var A=new XMLHttpRequest;A.open("GET",y(_),!0),A.onreadystatechange=()=>{A.readyState==4&&(A.status==200?E(A.responseText,P):O(_))},A.send(null)}function v(_,P,E){function O(x,I){R[I]=x,L++,L==A&&P(R)}for(var A=_.length,L=0,R=[],N=0;N<A;N++)b(_[N],N,O,E)}l.getColorsRGB=(_,P)=>{var E=Math.floor(P/3),O=P%3,A=0;O==0?A=_[E].r:O==1?A=_[E].g:O==2&&(A=_[E].b);var L=new f.Color(A);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(_,P){if(P&&_&&_.morphAttributes&&_.morphAttributes.color){var E=_.morphAttributes.color,O=P.morphTargetInfluences,A=O.length;_.deleteAttribute("morphColor0"),_.deleteAttribute("morphColor1");for(var L=0,R=[],N=0;1>L||N<A;N++)0<O[N]&&(L++,R.push([N,O[N]]));R.length==2?(_.setAttribute("morphColor0",E[R[0][0]]),_.setAttribute("morphColor1",E[R[1][0]])):R.length==1&&(_.setAttribute("morphColor0",E[R[0][0]]),_.setAttribute("morphColor1",E[R[0][0]]))}},l.toBufferGeometry=(_,P)=>{var E;return _ instanceof h?(P.localTimeEnabled&&!_.morphNormalsReady&&(_.morphNormals==null||_.morphNormals.length==0)&&_.computeMorphNormals(),E=_.toIndexedBufferGeometry(),P.localMorphColour&&g(_,E)):_ instanceof f.BufferGeometry&&(E=_.clone()),E.colorsNeedUpdate=!0,E.computeBoundingBox(),E.computeBoundingSphere(),_._video&&(E._video=_._video),E},l.copyMorphColorsToBufferGeometry=(_,P)=>{if(_&&_.morphColors&&0<_.morphColors.length){for(var E=[],O=_.morphColors,A=u(5).getColorsRGB,L=0,R=O.length;L<R;L++){for(var N=O[L],x=[],I=0;I<_.faces.length;I++){var B=_.faces[I],F=A(N.colors,B.a);x.push(F[0],F[1],F[2]),F=A(N.colors,B.b),x.push(F[0],F[1],F[2]),F=A(N.colors,B.c),x.push(F[0],F[1],F[2])}var V=new f.Float32BufferAttribute(3*(3*_.faces.length),3);V.name=N.name,E.push(V.copyArray(x))}P.morphAttributes.color=E}};var g=(_,P)=>{if(_&&_.morphColors&&0<_.morphColors.length){for(var E=[],O=_.morphColors,A=u(5).getColorsRGB,L=0,R=O.length;L<R;L++){for(var N,x=O[L],I=[],B=0;B<3*x.colors.length;B++)N=A(x.colors,B),I.push(N[0],N[1],N[2]);var F=new f.Float32BufferAttribute(I,3);F.name=x.name,E.push(F)}P.morphAttributes.color=E}};l.mergeVertices=function(_){var P=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;P=Math.max(P,Number.EPSILON);for(var E,O={},A=_.getIndex(),L=_.getAttribute("position"),R=A?A.count:L.count,N=0,x=Object.keys(_.attributes),I={},B={},ce=[],F=["getX","getY","getZ","getW"],V=0,k=x.length;V<k;V++){E=x[V],I[E]=[];var G=_.morphAttributes[E];G&&(B[E]=Array(G.length).fill().map(()=>[]))}for(var J=Math.log10(1/P),ne=Math.pow(10,J),V=0;V<R;V++){for(var ae=A?A.getX(V):V,ie="",oe=0,k=x.length;oe<k;oe++)for(var E=x[oe],W=_.getAttribute(E),Z=W.itemSize,j=0;j<Z;j++)ie+="".concat(~~(W[F[j]](ae)*ne),",");if(ie in O)ce.push(O[ie]);else{for(var oe=0,k=x.length;oe<k;oe++)for(var re,E=x[oe],W=_.getAttribute(E),G=_.morphAttributes[E],Z=W.itemSize,z=I[E],H=B[E],j=0;j<Z;j++)if(re=F[j],z.push(W[re](ae)),G)for(var K=0,le=G.length;K<le;K++)H[K].push(G[K][re](ae));O[ie]=N,ce.push(N),N++}}for(var se=_.clone(),V=0,k=x.length;V<k;V++){var W,E=x[V],U=_.getAttribute(E),D=new U.array.constructor(I[E]);if(U.isInterleavedBufferAttribute?W=new f.BufferAttribute(D,U.itemSize,U.itemSize):(W=_.getAttribute(E).clone(),W.setArray(D)),se.setAttribute(E,W),E in B)for(var $,oe=0;oe<B[E].length;oe++)$=_.morphAttributes[E][oe].clone(),$.setArray(new $.array.constructor(B[E][oe])),se.morphAttributes[E][oe]=$}var Y=Uint8Array;ce.length>=Math.pow(2,8)&&(Y=Uint16Array),ce.length>=Math.pow(2,16)&&(Y=Uint32Array);var ee=new Y(ce),ce=null;return A===null?ce=new f.BufferAttribute(ee,1):(ce=_.getIndex().clone(),ce.setArray(ee)),se.setIndex(ce),se};function w(_){if(_.isMeshPhongMaterial){var P=new f.MeshToonMaterial({color:_.color.clone(),morphTargets:_.morphTargets,morphNormals:_.morphNormals,vertexColors:_.vertexColors,transparent:_.transparent,opacity:_.opacity,side:_.side});return _.map&&(P.map=_.map),P}return _}function S(_,P){if(P&&_>=P.length){var E=new f.BufferGeometry,O=new Float32Array(3*_),A=0;return P.forEach(L=>{O[A++]=L[0],O[A++]=L[1],O[A++]=L[2]}),E.setAttribute("position",new f.BufferAttribute(O,3)),E.setDrawRange(0,P.length),E}}function T(){var _=new Image;_.src=u(8);var P=new f.Texture;return P.image=_,P.needsUpdate=!0,P}function M(_,P,E,O,A,L){var R=new p(_,P,E,O,A,L);return R.fontFace=O,R.fontSize=A,R.fontWeight=L,R.material.map.generateMipmaps=!1,R.material.map.anisotropy=4,R.material.sizeAttenuation=!1,R.material.alphaTest=.5,R.material.transparent=!0,R.material.depthWrite=!1,R.material.depthTest=!1,R.center.set(.5,-1.2),R.renderOrder=1e4,R}function C(_,P,E){if(E){var O=_||"",A=P||"",L=E.lastIndexOf("/");if(-1<L){var R=void 0,N=void 0;if(R=E.substring(0,L),N=E.substring(L+1),(R==="*"||R==="**"||R.toLowerCase()===O.toLowerCase())&&(N==="*"||N==="**"||N.toLowerCase()===A.toLowerCase()))return!0}else if(O.toLowerCase()===E.toLowerCase()||A.toLowerCase()===E.toLowerCase())return!0}return!1}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=T,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=w,l.createNewSpriteText=M,l.isRegionGroup=C},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,y=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,S=new c.Matrix3().getNormalMatrix(g),T=0,M=this.vertices.length;T<M;T++)w=this.vertices[T],w.applyMatrix4(g);for(var C,_=0,P=this.faces.length;_<P;_++){C=this.faces[_],C.normal.applyMatrix3(S).normalize();for(var E=0,O=C.vertexNormals.length;E<O;E++)C.vertexNormals[E].applyMatrix3(S).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,w,S){return f.makeTranslation(g,w,S),this.applyMatrix4(f),this},scale:function(g,w,S){return f.makeScale(g,w,S),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function w(G,J,ne,ae){var ie=P===void 0?[]:[S.colors[G].clone(),S.colors[J].clone(),S.colors[ne].clone()],oe=_===void 0?[]:[new c.Vector3().fromBufferAttribute(_,G),new c.Vector3().fromBufferAttribute(_,J),new c.Vector3().fromBufferAttribute(_,ne)],W=new b(G,J,ne,oe,ie,ae);S.faces.push(W),E!==void 0&&S.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(E,G),new c.Vector2().fromBufferAttribute(E,J),new c.Vector2().fromBufferAttribute(E,ne)]),O!==void 0&&S.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(O,G),new c.Vector2().fromBufferAttribute(O,J),new c.Vector2().fromBufferAttribute(O,ne)])}var S=this,T=g.index===null?void 0:g.index,M=g.attributes;if(M.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var C=M.position,_=M.normal,P=M.color,E=M.uv,O=M.uv2;O!==void 0&&(this.faceVertexUvs[1]=[]);for(var A=0;A<C.count;A++)S.vertices.push(new c.Vector3().fromBufferAttribute(C,A)),P!==void 0&&S.colors.push(new c.Color().fromBufferAttribute(P,A));var L=g.groups;if(0<L.length)for(var R=0;R<L.length;R++)for(var N=L[R],x=N.start,I=N.count,B=x,F=x+I;B<F;B+=3)T===void 0?w(B,B+1,B+2,N.materialIndex):w(T.getX(B),T.getX(B+1),T.getX(B+2),N.materialIndex);else if(T!==void 0)for(var V=0;V<T.count;V+=3)w(T.getX(V),T.getX(V+1),T.getX(V+2));else for(var k=0;k<C.count;k+=3)w(k,k+1,k+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,w=this.boundingSphere.radius,S=w===0?1:1/w,T=new c.Matrix4;return T.set(S,0,0,-S*g.x,0,S,0,-S*g.y,0,0,S,-S*g.z,0,0,0,1),this.applyMatrix4(T),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,S=0,T=this.faces.length;S<T;S++){var M=this.faces[S],C=this.vertices[M.a],_=this.vertices[M.b],P=this.vertices[M.c];g.subVectors(P,_),w.subVectors(C,_),g.cross(w),g.normalize(),M.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],w=Array(this.vertices.length),S=0,T=this.vertices.length;S<T;S++)w[S]=new c.Vector3;if(g)for(var M=new c.Vector3,C=new c.Vector3,_=0,P=this.faces.length;_<P;_++){var E=this.faces[_],O=this.vertices[E.a],A=this.vertices[E.b],L=this.vertices[E.c];M.subVectors(L,A),C.subVectors(O,A),M.cross(C),w[E.a].add(M),w[E.b].add(M),w[E.c].add(M)}else{this.computeFaceNormals();for(var R,N=0,x=this.faces.length;N<x;N++)R=this.faces[N],w[R.a].add(R.normal),w[R.b].add(R.normal),w[R.c].add(R.normal)}for(var I=0,B=this.vertices.length;I<B;I++)w[I].normalize();for(var F=0,V=this.faces.length;F<V;F++){var k=this.faces[F],G=k.vertexNormals;G.length===3?(G[0].copy(w[k.a]),G[1].copy(w[k.b]),G[2].copy(w[k.c])):(G[0]=w[k.a].clone(),G[1]=w[k.b].clone(),G[2]=w[k.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),w},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,w=this.faces.length;g<w;g++){var S=this.faces[g],T=S.vertexNormals;T.length===3?(T[0].copy(S.normal),T[1].copy(S.normal),T[2].copy(S.normal)):(T[0]=S.normal.clone(),T[1]=S.normal.clone(),T[2]=S.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,S=this.faces.length;w<S;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var T=0,M=g.vertexNormals.length;T<M;T++)g.__originalVertexNormals[T]?g.__originalVertexNormals[T].copy(g.vertexNormals[T]):g.__originalVertexNormals[T]=g.vertexNormals[T].clone()}var C=new m;C.faces=this.faces;for(var _=0,P=this.morphTargets.length;_<P;_++){if(!this.morphNormals[_]){this.morphNormals[_]={},this.morphNormals[_].faceNormals=[],this.morphNormals[_].vertexNormals=[];for(var E=this.morphNormals[_].faceNormals,O=this.morphNormals[_].vertexNormals,A=0,L=this.faces.length;A<L;A++){var R=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};E.push(R),O.push(N)}}var x=this.morphNormals[_];C.vertices=this.morphTargets[_].vertices,C.computeFaceNormals();var I=C.computeVertexNormals();if(I&&0<I.length){this.morphTargets[_].normals=Array(this.vertices.length);for(var B=0;B<I.length;B++)this.morphTargets[_].normals[B]=I[B].clone()}for(var F=0,V=this.faces.length;F<V;F++){var k=this.faces[F],G=x.faceNormals[F],J=x.vertexNormals[F];G.copy(k.normal),J.a.copy(k.vertexNormals[0]),J.b.copy(k.vertexNormals[1]),J.c.copy(k.vertexNormals[2])}}for(var ne,ae=0,ie=this.faces.length;ae<ie;ae++)ne=this.faces[ae],ne.normal=ne.__originalFaceNormal,ne.vertexNormals=ne.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,w){var S=this.morphTargets.length,T=this.morphTargets,M=g.morphTargets,C=this.morphColors.length,_=this.morphColors,P=g.morphColors;if(0<S&&S==M.length)for(var E=0,O=T.length;E<O;E++){for(var A=T[E],L=M[E],R=0,N=L.vertices.length;R<N;R++){var x=L.vertices[R],I=x.clone();w!==void 0&&I.applyMatrix4(w),A.vertices.push(I)}if(A.normals&&L.normals)for(var B=0;B<L.normals.length;B+=3)y.set(L.normals2[B],L.normals2[B+1],L.normals2[B+2]),w!==void 0&&y.applyMatrix4(w),A.normals.push(y.x,y.y,y.z)}if(0<C&&C==P.length)for(var F=0,V=_.length;F<V;F++)for(var k=_[F],G=P[F],J=0,ne=G.colors;J<ne;J++)k.colors.push(G.colors[J].clone())},merge:function(g,w){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var T,M=this.vertices.length,C=this.vertices,_=g.vertices,P=g.normals,E=this.faces,O=g.faces,A=this.colors,L=g.colors;w!==void 0&&(T=new c.Matrix3().getNormalMatrix(w));for(var R=0,N=_.length;R<N;R++){var x=_[R],I=x.clone();w!==void 0&&I.applyMatrix4(w),C.push(I)}for(var B=0;B<P.length;B+=3)y.set(P[B],P[B+1],P[B+2]),w!==void 0&&y.applyMatrix4(w),this.normals.push(y.x,y.y,y.z);for(var F=0,V=L.length;F<V;F++)typeof L[F]=="number"?A.push(L[F]):A.push(L[F].clone());for(var k=0,G=O.length;k<G;k++){var J=O[k],ne=void 0,ae=void 0,ie=J.vertexNormals,oe=J.vertexColors,W=new b(J.a+M,J.b+M,J.c+M);W.normal.copy(J.normal),T!==void 0&&W.normal.applyMatrix3(T).normalize();for(var Z=0,j=ie.length;Z<j;Z++)ne=ie[Z].clone(),T!==void 0&&ne.applyMatrix3(T).normalize(),W.vertexNormals.push(ne);W.color.copy(J.color);for(var re=0,z=oe.length;re<z;re++)ae=oe[re],W.vertexColors.push(ae.clone());W.materialIndex=J.materialIndex+S,E.push(W)}for(var H,K=0,le=g.faceVertexUvs.length;K<le;K++){H=g.faceVertexUvs[K],this.faceVertexUvs[K]===void 0&&(this.faceVertexUvs[K]=[]);for(var se=0,U=H.length;se<U;se++){for(var D=H[se],$=[],Y=0,ee=D.length;Y<ee;Y++)$.push(D[Y].clone());this.faceVertexUvs[K].push($)}}this.mergeMorph(g,w)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,w={},S=[],T=[],M=Math.pow(10,g),C=0,_=this.vertices.length;C<_;C++){var P=this.vertices[C],E=Math.round(P.x*M)+"_"+Math.round(P.y*M)+"_"+Math.round(P.z*M);w[E]===void 0?(w[E]=C,S.push(this.vertices[C]),T[C]=S.length-1):T[C]=T[w[E]]}for(var O,A=[],L=0,R=this.faces.length;L<R;L++){O=this.faces[L],O.a=T[O.a],O.b=T[O.b],O.c=T[O.c];for(var N=[O.a,O.b,O.c],x=0;3>x;x++)if(N[x]===N[(x+1)%3]){A.push(L);break}}for(var I,B=A.length-1;0<=B;B--){I=A[B],this.faces.splice(I,1);for(var F=0,V=this.faceVertexUvs.length;F<V;F++)this.faceVertexUvs[F].splice(I,1)}var k=this.vertices.length-S.length;return this.vertices=S,k},setFromPoints:function(g){this.vertices=[];for(var w,S=0,T=g.length;S<T;S++)w=g[S],this.vertices.push(new c.Vector3(w.x,w.y,w.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,w=g.length,S=0;S<w;S++)g[S]._id=S;g.sort(function(O,A){return O.materialIndex-A.materialIndex});var T,M,C=this.faceVertexUvs[0],_=this.faceVertexUvs[1];C&&C.length===w&&(T=[]),_&&_.length===w&&(M=[]);for(var P,E=0;E<w;E++)P=g[E]._id,T&&T.push(C[P]),M&&M.push(_[P]);T&&(this.faceVertexUvs[0]=T),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(z,H,K){return K?z|1<<H:z&~(1<<H)}function w(z){var H=z.x.toString()+z.y.toString()+z.z.toString();return R[H]===void 0&&(R[H]=L.length/3,L.push(z.x,z.y,z.z)),R[H]}function S(z){var H=z.r.toString()+z.g.toString()+z.b.toString();return x[H]===void 0&&(x[H]=N.length,N.push(z.getHex())),x[H]}function T(z){var H=z.x.toString()+z.y.toString();return B[H]===void 0&&(B[H]=I.length/2,I.push(z.x,z.y)),B[H]}var M={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(M.uuid=this.uuid,M.type=this.type,this.name!==""&&(M.name=this.name),this.parameters!==void 0){var C=this.parameters;for(var _ in C)C[_]!==void 0&&(M[_]=C[_]);return M}for(var P,E=[],O=0;O<this.vertices.length;O++)P=this.vertices[O],E.push(P.x,P.y,P.z);for(var A=[],L=[],R={},N=[],x={},I=[],B={},F=0;F<this.faces.length;F++){var V=this.faces[F],k=!0,G=!1,J=this.faceVertexUvs[0][F]!==void 0,ne=0<V.normal.length(),ae=0<V.vertexNormals.length,ie=V.color.r!==1||V.color.g!==1||V.color.b!==1,oe=0<V.vertexColors.length,W=0;if(W=g(W,0,0),W=g(W,1,k),W=g(W,2,G),W=g(W,3,J),W=g(W,4,ne),W=g(W,5,ae),W=g(W,6,ie),W=g(W,7,oe),A.push(W),A.push(V.a,V.b,V.c),A.push(V.materialIndex),J){var Z=this.faceVertexUvs[0][F];A.push(T(Z[0]),T(Z[1]),T(Z[2]))}if(ne&&A.push(w(V.normal)),ae){var j=V.vertexNormals;A.push(w(j[0]),w(j[1]),w(j[2]))}if(ie&&A.push(S(V.color)),oe){var re=V.vertexColors;A.push(S(re[0]),S(re[1]),S(re[2]))}}return M.data={},M.data.vertices=E,M.data.normals=L,0<N.length&&(M.data.colors=N),0<I.length&&(M.data.uvs=[I]),M.data.faces=A,M},clone:function(){return new m().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var w=g.vertices,S=0,T=w.length;S<T;S++)this.vertices.push(w[S].clone());for(var M=g.colors,C=0,_=M.length;C<_;C++)this.colors.push(M[C].clone());for(var P=g.faces,E=0,O=P.length;E<O;E++)this.faces.push(P[E].clone());for(var A,L=0,R=g.faceVertexUvs.length;L<R;L++){A=g.faceVertexUvs[L],this.faceVertexUvs[L]===void 0&&(this.faceVertexUvs[L]=[]);for(var N=0,x=A.length;N<x;N++){for(var I,B=A[N],F=[],V=0,k=B.length;V<k;V++)I=B[V],F.push(I.clone());this.faceVertexUvs[L].push(F)}}for(var G,J=g.morphTargets,ne=0,ae=J.length;ne<ae;ne++){if(G={},G.name=J[ne].name,J[ne].vertices!==void 0){G.vertices=[];for(var ie=0,oe=J[ne].vertices.length;ie<oe;ie++)G.vertices.push(J[ne].vertices[ie].clone())}if(J[ne].normals!==void 0){G.normals=[];for(var W=0,Z=J[ne].normals.length;W<Z;W++)G.normals.push(J[ne].normals[W].clone())}this.morphTargets.push(G)}for(var j,re=g.morphNormals,z=0,H=re.length;z<H;z++){if(j={},re[z].vertexNormals!==void 0){j.vertexNormals=[];for(var K=0,le=re[z].vertexNormals.length;K<le;K++){var se=re[z].vertexNormals[K],U={};U.a=se.a.clone(),U.b=se.b.clone(),U.c=se.c.clone(),j.vertexNormals.push(U)}}if(re[z].faceNormals!==void 0){j.faceNormals=[];for(var D=0,$=re[z].faceNormals.length;D<$;D++)j.faceNormals.push(re[z].faceNormals[D].clone())}this.morphNormals.push(j)}for(var Y=g.skinWeights,ee=0,ce=Y.length;ee<ce;ee++)this.skinWeights.push(Y[ee].clone());for(var ve=g.skinIndices,be=0,ue=ve.length;be<ue;be++)this.skinIndices.push(ve[be].clone());for(var me=g.lineDistances,te=0,he=me.length;te<he;te++)this.lineDistances.push(me[te]);var ge=g.boundingBox;ge!==null&&(this.boundingBox=ge.clone());var Ae=g.boundingSphere;return Ae!==null&&(this.boundingSphere=Ae.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var v,g,w=[],S=void 0,T=this.faces;for(g=0;g<T.length;g++){var M=T[g];M.materialIndex!==S&&(S=M.materialIndex,v!==void 0&&(v.count=3*g-v.start,w.push(v)),v={start:3*g,materialIndex:S})}return v!==void 0&&(v.count=3*g-v.start,w.push(v)),w},toBufferGeometry:function(){var g=new d().fromGeometry(this),w=new c.BufferGeometry,S=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(S,3).copyVector3sArray(g.vertices)),0<g.normals.length){var T=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(T,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var M=new Float32Array(3*g.colors.length);w.setAttribute("color",new c.BufferAttribute(M,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var C=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(C,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var _=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(_,2).copyVector2sArray(g.uvs2))}for(var P in w.groups=g.groups,g.morphTargets){for(var E=[],O=g.morphTargets[P],A=0,L=O.length;A<L;A++){var R=O[A],N=new c.Float32BufferAttribute(3*R.data.length,3);N.name=R.name,E.push(N.copyVector3sArray(R.data))}w.morphAttributes[P]=E}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);w.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var I=new c.Float32BufferAttribute(4*g.skinWeights.length,4);w.setAttribute("skinWeight",I.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(w.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(w.boundingBox=g.boundingBox.clone()),w},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,w=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(w,3).copyVector3sArray(this.vertices)),0<this.normals.length){var S=new Float32Array(this.normals.length),T=new c.BufferAttribute(S,3).copyArray(this.normals);g.setAttribute("normal",T)}if(0<this.uvs.length&&0<this.uvs[0].length){var M=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(M,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var C=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(C,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var _=[],P=0;P<this.colors.length;P++)_.push(new c.Color(this.colors[P]));var E=new Float32Array(3*_.length);g.setAttribute("color",new c.BufferAttribute(E,3).copyColorsArray(_))}else{for(var O=new Float32Array(3*this.vertices.length),A=0;A<3*this.vertices.length;A++)O[A]=1;g.setAttribute("color",new c.BufferAttribute(O,3))}if(0<this.faces.length){for(var L=[],R=[],N=0;N<this.faces.length;N++){R.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var x=this.faces[N].vertexColors;if(x.length===3)L.push(x[0],x[1],x[2]);else{var I=this.faces[N].color;L.push(I,I,I)}}g.setIndex(R),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],F=[],V=0,k=this.morphTargets.length;V<k;V++){var G=this.morphTargets[V],J=new c.Float32BufferAttribute(3*G.vertices.length,3);if(J.name=G.name,B.push(J.copyVector3sArray(G.vertices)),G.normals){var ne=new c.Float32BufferAttribute(3*G.normals.length,3);ne.name=G.name,F.push(ne.copyVector3sArray(G.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=F}if(0<this.skinIndices.length){var ae=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",ae.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ie=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ie.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,w=v.geometry;if(v.isPoints||v.isLine){var S=new c.Float32BufferAttribute(3*w.vertices.length,3),T=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",S.copyVector3sArray(w.vertices)),g.setAttribute("color",T.copyColorsArray(w.colors)),w.lineDistances&&w.lineDistances.length===w.vertices.length){var M=new c.Float32BufferAttribute(w.lineDistances.length,1);g.setAttribute("lineDistance",M.copyArray(w.lineDistances))}w.boundingSphere!==null&&(g.boundingSphere=w.boundingSphere.clone()),w.boundingBox!==null&&(g.boundingBox=w.boundingBox.clone())}else v.isMesh&&(g=w.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var w,S,T=[],M=void 0,C=g.faces;for(S=0;S<C.length;S++){var _=C[S];_.materialIndex!==M&&(M=_.materialIndex,w!==void 0&&(w.count=3*S-w.start,T.push(w)),w={start:3*S,materialIndex:M})}w!==void 0&&(w.count=3*S-w.start,T.push(w)),this.groups=T}fromGeometry(g){var w,S=g.faces,T=g.vertices,M=g.faceVertexUvs,C=M[0]&&0<M[0].length,_=M[1]&&0<M[1].length,P=g.morphTargets,E=P.length;if(0<E){w=[];for(var O=0;O<E;O++)w[O]={name:P[O].name,data:[]};this.morphTargets.position=w}var A,L=g.morphNormals,R=L.length;if(0<R){A=[];for(var N=0;N<R;N++)A[N]={name:L[N].name,data:[]};this.morphTargets.normal=A}var x=g.skinIndices,I=g.skinWeights,B=x.length===T.length,F=I.length===T.length;0<T.length&&S.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var V,k=0;k<S.length;k++){V=S[k],this.vertices.push(T[V.a],T[V.b],T[V.c]);var G=V.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var J=V.normal;this.normals.push(J,J,J)}var ne=V.vertexColors;if(ne.length===3)this.colors.push(ne[0],ne[1],ne[2]);else{var ae=V.color;this.colors.push(ae,ae,ae)}if(C===!0){var ie=M[0][k];ie===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",k),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ie[0],ie[1],ie[2])}if(_===!0){var oe=M[1][k];oe===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",k),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(oe[0],oe[1],oe[2])}for(var W,Z=0;Z<E;Z++)W=P[Z].vertices,w[Z].data.push(W[V.a],W[V.b],W[V.c]);for(var j,re=0;re<R;re++)j=L[re].vertexNormals[k],A[re].data.push(j.a,j.b,j.c);B&&this.skinIndices.push(x[V.a],x[V.b],x[V.c]),F&&this.skinWeights.push(I[V.a],I[V.b],I[V.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,w,S,T,M){var C=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=S,this.normal=T&&T.isVector3?T:new c.Vector3,this.vertexNormals=Array.isArray(T)?T:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=C}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var w=0,S=g.vertexNormals.length;w<S;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var T=0,M=g.vertexColors.length;T<M;T++)this.vertexColors[T]=g.vertexColors[T].clone();return this}}},o=>{o.exports=qD},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3183
3183
  `)),u.vertexShader=u.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join(`
3184
- `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,y=function(){return"pr"+p++},m=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=y(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(d,b,v){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=v,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,w=v*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var S=d;S=d>this.duration?this.duration:0>d?0:d,S!=this.inbuildTime&&(this.inbuildTime=S,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var v=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1),v)for(var g=-1,w=0,S=0;S<v.count;S++)this._v2.fromArray(v.array,3*S),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,d=S)}return d},m.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var g=v.morphTargetInfluences,w=v.geometry.morphAttributes;if(g&&w&&w.position){for(var S=!1,T=0;T<g.length;T++)0<g[T]&&(S=!0,this._v1.fromArray(w.position[T].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[T])));if(S)return d?b.applyMatrix4(v.matrixWorld):b}else return b.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(v.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},m.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},m.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var v=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(v=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),b&&b.camera&&(v||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,v=this.getClosestVertex(!0);return v.project(d.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:b}}},m.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(d,b,v,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(v,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var w=this.inbuildTime+d;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,v,g,w){this._lod.addLevelFromURL(d,b,v,g,w)},m.prototype.addVertices=function(d){var b=this.getMorph(),v=void 0;if(!b)v=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(w=>{g.setXYZ(this.drawRange,w[0],w[1],w[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),v=b.geoemtry,this.boundingBoxUpdateRequired=!0}return v},m.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=function(y){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=y,this.addLevel=(d,b)=>{if(d){var v,g=Math.abs(b);for(v=0;v<this.levels.length&&!(g<this.levels[v].distance);v++);this.levels.splice(v,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var v=Math.abs(b),g=0;g<this.levels.length;g++)if(v===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,v,g,w)=>{this._loader=d;var S,T=this.calculateDistance(b);for(S=0;S<this.levels.length&&!(T<this.levels[S].distance);S++);this.levels.splice(S,0,{distance:T,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),w&&this.loadLevel(S)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,v=0;return d==="far"?v=4.5*b:d==="medium"?v=2.5*b:d=="close"&&(v=0),v},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var v=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},w=h(b,g),S=void 0;this._parent.isGeometry?S=new c.Mesh(w,v):this._parent.isLines&&(S=new(u(12)).LineSegments(w,v)),S.userData=this._parent,S.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(S,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(v=>{v.morph&&v.morph.geometry&&f(v.morph.geometry,v.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),m()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1<v.length){var g,w,S=d.cameraObject.position.distanceTo(b),T=-1,M=-1;for(g=0,w=v.length;g<w&&S>=v[g].distance;g++)v[g].morph?(-1<T&&v[T].morph&&(v[T].morph.visible=!1),T=g,v[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;g++)v[g].morph&&(-1<T?v[g].morph.visible=!1:(v[g].morph.visible=!0,T=g));this._currentLevel!=T&&(this._currentLevel=T,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(v=>{v.morph&&(b?v.morph.add(d):v.morph.remove(d))})};var m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,p=new f.Vector3;class y extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,v=[],g=0,w=b.count;g<w;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+h.distanceTo(p);d.setAttribute("lineDistance",new f.Float32BufferAttribute(v,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}y.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>w});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,y=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,C=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=C,this.updateMorphTargets()}copy(M){return super.copy(M),this.material=M.material,this.geometry=M.geometry,this}computeLineDistances(){var M=this.geometry;if(!M.isBufferGeometry)M.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(M.index===null){for(var C=M.attributes.position,_=[0],P=1,E=C.count;P<E;P++)f.fromBufferAttribute(C,P-1),h.fromBufferAttribute(C,P),_[P]=_[P-1],_[P]+=f.distanceTo(h);M.setAttribute("lineDistance",new c.Float32BufferAttribute(_,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,C){var _=this.geometry,P=this.matrixWorld,E=M.params.Line.threshold,O=_.drawRange,A=_.morphAttributes.position;if(_.boundingSphere===null&&_.computeBoundingSphere(),m.copy(_.boundingSphere),m.applyMatrix4(P),m.radius+=E,M.ray.intersectsSphere(m)!==!1){p.copy(P).invert(),y.copy(M.ray).applyMatrix4(p);var L=E/((this.scale.x+this.scale.y+this.scale.z)/3),R=L*L,N=new c.Vector3,x=new c.Vector3,I=new c.Vector3,B=new c.Vector3,F=this.isLineSegments?2:1;if(_.isBufferGeometry){var V=_.index,k=_.attributes,G=k.position;if(V!==null)for(var J=Math.max(0,O.start),ne=Math.min(V.count,O.start+O.count),ae=J;ae<ne-1;ae+=F){var ie=V.getX(ae),oe=V.getX(ae+1);S(N,x,this,G,A,ie,oe);var W=y.distanceSqToSegment(N,x,B,I);if(!(W>R)){B.applyMatrix4(this.matrixWorld);var X=M.ray.origin.distanceTo(B);X<M.near||X>M.far||C.push({distance:X,point:I.clone().applyMatrix4(this.matrixWorld),index:ae,face:null,faceIndex:null,object:this})}}else for(var j=Math.max(0,O.start),re=Math.min(G.count,O.start+O.count),z=j;z<re-1;z+=F){S(N,x,this,G,A,z,z+1);var H=y.distanceSqToSegment(N,x,B,I);if(!(H>R)){B.applyMatrix4(this.matrixWorld);var K=M.ray.origin.distanceTo(B);K<M.near||K>M.far||C.push({distance:K,point:I.clone().applyMatrix4(this.matrixWorld),index:z,face:null,faceIndex:null,object:this})}}}else _.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var C=M.morphAttributes,_=Object.keys(C);if(0<_.length){var P=C[_[0]];if(P!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var E,O=0,A=P.length;O<A;O++)E=P[O].name||O+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[E]=O}}}else{var L=M.morphTargets;L!==void 0&&0<L.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function S(T,M,C,_,P,E,O){T.fromBufferAttribute(_,E),M.fromBufferAttribute(_,O);var A=C.morphTargetInfluences;if(C.material.morphTargets&&P&&A){d.set(0,0,0),b.set(0,0,0);for(var L=0,R=P.length;L<R;L++){var N=A[L],x=P[L];N!==0&&(v.fromBufferAttribute(x,E),g.fromBufferAttribute(x,O),d.addScaledVector(v.sub(T),N),b.addScaledVector(g.sub(M),N))}T.add(d),M.add(b)}}w.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var p=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v=void 0,g=void 0,w=void 0,S=void 0,T=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var C=!1;this.ndc=new c.Vector3;var _=void 0,P=void 0,E=()=>{v=new c.Sprite(y),v.center.set(.5,0),this.morph.add(v),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,v.scale.set(p[0],p[1],p[2]),v.userData=this};this.updateVisual=(O,A)=>{var L=1,R=0;O!==A&&(R=1-(this.ndc.z-O)/(A-O),L=.6+.4*R),this.setSpriteSize(L)},this.updateNDC=O=>(this.ndc.copy(this.morph.position),this.ndc.project(O),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(O,A,L)=>{this.morph.position.set(O,A,L)},this.setSpriteSize=O=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(O)},this.setUserSprite=()=>{S&&(this.morph.add(S),M&&(this.morph.remove(v),P&&this.morph.remove(P),M=!1))},this.setImageForUserSprite=(O,A)=>{S&&(this.morph.remove(S),S=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=O,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),A||(A=[.05,.05,1]),S=new c.Sprite(w),S.center.set(.5,0),S.scale.set(A[0],A[1],A[2]),S.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(v),S&&this.morph.remove(S),P&&this.morph.add(P))},this.loadUserSprite=(O,A)=>{if(O)if(O!==T){T=O;var L=new Image(128,128);L.crossOrigin="anonymous",L.onload=()=>{this.setImageForUserSprite(L,A)},L.src=O}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),P&&(P.material.map.dispose(),P.material.dispose(),P=void 0)},this.isEnabled=()=>C,this.setNumber=O=>{(!O||_!=O)&&P&&(this.morph.remove(P),P.material.map.dispose(),P.material.dispose(),P=void 0),!P&&O&&(P=m(O,.012,"black","Asap",120,700),this.morph.add(P)),_=O},this.getNumber=()=>_||1,this.setVisibility=function(O){O!==this.visible&&(this.visible=O,this.group.visible=O,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{C=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{C=!1,this.morph.visible=!1,this.visible=!1},E()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,p,y,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(v=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)&&(b=new(u(17)).Label(v,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(w,S,T,M)=>{this.morph&&(this.morph.matrix.elements[0]=S[0],this.morph.matrix.elements[1]=S[1],this.morph.matrix.elements[2]=S[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=T[0],this.morph.matrix.elements[5]=T[1],this.morph.matrix.elements[6]=T[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var p=f,y=void 0;y=h?new c(p,.015,h.getStyle()):new c(p,.015),y.fontFace="Asap",y.fontWeight=700,y.material.map.generateMipmaps=!1,y.material.sizeAttenuation=!1,y.center.x=-.05,y.center.y=0,this.getPosition=()=>y?[y.position.x,y.position.y,y.position.z]:[0,0,0],this.setPosition=(m,d,b)=>{y&&y.position.set(m,d,b)},this.setColour=m=>{y.color=m.getStyle()},this.setScale=m=>{y&&0<m&&y.scale.set(m,m,1)},this.dispose=()=>{},this.getSprite=()=>y,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,h=function(){u(10).ZincObject.call(this);var p=[],y=void 0,m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,w=void 0,S=0,T=0,M=[0,0,0],C=[0,0,0],_=[0,0,0],P="NONE";this.ready=!1;var E=!1,O=!1;this.isGlyphset=!0;var A=new c.Matrix4,L=new c.Color,R=new c.Color,N=new c.Box3,x=new c.Box3,I=new c.Box3,B=[],F=[],V=[],k=[],G=[],J=[],ne=[];this.globalScale=1;for(var ae=0;8>ae;ae++)new c.Vector3;this.load=(z,H,K,le,se)=>{y=z.axis1,m=z.axis2,d=z.axis3,b=z.positions,v=z.scale,g=z.colors,w=z.label,E=z.metadata.MorphColours,O=z.metadata.MorphVertices,S=z.metadata.number_of_time_steps,P=z.metadata.repeat_mode,T=z.metadata.number_of_vertices,P=="AXES_2D"||P=="MIRROR"?T*=2:P=="AXES_3D"&&(T*=3),M=z.metadata.base_size,C=z.metadata.offset,_=z.metadata.scale_factors;var U=new f;this.geometry=new c.BufferGeometry;var D=new c.InstancedMesh(this.geometry,void 0,T);if(this.setMorph(D),le){var $=U.parse(H);re(K,se)($.geometry,$.materials),$.geometry.dispose()}else U.crossOrigin="Anonymous",U.load(H,re(K,se))};var ie=(z,H,K,le,se,U)=>{if(P=="NONE"||P=="MIRROR"){for(var D,$=[0,0,0],Y=[0,0,0],ee=[0,0,0],ce=[0,0,0],ve=[0,0,0],be=[0,0,0],ue=[0,0,0],me=[0,0,0],te=[0,0,0],he=0;3>he;he++)D=0>se[he]?-1:1,$[he]=(D*M[he]+se[he]*_[he])*this.globalScale;for(var he=0;3>he;he++)Y[he]=H[he]*$[0],ee[he]=K[he]*$[1],ce[he]=le[he]*$[2],ve[he]=z[he]+C[0]*Y[he]+C[1]*ee[he]+C[2]*ce[he],P=="MIRROR"&&(be[he]=-Y[he],ue[he]=-ee[he],me[he]=-ce[he],te[he]=ve[he],0>se[0]&&(ve[he]-=Y[he],te[he]-=be[he]));0>ce[0]*(Y[1]*ee[2]-Y[2]*ee[1])+ce[1]*(Y[2]*ee[0]-Y[0]*ee[2])+ce[2]*(Y[0]*ee[1]-Y[1]*ee[0])&&(ce[0]=-ce[0],ce[1]=-ce[1],ce[2]=-ce[2]),U[0]=[ve,Y,ee,ce],P=="MIRROR"&&(0>me[0]*(be[1]*ue[2]-be[2]*ue[1])+me[1]*(be[2]*ue[0]-be[0]*ue[2])+me[2]*(be[0]*ue[1]-be[1]*ue[0])&&(me[0]=-me[0],me[1]=-me[1],me[2]=-me[2]),U[1]=[te,be,ue,me])}else if(P=="AXES_2D"||P=="AXES_3D"){for(var D,ge=[0,0,0],Ae=[0,0,0],he=0;3>he;he++)D=0>se[he]?-1:1,ge[he]=(D*M[0]+se[he]*_[0])*this.globalScale;for(var he=0;3>he;he++)Ae[he]=z[he]+C[0]*ge[0]*H[he]+C[1]*ge[1]*K[he]+C[2]*ge[2]*le[he];for(var Te=glyph_repeat_mode=="AXES_2D"?2:3,De=0;De<Te;De++){var Ye=void 0,ze=void 0,st=se[De],Ce=[0,0,0],He=[0,0,0],Ge=[0,0,0];De==0?(Ye=H,ze=K):De==1?(Ye=K,ze=glyph_repeat_mode=="AXES_2D"?H:le):(Ye=le,ze=H);var It=(M[0]+st*_[0])*this.globalScale;Ce[0]=Ye[0]*It,Ce[1]=Ye[1]*It,Ce[2]=Ye[2]*It,Ge[0]=Ce[1]*ze[2]-ze[1]*Ce[2],Ge[1]=Ce[2]*ze[0]-ze[2]*Ce[0],Ge[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var Ot=Math.sqrt(Ge[0]*Ge[0]+Ge[1]*Ge[1]+Ge[2]*Ge[2]);if(0<Ot){var mt=(M[2]+st*_[2])*this.globalScale/Ot;P=="AXES_2D"&&0<De&&(mt*=-1),Ge[0]*=mt,Ge[1]*=mt,Ge[2]*=mt}if(He[0]=Ge[1]*Ce[2]-Ce[1]*Ge[2],He[1]=Ge[2]*Ce[0]-Ce[2]*Ge[0],He[2]=Ge[0]*Ce[1]-Ge[1]*Ce[0],Ot=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]),0<Ot){var bt=(M[1]+st*_[1])*this.globalScale/Ot;He[0]*=bt,He[1]*=bt,He[2]*=bt}U[De]=[Ae,Ce,He,Ge]}}return U},oe=(z,H,K,le,se)=>{var U=1;P=="AXES_2D"||P=="MIRROR"?U=2:P=="AXES_3D"&&(U=3);var D=z.length/3,$=0;ne.length=U;for(var Y=0;Y<D;Y++){var ee=3*Y,ce=[z[ee],z[ee+1],z[ee+2]],ve=[H[ee],H[ee+1],H[ee+2]],be=[K[ee],K[ee+1],K[ee+2]],ue=[le[ee],le[ee+1],le[ee+2]],me=[se[ee],se[ee+1],se[ee+2]],te=ie(ce,ve,be,ue,me,ne);if(te.length==U)for(var he=0;he<U;he++){A.elements[0]=te[he][1][0],A.elements[1]=te[he][1][1],A.elements[2]=te[he][1][2],A.elements[3]=0,A.elements[4]=te[he][2][0],A.elements[5]=te[he][2][1],A.elements[6]=te[he][2][2],A.elements[7]=0,A.elements[8]=te[he][3][0],A.elements[9]=te[he][3][1],A.elements[10]=te[he][3][2],A.elements[11]=0,A.elements[12]=te[he][0][0],A.elements[13]=te[he][0][1],A.elements[14]=te[he][0][2],A.elements[15]=1,this.morph.setMatrixAt($,A);var ge=p[$];ge&&ge.setTransformation(te[he][0],te[he][1],te[he][2],te[he][3]),$++}}this.morph.instanceMatrix.needsUpdate=!0},W=z=>{var H=1;P=="AXES_2D"||P=="MIRROR"?H=2:P=="AXES_3D"&&(H=3);for(var K,le=z.length,se=0,U=0;U<le;U++){K=z[U];for(var D=0;D<H;D++){L.setHex(K),this.morph.setColorAt(se,L);var $=p[se];$&&$.setColour(L),se++}}this.morph.instanceColor.needsUpdate=!0},X=()=>{var z=B,H=F,K=V,le=k,se=G,U=J,D=this.inbuildTime/this.duration*(S-1),$=Math.floor(D),Y=1-(D-$),ee=Math.ceil(D);if(O){var ce=b[$.toString()],ve=b[ee.toString()],be=y[$.toString()],ue=y[ee.toString()],me=m[$.toString()],te=m[ee.toString()],he=d[$.toString()],ge=d[ee.toString()],Ae=v[$.toString()],Te=v[ee.toString()];B.length=ce.length,F.length=ce.length,V.length=ce.length,k.length=ce.length,G.length=ce.length;for(var De=0;De<ce.length;De++)z[De]=Y*ce[De]+(1-Y)*ve[De],H[De]=Y*be[De]+(1-Y)*ue[De],K[De]=Y*me[De]+(1-Y)*te[De],le[De]=Y*he[De]+(1-Y)*ge[De],se[De]=Y*Ae[De]+(1-Y)*Te[De]}else z=b[0],H=y[0],K=m[0],le=d[0],se=v[0];if(oe(z,H,K,le,se),this.boundingBoxUpdateRequired=!0,g!=null){if(E){var Ye=g[$.toString()],ze=g[ee.toString()];U.length=Ye.length;for(var st=0;st<Ye.length;st++)L.setHex(Ye[st]),R.setHex(ze[st]),L.setRGB(L.r*Y+R.r*(1-Y),L.g*Y+R.g*(1-Y),L.b*Y+R.b*(1-Y)),U[st]=L.getHex()}else U=g[0];W(U)}};this.showLabel=()=>{for(var z=0;z<p.length;z++)p[z].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var z=0;z<p.length;z++)p[z].hideLabel()};var j=z=>{for(var H=0;H<T;H++){var K=new(u(16)).Glyph(void 0,void 0,H,this),le=w?w[H]:void 0;le=le||this.groupName,le&&K.setLabel(le),0<S&&K.setFrustumCulled(!1),p[H]=K,this.morph.add(K.getGroup())}z&&this.showLabel(),oe(b[0],y[0],m[0],d[0],v[0]),g!=null&&W(g[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=z=>{z.isGlyph&&p.push(z),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(z,H)=>{if(z.isMesh){var K=new(u(16)).Glyph(void 0,void 0,H,this);return K.fromMesh(z),p.push(K),this.morph.add(K.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,K}},this.forEachGlyph=z=>{for(var H=0;H<p.length;H++)z(p[H])};var re=(z,H)=>(K,le)=>{var se=K.toBufferGeometry();this.geometry.copy(se),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),se.dispose(),le&&le[0]&&(this.morph.material=le[0]),j(H),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),K.dispose(),z!=null&&typeof z=="function"&&z(this)};this.getClosestVertexIndex=function(){var z=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var H,K=b[0],le=K.length/3,se=-1,U=0,D=0;D<le;D++)H=3*D,this._v2.set(K[H],K[H+1],K[H+2]),U=this._v1.distanceTo(this._v2),(se==-1||se>U)&&(se=U,z=D)}return z},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var z=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,A),z.setFromMatrixPosition(A),z}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){N.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var z=0;z<T;z++)this.morph.getMatrixAt(z,A),x.copy(N).applyMatrix4(A),z==0?I.copy(x):I.union(x);if(I)this.cachedBoundingBox.copy(I),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=z=>{this.inbuildTime=z>this.duration?this.duration:0>z?0:z,(E||O)&&(X(),O&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<S)&&(E||O)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(z){this.globalScale=z,X()},this.dispose=()=>{for(var z=p.length-1;0<=z;z--)p[z].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),y=void 0,m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(z,H,K)=>{if(H==!0){var le=this.inbuildTime+z;le>this.duration&&(le-=this.duration),this.inbuildTime=le,(E||O)&&X()}this.updateMarker(H,K)}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=h},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,y=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,S=c.DefaultLoadingManager,T=u(21).VideoHandler;function M(C){typeof C=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),C=void 0),this.manager=C===void 0?S:C,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(_,P,E,O){var A=this,L=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(_),R=new w(this.manager);_.split("?"),this.paramsString=_.length===2?paramsStrings[1]:"",R.setWithCredentials(this.withCredentials),R.load(_,function(N){var x;try{x=JSON.parse(N)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),O)return void O({responseURL:_})}var I=x.metadata;if(I!==void 0){var B=I.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+_+" should be loaded with THREE.ObjectLoader instead.")}if(A&&A.parse){var F=A.parse(x,L);P(F.geometry,F.materials)}},E,O)},setTexturePath:function(_){this.texturePath=_},parse:function(){function C(O,A){function L(he,ge){return he&1<<ge}var R,N,x,I,B,F,V,k,G,J,ne,ae,ie,oe,W,X,j,re,z,H,K,le,se,U,D,$,Y,ee=O.faces,ce=O.vertices,ve=O.normals,be=O.colors,ue=O.scale,me=0;if(O.uvs!==void 0){for(R=0;R<O.uvs.length;R++)O.uvs[R].length&&me++;for(R=0;R<me;R++)A.faceVertexUvs[R]=[]}for(I=0,B=ce.length;I<B;)re=new y,re.x=ce[I++]*ue,re.y=ce[I++]*ue,re.z=ce[I++]*ue,A.vertices.push(re);if(I=0,B=ee.length,O.uvs)for(R=0;R<O.uvs.length;R++){A.uvs[R]=[];for(var te=0;te<O.uvs[R].length;te++)A.uvs[R][te]=O.uvs[R][te]}if(ve)for(R=0;R<ve.length;R++)A.normals[R]=ve[R];if(be)for(R=0;R<be.length;R++)A.colors[R]=be[R];for(;I<B;)if(J=ee[I++],ne=L(J,0),ae=L(J,1),ie=L(J,3),oe=L(J,4),W=L(J,5),X=L(J,6),j=L(J,7),ne){if(H=new v,H.a=ee[I],H.b=ee[I+1],H.c=ee[I+3],K=new v,K.a=ee[I+1],K.b=ee[I+2],K.c=ee[I+3],I+=4,ae&&(G=ee[I++],H.materialIndex=G,K.materialIndex=G),x=A.faces.length,ie)for(R=0;R<me;R++)for(U=O.uvs[R],A.faceVertexUvs[R][x]=[],A.faceVertexUvs[R][x+1]=[],N=0;4>N;N++)k=ee[I++],$=U[2*k],Y=U[2*k+1],D=new b($,Y),N!==2&&A.faceVertexUvs[R][x].push(D),N!==0&&A.faceVertexUvs[R][x+1].push(D);if(oe&&(V=3*ee[I++],H.normal.set(ve[V++],ve[V++],ve[V]),K.normal.copy(H.normal)),W)for(R=0;4>R;R++)V=3*ee[I++],se=new y(ve[V++],ve[V++],ve[V]),R!==2&&H.vertexNormals.push(se),R!==0&&K.vertexNormals.push(se);if(X&&(F=ee[I++],le=be[F],H.color.setHex(le),K.color.setHex(le)),j)for(R=0;4>R;R++)F=ee[I++],le=be[F],R!==2&&H.vertexColors.push(new d(le)),R!==0&&K.vertexColors.push(new d(le));A.faces.push(H),A.faces.push(K)}else{if(z=new v,z.a=ee[I++],z.b=ee[I++],z.c=ee[I++],ae&&(G=ee[I++],z.materialIndex=G),x=A.faces.length,ie)for(R=0;R<me;R++)for(U=O.uvs[R],A.faceVertexUvs[R][x]=[],N=0;3>N;N++)k=ee[I++],$=U[2*k],Y=U[2*k+1],D=new b($,Y),A.faceVertexUvs[R][x].push(D);if(oe&&(V=3*ee[I++],z.normal.set(ve[V++],ve[V++],ve[V])),W)for(R=0;3>R;R++)V=3*ee[I++],se=new y(ve[V++],ve[V++],ve[V]),z.vertexNormals.push(se);if(X&&(F=ee[I++],z.color.setHex(be[F])),j)for(R=0;3>R;R++)F=ee[I++],z.vertexColors.push(new d(be[F]));A.faces.push(z)}}function _(O,A){var L=O.influencesPerVertex===void 0?2:O.influencesPerVertex;if(O.skinWeights)for(var R=0,N=O.skinWeights.length;R<N;R+=L){var x=O.skinWeights[R],I=1<L?O.skinWeights[R+1]:0,B=2<L?O.skinWeights[R+2]:0,F=3<L?O.skinWeights[R+3]:0;A.skinWeights.push(new m(x,I,B,F))}if(O.skinIndices)for(var R=0,N=O.skinIndices.length;R<N;R+=L){var V=O.skinIndices[R],k=1<L?O.skinIndices[R+1]:0,G=2<L?O.skinIndices[R+2]:0,J=3<L?O.skinIndices[R+3]:0;A.skinIndices.push(new m(V,k,G,J))}A.bones=O.bones,A.bones&&0<A.bones.length&&(A.skinWeights.length!==A.skinIndices.length||A.skinIndices.length!==A.vertices.length)&&console.warn("When skinning, number of vertices ("+A.vertices.length+"), skinIndices ("+A.skinIndices.length+"), and skinWeights ("+A.skinWeights.length+") should match.")}function P(O,A){var L=O.scale;if(O.morphTargets!==void 0)for(var R=0,N=O.morphTargets.length;R<N;R++){A.morphTargets[R]={},A.morphTargets[R].name=O.morphTargets[R].name,A.morphTargets[R].vertices=[];for(var x,I=A.morphTargets[R].vertices,B=O.morphTargets[R].vertices,F=0,V=B.length;F<V;F+=3)x=new y,x.x=B[F]*L,x.y=B[F+1]*L,x.z=B[F+2]*L,I.push(x)}if(O.morphNormals!==void 0){for(var R=0,N=O.morphNormals.length;R<N;R++)if(A.morphTargets[R]){A.morphTargets[R].normals=[];for(var k,G=A.morphTargets[R].normals,J=O.morphNormals[R].normals,F=0,V=J.length;F<V;F+=3)k=new y,k.x=J[F],k.y=J[F+1],k.z=J[F+2],G.push(k);A.morphNormalsReady=!0}}if(O.morphColors!==void 0){var R,N,ne,ae,ie,oe,W;for(R=0,N=O.morphColors.length;R<N;R++)for(A.morphColors[R]={},A.morphColors[R].name=O.morphColors[R].name,A.morphColors[R].colors=[],ie=A.morphColors[R].colors,oe=O.morphColors[R].colors,ne=0,ae=oe.length;ne<ae;ne+=3)W=new c.Color(16755200),W.setRGB(oe[ne],oe[ne+1],oe[ne+2]),ie.push(W)}}function E(O,A){var L=[],R=[];O.animation!==void 0&&R.push(O.animation),O.animations!==void 0&&(O.animations.length?R=R.concat(O.animations):R.push(O.animations));for(var N,x=0;x<R.length;x++)N=p.parseAnimation(R[x],A.bones),N&&L.push(N);if(A.morphTargets){var I=p.CreateClipsFromMorphTargetSequences(A.morphTargets,10);L=L.concat(I)}0<L.length&&(A.animations=L)}return function(O,A){O.data!==void 0&&(O=O.data),O.scale=O.scale===void 0?1:1/O.scale;var L=new g;if(L.morphColors=[],C(O,L),_(O,L),P(O,L),E(O,L),L.computeFaceNormals(),L.computeBoundingSphere(),O.materials===void 0||O.materials.length===0)return{geometry:L};var R=f.prototype.initMaterials(O.materials,A,"Anonymous");if(O.materials[0].video){var N=A+O.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var x=new T(N);L._video=x}return R&&0<R.length&&(R[0].side=O.materials[0].singleSided?c.FrontSide:O.materials[0].flipSided?c.BackSide:c.DoubleSide,O.materials[0].specularCoef&&(R[0].shininess=Math.floor(O.materials[0].specularCoef/3))),{geometry:L,materials:R}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,y){this.handlers.push(p,y)},get:function(p){for(var y=this.handlers,m=0,d=y.length;m<d;m+=2){var b=y[m],v=y[m+1];if(b.test(p))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,y,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],y,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,y=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,v){function g(C,_,P,E,O){var A,L=b+C,R=f.Handlers.get(L);R===null?(y.setCrossOrigin(v),A=y.load(L)):A=R.load(L),_!==void 0&&(A.repeat.fromArray(_),_[0]!==1&&(A.wrapS=c.RepeatWrapping),_[1]!==1&&(A.wrapT=c.RepeatWrapping)),P!==void 0&&A.offset.fromArray(P),E!==void 0&&(E[0]==="repeat"&&(A.wrapS=c.RepeatWrapping),E[0]==="mirror"&&(A.wrapS=c.MirroredRepeatWrapping),E[1]==="repeat"&&(A.wrapT=c.RepeatWrapping),E[1]==="mirror"&&(A.wrapT=c.MirroredRepeatWrapping)),O!==void 0&&(A.anisotropy=O);var N=c.MathUtils.generateUUID();return w[N]=A,N}var w={},S={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var T in d){var M=d[T];switch(T){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":S.name=M;break;case"blending":S.blending=h[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",T,"is no longer supported.");break;case"colorDiffuse":S.color=p.fromArray(M).getHex();break;case"colorSpecular":S.specular=p.fromArray(M).getHex();break;case"colorEmissive":S.emissive=p.fromArray(M).getHex();break;case"specularCoef":S.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(S.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(S.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(S.type="MeshStandardMaterial");break;case"mapDiffuse":S.map=g(M,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":S.emissiveMap=g(M,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":S.lightMap=g(M,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":S.aoMap=g(M,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":S.bumpMap=g(M,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":S.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":S.normalMap=g(M,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":S.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":S.specularMap=g(M,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":S.metalnessMap=g(M,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":S.roughnessMap=g(M,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":S.alphaMap=g(M,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":S.side=c.BackSide;break;case"doubleSided":S.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),S.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":S[T]=M;break;case"vertexColors":M===!0&&(S.vertexColors=c.VertexColors),M==="face"&&(S.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",T,M)}}return S.type==="MeshBasicMaterial"&&delete S.emissive,S.type!=="MeshPhongMaterial"&&delete S.specular,1>S.opacity&&(S.transparent=!0),m.setTextures(w),m.parse(S)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,y){var m=p/y*h.video.duration;h.video.currentTime=m},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(p){return h.video?p*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,p=u(5).getCircularTexture,y=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,w)=>{if(v&&g){var S=h(v,w),T=p();g.map=T;var M=new f(S,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(v,g,w,S)=>{if(w){var T=new c.Color(S),M=new y(w,T);M.setPosition(g[0],g[1],g[2]);var C=M.getSprite();C.material.sizeAttenuation=!1,C.material.alphaTest=.5,C.material.transparent=!0,C.material.depthWrite=!1,C.material.depthTest=!1,this.group.add(C),d[v]=M}};this.addPoints=(v,g,w)=>{if(v&&0<v.length){var S=this.drawRange-1,T=this.addVertices(v),M=this.getMorph();if(!M){var C=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});T.colorsNeedUpdate=!0,this.createMesh(T,C,{localTimeEnabled:!1,localMorphColour:!1})}var _=S+v.length,P=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(S;S+P<_;){var E=typeof g=="string"?g:g[P];b(P,v[P],E,w),P++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=v=>{this.morph&&this.morph.material&&(this.morph.material.size=v,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=v=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=v,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(v){if(0<=v&&this.drawRange>v){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(v),g.getY(v),g.getZ(v)]}},this.editVertices=function(v,g){if(v&&v.length){var w=this.getMorph(),S=g+v.length-1;if(!w||0>g||S>=this.drawRange)return;var T=w.geometry.getAttribute("position"),M=g;v.forEach(C=>{var _=d[M];_&&_.setPosition(C[0],C[1],C[2]),T.setXYZ(M++,C[0],C[1],C[2])}),T.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,w,S)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,v,g,w,S)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,y=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var S=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,T=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=S,this.material=T,this.sizePerPixel=1,this.updateMorphTargets()}copy(S){return super.copy(S),this.material=S.material,this.geometry=S.geometry,this}raycast(S,T){var M=this.geometry,C=this.matrixWorld,_=S.params.Points.threshold,P=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(C),p.radius+=_,S.ray.intersectsSphere(p)!==!1){f.copy(C).invert(),h.copy(S.ray).applyMatrix4(f);var E=_/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,O=E*E;if(M.isBufferGeometry){var A=M.index,L=M.attributes,R=L.position,N=M.morphAttributes.position;if(A!==null)for(var x,I=Math.max(0,P.start),B=Math.min(A.count,P.start+P.count),F=I;F<B;F++)x=A.getX(F),g(this,R,N,x),v(y,x,O,C,S,T,this);else for(var V=Math.max(0,P.start),k=Math.min(R.count,P.start+P.count),G=V;G<k;G++)g(this,R,N,G),v(y,G,O,C,S,T,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var S=this.geometry;if(S.isBufferGeometry){var T=S.morphAttributes,M=Object.keys(T);if(0<M.length){var C=T[M[0]];if(C!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var _,P=0,E=C.length;P<E;P++)_=C[P].name||P+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[_]=P}}}else{var O=S.morphTargets;O!==void 0&&0<O.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(w,S,T,M,C,_,P){var E=h.distanceSqToPoint(w);if(E<T){var O=new c.Vector3;h.closestPointToPoint(w,O),O.applyMatrix4(M);var A=C.ray.origin.distanceTo(O);if(A<C.near||A>C.far)return;_.push({distance:A,distanceToRay:Math.sqrt(E),point:O,index:S,face:null,object:P})}}function g(w,S,T,M){y.fromBufferAttribute(S,M);var C=w.morphTargetInfluences;if(w.material.morphTargets&&T&&C){m.set(0,0,0);for(var _=0,P=T.length;_<P;_++){var E=C[_],O=T[_];E!==0&&(d.fromBufferAttribute(O,M),m.addScaledVector(d.sub(y),E))}y.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,y,m)=>{if(p&&y){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,y)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:y});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(y,m,d,b,v,g,w){try{var S=y[g](w),T=S.value}catch(M){return void d(M)}S.done?m(T):Promise.resolve(T).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(T){c(S,b,v,g,w,"next",T)}function w(T){c(S,b,v,g,w,"throw",T)}var S=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var S,T=document.createElement("canvas"),M=0,C=Array(d.length),_=0;_<d.length;_++)S=yield y.imageToUint8Array(y,w,d[_],T),S&&S.array&&(b=S.width,v=S.height,C[g]=S.array,M+=C[g].length,g++);var P=new Uint8Array(M);M=0,C.forEach(E=>{P.set(E,M),M+=E.length}),y.impl=new h.DataTexture2DArray(P,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var v=h.FrontSide;m.side&&(v=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:v}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(y,m,d,b,v,g,w){try{var S=y[g](w),T=S.value}catch(M){return void d(M)}S.done?m(T):Promise.resolve(T).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(T){c(S,b,v,g,w,"next",T)}function w(T){c(S,b,v,g,w,"throw",T)}var S=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(y,m){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=m})},p.prototype.imageToUint8Array=function(){var y=f(function*(m,d,b,v){yield m.loadImage(d,b),v.width=d.width,v.height=d.height;var g=v.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,v.width,v.height).data.buffer),width:v.width,height:v.height}});return function(){return y.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(v,g){var w=Object.keys(v);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(v);g&&(S=S.filter(function(T){return Object.getOwnPropertyDescriptor(v,T).enumerable})),w.push.apply(w,S)}return w}function f(v){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(S){h(v,S,g[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(S){Object.defineProperty(v,S,Object.getOwnPropertyDescriptor(g,S))});return v}function h(v,g,w){return g=p(g),g in v?Object.defineProperty(v,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[g]=w,v}function p(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var S=w.call(v,g||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(v)}var m=u(4),d=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var S=void 0,T=!0;this.createSlides=_=>{_.forEach(P=>this.createSlide(P))};var M=(_,P)=>{var E=_.material,O=E.uniforms;switch(_.rotation.x=0,_.rotation.y=0,_.rotation.z=0,_.position.x=0,_.position.y=0,_.position.z=0,P.direction){case"x":var A=-Math.PI/2;_.rotation.y=A,O.direction.value=1,O.slide.value.set(P.value,0,0),_.position.x=P.value;break;case"y":_.rotation.x=Math.PI/2,O.direction.value=2,O.slide.value.set(0,P.value,0),_.position.y=P.value;break;case"z":O.direction.value=3,O.slide.value.set(0,0,P.value),_.position.z=P.value;break}E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=_=>{_&&_.id&&_.id in w&&w[_.id]&&M(w[_.id],_)},this.createSlide=_=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&_&&_.direction&&_.value!==void 0){var P=new m.PlaneGeometry(1,1);P.translate(.5,.5,0);var E=d.getUniforms();E.diffuse.value=this.texture.impl,E.depth.value=this.texture.size.depth,E.flipY.value=T;var O={fs:d.fs,vs:d.vs,uniforms:E,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},A=this.texture.getMaterial(O);A.needsUpdate=!0;var L=new m.Mesh(P,A);L.name=this.groupName,L.userData=this;var R={value:_.value,direction:_.direction,id:L.id};return g.push(R),M(L,R),w[L.id]=L,this.morph.add(L),this.boundingBoxUpdateRequired=!0,R}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=_=>{for(var P=0;P<g.length;P++)if(_===g[P].id)return f({},g[P])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=_=>{_&&this.removeSlideWithId(_.id)},this.removeSlideWithId=_=>{if(this.morph&&_ in w&&w[_]){if(this.morph.getObjectById(_)){var P=w[_];this.morph.remove(P),P.clear(),P.geometry&&P.geometry.dispose(),P.material&&P.material.dispose(),this.boundingBoxUpdateRequired=!0}var E=g.findIndex(O=>O.id===_);-1<E&&g.splice(E,1)}},this.dispose=()=>{this.morph.children.forEach(_=>{_.geometry&&_.geometry.dispose(),_.material&&_.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var C=(_,P,E)=>{if(P)switch(P.direction.value){case 1:E.copy(P.slide.value),_.expandByPoint(E),E.setY(1),E.setZ(1),_.expandByPoint(E);break;case 2:E.copy(P.slide.value),_.expandByPoint(E),E.setX(1),E.setZ(1),_.expandByPoint(E);break;case 3:E.copy(P.slide.value),_.expandByPoint(E),E.setX(1),E.setY(1),_.expandByPoint(E);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var _=new m.Vector3(0,0,0);this.morph.children.forEach(P=>{C(this.cachedBoundingBox,P.material.uniforms,_)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(_,P,E)=>{var O=new m.Matrix4;O.set(_[0],_[1],_[2],0,_[3],_[4],_[5],0,_[6],_[7],_[8],0,0,0,0,0);var A=new m.Quaternion().setFromRotationMatrix(O);this.morph.position.set(...P),this.morph.quaternion.copy(A),this.morph.scale.set(...E),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=_=>{this.morph.renderOrder=_},this.initialise=(_,P)=>{if(_){var E=_.locations;E&&0<E.length&&(this.applyTransformation(E[0].orientation,E[0].position,E[0].scale),"flipY"in E[0]&&(T=E[0].flipY)),this.createSlides(_.settings.slides),P!=null&&typeof P=="function"&&P(this)}},this.showEdges=_=>{if(S)S.material.color=_;else{var P=new m.BoxGeometry(1,1,1);P.translate(.5,.5,.5);var E=new m.EdgesGeometry(P);S=new m.LineSegments(E,new m.LineBasicMaterial({color:_})),this.group.add(S)}S.visible=!0},this.hideEdges=()=>{S&&(S.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
3184
+ `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,y=function(){return"pr"+p++},m=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=y(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(d,b,v){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=v,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,w=v*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var S=d;S=d>this.duration?this.duration:0>d?0:d,S!=this.inbuildTime&&(this.inbuildTime=S,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var v=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1),v)for(var g=-1,w=0,S=0;S<v.count;S++)this._v2.fromArray(v.array,3*S),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,d=S)}return d},m.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var g=v.morphTargetInfluences,w=v.geometry.morphAttributes;if(g&&w&&w.position){for(var S=!1,T=0;T<g.length;T++)0<g[T]&&(S=!0,this._v1.fromArray(w.position[T].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[T])));if(S)return d?b.applyMatrix4(v.matrixWorld):b}else return b.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(v.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},m.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},m.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var v=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(v=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),b&&b.camera&&(v||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,v=this.getClosestVertex(!0);return v.project(d.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:b}}},m.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(d,b,v,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(v,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var w=this.inbuildTime+d;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,v,g,w){this._lod.addLevelFromURL(d,b,v,g,w)},m.prototype.addVertices=function(d){var b=this.getMorph(),v=void 0;if(!b)v=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(w=>{g.setXYZ(this.drawRange,w[0],w[1],w[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),v=b.geoemtry,this.boundingBoxUpdateRequired=!0}return v},m.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=function(y){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=y,this.addLevel=(d,b)=>{if(d){var v,g=Math.abs(b);for(v=0;v<this.levels.length&&!(g<this.levels[v].distance);v++);this.levels.splice(v,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var v=Math.abs(b),g=0;g<this.levels.length;g++)if(v===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,v,g,w)=>{this._loader=d;var S,T=this.calculateDistance(b);for(S=0;S<this.levels.length&&!(T<this.levels[S].distance);S++);this.levels.splice(S,0,{distance:T,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),w&&this.loadLevel(S)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,v=0;return d==="far"?v=4.5*b:d==="medium"?v=2.5*b:d=="close"&&(v=0),v},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var v=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},w=h(b,g),S=void 0;this._parent.isGeometry?S=new c.Mesh(w,v):this._parent.isLines&&(S=new(u(12)).LineSegments(w,v)),S.userData=this._parent,S.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(S,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(v=>{v.morph&&v.morph.geometry&&f(v.morph.geometry,v.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),m()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1<v.length){var g,w,S=d.cameraObject.position.distanceTo(b),T=-1,M=-1;for(g=0,w=v.length;g<w&&S>=v[g].distance;g++)v[g].morph?(-1<T&&v[T].morph&&(v[T].morph.visible=!1),T=g,v[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;g++)v[g].morph&&(-1<T?v[g].morph.visible=!1:(v[g].morph.visible=!0,T=g));this._currentLevel!=T&&(this._currentLevel=T,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(v=>{v.morph&&(b?v.morph.add(d):v.morph.remove(d))})};var m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,p=new f.Vector3;class y extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,v=[],g=0,w=b.count;g<w;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+h.distanceTo(p);d.setAttribute("lineDistance",new f.Float32BufferAttribute(v,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}y.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>w});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,y=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,C=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=C,this.updateMorphTargets()}copy(M){return super.copy(M),this.material=M.material,this.geometry=M.geometry,this}computeLineDistances(){var M=this.geometry;if(!M.isBufferGeometry)M.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(M.index===null){for(var C=M.attributes.position,_=[0],P=1,E=C.count;P<E;P++)f.fromBufferAttribute(C,P-1),h.fromBufferAttribute(C,P),_[P]=_[P-1],_[P]+=f.distanceTo(h);M.setAttribute("lineDistance",new c.Float32BufferAttribute(_,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,C){var _=this.geometry,P=this.matrixWorld,E=M.params.Line.threshold,O=_.drawRange,A=_.morphAttributes.position;if(_.boundingSphere===null&&_.computeBoundingSphere(),m.copy(_.boundingSphere),m.applyMatrix4(P),m.radius+=E,M.ray.intersectsSphere(m)!==!1){p.copy(P).invert(),y.copy(M.ray).applyMatrix4(p);var L=E/((this.scale.x+this.scale.y+this.scale.z)/3),R=L*L,N=new c.Vector3,x=new c.Vector3,I=new c.Vector3,B=new c.Vector3,F=this.isLineSegments?2:1;if(_.isBufferGeometry){var V=_.index,k=_.attributes,G=k.position;if(V!==null)for(var J=Math.max(0,O.start),ne=Math.min(V.count,O.start+O.count),ae=J;ae<ne-1;ae+=F){var ie=V.getX(ae),oe=V.getX(ae+1);S(N,x,this,G,A,ie,oe);var W=y.distanceSqToSegment(N,x,B,I);if(!(W>R)){B.applyMatrix4(this.matrixWorld);var Z=M.ray.origin.distanceTo(B);Z<M.near||Z>M.far||C.push({distance:Z,point:I.clone().applyMatrix4(this.matrixWorld),index:ae,face:null,faceIndex:null,object:this})}}else for(var j=Math.max(0,O.start),re=Math.min(G.count,O.start+O.count),z=j;z<re-1;z+=F){S(N,x,this,G,A,z,z+1);var H=y.distanceSqToSegment(N,x,B,I);if(!(H>R)){B.applyMatrix4(this.matrixWorld);var K=M.ray.origin.distanceTo(B);K<M.near||K>M.far||C.push({distance:K,point:I.clone().applyMatrix4(this.matrixWorld),index:z,face:null,faceIndex:null,object:this})}}}else _.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var C=M.morphAttributes,_=Object.keys(C);if(0<_.length){var P=C[_[0]];if(P!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var E,O=0,A=P.length;O<A;O++)E=P[O].name||O+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[E]=O}}}else{var L=M.morphTargets;L!==void 0&&0<L.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function S(T,M,C,_,P,E,O){T.fromBufferAttribute(_,E),M.fromBufferAttribute(_,O);var A=C.morphTargetInfluences;if(C.material.morphTargets&&P&&A){d.set(0,0,0),b.set(0,0,0);for(var L=0,R=P.length;L<R;L++){var N=A[L],x=P[L];N!==0&&(v.fromBufferAttribute(x,E),g.fromBufferAttribute(x,O),d.addScaledVector(v.sub(T),N),b.addScaledVector(g.sub(M),N))}T.add(d),M.add(b)}}w.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var p=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v=void 0,g=void 0,w=void 0,S=void 0,T=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var C=!1;this.ndc=new c.Vector3;var _=void 0,P=void 0,E=()=>{v=new c.Sprite(y),v.center.set(.5,0),this.morph.add(v),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,v.scale.set(p[0],p[1],p[2]),v.userData=this};this.updateVisual=(O,A)=>{var L=1,R=0;O!==A&&(R=1-(this.ndc.z-O)/(A-O),L=.6+.4*R),this.setSpriteSize(L)},this.updateNDC=O=>(this.ndc.copy(this.morph.position),this.ndc.project(O),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(O,A,L)=>{this.morph.position.set(O,A,L)},this.setSpriteSize=O=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(O)},this.setUserSprite=()=>{S&&(this.morph.add(S),M&&(this.morph.remove(v),P&&this.morph.remove(P),M=!1))},this.setImageForUserSprite=(O,A)=>{S&&(this.morph.remove(S),S=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=O,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),A||(A=[.05,.05,1]),S=new c.Sprite(w),S.center.set(.5,0),S.scale.set(A[0],A[1],A[2]),S.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(v),S&&this.morph.remove(S),P&&this.morph.add(P))},this.loadUserSprite=(O,A)=>{if(O)if(O!==T){T=O;var L=new Image(128,128);L.crossOrigin="anonymous",L.onload=()=>{this.setImageForUserSprite(L,A)},L.src=O}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),P&&(P.material.map.dispose(),P.material.dispose(),P=void 0)},this.isEnabled=()=>C,this.setNumber=O=>{(!O||_!=O)&&P&&(this.morph.remove(P),P.material.map.dispose(),P.material.dispose(),P=void 0),!P&&O&&(P=m(O,.012,"black","Asap",120,700),this.morph.add(P)),_=O},this.getNumber=()=>_||1,this.setVisibility=function(O){O!==this.visible&&(this.visible=O,this.group.visible=O,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{C=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{C=!1,this.morph.visible=!1,this.visible=!1},E()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,p,y,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(v=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)&&(b=new(u(17)).Label(v,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(w,S,T,M)=>{this.morph&&(this.morph.matrix.elements[0]=S[0],this.morph.matrix.elements[1]=S[1],this.morph.matrix.elements[2]=S[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=T[0],this.morph.matrix.elements[5]=T[1],this.morph.matrix.elements[6]=T[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var p=f,y=void 0;y=h?new c(p,.015,h.getStyle()):new c(p,.015),y.fontFace="Asap",y.fontWeight=700,y.material.map.generateMipmaps=!1,y.material.sizeAttenuation=!1,y.center.x=-.05,y.center.y=0,this.getPosition=()=>y?[y.position.x,y.position.y,y.position.z]:[0,0,0],this.setPosition=(m,d,b)=>{y&&y.position.set(m,d,b)},this.setColour=m=>{y.color=m.getStyle()},this.setScale=m=>{y&&0<m&&y.scale.set(m,m,1)},this.dispose=()=>{},this.getSprite=()=>y,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,h=function(){u(10).ZincObject.call(this);var p=[],y=void 0,m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,w=void 0,S=0,T=0,M=[0,0,0],C=[0,0,0],_=[0,0,0],P="NONE";this.ready=!1;var E=!1,O=!1;this.isGlyphset=!0;var A=new c.Matrix4,L=new c.Color,R=new c.Color,N=new c.Box3,x=new c.Box3,I=new c.Box3,B=[],F=[],V=[],k=[],G=[],J=[],ne=[];this.globalScale=1;for(var ae=0;8>ae;ae++)new c.Vector3;this.load=(z,H,K,le,se)=>{y=z.axis1,m=z.axis2,d=z.axis3,b=z.positions,v=z.scale,g=z.colors,w=z.label,E=z.metadata.MorphColours,O=z.metadata.MorphVertices,S=z.metadata.number_of_time_steps,P=z.metadata.repeat_mode,T=z.metadata.number_of_vertices,P=="AXES_2D"||P=="MIRROR"?T*=2:P=="AXES_3D"&&(T*=3),M=z.metadata.base_size,C=z.metadata.offset,_=z.metadata.scale_factors;var U=new f;this.geometry=new c.BufferGeometry;var D=new c.InstancedMesh(this.geometry,void 0,T);if(this.setMorph(D),le){var $=U.parse(H);re(K,se)($.geometry,$.materials),$.geometry.dispose()}else U.crossOrigin="Anonymous",U.load(H,re(K,se))};var ie=(z,H,K,le,se,U)=>{if(P=="NONE"||P=="MIRROR"){for(var D,$=[0,0,0],Y=[0,0,0],ee=[0,0,0],ce=[0,0,0],ve=[0,0,0],be=[0,0,0],ue=[0,0,0],me=[0,0,0],te=[0,0,0],he=0;3>he;he++)D=0>se[he]?-1:1,$[he]=(D*M[he]+se[he]*_[he])*this.globalScale;for(var he=0;3>he;he++)Y[he]=H[he]*$[0],ee[he]=K[he]*$[1],ce[he]=le[he]*$[2],ve[he]=z[he]+C[0]*Y[he]+C[1]*ee[he]+C[2]*ce[he],P=="MIRROR"&&(be[he]=-Y[he],ue[he]=-ee[he],me[he]=-ce[he],te[he]=ve[he],0>se[0]&&(ve[he]-=Y[he],te[he]-=be[he]));0>ce[0]*(Y[1]*ee[2]-Y[2]*ee[1])+ce[1]*(Y[2]*ee[0]-Y[0]*ee[2])+ce[2]*(Y[0]*ee[1]-Y[1]*ee[0])&&(ce[0]=-ce[0],ce[1]=-ce[1],ce[2]=-ce[2]),U[0]=[ve,Y,ee,ce],P=="MIRROR"&&(0>me[0]*(be[1]*ue[2]-be[2]*ue[1])+me[1]*(be[2]*ue[0]-be[0]*ue[2])+me[2]*(be[0]*ue[1]-be[1]*ue[0])&&(me[0]=-me[0],me[1]=-me[1],me[2]=-me[2]),U[1]=[te,be,ue,me])}else if(P=="AXES_2D"||P=="AXES_3D"){for(var D,ge=[0,0,0],Ae=[0,0,0],he=0;3>he;he++)D=0>se[he]?-1:1,ge[he]=(D*M[0]+se[he]*_[0])*this.globalScale;for(var he=0;3>he;he++)Ae[he]=z[he]+C[0]*ge[0]*H[he]+C[1]*ge[1]*K[he]+C[2]*ge[2]*le[he];for(var Te=glyph_repeat_mode=="AXES_2D"?2:3,De=0;De<Te;De++){var Ye=void 0,ze=void 0,st=se[De],Ce=[0,0,0],He=[0,0,0],Ge=[0,0,0];De==0?(Ye=H,ze=K):De==1?(Ye=K,ze=glyph_repeat_mode=="AXES_2D"?H:le):(Ye=le,ze=H);var It=(M[0]+st*_[0])*this.globalScale;Ce[0]=Ye[0]*It,Ce[1]=Ye[1]*It,Ce[2]=Ye[2]*It,Ge[0]=Ce[1]*ze[2]-ze[1]*Ce[2],Ge[1]=Ce[2]*ze[0]-ze[2]*Ce[0],Ge[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var Ot=Math.sqrt(Ge[0]*Ge[0]+Ge[1]*Ge[1]+Ge[2]*Ge[2]);if(0<Ot){var mt=(M[2]+st*_[2])*this.globalScale/Ot;P=="AXES_2D"&&0<De&&(mt*=-1),Ge[0]*=mt,Ge[1]*=mt,Ge[2]*=mt}if(He[0]=Ge[1]*Ce[2]-Ce[1]*Ge[2],He[1]=Ge[2]*Ce[0]-Ce[2]*Ge[0],He[2]=Ge[0]*Ce[1]-Ge[1]*Ce[0],Ot=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]),0<Ot){var bt=(M[1]+st*_[1])*this.globalScale/Ot;He[0]*=bt,He[1]*=bt,He[2]*=bt}U[De]=[Ae,Ce,He,Ge]}}return U},oe=(z,H,K,le,se)=>{var U=1;P=="AXES_2D"||P=="MIRROR"?U=2:P=="AXES_3D"&&(U=3);var D=z.length/3,$=0;ne.length=U;for(var Y=0;Y<D;Y++){var ee=3*Y,ce=[z[ee],z[ee+1],z[ee+2]],ve=[H[ee],H[ee+1],H[ee+2]],be=[K[ee],K[ee+1],K[ee+2]],ue=[le[ee],le[ee+1],le[ee+2]],me=[se[ee],se[ee+1],se[ee+2]],te=ie(ce,ve,be,ue,me,ne);if(te.length==U)for(var he=0;he<U;he++){A.elements[0]=te[he][1][0],A.elements[1]=te[he][1][1],A.elements[2]=te[he][1][2],A.elements[3]=0,A.elements[4]=te[he][2][0],A.elements[5]=te[he][2][1],A.elements[6]=te[he][2][2],A.elements[7]=0,A.elements[8]=te[he][3][0],A.elements[9]=te[he][3][1],A.elements[10]=te[he][3][2],A.elements[11]=0,A.elements[12]=te[he][0][0],A.elements[13]=te[he][0][1],A.elements[14]=te[he][0][2],A.elements[15]=1,this.morph.setMatrixAt($,A);var ge=p[$];ge&&ge.setTransformation(te[he][0],te[he][1],te[he][2],te[he][3]),$++}}this.morph.instanceMatrix.needsUpdate=!0},W=z=>{var H=1;P=="AXES_2D"||P=="MIRROR"?H=2:P=="AXES_3D"&&(H=3);for(var K,le=z.length,se=0,U=0;U<le;U++){K=z[U];for(var D=0;D<H;D++){L.setHex(K),this.morph.setColorAt(se,L);var $=p[se];$&&$.setColour(L),se++}}this.morph.instanceColor.needsUpdate=!0},Z=()=>{var z=B,H=F,K=V,le=k,se=G,U=J,D=this.inbuildTime/this.duration*(S-1),$=Math.floor(D),Y=1-(D-$),ee=Math.ceil(D);if(O){var ce=b[$.toString()],ve=b[ee.toString()],be=y[$.toString()],ue=y[ee.toString()],me=m[$.toString()],te=m[ee.toString()],he=d[$.toString()],ge=d[ee.toString()],Ae=v[$.toString()],Te=v[ee.toString()];B.length=ce.length,F.length=ce.length,V.length=ce.length,k.length=ce.length,G.length=ce.length;for(var De=0;De<ce.length;De++)z[De]=Y*ce[De]+(1-Y)*ve[De],H[De]=Y*be[De]+(1-Y)*ue[De],K[De]=Y*me[De]+(1-Y)*te[De],le[De]=Y*he[De]+(1-Y)*ge[De],se[De]=Y*Ae[De]+(1-Y)*Te[De]}else z=b[0],H=y[0],K=m[0],le=d[0],se=v[0];if(oe(z,H,K,le,se),this.boundingBoxUpdateRequired=!0,g!=null){if(E){var Ye=g[$.toString()],ze=g[ee.toString()];U.length=Ye.length;for(var st=0;st<Ye.length;st++)L.setHex(Ye[st]),R.setHex(ze[st]),L.setRGB(L.r*Y+R.r*(1-Y),L.g*Y+R.g*(1-Y),L.b*Y+R.b*(1-Y)),U[st]=L.getHex()}else U=g[0];W(U)}};this.showLabel=()=>{for(var z=0;z<p.length;z++)p[z].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var z=0;z<p.length;z++)p[z].hideLabel()};var j=z=>{for(var H=0;H<T;H++){var K=new(u(16)).Glyph(void 0,void 0,H,this),le=w?w[H]:void 0;le=le||this.groupName,le&&K.setLabel(le),0<S&&K.setFrustumCulled(!1),p[H]=K,this.morph.add(K.getGroup())}z&&this.showLabel(),oe(b[0],y[0],m[0],d[0],v[0]),g!=null&&W(g[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=z=>{z.isGlyph&&p.push(z),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(z,H)=>{if(z.isMesh){var K=new(u(16)).Glyph(void 0,void 0,H,this);return K.fromMesh(z),p.push(K),this.morph.add(K.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,K}},this.forEachGlyph=z=>{for(var H=0;H<p.length;H++)z(p[H])};var re=(z,H)=>(K,le)=>{var se=K.toBufferGeometry();this.geometry.copy(se),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),se.dispose(),le&&le[0]&&(this.morph.material=le[0]),j(H),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),K.dispose(),z!=null&&typeof z=="function"&&z(this)};this.getClosestVertexIndex=function(){var z=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var H,K=b[0],le=K.length/3,se=-1,U=0,D=0;D<le;D++)H=3*D,this._v2.set(K[H],K[H+1],K[H+2]),U=this._v1.distanceTo(this._v2),(se==-1||se>U)&&(se=U,z=D)}return z},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var z=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,A),z.setFromMatrixPosition(A),z}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){N.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var z=0;z<T;z++)this.morph.getMatrixAt(z,A),x.copy(N).applyMatrix4(A),z==0?I.copy(x):I.union(x);if(I)this.cachedBoundingBox.copy(I),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=z=>{this.inbuildTime=z>this.duration?this.duration:0>z?0:z,(E||O)&&(Z(),O&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<S)&&(E||O)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(z){this.globalScale=z,Z()},this.dispose=()=>{for(var z=p.length-1;0<=z;z--)p[z].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),y=void 0,m=void 0,d=void 0,b=void 0,v=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(z,H,K)=>{if(H==!0){var le=this.inbuildTime+z;le>this.duration&&(le-=this.duration),this.inbuildTime=le,(E||O)&&Z()}this.updateMarker(H,K)}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=h},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,y=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,S=c.DefaultLoadingManager,T=u(21).VideoHandler;function M(C){typeof C=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),C=void 0),this.manager=C===void 0?S:C,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(_,P,E,O){var A=this,L=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(_),R=new w(this.manager);_.split("?"),this.paramsString=_.length===2?paramsStrings[1]:"",R.setWithCredentials(this.withCredentials),R.load(_,function(N){var x;try{x=JSON.parse(N)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),O)return void O({responseURL:_})}var I=x.metadata;if(I!==void 0){var B=I.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+_+" should be loaded with THREE.ObjectLoader instead.")}if(A&&A.parse)try{var F=A.parse(x,L);P(F.geometry,F.materials)}catch(V){if(console.error("The loader has encountered aon loading the geometry"),console.error(V),O)return void O({responseURL:_})}},E,O)},setTexturePath:function(_){this.texturePath=_},parse:function(){function C(O,A){function L(he,ge){return he&1<<ge}var R,N,x,I,B,F,V,k,G,J,ne,ae,ie,oe,W,Z,j,re,z,H,K,le,se,U,D,$,Y,ee=O.faces,ce=O.vertices,ve=O.normals,be=O.colors,ue=O.scale,me=0;if(O.uvs!==void 0){for(R=0;R<O.uvs.length;R++)O.uvs[R].length&&me++;for(R=0;R<me;R++)A.faceVertexUvs[R]=[]}for(I=0,B=ce.length;I<B;)re=new y,re.x=ce[I++]*ue,re.y=ce[I++]*ue,re.z=ce[I++]*ue,A.vertices.push(re);if(I=0,B=ee.length,O.uvs)for(R=0;R<O.uvs.length;R++){A.uvs[R]=[];for(var te=0;te<O.uvs[R].length;te++)A.uvs[R][te]=O.uvs[R][te]}if(ve)for(R=0;R<ve.length;R++)A.normals[R]=ve[R];if(be)for(R=0;R<be.length;R++)A.colors[R]=be[R];for(;I<B;)if(J=ee[I++],ne=L(J,0),ae=L(J,1),ie=L(J,3),oe=L(J,4),W=L(J,5),Z=L(J,6),j=L(J,7),ne){if(H=new v,H.a=ee[I],H.b=ee[I+1],H.c=ee[I+3],K=new v,K.a=ee[I+1],K.b=ee[I+2],K.c=ee[I+3],I+=4,ae&&(G=ee[I++],H.materialIndex=G,K.materialIndex=G),x=A.faces.length,ie)for(R=0;R<me;R++)for(U=O.uvs[R],A.faceVertexUvs[R][x]=[],A.faceVertexUvs[R][x+1]=[],N=0;4>N;N++)k=ee[I++],$=U[2*k],Y=U[2*k+1],D=new b($,Y),N!==2&&A.faceVertexUvs[R][x].push(D),N!==0&&A.faceVertexUvs[R][x+1].push(D);if(oe&&(V=3*ee[I++],H.normal.set(ve[V++],ve[V++],ve[V]),K.normal.copy(H.normal)),W)for(R=0;4>R;R++)V=3*ee[I++],se=new y(ve[V++],ve[V++],ve[V]),R!==2&&H.vertexNormals.push(se),R!==0&&K.vertexNormals.push(se);if(Z&&(F=ee[I++],le=be[F],H.color.setHex(le),K.color.setHex(le)),j)for(R=0;4>R;R++)F=ee[I++],le=be[F],R!==2&&H.vertexColors.push(new d(le)),R!==0&&K.vertexColors.push(new d(le));A.faces.push(H),A.faces.push(K)}else{if(z=new v,z.a=ee[I++],z.b=ee[I++],z.c=ee[I++],ae&&(G=ee[I++],z.materialIndex=G),x=A.faces.length,ie)for(R=0;R<me;R++)for(U=O.uvs[R],A.faceVertexUvs[R][x]=[],N=0;3>N;N++)k=ee[I++],$=U[2*k],Y=U[2*k+1],D=new b($,Y),A.faceVertexUvs[R][x].push(D);if(oe&&(V=3*ee[I++],z.normal.set(ve[V++],ve[V++],ve[V])),W)for(R=0;3>R;R++)V=3*ee[I++],se=new y(ve[V++],ve[V++],ve[V]),z.vertexNormals.push(se);if(Z&&(F=ee[I++],z.color.setHex(be[F])),j)for(R=0;3>R;R++)F=ee[I++],z.vertexColors.push(new d(be[F]));A.faces.push(z)}}function _(O,A){var L=O.influencesPerVertex===void 0?2:O.influencesPerVertex;if(O.skinWeights)for(var R=0,N=O.skinWeights.length;R<N;R+=L){var x=O.skinWeights[R],I=1<L?O.skinWeights[R+1]:0,B=2<L?O.skinWeights[R+2]:0,F=3<L?O.skinWeights[R+3]:0;A.skinWeights.push(new m(x,I,B,F))}if(O.skinIndices)for(var R=0,N=O.skinIndices.length;R<N;R+=L){var V=O.skinIndices[R],k=1<L?O.skinIndices[R+1]:0,G=2<L?O.skinIndices[R+2]:0,J=3<L?O.skinIndices[R+3]:0;A.skinIndices.push(new m(V,k,G,J))}A.bones=O.bones,A.bones&&0<A.bones.length&&(A.skinWeights.length!==A.skinIndices.length||A.skinIndices.length!==A.vertices.length)&&console.warn("When skinning, number of vertices ("+A.vertices.length+"), skinIndices ("+A.skinIndices.length+"), and skinWeights ("+A.skinWeights.length+") should match.")}function P(O,A){var L=O.scale;if(O.morphTargets!==void 0)for(var R=0,N=O.morphTargets.length;R<N;R++){A.morphTargets[R]={},A.morphTargets[R].name=O.morphTargets[R].name,A.morphTargets[R].vertices=[];for(var x,I=A.morphTargets[R].vertices,B=O.morphTargets[R].vertices,F=0,V=B.length;F<V;F+=3)x=new y,x.x=B[F]*L,x.y=B[F+1]*L,x.z=B[F+2]*L,I.push(x)}if(O.morphNormals!==void 0){for(var R=0,N=O.morphNormals.length;R<N;R++)if(A.morphTargets[R]){A.morphTargets[R].normals=[];for(var k,G=A.morphTargets[R].normals,J=O.morphNormals[R].normals,F=0,V=J.length;F<V;F+=3)k=new y,k.x=J[F],k.y=J[F+1],k.z=J[F+2],G.push(k);A.morphNormalsReady=!0}}if(O.morphColors!==void 0){var R,N,ne,ae,ie,oe,W;for(R=0,N=O.morphColors.length;R<N;R++)for(A.morphColors[R]={},A.morphColors[R].name=O.morphColors[R].name,A.morphColors[R].colors=[],ie=A.morphColors[R].colors,oe=O.morphColors[R].colors,ne=0,ae=oe.length;ne<ae;ne+=3)W=new c.Color(16755200),W.setRGB(oe[ne],oe[ne+1],oe[ne+2]),ie.push(W)}}function E(O,A){var L=[],R=[];O.animation!==void 0&&R.push(O.animation),O.animations!==void 0&&(O.animations.length?R=R.concat(O.animations):R.push(O.animations));for(var N,x=0;x<R.length;x++)N=p.parseAnimation(R[x],A.bones),N&&L.push(N);if(A.morphTargets){var I=p.CreateClipsFromMorphTargetSequences(A.morphTargets,10);L=L.concat(I)}0<L.length&&(A.animations=L)}return function(O,A){O.data!==void 0&&(O=O.data),O.scale=O.scale===void 0?1:1/O.scale;var L=new g;if(L.morphColors=[],C(O,L),_(O,L),P(O,L),E(O,L),L.computeFaceNormals(),L.computeBoundingSphere(),O.materials===void 0||O.materials.length===0)return{geometry:L};var R=f.prototype.initMaterials(O.materials,A,"Anonymous");if(O.materials[0].video){var N=A+O.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var x=new T(N);L._video=x}return R&&0<R.length&&(R[0].side=O.materials[0].singleSided?c.FrontSide:O.materials[0].flipSided?c.BackSide:c.DoubleSide,O.materials[0].specularCoef&&(R[0].shininess=Math.floor(O.materials[0].specularCoef/3))),{geometry:L,materials:R}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,y){this.handlers.push(p,y)},get:function(p){for(var y=this.handlers,m=0,d=y.length;m<d;m+=2){var b=y[m],v=y[m+1];if(b.test(p))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,y,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],y,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,y=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,v){function g(C,_,P,E,O){var A,L=b+C,R=f.Handlers.get(L);R===null?(y.setCrossOrigin(v),A=y.load(L)):A=R.load(L),_!==void 0&&(A.repeat.fromArray(_),_[0]!==1&&(A.wrapS=c.RepeatWrapping),_[1]!==1&&(A.wrapT=c.RepeatWrapping)),P!==void 0&&A.offset.fromArray(P),E!==void 0&&(E[0]==="repeat"&&(A.wrapS=c.RepeatWrapping),E[0]==="mirror"&&(A.wrapS=c.MirroredRepeatWrapping),E[1]==="repeat"&&(A.wrapT=c.RepeatWrapping),E[1]==="mirror"&&(A.wrapT=c.MirroredRepeatWrapping)),O!==void 0&&(A.anisotropy=O);var N=c.MathUtils.generateUUID();return w[N]=A,N}var w={},S={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var T in d){var M=d[T];switch(T){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":S.name=M;break;case"blending":S.blending=h[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",T,"is no longer supported.");break;case"colorDiffuse":S.color=p.fromArray(M).getHex();break;case"colorSpecular":S.specular=p.fromArray(M).getHex();break;case"colorEmissive":S.emissive=p.fromArray(M).getHex();break;case"specularCoef":S.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(S.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(S.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(S.type="MeshStandardMaterial");break;case"mapDiffuse":S.map=g(M,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":S.emissiveMap=g(M,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":S.lightMap=g(M,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":S.aoMap=g(M,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":S.bumpMap=g(M,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":S.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":S.normalMap=g(M,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":S.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":S.specularMap=g(M,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":S.metalnessMap=g(M,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":S.roughnessMap=g(M,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":S.alphaMap=g(M,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":S.side=c.BackSide;break;case"doubleSided":S.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),S.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":S[T]=M;break;case"vertexColors":M===!0&&(S.vertexColors=c.VertexColors),M==="face"&&(S.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",T,M)}}return S.type==="MeshBasicMaterial"&&delete S.emissive,S.type!=="MeshPhongMaterial"&&delete S.specular,1>S.opacity&&(S.transparent=!0),m.setTextures(w),m.parse(S)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,y){var m=p/y*h.video.duration;h.video.currentTime=m},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(p){return h.video?p*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,p=u(5).getCircularTexture,y=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,w)=>{if(v&&g){var S=h(v,w),T=p();g.map=T;var M=new f(S,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(v,g,w,S)=>{if(w){var T=new c.Color(S),M=new y(w,T);M.setPosition(g[0],g[1],g[2]);var C=M.getSprite();C.material.sizeAttenuation=!1,C.material.alphaTest=.5,C.material.transparent=!0,C.material.depthWrite=!1,C.material.depthTest=!1,this.group.add(C),d[v]=M}};this.addPoints=(v,g,w)=>{if(v&&0<v.length){var S=this.drawRange-1,T=this.addVertices(v),M=this.getMorph();if(!M){var C=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});T.colorsNeedUpdate=!0,this.createMesh(T,C,{localTimeEnabled:!1,localMorphColour:!1})}var _=S+v.length,P=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(S;S+P<_;){var E=typeof g=="string"?g:g[P];b(P,v[P],E,w),P++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=v=>{this.morph&&this.morph.material&&(this.morph.material.size=v,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=v=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=v,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(v){if(0<=v&&this.drawRange>v){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(v),g.getY(v),g.getZ(v)]}},this.editVertices=function(v,g){if(v&&v.length){var w=this.getMorph(),S=g+v.length-1;if(!w||0>g||S>=this.drawRange)return;var T=w.geometry.getAttribute("position"),M=g;v.forEach(C=>{var _=d[M];_&&_.setPosition(C[0],C[1],C[2]),T.setXYZ(M++,C[0],C[1],C[2])}),T.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,w,S)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,v,g,w,S)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,y=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var S=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,T=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=S,this.material=T,this.sizePerPixel=1,this.updateMorphTargets()}copy(S){return super.copy(S),this.material=S.material,this.geometry=S.geometry,this}raycast(S,T){var M=this.geometry,C=this.matrixWorld,_=S.params.Points.threshold,P=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(C),p.radius+=_,S.ray.intersectsSphere(p)!==!1){f.copy(C).invert(),h.copy(S.ray).applyMatrix4(f);var E=_/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,O=E*E;if(M.isBufferGeometry){var A=M.index,L=M.attributes,R=L.position,N=M.morphAttributes.position;if(A!==null)for(var x,I=Math.max(0,P.start),B=Math.min(A.count,P.start+P.count),F=I;F<B;F++)x=A.getX(F),g(this,R,N,x),v(y,x,O,C,S,T,this);else for(var V=Math.max(0,P.start),k=Math.min(R.count,P.start+P.count),G=V;G<k;G++)g(this,R,N,G),v(y,G,O,C,S,T,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var S=this.geometry;if(S.isBufferGeometry){var T=S.morphAttributes,M=Object.keys(T);if(0<M.length){var C=T[M[0]];if(C!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var _,P=0,E=C.length;P<E;P++)_=C[P].name||P+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[_]=P}}}else{var O=S.morphTargets;O!==void 0&&0<O.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(w,S,T,M,C,_,P){var E=h.distanceSqToPoint(w);if(E<T){var O=new c.Vector3;h.closestPointToPoint(w,O),O.applyMatrix4(M);var A=C.ray.origin.distanceTo(O);if(A<C.near||A>C.far)return;_.push({distance:A,distanceToRay:Math.sqrt(E),point:O,index:S,face:null,object:P})}}function g(w,S,T,M){y.fromBufferAttribute(S,M);var C=w.morphTargetInfluences;if(w.material.morphTargets&&T&&C){m.set(0,0,0);for(var _=0,P=T.length;_<P;_++){var E=C[_],O=T[_];E!==0&&(d.fromBufferAttribute(O,M),m.addScaledVector(d.sub(y),E))}y.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,y,m)=>{if(p&&y){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,y)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:y});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(y,m,d,b,v,g,w){try{var S=y[g](w),T=S.value}catch(M){return void d(M)}S.done?m(T):Promise.resolve(T).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(T){c(S,b,v,g,w,"next",T)}function w(T){c(S,b,v,g,w,"throw",T)}var S=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var S,T=document.createElement("canvas"),M=0,C=Array(d.length),_=0;_<d.length;_++)S=yield y.imageToUint8Array(y,w,d[_],T),S&&S.array&&(b=S.width,v=S.height,C[g]=S.array,M+=C[g].length,g++);var P=new Uint8Array(M);M=0,C.forEach(E=>{P.set(E,M),M+=E.length}),y.impl=new h.DataTexture2DArray(P,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var v=h.FrontSide;m.side&&(v=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:v}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(y,m,d,b,v,g,w){try{var S=y[g](w),T=S.value}catch(M){return void d(M)}S.done?m(T):Promise.resolve(T).then(b,v)}function f(y){return function(){var m=this,d=arguments;return new Promise(function(b,v){function g(T){c(S,b,v,g,w,"next",T)}function w(T){c(S,b,v,g,w,"throw",T)}var S=y.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(y,m){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=m})},p.prototype.imageToUint8Array=function(){var y=f(function*(m,d,b,v){yield m.loadImage(d,b),v.width=d.width,v.height=d.height;var g=v.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,v.width,v.height).data.buffer),width:v.width,height:v.height}});return function(){return y.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(v,g){var w=Object.keys(v);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(v);g&&(S=S.filter(function(T){return Object.getOwnPropertyDescriptor(v,T).enumerable})),w.push.apply(w,S)}return w}function f(v){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(S){h(v,S,g[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(S){Object.defineProperty(v,S,Object.getOwnPropertyDescriptor(g,S))});return v}function h(v,g,w){return g=p(g),g in v?Object.defineProperty(v,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[g]=w,v}function p(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var S=w.call(v,g||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(v)}var m=u(4),d=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var S=void 0,T=!0;this.createSlides=_=>{_.forEach(P=>this.createSlide(P))};var M=(_,P)=>{var E=_.material,O=E.uniforms;switch(_.rotation.x=0,_.rotation.y=0,_.rotation.z=0,_.position.x=0,_.position.y=0,_.position.z=0,P.direction){case"x":var A=-Math.PI/2;_.rotation.y=A,O.direction.value=1,O.slide.value.set(P.value,0,0),_.position.x=P.value;break;case"y":_.rotation.x=Math.PI/2,O.direction.value=2,O.slide.value.set(0,P.value,0),_.position.y=P.value;break;case"z":O.direction.value=3,O.slide.value.set(0,0,P.value),_.position.z=P.value;break}E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=_=>{_&&_.id&&_.id in w&&w[_.id]&&M(w[_.id],_)},this.createSlide=_=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&_&&_.direction&&_.value!==void 0){var P=new m.PlaneGeometry(1,1);P.translate(.5,.5,0);var E=d.getUniforms();E.diffuse.value=this.texture.impl,E.depth.value=this.texture.size.depth,E.flipY.value=T;var O={fs:d.fs,vs:d.vs,uniforms:E,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},A=this.texture.getMaterial(O);A.needsUpdate=!0;var L=new m.Mesh(P,A);L.name=this.groupName,L.userData=this;var R={value:_.value,direction:_.direction,id:L.id};return g.push(R),M(L,R),w[L.id]=L,this.morph.add(L),this.boundingBoxUpdateRequired=!0,R}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=_=>{for(var P=0;P<g.length;P++)if(_===g[P].id)return f({},g[P])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=_=>{_&&this.removeSlideWithId(_.id)},this.removeSlideWithId=_=>{if(this.morph&&_ in w&&w[_]){if(this.morph.getObjectById(_)){var P=w[_];this.morph.remove(P),P.clear(),P.geometry&&P.geometry.dispose(),P.material&&P.material.dispose(),this.boundingBoxUpdateRequired=!0}var E=g.findIndex(O=>O.id===_);-1<E&&g.splice(E,1)}},this.dispose=()=>{this.morph.children.forEach(_=>{_.geometry&&_.geometry.dispose(),_.material&&_.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var C=(_,P,E)=>{if(P)switch(P.direction.value){case 1:E.copy(P.slide.value),_.expandByPoint(E),E.setY(1),E.setZ(1),_.expandByPoint(E);break;case 2:E.copy(P.slide.value),_.expandByPoint(E),E.setX(1),E.setZ(1),_.expandByPoint(E);break;case 3:E.copy(P.slide.value),_.expandByPoint(E),E.setX(1),E.setY(1),_.expandByPoint(E);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var _=new m.Vector3(0,0,0);this.morph.children.forEach(P=>{C(this.cachedBoundingBox,P.material.uniforms,_)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(_,P,E)=>{var O=new m.Matrix4;O.set(_[0],_[1],_[2],0,_[3],_[4],_[5],0,_[6],_[7],_[8],0,0,0,0,0);var A=new m.Quaternion().setFromRotationMatrix(O);this.morph.position.set(...P),this.morph.quaternion.copy(A),this.morph.scale.set(...E),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=_=>{this.morph.renderOrder=_},this.initialise=(_,P)=>{if(_){var E=_.locations;E&&0<E.length&&(this.applyTransformation(E[0].orientation,E[0].position,E[0].scale),"flipY"in E[0]&&(T=E[0].flipY)),this.createSlides(_.settings.slides),P!=null&&typeof P=="function"&&P(this)}},this.showEdges=_=>{if(S)S.material.color=_;else{var P=new m.BoxGeometry(1,1,1);P.translate(.5,.5,.5);var E=new m.EdgesGeometry(P);S=new m.LineSegments(E,new m.LineBasicMaterial({color:_})),this.group.add(S)}S.visible=!0},this.hideEdges=()=>{S&&(S.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
3185
3185
  precision highp float;
3186
3186
  precision highp int;
3187
3187
  precision highp sampler2DArray;
@@ -3227,11 +3227,11 @@ void main() {
3227
3227
  vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth);
3228
3228
 
3229
3229
  }
3230
- `,y=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new c.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0},discardAlpha:{value:!0}}};l.fs=h,l.vs=p,l.glslVersion=f,l.getUniforms=y},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(h){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=h,this.load=(p,y)=>{if(p&&p.images&&p.images.source){var m=new(u(25)).TextureArray,d=[];p.images.source.forEach(v=>{d.push(c(v))});var b=this;m.loadFromImages(d).then(()=>{b.texture=m,b.initialise(p,y)})}},this.initialise=(p,y)=>{y!=null&&typeof y=="function"&&y(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(h){var p=h,y=void 0,m=void 0,d=new c.Clock(!1);this.playAnimation=!0;var b=1e3,v=[],g=0,w=[],S=0,T=void 0,M=void 0,C=void 0,_=void 0,P=[],E=[],O=new c.Group,A=void 0,L=void 0,R=!1;this.getDrawingWidth=()=>p?p.clientWidth:A?typeof A.clientWidth>"u"?Math.round(A.width):Math.round(A.clientWidth):0,this.getDrawingHeight=()=>p?p.clientHeight:A?typeof A.clientHeight>"u"?Math.round(A.height):Math.round(A.clientHeight):0,this.onWindowResize=()=>{m.onWindowResize();var I=this.getDrawingWidth(),B=this.getDrawingHeight();if(y!=null){var F;p?(F=p.getBoundingClientRect(),y.setSize(I,B)):A&&(typeof A.getBoundingClientRect>"u"||(F=A.getBoundingClientRect(),A.width=I,A.height=B),y.setSize(I,B,!1)),F&&(F.left,F.top);var V=new c.Vector2;y.getSize(V),V.x,V.y}},this.initialiseVisualisation=I=>{if(I=I||{},I.antialias===void 0){var B=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(B=!0)}catch{B=!1}I.antialias=!B}I.canvas&&(p=void 0,A=I.canvas),y=new c.WebGLRenderer(I),p!==void 0&&p.appendChild(y.domElement),y.setClearColor(16777215,1),A&&A.style&&(A.style.height="100%",A.style.width="100%"),y.autoClear=!1;var F=this.createScene("default");this.setCurrentScene(F)},this.getCurrentScene=()=>m,this.setCurrentScene=I=>{if(I){this.removeActiveScene(I);var B=m;m=I,B&&B.setInteractiveControlEnable(!1),m.setInteractiveControlEnable(!0),m.setAdditionalScenesGroup(O),this.onWindowResize()}},this.getSceneByName=I=>P[I],this.createScene=I=>{if(P[I]==null){var B;return B=A?new(u(32)).Scene(A,y):new(u(32)).Scene(p,y),P[I]=B,B.sceneName=I,B}},this.resetView=()=>{m.resetView()},this.viewAll=()=>{if(m){var I=m.getBoundingBox();if(I){for(var B,F=0;F<E.length;F++)B=E[F].getBoundingBox(),B&&I.union(B);m.viewAllWithBoundingBox(I)}}},this.loadModelsURL=(I,B,F,V,k,G)=>{m.loadModelsURL(I,B,F,V,k,G)},this.loadViewURL=I=>{m.loadViewURL(I)},this.loadFromViewURL=(I,B)=>{m.loadFromViewURL(I,B)},this.updateDirectionalLight=()=>{m.updateDirectionalLight()};var N=()=>{R?(T=requestAnimationFrame(N),this.render()):(cancelAnimationFrame(T),T=void 0)};this.stopAnimate=()=>{R&&(d.stop(),R=!1)},this.animate=()=>{R||(d.start(),R=!0,N())},this.addPreRenderCallbackFunction=I=>(++g,v[g]=I,g),this.removePreRenderCallbackFunction=I=>{I in v&&delete v[I]},this.addPostRenderCallbackFunction=I=>(++S,w[S]=I,S),this.removePostRenderCallbackFunction=I=>{I in w&&delete w[I]},this.getPlayRate=()=>b,this.setPlayRate=I=>{b=I},this.getCurrentTime=()=>m.getCurrentTime(),this.setMorphsTime=I=>{m.setMorphsTime(I)},this.getZincGeometryByID=I=>m.getZincGeometryByID(I),this.addToScene=I=>{m.addObject(I)},this.addToOrthoScene=I=>{if(C==null&&(C=new c.Scene),M==null){var B=this.getDrawingWidth(),F=this.getDrawingHeight();M=new c.OrthographicCamera(-B/2,B/2,F/2,-F/2,1,10),M.position.z=10}C.add(I)};var x=I=>B=>{B.needsUpdate=!0;var F=new c.SpriteMaterial({map:B}),V=F.map.image.width,k=F.map.image.height;I.material=F,I.scale.set(V,k,1);var G=this.getDrawingWidth(),J=this.getDrawingHeight();I.position.set((G-V)/2,(-J+k)/2,1),this.addToOrthoScene(I)};this.addLogo=()=>{_=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,x(_))},this.render=()=>{L||(p?0<p.clientWidth&&0<p.clientHeight&&(L=new f(p,this.onWindowResize)):A&&0<A.width&&0<A.height&&(L=new f(A,this.onWindowResize)));var I=d.getDelta();m.renderGeometries(b,I,this.playAnimation);for(var B,F=0;F<E.length;F++)B=E[F],B.renderGeometries(b,I,this.playAnimation);for(var V in M!=null&&C!=null&&(y.clearDepth(),y.render(C,M)),v)v.hasOwnProperty(V)&&v[V].call();for(var k in m.render(y),w)w.hasOwnProperty(k)&&w[k].call()},this.getThreeJSRenderer=()=>y,this.isSceneActive=I=>{if(m===I)return!0;for(var B,F=0;F<E.length;F++)if(B=E[F],B===I)return!0;return!1},this.addActiveScene=I=>{this.isSceneActive(I)||(E.push(I),O.add(I.getThreeJSScene()))},this.removeActiveScene=I=>{for(var B,F=0;F<E.length;F++)if(B=E[F],B===I)return E.splice(F,1),void O.remove(I.getThreeJSScene())},this.clearAllActiveScene=()=>{for(var I=0;I<E.length;I++)O.remove(E[I].getThreeJSScene());E.splice(0,E.length)},this.dispose=()=>{for(var I in R&&cancelAnimationFrame(T),P)P.hasOwnProperty(I)&&P[I].clearAll();P=[],E=[],O=new c.Group,this.stopAnimate(),v=[],g=0,M=void 0,C=void 0,_=void 0;var B=this.createScene("default");this.setCurrentScene(B),L=void 0},this.transitionScene=(I,B)=>{if(m){var F=m.getZincCameraControls(),V=I.getBoundingBox();if(V){var k=V.min.distanceTo(V.max)/2,G=(V.min.x+V.max.x)/2,J=(V.min.y+V.max.y)/2,ne=(V.min.z+V.max.z)/2,ae=F.getViewportFromCentreAndRadius(G,J,ne,k,40,k*4),ie=F.getCurrentViewport();F.cameraTransition(ie,ae,B),F.enableCameraTransition()}}},this.isWebGL2=()=>!!y&&y.capabilities.isWebGL2}},o=>{o.exports=QD()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,h=u(35).SceneLoader,p=u(41).SceneExporter,y=u(43).Viewport,m=u(5).createBufferGeometry,d=u(5).getCircularTexture,b=u(5).createNewSpriteText,v=0,g=function(){return"sc"+v++},w=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},S=6e3;l.Scene=function(T,M){var C=this,_=T,P=void 0,E=new h(this),O=void 0,A={},L=0,R={},N=0,x=new c.Scene,I=new c.Scene,B=new(u(44)).Region(void 0,this);x.add(B.getGroup());var F=new c.Group;x.add(F),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var V=6e3,k=void 0;this.sceneName=void 0;var G=!1,J=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.displayMiniAxes=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-right",updateRequired:!0};var ne={x:0,y:0},ae=w(),ie=new c.Vector2,oe=[];this.forcePickableObjectsUpdate=!1,this.uuid=g();var W=new f(this);W.disable(),x.add(W.group);var X={main:[],mini:[]},j=new c.Vector3(0,0,0),re=()=>_?typeof _.clientWidth>"u"?_.width:_.clientWidth:0,z=()=>_?typeof _.clientHeight>"u"?_.height:_.clientHeight:0;this.getDownloadProgress=()=>E.getDownloadProgress(),this.onWindowResize=()=>{var D=z();this.camera.aspect=re()/D,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,k.onResize(),k.calculateHeightPerPixelAtZeroDepth(D)},this.resetView=()=>{this.onWindowResize(),k.resetView()},this.changeZoomByScrollRateUnit=D=>{k.changeZoomByScrollRateUnit(D)};var H=()=>{this.camera=new c.PerspectiveCamera(40,re()/z(),0,10),this.ambient=new c.AmbientLight(16777215,.2),x.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),x.add(this.directionalLight),k=new(u(43)).CameraControls(this.camera,M.domElement,M,this),k.setDirectionalLight(this.directionalLight),k.resetView(),O=new(u(49)).Minimap(this)};H(),this.loadView=D=>{var $=new y;return $.setFromObject(D),k.setCurrentCameraSettings($),!0},this.setupMultipleViews=(D,$)=>{for(var[Y,ee]of Object.entries($)){var ce=new y;ce.setFromObject(ee),k.addViewport(Y,ce)}k.setDefaultViewport(D)},this.getBoundingBox=()=>B.getBoundingBox(!0),this.viewAllWithBoundingBox=D=>{if(D){var $=k.getViewportFromBoundingBox(D,1);k.setCurrentCameraSettings($),k.calculateHeightPerPixelAtZeroDepth(z()),W.markerUpdateRequired=!0}},this.viewAll=()=>{var D=this.getBoundingBox();this.viewAllWithBoundingBox(D),W.markerUpdateRequired=!0},this.forEachGeometry=D=>{B.forEachGeometry(D,!0)},this.forEachGlyphset=D=>{B.forEachGlyphset(D,!0)},this.forEachPointset=D=>{B.forEachPointset(D,!0)},this.forEachLine=D=>{B.forEachLine(D,!0)},this.findGeometriesWithGroupName=D=>B.findGeometriesWithGroupName(D,!0),this.findPointsetsWithGroupName=D=>B.findPointsetsWithGroupName(D,!0),this.findGlyphsetsWithGroupName=D=>B.findGlyphsetsWithGroupName(D,!0),this.findLinesWithGroupName=D=>B.findLinesWithGroupName(D,!0),this.findObjectsWithGroupName=D=>B.findObjectsWithGroupName(D,!0),this.findObjectsWithAnatomicalId=D=>B.findObjectsWithAnatomicalId(D,!0),this.getBoundingBoxOfZincObjects=D=>{for(var $,Y=void 0,ee=0;ee<D.length;ee++)$=D[ee].getBoundingBox(),$&&(Y?Y.union($):Y=$);return Y},this.vectorToScreenXY=D=>{D.project(this.camera);var $=re(),Y=z(),ee=$/2,ce=Y/2;return D.x=D.x*ee+ee,D.y=-(D.y*ce)+ce,D},this.getObjectsScreenXY=D=>{if(D&&0<D.length){var $=this.getBoundingBoxOfZincObjects(D),Y=new c.Vector3;return $.getCenter(Y),this.vectorToScreenXY(Y)}},this.getNamedObjectsScreenXY=D=>{var $=this.findObjectsWithGroupName(D);return this.getObjectsScreenXY($)},this.addZincObject=D=>{D&&(B.addZincObject(D),k&&k.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(D,$,Y,ee)=>{E.loadGlyphsetURL(B,D,$,Y,ee)},this.loadPointsetURL=(D,$,Y,ee,ce)=>{E.loadPointsetURL(B,D,$,Y,ee,ce)},this.loadLinesURL=(D,$,Y,ee,ce)=>{E.loadLinesURL(B,D,$,Y,ee,ce)},this.loadSTL=(D,$,Y)=>{E.loadSTL(B,D,$,Y)},this.loadOBJ=(D,$,Y)=>{E.loadOBJ(B,D,$,Y)},this.loadMetadataURL=(D,$,Y,ee)=>{E.loadMetadataURL(B,D,$,Y,ee)},this.loadModelsURL=(D,$,Y,ee,ce,ve)=>{E.loadModelsURL(B.urls,$,Y,ee,ce,ve)},this.loadViewURL=D=>{E.loadViewURL(D)},this.loadFromViewURL=(D,$)=>{E.loadFromViewURL(D,$)},this.loadGLTF=(D,$,Y,ee)=>{E.loadGLTF(B,D,$,Y,ee)},this.updateDirectionalLight=()=>{k.updateDirectionalLight()},this.addObject=D=>{x.add(D)},this.removeObject=D=>{x.remove(D)},this.getCurrentTime=()=>{if(P!=null)return P.getCurrentTime(V);var D=B.getCurrentTime();return D===-1?0:D},this.setMorphsTime=D=>{P!=null&&P.setMorphTime(D,V),B.setMorphTime(D,!0)},this.isTimeVarying=()=>!!(P&&P.video&&!P.video.error)||B.isTimeVarying(),this.renderGeometries=(D,$,Y)=>{var ee={};if(ee.camera=k,ee.displayMarkers=this.displayMarkers,ee.markerCluster=W,ee.markersList=W.markers,ee.ndcToBeUpdated=!1,Y&&(ee.markerCluster.markerUpdateRequired=!0),!P)E.toBeDownloaded==0?(ee.ndcToBeUpdated=k.update($),ee.ndcToBeUpdated&&k.calculateHeightPerPixelAtZeroDepth(z()),B.renderGeometries(D,$,Y,k,ee,!0)):k.update(0);else if(P.isReadyToPlay()){Y?P.video.play():P.video.pause();var ce=P.video.currentTime/P.getVideoDuration()*V;E.toBeDownloaded==0?(k.setTime(ce),ee.ndcToBeUpdated=k.update(0),ee.ndcToBeUpdated&&k.calculateHeightPerPixelAtZeroDepth(z()),B.setMorphTime(ce,!0),B.renderGeometries(0,0,Y,k,ee,!0)):k.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>x,this.setVideoHandler=D=>{P||(P=D)},this.setAdditionalScenesGroup=D=>{x.add(D)};var K=(D,$,Y,ee,ce,ve,be)=>{var ue=0,me=0;return me=D.includes("top")?be-ce-Y:D.includes("bottom")?Y:Math.floor((be-ce)/2),ue=D.includes("left")?$:D.includes("right")?ve-$-ee:Math.floor((ve-ee)/2),{x:ue,y:me}},le=D=>{(this.displayMinimap||this.displayMiniAxes)&&(D.setScissorTest(!0),D.getSize(ie),this.minimapScissor.updateRequired&&(ne=K(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,ie.x,ie.y),this.minimapScissor.updateRequired=!1),D.setScissor(ne.x,ne.y,this.minimapScissor.width,this.minimapScissor.height),D.setViewport(ne.x,ne.y,this.minimapScissor.width,this.minimapScissor.height),O.updateCamera(),this.displayMiniAxes?D.render(I,O.camera):(x.add(O.mask),D.render(x,O.camera),x.remove(O.mask)),D.setScissorTest(!1),D.setViewport(0,0,ie.x,ie.y))};this.render=D=>{this.autoClearFlag&&D.clear(),G&&J?J.render(x,this.camera):(D.render(x,this.camera),le(D))},this.setInteractiveControlEnable=D=>{D==!0?k.enable():k.disable()},this.getZincCameraControls=()=>k,this.getThreeJSScene=()=>x,this.setDuration=D=>{B.setDuration(D),V=D,k.setPathDuration(D),E.duration=D},this.getDuration=()=>V,this.setStereoEffectEnable=D=>{D!=!0||J||(J=new u(43).StereoEffect(M)),M.setSize(re(),z()),this.camera.updateProjectionMatrix(),G=D},this.objectIsInScene=D=>B.objectIsInRegion(D,!0),this.alignBoundingBoxToCameraView=(D,$)=>{if(D){D.getCenter(j);var Y=this.getZincCameraControls().getCurrentViewport(),ee=new c.Vector3(Y.targetPosition[0],Y.targetPosition[1],Y.targetPosition[2]),ce=new c.Vector3(Y.eyePosition[0],Y.eyePosition[1],Y.eyePosition[2]),ve=new c.Vector3,be=new c.Vector3;ve.subVectors(ee,ce).normalize(),be.subVectors(ee,j).normalize();var ue=new c.Vector3;ue.crossVectors(ve,be);var me=ve.angleTo(be);0<$?(this.getZincCameraControls().rotateCameraTransition(ue,me,$),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(ue,me),W.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(D,$,Y)=>{if(D){var ee=this.getZincCameraControls().getCurrentViewport(),ce=this.getZincCameraControls().getViewportFromBoundingBox(D,$);0<Y&&(this.getZincCameraControls().cameraTransition(ee,ce,Y),this.getZincCameraControls().enableCameraTransition()),W.markerUpdateRequired=!0}},this.alignObjectToCameraView=(D,$)=>{if(this.objectIsInScene(D)){var Y=D.getBoundingBox();this.alignBoundingBoxToCameraView(Y,$)}},this.setCameraTargetToObject=D=>{if(this.objectIsInScene(D)){var $=D.getBoundingBox(),Y=this.getZincCameraControls().getCurrentViewport();$.getCenter(j);var ee=new c.Vector3(Y.targetPosition[0],Y.targetPosition[1],Y.targetPosition[2]),ce=new c.Vector3(Y.eyePosition[0],Y.eyePosition[1],Y.eyePosition[2]),ve=new c.Vector3,be=new c.Vector3;ve.subVectors(ce,ee),be.addVectors(j,ve),Y.eyePosition[0]=be.x,Y.eyePosition[1]=be.y,Y.eyePosition[2]=be.z,Y.targetPosition[0]=j.x,Y.targetPosition[1]=j.y,Y.targetPosition[2]=j.z,this.getZincCameraControls().setCurrentCameraSettings(Y),W.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>G,this.removeZincObject=D=>{B.removeZincObject(D),k&&k.calculateMaxAllowedDistance(this),W.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{oe.length=0,W.isEnabled&&oe.push(W.group),B.getPickableThreeJSObjects(oe,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||B.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),oe),this.getNormalisedMinimapCoordinates=(D,$)=>{if(this.displayMinimap){var Y=new c.Vector2;D.getSize(Y);var ee=Y.y-$.clientY;if(ne.x+this.minimapScissor.width>$.clientX&&$.clientX>ne.x&&ne.y+this.minimapScissor.height>ee&&ee>ne.y){var ce=2*(($.clientX-ne.x)/this.minimapScissor.width)-1,ve=2*((ee-ne.y)/this.minimapScissor.height)-1;return{x:ce,y:ve}}}},this.getMinimapDiffFromNormalised=(D,$)=>O?O.getDiffFromNormalised(D,$):void 0,this.isWebGL2=()=>M.isWebGL2(),this.clearAll=()=>{W.clear(),B.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),E.toBeDwonloaded=0,k&&k.calculateMaxAllowedDistance(this),W.markerUpdateRequired=!0},this.addMetadataTimeStamp=(D,$)=>{ae.TimeStamps[D]=U($)},this.getMetadataTag=D=>ae[D],this.getMetadata=()=>ae,this.setMetadataTag=(D,$)=>{ae[D]=$},this.removeMetadataTag=D=>{delete ae[D]},this.resetMetadata=()=>{ae=w()},this.resetDuration=()=>{this.setDuration(S)};var se=D=>[...D.years?["".concat(D.years,"years")]:[],...D.months?["".concat(D.months,"months")]:[],...D.weeks?["".concat(D.weeks,"weeks")]:[],...D.days?["".concat(D.days,"days")]:[],...D.hours?["".concat(D.hours,"hours")]:[],...D.mins?["".concat(D.mins,"mins")]:[],...D.secs?["".concat(D.secs,"secs")]:[]].join(" "),U=D=>D.years?31536e6*D.years:0+D.months?2592e6*D.months:0+D.weeks?6048e5*D.weeks:0+D.days?864e5*D.days:0+D.hours?36e5*D.hours:0+D.mins?6e4*D.mins:0+D.secs?1e3*D.secs:0;this.setDurationFromObject=D=>{var $=se(D),Y=U(D);this.setMetadataTag("Duration",$),this.setDuration(Y)},this.setOriginalDurationFromObject=D=>{var $=se(D);this.setMetadataTag("OriginalDuration",$)},this.exportGLTF=D=>{var $=new p(this);return $.exportGLTF(D)},this.getRootRegion=()=>B,this.createLines=(D,$,Y,ee)=>{var ce=B.findChildFromPath(D);return ce===void 0&&(ce=B.createChildFromPath(D)),ce.createLines($,Y,ee)},this.createPoints=(D,$,Y,ee,ce)=>{var ve=B.findChildFromPath(D);return ve===void 0&&(ve=B.createChildFromPath(D)),ve.createPoints($,Y,ee,ce)},this.addZincObjectAddedCallbacks=D=>(++L,A[L]=D,L),this.addZincObjectRemovedCallbacks=D=>(++N,R[N]=D,N),this.removeZincObjectAddedCallbacks=D=>{D in L&&delete A[D]},this.removeZincObjectRemovedCallbacks=D=>{D in N&&delete R[D]},this.clearZincObjectAddedCallbacks=()=>{A={},L=0},this.clearZincObjectRemovedCallbacks=()=>{R={},N=0},this.triggerObjectAddedCallback=D=>{for(var $ in A)A.hasOwnProperty($)&&A[$](D)},this.triggerObjectRemovedCallback=D=>{for(var $ in R)R.hasOwnProperty($)&&R[$](D)},this.addTemporaryPoints=(D,$)=>{var Y=m(D.length,D),ee=new c.PointsMaterial({alphaTest:.5,size:15,color:$,sizeAttenuation:!1}),ce=d();ee.map=ce;var ve=new(u(23)).Points(Y,ee);return F.add(ve),ve},this.addTemporaryLines=(D,$)=>{var Y=m(D.length,D),ee=new c.LineBasicMaterial({color:$}),ce=new(u(12)).LineSegments(Y,ee);return F.add(ce),ce},this.removeTemporaryPrimitive=D=>{F.remove(D),D.geometry.dispose(),D.material.dispose()},this.clearTemporaryPrimitives=()=>{var D=0,$=F.children;return $.forEach(Y=>{Y.geometry.dispose(),Y.material.dispose(),D++}),F.clear(),D},this.addBoundingBoxPrimitive=function(D,$,Y,ee,ce){var ve=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0,be=B.findChildFromPath(D);be===void 0&&(be=B.createChildFromPath(D));var ue=ve||C.getBoundingBox();j.set(0,0,0);var me=j.subVectors(ue.max,ue.min),te=new c.BoxGeometry(me.x,me.y,me.z),he=be.createGeometryFromThreeJSGeometry($,te,Y,ee,ce,1e4);return me.addVectors(ue.min,ue.max).multiplyScalar(.5),he.setPosition(me.x,me.y,me.z),he},this.addSlicesPrimitive=function(D,$,Y,ee,ce){var ve=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0;if($&&3<=$.length&&Y&&3<=Y.length){var be=B.findChildFromPath(D);be===void 0&&(be=B.createChildFromPath(D));var ue=ve||C.getBoundingBox();j.set(0,0,0);var me=j.subVectors(ue.max,ue.min),te=[],he=0;return["x","y","z"].forEach(ge=>{var Ae;switch(ge){case"x":Ae=new c.PlaneGeometry(me.z,me.y),Ae.rotateY(Math.PI/2);break;case"y":Ae=new c.PlaneGeometry(me.x,me.z),Ae.rotateX(Math.PI/2);break;case"z":Ae=new c.PlaneGeometry(me.x,me.y);break}var Te=be.createGeometryFromThreeJSGeometry($[he],Ae,Y[he],ee,ce,10001);te.push(Te),he++}),me.addVectors(ue.min,ue.max).multiplyScalar(.5),te.forEach(ge=>{ge.setPosition(me.x,me.y,me.z)}),te}},this.enableMarkerCluster=D=>{D?(W.markerUpdateRequired=!0,W.enable()):(W.markerUpdateRequired=!1,W.disable()),this.forcePickableObjectsUpdate=!0},this.destroyAxisDisplay=()=>{this.displayMiniAxes=!1,X.main&&(this.enableAxisDisplay(!1,!1),X.main.forEach(D=>{D.dispose&&D.dispose()})),X.mini&&(this.enableAxisDisplay(!1,!0),X.mini.forEach(D=>{D.dispose&&D.dispose()})),X={main:[],mini:[]}},this.createAxisDisplay=function(){var D=0<arguments.length&&arguments[0]!==void 0&&arguments[0];C.destroyAxisDisplay();var $=[{name:"x",dir:new c.Vector3(1,0,0),colour:"red",hex:16733525},{name:"y",dir:new c.Vector3(0,1,0),colour:"green",hex:5635925},{name:"z",dir:new c.Vector3(0,0,1),colour:"blue",hex:5592575}],Y=C.getBoundingBox(),ee=Y.min.distanceTo(Y.max),ce=new c.Vector3(0,0,0);D&&ce.copy(Y.min),$.forEach(ve=>{var be=new c.ArrowHelper(ve.dir,ce,ee,ve.hex);X.main.push(be);var ue=new c.ArrowHelper(ve.dir,Y.getCenter(j),ee/2,ve.hex);X.mini.push(ue);var me=b(ve.name,.036,ve.colour,"Asap",120,700),te=ve.dir.clone().multiplyScalar(ee).add(ce);me.position.set(te.x,te.y,te.z),X.main.push(me)})},this.enableAxisDisplay=function(D){var $,Y=1<arguments.length&&arguments[1]!==void 0&&arguments[1];Y&&($=X)!==null&&$!==void 0&&($=$.mini)!==null&&$!==void 0&&$.length?(C.displayMiniAxes=D,X.mini.forEach(ee=>{D?I.add(ee):I.remove(ee)})):!Y&&X.main&&X.main.forEach(ee=>{D?x.add(ee):x.remove(ee)})}}},(o,l,u)=>{function c(T,M){var C=Object.keys(T);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(T);M&&(_=_.filter(function(P){return Object.getOwnPropertyDescriptor(T,P).enumerable})),C.push.apply(C,_)}return C}function f(T){for(var M,C=1;C<arguments.length;C++)M=arguments[C]==null?{}:arguments[C],C%2?c(Object(M),!0).forEach(function(_){h(T,_,M[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(M)):c(Object(M)).forEach(function(_){Object.defineProperty(T,_,Object.getOwnPropertyDescriptor(M,_))});return T}function h(T,M,C){return M=p(M),M in T?Object.defineProperty(T,M,{value:C,enumerable:!0,configurable:!0,writable:!0}):T[M]=C,T}function p(T){var M=y(T,"string");return typeof M=="symbol"?M:M+""}function y(T,M){if(typeof T!="object"||!T)return T;var C=T[Symbol.toPrimitive];if(C!==void 0){var _=C.call(T,M||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(M==="string"?String:Number)(T)}var m=u(4),d=new Image(128,128);d.src=u(34);var b=new m.Texture;b.image=d,b.needsUpdate=!0;var v=[.02,.03,1],g=new m.SpriteMaterial({map:b,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),w=u(5).createNewSpriteText,S=function(T){u(10).ZincObject.call(this),this.texture=b;var M=void 0;this.morph=new m.Group,this.group=this.morph,this.isMarkerCluster=!0;var C=!0,_=[];this.markers={};var P=new m.Vector2,E=new m.Vector2,O=Date.now();this.setSpriteSize=x=>{M.scale.set(.015,.02,1),M.scale.multiplyScalar(x)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var A=x=>{var I=new m.Group,B=new m.Sprite(g);return B.clusterIndex=x,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(v[0],v[1],v[2]),B.userData=this,I.add(B),this.group.add(I),{group:I,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},L=(x,I,B)=>{x.group.visible=!0,x.group.position.set(I.coords[0],I.coords[1],I.coords[2]),(x.label===void 0||B!==x.number)&&(x.label&&(x.group.remove(x.label),x.label.material.map.dispose(),x.label.material.dispose()),x.label=w(B,.012,"black","Asap",120,700),x.number=B,x.group.add(x.label)),x.min=I.min,x.max=I.max},R=x=>{var I=0;for(x.forEach(B=>{var F=B.members.length,V=0;F===1?B.members[0].setVisibility(!0):(B.members.forEach(k=>{V+=k.getNumber(),k.setVisibility(!1)}),!_[I]&&_.push(A(I)),L(_[I],B,V),I++)}),I;I<_.length;I++)_[I].group.visible=!1},N=(x,I)=>{var B=!0,F={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},V=0;for(var k in x)B?(P.set(x[k].ndc.x,x[k].ndc.y),this._b1.setFromPoints([x[k].morph.position]),B=!1,F.members.push(x[k]),F.coords=[x[k].morph.position.x,x[k].morph.position.y,x[k].morph.position.z],I.push(F),delete x[k]):(E.set(x[k].ndc.x,x[k].ndc.y),V=P.distanceTo(E),.1>V&&(F.members.push(x[k]),this._b1.expandByPoint(x[k].morph.position),delete x[k]));F.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],F.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&N(x,I)};this.calculate=()=>{if(C){var x=Date.now();if(500<x-O){var I=[];N(f({},this.markers),I),R(I),O=Date.now(),this.markerUpdateRequired=!1}}},this.isEnabled=()=>C,this.enable=()=>{C=!0,this.morph.visible=!0},this.disable=()=>{for(var x in C=!1,this.morph.visible=!1,this.markers){var I;(I=this.markers[x])!==null&&I!==void 0&&I.isMarker&&this.markers[x].isEnabled()&&this.markers[x].setVisibility(!0)}},this.zoomToCluster=x=>!!(x!==void 0&&-1<x&&(this._v1.set(..._[x].min),this._v2.set(..._[x].max),Math.abs(0<this._v1.distanceTo(this._v2))))&&(this._b1.set(this._v1,this._v2),T.translateBoundingBoxToCameraView(this._b1,3,300),this.markerUpdateRequired=!0,!0),this.clusterIsVisible=x=>{if(x!==void 0&&-1<x&&_[x]){var I;return(I=_[x].group)===null||I===void 0?void 0:I.visible}return!1}};S.prototype=Object.create(u(10).ZincObject.prototype),l.MarkerCluster=S},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=u(5).createNewURL,p=u(5).isRegionGroup,y=u(36).STLLoader,m=u(37).OBJLoader,d=u(38).PrimitivesLoader;l.SceneLoader=function(b){var v=b;this.toBeDownloaded=0,this.progressMap={};var g=!1,w=!1,S=new d;this.getDownloadProgress=()=>{var W=0,X=0,j=!1;for(var re in this.progressMap){var z=this.progressMap[re];W+=z[1],X+=z[0],z[1]==0&&(j=!0)}return j&&(W=0),[W,X,w]},this.onProgress=W=>X=>{this.progressMap[W]=[X.loaded,X.total]},this.onError=W=>X=>{--this.toBeDownloaded,w=!0,console.error("There is an issue with external resource: ".concat(X==null?void 0:X.responseURL,".")),W&&W({type:"Error",xhr:X})};var T=(W,X)=>{var j=X.Default;if(X.Inline)v.setupMultipleViews(j,X.Entries);else{var re=[],z=function(se){W&&(newURL=h(K,W),re.push(new Promise((U,D)=>{fetch(newURL).then($=>$.json()).then($=>U({key:se,data:$})).catch($=>D($))})))};for(var[H,K]of Object.entries(X.Entries))z(H);Promise.all(re).then(le=>{var se={};le.forEach(D=>{se[D.key]=D.data}),v.setupMultipleViews(j,se);var U=v.getZincCameraControls();U&&U.setCurrentViewport(j),g=!0})}};this.loadViewURL=(W,X)=>{this.toBeDownloaded+=1;var j=new XMLHttpRequest;j.onreadystatechange=()=>{if(j.readyState==4)if(j.status==200){var z=JSON.parse(j.responseText);v.setupMultipleViews("default",{default:z}),v.resetView(),g=!0,--this.toBeDownloaded,X!=null&&typeof X=="function"&&X()}else this.onError()};var re=f(W);j.open("GET",re,!0),j.send()},this.loadModelsURL=(W,X,j,re,z,H,K)=>{var le=X.length;this.toBeDownloaded+=le;for(var se=0;se<le;se++){var U=X[se],D=u(0).defaultMaterialColor,$=u(0).defaultOpacity;j!=null&&j[se]!=null&&(D=!!j[se]),re!=null&&re[se]!=null&&($=re[se]);var Y=0;z!=null&&z[se]!=null&&(Y=!!z[se]);var ee=0;H!=null&&H[se]!=null&&(ee=!!H[se]),S.load(f(U),N(W,D,$,Y,ee,void 0,void 0,void 0,void 0,K),this.onProgress(U),this.onError(K))}},this.loadFromViewURL=(W,X,j)=>{var re=new XMLHttpRequest;re.onreadystatechange=()=>{if(re.readyState==4&&re.status==200){var H=JSON.parse(re.responseText);v.loadView(H);for(var K,le=[],se=X+"_",U=0;U<H.numberOfResources;U++)K=se+(U+1)+".json",le.push(K);this.loadModelsURL(W,le,H.colour,H.opacity,H.timeEnabled,H.morphColour,j)}};var z=f(X+"_view.json");re.open("GET",z,!0),re.send()};var M=(W,X,j,re,z,H,K,le)=>(se,U)=>{var D=new(u(24)).Lines,$=void 0;U&&U[0]&&($=new c.LineBasicMaterial({color:U[0].color.clone()}),1>U[0].opacity&&($.transparent=!0),$.opacity=U[0].opacity,$.morphTargets=X,$.vertexColors=U[0].vertexColors);var Y={localTimeEnabled:X,localMorphColour:j};if(D&&(D.createLineSegment(se,$,Y),D.setName(re),D.anatomicalId=z,D.setRenderOrder(H),W.addZincObject(D),D.setDuration(v.getDuration()),K&&K.levels))for(var[ee,ce]of Object.entries(K.levels))D.addLOD(S,ee,ce.URL,ce.Index,K.preload);--this.toBeDownloaded,se.dispose(),le!=null&&typeof le=="function"&&le(D)};this.loadLinesURL=(W,X,j,re,z,H,K)=>{var le=0;this.toBeDownloaded+=1;var se=!!(K&&K.isInline)&&K.isInline,U=K&&K.anatomicalId?K.anatomicalId:void 0,D=K&&K.renderOrder?K.renderOrder:void 0;j!=null&&(le=!!j);var $=0;if(re!=null&&($=!!re),se){var Y=S.parse(X);M(W,le,$,z,U,D,K.lod,H)(Y.geometry,Y.materials)}else S.load(X,M(W,le,$,z,U,D,K.lod,H),this.onProgress(X),this.onError(H),K.loaderOptions)};var C=(W,X,j,re,z,H)=>{var K=H&&H.isInline?H.isInline:void 0,le=H&&H.anatomicalId?H.anatomicalId:void 0,se=H&&H.displayLabels?H.displayLabels:void 0,U=H&&H.renderOrder?H.renderOrder:void 0,D=new(u(18)).Glyphset;D.setDuration(v.getDuration()),D.groupName=re;var $=()=>{--this.toBeDownloaded,z!=null&&typeof z=="function"&&z(D)};++this.toBeDownloaded,K?D.load(X,j,$,K,se):D.load(X,f(j),$,K,se),D.anatomicalId=le,D.setRenderOrder(U),W.addZincObject(D)},_=(W,X,j,re,z,H)=>()=>{if(X.readyState==4&&X.status==200){var K=JSON.parse(X.responseText);C(W,K,j,re,z,H)}},P=(W,X,j,re,z,H,K)=>(le,se)=>{var U=new(u(22)).Pointset,D=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});se&&se[0]&&(1>se[0].opacity&&(D.transparent=!0),D.opacity=se[0].opacity,D.color=se[0].color,D.morphTargets=X,D.vertexColors=se[0].vertexColors);var $={};$.localTimeEnabled=X,$.localMorphColour=j,U&&(U.createMesh(le,D,$),U.setName(re),U.anatomicalId=z,W.addZincObject(U),U.setDuration(v.getDuration()),U.setRenderOrder(H)),le.dispose(),--this.toBeDownloaded,K!=null&&typeof K=="function"&&K(U)};this.loadSTL=(W,X,j,re)=>{this.toBeDownloaded+=1;var z=u(0).defaultMaterialColor,H=u(0).defaultOpacity,K=new y;K.crossOrigin="Anonymous",K.load(f(X),N(W,z,H,!1,!1,j,void 0,void 0,void 0,re))},this.loadOBJ=(W,X,j,re)=>{this.toBeDownloaded+=1;var z=u(0).defaultMaterialColor,H=u(0).defaultOpacity,K=new m;K.crossOrigin="Anonymous",K.load(f(X),N(W,z,H,!1,!1,j,void 0,void 0,void 0,re))};var E=(W,X,j,re,z,H,K)=>{this.toBeDownloaded+=1;var le=u(0).defaultMaterialColor,se=u(0).defaultOpacity,U=0,D=!!(K&&K.isInline)&&K.isInline,$=K&&K.fileFormat?K.fileFormat:void 0,Y=K&&K.anatomicalId?K.anatomicalId:void 0,ee=K&&K.renderOrder?K.renderOrder:void 0;j!=null&&(U=!!j);var ce=0;re!=null&&(ce=!!re);var ve=S;if($!==void 0){if($=="STL")ve=new y;else if($=="OBJ")return ve=new m,ve.crossOrigin="Anonymous",void ve.load(X,objloader(W,le,se,U,ce,z,Y,H),this.onProgress(X),this.onError,K.loaderOptions)}if(D){var be=S.parse(X);N(W,le,se,U,ce,z,Y,ee,K,H)(be.geometry,be.materials)}else ve.crossOrigin="Anonymous",S.load(X,N(W,le,se,U,ce,z,Y,ee,K,H),this.onProgress(X),this.onError(H),K.loaderOptions)},O=function(X,j,re){var z=0;return H=>{if(++z,H&&j!=null&&typeof j=="function"&&j(H),z==X&&(g==!1&&v.viewAll(),re!=null&&typeof re=="function")){re();var K=v.getZincCameraControls();K&&K.calculateMaxAllowedDistance(v)}}};this.loadPointsetURL=(W,X,j,re,z,H,K)=>{var le=0;this.toBeDownloaded+=1,j!=null&&(le=!!j);var se=0;re!=null&&(se=!!re);var U=!!(K&&K.isInline)&&K.isInline,D=K&&K.anatomicalId?K.anatomicalId:void 0,$=K&&K.renderOrder?K.renderOrder:void 0;if(U){var Y=S.parse(X);P(W,le,se,z,D,$,H)(Y.geometry,Y.materials)}else S.load(X,P(W,le,se,z,D,$,H),this.onProgress(X),this.onError(H),K.loaderOptions)};var A=(W,X,j,re,z,H)=>{var K=H&&H.isInline?H.isInline:void 0,le=H&&H.anatomicalId?H.anatomicalId:void 0,se=H&&H.renderOrder?H.renderOrder:void 0,U=void 0;if(j){if(X&&j.images&&j.images.source)for(var D,$=j.images.source,Y=0;Y<$.length;Y++)D=h($[Y],X),j.images.source[Y]=D;if(j.type==="slides"&&(U=new(u(27)).TextureSlides),U){U.groupName=re;var ee=()=>{--this.toBeDownloaded,z!=null&&typeof z=="function"&&z(U)};++this.toBeDownloaded,U.load(j,ee,K),U.anatomicalId=le,U.setRenderOrder(se),W.addZincObject(U)}}},L=(W,X,j,re,z)=>()=>{if(X.readyState==4&&X.status==200){var H=JSON.parse(X.responseText);A(W,X.responseURL,H,j,re,z)}};this.loadTextureURL=(W,X,j,re,z)=>{var H=!!(z&&z.isInline)&&z.isInline;if(H)A(W,void 0,X,j,re,z);else{var K=new XMLHttpRequest;K.onreadystatechange=L(W,K,j,re,z),K.open("GET",f(X),!0),K.send()}},this.loadGlyphsetURL=(W,X,j,re,z,H)=>{var K=!!(H&&H.isInline)&&H.isInline;if(K)C(W,X,j,re,z,H);else{var le=new XMLHttpRequest;le.onreadystatechange=_(W,le,j,re,z,H),le.open("GET",f(X),!0),le.send()}};var R=(W,X,j,re,z,H,K,le,se)=>{var U={colour:j,opacity:re,localTimeEnabled:z,localMorphColour:H},D=new(u(3)).Geometry;return D.createMesh(X,le,U),D.getMorph()?(D.setName(se),W&&W.addZincObject(D),D.setDuration(v.getDuration()),D.videoHandler&&v.setVideoHandler(D.videoHandler),D):void 0},N=(W,X,j,re,z,H,K,le,se,U)=>(D,$)=>{var Y;$&&$[0]&&(Y=$[0]);var ee=R(W,D,X,j,re,z,void 0,Y,H);if(ee.anatomicalId=K,ee.setRenderOrder(le),se.lod&&se.lod.levels)for(var[ce,ve]of Object.entries(se.lod.levels))ee.addLOD(S,ce,ve.URL,ve.Index,se.lod.preload);--this.toBeDownloaded,D.dispose(),U!=null&&typeof U=="function"&&U(ee)},x=W=>{var X=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,j,re,z,H,K,le,se]=W.match(X);return{years:j,months:re,weeks:z,days:H,hours:K,mins:le,secs:se}};this.loadSettings=W=>{if(W){if(W.Duration){var X=x(W.Duration);v.setDurationFromObject(X)}if(W.OriginalDuration){var j=x(W.OriginalDuration);v.setOriginalDurationFromObject(j)}if(W.TimeStamps)for(var re in W.TimeStamps){var z=x(W.TimeStamps[re]);v.addMetadataTimeStamp(re,z)}}};var I=(W,X,j,re,z)=>{if(j){var H=void 0,K=!1;j.URL?(H=j.URL,X&&(H=h(H,X))):j.Inline&&(H=j.Inline.URL,K=!0);var le={};if(j.LOD&&j.LOD.Levels){le.preload=!!j.LOD.Preload,le.levels={};for(var[se,U]of Object.entries(j.LOD.Levels))le.levels[se]={},le.levels[se].URL=h(U.URL,X),le.levels[se].Index=U.Index}var D=j.GroupName;(D===void 0||D==="")&&(D="_Unnamed");var $={loaderOptions:{index:j.Index},isInline:K,fileFormat:j.FileFormat,anatomicalId:j.AnatomicalId,compression:j.compression,lod:le,renderOrder:re};switch(j.Type){case"Surfaces":E(W,H,j.MorphVertices,j.MorphColours,D,z,$);break;case"Glyph":var Y;K?Y=j.Inline.GlyphGeometriesURL:(Y=j.GlyphGeometriesURL,Y=h(j.GlyphGeometriesURL,X)),j.DisplayLabels&&($.displayLabels=!0),this.loadGlyphsetURL(W,H,Y,D,z,$);break;case"Points":this.loadPointsetURL(W,H,j.MorphVertices,j.MorphColours,D,z,$);break;case"Lines":this.loadLinesURL(W,H,j.MorphVertices,j.MorphColours,D,z,$);break;case"Texture":this.loadTextureURL(W,H,D,z,$);break}}},B=(W,X,j)=>{if(X){var re=void 0,z=!1;switch(X.URL?(re=X.URL,W&&(re=h(X.URL,W))):X.Inline&&(re=X.Inline.URL,z=!0),X.Type){case"View":z?(v.setupMultipleViews("default",{default:re}),g=!0,j!=null&&typeof j=="function"&&j()):this.loadViewURL(re,j);break;case"Settings":this.loadSettings(X);break}}};this.loadGLTF=(W,X,j,re,z)=>{var H=new(u(39)).GLTFToZincJSLoader;H.load(v,W,X,j,re,z)};var F=(W,X,j,re)=>{if(j.Primitives&&j.Primitives.forEach(le=>{var se=1;le.Order&&(se=le.Order),I(W,X,le,se,re)}),j.Transformation&&W.setTransformation(j.Transformation),j.Children)for(var[z,H]of Object.entries(j.Children)){var K=W.findOrCreateChildFromPath(z);K&&F(K,X,H,re)}},V=(W,X)=>{var j,re,z=W,H=X==null||(j=X.enabled)===null||j===void 0?void 0:j.include,K=X==null||(re=X.enabled)===null||re===void 0?void 0:re.exclude;return(H!=null&&H.length||K!=null&&K.length)&&(H&&(z=W.filter(le=>{if(le.Type==="View")return!0;for(var se=0;se<H.length;se++)if(p(le.RegionPath,le.GroupName,H[se]))return!0;return!1})),K&&(z=z.filter(le=>{if(le.Type==="View")return!0;for(var se=0;se<K.length;se++)if(p(le.RegionPath,le.GroupName,K[se]))return!1;return!0}))),z},k=(W,X)=>Array.isArray(W)?V(W,X):W,G=(W,X)=>{if(Array.isArray(W)){for(var j=0,re=0;re<W.length;re++)W[re].Type&&(X&&W[re].Type==="View"||W[re].Type==="Surfaces"||W[re].Type==="Glyph"||W[re].Type==="Points"||W[re].Type==="Lines"||W[re].Type==="Texture")&&j++;return j}return 0},J=W=>{var X=W.Primitives?G(W.Primitives,!1):0;return W.Children&&Object.values(W.Children).forEach(j=>{X+=J(j)}),X},ne=W=>Array.isArray(W)?G(W,!0):typeof W=="object"&&W!==null&&W.Version==="2.0"?J(W.Regions):void 0,ae=(W,X,j,re,z)=>{var H=W;j.RegionPath&&j.RegionPath!==""&&(H=W.findOrCreateChildFromPath(j.RegionPath)),I(H,X,j,2*re,z)},ie=(W,X,j,re,z,H)=>{for(var K=k(X,H),le=ne(K),se=new O(le,re,z),U=0;U<X.length;U++)B(j,K[U],se);for(var D=0;D<X.length;D++)ae(W,j,K[D],D,se)},oe=(W,X,j,re,z)=>{var H=ne(X),K=new O(H,re,z);X.Settings&&this.loadSettings(X.Settings),X.Views&&T(j,X.Views),X.Regions&&F(W,j,X.Regions,K)};this.loadMetadataURL=(W,X,j,re,z)=>{var H=new XMLHttpRequest,K=f(X);H.onreadystatechange=()=>{if(H.readyState==4&&H.status==200){v.resetMetadata(),v.resetDuration(),g=!1;var le=H.responseURL;le===void 0&&(le=new URL(K).href);var se=JSON.parse(H.responseText);Array.isArray(se)?ie(W,se,le,j,re,z):typeof se=="object"&&se!==null&&se.Version=="2.0"&&oe(W,se,le,j,re)}},H.open("GET",K,!0),H.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(p){super(p)}load(p,y,m,d){var b=this,v=new c.FileLoader(this.manager);v.setPath(this.path),v.setResponseType("arraybuffer"),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(p,function(g){try{y(b.parse(g))}catch(w){d?d(w):console.error(w),b.manager.itemError(p)}},m,d)}parse(p){function y(d,b,v){for(var g=0,w=d.length;g<w;g++)if(d[g]!==b.getUint8(v+g,!1))return!1;return!0}var m=function(d){if(typeof d=="string"){for(var b=new Uint8Array(d.length),v=0;v<d.length;v++)b[v]=255&d.charCodeAt(v);return b.buffer||b}return d}(p);return function(d){var b=new DataView(d),v=b.getUint32(80,!0);if(84+v*50===b.byteLength)return!0;for(var g=[115,111,108,105,100],w=0;5>w;w++)if(y(g,b,w))return!1;return!0}(m)?function(d){for(var b,v,g,w,S,T,M,C,_=new DataView(d),P=_.getUint32(80,!0),E=!1,O=0;O<70;O++)_.getUint32(O,!1)==1129270351&&_.getUint8(O+4)==82&&_.getUint8(O+5)==61&&(E=!0,w=new Float32Array(3*(3*P)),S=_.getUint8(O+6)/255,T=_.getUint8(O+7)/255,M=_.getUint8(O+8)/255,C=_.getUint8(O+9)/255);for(var A=new c.BufferGeometry,L=new Float32Array(3*(3*P)),R=new Float32Array(3*(3*P)),N=0;N<P;N++){var x=84+N*50,I=_.getFloat32(x,!0),B=_.getFloat32(x+4,!0),F=_.getFloat32(x+8,!0);if(E){var V=_.getUint16(x+48,!0);32768&V?(b=S,v=T,g=M):(b=(31&V)/31,v=(31&V>>5)/31,g=(31&V>>10)/31)}for(var k=1;3>=k;k++){var G=x+12*k,J=3*(3*N)+3*(k-1);L[J]=_.getFloat32(G,!0),L[J+1]=_.getFloat32(G+4,!0),L[J+2]=_.getFloat32(G+8,!0),R[J]=I,R[J+1]=B,R[J+2]=F,E&&(w[J]=b,w[J+1]=v,w[J+2]=g)}}return A.setAttribute("position",new c.BufferAttribute(L,3)),A.setAttribute("normal",new c.BufferAttribute(R,3)),E&&(A.setAttribute("color",new c.BufferAttribute(w,3)),A.hasColors=!0,A.alpha=C),A}(m):function(d){for(var b,v=new c.BufferGeometry,g=/solid([\s\S]*?)endsolid/g,w=/facet([\s\S]*?)endfacet/g,S=0,T=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,M=new RegExp("vertex"+T+T+T,"g"),C=new RegExp("normal"+T+T+T,"g"),_=[],P=[],E=new c.Vector3,O=0,A=0,L=0;(b=g.exec(d))!==null;){A=L;for(var R=b[0];(b=w.exec(R))!==null;){for(var N=0,x=0,I=b[0];(b=C.exec(I))!==null;)E.x=parseFloat(b[1]),E.y=parseFloat(b[2]),E.z=parseFloat(b[3]),x++;for(;(b=M.exec(I))!==null;)_.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),P.push(E.x,E.y,E.z),N++,L++;x!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+S),N!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+S),S++}var B=A,F=L-A;v.addGroup(B,F,O),O++}return v.setAttribute("position",new c.Float32BufferAttribute(_,3)),v.setAttribute("normal",new c.Float32BufferAttribute(P,3)),v}(function(d){return typeof d=="string"?d:c.LoaderUtils.decodeText(new Uint8Array(d))}(p))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>S});var c=u(4),f=/^[og]\s*(.+)?/,h=/^mtllib /,p=/^usemtl /,y=/^usemap /,m=new c.Vector3,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;function w(){var T={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(C,_){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=C,void(this.object.fromDeclaration=_!==!1);var P=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:C||"",fromDeclaration:_!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(A,L){var R=this._finalize(!1);R&&(R.inherited||0>=R.groupCount)&&this.materials.splice(R.index,1);var N={index:this.materials.length,name:A||"",mtllib:Array.isArray(L)&&0<L.length?L[L.length-1]:"",smooth:R===void 0?this.smooth:R.smooth,groupStart:R===void 0?0:R.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(I){var B={index:typeof I=="number"?I:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return B.clone=this.clone.bind(B),B}};return this.materials.push(N),N},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(A){var L=this.currentMaterial();if(L&&L.groupEnd===-1&&(L.groupEnd=this.geometry.vertices.length/3,L.groupCount=L.groupEnd-L.groupStart,L.inherited=!1),A&&1<this.materials.length)for(var R=this.materials.length-1;0<=R;R--)0>=this.materials[R].groupCount&&this.materials.splice(R,1);return A&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),L}},P&&P.name&&typeof P.clone=="function"){var E=P.clone(0);E.inherited=!0,this.object.materials.push(E)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(C,_){var P=parseInt(C,10);return 3*(0<=P?P-1:P+_/3)},parseNormalIndex:function(C,_){var P=parseInt(C,10);return 3*(0<=P?P-1:P+_/3)},parseUVIndex:function(C,_){var P=parseInt(C,10);return 2*(0<=P?P-1:P+_/2)},addVertex:function(C,_,P){var E=this.vertices,O=this.object.geometry.vertices;O.push(E[C+0],E[C+1],E[C+2]),O.push(E[_+0],E[_+1],E[_+2]),O.push(E[P+0],E[P+1],E[P+2])},addVertexPoint:function(C){var _=this.vertices,P=this.object.geometry.vertices;P.push(_[C+0],_[C+1],_[C+2])},addVertexLine:function(C){var _=this.vertices,P=this.object.geometry.vertices;P.push(_[C+0],_[C+1],_[C+2])},addNormal:function(C,_,P){var E=this.normals,O=this.object.geometry.normals;O.push(E[C+0],E[C+1],E[C+2]),O.push(E[_+0],E[_+1],E[_+2]),O.push(E[P+0],E[P+1],E[P+2])},addFaceNormal:function(C,_,P){var E=this.vertices,O=this.object.geometry.normals;m.fromArray(E,C),d.fromArray(E,_),b.fromArray(E,P),g.subVectors(b,d),v.subVectors(m,d),g.cross(v),g.normalize(),O.push(g.x,g.y,g.z),O.push(g.x,g.y,g.z),O.push(g.x,g.y,g.z)},addColor:function(C,_,P){var E=this.colors,O=this.object.geometry.colors;E[C]!==void 0&&O.push(E[C+0],E[C+1],E[C+2]),E[_]!==void 0&&O.push(E[_+0],E[_+1],E[_+2]),E[P]!==void 0&&O.push(E[P+0],E[P+1],E[P+2])},addUV:function(C,_,P){var E=this.uvs,O=this.object.geometry.uvs;O.push(E[C+0],E[C+1]),O.push(E[_+0],E[_+1]),O.push(E[P+0],E[P+1])},addDefaultUV:function(){var C=this.object.geometry.uvs;C.push(0,0),C.push(0,0),C.push(0,0)},addUVLine:function(C){var _=this.uvs,P=this.object.geometry.uvs;P.push(_[C+0],_[C+1])},addFace:function(C,_,P,E,O,A,L,R,N){var x=this.vertices.length,I=this.parseVertexIndex(C,x),B=this.parseVertexIndex(_,x),F=this.parseVertexIndex(P,x);if(this.addVertex(I,B,F),this.addColor(I,B,F),L!==void 0&&L!==""){var V=this.normals.length;I=this.parseNormalIndex(L,V),B=this.parseNormalIndex(R,V),F=this.parseNormalIndex(N,V),this.addNormal(I,B,F)}else this.addFaceNormal(I,B,F);if(E!==void 0&&E!==""){var k=this.uvs.length;I=this.parseUVIndex(E,k),B=this.parseUVIndex(O,k),F=this.parseUVIndex(A,k),this.addUV(I,B,F),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(C){this.object.geometry.type="Points";for(var _,P=this.vertices.length,E=0,O=C.length;E<O;E++)_=this.parseVertexIndex(C[E],P),this.addVertexPoint(_),this.addColor(_)},addLineGeometry:function(C,_){this.object.geometry.type="Line";for(var P=this.vertices.length,E=this.uvs.length,O=0,A=C.length;O<A;O++)this.addVertexLine(this.parseVertexIndex(C[O],P));for(var L=0,R=_.length;L<R;L++)this.addUVLine(this.parseUVIndex(_[L],E))}};return T.startObject("",!1),T}class S extends c.Loader{constructor(M){super(M),this.materials=null}load(M,C,_,P){var E=this,O=new c.FileLoader(this.manager);O.setPath(this.path),O.setRequestHeader(this.requestHeader),O.setWithCredentials(this.withCredentials),O.load(M,function(A){try{C(E.parse(A))}catch(L){P?P(L):console.error(L),E.manager.itemError(M)}},_,P)}setMaterials(M){return this.materials=M,this}parse(M){var C=new w;M.indexOf(`\r
3230
+ `,y=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new c.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0},discardAlpha:{value:!0}}};l.fs=h,l.vs=p,l.glslVersion=f,l.getUniforms=y},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(h){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=h,this.load=(p,y)=>{if(p&&p.images&&p.images.source){var m=new(u(25)).TextureArray,d=[];p.images.source.forEach(v=>{d.push(c(v))});var b=this;m.loadFromImages(d).then(()=>{b.texture=m,b.initialise(p,y)})}},this.initialise=(p,y)=>{y!=null&&typeof y=="function"&&y(this)}};f.prototype=Object.create(u(10).ZincObject.prototype),f.prototype.constructor=f,l.TexturePrimitive=f},(o,l,u)=>{var c=u(4),f=u(31);l.Renderer=function(h){var p=h,y=void 0,m=void 0,d=new c.Clock(!1);this.playAnimation=!0;var b=1e3,v=[],g=0,w=[],S=0,T=void 0,M=void 0,C=void 0,_=void 0,P=[],E=[],O=new c.Group,A=void 0,L=void 0,R=!1;this.getDrawingWidth=()=>p?p.clientWidth:A?typeof A.clientWidth>"u"?Math.round(A.width):Math.round(A.clientWidth):0,this.getDrawingHeight=()=>p?p.clientHeight:A?typeof A.clientHeight>"u"?Math.round(A.height):Math.round(A.clientHeight):0,this.onWindowResize=()=>{m.onWindowResize();var I=this.getDrawingWidth(),B=this.getDrawingHeight();if(y!=null){var F;p?(F=p.getBoundingClientRect(),y.setSize(I,B)):A&&(typeof A.getBoundingClientRect>"u"||(F=A.getBoundingClientRect(),A.width=I,A.height=B),y.setSize(I,B,!1)),F&&(F.left,F.top);var V=new c.Vector2;y.getSize(V),V.x,V.y}},this.initialiseVisualisation=I=>{if(I=I||{},I.antialias===void 0){var B=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(B=!0)}catch{B=!1}I.antialias=!B}I.canvas&&(p=void 0,A=I.canvas),y=new c.WebGLRenderer(I),p!==void 0&&p.appendChild(y.domElement),y.setClearColor(16777215,1),A&&A.style&&(A.style.height="100%",A.style.width="100%"),y.autoClear=!1;var F=this.createScene("default");this.setCurrentScene(F)},this.getCurrentScene=()=>m,this.setCurrentScene=I=>{if(I){this.removeActiveScene(I);var B=m;m=I,B&&B.setInteractiveControlEnable(!1),m.setInteractiveControlEnable(!0),m.setAdditionalScenesGroup(O),this.onWindowResize()}},this.getSceneByName=I=>P[I],this.createScene=I=>{if(P[I]==null){var B;return B=A?new(u(32)).Scene(A,y):new(u(32)).Scene(p,y),P[I]=B,B.sceneName=I,B}},this.resetView=()=>{m.resetView()},this.viewAll=()=>{if(m){var I=m.getBoundingBox();if(I){for(var B,F=0;F<E.length;F++)B=E[F].getBoundingBox(),B&&I.union(B);m.viewAllWithBoundingBox(I)}}},this.loadModelsURL=(I,B,F,V,k,G)=>{m.loadModelsURL(I,B,F,V,k,G)},this.loadViewURL=I=>{m.loadViewURL(I)},this.loadFromViewURL=(I,B)=>{m.loadFromViewURL(I,B)},this.updateDirectionalLight=()=>{m.updateDirectionalLight()};var N=()=>{R?(T=requestAnimationFrame(N),this.render()):(cancelAnimationFrame(T),T=void 0)};this.stopAnimate=()=>{R&&(d.stop(),R=!1)},this.animate=()=>{R||(d.start(),R=!0,N())},this.addPreRenderCallbackFunction=I=>(++g,v[g]=I,g),this.removePreRenderCallbackFunction=I=>{I in v&&delete v[I]},this.addPostRenderCallbackFunction=I=>(++S,w[S]=I,S),this.removePostRenderCallbackFunction=I=>{I in w&&delete w[I]},this.getPlayRate=()=>b,this.setPlayRate=I=>{b=I},this.getCurrentTime=()=>m.getCurrentTime(),this.setMorphsTime=I=>{m.setMorphsTime(I)},this.getZincGeometryByID=I=>m.getZincGeometryByID(I),this.addToScene=I=>{m.addObject(I)},this.addToOrthoScene=I=>{if(C==null&&(C=new c.Scene),M==null){var B=this.getDrawingWidth(),F=this.getDrawingHeight();M=new c.OrthographicCamera(-B/2,B/2,F/2,-F/2,1,10),M.position.z=10}C.add(I)};var x=I=>B=>{B.needsUpdate=!0;var F=new c.SpriteMaterial({map:B}),V=F.map.image.width,k=F.map.image.height;I.material=F,I.scale.set(V,k,1);var G=this.getDrawingWidth(),J=this.getDrawingHeight();I.position.set((G-V)/2,(-J+k)/2,1),this.addToOrthoScene(I)};this.addLogo=()=>{_=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,x(_))},this.render=()=>{L||(p?0<p.clientWidth&&0<p.clientHeight&&(L=new f(p,this.onWindowResize)):A&&0<A.width&&0<A.height&&(L=new f(A,this.onWindowResize)));var I=d.getDelta();m.renderGeometries(b,I,this.playAnimation);for(var B,F=0;F<E.length;F++)B=E[F],B.renderGeometries(b,I,this.playAnimation);for(var V in M!=null&&C!=null&&(y.clearDepth(),y.render(C,M)),v)v.hasOwnProperty(V)&&v[V].call();for(var k in m.render(y),w)w.hasOwnProperty(k)&&w[k].call()},this.getThreeJSRenderer=()=>y,this.isSceneActive=I=>{if(m===I)return!0;for(var B,F=0;F<E.length;F++)if(B=E[F],B===I)return!0;return!1},this.addActiveScene=I=>{this.isSceneActive(I)||(E.push(I),O.add(I.getThreeJSScene()))},this.removeActiveScene=I=>{for(var B,F=0;F<E.length;F++)if(B=E[F],B===I)return E.splice(F,1),void O.remove(I.getThreeJSScene())},this.clearAllActiveScene=()=>{for(var I=0;I<E.length;I++)O.remove(E[I].getThreeJSScene());E.splice(0,E.length)},this.dispose=()=>{for(var I in R&&cancelAnimationFrame(T),P)P.hasOwnProperty(I)&&P[I].clearAll();P=[],E=[],O=new c.Group,this.stopAnimate(),v=[],g=0,M=void 0,C=void 0,_=void 0;var B=this.createScene("default");this.setCurrentScene(B),L=void 0},this.transitionScene=(I,B)=>{if(m){var F=m.getZincCameraControls(),V=I.getBoundingBox();if(V){var k=V.min.distanceTo(V.max)/2,G=(V.min.x+V.max.x)/2,J=(V.min.y+V.max.y)/2,ne=(V.min.z+V.max.z)/2,ae=F.getViewportFromCentreAndRadius(G,J,ne,k,40,k*4),ie=F.getCurrentViewport();F.cameraTransition(ie,ae,B),F.enableCameraTransition()}}},this.isWebGL2=()=>!!y&&y.capabilities.isWebGL2}},o=>{o.exports=QD()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,h=u(35).SceneLoader,p=u(41).SceneExporter,y=u(43).Viewport,m=u(5).createBufferGeometry,d=u(5).getCircularTexture,b=u(5).createNewSpriteText,v=0,g=function(){return"sc"+v++},w=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},S=6e3;l.Scene=function(T,M){var C=this,_=T,P=void 0,E=new h(this),O=void 0,A={},L=0,R={},N=0,x=new c.Scene,I=new c.Scene,B=new(u(44)).Region(void 0,this);x.add(B.getGroup());var F=new c.Group;x.add(F),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var V=6e3,k=void 0;this.sceneName=void 0;var G=!1,J=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.displayMiniAxes=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-right",updateRequired:!0};var ne={x:0,y:0},ae=w(),ie=new c.Vector2,oe=[];this.forcePickableObjectsUpdate=!1,this.uuid=g();var W=new f(this);W.disable(),x.add(W.group);var Z={main:[],mini:[]},j=new c.Vector3(0,0,0),re=()=>_?typeof _.clientWidth>"u"?_.width:_.clientWidth:0,z=()=>_?typeof _.clientHeight>"u"?_.height:_.clientHeight:0;this.getDownloadProgress=()=>E.getDownloadProgress(),this.onWindowResize=()=>{var D=z();this.camera.aspect=re()/D,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,k.onResize(),k.calculateHeightPerPixelAtZeroDepth(D)},this.resetView=()=>{this.onWindowResize(),k.resetView()},this.changeZoomByScrollRateUnit=D=>{k.changeZoomByScrollRateUnit(D)};var H=()=>{this.camera=new c.PerspectiveCamera(40,re()/z(),0,10),this.ambient=new c.AmbientLight(16777215,.2),x.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),x.add(this.directionalLight),k=new(u(43)).CameraControls(this.camera,M.domElement,M,this),k.setDirectionalLight(this.directionalLight),k.resetView(),O=new(u(49)).Minimap(this)};H(),this.loadView=D=>{var $=new y;return $.setFromObject(D),k.setCurrentCameraSettings($),!0},this.setupMultipleViews=(D,$)=>{for(var[Y,ee]of Object.entries($)){var ce=new y;ce.setFromObject(ee),k.addViewport(Y,ce)}k.setDefaultViewport(D)},this.getBoundingBox=()=>B.getBoundingBox(!0),this.viewAllWithBoundingBox=D=>{if(D){var $=k.getViewportFromBoundingBox(D,1);k.setCurrentCameraSettings($),k.calculateHeightPerPixelAtZeroDepth(z()),W.markerUpdateRequired=!0}},this.viewAll=()=>{var D=this.getBoundingBox();this.viewAllWithBoundingBox(D),W.markerUpdateRequired=!0},this.forEachGeometry=D=>{B.forEachGeometry(D,!0)},this.forEachGlyphset=D=>{B.forEachGlyphset(D,!0)},this.forEachPointset=D=>{B.forEachPointset(D,!0)},this.forEachLine=D=>{B.forEachLine(D,!0)},this.findGeometriesWithGroupName=D=>B.findGeometriesWithGroupName(D,!0),this.findPointsetsWithGroupName=D=>B.findPointsetsWithGroupName(D,!0),this.findGlyphsetsWithGroupName=D=>B.findGlyphsetsWithGroupName(D,!0),this.findLinesWithGroupName=D=>B.findLinesWithGroupName(D,!0),this.findObjectsWithGroupName=D=>B.findObjectsWithGroupName(D,!0),this.findObjectsWithAnatomicalId=D=>B.findObjectsWithAnatomicalId(D,!0),this.getBoundingBoxOfZincObjects=D=>{for(var $,Y=void 0,ee=0;ee<D.length;ee++)$=D[ee].getBoundingBox(),$&&(Y?Y.union($):Y=$);return Y},this.vectorToScreenXY=D=>{D.project(this.camera);var $=re(),Y=z(),ee=$/2,ce=Y/2;return D.x=D.x*ee+ee,D.y=-(D.y*ce)+ce,D},this.getObjectsScreenXY=D=>{if(D&&0<D.length){var $=this.getBoundingBoxOfZincObjects(D),Y=new c.Vector3;return $.getCenter(Y),this.vectorToScreenXY(Y)}},this.getNamedObjectsScreenXY=D=>{var $=this.findObjectsWithGroupName(D);return this.getObjectsScreenXY($)},this.addZincObject=D=>{D&&(B.addZincObject(D),k&&k.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(D,$,Y,ee)=>{E.loadGlyphsetURL(B,D,$,Y,ee)},this.loadPointsetURL=(D,$,Y,ee,ce)=>{E.loadPointsetURL(B,D,$,Y,ee,ce)},this.loadLinesURL=(D,$,Y,ee,ce)=>{E.loadLinesURL(B,D,$,Y,ee,ce)},this.loadSTL=(D,$,Y)=>{E.loadSTL(B,D,$,Y)},this.loadOBJ=(D,$,Y)=>{E.loadOBJ(B,D,$,Y)},this.loadMetadataURL=(D,$,Y,ee)=>{E.loadMetadataURL(B,D,$,Y,ee)},this.loadModelsURL=(D,$,Y,ee,ce,ve)=>{E.loadModelsURL(B.urls,$,Y,ee,ce,ve)},this.loadViewURL=D=>{E.loadViewURL(D)},this.loadFromViewURL=(D,$)=>{E.loadFromViewURL(D,$)},this.loadGLTF=(D,$,Y,ee)=>{E.loadGLTF(B,D,$,Y,ee)},this.updateDirectionalLight=()=>{k.updateDirectionalLight()},this.addObject=D=>{x.add(D)},this.removeObject=D=>{x.remove(D)},this.getCurrentTime=()=>{if(P!=null)return P.getCurrentTime(V);var D=B.getCurrentTime();return D===-1?0:D},this.setMorphsTime=D=>{P!=null&&P.setMorphTime(D,V),B.setMorphTime(D,!0)},this.isTimeVarying=()=>!!(P&&P.video&&!P.video.error)||B.isTimeVarying(),this.renderGeometries=(D,$,Y)=>{var ee={};if(ee.camera=k,ee.displayMarkers=this.displayMarkers,ee.markerCluster=W,ee.markersList=W.markers,ee.ndcToBeUpdated=!1,Y&&(ee.markerCluster.markerUpdateRequired=!0),!P)E.toBeDownloaded==0?(ee.ndcToBeUpdated=k.update($),ee.ndcToBeUpdated&&k.calculateHeightPerPixelAtZeroDepth(z()),B.renderGeometries(D,$,Y,k,ee,!0)):k.update(0);else if(P.isReadyToPlay()){Y?P.video.play():P.video.pause();var ce=P.video.currentTime/P.getVideoDuration()*V;E.toBeDownloaded==0?(k.setTime(ce),ee.ndcToBeUpdated=k.update(0),ee.ndcToBeUpdated&&k.calculateHeightPerPixelAtZeroDepth(z()),B.setMorphTime(ce,!0),B.renderGeometries(0,0,Y,k,ee,!0)):k.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>x,this.setVideoHandler=D=>{P||(P=D)},this.setAdditionalScenesGroup=D=>{x.add(D)};var K=(D,$,Y,ee,ce,ve,be)=>{var ue=0,me=0;return me=D.includes("top")?be-ce-Y:D.includes("bottom")?Y:Math.floor((be-ce)/2),ue=D.includes("left")?$:D.includes("right")?ve-$-ee:Math.floor((ve-ee)/2),{x:ue,y:me}},le=D=>{(this.displayMinimap||this.displayMiniAxes)&&(D.setScissorTest(!0),D.getSize(ie),this.minimapScissor.updateRequired&&(ne=K(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,ie.x,ie.y),this.minimapScissor.updateRequired=!1),D.setScissor(ne.x,ne.y,this.minimapScissor.width,this.minimapScissor.height),D.setViewport(ne.x,ne.y,this.minimapScissor.width,this.minimapScissor.height),O.updateCamera(),this.displayMiniAxes?D.render(I,O.camera):(x.add(O.mask),D.render(x,O.camera),x.remove(O.mask)),D.setScissorTest(!1),D.setViewport(0,0,ie.x,ie.y))};this.render=D=>{this.autoClearFlag&&D.clear(),G&&J?J.render(x,this.camera):(D.render(x,this.camera),le(D))},this.setInteractiveControlEnable=D=>{D==!0?k.enable():k.disable()},this.getZincCameraControls=()=>k,this.getThreeJSScene=()=>x,this.setDuration=D=>{B.setDuration(D),V=D,k.setPathDuration(D),E.duration=D},this.getDuration=()=>V,this.setStereoEffectEnable=D=>{D!=!0||J||(J=new u(43).StereoEffect(M)),M.setSize(re(),z()),this.camera.updateProjectionMatrix(),G=D},this.objectIsInScene=D=>B.objectIsInRegion(D,!0),this.alignBoundingBoxToCameraView=(D,$)=>{if(D){D.getCenter(j);var Y=this.getZincCameraControls().getCurrentViewport(),ee=new c.Vector3(Y.targetPosition[0],Y.targetPosition[1],Y.targetPosition[2]),ce=new c.Vector3(Y.eyePosition[0],Y.eyePosition[1],Y.eyePosition[2]),ve=new c.Vector3,be=new c.Vector3;ve.subVectors(ee,ce).normalize(),be.subVectors(ee,j).normalize();var ue=new c.Vector3;ue.crossVectors(ve,be);var me=ve.angleTo(be);0<$?(this.getZincCameraControls().rotateCameraTransition(ue,me,$),this.getZincCameraControls().enableCameraTransition()):this.getZincCameraControls().rotateAboutLookAtpoint(ue,me),W.markerUpdateRequired=!0}},this.translateBoundingBoxToCameraView=(D,$,Y)=>{if(D){var ee=this.getZincCameraControls().getCurrentViewport(),ce=this.getZincCameraControls().getViewportFromBoundingBox(D,$);0<Y&&(this.getZincCameraControls().cameraTransition(ee,ce,Y),this.getZincCameraControls().enableCameraTransition()),W.markerUpdateRequired=!0}},this.alignObjectToCameraView=(D,$)=>{if(this.objectIsInScene(D)){var Y=D.getBoundingBox();this.alignBoundingBoxToCameraView(Y,$)}},this.setCameraTargetToObject=D=>{if(this.objectIsInScene(D)){var $=D.getBoundingBox(),Y=this.getZincCameraControls().getCurrentViewport();$.getCenter(j);var ee=new c.Vector3(Y.targetPosition[0],Y.targetPosition[1],Y.targetPosition[2]),ce=new c.Vector3(Y.eyePosition[0],Y.eyePosition[1],Y.eyePosition[2]),ve=new c.Vector3,be=new c.Vector3;ve.subVectors(ce,ee),be.addVectors(j,ve),Y.eyePosition[0]=be.x,Y.eyePosition[1]=be.y,Y.eyePosition[2]=be.z,Y.targetPosition[0]=j.x,Y.targetPosition[1]=j.y,Y.targetPosition[2]=j.z,this.getZincCameraControls().setCurrentCameraSettings(Y),W.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>G,this.removeZincObject=D=>{B.removeZincObject(D),k&&k.calculateMaxAllowedDistance(this),W.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{oe.length=0,W.isEnabled&&oe.push(W.group),B.getPickableThreeJSObjects(oe,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||B.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),oe),this.getNormalisedMinimapCoordinates=(D,$)=>{if(this.displayMinimap){var Y=new c.Vector2;D.getSize(Y);var ee=Y.y-$.clientY;if(ne.x+this.minimapScissor.width>$.clientX&&$.clientX>ne.x&&ne.y+this.minimapScissor.height>ee&&ee>ne.y){var ce=2*(($.clientX-ne.x)/this.minimapScissor.width)-1,ve=2*((ee-ne.y)/this.minimapScissor.height)-1;return{x:ce,y:ve}}}},this.getMinimapDiffFromNormalised=(D,$)=>O?O.getDiffFromNormalised(D,$):void 0,this.isWebGL2=()=>M.isWebGL2(),this.clearAll=()=>{W.clear(),B.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),E.toBeDwonloaded=0,k&&k.calculateMaxAllowedDistance(this),W.markerUpdateRequired=!0},this.addMetadataTimeStamp=(D,$)=>{ae.TimeStamps[D]=U($)},this.getMetadataTag=D=>ae[D],this.getMetadata=()=>ae,this.setMetadataTag=(D,$)=>{ae[D]=$},this.removeMetadataTag=D=>{delete ae[D]},this.resetMetadata=()=>{ae=w()},this.resetDuration=()=>{this.setDuration(S)};var se=D=>[...D.years?["".concat(D.years,"years")]:[],...D.months?["".concat(D.months,"months")]:[],...D.weeks?["".concat(D.weeks,"weeks")]:[],...D.days?["".concat(D.days,"days")]:[],...D.hours?["".concat(D.hours,"hours")]:[],...D.mins?["".concat(D.mins,"mins")]:[],...D.secs?["".concat(D.secs,"secs")]:[]].join(" "),U=D=>D.years?31536e6*D.years:0+D.months?2592e6*D.months:0+D.weeks?6048e5*D.weeks:0+D.days?864e5*D.days:0+D.hours?36e5*D.hours:0+D.mins?6e4*D.mins:0+D.secs?1e3*D.secs:0;this.setDurationFromObject=D=>{var $=se(D),Y=U(D);this.setMetadataTag("Duration",$),this.setDuration(Y)},this.setOriginalDurationFromObject=D=>{var $=se(D);this.setMetadataTag("OriginalDuration",$)},this.exportGLTF=D=>{var $=new p(this);return $.exportGLTF(D)},this.getRootRegion=()=>B,this.createLines=(D,$,Y,ee)=>{var ce=B.findChildFromPath(D);return ce===void 0&&(ce=B.createChildFromPath(D)),ce.createLines($,Y,ee)},this.createPoints=(D,$,Y,ee,ce)=>{var ve=B.findChildFromPath(D);return ve===void 0&&(ve=B.createChildFromPath(D)),ve.createPoints($,Y,ee,ce)},this.addZincObjectAddedCallbacks=D=>(++L,A[L]=D,L),this.addZincObjectRemovedCallbacks=D=>(++N,R[N]=D,N),this.removeZincObjectAddedCallbacks=D=>{D in L&&delete A[D]},this.removeZincObjectRemovedCallbacks=D=>{D in N&&delete R[D]},this.clearZincObjectAddedCallbacks=()=>{A={},L=0},this.clearZincObjectRemovedCallbacks=()=>{R={},N=0},this.triggerObjectAddedCallback=D=>{for(var $ in A)A.hasOwnProperty($)&&A[$](D)},this.triggerObjectRemovedCallback=D=>{for(var $ in R)R.hasOwnProperty($)&&R[$](D)},this.addTemporaryPoints=(D,$)=>{var Y=m(D.length,D),ee=new c.PointsMaterial({alphaTest:.5,size:15,color:$,sizeAttenuation:!1}),ce=d();ee.map=ce;var ve=new(u(23)).Points(Y,ee);return F.add(ve),ve},this.addTemporaryLines=(D,$)=>{var Y=m(D.length,D),ee=new c.LineBasicMaterial({color:$}),ce=new(u(12)).LineSegments(Y,ee);return F.add(ce),ce},this.removeTemporaryPrimitive=D=>{F.remove(D),D.geometry.dispose(),D.material.dispose()},this.clearTemporaryPrimitives=()=>{var D=0,$=F.children;return $.forEach(Y=>{Y.geometry.dispose(),Y.material.dispose(),D++}),F.clear(),D},this.addBoundingBoxPrimitive=function(D,$,Y,ee,ce){var ve=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0,be=B.findChildFromPath(D);be===void 0&&(be=B.createChildFromPath(D));var ue=ve||C.getBoundingBox();j.set(0,0,0);var me=j.subVectors(ue.max,ue.min),te=new c.BoxGeometry(me.x,me.y,me.z),he=be.createGeometryFromThreeJSGeometry($,te,Y,ee,ce,1e4);return me.addVectors(ue.min,ue.max).multiplyScalar(.5),he.setPosition(me.x,me.y,me.z),he},this.addSlicesPrimitive=function(D,$,Y,ee,ce){var ve=5<arguments.length&&arguments[5]!==void 0?arguments[5]:void 0;if($&&3<=$.length&&Y&&3<=Y.length){var be=B.findChildFromPath(D);be===void 0&&(be=B.createChildFromPath(D));var ue=ve||C.getBoundingBox();j.set(0,0,0);var me=j.subVectors(ue.max,ue.min),te=[],he=0;return["x","y","z"].forEach(ge=>{var Ae;switch(ge){case"x":Ae=new c.PlaneGeometry(me.z,me.y),Ae.rotateY(Math.PI/2);break;case"y":Ae=new c.PlaneGeometry(me.x,me.z),Ae.rotateX(Math.PI/2);break;case"z":Ae=new c.PlaneGeometry(me.x,me.y);break}var Te=be.createGeometryFromThreeJSGeometry($[he],Ae,Y[he],ee,ce,10001);te.push(Te),he++}),me.addVectors(ue.min,ue.max).multiplyScalar(.5),te.forEach(ge=>{ge.setPosition(me.x,me.y,me.z)}),te}},this.enableMarkerCluster=D=>{D?(W.markerUpdateRequired=!0,W.enable()):(W.markerUpdateRequired=!1,W.disable()),this.forcePickableObjectsUpdate=!0},this.destroyAxisDisplay=()=>{this.displayMiniAxes=!1,Z.main&&(this.enableAxisDisplay(!1,!1),Z.main.forEach(D=>{D.dispose&&D.dispose()})),Z.mini&&(this.enableAxisDisplay(!1,!0),Z.mini.forEach(D=>{D.dispose&&D.dispose()})),Z={main:[],mini:[]}},this.createAxisDisplay=function(){var D=0<arguments.length&&arguments[0]!==void 0&&arguments[0];C.destroyAxisDisplay();var $=[{name:"x",dir:new c.Vector3(1,0,0),colour:"red",hex:16733525},{name:"y",dir:new c.Vector3(0,1,0),colour:"green",hex:5635925},{name:"z",dir:new c.Vector3(0,0,1),colour:"blue",hex:5592575}],Y=C.getBoundingBox(),ee=Y.min.distanceTo(Y.max),ce=new c.Vector3(0,0,0);D&&ce.copy(Y.min),$.forEach(ve=>{var be=new c.ArrowHelper(ve.dir,ce,ee,ve.hex);Z.main.push(be);var ue=new c.ArrowHelper(ve.dir,Y.getCenter(j),ee/2,ve.hex);Z.mini.push(ue);var me=b(ve.name,.036,ve.colour,"Asap",120,700),te=ve.dir.clone().multiplyScalar(ee).add(ce);me.position.set(te.x,te.y,te.z),Z.main.push(me)})},this.enableAxisDisplay=function(D){var $,Y=1<arguments.length&&arguments[1]!==void 0&&arguments[1];Y&&($=Z)!==null&&$!==void 0&&($=$.mini)!==null&&$!==void 0&&$.length?(C.displayMiniAxes=D,Z.mini.forEach(ee=>{D?I.add(ee):I.remove(ee)})):!Y&&Z.main&&Z.main.forEach(ee=>{D?x.add(ee):x.remove(ee)})}}},(o,l,u)=>{function c(T,M){var C=Object.keys(T);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(T);M&&(_=_.filter(function(P){return Object.getOwnPropertyDescriptor(T,P).enumerable})),C.push.apply(C,_)}return C}function f(T){for(var M,C=1;C<arguments.length;C++)M=arguments[C]==null?{}:arguments[C],C%2?c(Object(M),!0).forEach(function(_){h(T,_,M[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(M)):c(Object(M)).forEach(function(_){Object.defineProperty(T,_,Object.getOwnPropertyDescriptor(M,_))});return T}function h(T,M,C){return M=p(M),M in T?Object.defineProperty(T,M,{value:C,enumerable:!0,configurable:!0,writable:!0}):T[M]=C,T}function p(T){var M=y(T,"string");return typeof M=="symbol"?M:M+""}function y(T,M){if(typeof T!="object"||!T)return T;var C=T[Symbol.toPrimitive];if(C!==void 0){var _=C.call(T,M||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(M==="string"?String:Number)(T)}var m=u(4),d=new Image(128,128);d.src=u(34);var b=new m.Texture;b.image=d,b.needsUpdate=!0;var v=[.02,.03,1],g=new m.SpriteMaterial({map:b,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),w=u(5).createNewSpriteText,S=function(T){u(10).ZincObject.call(this),this.texture=b;var M=void 0;this.morph=new m.Group,this.group=this.morph,this.isMarkerCluster=!0;var C=!0,_=[];this.markers={};var P=new m.Vector2,E=new m.Vector2,O=Date.now();this.setSpriteSize=x=>{M.scale.set(.015,.02,1),M.scale.multiplyScalar(x)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var A=x=>{var I=new m.Group,B=new m.Sprite(g);return B.clusterIndex=x,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(v[0],v[1],v[2]),B.userData=this,I.add(B),this.group.add(I),{group:I,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},L=(x,I,B)=>{x.group.visible=!0,x.group.position.set(I.coords[0],I.coords[1],I.coords[2]),(x.label===void 0||B!==x.number)&&(x.label&&(x.group.remove(x.label),x.label.material.map.dispose(),x.label.material.dispose()),x.label=w(B,.012,"black","Asap",120,700),x.number=B,x.group.add(x.label)),x.min=I.min,x.max=I.max},R=x=>{var I=0;for(x.forEach(B=>{var F=B.members.length,V=0;F===1?B.members[0].setVisibility(!0):(B.members.forEach(k=>{V+=k.getNumber(),k.setVisibility(!1)}),!_[I]&&_.push(A(I)),L(_[I],B,V),I++)}),I;I<_.length;I++)_[I].group.visible=!1},N=(x,I)=>{var B=!0,F={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},V=0;for(var k in x)B?(P.set(x[k].ndc.x,x[k].ndc.y),this._b1.setFromPoints([x[k].morph.position]),B=!1,F.members.push(x[k]),F.coords=[x[k].morph.position.x,x[k].morph.position.y,x[k].morph.position.z],I.push(F),delete x[k]):(E.set(x[k].ndc.x,x[k].ndc.y),V=P.distanceTo(E),.1>V&&(F.members.push(x[k]),this._b1.expandByPoint(x[k].morph.position),delete x[k]));F.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],F.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],B!=!0&&N(x,I)};this.calculate=()=>{if(C){var x=Date.now();if(500<x-O){var I=[];N(f({},this.markers),I),R(I),O=Date.now(),this.markerUpdateRequired=!1}}},this.isEnabled=()=>C,this.enable=()=>{C=!0,this.morph.visible=!0},this.disable=()=>{for(var x in C=!1,this.morph.visible=!1,this.markers){var I;(I=this.markers[x])!==null&&I!==void 0&&I.isMarker&&this.markers[x].isEnabled()&&this.markers[x].setVisibility(!0)}},this.zoomToCluster=x=>!!(x!==void 0&&-1<x&&(this._v1.set(..._[x].min),this._v2.set(..._[x].max),Math.abs(0<this._v1.distanceTo(this._v2))))&&(this._b1.set(this._v1,this._v2),T.translateBoundingBoxToCameraView(this._b1,3,300),this.markerUpdateRequired=!0,!0),this.clusterIsVisible=x=>{if(x!==void 0&&-1<x&&_[x]){var I;return(I=_[x].group)===null||I===void 0?void 0:I.visible}return!1}};S.prototype=Object.create(u(10).ZincObject.prototype),l.MarkerCluster=S},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=u(5).createNewURL,p=u(5).isRegionGroup,y=u(36).STLLoader,m=u(37).OBJLoader,d=u(38).PrimitivesLoader;l.SceneLoader=function(b){var v=b;this.toBeDownloaded=0,this.progressMap={};var g=!1,w=!1,S=new d;this.getDownloadProgress=()=>{var W=0,Z=0,j=!1;for(var re in this.progressMap){var z=this.progressMap[re];W+=z[1],Z+=z[0],z[1]==0&&(j=!0)}return j&&(W=0),[W,Z,w]},this.onProgress=W=>Z=>{this.progressMap[W]=[Z.loaded,Z.total]},this.onError=W=>Z=>{--this.toBeDownloaded,w=!0,console.error("There is an issue with external resource ".concat(Z!=null&&Z.responseURL?": "+(Z==null?void 0:Z.responseURL):"",".")),W&&W({type:"Error",xhr:Z})};var T=(W,Z)=>{var j=Z.Default;if(Z.Inline)v.setupMultipleViews(j,Z.Entries);else{var re=[],z=function(se){W&&(newURL=h(K,W),re.push(new Promise((U,D)=>{fetch(newURL).then($=>$.json()).then($=>U({key:se,data:$})).catch($=>D($))})))};for(var[H,K]of Object.entries(Z.Entries))z(H);Promise.all(re).then(le=>{var se={};le.forEach(D=>{se[D.key]=D.data}),v.setupMultipleViews(j,se);var U=v.getZincCameraControls();U&&U.setCurrentViewport(j),g=!0})}};this.loadViewURL=(W,Z)=>{this.toBeDownloaded+=1;var j=new XMLHttpRequest;j.onreadystatechange=()=>{if(j.readyState==4)if(j.status==200){var z=JSON.parse(j.responseText);v.setupMultipleViews("default",{default:z}),v.resetView(),g=!0,--this.toBeDownloaded,Z!=null&&typeof Z=="function"&&Z()}else this.onError(Z)({responseURL:W})};var re=f(W);j.open("GET",re,!0),j.send()},this.loadModelsURL=(W,Z,j,re,z,H,K)=>{var le=Z.length;this.toBeDownloaded+=le;for(var se=0;se<le;se++){var U=Z[se],D=u(0).defaultMaterialColor,$=u(0).defaultOpacity;j!=null&&j[se]!=null&&(D=!!j[se]),re!=null&&re[se]!=null&&($=re[se]);var Y=0;z!=null&&z[se]!=null&&(Y=!!z[se]);var ee=0;H!=null&&H[se]!=null&&(ee=!!H[se]),S.load(f(U),N(W,D,$,Y,ee,void 0,void 0,void 0,void 0,K),this.onProgress(U),this.onError(K))}},this.loadFromViewURL=(W,Z,j)=>{var re=new XMLHttpRequest;re.onreadystatechange=()=>{if(re.readyState==4&&re.status==200){var H=JSON.parse(re.responseText);v.loadView(H);for(var K,le=[],se=Z+"_",U=0;U<H.numberOfResources;U++)K=se+(U+1)+".json",le.push(K);this.loadModelsURL(W,le,H.colour,H.opacity,H.timeEnabled,H.morphColour,j)}};var z=f(Z+"_view.json");re.open("GET",z,!0),re.send()};var M=(W,Z,j,re,z,H,K,le)=>(se,U)=>{var D=new(u(24)).Lines,$=void 0;U&&U[0]&&($=new c.LineBasicMaterial({color:U[0].color.clone()}),1>U[0].opacity&&($.transparent=!0),$.opacity=U[0].opacity,$.morphTargets=Z,$.vertexColors=U[0].vertexColors);var Y={localTimeEnabled:Z,localMorphColour:j};if(D&&(D.createLineSegment(se,$,Y),D.setName(re),D.anatomicalId=z,D.setRenderOrder(H),W.addZincObject(D),D.setDuration(v.getDuration()),K&&K.levels))for(var[ee,ce]of Object.entries(K.levels))D.addLOD(S,ee,ce.URL,ce.Index,K.preload);--this.toBeDownloaded,se.dispose(),le!=null&&typeof le=="function"&&le(D)};this.loadLinesURL=(W,Z,j,re,z,H,K)=>{var le=0;this.toBeDownloaded+=1;var se=!!(K&&K.isInline)&&K.isInline,U=K&&K.anatomicalId?K.anatomicalId:void 0,D=K&&K.renderOrder?K.renderOrder:void 0;j!=null&&(le=!!j);var $=0;if(re!=null&&($=!!re),se){var Y=S.parse(Z);M(W,le,$,z,U,D,K.lod,H)(Y.geometry,Y.materials)}else S.load(Z,M(W,le,$,z,U,D,K.lod,H),this.onProgress(Z),this.onError(H),K.loaderOptions)};var C=(W,Z,j,re,z,H)=>{var K=H&&H.isInline?H.isInline:void 0,le=H&&H.anatomicalId?H.anatomicalId:void 0,se=H&&H.displayLabels?H.displayLabels:void 0,U=H&&H.renderOrder?H.renderOrder:void 0,D=new(u(18)).Glyphset;D.setDuration(v.getDuration()),D.groupName=re;var $=()=>{--this.toBeDownloaded,z!=null&&typeof z=="function"&&z(D)};++this.toBeDownloaded,K?D.load(Z,j,$,K,se):D.load(Z,f(j),$,K,se),D.anatomicalId=le,D.setRenderOrder(U),W.addZincObject(D)},_=(W,Z,j,re,z,H)=>()=>{if(Z.readyState==4&&Z.status==200){var K=JSON.parse(Z.responseText);C(W,K,j,re,z,H)}},P=(W,Z,j,re,z,H,K)=>(le,se)=>{var U=new(u(22)).Pointset,D=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});se&&se[0]&&(1>se[0].opacity&&(D.transparent=!0),D.opacity=se[0].opacity,D.color=se[0].color,D.morphTargets=Z,D.vertexColors=se[0].vertexColors);var $={};$.localTimeEnabled=Z,$.localMorphColour=j,U&&(U.createMesh(le,D,$),U.setName(re),U.anatomicalId=z,W.addZincObject(U),U.setDuration(v.getDuration()),U.setRenderOrder(H)),le.dispose(),--this.toBeDownloaded,K!=null&&typeof K=="function"&&K(U)};this.loadSTL=(W,Z,j,re)=>{this.toBeDownloaded+=1;var z=u(0).defaultMaterialColor,H=u(0).defaultOpacity,K=new y;K.crossOrigin="Anonymous",K.load(f(Z),N(W,z,H,!1,!1,j,void 0,void 0,void 0,re))},this.loadOBJ=(W,Z,j,re)=>{this.toBeDownloaded+=1;var z=u(0).defaultMaterialColor,H=u(0).defaultOpacity,K=new m;K.crossOrigin="Anonymous",K.load(f(Z),N(W,z,H,!1,!1,j,void 0,void 0,void 0,re))};var E=(W,Z,j,re,z,H,K)=>{this.toBeDownloaded+=1;var le=u(0).defaultMaterialColor,se=u(0).defaultOpacity,U=0,D=!!(K&&K.isInline)&&K.isInline,$=K&&K.fileFormat?K.fileFormat:void 0,Y=K&&K.anatomicalId?K.anatomicalId:void 0,ee=K&&K.renderOrder?K.renderOrder:void 0;j!=null&&(U=!!j);var ce=0;re!=null&&(ce=!!re);var ve=S;if($!==void 0){if($=="STL")ve=new y;else if($=="OBJ")return ve=new m,ve.crossOrigin="Anonymous",void ve.load(Z,objloader(W,le,se,U,ce,z,Y,H),this.onProgress(Z),this.onError,K.loaderOptions)}if(D){var be=S.parse(Z);N(W,le,se,U,ce,z,Y,ee,K,H)(be.geometry,be.materials)}else ve.crossOrigin="Anonymous",S.load(Z,N(W,le,se,U,ce,z,Y,ee,K,H),this.onProgress(Z),this.onError(H),K.loaderOptions)},O=function(Z,j,re){var z=0;return H=>{if(++z,H&&j!=null&&typeof j=="function"&&j(H),z==Z&&(g==!1&&v.viewAll(),re!=null&&typeof re=="function")){re();var K=v.getZincCameraControls();K&&K.calculateMaxAllowedDistance(v)}}};this.loadPointsetURL=(W,Z,j,re,z,H,K)=>{var le=0;this.toBeDownloaded+=1,j!=null&&(le=!!j);var se=0;re!=null&&(se=!!re);var U=!!(K&&K.isInline)&&K.isInline,D=K&&K.anatomicalId?K.anatomicalId:void 0,$=K&&K.renderOrder?K.renderOrder:void 0;if(U){var Y=S.parse(Z);P(W,le,se,z,D,$,H)(Y.geometry,Y.materials)}else S.load(Z,P(W,le,se,z,D,$,H),this.onProgress(Z),this.onError(H),K.loaderOptions)};var A=(W,Z,j,re,z,H)=>{var K=H&&H.isInline?H.isInline:void 0,le=H&&H.anatomicalId?H.anatomicalId:void 0,se=H&&H.renderOrder?H.renderOrder:void 0,U=void 0;if(j){if(Z&&j.images&&j.images.source)for(var D,$=j.images.source,Y=0;Y<$.length;Y++)D=h($[Y],Z),j.images.source[Y]=D;if(j.type==="slides"&&(U=new(u(27)).TextureSlides),U){U.groupName=re;var ee=()=>{--this.toBeDownloaded,z!=null&&typeof z=="function"&&z(U)};++this.toBeDownloaded,U.load(j,ee,K),U.anatomicalId=le,U.setRenderOrder(se),W.addZincObject(U)}}},L=(W,Z,j,re,z)=>()=>{if(Z.readyState==4&&Z.status==200){var H=JSON.parse(Z.responseText);A(W,Z.responseURL,H,j,re,z)}};this.loadTextureURL=(W,Z,j,re,z)=>{var H=!!(z&&z.isInline)&&z.isInline;if(H)A(W,void 0,Z,j,re,z);else{var K=new XMLHttpRequest;K.onreadystatechange=L(W,K,j,re,z),K.open("GET",f(Z),!0),K.send()}},this.loadGlyphsetURL=(W,Z,j,re,z,H)=>{var K=!!(H&&H.isInline)&&H.isInline;if(K)C(W,Z,j,re,z,H);else{var le=new XMLHttpRequest;le.onreadystatechange=_(W,le,j,re,z,H),le.open("GET",f(Z),!0),le.send()}};var R=(W,Z,j,re,z,H,K,le,se)=>{var U={colour:j,opacity:re,localTimeEnabled:z,localMorphColour:H},D=new(u(3)).Geometry;return D.createMesh(Z,le,U),D.getMorph()?(D.setName(se),W&&W.addZincObject(D),D.setDuration(v.getDuration()),D.videoHandler&&v.setVideoHandler(D.videoHandler),D):void 0},N=(W,Z,j,re,z,H,K,le,se,U)=>(D,$)=>{var Y;$&&$[0]&&(Y=$[0]);var ee=R(W,D,Z,j,re,z,void 0,Y,H);if(ee.anatomicalId=K,ee.setRenderOrder(le),se.lod&&se.lod.levels)for(var[ce,ve]of Object.entries(se.lod.levels))ee.addLOD(S,ce,ve.URL,ve.Index,se.lod.preload);--this.toBeDownloaded,D.dispose(),U!=null&&typeof U=="function"&&U(ee)},x=W=>{var Z=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,j,re,z,H,K,le,se]=W.match(Z);return{years:j,months:re,weeks:z,days:H,hours:K,mins:le,secs:se}};this.loadSettings=W=>{if(W){if(W.Duration){var Z=x(W.Duration);v.setDurationFromObject(Z)}if(W.OriginalDuration){var j=x(W.OriginalDuration);v.setOriginalDurationFromObject(j)}if(W.TimeStamps)for(var re in W.TimeStamps){var z=x(W.TimeStamps[re]);v.addMetadataTimeStamp(re,z)}}};var I=(W,Z,j,re,z)=>{if(j){var H=void 0,K=!1;j.URL?(H=j.URL,Z&&(H=h(H,Z))):j.Inline&&(H=j.Inline.URL,K=!0);var le={};if(j.LOD&&j.LOD.Levels){le.preload=!!j.LOD.Preload,le.levels={};for(var[se,U]of Object.entries(j.LOD.Levels))le.levels[se]={},le.levels[se].URL=h(U.URL,Z),le.levels[se].Index=U.Index}var D=j.GroupName;(D===void 0||D==="")&&(D="_Unnamed");var $={loaderOptions:{index:j.Index},isInline:K,fileFormat:j.FileFormat,anatomicalId:j.AnatomicalId,compression:j.compression,lod:le,renderOrder:re};switch(j.Type){case"Surfaces":E(W,H,j.MorphVertices,j.MorphColours,D,z,$);break;case"Glyph":var Y;K?Y=j.Inline.GlyphGeometriesURL:(Y=j.GlyphGeometriesURL,Y=h(j.GlyphGeometriesURL,Z)),j.DisplayLabels&&($.displayLabels=!0),this.loadGlyphsetURL(W,H,Y,D,z,$);break;case"Points":this.loadPointsetURL(W,H,j.MorphVertices,j.MorphColours,D,z,$);break;case"Lines":this.loadLinesURL(W,H,j.MorphVertices,j.MorphColours,D,z,$);break;case"Texture":this.loadTextureURL(W,H,D,z,$);break}}},B=(W,Z,j)=>{if(Z){var re=void 0,z=!1;switch(Z.URL?(re=Z.URL,W&&(re=h(Z.URL,W))):Z.Inline&&(re=Z.Inline.URL,z=!0),Z.Type){case"View":z?(v.setupMultipleViews("default",{default:re}),g=!0,j!=null&&typeof j=="function"&&j()):this.loadViewURL(re,j);break;case"Settings":this.loadSettings(Z);break}}};this.loadGLTF=(W,Z,j,re,z)=>{var H=new(u(39)).GLTFToZincJSLoader;H.load(v,W,Z,j,re,z)};var F=(W,Z,j,re)=>{if(j.Primitives&&j.Primitives.forEach(le=>{var se=1;le.Order&&(se=le.Order),I(W,Z,le,se,re)}),j.Transformation&&W.setTransformation(j.Transformation),j.Children)for(var[z,H]of Object.entries(j.Children)){var K=W.findOrCreateChildFromPath(z);K&&F(K,Z,H,re)}},V=(W,Z)=>{var j,re,z=W,H=Z==null||(j=Z.enabled)===null||j===void 0?void 0:j.include,K=Z==null||(re=Z.enabled)===null||re===void 0?void 0:re.exclude;return(H!=null&&H.length||K!=null&&K.length)&&(H&&(z=W.filter(le=>{if(le.Type==="View")return!0;for(var se=0;se<H.length;se++)if(p(le.RegionPath,le.GroupName,H[se]))return!0;return!1})),K&&(z=z.filter(le=>{if(le.Type==="View")return!0;for(var se=0;se<K.length;se++)if(p(le.RegionPath,le.GroupName,K[se]))return!1;return!0}))),z},k=(W,Z)=>Array.isArray(W)?V(W,Z):W,G=(W,Z)=>{if(Array.isArray(W)){for(var j=0,re=0;re<W.length;re++)W[re].Type&&(Z&&W[re].Type==="View"||W[re].Type==="Surfaces"||W[re].Type==="Glyph"||W[re].Type==="Points"||W[re].Type==="Lines"||W[re].Type==="Texture")&&j++;return j}return 0},J=W=>{var Z=W.Primitives?G(W.Primitives,!1):0;return W.Children&&Object.values(W.Children).forEach(j=>{Z+=J(j)}),Z},ne=W=>Array.isArray(W)?G(W,!0):typeof W=="object"&&W!==null&&W.Version==="2.0"?J(W.Regions):void 0,ae=(W,Z,j,re,z)=>{var H=W;j.RegionPath&&j.RegionPath!==""&&(H=W.findOrCreateChildFromPath(j.RegionPath)),I(H,Z,j,2*re,z)},ie=(W,Z,j,re,z,H)=>{for(var K=k(Z,H),le=ne(K),se=new O(le,re,z),U=0;U<Z.length;U++)B(j,K[U],se);for(var D=0;D<Z.length;D++)ae(W,j,K[D],D,se)},oe=(W,Z,j,re,z)=>{var H=ne(Z),K=new O(H,re,z);Z.Settings&&this.loadSettings(Z.Settings),Z.Views&&T(j,Z.Views),Z.Regions&&F(W,j,Z.Regions,K)};this.loadMetadataURL=(W,Z,j,re,z)=>{var H=new XMLHttpRequest,K=f(Z);H.onreadystatechange=()=>{if(H.readyState==4&&H.status==200){v.resetMetadata(),v.resetDuration(),g=!1;var le=H.responseURL;le===void 0&&(le=new URL(K).href);var se=JSON.parse(H.responseText);Array.isArray(se)?ie(W,se,le,j,re,z):typeof se=="object"&&se!==null&&se.Version=="2.0"&&oe(W,se,le,j,re)}},H.open("GET",K,!0),H.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(p){super(p)}load(p,y,m,d){var b=this,v=new c.FileLoader(this.manager);v.setPath(this.path),v.setResponseType("arraybuffer"),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(p,function(g){try{y(b.parse(g))}catch(w){d?d(w):console.error(w),b.manager.itemError(p)}},m,d)}parse(p){function y(d,b,v){for(var g=0,w=d.length;g<w;g++)if(d[g]!==b.getUint8(v+g,!1))return!1;return!0}var m=function(d){if(typeof d=="string"){for(var b=new Uint8Array(d.length),v=0;v<d.length;v++)b[v]=255&d.charCodeAt(v);return b.buffer||b}return d}(p);return function(d){var b=new DataView(d),v=b.getUint32(80,!0);if(84+v*50===b.byteLength)return!0;for(var g=[115,111,108,105,100],w=0;5>w;w++)if(y(g,b,w))return!1;return!0}(m)?function(d){for(var b,v,g,w,S,T,M,C,_=new DataView(d),P=_.getUint32(80,!0),E=!1,O=0;O<70;O++)_.getUint32(O,!1)==1129270351&&_.getUint8(O+4)==82&&_.getUint8(O+5)==61&&(E=!0,w=new Float32Array(3*(3*P)),S=_.getUint8(O+6)/255,T=_.getUint8(O+7)/255,M=_.getUint8(O+8)/255,C=_.getUint8(O+9)/255);for(var A=new c.BufferGeometry,L=new Float32Array(3*(3*P)),R=new Float32Array(3*(3*P)),N=0;N<P;N++){var x=84+N*50,I=_.getFloat32(x,!0),B=_.getFloat32(x+4,!0),F=_.getFloat32(x+8,!0);if(E){var V=_.getUint16(x+48,!0);32768&V?(b=S,v=T,g=M):(b=(31&V)/31,v=(31&V>>5)/31,g=(31&V>>10)/31)}for(var k=1;3>=k;k++){var G=x+12*k,J=3*(3*N)+3*(k-1);L[J]=_.getFloat32(G,!0),L[J+1]=_.getFloat32(G+4,!0),L[J+2]=_.getFloat32(G+8,!0),R[J]=I,R[J+1]=B,R[J+2]=F,E&&(w[J]=b,w[J+1]=v,w[J+2]=g)}}return A.setAttribute("position",new c.BufferAttribute(L,3)),A.setAttribute("normal",new c.BufferAttribute(R,3)),E&&(A.setAttribute("color",new c.BufferAttribute(w,3)),A.hasColors=!0,A.alpha=C),A}(m):function(d){for(var b,v=new c.BufferGeometry,g=/solid([\s\S]*?)endsolid/g,w=/facet([\s\S]*?)endfacet/g,S=0,T=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,M=new RegExp("vertex"+T+T+T,"g"),C=new RegExp("normal"+T+T+T,"g"),_=[],P=[],E=new c.Vector3,O=0,A=0,L=0;(b=g.exec(d))!==null;){A=L;for(var R=b[0];(b=w.exec(R))!==null;){for(var N=0,x=0,I=b[0];(b=C.exec(I))!==null;)E.x=parseFloat(b[1]),E.y=parseFloat(b[2]),E.z=parseFloat(b[3]),x++;for(;(b=M.exec(I))!==null;)_.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),P.push(E.x,E.y,E.z),N++,L++;x!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+S),N!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+S),S++}var B=A,F=L-A;v.addGroup(B,F,O),O++}return v.setAttribute("position",new c.Float32BufferAttribute(_,3)),v.setAttribute("normal",new c.Float32BufferAttribute(P,3)),v}(function(d){return typeof d=="string"?d:c.LoaderUtils.decodeText(new Uint8Array(d))}(p))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>S});var c=u(4),f=/^[og]\s*(.+)?/,h=/^mtllib /,p=/^usemtl /,y=/^usemap /,m=new c.Vector3,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;function w(){var T={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(C,_){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=C,void(this.object.fromDeclaration=_!==!1);var P=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:C||"",fromDeclaration:_!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(A,L){var R=this._finalize(!1);R&&(R.inherited||0>=R.groupCount)&&this.materials.splice(R.index,1);var N={index:this.materials.length,name:A||"",mtllib:Array.isArray(L)&&0<L.length?L[L.length-1]:"",smooth:R===void 0?this.smooth:R.smooth,groupStart:R===void 0?0:R.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(I){var B={index:typeof I=="number"?I:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return B.clone=this.clone.bind(B),B}};return this.materials.push(N),N},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(A){var L=this.currentMaterial();if(L&&L.groupEnd===-1&&(L.groupEnd=this.geometry.vertices.length/3,L.groupCount=L.groupEnd-L.groupStart,L.inherited=!1),A&&1<this.materials.length)for(var R=this.materials.length-1;0<=R;R--)0>=this.materials[R].groupCount&&this.materials.splice(R,1);return A&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),L}},P&&P.name&&typeof P.clone=="function"){var E=P.clone(0);E.inherited=!0,this.object.materials.push(E)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(C,_){var P=parseInt(C,10);return 3*(0<=P?P-1:P+_/3)},parseNormalIndex:function(C,_){var P=parseInt(C,10);return 3*(0<=P?P-1:P+_/3)},parseUVIndex:function(C,_){var P=parseInt(C,10);return 2*(0<=P?P-1:P+_/2)},addVertex:function(C,_,P){var E=this.vertices,O=this.object.geometry.vertices;O.push(E[C+0],E[C+1],E[C+2]),O.push(E[_+0],E[_+1],E[_+2]),O.push(E[P+0],E[P+1],E[P+2])},addVertexPoint:function(C){var _=this.vertices,P=this.object.geometry.vertices;P.push(_[C+0],_[C+1],_[C+2])},addVertexLine:function(C){var _=this.vertices,P=this.object.geometry.vertices;P.push(_[C+0],_[C+1],_[C+2])},addNormal:function(C,_,P){var E=this.normals,O=this.object.geometry.normals;O.push(E[C+0],E[C+1],E[C+2]),O.push(E[_+0],E[_+1],E[_+2]),O.push(E[P+0],E[P+1],E[P+2])},addFaceNormal:function(C,_,P){var E=this.vertices,O=this.object.geometry.normals;m.fromArray(E,C),d.fromArray(E,_),b.fromArray(E,P),g.subVectors(b,d),v.subVectors(m,d),g.cross(v),g.normalize(),O.push(g.x,g.y,g.z),O.push(g.x,g.y,g.z),O.push(g.x,g.y,g.z)},addColor:function(C,_,P){var E=this.colors,O=this.object.geometry.colors;E[C]!==void 0&&O.push(E[C+0],E[C+1],E[C+2]),E[_]!==void 0&&O.push(E[_+0],E[_+1],E[_+2]),E[P]!==void 0&&O.push(E[P+0],E[P+1],E[P+2])},addUV:function(C,_,P){var E=this.uvs,O=this.object.geometry.uvs;O.push(E[C+0],E[C+1]),O.push(E[_+0],E[_+1]),O.push(E[P+0],E[P+1])},addDefaultUV:function(){var C=this.object.geometry.uvs;C.push(0,0),C.push(0,0),C.push(0,0)},addUVLine:function(C){var _=this.uvs,P=this.object.geometry.uvs;P.push(_[C+0],_[C+1])},addFace:function(C,_,P,E,O,A,L,R,N){var x=this.vertices.length,I=this.parseVertexIndex(C,x),B=this.parseVertexIndex(_,x),F=this.parseVertexIndex(P,x);if(this.addVertex(I,B,F),this.addColor(I,B,F),L!==void 0&&L!==""){var V=this.normals.length;I=this.parseNormalIndex(L,V),B=this.parseNormalIndex(R,V),F=this.parseNormalIndex(N,V),this.addNormal(I,B,F)}else this.addFaceNormal(I,B,F);if(E!==void 0&&E!==""){var k=this.uvs.length;I=this.parseUVIndex(E,k),B=this.parseUVIndex(O,k),F=this.parseUVIndex(A,k),this.addUV(I,B,F),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(C){this.object.geometry.type="Points";for(var _,P=this.vertices.length,E=0,O=C.length;E<O;E++)_=this.parseVertexIndex(C[E],P),this.addVertexPoint(_),this.addColor(_)},addLineGeometry:function(C,_){this.object.geometry.type="Line";for(var P=this.vertices.length,E=this.uvs.length,O=0,A=C.length;O<A;O++)this.addVertexLine(this.parseVertexIndex(C[O],P));for(var L=0,R=_.length;L<R;L++)this.addUVLine(this.parseUVIndex(_[L],E))}};return T.startObject("",!1),T}class S extends c.Loader{constructor(M){super(M),this.materials=null}load(M,C,_,P){var E=this,O=new c.FileLoader(this.manager);O.setPath(this.path),O.setRequestHeader(this.requestHeader),O.setWithCredentials(this.withCredentials),O.load(M,function(A){try{C(E.parse(A))}catch(L){P?P(L):console.error(L),E.manager.itemError(M)}},_,P)}setMaterials(M){return this.materials=M,this}parse(M){var C=new w;M.indexOf(`\r
3231
3231
  `)!==-1&&(M=M.replace(/\r\n/g,`
3232
3232
  `)),M.indexOf(`\\
3233
3233
  `)!==-1&&(M=M.replace(/\\\n/g,""));for(var _=M.split(`
3234
- `),P="",E="",O=0,A=[],L=typeof"".trimLeft=="function",R=0,N=_.length;R<N;R++)if(P=_[R],P=L?P.trimLeft():P.trim(),O=P.length,O!==0&&(E=P.charAt(0),E!=="#"))if(E==="v"){var x=P.split(/\s+/);switch(x[0]){case"v":C.vertices.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3])),7<=x.length?C.colors.push(parseFloat(x[4]),parseFloat(x[5]),parseFloat(x[6])):C.colors.push(void 0,void 0,void 0);break;case"vn":C.normals.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3]));break;case"vt":C.uvs.push(parseFloat(x[1]),parseFloat(x[2]))}}else if(E==="f"){for(var I,B=P.substr(1).trim(),F=B.split(/\s+/),V=[],k=0,G=F.length;k<G;k++)if(I=F[k],0<I.length){var J=I.split("/");V.push(J)}for(var ne=V[0],ae=1,ie=V.length-1;ae<ie;ae++){var oe=V[ae],W=V[ae+1];C.addFace(ne[0],oe[0],W[0],ne[1],oe[1],W[1],ne[2],oe[2],W[2])}}else if(E==="l"){var X=P.substring(1).trim().split(" "),j=[],re=[];if(P.indexOf("/")===-1)j=X;else for(var z,H=0,K=X.length;H<K;H++)z=X[H].split("/"),z[0]!==""&&j.push(z[0]),z[1]!==""&&re.push(z[1]);C.addLineGeometry(j,re)}else if(E==="p"){var le=P.substr(1).trim(),se=le.split(" ");C.addPointGeometry(se)}else if((A=f.exec(P))!==null){var U=(" "+A[0].substr(1).trim()).substr(1);C.startObject(U)}else if(p.test(P))C.object.startMaterial(P.substring(7).trim(),C.materialLibraries);else if(h.test(P))C.materialLibraries.push(P.substring(7).trim());else if(y.test(P))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(E==="s"){if(A=P.split(" "),1<A.length){var D=A[1].trim().toLowerCase();C.object.smooth=D!=="0"&&D!=="off"}else C.object.smooth=!0;var $=C.object.currentMaterial();$&&($.smooth=C.object.smooth)}else{if(P==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+P+'"')}C.finalize();var Y=new c.Group;Y.materialLibraries=[].concat(C.materialLibraries);var ee=C.objects.length!==1||C.objects[0].geometry.vertices.length!==0;if(ee==!0)for(var ce=0,ve=C.objects.length;ce<ve;ce++){var be=C.objects[ce],ue=be.geometry,me=be.materials,te=ue.type==="Line",he=ue.type==="Points",ge=!1;if(ue.vertices.length!==0){var Ae=new c.BufferGeometry;Ae.setAttribute("position",new c.Float32BufferAttribute(ue.vertices,3)),0<ue.normals.length&&Ae.setAttribute("normal",new c.Float32BufferAttribute(ue.normals,3)),0<ue.colors.length&&(ge=!0,Ae.setAttribute("color",new c.Float32BufferAttribute(ue.colors,3))),ue.hasUVIndices===!0&&Ae.setAttribute("uv",new c.Float32BufferAttribute(ue.uvs,2));for(var Te=[],De=0,Ye=me.length;De<Ye;De++){var ze=me[De],st=ze.name+"_"+ze.smooth+"_"+ge,Ce=C.materials[st];if(this.materials!==null){if(Ce=this.materials.create(ze.name),te&&Ce&&!(Ce instanceof c.LineBasicMaterial)){var He=new c.LineBasicMaterial;c.Material.prototype.copy.call(He,Ce),He.color.copy(Ce.color),Ce=He}else if(he&&Ce&&!(Ce instanceof c.PointsMaterial)){var Ge=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call(Ge,Ce),Ge.color.copy(Ce.color),Ge.map=Ce.map,Ce=Ge}}Ce===void 0&&(Ce=te?new c.LineBasicMaterial:he?new c.PointsMaterial({size:1,sizeAttenuation:!1}):new c.MeshPhongMaterial,Ce.name=ze.name,Ce.flatShading=!ze.smooth,Ce.vertexColors=ge,C.materials[st]=Ce),Te.push(Ce)}var It=void 0;if(1<Te.length){for(var Ot,mt=0,bt=me.length;mt<bt;mt++)Ot=me[mt],Ae.addGroup(Ot.groupStart,Ot.groupCount,mt);It=te?new c.LineSegments(Ae,Te):he?new c.Points(Ae,Te):new c.Mesh(Ae,Te)}else It=te?new c.LineSegments(Ae,Te[0]):he?new c.Points(Ae,Te[0]):new c.Mesh(Ae,Te[0]);It.name=be.name,Y.add(It)}}else if(0<C.vertices.length){var Ii=new c.PointsMaterial({size:1,sizeAttenuation:!1}),Oi=new c.BufferGeometry;Oi.setAttribute("position",new c.Float32BufferAttribute(C.vertices,3)),0<C.colors.length&&C.colors[0]!==void 0&&(Oi.setAttribute("color",new c.Float32BufferAttribute(C.colors,3)),Ii.vertexColors=!0);var zn=new c.Points(Oi,Ii);Y.add(zn)}return Y}}},(o,l,u)=>{function c(S,T){var M=Object.keys(S);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(S);T&&(C=C.filter(function(_){return Object.getOwnPropertyDescriptor(S,_).enumerable})),M.push.apply(M,C)}return M}function f(S){for(var T,M=1;M<arguments.length;M++)T=arguments[M]==null?{}:arguments[M],M%2?c(Object(T),!0).forEach(function(C){h(S,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(T)):c(Object(T)).forEach(function(C){Object.defineProperty(S,C,Object.getOwnPropertyDescriptor(T,C))});return S}function h(S,T,M){return T=p(T),T in S?Object.defineProperty(S,T,{value:M,enumerable:!0,configurable:!0,writable:!0}):S[T]=M,S}function p(S){var T=y(S,"string");return typeof T=="symbol"?T:T+""}function y(S,T){if(typeof S!="object"||!S)return S;var M=S[Symbol.toPrimitive];if(M!==void 0){var C=M.call(S,T||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(S)}var m=u(19).JSONLoader,d=u(4),b=d.FileLoader,v=S=>{var T=(C,_)=>{C.merge(_)};if(S&&0<S.length){for(;1<S.length;){var M=S.splice(1,1);T(S[0],M[0])}return S[0]}},g=function(T,M,C){var _=new b,P=new m;_.crossOrigin=M;var E=T,O=C,A=void 0,L=!1,R=!1,N=void 0,x=[],I=k=>{var G=A[k.index];if(G){var J=P.parse(G);k.onLoad(J.geometry,J.materials)}else B(k)},B=k=>{k.onError&&(!N&&(N={responseURL:E}),k.onError(N))};this.downloadCompleted=k=>{try{A=JSON.parse(k[0]),L=!1,R=!0,Array.isArray(A)?x.forEach(G=>I(G)):x.forEach(G=>B(G))}catch{x.forEach(J=>B(J))}};var F=()=>k=>{N=k,R=!0,L=!1,x.forEach(G=>{B(G)})},V=()=>k=>{x.forEach(G=>{G.onProgress&&G.onProgress(k)})};this.load=(k,G,J,ne)=>{var ae={index:k,onLoad:G,onProgress:J,onError:ne};R?A?I(ae):B(N):L?x.push(ae):(x.push(ae),L=!0,_.load(E,O,V,F))}},w=function(T,M){var C=[],_=T,P=M,E=0;this.itemDownloaded=(O,A)=>{if(C[O]=A,E++,E==_){for(var L=C[0][1],R=C.map(I=>I[0]),N=v(R),x=1;x<_;x++)C[O][0].dispose(),C[O][1].forEach(I=>I.dispose());P(N,L)}}};l.PrimitivesLoader=function(){var S=0,T=20;this.crossOrigin="Anonymous";var M=new m,C=[],_={},P=(L,R,N,x,I)=>{var B=L.length,F=new w(B,R),V=0;L.forEach(k=>{var G=I?f({},I):{};G.msHandler=F,G.order=V,V++,O(k,R,N,x,G)})},E=(L,R,N,x,I)=>{var B=I?f({},I):{},F=_[L];if(!F)if(T>S){var V=new A(void 0,this,B);++S,F=new g(L,this.crossOrigin,V),_[L]=F}else C.push({url:L,onLoad:R,onProgress:N,onError:x,options:I});F&&(B.isHandler=F,F.load(I.index,R,N,x))},O=(L,R,N,x,I)=>{if(I&&I.index!==void 0)E(L,R,N,x,I);else if(T>S){++S;var B=new A(R,this,I),F=new A(x,this,I);M.crossOrigin=this.crossOrigin,M.load(L,B,N,F)}else C.push({url:L,onLoad:R,onProgress:N,onError:x,options:I})};this.load=(L,R,N,x,I)=>{Array.isArray(L)?P(L,R,N,x,I):O(L,R,N,x,I)},this.loadFromWaitingList=()=>{for(;T>S;){var L=C.shift();if(L)this.load(L.url,L.onLoad,L.onProgress,L.onError,L.options);else return}},this.itemRemainingCheck=()=>{if(C.length===0&&S==0)for(var L in _)_.hasOwnProperty(L)&&delete _[L]};var A=function(R,N,x){return function(){--S;for(var I=arguments.length,B=Array(I),F=0;F<I;F++)B[F]=arguments[F];x!=null&&x.msHandler?x.msHandler.itemDownloaded(x.order,B):x!=null&&x.isHandler?x.isHandler.downloadCompleted(B):R&&R(...B),N.loadFromWaitingList(),N.itemRemainingCheck()}};this.parse=L=>M.parse(L)}},(o,l,u)=>{u(4);var c=u(40).GLTFLoader,f=function(){var h=this;this.parseGLTFObjects=(p,y,m,d)=>{var b=y;if(m!==0){if(p.type!=="Object3D"){var v;if(p.type==="Mesh"?v=new(u(3)).Geometry:p.type==="LineSegments"?v=new(u(24)).Lines:p.type==="Points"&&(v=new(u(22)).Pointset),v){var g=!1,w=!1;p.geometry&&p.geometry.morphAttributes&&(g=!!p.geometry.morphAttributes.position,w=!!p.geometry.morphAttributes.color),v.setMesh(p.clone(),g,w);var S=v.getMorph();v.groupName=S.name,S.matrixAutoUpdate=!0,y.addZincObject(v),d!=null&&typeof d=="function"&&d(v)}}else if(p.name!==""&&(y&&(b=y.findOrCreateChildFromPath(p.name)),b)){var T=b.getGroup();T.position.copy(p.position),T.rotation.copy(p.rotation),T.quaternion.copy(p.quaternion),T.matrixAutoUpdate=!0}}m++,p.children.forEach(M=>{h.parseGLTFObjects(M,b,m,d)})},this.setCamera=p=>{p.viewAll();var y=p.getZincCameraControls(),m=y.getCurrentViewport();y.addViewport("default",m),y.setDefaultViewport("default")},this.load=(p,y,m,d,b)=>{var v=m.substring(0,m.lastIndexOf("/")+1),g=m.substring(m.lastIndexOf("/")+1,m.length),w=new c().setPath(v);w.load(g,function(S){console.log(S),h.parseGLTFObjects(S.scene,y,0,d),h.setCamera(p),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=wB},(o,l,u)=>{var c=u(42).GLTFExporter,f=function(h){var p=h;this.exportGLTF=y=>{var m=p.getRootRegion(),d=m.getAllObjects(!0),b=[];d.forEach(w=>{w.animationClip&&b.push({clip:w.animationClip[0],mesh:w.getMorph()})});var v=new c,g={binary:y,animations:b};return new Promise(w=>{v.parse(p.getThreeJSScene(),function(S){w(S)},g)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(x){return new A(x)}),this.register(function(x){return new L(x)}),this.register(function(x){return new R(x)})}register(x){return this.pluginCallbacks.indexOf(x)===-1&&this.pluginCallbacks.push(x),this}unregister(x){return this.pluginCallbacks.indexOf(x)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(x),1),this}parse(x,I,B){for(var F=new O,V=[],k=0,G=this.pluginCallbacks.length;k<G;k++)V.push(this.pluginCallbacks[k](F));F.setPlugins(V),F.write(x,I,B)}}var h={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},p={};p[c.NearestFilter]=h.NEAREST,p[c.NearestMipmapNearestFilter]=h.NEAREST_MIPMAP_NEAREST,p[c.NearestMipmapLinearFilter]=h.NEAREST_MIPMAP_LINEAR,p[c.LinearFilter]=h.LINEAR,p[c.LinearMipmapNearestFilter]=h.LINEAR_MIPMAP_NEAREST,p[c.LinearMipmapLinearFilter]=h.LINEAR_MIPMAP_LINEAR,p[c.ClampToEdgeWrapping]=h.CLAMP_TO_EDGE,p[c.RepeatWrapping]=h.REPEAT,p[c.MirroredRepeatWrapping]=h.MIRRORED_REPEAT;var y={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},m=12,d=1179937895,b=2,v=8,g=1313821514,w=5130562;function S(N,x){return N.length===x.length&&N.every(function(I,B){return I===x[B]})}function T(N){if(window.TextEncoder!==void 0)return new TextEncoder().encode(N).buffer;for(var x,I=new Uint8Array(new ArrayBuffer(N.length)),B=0,F=N.length;B<F;B++)x=N.charCodeAt(B),I[B]=255<x?32:x;return I.buffer}function M(N){return S(N.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function C(N,x,I){for(var B={min:Array(N.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(N.itemSize).fill(Number.NEGATIVE_INFINITY)},F=x;F<x+I;F++)for(var V,k=0;k<N.itemSize;k++)V=void 0,4<N.itemSize?V=N.array[F*N.itemSize+k]:k===0?V=N.getX(F):k===1?V=N.getY(F):k===2?V=N.getZ(F):k==3&&(V=N.getW(F)),B.min[k]=Math.min(B.min[k],V),B.max[k]=Math.max(B.max[k],V);return B}function _(N){return 4*Math.ceil(N/4)}function P(N){var x=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,I=_(N.byteLength);if(I!==N.byteLength){var B=new Uint8Array(I);if(B.set(new Uint8Array(N)),x!==0)for(var F=N.byteLength;F<I;F++)B[F]=x;return B.buffer}return N}var E=null;class O{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(x){this.plugins=x}write(x,I,B){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},B),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(x);var F=this;Promise.all(this.pending).then(function(){var V=F.buffers,k=F.json,G=F.options,J=F.extensionsUsed,ne=new Blob(V,{type:"application/octet-stream"}),ae=Object.keys(J);if(0<ae.length&&(k.extensionsUsed=ae),k.buffers&&0<k.buffers.length&&(k.buffers[0].byteLength=ne.size),G.binary===!0){var ie=new window.FileReader;ie.readAsArrayBuffer(ne),ie.onloadend=function(){var W=P(ie.result),X=new DataView(new ArrayBuffer(v));X.setUint32(0,W.byteLength,!0),X.setUint32(4,w,!0);var j=P(T(JSON.stringify(k)),32),re=new DataView(new ArrayBuffer(v));re.setUint32(0,j.byteLength,!0),re.setUint32(4,g,!0);var z=new ArrayBuffer(m),H=new DataView(z);H.setUint32(0,d,!0),H.setUint32(4,b,!0);var K=m+re.byteLength+j.byteLength+X.byteLength+W.byteLength;H.setUint32(8,K,!0);var le=new Blob([z,re,j,X,W],{type:"application/octet-stream"}),se=new window.FileReader;se.readAsArrayBuffer(le),se.onloadend=function(){I(se.result)}}}else if(k.buffers&&0<k.buffers.length){var oe=new window.FileReader;oe.readAsDataURL(ne),oe.onloadend=function(){var W=oe.result;k.buffers[0].uri=W,I(k)}}else I(k)})}serializeUserData(x,I){if(!(x.userData&&x.userData.isZincObject)&&Object.keys(x.userData).length!==0){var B=this.options,F=this.extensionsUsed;try{var V=JSON.parse(JSON.stringify(x.userData));if(B.includeCustomExtensions&&V.gltfExtensions){for(var k in I.extensions===void 0&&(I.extensions={}),V.gltfExtensions)I.extensions[k]=V.gltfExtensions[k],F[k]=!0;delete V.gltfExtensions}0<Object.keys(V).length&&(I.extras=V)}catch(G){console.warn("THREE.GLTFExporter: userData of '"+x.name+"' won't be serialized because of JSON.stringify error - "+G.message)}}}getUID(x){return this.uids.has(x)||this.uids.set(x,this.uid++),this.uids.get(x)}isNormalizedNormalAttribute(x){var I=this.cache;if(I.attributesNormalized.has(x))return!1;for(var B=new c.Vector3,F=0,V=x.count;F<V;F++)if(5e-4<Math.abs(B.fromBufferAttribute(x,F).length()-1))return!1;return!0}createNormalizedNormalAttribute(x){var I=this.cache;if(I.attributesNormalized.has(x))return I.attributesNormalized.get(x);for(var B=x.clone(),F=new c.Vector3,V=0,k=B.count;V<k;V++)F.fromBufferAttribute(B,V),F.x===0&&F.y===0&&F.z===0?F.setX(1):F.normalize(),B.setXYZ(V,F.x,F.y,F.z);return I.attributesNormalized.set(x,B),B}applyTextureTransform(x,I){var B=!1,F={};(I.offset.x!==0||I.offset.y!==0)&&(F.offset=I.offset.toArray(),B=!0),I.rotation!==0&&(F.rotation=I.rotation,B=!0),(I.repeat.x!==1||I.repeat.y!==1)&&(F.scale=I.repeat.toArray(),B=!0),B&&(x.extensions=x.extensions||{},x.extensions.KHR_texture_transform=F,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(x){var I=this.json,B=this.buffers;return I.buffers||(I.buffers=[{byteLength:0}]),B.push(x),0}processBufferView(x,I,B,F,V){var k=this.json;k.bufferViews||(k.bufferViews=[]);for(var G=I===h.UNSIGNED_BYTE?1:I===h.UNSIGNED_SHORT?2:4,J=_(F*x.itemSize*G),ne=new DataView(new ArrayBuffer(J)),ae=0,ie=B;ie<B+F;ie++)for(var oe,W=0;W<x.itemSize;W++)oe=void 0,4<x.itemSize?oe=x.array[ie*x.itemSize+W]:W===0?oe=x.getX(ie):W===1?oe=x.getY(ie):W===2?oe=x.getZ(ie):W==3&&(oe=x.getW(ie)),I===h.FLOAT?ne.setFloat32(ae,oe,!0):I===h.UNSIGNED_INT?ne.setUint32(ae,oe,!0):I===h.UNSIGNED_SHORT?ne.setUint16(ae,oe,!0):I===h.UNSIGNED_BYTE&&ne.setUint8(ae,oe),ae+=G;var X={buffer:this.processBuffer(ne.buffer),byteOffset:this.byteOffset,byteLength:J};V!==void 0&&(X.target=V),V===h.ARRAY_BUFFER&&(X.byteStride=x.itemSize*G),this.byteOffset+=J,k.bufferViews.push(X);var j={id:k.bufferViews.length-1,byteLength:0};return j}processBufferViewImage(x){var I=this,B=I.json;return B.bufferViews||(B.bufferViews=[]),new Promise(function(F){var V=new window.FileReader;V.readAsArrayBuffer(x),V.onloadend=function(){var k=P(V.result),G={buffer:I.processBuffer(k),byteOffset:I.byteOffset,byteLength:k.byteLength};I.byteOffset+=k.byteLength,F(B.bufferViews.push(G)-1)}})}processAccessor(x,I,B,F){var V,k=this.options,G=this.json;if(x.array.constructor===Float32Array)V=h.FLOAT;else if(x.array.constructor===Uint32Array)V=h.UNSIGNED_INT;else if(x.array.constructor===Uint16Array)V=h.UNSIGNED_SHORT;else if(x.array.constructor===Uint8Array)V=h.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(B===void 0&&(B=0),F===void 0&&(F=x.count),k.truncateDrawRange&&I!==void 0&&I.index===null){var J=B+F,ne=I.drawRange.count===1/0?x.count:I.drawRange.start+I.drawRange.count;B=Math.max(B,I.drawRange.start),F=Math.min(J,ne)-B,0>F&&(F=0)}if(F===0)return null;var ae,ie=C(x,B,F);I!==void 0&&(ae=x===I.index?h.ELEMENT_ARRAY_BUFFER:h.ARRAY_BUFFER);var oe=this.processBufferView(x,V,B,F,ae),W={bufferView:oe.id,byteOffset:oe.byteOffset,componentType:V,count:F,max:ie.max,min:ie.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[x.itemSize]};return x.normalized===!0&&(W.normalized=!0),G.accessors||(G.accessors=[]),G.accessors.push(W)-1}processImage(x,I,B){var F=this,V=F.cache,k=F.json,G=F.options,J=F.pending;V.images.has(x)||V.images.set(x,{});var ne=V.images.get(x),ae=I===c.RGBAFormat?"image/png":"image/jpeg",ie=ae+":flipY/"+B.toString();if(ne[ie]!==void 0)return ne[ie];k.images||(k.images=[]);var oe={mimeType:ae};if(G.embedImages){var W=E=E||document.createElement("canvas");W.width=Math.min(x.width,G.maxTextureSize),W.height=Math.min(x.height,G.maxTextureSize);var X=W.getContext("2d");if(B===!0&&(X.translate(0,W.height),X.scale(1,-1)),typeof HTMLImageElement<"u"&&x instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&x instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&x instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&x instanceof ImageBitmap)X.drawImage(x,0,0,W.width,W.height);else{I!==c.RGBAFormat&&I!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(x.width>G.maxTextureSize||x.height>G.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",x);var j=new Uint8ClampedArray(4*(x.height*x.width));if(I===c.RGBAFormat)for(var re=0;re<j.length;re+=4)j[re+0]=x.data[re+0],j[re+1]=x.data[re+1],j[re+2]=x.data[re+2],j[re+3]=x.data[re+3];else for(var z=0,H=0;z<j.length;z+=4,H+=3)j[z+0]=x.data[H+0],j[z+1]=x.data[H+1],j[z+2]=x.data[H+2],j[z+3]=255;X.putImageData(new ImageData(j,x.width,x.height),0,0)}G.binary===!0?J.push(new Promise(function(le){W.toBlob(function(se){F.processBufferViewImage(se).then(function(U){oe.bufferView=U,le()})},ae)})):oe.uri=W.toDataURL(ae)}else oe.uri=x.src;var K=k.images.push(oe)-1;return ne[ie]=K,K}processSampler(x){var I=this.json;I.samplers||(I.samplers=[]);var B={magFilter:p[x.magFilter],minFilter:p[x.minFilter],wrapS:p[x.wrapS],wrapT:p[x.wrapT]};return I.samplers.push(B)-1}processTexture(x){var I=this.cache,B=this.json;if(I.textures.has(x))return I.textures.get(x);B.textures||(B.textures=[]);var F={sampler:this.processSampler(x),source:this.processImage(x.image,x.format,x.flipY)};x.name&&(F.name=x.name),this._invokeAll(function(k){k.writeTexture&&k.writeTexture(x,F)});var V=B.textures.push(F)-1;return I.textures.set(x,V),V}processMaterial(x){var I=this.cache,B=this.json;if(I.materials.has(x))return I.materials.get(x);if(x.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;B.materials||(B.materials=[]);var F={pbrMetallicRoughness:{}};x.isMeshStandardMaterial!==!0&&x.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var V=x.color.toArray().concat([x.opacity]);if(S(V,[1,1,1,1])||(F.pbrMetallicRoughness.baseColorFactor=V),x.isMeshStandardMaterial?(F.pbrMetallicRoughness.metallicFactor=x.metalness,F.pbrMetallicRoughness.roughnessFactor=x.roughness):(F.pbrMetallicRoughness.metallicFactor=.5,F.pbrMetallicRoughness.roughnessFactor=.5),x.metalnessMap||x.roughnessMap)if(x.metalnessMap===x.roughnessMap){var k={index:this.processTexture(x.metalnessMap)};this.applyTextureTransform(k,x.metalnessMap),F.pbrMetallicRoughness.metallicRoughnessTexture=k}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(x.map){var G={index:this.processTexture(x.map)};this.applyTextureTransform(G,x.map),F.pbrMetallicRoughness.baseColorTexture=G}if(x.emissive){var J=x.emissive.clone().multiplyScalar(x.emissiveIntensity),ne=Math.max(J.r,J.g,J.b);if(1<ne&&(J.multiplyScalar(1/ne),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<ne&&(F.emissiveFactor=J.toArray()),x.emissiveMap){var ae={index:this.processTexture(x.emissiveMap)};this.applyTextureTransform(ae,x.emissiveMap),F.emissiveTexture=ae}}if(x.normalMap){var ie={index:this.processTexture(x.normalMap)};x.normalScale&&x.normalScale.x!==-1&&(x.normalScale.x!==x.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),ie.scale=x.normalScale.x),this.applyTextureTransform(ie,x.normalMap),F.normalTexture=ie}if(x.aoMap){var oe={index:this.processTexture(x.aoMap),texCoord:1};x.aoMapIntensity!==1&&(oe.strength=x.aoMapIntensity),this.applyTextureTransform(oe,x.aoMap),F.occlusionTexture=oe}x.transparent?F.alphaMode="BLEND":0<x.alphaTest&&(F.alphaMode="MASK",F.alphaCutoff=x.alphaTest),x.side===c.DoubleSide&&(F.doubleSided=!0),x.name!==""&&(F.name=x.name),this.serializeUserData(x,F),this._invokeAll(function(X){X.writeMaterial&&X.writeMaterial(x,F)});var W=B.materials.push(F)-1;return I.materials.set(x,W),W}processMesh(x){var I=this.cache,B=this.json,F=[x.geometry.uuid];if(Array.isArray(x.material))for(var V=0,k=x.material.length;V<k;V++)F.push(x.material[V].uuid);else F.push(x.material.uuid);var G=F.join(":");if(I.meshes.has(G))return I.meshes.get(G);var J,ne=x.geometry;if(J=x.isLineSegments?h.LINES:x.isLineLoop?h.LINE_LOOP:x.isLine?h.LINE_STRIP:x.isPoints?h.POINTS:x.material.wireframe?h.LINES:h.TRIANGLES,ne.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var ae={},ie={},oe=[],W=[],X={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},j=ne.getAttribute("normal");j===void 0||this.isNormalizedNormalAttribute(j)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),ne.setAttribute("normal",this.createNormalizedNormalAttribute(j)));var re=null;for(var z in ne.attributes)if(z.substr(0,5)!=="morph"){var H=ne.attributes[z];z=X[z]||z.toUpperCase();var K=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(K.test(z)||(z="_"+z),I.attributes.has(this.getUID(H))){ie[z]=I.attributes.get(this.getUID(H));continue}re=null;var le=H.array;z!=="JOINTS_0"||le instanceof Uint16Array||le instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),re=new c.BufferAttribute(new Uint16Array(le),H.itemSize,H.normalized));var se=this.processAccessor(re||H,ne);se!==null&&(ie[z]=se,I.attributes.set(this.getUID(H),se))}if(j!==void 0&&ne.setAttribute("normal",j),Object.keys(ie).length===0)return null;if(x.morphTargetInfluences!==void 0&&0<x.morphTargetInfluences.length){var U=[],D=[],$={};if(x.morphTargetDictionary!==void 0)for(var Y in x.morphTargetDictionary)$[x.morphTargetDictionary[Y]]=Y;for(var ee=0;ee<x.morphTargetInfluences.length;++ee){var ce={},ve=!1;for(var be in ne.morphAttributes){if(be!="position"&&be!=="normal"&&be!=="color"){ve||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),ve=!0);continue}var ue=ne.morphAttributes[be][ee],me=be.toUpperCase();X[be]&&(me=X[be]);var te=ne.attributes[be];if(I.attributes.has(this.getUID(ue))){ce[me]=I.attributes.get(this.getUID(ue));continue}var he=te.clone();if(!ne.morphTargetsRelative)if(te)for(var ge=0,Ae=ue.count;ge<Ae;ge++)te.count>ge&&he.setXYZ(ge,ue.getX(ge)-te.getX(ge),ue.getY(ge)-te.getY(ge),ue.getZ(ge)-te.getZ(ge));else for(var Te=0,De=ue.count;Te<De;Te++)he.setXYZ(Te,0,0,0);ce[me]=this.processAccessor(he,ne),I.attributes.set(this.getUID(te),ce[me])}W.push(ce),U.push(x.morphTargetInfluences[ee]),x.morphTargetDictionary!==void 0&&D.push($[ee])}ae.weights=U,0<D.length&&(ae.extras={},ae.extras.targetNames=D)}var Ye=Array.isArray(x.material);if(Ye&&ne.groups.length===0)return null;for(var ze,st=Ye?x.material:[x.material],Ce=Ye?ne.groups:[{materialIndex:0,start:void 0,count:void 0}],He=0,Ge=Ce.length;He<Ge;He++){if(ze={mode:J,attributes:ie},this.serializeUserData(ne,ze),0<W.length&&(ze.targets=W),ne.index!==null){var It=this.getUID(ne.index);(Ce[He].start!==void 0||Ce[He].count!==void 0)&&(It+=":"+Ce[He].start+":"+Ce[He].count),I.attributes.has(It)?ze.indices=I.attributes.get(It):(ze.indices=this.processAccessor(ne.index,ne,Ce[He].start,Ce[He].count),I.attributes.set(It,ze.indices)),ze.indices===null&&delete ze.indices}var Ot=this.processMaterial(st[Ce[He].materialIndex]);Ot!==null&&(ze.material=Ot),oe.push(ze)}ae.primitives=oe,B.meshes||(B.meshes=[]),this._invokeAll(function(bt){bt.writeMesh&&bt.writeMesh(x,ae)});var mt=B.meshes.push(ae)-1;return I.meshes.set(G,mt),mt}processCamera(x){var I=this.json;I.cameras||(I.cameras=[]);var B=x.isOrthographicCamera,F={type:B?"orthographic":"perspective"};return B?F.orthographic={xmag:2*x.right,ymag:2*x.top,zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near}:F.perspective={aspectRatio:x.aspect,yfov:c.MathUtils.degToRad(x.fov),zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near},x.name!==""&&(F.name=x.type),I.cameras.push(F)-1}processAnimation(x,I){var B=this.json,F=this.nodeMap;B.animations||(B.animations=[]),x=f.Utils.mergeMorphTargetTracks(x.clone(),I);for(var V=x.tracks,k=[],G=[],J=0;J<V.length;++J){var ne=V[J],ae=c.PropertyBinding.parseTrackName(ne.name),ie=c.PropertyBinding.findNode(I,ae.nodeName),oe=y[ae.propertyName];if(ae.objectName==="bones"&&(ie.isSkinnedMesh===!0?ie=ie.skeleton.getBoneByName(ae.objectIndex):ie=void 0),!ie||!oe)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',ne.name),null;var W=1,X=ne.values.length/ne.times.length;oe===y.morphTargetInfluences&&(X/=ie.morphTargetInfluences.length);var j=void 0;ne.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(j="CUBICSPLINE",X/=3):ne.getInterpolation()===c.InterpolateDiscrete?j="STEP":j="LINEAR",G.push({input:this.processAccessor(new c.BufferAttribute(ne.times,W)),output:this.processAccessor(new c.BufferAttribute(ne.values,X)),interpolation:j}),k.push({sampler:G.length-1,target:{node:F.get(ie),path:oe}})}return B.animations.push({name:x.name||"clip_"+B.animations.length,samplers:G,channels:k}),B.animations.length-1}processSkin(x){var I=this.json,B=this.nodeMap,F=I.nodes[B.get(x)],V=x.skeleton;if(V===void 0)return null;var k=x.skeleton.bones[0];if(k===void 0)return null;for(var G=[],J=new Float32Array(16*V.bones.length),ne=new c.Matrix4,ae=0;ae<V.bones.length;++ae)G.push(B.get(V.bones[ae])),ne.copy(V.boneInverses[ae]),ne.multiply(x.bindMatrix).toArray(J,16*ae);I.skins===void 0&&(I.skins=[]),I.skins.push({inverseBindMatrices:this.processAccessor(new c.BufferAttribute(J,16)),joints:G,skeleton:B.get(k)});var ie=F.skin=I.skins.length-1;return ie}processNode(x){var I=this.json,B=this.options,F=this.nodeMap;I.nodes||(I.nodes=[]);var V={};if(B.trs){var k=x.quaternion.toArray(),G=x.position.toArray(),J=x.scale.toArray();S(k,[0,0,0,1])||(V.rotation=k),S(G,[0,0,0])||(V.translation=G),S(J,[1,1,1])||(V.scale=J)}else x.matrixAutoUpdate&&x.updateMatrix(),M(x.matrix)===!1&&(V.matrix=x.matrix.elements);if(x.name!==""&&(V.name=x.name+""),this.serializeUserData(x,V),x.isMesh||x.isLine||x.isPoints){var ne=this.processMesh(x);ne!==null&&(V.mesh=ne)}else x.isCamera&&(V.camera=this.processCamera(x));if(x.isSkinnedMesh&&this.skins.push(x),0<x.children.length){for(var ae,ie=[],oe=0,W=x.children.length;oe<W;oe++)if(ae=x.children[oe],ae.visible||B.onlyVisible===!1){var X=this.processNode(ae);X!==null&&ie.push(X)}0<ie.length&&(V.children=ie)}this._invokeAll(function(re){re.writeNode&&re.writeNode(x,V)});var j=I.nodes.push(V)-1;return F.set(x,j),j}processScene(x){var I=this.json,B=this.options;I.scenes||(I.scenes=[],I.scene=0);var F={};x.name!==""&&(F.name=x.name),I.scenes.push(F);for(var V,k=[],G=0,J=x.children.length;G<J;G++)if(V=x.children[G],V.visible||B.onlyVisible===!1){var ne=this.processNode(V);ne!==null&&k.push(ne)}0<k.length&&(F.nodes=k),this.serializeUserData(x,F)}processObjects(x){var I=new c.Scene;I.name="AuxScene";for(var B=0;B<x.length;B++)I.children.push(x[B]);this.processScene(I)}processInput(x){var I=this.options;x=x instanceof Array?x:[x],this._invokeAll(function(G){G.beforeParse&&G.beforeParse(x)});for(var B=[],F=0;F<x.length;F++)x[F]instanceof c.Scene?this.processScene(x[F]):B.push(x[F]);0<B.length&&this.processObjects(B);for(var V=0;V<this.skins.length;++V)this.processSkin(this.skins[V]);for(var k=0;k<I.animations.length;++k)this.processAnimation(I.animations[k].clip,I.animations[k].mesh);this._invokeAll(function(G){G.afterParse&&G.afterParse(x)})}_invokeAll(x){for(var I=0,B=this.plugins.length;I<B;I++)x(this.plugins[I])}}class A{constructor(x){this.writer=x,this.name="KHR_lights_punctual"}writeNode(x,I){if(x.isLight){if(!x.isDirectionalLight&&!x.isPointLight&&!x.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",x);var B=this.writer,F=B.json,V=B.extensionsUsed,k={};x.name&&(k.name=x.name),k.color=x.color.toArray(),k.intensity=x.intensity,x.isDirectionalLight?k.type="directional":x.isPointLight?(k.type="point",0<x.distance&&(k.range=x.distance)):x.isSpotLight&&(k.type="spot",0<x.distance&&(k.range=x.distance),k.spot={},k.spot.innerConeAngle=-1*((x.penumbra-1)*x.angle),k.spot.outerConeAngle=x.angle),x.decay!==void 0&&x.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),x.target&&(x.target.parent!==x||x.target.position.x!==0||x.target.position.y!==0||x.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),V[this.name]||(F.extensions=F.extensions||{},F.extensions[this.name]={lights:[]},V[this.name]=!0);var G=F.extensions[this.name].lights;G.push(k),I.extensions=I.extensions||{},I.extensions[this.name]={light:G.length-1}}}}class L{constructor(x){this.writer=x,this.name="KHR_materials_unlit"}writeMaterial(x,I){if(x.isMeshBasicMaterial){var B=this.writer,F=B.extensionsUsed;I.extensions=I.extensions||{},I.extensions[this.name]={},F[this.name]=!0,I.pbrMetallicRoughness.metallicFactor=0,I.pbrMetallicRoughness.roughnessFactor=.9}}}class R{constructor(x){this.writer=x,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(x,I){if(x.isGLTFSpecularGlossinessMaterial){var B=this.writer,F=B.extensionsUsed,V={};I.pbrMetallicRoughness.baseColorFactor&&(V.diffuseFactor=I.pbrMetallicRoughness.baseColorFactor);var k=[1,1,1];if(x.specular.toArray(k,0),V.specularFactor=k,V.glossinessFactor=x.glossiness,I.pbrMetallicRoughness.baseColorTexture&&(V.diffuseTexture=I.pbrMetallicRoughness.baseColorTexture),x.specularMap){var G={index:B.processTexture(x.specularMap)};B.applyTextureTransform(G,x.specularMap),V.specularGlossinessTexture=G}I.extensions=I.extensions||{},I.extensions[this.name]=V,F[this.name]=!0}}}f.Utils={insertKeyframe:function(x,I){var B,F=.001,V=x.getValueSize(),k=new x.TimeBufferType(x.times.length+1),G=new x.ValueBufferType(x.values.length+V),J=x.createInterpolant(new x.ValueBufferType(V));if(x.times.length===0){k[0]=I;for(var ne=0;ne<V;ne++)G[ne]=0;B=0}else if(I<x.times[0]){if(Math.abs(x.times[0]-I)<F)return 0;k[0]=I,k.set(x.times,1),G.set(J.evaluate(I),0),G.set(x.values,V),B=0}else if(I>x.times[x.times.length-1]){if(Math.abs(x.times[x.times.length-1]-I)<F)return x.times.length-1;k[k.length-1]=I,k.set(x.times,0),G.set(x.values,0),G.set(J.evaluate(I),x.values.length),B=k.length-1}else for(var ae=0;ae<x.times.length;ae++){if(Math.abs(x.times[ae]-I)<F)return ae;if(x.times[ae]<I&&x.times[ae+1]>I){k.set(x.times.slice(0,ae+1),0),k[ae+1]=I,k.set(x.times.slice(ae+1),ae+2),G.set(x.values.slice(0,(ae+1)*V),0),G.set(J.evaluate(I),(ae+1)*V),G.set(x.values.slice((ae+1)*V),(ae+2)*V),B=ae+1;break}}return x.times=k,x.values=G,B},mergeMorphTargetTracks:function(x,I){for(var B=[],F={},V=x.tracks,k=0;k<V.length;++k){var G=V[k],J=c.PropertyBinding.parseTrackName(G.name),ne=c.PropertyBinding.findNode(I,J.nodeName);if(J.propertyName!=="morphTargetInfluences"||J.propertyIndex===void 0){B.push(G);continue}if(G.createInterpolant!==G.InterpolantFactoryMethodDiscrete&&G.createInterpolant!==G.InterpolantFactoryMethodLinear){if(G.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),G=G.clone(),G.setInterpolation(c.InterpolateLinear)}var ae=ne.morphTargetInfluences.length,ie=ne.morphTargetDictionary[J.propertyIndex];if(ie===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+J.propertyIndex);var oe=void 0;if(F[ne.uuid]===void 0){oe=G.clone();for(var W=new oe.ValueBufferType(ae*oe.times.length),X=0;X<oe.times.length;X++)W[X*ae+ie]=oe.values[X];oe.name=(J.nodeName||"")+".morphTargetInfluences",oe.values=W,F[ne.uuid]=oe,B.push(oe);continue}var j=G.createInterpolant(new G.ValueBufferType(1));oe=F[ne.uuid];for(var re=0;re<oe.times.length;re++)oe.values[re*ae+ie]=j.evaluate(oe.times[re]);for(var z,H=0;H<G.times.length;H++)z=this.insertKeyframe(oe,G.times[H]),oe.values[z*ae+ie]=G.values[H]}return x.tracks=B,x}}},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var T=this;this.setFromObject=M=>{var{nearPlane:C,farPlane:_,eyePosition:P,targetPosition:E,upVector:O}=M;T.nearPlane=C,T.farPlane=_,T.eyePosition=P,T.targetPosition=E,T.upVector=O}},p=function(T,M,C,_){var P={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},E={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6,KEYBOARD_ZOOM:7,KEYBOARD_ROTATE:8,KEYBOARD_PAN:9},O={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},A={ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40,NUMPADADD:107,NUMPADSUBTRACT:109,EQUAL:187,MINUS:189},L={};L.MAIN=E.ROTATE,L.AUXILIARY=E.ZOOM,L.SECONDARY=E.PAN,this.cameraObject=T,this.domElement=M===void 0?document:M,this.renderer=C,this.scene=_,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.zoomRate=50,this.rotateRate=50,this.panRate=100,this.pixelHeight=1;var R=6e3,N=!0,x=0,I=void 0,B=void 0,F=!1,V=500,k=void 0,G="default",J=P.DEFAULT,ne=void 0,ae=void 0,ie=void 0,oe=0,W=O.FREE;this._state=E.NONE;var X;this.targetTouchId=-1;var j=void 0,re=new c.Vector3,z=new c.Vector3,H=new c.Vector3,K=new c.Vector3,le=new c.Vector3,se=new c.Vector3,U=new c.Vector3,D=new c.Vector3,$=new c.Sphere,Y=new c.Vector3,ee=!1,ce=void 0,ve=0,be={default:new h};be.default.nearPlane=.1,be.default.farPlane=2e3,be.default.eyePosition=[0,0,0],be.default.targetPosition=[0,0,-1],be.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...be.default.targetPosition)),this.calculateMaxAllowedDistance=Q=>{var we=Q.getBoundingBox();if(we){we.getBoundingSphere($),ve=6*$.radius;var Ee=0;this.cameraObject&&(Ee=this.cameraObject.position.distanceTo($.center)),ve=Ee>ve?1.5*Ee:ve}else ve=0},this.addViewport=(Q,we)=>{Q&&we&&(be[Q]=we)},this.setDefaultViewport=Q=>!!(Q&&Q in be)&&(G=Q,!0),this.getDefaultViewport=()=>G,this.getViewportOfName=Q=>be[Q],this.setCurrentViewport=Q=>Q in be&&(this.setCurrentCameraSettings(be[Q]),!0),this.setRotationMode=Q=>{switch(Q){case"none":W=O.NONE;break;case"horizontal":W=O.HORIZONTAL;break;case"vertical":W=O.VERTICAL;break;case"free":default:W=O.FREE}},this.onResize=()=>{j&&(j=void 0),ce&&ce.setCurrentCameraSettings(this.cameraObject,be[G])},this.getVisibleHeightAtZDepth=Q=>{var we=this.cameraObject.position.distanceTo(this.cameraObject.target);Q<we?Q-=we:Q+=we;var Ee=this.cameraObject.fov*Math.PI/180;return 2*Math.tan(Ee/2)*Math.abs(Q)},this.calculateHeightPerPixelAtZeroDepth=Q=>{var we=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=we/Q,this.pixelHeight},this.getNDCFromDocumentCoords=(Q,we,Ee)=>{Ce(!1);var Be=Ee||new c.Vector2,Ke=2*((Q-j.left)/j.width)-1,Z=2*-((we-j.top)/j.height)+1;return Be.set(Ke,Z)},this.getRelativeCoordsFromNDC=(Q,we,Ee)=>{Ce(!1);var Be=Ee||new c.Vector2;return Be.x=(Q+1)*j.width/2,Be.y=(1-we)*j.height/2,Be},this.setMouseButtonAction=(Q,we)=>{L[Q]=E[we]};var ue=(Q,we)=>{Q instanceof HTMLCanvasElement&&(Q.tabIndex=we)},me=()=>{if(0<ve){var Q=Y.distanceTo($.center);return ve>Q||this.cameraObject.position.distanceTo($.center)>Q}return!0},te=Q=>{Y.copy(this.cameraObject.position).add(Q),me()&&(this.cameraObject.target.add(Q),this.cameraObject.position.add(Q),this.updateDirectionalLight())},he=Q=>{Ce(!1);var we;if(J===P.DEFAULT&&(we=this.scene.getNormalisedMinimapCoordinates(this.renderer,Q)),!we)Q.button==0?Q.ctrlKey?this._state=L.AUXILIARY:Q.shiftKey?this._state=L.SECONDARY:this._state=L.MAIN:Q.button==1?(Q.preventDefault(),this._state=L.AUXILIARY):Q.button==2&&(this._state=L.SECONDARY),this.pointer_x=Q.clientX-j.left,this.pointer_y=Q.clientY-j.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{J=P.MINIMAP;var Ee=this.scene.getMinimapDiffFromNormalised(we.x,we.y);te(Ee)}},ge=Q=>{if(Ce(!1),j)if(this.pointer_x=Q.clientX-j.left,this.pointer_y=Q.clientY-j.top,J===P.MINIMAP){var we=this.scene.getNormalisedMinimapCoordinates(this.renderer,Q);if(we){var Ee=this.scene.getMinimapDiffFromNormalised(we.x,we.y);te(Ee)}}else this._state===E.NONE&&X!==void 0&&X.move(this,Q.clientX,Q.clientY,this.renderer)},Ae=Q=>{this._state=E.NONE,J==P.MINIMAP&&(J=P.DEFAULT),X!==void 0&&this.pointer_x_start==Q.clientX-j.left&&this.pointer_y_start==Q.clientY-j.top&&X.pick(this,Q.clientX,Q.clientY,this.renderer)},Te=Q=>{this._state=E.NONE},De=Q=>{Ce(!1);var we=Q.touches.length;if(we==1){var Ee,Be;this._state=E.TOUCH_ROTATE,this.pointer_x=Q.touches[0].clientX-((Ee=j)===null||Ee===void 0?void 0:Ee.left),this.pointer_y=Q.touches[0].clientY-((Be=j)===null||Be===void 0?void 0:Be.top),this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}else if(we==2){this._state=E.TOUCH_ZOOM;var Ke=Q.touches[0].clientX-Q.touches[1].clientX,Z=Q.touches[0].clientY-Q.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Ke*Ke+Z*Z)}else if(we==3){var pe,de;this._state=E.TOUCH_PAN,this.targetTouchId=Q.touches[0].identifier,this.pointer_x=Q.touches[0].clientX-((pe=j)===null||pe===void 0?void 0:pe.left),this.pointer_y=Q.touches[0].clientY-((de=j)===null||de===void 0?void 0:de.top),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}},Ye=Q=>{Q.preventDefault(),Q.stopPropagation();var we=Q.touches.length;if(we==1)this.pointer_x=Q.touches[0].clientX-j.left,this.pointer_y=Q.touches[0].clientY-j.top;else if(we==2){if(this._state===E.TOUCH_ZOOM){var Ee=Q.touches[0].clientX-Q.touches[1].clientX,Be=Q.touches[0].clientY-Q.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ee*Ee+Be*Be)}}else if(we==3&&this._state===E.TOUCH_PAN)for(var Ke=0;3>Ke;Ke++)Q.touches[Ke].identifier==this.targetTouchId&&(this.pointer_x=Q.touches[0].clientX-j.left,this.pointer_y=Q.touches[0].clientY-j.top)},ze=Q=>{var we=Q.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=E.NONE,we==1&&X!==void 0&&this.pointer_x_start==Q.touches[0].clientX-j.left&&this.pointer_y_start==Q.touches[0].clientY-j.top&&X.pick(this.cameraObject,Q.touches[0].clientX,Q.touches[0].clientY,this.renderer)},st=()=>{Ce(!0)},Ce=Q=>{if(Q||j===void 0){var we=new IntersectionObserver(Ee=>{for(var Be of Ee)j=Be.boundingClientRect;we.disconnect()});we.observe(this.domElement)}},He=Q=>{Ce(!1),this._state=E.SCROLL;var we=0;0<Q.deltaY?we=this.zoomRate:0>Q.deltaY&&(we=-1*this.zoomRate),oe+=we,Q.preventDefault(),Q.stopImmediatePropagation()},Ge=Q=>{Ce(!1);var we=0;if(Q.keyCode===A.EQUAL||Q.keyCode===A.MINUS||Q.keyCode===A.NUMPADADD||Q.keyCode===A.NUMPADSUBTRACT){this._state=E.KEYBOARD_ZOOM;var Ee=1;Q.shiftKey&&(Ee*=2),Q.keyCode===A.EQUAL||Q.keyCode===A.NUMPADADD?we=-1*(this.zoomRate*Ee):(Q.keyCode===A.MINUS||Q.keyCode===A.NUMPADSUBTRACT)&&(we=this.zoomRate*Ee),oe+=we}else(Q.keyCode===A.ARROWLEFT||Q.keyCode===A.ARROWUP||Q.keyCode===A.ARROWRIGHT||Q.keyCode===A.ARROWDOWN)&&(Q.shiftKey?(this._state=E.KEYBOARD_ROTATE,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,we=this.rotateRate):(this._state=E.KEYBOARD_PAN,we=this.panRate),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,Q.keyCode===A.ARROWLEFT?this.pointer_x-=we:Q.keyCode===A.ARROWUP?this.pointer_y-=we:Q.keyCode===A.ARROWRIGHT?this.pointer_x+=we:Q.keyCode===A.ARROWDOWN&&(this.pointer_y+=we));Object.values(A).includes(Q.keyCode)&&Q.preventDefault()},It=Q=>{this._state=E.NONE},Ot=()=>{if(typeof this.cameraObject<"u"){var Q=j.height,we=this.cameraObject.position.distanceTo(this.cameraObject.target),Ee=0;this.cameraObject.far>this.cameraObject.near&&we>=this.cameraObject.near&&we<=this.cameraObject.far&&(Ee=(we-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),z.set(this.previous_pointer_x,Q-this.previous_pointer_y,0),H.set(this.previous_pointer_x,Q-this.previous_pointer_y,1),K.set(this.pointer_x,Q-this.pointer_y,0),le.set(this.pointer_x,Q-this.pointer_y,1),z.unproject(this.cameraObject),H.unproject(this.cameraObject),K.unproject(this.cameraObject),le.unproject(this.cameraObject);var Be=-.002;K.sub(z).multiplyScalar(1-Ee),le.sub(H).multiplyScalar(Ee),K.add(le).multiplyScalar(Be),te(K)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(Q,we)=>{Q.normalize(),U.copy(this.cameraObject.position).sub(this.cameraObject.target),D.copy(U),U.normalize(),.8<Math.abs(U.dot(Q))&&U.copy(this.cameraObject.up),z.crossVectors(Q,U).normalize(),H.crossVectors(Q,z);var Ee=Q.dot(D),Be=z.dot(D),Ke=H.dot(D),Z=Q.dot(this.cameraObject.up),pe=z.dot(this.cameraObject.up),de=H.dot(this.cameraObject.up),ye=Math.cos(we),Me=Math.sin(we);return K.set(ye*z.x+Me*H.x,ye*z.y+Me*H.y,ye*z.z+Me*H.z),le.set(ye*H.x-Me*z.x,ye*H.y-Me*z.y,ye*H.z-Me*z.z),U.copy(this.cameraObject.target),U.x=U.x+Q.x*Ee+K.x*Be+le.x*Ke,U.y=U.y+Q.y*Ee+K.y*Be+le.y*Ke,U.z=U.z+Q.z*Ee+K.z*Be+le.z*Ke,re.set(Q.x*Z+K.x*pe+le.x*de,Q.y*Z+K.y*pe+le.y*de,Q.z*Z+K.z*pe+le.z*de),{position:U,up:re}},this.rotateAboutLookAtpoint=(Q,we)=>{var Ee=this.getVectorsFromRotateAboutLookAtPoints(Q,we);this.cameraObject.position.copy(Ee.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ee.up)};var mt=()=>{if(typeof this.cameraObject<"u"){var Q,we,Ee=(Q=j)===null||Q===void 0?void 0:Q.width,Be=(we=j)===null||we===void 0?void 0:we.height;if(0<Ee&&0<Be){var Ke=.25*(Ee+Be),Z=0,pe=0;(W===O.FREE||W===O.HORIZONTAL)&&(Z=this.pointer_x-this.previous_pointer_x),(W===O.FREE||W===O.VERTICAL)&&(pe=this.previous_pointer_y-this.pointer_y);var de=Math.sqrt(Z*Z+pe*pe);if(0<de){var ye=1*-pe/de,Me=1*Z/de,fe=0;W===O.FREE&&ye*(this.pointer_x-.5*(Ee-1))+Me*(.5*(Be-1)-this.pointer_y);var xe=Math.acos(fe/Ke)-.5*Math.PI,_e=this.tumble_rate*de/Ke;re.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),z.copy(this.cameraObject.up).normalize(),H.copy(z).cross(re).normalize().multiplyScalar(ye),z.multiplyScalar(Me),se.addVectors(H,z).multiplyScalar(Math.cos(xe)),re.multiplyScalar(Math.sin(xe)),se.add(re),this.rotateAboutLookAtpoint(se,-_e)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},bt=()=>{var Q=0;return this._state===E.ZOOM?Q=this.previous_pointer_y-this.pointer_y:this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM?Q=oe:(Q=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),Q};this.changeZoomByScrollRateUnit=Q=>{var we=Q*this.zoomRate;this.changeZoomByValue(we)},this.changeZoomByValue=Q=>{if(typeof this.cameraObject<"u"){var we=j.height,Ee=this.cameraObject.position.clone();Ee.sub(this.cameraObject.target);var Be=Ee.length(),Ke=1.5*Q/we;if(.01<Be+Ke*Be&&(Ee.normalize(),Y.copy(this.cameraObject.position),Y.x+=Ee.x*Ke*Be,Y.y+=Ee.y*Ke*Be,Y.z+=Ee.z*Ke*Be,me())){this.cameraObject.position.copy(Y),this.updateDirectionalLight();var Z=1e-5;if(Z*this.cameraObject.far<this.cameraObject.near+Ke*Be+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=Ke*Be,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=Ke*Be,this.cameraObject.far+=Ke*Be));else{if(this.near_plane_fly_debt==0){var pe=this.cameraObject.near-Z*this.cameraObject.far;this.cameraObject.near=Z*this.cameraObject.far,this.cameraObject.far-=pe,this.near_plane_fly_debt-=Z*this.cameraObject.far}this.near_plane_fly_debt+=Ke*Be}ee=!0}}};var Ii=()=>{var Q=bt();this.changeZoomByValue(Q),this._state===E.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),(this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM)&&(oe=0,this._state=E.NONE)};this.setDirectionalLight=Q=>{this.directionalLight=Q},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){N=!0,this.domElement&&this.domElement.addEventListener&&(ue(this.domElement,0),this.domElement.addEventListener("mousedown",he,!1),this.domElement.addEventListener("mousemove",ge,!1),this.domElement.addEventListener("mouseup",Ae,!1),this.domElement.addEventListener("mouseleave",Te,!1),this.domElement.addEventListener("touchstart",De,!1),this.domElement.addEventListener("touchmove",Ye,!1),this.domElement.addEventListener("touchend",ze,!1),this.domElement.addEventListener("wheel",He,!1),this.domElement.addEventListener("mouseenter",st,!1),this.domElement.addEventListener("contextmenu",Q=>{Q.preventDefault()},!1),this.domElement.addEventListener("keydown",Ge,!1),this.domElement.addEventListener("keyup",It,!1))},this.disable=function(){N=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",he,!1),this.domElement.removeEventListener("mousemove",ge,!1),this.domElement.removeEventListener("mouseup",Ae,!1),this.domElement.removeEventListener("mouseleave",Te,!1),this.domElement.removeEventListener("touchstart",De,!1),this.domElement.removeEventListener("touchmove",Ye,!1),this.domElement.removeEventListener("touchend",ze,!1),this.domElement.removeEventListener("wheel",He,!1),this.domElement.removeEventListener("mouseenter",st,!1),this.domElement.removeEventListener("contextmenu",Q=>{Q.preventDefault()},!1),this.domElement.removeEventListener("keydown",Ge,!1),this.domElement.removeEventListener("keyup",It,!1),ue(this.domElement,-1))},this.loadPath=Q=>{I=Q.CameraPath,B=Q.NumberOfPoints},this.loadPathURL=(Q,we)=>{var Ee=new XMLHttpRequest;Ee.onreadystatechange=()=>{if(Ee.readyState==4&&Ee.status==200){var Ke=JSON.parse(Ee.responseText);this.loadPath(Ke),we!=null&&typeof we=="function"&&we()}};var Be=f(Q);Ee.open("GET",Be,!0),Ee.send()},this.setPathDuration=Q=>{R=Q,ne&&ne.setDuration(R),ae&&ae.setDuration(R)},this.getPlayRate=()=>V,this.setPlayRate=Q=>{V=Q};var Oi=Q=>{var we=x+Q;we>R&&(we-=R),x=we};this.getTime=()=>x,this.setTime=Q=>{x=Q>R?R:0>Q?0:Q},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2<B){var Q=x/R*(B-1),we=Math.floor(Q),Ee=1-(Q-we),Be=Math.ceil(Q);return we==Be?we==B-1?[we-1,Be,0]:[we,Be+1,1]:[we,Be,Ee]}return B==1?[0,0,0]:void 0},this.setCurrentTimeFrame=Q=>{2<B&&(x=R*Q/(B-1),0>x&&(x=0),x>R&&(x=R))};var zn=Q=>{if(J===P.PATH&&(Oi(Q),I)){for(var we=this.getCurrentTimeFrame(),Ee=we[0],Be=we[1],Ke=we[2],Z=[I[3*Ee],I[3*Ee+1],I[3*Ee+2]],pe=[I[3*Be],I[3*Be+1],I[3*Be+2]],de=[],ye=0;ye<Z.length;ye++)de.push(Ke*Z[ye]+(1-Ke)*pe[ye]);this.cameraObject.position.set(de[0],de[1],de[2]),this.cameraObject.target.set(pe[0],pe[1],pe[2]),k&&this.cameraObject.lookAt(this.cameraObject.target),F&&(this.directionalLight.position.set(de[0],de[1],de[2]),this.directionalLight.target.position.set(pe[0],pe[1],pe[2]))}};this.calculatePathNow=()=>{zn(0)};var ns=()=>{this._state===E.ROTATE||this._state===E.TOUCH_ROTATE||this._state===E.KEYBOARD_ROTATE?mt():this._state===E.PAN||this._state===E.TOUCH_PAN||this._state===E.KEYBOARD_PAN?(Ot(),ce.triggerCallback()):(this._state===E.ZOOM||this._state===E.TOUCH_ZOOM||this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM)&&(ce.zoom(bt()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,(this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM)&&(this._state=E.NONE),oe=0,ce.triggerCallback())};this.update=Q=>{var we=Q*V,Ee=N,Be=!0;return J===P.PATH?zn(we):J===P.SMOOTH_CAMERA_TRANSITION&&ne?(ne.update(we),ne.isTransitionCompleted()&&(J=P.DEFAULT),Ee=!1):J===P.ROTATE_CAMERA_TRANSITION&&ae?(ae.update(we),ae.isTransitionCompleted()&&(J=P.DEFAULT),Ee=!1):J===P.AUTO_TUMBLE&&ie?ie.update(we):J===P.SYNC_CONTROL&&ce?(ns(),Ee=!1):Be=!1,Ee&&(this._state!==E.NONE&&(Be=!0),this._state===E.ROTATE||this._state===E.TOUCH_ROTATE||this._state===E.KEYBOARD_ROTATE?mt():this._state===E.PAN||this._state===E.TOUCH_PAN||this._state===E.KEYBOARD_PAN?Ot():(this._state===E.ZOOM||this._state===E.TOUCH_ZOOM||this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM)&&Ii(),this._state!==E.NONE&&J===P.AUTO_TUMBLE&&ie&&ie.stopOnCameraInput,this._state===E.SCROLL&&(this._state=E.NONE)),k?(Be=!0,k.update()):this.cameraObject.lookAt(this.cameraObject.target),Be=Be||ee,ee=!1,Be},this.playPath=()=>{J=P.PATH},this.stopPath=()=>{J=P.DEFAULT},this.isPlayingPath=()=>J===P.PATH,this.enableDirectionalLightUpdateWithPath=Q=>{F=Q},this.enableDeviceOrientation=()=>{k||(k=new w(this.cameraObject))},this.disableDeviceOrientation=()=>{k&&(k.dispose(),k=void 0)},this.isDeviceOrientationEnabled=()=>!!k,this.resetView=()=>{var Q=be[G];this.cameraObject.near=Q.nearPlane,this.cameraObject.far=Q.farPlane,this.cameraObject.position.set(Q.eyePosition[0],Q.eyePosition[1],Q.eyePosition[2]),this.cameraObject.target.set(Q.targetPosition[0],Q.targetPosition[1],Q.targetPosition[2]),this.cameraObject.up.set(Q.upVector[0],Q.upVector[1],Q.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=Q=>{Q.nearPlane&&(this.cameraObject.near=Q.nearPlane),Q.farPlane&&(this.cameraObject.far=Q.farPlane),Q.eyePosition&&this.cameraObject.position.set(Q.eyePosition[0],Q.eyePosition[1],Q.eyePosition[2]),Q.targetPosition&&this.cameraObject.target.set(Q.targetPosition[0],Q.targetPosition[1],Q.targetPosition[2]),Q.upVector&&this.cameraObject.up.set(Q.upVector[0],Q.upVector[1],Q.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight(),ee=!0},this.getViewportFromCentreAndRadius=(Q,we,Ee,Be,Ke,Z)=>{var pe=this.cameraObject.position.x-this.cameraObject.target.x,de=this.cameraObject.position.y-this.cameraObject.target.y,ye=this.cameraObject.position.z-this.cameraObject.target.z,Me=1/Math.sqrt(pe*pe+de*de+ye*ye);pe*=Me,de*=Me,ye*=Me;var fe=[Q,we,Ee],xe=Be/Math.tan(Ke*Math.PI/360),_e=[Q+pe*xe,we+de*xe,Ee+ye*xe],Pe=xe+Z,Oe=0,Ue=.95;Oe=Z>Ue*xe?(1-Ue)*xe:xe-Z;var Fe=new h;return Fe.nearPlane=Oe,Fe.farPlane=Pe,Fe.eyePosition=_e,Fe.targetPosition=fe,Fe.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],Fe},this.getViewportFromBoundingBox=(Q,we)=>{var Ee=Q.min.distanceTo(Q.max)/2*we,Be=(Q.min.x+Q.max.x)/2,Ke=(Q.min.y+Q.max.y)/2,Z=(Q.min.z+Q.max.z)/2,pe=4,de=this.getViewportFromCentreAndRadius(Be,Ke,Z,Ee,40,Ee*pe);return de},this.getCurrentViewport=()=>{var Q=new h;return Q.nearPlane=this.cameraObject.near,Q.farPlane=this.cameraObject.far,Q.eyePosition[0]=this.cameraObject.position.x,Q.eyePosition[1]=this.cameraObject.position.y,Q.eyePosition[2]=this.cameraObject.position.z,Q.targetPosition[0]=this.cameraObject.target.x,Q.targetPosition[1]=this.cameraObject.target.y,Q.targetPosition[2]=this.cameraObject.target.z,Q.upVector[0]=this.cameraObject.up.x,Q.upVector[1]=this.cameraObject.up.y,Q.upVector[2]=this.cameraObject.up.z,Q},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(Q,we,Ee)=>{ae==null&&(ne=new y(Q,we,this,Ee))},this.rotateCameraTransition=(Q,we,Ee)=>{ne==null&&(ae=new m(Q,we,this,Ee))},this.enableCameraTransition=()=>{ne&&(J=P.SMOOTH_CAMERA_TRANSITION),ae&&(J=P.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{J=P.DEFAULT},this.stopCameraTransition=()=>{J=P.DEFAULT,ne=void 0,ae=void 0},this.isTransitioningCamera=()=>J===P.SMOOTH_CAMERA_TRANSITION||J===P.ROTATE_CAMERA_TRANSITION,this.autoTumble=(Q,we,Ee)=>{ie=new b(Q,we,Ee,this)},this.enableAutoTumble=()=>{J=P.AUTO_TUMBLE},this.stopAutoTumble=()=>{J=P.DEFAULT,ie=void 0},this.updateAutoTumble=()=>{ie&&(ie.requireUpdate=!0)},this.isAutoTumble=()=>J===P.AUTO_TUMBLE,this.enableRaycaster=(Q,we,Ee)=>{X==null&&(X=new d(Q,this.scene,we,Ee,this.renderer))},this.disableRaycaster=()=>{X.disable(),X=void 0},this.isSyncControl=()=>currentMpde===P.SYNC_CONTROL,this.enableSyncControl=()=>(J=P.SYNC_CONTROL,ce||(ce=new S),ce.setCurrentCameraSettings(this.cameraObject,be[G]),ce),this.disableSyncControl=()=>{J=P.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},y=function(M,C,_,P){var E=M.eyePosition,O=M.targetPosition,A=M.upVector,L=C.eyePosition,R=C.targetPosition,N=C.upVector,x=_,I=P,B=0,F=!1;x.near=Math.min(M.nearPlane,C.nearPlane),x.far=Math.max(M.farPlane,C.farPlane),x.cameraObject.up.set(C.upVector[0],C.upVector[1],C.upVector[2]),this.setDuration=G=>{I=G};var V=G=>{var J=B+G;J>I&&(J=I),B=J},k=()=>{var G=B/I,J=[E[0]*(1-G)+L[0]*G,E[1]*(1-G)+L[1]*G,E[2]*(1-G)+L[2]*G],ne=[O[0]*(1-G)+R[0]*G,O[1]*(1-G)+R[1]*G,O[2]*(1-G)+R[2]*G];A[0]*(1-G)+N[0]*G,A[1]*(1-G)+N[1]*G,A[2]*(1-G)+N[2]*G,x.cameraObject.position.set(J[0],J[1],J[2]),x.cameraObject.target.set(ne[0],ne[1],ne[2])};this.update=G=>{this.enabled===!1||(V(G),k(),B==I&&(F=!0))},this.isTransitionCompleted=()=>F},m=function(M,C,_,P){var E=M,O=C,A=_,L=P,R=0,N=!1;this.setDuration=I=>{L=I};var x=I=>{var B=R,F=R+I;F>L&&(F=L),R=F;var V=R-B,k=V/L,G=k*O;A.rotateAboutLookAtpoint(E,G)};this.update=I=>{this.enabled===!1||(x(I),R==L&&(N=!0))},this.isTransitionCompleted=()=>N},d=function(M,C,_,P,E){var O=M,A=C,L=E,R=_,N=P,x=new c.Raycaster;x.params.Line.threshold=.1,x.params.Points.threshold=1;var I=new c.Vector2,B=!1,F=new Date,V=!1,k=0,G=[],J={zincCamera:void 0,x:-1,y:-1},ne=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=oe=>{if(A!==O){var W=O.getThreeJSScene();L.render(W,oe.cameraObject)}var X=ne||O.getPickableThreeJSObjects();return G.length=0,x.intersectObjects(X,!0,G)},this.setPickableObjects=oe=>{oe===void 0?ne=void 0:(ne=[],oe.forEach(W=>{W.getGroup()&&W.getGroup().visible&&ne.push(W.getGroup())}))},this.getIntersectsObjectWithOrigin=(oe,W,X)=>(x.set(W,X),this.getIntersectsObject(oe)),this.getIntersectsObjectWithCamera=(oe,W,X)=>(oe.getNDCFromDocumentCoords(W,X,I),x.setFromCamera(I,oe.cameraObject),this.getIntersectsObject(oe)),this.pick=(oe,W,X)=>{if(L&&O&&oe&&R){this.getIntersectsObjectWithCamera(oe,W,X);for(var j,re=G.length,z=0;z<re;z++)if(j=G[z].object?G[z].object.userData:void 0,j&&j.isMarkerCluster&&j.visible&&j.clusterIsVisible(G[z].object.clusterIndex)&&j.zoomToCluster(G[z].object.clusterIndex))return;R(G,W,X)}};var ae=(oe,W,X)=>{if(L&&O&&oe&&N){if(this.getIntersectsObjectWithCamera(oe,W,X),F.setTime(Date.now()),G.length===0){if(V)return;V=!0}else V=!1;N(G,W,X)}};this.move=(oe,W,X)=>{L&&O&&oe&&N&&(O.displayMarkers?ae(oe,W,X):(J.zincCamera=oe,J.x=W,J.y=X,!B&&(k=F?Date.now()-F.getTime():250,250<=k?ae(oe,W,X):(B=!0,setTimeout(ie(J),k)))))};var ie=oe=>function(){B=!1,ae(oe.zincCamera,oe.x,oe.y)}},b=function(M,C,_,P){var E=new c.Vector3,O=-C,A=P,L=M;this.stopOnCameraInput=_,this.requireUpdate=!0;var R=new c.Vector3,N=new c.Vector3,x=I=>{var B=Math.sqrt(I[0]*I[0]+I[1]*I[1]),F=4*Math.abs(I[0]),V=4*Math.abs(I[1]),k=.25*(F+V),G=-I[1]/B,J=I[0]/B,ne=G*I[0]+J*-I[1];ne>k?ne=k:ne<-k&&(ne=-k);var ae=Math.acos(ne/k)-.5*Math.PI;E.copy(A.cameraObject.position).sub(A.cameraObject.target).normalize(),R.copy(A.cameraObject.up).normalize(),N.crossVectors(R,E).normalize().multiplyScalar(G),R.multiplyScalar(J),R.add(N).multiplyScalar(Math.cos(ae)),E.multiplyScalar(Math.sin(ae)).add(R)};this.update=I=>{this.enabled===!1||(this.requireUpdate&&(x(L),this.requireUpdate=!1),A.rotateAboutLookAtpoint(E,O*I/1e3))}},v=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(v.prototype,{update:(()=>{var T,M,C,_,P,E,O=new c.Matrix4,A=new c.Matrix4;return function(R){var N=T!==R.focus||M!==R.fov||C!==R.aspect*this.aspect||_!==R.near||P!==R.far||E!==R.zoom;if(N){T=R.focus,M=R.fov,C=R.aspect*this.aspect,_=R.near,P=R.far,E=R.zoom;var x,I,B=R.projectionMatrix.clone(),F=.064/2,V=F*_/T,k=_*Math.tan(.5*(c.Math.DEG2RAD*M))/R.zoom;A.elements[12]=-F,O.elements[12]=F,x=-k*C+V,I=k*C+V,B.elements[0]=2*_/(I-x),B.elements[8]=(I+x)/(I-x),this.cameraL.projectionMatrix.copy(B),x=-k*C-V,I=k*C-V,B.elements[0]=2*_/(I-x),B.elements[8]=(I+x)/(I-x),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(R.matrixWorld).multiply(A),this.cameraR.matrixWorld.copy(R.matrixWorld).multiply(O)}})()});var g=function(M){var C=new v;C.aspect=.5,this.setSize=(_,P)=>{M.setSize(_,P)},this.render=(_,P)=>{_.updateMatrixWorld(),P.parent===null&&P.updateMatrixWorld(),C.update(P);var E=M.getSize();M.setScissorTest(!0),M.clear(),M.setScissor(0,0,E.width/2,E.height),M.setViewport(0,0,E.width/2,E.height),M.render(_,C.cameraL),M.setScissor(E.width/2,0,E.width/2,E.height),M.setViewport(E.width/2,0,E.width/2,E.height),M.render(_,C.cameraR),M.setScissorTest(!1)}},w=function(M){var C=this;this.object=M,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var _=O=>{C.deviceOrientation=O},P=()=>{typeof window<"u"&&(C.screenOrientation=window.orientation||0)},E=(()=>{var O=new c.Vector3(0,0,1),A=new c.Euler,L=new c.Quaternion,R=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(N,x,I,B,F)=>{var V=new c.Vector3(0,0,1);V.subVectors(N.target,N.position),A.set(I,x,-B,"YXZ");var k=new c.Quaternion;k.setFromEuler(A),k.multiply(R),k.multiply(L.setFromAxisAngle(O,-F)),V.applyQuaternion(k),V.addVectors(N.position,V),N.lookAt(V)}})();this.connect=()=>{P(),typeof window<"u"&&(window.addEventListener("orientationchange",P,!1),window.addEventListener("deviceorientation",_,!1)),C.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",P,!1),window.removeEventListener("deviceorientation",_,!1)),C.enabled=!1},this.update=()=>{if(C.enabled!==!1){var O=C.deviceOrientation.alpha?c.Math.degToRad(C.deviceOrientation.alpha):0,A=C.deviceOrientation.beta?c.Math.degToRad(C.deviceOrientation.beta):0,L=C.deviceOrientation.gamma?c.Math.degToRad(C.deviceOrientation.gamma):0,R=C.screenOrientation?c.Math.degToRad(C.screenOrientation):0;E(C.object,O,A,L,R)}},this.dispose=function(){this.disconnect()},this.connect()},S=function(){var M=void 0,C=void 0,_=void 0,P=new c.Vector3,E=new c.Vector3,O=new c.Vector3,A=new c.Vector3,L=void 0;this.setCurrentCameraSettings=(R,N)=>{M=R.clone(),C=R,_=N,M.near=_.nearPlane,_.farPlane&&(M.far=_.farPlane),_.eyePosition&&M.position.set(_.eyePosition[0],_.eyePosition[1],_.eyePosition[2]),_.upVector&&M.up.set(_.upVector[0],_.upVector[1],_.upVector[2]),_.targetPosition&&(M.target=new c.Vector3(_.targetPosition[0],_.targetPosition[1],_.targetPosition[2]),M.lookAt(M.target)),M.updateProjectionMatrix(),P.copy(M.position).project(M),E.copy(M.target).project(M)},this.getCurrentPosition=()=>(E.copy(C.target).project(M),[E.x,E.y]),this.zoom=R=>{var N=.002*R,x=Math.max(C.zoom-N,1);C.zoom=x,C.updateProjectionMatrix()},this.zoomToBox=(R,N)=>{R.getCenter(O),O.project(M),this.setCenterZoom([O.x,O.y],N)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:C.zoom}),this.setCenterZoom=(R,N)=>{O.set(R[0],R[1],E.z).unproject(M),A.copy(O).sub(C.target),C.target.copy(O),C.lookAt(C.target),C.position.add(A),C.zoom=N,C.updateProjectionMatrix()},this.setEventCallback=R=>{(R===void 0||typeof R=="function")&&(L=R)},this.triggerCallback=()=>{L!==void 0&&typeof L=="function"&&L()}};l.Viewport=h,l.CameraControls=p,l.SmoothCameraTransition=y,l.RotateCameraTransition=m,l.RayCaster=d,l.CameraAutoTumble=b,l.StereoEffect=g,l.NDCCameraControl=S},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),h=u(22).Pointset;u(24).Lines;var p=u(45).Lines2,y=u(3).Geometry,m=u(4),d=0,b=function(){return"re"+d++},v=function(g,w){var S=g,T=new c;T.matrixAutoUpdate=!1,T.userData=this;var M=[],C="",_=[],P=w,E=new f,O=3e3;E.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{M.forEach(A=>A.hideAllPrimitives()),_.forEach(A=>A.setVisibility(!1))},this.showAllPrimitives=()=>{M.forEach(A=>A.showAllPrimitives()),_.forEach(A=>A.setVisibility(!0))},this.setVisibility=A=>{A!=T.visible&&(T.visible=A,this.pickableUpdateRequired=!0)},this.getVisibility=()=>T.visible,this.getGroup=()=>T,this.setTransformation=A=>{E.set(...A),T.matrix.copy(E),T.updateMatrixWorld()},this.setName=A=>{A&&A!==""&&(C=A)},this.getName=()=>C,this.getParent=()=>S,this.getFullSeparatedPath=()=>{var A=[];if(C!==""){A.push(C);for(var L,R=S;R!==void 0;)L=R.getName(),L!==""&&A.unshift(L),R=R.getParent()}return A},this.getFullPath=()=>{var A=this.getFullSeparatedPath();if(0<A.length){var L=A.shift();return A.forEach(R=>{L=L.concat("/",R)}),L}return""},this.createChild=A=>{var L=new v(this,P);return L.setName(A),M.push(L),T.add(L.getGroup()),L},this.getChildWithName=A=>{if(A){for(var L=A.toLowerCase(),R=0;R<M.length;R++)if(M[R].getName().toLowerCase()===L)return M[R]}},this.findChildFromSeparatedPath=A=>{if(A&&0<A.length&&A[0]===""&&A.shift(),A&&0<A.length){var L=this.getChildWithName(A[0]);return L?(A.shift(),L.findChildFromSeparatedPath(A)):void 0}return this},this.findChildFromPath=A=>{var L=A.split("/");return this.findChildFromSeparatedPath(L)},this.createChildFromSeparatedPath=A=>{if(0<A.length&&A[0]===""&&A.shift(),0<A.length){var L=this.getChildWithName(A[0]);return L||(L=this.createChild(A[0])),A.shift(),L.createChildFromSeparatedPath(A)}return this},this.createChildFromPath=A=>{var L=A.split("/");return this.createChildFromSeparatedPath(L)},this.findOrCreateChildFromPath=A=>{var L=this.findChildFromPath(A);return L||(L=this.createChildFromPath(A)),L},this.addZincObject=A=>{A&&(A.setRegion(this),T.add(A.getGroup()),_.push(A),this.pickableUpdateRequired=!0,P&&P.triggerObjectAddedCallback(A))},this.removeZincObject=A=>{for(var L=0;L<_.length;L++)if(A===_[L])return T.remove(A.getGroup()),_.splice(L,1),P&&P.triggerObjectRemovedCallback(A),A.dispose(),void(this.pickableUpdateRequired=!0)},this.checkPickableUpdateRequred=A=>{if(this.pickableUpdateRequired)return!0;if(A){for(var L=!1,R=0;R<M.length;R++)if(L=M[R].checkPickableUpdateRequred(A),L)return!0}return!1},this.getPickableThreeJSObjects=(A,L)=>(T.visible&&(_.forEach(R=>{if(R.getGroup()&&R.getGroup().visible){var N=R.marker;N&&N.isEnabled()&&A.push(N.getMorph()),A.push(R.getGroup())}}),L&&M.forEach(R=>{R.getPickableThreeJSObjects(A,L)}),this.pickableUpdateRequired=!1),A),this.setDuration=A=>{O=A,_.forEach(L=>L.setDuration(A)),M.forEach(L=>L.setDuration(A))},this.getDuration=()=>O,this.getBoundingBox=A=>{var L,R;return _.forEach(N=>{R=N.getBoundingBox(),R&&(L==null?L=R.clone():L.union(R))}),A&&M.forEach(N=>{R=N.getBoundingBox(A),R&&(L==null?L=R.clone():L.union(R))}),L},this.clear=A=>{A&&M.forEach(L=>L.clear(A)),_.forEach(L=>{T.remove(L.getGroup()),L.dispose()}),M=[],_=[]},this.objectIsInRegion=(A,L)=>{for(var R=0;R<_.length;R++)if(A===_[R])return!0;if(L){for(var N=0;N<M.length;N++)if(M[N].objectIsInRegion(A,L))return!0}return!1},this.forEachGeometry=(A,L)=>{_.forEach(R=>{R.isGeometry&&A(R)}),L&&M.forEach(R=>R.forEachGeometry(A,L))},this.forEachGlyphset=(A,L)=>{_.forEach(R=>{R.isGlyphset&&A(R)}),L&&M.forEach(R=>R.forEachGlyphset(A,L))},this.forEachPointset=(A,L)=>{_.forEach(R=>{R.isPointset&&A(R)}),L&&M.forEach(R=>R.forEachPointset(A,L))},this.forEachLine=(A,L)=>{_.forEach(R=>{R.isLines&&A(R)}),L&&M.forEach(R=>R.forEachLine(A,L))},this.findObjectsWithAnatomicalId=(A,L)=>(_.forEach(R=>{R.anatomicalId===A&&objectsArray.push(R)}),L&&M.forEach(R=>{var N=R.findObjectsWithAnatomicalId(A,L);objectsArray.push(...N)}),objectsArray),this.findObjectsWithGroupName=(A,L)=>{var R=[];return _.forEach(N=>{var x=N.groupName?N.groupName.toLowerCase():N.groupName,I=A&&A.toLowerCase();x===I&&R.push(N)}),L&&M.forEach(N=>{var x=N.findObjectsWithGroupName(A,L);R.push(...x)}),R},this.findGeometriesWithGroupName=(A,L)=>{var R=this.findObjectsWithGroupName(A,L),N=R.filter(x=>x.isGeometry);return N},this.findPointsetsWithGroupName=(A,L)=>{var R=this.findObjectsWithGroupName(A,L),N=R.filter(x=>x.isPointset);return N},this.findGlyphsetsWithGroupName=(A,L)=>{var R=this.findObjectsWithGroupName(A,L),N=R.filter(x=>x.isGlyphset);return N},this.findLinesWithGroupName=(A,L)=>{var R=this.findObjectsWithGroupName(A,L),N=R.filter(x=>x.isLines);return N},this.getAllObjects=A=>{var L=[..._];return A&&M.forEach(R=>{var N=R.getAllObjects(A);L.push(...N)}),L},this.getChildRegions=A=>{var L=[...M];return A&&M.forEach(R=>{var N=R.getChildRegions(A);L.push(...N)}),L},this.getCurrentTime=()=>{if(_[0]!=null)return _[0].getCurrentTime();for(var A,L=0;L<M.length;L++)if(A=M[L].getCurrentTime(),A!==-1)return A;return-1},this.setMorphTime=(A,L)=>{_.forEach(R=>{R.setMorphTime(A)}),L&&M.forEach(R=>{R.setMorphTime(A)})},this.isTimeVarying=()=>{for(var A=0;A<_.length;A++)if(_[A].isTimeVarying())return!0;for(var L=0;L<M.length;L++)if(M[L].isTimeVarying())return!0;return!1},this.renderGeometries=(A,L,R,N,x,I)=>{var B,F=this.getAllObjects(I);F.forEach(V=>{V.render(A*L,R,N,x)}),x&&R===!1&&(B=x.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&x.markerCluster.calculate()},this.createPoints=(A,L,R,N)=>{var x=!1,I=this.findObjectsWithGroupName(A,!1),B=I.findIndex(V=>V.isPointset),F=-1<B?I[B]:new h;return F.addPoints(L,R,N),B===-1?(F.setName(A),this.addZincObject(F),x=!0):this.pickableUpdateRequired=!0,{zincObject:F,isNew:x}},this.createLines=(A,L,R)=>{var N=!1,x=this.findObjectsWithGroupName(A,!1),I=x.findIndex(F=>F.isLines),B=-1<I?x[I]:new p;return B.addLines(L,R),I===-1?(B.setName(A),this.addZincObject(B),N=!0):this.pickableUpdateRequired=!0,{zincObject:B,isNew:N}},this.createGeometryFromThreeJSGeometry=(A,L,R,N,x,I)=>{var B=new y,F=new m.MeshPhongMaterial({color:R,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:N,side:m.DoubleSide});return B.createMesh(L,F,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(A),B.setRenderOrder(I),this.addZincObject(B),B):void 0}};l.Region=v},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(46).LineSegments2,f=u(48).LineMaterial,h=u(47).LineSegmentsGeometry,p=function(){u(24).Lines.call(this),this.isLines2=!0;var y=Array(300);this.createLineSegment=(m,d,b)=>{if(m&&d){var v=new h;v.setPositions(m),v.colorsNeedUpdate=!0;var g=new c(v,d);g.scale.set(1,1,1),g.computeLineDistances(),this.setMesh(g,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addVertices=function(m){if(m&&m.length){var d=this.getMorph();d||(this.drawRange=0);var b=3*this.drawRange;if(m.forEach(v=>{y[b++]=v[0],y[b++]=v[1],y[b++]=v[2],this.drawRange++}),!d)for(;300>b;)y[b++]=m[0][0],y[b++]=m[0][1],y[b++]=m[0][2];d&&(d.geometry.setPositions(y),d.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return y},this.getVerticesByFaceIndex=function(m){var d=3*(2*m),b=this.getMorph();if(b&&3*this.drawRange>d){var v=b.geometry.getAttribute("instanceStart");return[[v.data.array[d],v.data.array[++d],v.data.array[++d]],[v.data.array[++d],v.data.array[++d],v.data.array[++d]]]}return[]},this.editVertices=function(m,d){if(m&&m.length){var b=this.getMorph(),v=d+m.length-1;if(!b||0>d||v>=this.drawRange)return;var g=3*d;for(m.forEach(w=>{y[g++]=w[0],y[g++]=w[1],y[g++]=w[2]}),g=3*this.drawRange;300>g;)y[g++]=m[0][0],y[g++]=m[0][1],y[g++]=m[0][2];b.geometry.setPositions(y),b.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return y},this.addLines=(m,d)=>{if(m&&0<m.length){this.addVertices(m);var b=this.getMorph();if(!b){var v=new f({color:d,linewidth:1,vertexColors:!1,worldUnits:!1});v.resolution.set(window.innerWidth,window.innerHeight),this.createLineSegment(y,v,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.render=()=>{var m=this.getMorph().material;m.resolution.set(window.innerWidth,window.innerHeight)}};p.prototype=Object.create(u(24).Lines.prototype),p.prototype.constructor=p,l.Lines2=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>_});var c=u(4),f=u(47),h=u(48),p=new c.Vector3,y=new c.Vector3,m=new c.Vector4,d=new c.Vector4,b=new c.Vector4,v=new c.Vector3,g=new c.Matrix4,w=new c.Line3,S=new c.Vector3,T=new c.Box3,M=new c.Sphere,C=new c.Vector4;class _ extends c.Mesh{constructor(){var E=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new f.LineSegmentsGeometry,O=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new h.LineMaterial({color:16777215*Math.random()});super(E,O),this.type="LineSegments2"}computeLineDistances(){for(var E=this.geometry,O=E.attributes.instanceStart,A=E.attributes.instanceEnd,L=new Float32Array(2*O.count),R=0,N=0,x=O.count;R<x;R++,N+=2)p.fromBufferAttribute(O,R),y.fromBufferAttribute(A,R),L[N]=N==0?0:L[N-1],L[N+1]=L[N]+p.distanceTo(y);var I=new c.InstancedInterleavedBuffer(L,2,1);return E.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(I,1,0)),E.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(I,1,1)),this}raycast(E,O){E.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var A=E.params.Line2===void 0?0:E.params.Line2.threshold||0,L=E.ray,R=E.camera,N=R.projectionMatrix,x=this.matrixWorld,I=this.geometry,B=this.material,F=B.resolution,V=B.linewidth+A,k=I.attributes.instanceStart,G=I.attributes.instanceEnd,J=-R.near,ne=2*Math.max(V/F.width,V/F.height);I.boundingSphere===null&&I.computeBoundingSphere(),M.copy(I.boundingSphere).applyMatrix4(x);var ae=Math.max(R.near,M.distanceToPoint(L.origin));C.set(0,0,-ae,1).applyMatrix4(R.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(R.projectionMatrixInverse);var ie=.5*Math.abs(ne/C.w);if(M.radius+=ie,E.ray.intersectsSphere(M)!==!1){I.boundingBox===null&&I.computeBoundingBox(),T.copy(I.boundingBox).applyMatrix4(x);var oe=Math.max(R.near,T.distanceToPoint(L.origin));C.set(0,0,-oe,1).applyMatrix4(R.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(R.projectionMatrixInverse);var W=.5*Math.abs(ne/C.w);if(T.max.x+=W,T.max.y+=W,T.max.z+=W,T.min.x-=W,T.min.y-=W,T.min.z-=W,E.ray.intersectsBox(T)!==!1){L.at(1,b),b.w=1,b.applyMatrix4(R.matrixWorldInverse),b.applyMatrix4(N),b.multiplyScalar(1/b.w),b.x*=F.x/2,b.y*=F.y/2,b.z=0,v.copy(b),g.multiplyMatrices(R.matrixWorldInverse,x);for(var X=0,j=k.count;X<j;X++){m.fromBufferAttribute(k,X),d.fromBufferAttribute(G,X),m.w=1,d.w=1,m.applyMatrix4(g),d.applyMatrix4(g);var re=m.z>J&&d.z>J;if(!re){if(m.z>J){var z=m.z-d.z,H=(m.z-J)/z;m.lerp(d,H)}else if(d.z>J){var K=d.z-m.z,le=(d.z-J)/K;d.lerp(m,le)}m.applyMatrix4(N),d.applyMatrix4(N),m.multiplyScalar(1/m.w),d.multiplyScalar(1/d.w),m.x*=F.x/2,m.y*=F.y/2,d.x*=F.x/2,d.y*=F.y/2,w.start.copy(m),w.start.z=0,w.end.copy(d),w.end.z=0;var se=w.closestPointToPointParameter(v,!0);w.at(se,S);var U=c.MathUtils.lerp(m.z,d.z,se),D=-1<=U&&1>=U,$=v.distanceTo(S)<.5*V;if(D&&$){w.start.fromBufferAttribute(k,X),w.end.fromBufferAttribute(G,X),w.start.applyMatrix4(x),w.end.applyMatrix4(x);var Y=new c.Vector3,ee=new c.Vector3;L.distanceSqToSegment(w.start,w.end,ee,Y),O.push({point:ee,pointOnLine:Y,distance:L.origin.distanceTo(ee),object:this,face:null,faceIndex:X,uv:null,uv2:null})}}}}}}}_.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>p});var c=u(4),f=new c.Box3,h=new c.Vector3;class p extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(m){var d=this.attributes.instanceStart,b=this.attributes.instanceEnd;return d!==void 0&&(d.applyMatrix4(m),b.applyMatrix4(m),d.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(m){var d;m instanceof Float32Array?d=m:Array.isArray(m)&&(d=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(m){var d;m instanceof Float32Array?d=m:Array.isArray(m)&&(d=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(m){return this.setPositions(m.attributes.position.array),this}fromEdgesGeometry(m){return this.setPositions(m.attributes.position.array),this}fromMesh(m){return this.fromWireframeGeometry(new c.WireframeGeometry(m.geometry)),this}fromLineSegments(m){var d=m.geometry;return d.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(d.isBufferGeometry&&this.setPositions(d.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var m=this.attributes.instanceStart,d=this.attributes.instanceEnd;m!==void 0&&d!==void 0&&(this.boundingBox.setFromBufferAttribute(m),f.setFromBufferAttribute(d),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var m=this.attributes.instanceStart,d=this.attributes.instanceEnd;if(m!==void 0&&d!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var v=0,g=0,w=m.count;g<w;g++)h.fromBufferAttribute(m,g),v=Math.max(v,b.distanceToSquared(h)),h.fromBufferAttribute(d,g),v=Math.max(v,b.distanceToSquared(h));this.boundingSphere.radius=Math.sqrt(v),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(m){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(m)}}p.prototype.isLineSegmentsGeometry=!0},(o,l,u)=>{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
3234
+ `),P="",E="",O=0,A=[],L=typeof"".trimLeft=="function",R=0,N=_.length;R<N;R++)if(P=_[R],P=L?P.trimLeft():P.trim(),O=P.length,O!==0&&(E=P.charAt(0),E!=="#"))if(E==="v"){var x=P.split(/\s+/);switch(x[0]){case"v":C.vertices.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3])),7<=x.length?C.colors.push(parseFloat(x[4]),parseFloat(x[5]),parseFloat(x[6])):C.colors.push(void 0,void 0,void 0);break;case"vn":C.normals.push(parseFloat(x[1]),parseFloat(x[2]),parseFloat(x[3]));break;case"vt":C.uvs.push(parseFloat(x[1]),parseFloat(x[2]))}}else if(E==="f"){for(var I,B=P.substr(1).trim(),F=B.split(/\s+/),V=[],k=0,G=F.length;k<G;k++)if(I=F[k],0<I.length){var J=I.split("/");V.push(J)}for(var ne=V[0],ae=1,ie=V.length-1;ae<ie;ae++){var oe=V[ae],W=V[ae+1];C.addFace(ne[0],oe[0],W[0],ne[1],oe[1],W[1],ne[2],oe[2],W[2])}}else if(E==="l"){var Z=P.substring(1).trim().split(" "),j=[],re=[];if(P.indexOf("/")===-1)j=Z;else for(var z,H=0,K=Z.length;H<K;H++)z=Z[H].split("/"),z[0]!==""&&j.push(z[0]),z[1]!==""&&re.push(z[1]);C.addLineGeometry(j,re)}else if(E==="p"){var le=P.substr(1).trim(),se=le.split(" ");C.addPointGeometry(se)}else if((A=f.exec(P))!==null){var U=(" "+A[0].substr(1).trim()).substr(1);C.startObject(U)}else if(p.test(P))C.object.startMaterial(P.substring(7).trim(),C.materialLibraries);else if(h.test(P))C.materialLibraries.push(P.substring(7).trim());else if(y.test(P))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(E==="s"){if(A=P.split(" "),1<A.length){var D=A[1].trim().toLowerCase();C.object.smooth=D!=="0"&&D!=="off"}else C.object.smooth=!0;var $=C.object.currentMaterial();$&&($.smooth=C.object.smooth)}else{if(P==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+P+'"')}C.finalize();var Y=new c.Group;Y.materialLibraries=[].concat(C.materialLibraries);var ee=C.objects.length!==1||C.objects[0].geometry.vertices.length!==0;if(ee==!0)for(var ce=0,ve=C.objects.length;ce<ve;ce++){var be=C.objects[ce],ue=be.geometry,me=be.materials,te=ue.type==="Line",he=ue.type==="Points",ge=!1;if(ue.vertices.length!==0){var Ae=new c.BufferGeometry;Ae.setAttribute("position",new c.Float32BufferAttribute(ue.vertices,3)),0<ue.normals.length&&Ae.setAttribute("normal",new c.Float32BufferAttribute(ue.normals,3)),0<ue.colors.length&&(ge=!0,Ae.setAttribute("color",new c.Float32BufferAttribute(ue.colors,3))),ue.hasUVIndices===!0&&Ae.setAttribute("uv",new c.Float32BufferAttribute(ue.uvs,2));for(var Te=[],De=0,Ye=me.length;De<Ye;De++){var ze=me[De],st=ze.name+"_"+ze.smooth+"_"+ge,Ce=C.materials[st];if(this.materials!==null){if(Ce=this.materials.create(ze.name),te&&Ce&&!(Ce instanceof c.LineBasicMaterial)){var He=new c.LineBasicMaterial;c.Material.prototype.copy.call(He,Ce),He.color.copy(Ce.color),Ce=He}else if(he&&Ce&&!(Ce instanceof c.PointsMaterial)){var Ge=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call(Ge,Ce),Ge.color.copy(Ce.color),Ge.map=Ce.map,Ce=Ge}}Ce===void 0&&(Ce=te?new c.LineBasicMaterial:he?new c.PointsMaterial({size:1,sizeAttenuation:!1}):new c.MeshPhongMaterial,Ce.name=ze.name,Ce.flatShading=!ze.smooth,Ce.vertexColors=ge,C.materials[st]=Ce),Te.push(Ce)}var It=void 0;if(1<Te.length){for(var Ot,mt=0,bt=me.length;mt<bt;mt++)Ot=me[mt],Ae.addGroup(Ot.groupStart,Ot.groupCount,mt);It=te?new c.LineSegments(Ae,Te):he?new c.Points(Ae,Te):new c.Mesh(Ae,Te)}else It=te?new c.LineSegments(Ae,Te[0]):he?new c.Points(Ae,Te[0]):new c.Mesh(Ae,Te[0]);It.name=be.name,Y.add(It)}}else if(0<C.vertices.length){var Ii=new c.PointsMaterial({size:1,sizeAttenuation:!1}),Oi=new c.BufferGeometry;Oi.setAttribute("position",new c.Float32BufferAttribute(C.vertices,3)),0<C.colors.length&&C.colors[0]!==void 0&&(Oi.setAttribute("color",new c.Float32BufferAttribute(C.colors,3)),Ii.vertexColors=!0);var zn=new c.Points(Oi,Ii);Y.add(zn)}return Y}}},(o,l,u)=>{function c(S,T){var M=Object.keys(S);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(S);T&&(C=C.filter(function(_){return Object.getOwnPropertyDescriptor(S,_).enumerable})),M.push.apply(M,C)}return M}function f(S){for(var T,M=1;M<arguments.length;M++)T=arguments[M]==null?{}:arguments[M],M%2?c(Object(T),!0).forEach(function(C){h(S,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(T)):c(Object(T)).forEach(function(C){Object.defineProperty(S,C,Object.getOwnPropertyDescriptor(T,C))});return S}function h(S,T,M){return T=p(T),T in S?Object.defineProperty(S,T,{value:M,enumerable:!0,configurable:!0,writable:!0}):S[T]=M,S}function p(S){var T=y(S,"string");return typeof T=="symbol"?T:T+""}function y(S,T){if(typeof S!="object"||!S)return S;var M=S[Symbol.toPrimitive];if(M!==void 0){var C=M.call(S,T||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(S)}var m=u(19).JSONLoader,d=u(4),b=d.FileLoader,v=S=>{var T=(C,_)=>{C.merge(_)};if(S&&0<S.length){for(;1<S.length;){var M=S.splice(1,1);T(S[0],M[0])}return S[0]}},g=function(T,M,C){var _=new b,P=new m;_.crossOrigin=M;var E=T,O=C,A=void 0,L=!1,R=!1,N=void 0,x=[],I=k=>{var G=A[k.index];if(G){var J=P.parse(G);k.onLoad(J.geometry,J.materials)}else B(k)},B=k=>{k.onError&&(!N&&(N={responseURL:E}),k.onError(N))};this.downloadCompleted=k=>{try{A=JSON.parse(k[0]),L=!1,R=!0,Array.isArray(A)?x.forEach(G=>I(G)):x.forEach(G=>B(G))}catch{x.forEach(J=>B(J))}};var F=()=>k=>{N=k,R=!0,L=!1,x.forEach(G=>{B(G)})},V=()=>k=>{x.forEach(G=>{G.onProgress&&G.onProgress(k)})};this.load=(k,G,J,ne)=>{var ae={index:k,onLoad:G,onProgress:J,onError:ne};R?A?I(ae):B(N):L?x.push(ae):(x.push(ae),L=!0,_.load(E,O,V,F))}},w=function(T,M){var C=[],_=T,P=M,E=0;this.itemDownloaded=(O,A)=>{if(C[O]=A,E++,E==_){for(var L=C[0][1],R=C.map(I=>I[0]),N=v(R),x=1;x<_;x++)C[O][0].dispose(),C[O][1].forEach(I=>I.dispose());P(N,L)}}};l.PrimitivesLoader=function(){var S=0,T=20;this.crossOrigin="Anonymous";var M=new m,C=[],_={},P=(L,R,N,x,I)=>{var B=L.length,F=new w(B,R),V=0;L.forEach(k=>{var G=I?f({},I):{};G.msHandler=F,G.order=V,V++,O(k,R,N,x,G)})},E=(L,R,N,x,I)=>{var B=I?f({},I):{},F=_[L];if(!F)if(T>S){var V=new A(void 0,this,B);++S,F=new g(L,this.crossOrigin,V),_[L]=F}else C.push({url:L,onLoad:R,onProgress:N,onError:x,options:I});F&&(B.isHandler=F,F.load(I.index,R,N,x))},O=(L,R,N,x,I)=>{if(I&&I.index!==void 0)E(L,R,N,x,I);else if(T>S){++S;var B=new A(R,this,I),F=new A(x,this,I);M.crossOrigin=this.crossOrigin,M.load(L,B,N,F)}else C.push({url:L,onLoad:R,onProgress:N,onError:x,options:I})};this.load=(L,R,N,x,I)=>{Array.isArray(L)?P(L,R,N,x,I):O(L,R,N,x,I)},this.loadFromWaitingList=()=>{for(;T>S;){var L=C.shift();if(L)this.load(L.url,L.onLoad,L.onProgress,L.onError,L.options);else return}},this.itemRemainingCheck=()=>{if(C.length===0&&S==0)for(var L in _)_.hasOwnProperty(L)&&delete _[L]};var A=function(R,N,x){return function(){--S;for(var I=arguments.length,B=Array(I),F=0;F<I;F++)B[F]=arguments[F];x!=null&&x.msHandler?x.msHandler.itemDownloaded(x.order,B):x!=null&&x.isHandler?x.isHandler.downloadCompleted(B):R&&R(...B),N.loadFromWaitingList(),N.itemRemainingCheck()}};this.parse=L=>M.parse(L)}},(o,l,u)=>{u(4);var c=u(40).GLTFLoader,f=function(){var h=this;this.parseGLTFObjects=(p,y,m,d)=>{var b=y;if(m!==0){if(p.type!=="Object3D"){var v;if(p.type==="Mesh"?v=new(u(3)).Geometry:p.type==="LineSegments"?v=new(u(24)).Lines:p.type==="Points"&&(v=new(u(22)).Pointset),v){var g=!1,w=!1;p.geometry&&p.geometry.morphAttributes&&(g=!!p.geometry.morphAttributes.position,w=!!p.geometry.morphAttributes.color),v.setMesh(p.clone(),g,w);var S=v.getMorph();v.groupName=S.name,S.matrixAutoUpdate=!0,y.addZincObject(v),d!=null&&typeof d=="function"&&d(v)}}else if(p.name!==""&&(y&&(b=y.findOrCreateChildFromPath(p.name)),b)){var T=b.getGroup();T.position.copy(p.position),T.rotation.copy(p.rotation),T.quaternion.copy(p.quaternion),T.matrixAutoUpdate=!0}}m++,p.children.forEach(M=>{h.parseGLTFObjects(M,b,m,d)})},this.setCamera=p=>{p.viewAll();var y=p.getZincCameraControls(),m=y.getCurrentViewport();y.addViewport("default",m),y.setDefaultViewport("default")},this.load=(p,y,m,d,b)=>{var v=m.substring(0,m.lastIndexOf("/")+1),g=m.substring(m.lastIndexOf("/")+1,m.length),w=new c().setPath(v);w.load(g,function(S){console.log(S),h.parseGLTFObjects(S.scene,y,0,d),h.setCamera(p),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=wB},(o,l,u)=>{var c=u(42).GLTFExporter,f=function(h){var p=h;this.exportGLTF=y=>{var m=p.getRootRegion(),d=m.getAllObjects(!0),b=[];d.forEach(w=>{w.animationClip&&b.push({clip:w.animationClip[0],mesh:w.getMorph()})});var v=new c,g={binary:y,animations:b};return new Promise(w=>{v.parse(p.getThreeJSScene(),function(S){w(S)},g)})}};l.SceneExporter=f},(o,l,u)=>{u.r(l),u.d(l,{GLTFExporter:()=>f});var c=u(4);class f{constructor(){this.pluginCallbacks=[],this.register(function(x){return new A(x)}),this.register(function(x){return new L(x)}),this.register(function(x){return new R(x)})}register(x){return this.pluginCallbacks.indexOf(x)===-1&&this.pluginCallbacks.push(x),this}unregister(x){return this.pluginCallbacks.indexOf(x)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(x),1),this}parse(x,I,B){for(var F=new O,V=[],k=0,G=this.pluginCallbacks.length;k<G;k++)V.push(this.pluginCallbacks[k](F));F.setPlugins(V),F.write(x,I,B)}}var h={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},p={};p[c.NearestFilter]=h.NEAREST,p[c.NearestMipmapNearestFilter]=h.NEAREST_MIPMAP_NEAREST,p[c.NearestMipmapLinearFilter]=h.NEAREST_MIPMAP_LINEAR,p[c.LinearFilter]=h.LINEAR,p[c.LinearMipmapNearestFilter]=h.LINEAR_MIPMAP_NEAREST,p[c.LinearMipmapLinearFilter]=h.LINEAR_MIPMAP_LINEAR,p[c.ClampToEdgeWrapping]=h.CLAMP_TO_EDGE,p[c.RepeatWrapping]=h.REPEAT,p[c.MirroredRepeatWrapping]=h.MIRRORED_REPEAT;var y={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},m=12,d=1179937895,b=2,v=8,g=1313821514,w=5130562;function S(N,x){return N.length===x.length&&N.every(function(I,B){return I===x[B]})}function T(N){if(window.TextEncoder!==void 0)return new TextEncoder().encode(N).buffer;for(var x,I=new Uint8Array(new ArrayBuffer(N.length)),B=0,F=N.length;B<F;B++)x=N.charCodeAt(B),I[B]=255<x?32:x;return I.buffer}function M(N){return S(N.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function C(N,x,I){for(var B={min:Array(N.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(N.itemSize).fill(Number.NEGATIVE_INFINITY)},F=x;F<x+I;F++)for(var V,k=0;k<N.itemSize;k++)V=void 0,4<N.itemSize?V=N.array[F*N.itemSize+k]:k===0?V=N.getX(F):k===1?V=N.getY(F):k===2?V=N.getZ(F):k==3&&(V=N.getW(F)),B.min[k]=Math.min(B.min[k],V),B.max[k]=Math.max(B.max[k],V);return B}function _(N){return 4*Math.ceil(N/4)}function P(N){var x=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,I=_(N.byteLength);if(I!==N.byteLength){var B=new Uint8Array(I);if(B.set(new Uint8Array(N)),x!==0)for(var F=N.byteLength;F<I;F++)B[F]=x;return B.buffer}return N}var E=null;class O{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(x){this.plugins=x}write(x,I,B){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},B),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(x);var F=this;Promise.all(this.pending).then(function(){var V=F.buffers,k=F.json,G=F.options,J=F.extensionsUsed,ne=new Blob(V,{type:"application/octet-stream"}),ae=Object.keys(J);if(0<ae.length&&(k.extensionsUsed=ae),k.buffers&&0<k.buffers.length&&(k.buffers[0].byteLength=ne.size),G.binary===!0){var ie=new window.FileReader;ie.readAsArrayBuffer(ne),ie.onloadend=function(){var W=P(ie.result),Z=new DataView(new ArrayBuffer(v));Z.setUint32(0,W.byteLength,!0),Z.setUint32(4,w,!0);var j=P(T(JSON.stringify(k)),32),re=new DataView(new ArrayBuffer(v));re.setUint32(0,j.byteLength,!0),re.setUint32(4,g,!0);var z=new ArrayBuffer(m),H=new DataView(z);H.setUint32(0,d,!0),H.setUint32(4,b,!0);var K=m+re.byteLength+j.byteLength+Z.byteLength+W.byteLength;H.setUint32(8,K,!0);var le=new Blob([z,re,j,Z,W],{type:"application/octet-stream"}),se=new window.FileReader;se.readAsArrayBuffer(le),se.onloadend=function(){I(se.result)}}}else if(k.buffers&&0<k.buffers.length){var oe=new window.FileReader;oe.readAsDataURL(ne),oe.onloadend=function(){var W=oe.result;k.buffers[0].uri=W,I(k)}}else I(k)})}serializeUserData(x,I){if(!(x.userData&&x.userData.isZincObject)&&Object.keys(x.userData).length!==0){var B=this.options,F=this.extensionsUsed;try{var V=JSON.parse(JSON.stringify(x.userData));if(B.includeCustomExtensions&&V.gltfExtensions){for(var k in I.extensions===void 0&&(I.extensions={}),V.gltfExtensions)I.extensions[k]=V.gltfExtensions[k],F[k]=!0;delete V.gltfExtensions}0<Object.keys(V).length&&(I.extras=V)}catch(G){console.warn("THREE.GLTFExporter: userData of '"+x.name+"' won't be serialized because of JSON.stringify error - "+G.message)}}}getUID(x){return this.uids.has(x)||this.uids.set(x,this.uid++),this.uids.get(x)}isNormalizedNormalAttribute(x){var I=this.cache;if(I.attributesNormalized.has(x))return!1;for(var B=new c.Vector3,F=0,V=x.count;F<V;F++)if(5e-4<Math.abs(B.fromBufferAttribute(x,F).length()-1))return!1;return!0}createNormalizedNormalAttribute(x){var I=this.cache;if(I.attributesNormalized.has(x))return I.attributesNormalized.get(x);for(var B=x.clone(),F=new c.Vector3,V=0,k=B.count;V<k;V++)F.fromBufferAttribute(B,V),F.x===0&&F.y===0&&F.z===0?F.setX(1):F.normalize(),B.setXYZ(V,F.x,F.y,F.z);return I.attributesNormalized.set(x,B),B}applyTextureTransform(x,I){var B=!1,F={};(I.offset.x!==0||I.offset.y!==0)&&(F.offset=I.offset.toArray(),B=!0),I.rotation!==0&&(F.rotation=I.rotation,B=!0),(I.repeat.x!==1||I.repeat.y!==1)&&(F.scale=I.repeat.toArray(),B=!0),B&&(x.extensions=x.extensions||{},x.extensions.KHR_texture_transform=F,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(x){var I=this.json,B=this.buffers;return I.buffers||(I.buffers=[{byteLength:0}]),B.push(x),0}processBufferView(x,I,B,F,V){var k=this.json;k.bufferViews||(k.bufferViews=[]);for(var G=I===h.UNSIGNED_BYTE?1:I===h.UNSIGNED_SHORT?2:4,J=_(F*x.itemSize*G),ne=new DataView(new ArrayBuffer(J)),ae=0,ie=B;ie<B+F;ie++)for(var oe,W=0;W<x.itemSize;W++)oe=void 0,4<x.itemSize?oe=x.array[ie*x.itemSize+W]:W===0?oe=x.getX(ie):W===1?oe=x.getY(ie):W===2?oe=x.getZ(ie):W==3&&(oe=x.getW(ie)),I===h.FLOAT?ne.setFloat32(ae,oe,!0):I===h.UNSIGNED_INT?ne.setUint32(ae,oe,!0):I===h.UNSIGNED_SHORT?ne.setUint16(ae,oe,!0):I===h.UNSIGNED_BYTE&&ne.setUint8(ae,oe),ae+=G;var Z={buffer:this.processBuffer(ne.buffer),byteOffset:this.byteOffset,byteLength:J};V!==void 0&&(Z.target=V),V===h.ARRAY_BUFFER&&(Z.byteStride=x.itemSize*G),this.byteOffset+=J,k.bufferViews.push(Z);var j={id:k.bufferViews.length-1,byteLength:0};return j}processBufferViewImage(x){var I=this,B=I.json;return B.bufferViews||(B.bufferViews=[]),new Promise(function(F){var V=new window.FileReader;V.readAsArrayBuffer(x),V.onloadend=function(){var k=P(V.result),G={buffer:I.processBuffer(k),byteOffset:I.byteOffset,byteLength:k.byteLength};I.byteOffset+=k.byteLength,F(B.bufferViews.push(G)-1)}})}processAccessor(x,I,B,F){var V,k=this.options,G=this.json;if(x.array.constructor===Float32Array)V=h.FLOAT;else if(x.array.constructor===Uint32Array)V=h.UNSIGNED_INT;else if(x.array.constructor===Uint16Array)V=h.UNSIGNED_SHORT;else if(x.array.constructor===Uint8Array)V=h.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(B===void 0&&(B=0),F===void 0&&(F=x.count),k.truncateDrawRange&&I!==void 0&&I.index===null){var J=B+F,ne=I.drawRange.count===1/0?x.count:I.drawRange.start+I.drawRange.count;B=Math.max(B,I.drawRange.start),F=Math.min(J,ne)-B,0>F&&(F=0)}if(F===0)return null;var ae,ie=C(x,B,F);I!==void 0&&(ae=x===I.index?h.ELEMENT_ARRAY_BUFFER:h.ARRAY_BUFFER);var oe=this.processBufferView(x,V,B,F,ae),W={bufferView:oe.id,byteOffset:oe.byteOffset,componentType:V,count:F,max:ie.max,min:ie.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[x.itemSize]};return x.normalized===!0&&(W.normalized=!0),G.accessors||(G.accessors=[]),G.accessors.push(W)-1}processImage(x,I,B){var F=this,V=F.cache,k=F.json,G=F.options,J=F.pending;V.images.has(x)||V.images.set(x,{});var ne=V.images.get(x),ae=I===c.RGBAFormat?"image/png":"image/jpeg",ie=ae+":flipY/"+B.toString();if(ne[ie]!==void 0)return ne[ie];k.images||(k.images=[]);var oe={mimeType:ae};if(G.embedImages){var W=E=E||document.createElement("canvas");W.width=Math.min(x.width,G.maxTextureSize),W.height=Math.min(x.height,G.maxTextureSize);var Z=W.getContext("2d");if(B===!0&&(Z.translate(0,W.height),Z.scale(1,-1)),typeof HTMLImageElement<"u"&&x instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&x instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&x instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&x instanceof ImageBitmap)Z.drawImage(x,0,0,W.width,W.height);else{I!==c.RGBAFormat&&I!==c.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(x.width>G.maxTextureSize||x.height>G.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",x);var j=new Uint8ClampedArray(4*(x.height*x.width));if(I===c.RGBAFormat)for(var re=0;re<j.length;re+=4)j[re+0]=x.data[re+0],j[re+1]=x.data[re+1],j[re+2]=x.data[re+2],j[re+3]=x.data[re+3];else for(var z=0,H=0;z<j.length;z+=4,H+=3)j[z+0]=x.data[H+0],j[z+1]=x.data[H+1],j[z+2]=x.data[H+2],j[z+3]=255;Z.putImageData(new ImageData(j,x.width,x.height),0,0)}G.binary===!0?J.push(new Promise(function(le){W.toBlob(function(se){F.processBufferViewImage(se).then(function(U){oe.bufferView=U,le()})},ae)})):oe.uri=W.toDataURL(ae)}else oe.uri=x.src;var K=k.images.push(oe)-1;return ne[ie]=K,K}processSampler(x){var I=this.json;I.samplers||(I.samplers=[]);var B={magFilter:p[x.magFilter],minFilter:p[x.minFilter],wrapS:p[x.wrapS],wrapT:p[x.wrapT]};return I.samplers.push(B)-1}processTexture(x){var I=this.cache,B=this.json;if(I.textures.has(x))return I.textures.get(x);B.textures||(B.textures=[]);var F={sampler:this.processSampler(x),source:this.processImage(x.image,x.format,x.flipY)};x.name&&(F.name=x.name),this._invokeAll(function(k){k.writeTexture&&k.writeTexture(x,F)});var V=B.textures.push(F)-1;return I.textures.set(x,V),V}processMaterial(x){var I=this.cache,B=this.json;if(I.materials.has(x))return I.materials.get(x);if(x.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;B.materials||(B.materials=[]);var F={pbrMetallicRoughness:{}};x.isMeshStandardMaterial!==!0&&x.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var V=x.color.toArray().concat([x.opacity]);if(S(V,[1,1,1,1])||(F.pbrMetallicRoughness.baseColorFactor=V),x.isMeshStandardMaterial?(F.pbrMetallicRoughness.metallicFactor=x.metalness,F.pbrMetallicRoughness.roughnessFactor=x.roughness):(F.pbrMetallicRoughness.metallicFactor=.5,F.pbrMetallicRoughness.roughnessFactor=.5),x.metalnessMap||x.roughnessMap)if(x.metalnessMap===x.roughnessMap){var k={index:this.processTexture(x.metalnessMap)};this.applyTextureTransform(k,x.metalnessMap),F.pbrMetallicRoughness.metallicRoughnessTexture=k}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(x.map){var G={index:this.processTexture(x.map)};this.applyTextureTransform(G,x.map),F.pbrMetallicRoughness.baseColorTexture=G}if(x.emissive){var J=x.emissive.clone().multiplyScalar(x.emissiveIntensity),ne=Math.max(J.r,J.g,J.b);if(1<ne&&(J.multiplyScalar(1/ne),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<ne&&(F.emissiveFactor=J.toArray()),x.emissiveMap){var ae={index:this.processTexture(x.emissiveMap)};this.applyTextureTransform(ae,x.emissiveMap),F.emissiveTexture=ae}}if(x.normalMap){var ie={index:this.processTexture(x.normalMap)};x.normalScale&&x.normalScale.x!==-1&&(x.normalScale.x!==x.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),ie.scale=x.normalScale.x),this.applyTextureTransform(ie,x.normalMap),F.normalTexture=ie}if(x.aoMap){var oe={index:this.processTexture(x.aoMap),texCoord:1};x.aoMapIntensity!==1&&(oe.strength=x.aoMapIntensity),this.applyTextureTransform(oe,x.aoMap),F.occlusionTexture=oe}x.transparent?F.alphaMode="BLEND":0<x.alphaTest&&(F.alphaMode="MASK",F.alphaCutoff=x.alphaTest),x.side===c.DoubleSide&&(F.doubleSided=!0),x.name!==""&&(F.name=x.name),this.serializeUserData(x,F),this._invokeAll(function(Z){Z.writeMaterial&&Z.writeMaterial(x,F)});var W=B.materials.push(F)-1;return I.materials.set(x,W),W}processMesh(x){var I=this.cache,B=this.json,F=[x.geometry.uuid];if(Array.isArray(x.material))for(var V=0,k=x.material.length;V<k;V++)F.push(x.material[V].uuid);else F.push(x.material.uuid);var G=F.join(":");if(I.meshes.has(G))return I.meshes.get(G);var J,ne=x.geometry;if(J=x.isLineSegments?h.LINES:x.isLineLoop?h.LINE_LOOP:x.isLine?h.LINE_STRIP:x.isPoints?h.POINTS:x.material.wireframe?h.LINES:h.TRIANGLES,ne.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var ae={},ie={},oe=[],W=[],Z={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},j=ne.getAttribute("normal");j===void 0||this.isNormalizedNormalAttribute(j)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),ne.setAttribute("normal",this.createNormalizedNormalAttribute(j)));var re=null;for(var z in ne.attributes)if(z.substr(0,5)!=="morph"){var H=ne.attributes[z];z=Z[z]||z.toUpperCase();var K=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(K.test(z)||(z="_"+z),I.attributes.has(this.getUID(H))){ie[z]=I.attributes.get(this.getUID(H));continue}re=null;var le=H.array;z!=="JOINTS_0"||le instanceof Uint16Array||le instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),re=new c.BufferAttribute(new Uint16Array(le),H.itemSize,H.normalized));var se=this.processAccessor(re||H,ne);se!==null&&(ie[z]=se,I.attributes.set(this.getUID(H),se))}if(j!==void 0&&ne.setAttribute("normal",j),Object.keys(ie).length===0)return null;if(x.morphTargetInfluences!==void 0&&0<x.morphTargetInfluences.length){var U=[],D=[],$={};if(x.morphTargetDictionary!==void 0)for(var Y in x.morphTargetDictionary)$[x.morphTargetDictionary[Y]]=Y;for(var ee=0;ee<x.morphTargetInfluences.length;++ee){var ce={},ve=!1;for(var be in ne.morphAttributes){if(be!="position"&&be!=="normal"&&be!=="color"){ve||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),ve=!0);continue}var ue=ne.morphAttributes[be][ee],me=be.toUpperCase();Z[be]&&(me=Z[be]);var te=ne.attributes[be];if(I.attributes.has(this.getUID(ue))){ce[me]=I.attributes.get(this.getUID(ue));continue}var he=te.clone();if(!ne.morphTargetsRelative)if(te)for(var ge=0,Ae=ue.count;ge<Ae;ge++)te.count>ge&&he.setXYZ(ge,ue.getX(ge)-te.getX(ge),ue.getY(ge)-te.getY(ge),ue.getZ(ge)-te.getZ(ge));else for(var Te=0,De=ue.count;Te<De;Te++)he.setXYZ(Te,0,0,0);ce[me]=this.processAccessor(he,ne),I.attributes.set(this.getUID(te),ce[me])}W.push(ce),U.push(x.morphTargetInfluences[ee]),x.morphTargetDictionary!==void 0&&D.push($[ee])}ae.weights=U,0<D.length&&(ae.extras={},ae.extras.targetNames=D)}var Ye=Array.isArray(x.material);if(Ye&&ne.groups.length===0)return null;for(var ze,st=Ye?x.material:[x.material],Ce=Ye?ne.groups:[{materialIndex:0,start:void 0,count:void 0}],He=0,Ge=Ce.length;He<Ge;He++){if(ze={mode:J,attributes:ie},this.serializeUserData(ne,ze),0<W.length&&(ze.targets=W),ne.index!==null){var It=this.getUID(ne.index);(Ce[He].start!==void 0||Ce[He].count!==void 0)&&(It+=":"+Ce[He].start+":"+Ce[He].count),I.attributes.has(It)?ze.indices=I.attributes.get(It):(ze.indices=this.processAccessor(ne.index,ne,Ce[He].start,Ce[He].count),I.attributes.set(It,ze.indices)),ze.indices===null&&delete ze.indices}var Ot=this.processMaterial(st[Ce[He].materialIndex]);Ot!==null&&(ze.material=Ot),oe.push(ze)}ae.primitives=oe,B.meshes||(B.meshes=[]),this._invokeAll(function(bt){bt.writeMesh&&bt.writeMesh(x,ae)});var mt=B.meshes.push(ae)-1;return I.meshes.set(G,mt),mt}processCamera(x){var I=this.json;I.cameras||(I.cameras=[]);var B=x.isOrthographicCamera,F={type:B?"orthographic":"perspective"};return B?F.orthographic={xmag:2*x.right,ymag:2*x.top,zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near}:F.perspective={aspectRatio:x.aspect,yfov:c.MathUtils.degToRad(x.fov),zfar:0>=x.far?.001:x.far,znear:0>x.near?0:x.near},x.name!==""&&(F.name=x.type),I.cameras.push(F)-1}processAnimation(x,I){var B=this.json,F=this.nodeMap;B.animations||(B.animations=[]),x=f.Utils.mergeMorphTargetTracks(x.clone(),I);for(var V=x.tracks,k=[],G=[],J=0;J<V.length;++J){var ne=V[J],ae=c.PropertyBinding.parseTrackName(ne.name),ie=c.PropertyBinding.findNode(I,ae.nodeName),oe=y[ae.propertyName];if(ae.objectName==="bones"&&(ie.isSkinnedMesh===!0?ie=ie.skeleton.getBoneByName(ae.objectIndex):ie=void 0),!ie||!oe)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',ne.name),null;var W=1,Z=ne.values.length/ne.times.length;oe===y.morphTargetInfluences&&(Z/=ie.morphTargetInfluences.length);var j=void 0;ne.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(j="CUBICSPLINE",Z/=3):ne.getInterpolation()===c.InterpolateDiscrete?j="STEP":j="LINEAR",G.push({input:this.processAccessor(new c.BufferAttribute(ne.times,W)),output:this.processAccessor(new c.BufferAttribute(ne.values,Z)),interpolation:j}),k.push({sampler:G.length-1,target:{node:F.get(ie),path:oe}})}return B.animations.push({name:x.name||"clip_"+B.animations.length,samplers:G,channels:k}),B.animations.length-1}processSkin(x){var I=this.json,B=this.nodeMap,F=I.nodes[B.get(x)],V=x.skeleton;if(V===void 0)return null;var k=x.skeleton.bones[0];if(k===void 0)return null;for(var G=[],J=new Float32Array(16*V.bones.length),ne=new c.Matrix4,ae=0;ae<V.bones.length;++ae)G.push(B.get(V.bones[ae])),ne.copy(V.boneInverses[ae]),ne.multiply(x.bindMatrix).toArray(J,16*ae);I.skins===void 0&&(I.skins=[]),I.skins.push({inverseBindMatrices:this.processAccessor(new c.BufferAttribute(J,16)),joints:G,skeleton:B.get(k)});var ie=F.skin=I.skins.length-1;return ie}processNode(x){var I=this.json,B=this.options,F=this.nodeMap;I.nodes||(I.nodes=[]);var V={};if(B.trs){var k=x.quaternion.toArray(),G=x.position.toArray(),J=x.scale.toArray();S(k,[0,0,0,1])||(V.rotation=k),S(G,[0,0,0])||(V.translation=G),S(J,[1,1,1])||(V.scale=J)}else x.matrixAutoUpdate&&x.updateMatrix(),M(x.matrix)===!1&&(V.matrix=x.matrix.elements);if(x.name!==""&&(V.name=x.name+""),this.serializeUserData(x,V),x.isMesh||x.isLine||x.isPoints){var ne=this.processMesh(x);ne!==null&&(V.mesh=ne)}else x.isCamera&&(V.camera=this.processCamera(x));if(x.isSkinnedMesh&&this.skins.push(x),0<x.children.length){for(var ae,ie=[],oe=0,W=x.children.length;oe<W;oe++)if(ae=x.children[oe],ae.visible||B.onlyVisible===!1){var Z=this.processNode(ae);Z!==null&&ie.push(Z)}0<ie.length&&(V.children=ie)}this._invokeAll(function(re){re.writeNode&&re.writeNode(x,V)});var j=I.nodes.push(V)-1;return F.set(x,j),j}processScene(x){var I=this.json,B=this.options;I.scenes||(I.scenes=[],I.scene=0);var F={};x.name!==""&&(F.name=x.name),I.scenes.push(F);for(var V,k=[],G=0,J=x.children.length;G<J;G++)if(V=x.children[G],V.visible||B.onlyVisible===!1){var ne=this.processNode(V);ne!==null&&k.push(ne)}0<k.length&&(F.nodes=k),this.serializeUserData(x,F)}processObjects(x){var I=new c.Scene;I.name="AuxScene";for(var B=0;B<x.length;B++)I.children.push(x[B]);this.processScene(I)}processInput(x){var I=this.options;x=x instanceof Array?x:[x],this._invokeAll(function(G){G.beforeParse&&G.beforeParse(x)});for(var B=[],F=0;F<x.length;F++)x[F]instanceof c.Scene?this.processScene(x[F]):B.push(x[F]);0<B.length&&this.processObjects(B);for(var V=0;V<this.skins.length;++V)this.processSkin(this.skins[V]);for(var k=0;k<I.animations.length;++k)this.processAnimation(I.animations[k].clip,I.animations[k].mesh);this._invokeAll(function(G){G.afterParse&&G.afterParse(x)})}_invokeAll(x){for(var I=0,B=this.plugins.length;I<B;I++)x(this.plugins[I])}}class A{constructor(x){this.writer=x,this.name="KHR_lights_punctual"}writeNode(x,I){if(x.isLight){if(!x.isDirectionalLight&&!x.isPointLight&&!x.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",x);var B=this.writer,F=B.json,V=B.extensionsUsed,k={};x.name&&(k.name=x.name),k.color=x.color.toArray(),k.intensity=x.intensity,x.isDirectionalLight?k.type="directional":x.isPointLight?(k.type="point",0<x.distance&&(k.range=x.distance)):x.isSpotLight&&(k.type="spot",0<x.distance&&(k.range=x.distance),k.spot={},k.spot.innerConeAngle=-1*((x.penumbra-1)*x.angle),k.spot.outerConeAngle=x.angle),x.decay!==void 0&&x.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),x.target&&(x.target.parent!==x||x.target.position.x!==0||x.target.position.y!==0||x.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),V[this.name]||(F.extensions=F.extensions||{},F.extensions[this.name]={lights:[]},V[this.name]=!0);var G=F.extensions[this.name].lights;G.push(k),I.extensions=I.extensions||{},I.extensions[this.name]={light:G.length-1}}}}class L{constructor(x){this.writer=x,this.name="KHR_materials_unlit"}writeMaterial(x,I){if(x.isMeshBasicMaterial){var B=this.writer,F=B.extensionsUsed;I.extensions=I.extensions||{},I.extensions[this.name]={},F[this.name]=!0,I.pbrMetallicRoughness.metallicFactor=0,I.pbrMetallicRoughness.roughnessFactor=.9}}}class R{constructor(x){this.writer=x,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(x,I){if(x.isGLTFSpecularGlossinessMaterial){var B=this.writer,F=B.extensionsUsed,V={};I.pbrMetallicRoughness.baseColorFactor&&(V.diffuseFactor=I.pbrMetallicRoughness.baseColorFactor);var k=[1,1,1];if(x.specular.toArray(k,0),V.specularFactor=k,V.glossinessFactor=x.glossiness,I.pbrMetallicRoughness.baseColorTexture&&(V.diffuseTexture=I.pbrMetallicRoughness.baseColorTexture),x.specularMap){var G={index:B.processTexture(x.specularMap)};B.applyTextureTransform(G,x.specularMap),V.specularGlossinessTexture=G}I.extensions=I.extensions||{},I.extensions[this.name]=V,F[this.name]=!0}}}f.Utils={insertKeyframe:function(x,I){var B,F=.001,V=x.getValueSize(),k=new x.TimeBufferType(x.times.length+1),G=new x.ValueBufferType(x.values.length+V),J=x.createInterpolant(new x.ValueBufferType(V));if(x.times.length===0){k[0]=I;for(var ne=0;ne<V;ne++)G[ne]=0;B=0}else if(I<x.times[0]){if(Math.abs(x.times[0]-I)<F)return 0;k[0]=I,k.set(x.times,1),G.set(J.evaluate(I),0),G.set(x.values,V),B=0}else if(I>x.times[x.times.length-1]){if(Math.abs(x.times[x.times.length-1]-I)<F)return x.times.length-1;k[k.length-1]=I,k.set(x.times,0),G.set(x.values,0),G.set(J.evaluate(I),x.values.length),B=k.length-1}else for(var ae=0;ae<x.times.length;ae++){if(Math.abs(x.times[ae]-I)<F)return ae;if(x.times[ae]<I&&x.times[ae+1]>I){k.set(x.times.slice(0,ae+1),0),k[ae+1]=I,k.set(x.times.slice(ae+1),ae+2),G.set(x.values.slice(0,(ae+1)*V),0),G.set(J.evaluate(I),(ae+1)*V),G.set(x.values.slice((ae+1)*V),(ae+2)*V),B=ae+1;break}}return x.times=k,x.values=G,B},mergeMorphTargetTracks:function(x,I){for(var B=[],F={},V=x.tracks,k=0;k<V.length;++k){var G=V[k],J=c.PropertyBinding.parseTrackName(G.name),ne=c.PropertyBinding.findNode(I,J.nodeName);if(J.propertyName!=="morphTargetInfluences"||J.propertyIndex===void 0){B.push(G);continue}if(G.createInterpolant!==G.InterpolantFactoryMethodDiscrete&&G.createInterpolant!==G.InterpolantFactoryMethodLinear){if(G.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),G=G.clone(),G.setInterpolation(c.InterpolateLinear)}var ae=ne.morphTargetInfluences.length,ie=ne.morphTargetDictionary[J.propertyIndex];if(ie===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+J.propertyIndex);var oe=void 0;if(F[ne.uuid]===void 0){oe=G.clone();for(var W=new oe.ValueBufferType(ae*oe.times.length),Z=0;Z<oe.times.length;Z++)W[Z*ae+ie]=oe.values[Z];oe.name=(J.nodeName||"")+".morphTargetInfluences",oe.values=W,F[ne.uuid]=oe,B.push(oe);continue}var j=G.createInterpolant(new G.ValueBufferType(1));oe=F[ne.uuid];for(var re=0;re<oe.times.length;re++)oe.values[re*ae+ie]=j.evaluate(oe.times[re]);for(var z,H=0;H<G.times.length;H++)z=this.insertKeyframe(oe,G.times[H]),oe.values[z*ae+ie]=G.values[H]}return x.tracks=B,x}}},(o,l,u)=>{var c=u(4),f=u(5).resolveURL,h=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var T=this;this.setFromObject=M=>{var{nearPlane:C,farPlane:_,eyePosition:P,targetPosition:E,upVector:O}=M;T.nearPlane=C,T.farPlane=_,T.eyePosition=P,T.targetPosition=E,T.upVector=O}},p=function(T,M,C,_){var P={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},E={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6,KEYBOARD_ZOOM:7,KEYBOARD_ROTATE:8,KEYBOARD_PAN:9},O={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},A={ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40,NUMPADADD:107,NUMPADSUBTRACT:109,EQUAL:187,MINUS:189},L={};L.MAIN=E.ROTATE,L.AUXILIARY=E.ZOOM,L.SECONDARY=E.PAN,this.cameraObject=T,this.domElement=M===void 0?document:M,this.renderer=C,this.scene=_,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.zoomRate=50,this.rotateRate=50,this.panRate=100,this.pixelHeight=1;var R=6e3,N=!0,x=0,I=void 0,B=void 0,F=!1,V=500,k=void 0,G="default",J=P.DEFAULT,ne=void 0,ae=void 0,ie=void 0,oe=0,W=O.FREE;this._state=E.NONE;var Z;this.targetTouchId=-1;var j=void 0,re=new c.Vector3,z=new c.Vector3,H=new c.Vector3,K=new c.Vector3,le=new c.Vector3,se=new c.Vector3,U=new c.Vector3,D=new c.Vector3,$=new c.Sphere,Y=new c.Vector3,ee=!1,ce=void 0,ve=0,be={default:new h};be.default.nearPlane=.1,be.default.farPlane=2e3,be.default.eyePosition=[0,0,0],be.default.targetPosition=[0,0,-1],be.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...be.default.targetPosition)),this.calculateMaxAllowedDistance=Q=>{var we=Q.getBoundingBox();if(we){we.getBoundingSphere($),ve=6*$.radius;var Ee=0;this.cameraObject&&(Ee=this.cameraObject.position.distanceTo($.center)),ve=Ee>ve?1.5*Ee:ve}else ve=0},this.addViewport=(Q,we)=>{Q&&we&&(be[Q]=we)},this.setDefaultViewport=Q=>!!(Q&&Q in be)&&(G=Q,!0),this.getDefaultViewport=()=>G,this.getViewportOfName=Q=>be[Q],this.setCurrentViewport=Q=>Q in be&&(this.setCurrentCameraSettings(be[Q]),!0),this.setRotationMode=Q=>{switch(Q){case"none":W=O.NONE;break;case"horizontal":W=O.HORIZONTAL;break;case"vertical":W=O.VERTICAL;break;case"free":default:W=O.FREE}},this.onResize=()=>{j&&(j=void 0),ce&&ce.setCurrentCameraSettings(this.cameraObject,be[G])},this.getVisibleHeightAtZDepth=Q=>{var we=this.cameraObject.position.distanceTo(this.cameraObject.target);Q<we?Q-=we:Q+=we;var Ee=this.cameraObject.fov*Math.PI/180;return 2*Math.tan(Ee/2)*Math.abs(Q)},this.calculateHeightPerPixelAtZeroDepth=Q=>{var we=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=we/Q,this.pixelHeight},this.getNDCFromDocumentCoords=(Q,we,Ee)=>{Ce(!1);var Be=Ee||new c.Vector2,Ke=2*((Q-j.left)/j.width)-1,X=2*-((we-j.top)/j.height)+1;return Be.set(Ke,X)},this.getRelativeCoordsFromNDC=(Q,we,Ee)=>{Ce(!1);var Be=Ee||new c.Vector2;return Be.x=(Q+1)*j.width/2,Be.y=(1-we)*j.height/2,Be},this.setMouseButtonAction=(Q,we)=>{L[Q]=E[we]};var ue=(Q,we)=>{Q instanceof HTMLCanvasElement&&(Q.tabIndex=we)},me=()=>{if(0<ve){var Q=Y.distanceTo($.center);return ve>Q||this.cameraObject.position.distanceTo($.center)>Q}return!0},te=Q=>{Y.copy(this.cameraObject.position).add(Q),me()&&(this.cameraObject.target.add(Q),this.cameraObject.position.add(Q),this.updateDirectionalLight())},he=Q=>{Ce(!1);var we;if(J===P.DEFAULT&&(we=this.scene.getNormalisedMinimapCoordinates(this.renderer,Q)),!we)Q.button==0?Q.ctrlKey?this._state=L.AUXILIARY:Q.shiftKey?this._state=L.SECONDARY:this._state=L.MAIN:Q.button==1?(Q.preventDefault(),this._state=L.AUXILIARY):Q.button==2&&(this._state=L.SECONDARY),this.pointer_x=Q.clientX-j.left,this.pointer_y=Q.clientY-j.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{J=P.MINIMAP;var Ee=this.scene.getMinimapDiffFromNormalised(we.x,we.y);te(Ee)}},ge=Q=>{if(Ce(!1),j)if(this.pointer_x=Q.clientX-j.left,this.pointer_y=Q.clientY-j.top,J===P.MINIMAP){var we=this.scene.getNormalisedMinimapCoordinates(this.renderer,Q);if(we){var Ee=this.scene.getMinimapDiffFromNormalised(we.x,we.y);te(Ee)}}else this._state===E.NONE&&Z!==void 0&&Z.move(this,Q.clientX,Q.clientY,this.renderer)},Ae=Q=>{this._state=E.NONE,J==P.MINIMAP&&(J=P.DEFAULT),Z!==void 0&&this.pointer_x_start==Q.clientX-j.left&&this.pointer_y_start==Q.clientY-j.top&&Z.pick(this,Q.clientX,Q.clientY,this.renderer)},Te=Q=>{this._state=E.NONE},De=Q=>{Ce(!1);var we=Q.touches.length;if(we==1){var Ee,Be;this._state=E.TOUCH_ROTATE,this.pointer_x=Q.touches[0].clientX-((Ee=j)===null||Ee===void 0?void 0:Ee.left),this.pointer_y=Q.touches[0].clientY-((Be=j)===null||Be===void 0?void 0:Be.top),this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}else if(we==2){this._state=E.TOUCH_ZOOM;var Ke=Q.touches[0].clientX-Q.touches[1].clientX,X=Q.touches[0].clientY-Q.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Ke*Ke+X*X)}else if(we==3){var pe,de;this._state=E.TOUCH_PAN,this.targetTouchId=Q.touches[0].identifier,this.pointer_x=Q.touches[0].clientX-((pe=j)===null||pe===void 0?void 0:pe.left),this.pointer_y=Q.touches[0].clientY-((de=j)===null||de===void 0?void 0:de.top),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}},Ye=Q=>{Q.preventDefault(),Q.stopPropagation();var we=Q.touches.length;if(we==1)this.pointer_x=Q.touches[0].clientX-j.left,this.pointer_y=Q.touches[0].clientY-j.top;else if(we==2){if(this._state===E.TOUCH_ZOOM){var Ee=Q.touches[0].clientX-Q.touches[1].clientX,Be=Q.touches[0].clientY-Q.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ee*Ee+Be*Be)}}else if(we==3&&this._state===E.TOUCH_PAN)for(var Ke=0;3>Ke;Ke++)Q.touches[Ke].identifier==this.targetTouchId&&(this.pointer_x=Q.touches[0].clientX-j.left,this.pointer_y=Q.touches[0].clientY-j.top)},ze=Q=>{var we=Q.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=E.NONE,we==1&&Z!==void 0&&this.pointer_x_start==Q.touches[0].clientX-j.left&&this.pointer_y_start==Q.touches[0].clientY-j.top&&Z.pick(this.cameraObject,Q.touches[0].clientX,Q.touches[0].clientY,this.renderer)},st=()=>{Ce(!0)},Ce=Q=>{if(Q||j===void 0){var we=new IntersectionObserver(Ee=>{for(var Be of Ee)j=Be.boundingClientRect;we.disconnect()});we.observe(this.domElement)}},He=Q=>{Ce(!1),this._state=E.SCROLL;var we=0;0<Q.deltaY?we=this.zoomRate:0>Q.deltaY&&(we=-1*this.zoomRate),oe+=we,Q.preventDefault(),Q.stopImmediatePropagation()},Ge=Q=>{Ce(!1);var we=0;if(Q.keyCode===A.EQUAL||Q.keyCode===A.MINUS||Q.keyCode===A.NUMPADADD||Q.keyCode===A.NUMPADSUBTRACT){this._state=E.KEYBOARD_ZOOM;var Ee=1;Q.shiftKey&&(Ee*=2),Q.keyCode===A.EQUAL||Q.keyCode===A.NUMPADADD?we=-1*(this.zoomRate*Ee):(Q.keyCode===A.MINUS||Q.keyCode===A.NUMPADSUBTRACT)&&(we=this.zoomRate*Ee),oe+=we}else(Q.keyCode===A.ARROWLEFT||Q.keyCode===A.ARROWUP||Q.keyCode===A.ARROWRIGHT||Q.keyCode===A.ARROWDOWN)&&(Q.shiftKey?(this._state=E.KEYBOARD_ROTATE,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,we=this.rotateRate):(this._state=E.KEYBOARD_PAN,we=this.panRate),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,Q.keyCode===A.ARROWLEFT?this.pointer_x-=we:Q.keyCode===A.ARROWUP?this.pointer_y-=we:Q.keyCode===A.ARROWRIGHT?this.pointer_x+=we:Q.keyCode===A.ARROWDOWN&&(this.pointer_y+=we));Object.values(A).includes(Q.keyCode)&&Q.preventDefault()},It=Q=>{this._state=E.NONE},Ot=()=>{if(typeof this.cameraObject<"u"){var Q=j.height,we=this.cameraObject.position.distanceTo(this.cameraObject.target),Ee=0;this.cameraObject.far>this.cameraObject.near&&we>=this.cameraObject.near&&we<=this.cameraObject.far&&(Ee=(we-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),z.set(this.previous_pointer_x,Q-this.previous_pointer_y,0),H.set(this.previous_pointer_x,Q-this.previous_pointer_y,1),K.set(this.pointer_x,Q-this.pointer_y,0),le.set(this.pointer_x,Q-this.pointer_y,1),z.unproject(this.cameraObject),H.unproject(this.cameraObject),K.unproject(this.cameraObject),le.unproject(this.cameraObject);var Be=-.002;K.sub(z).multiplyScalar(1-Ee),le.sub(H).multiplyScalar(Ee),K.add(le).multiplyScalar(Be),te(K)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(Q,we)=>{Q.normalize(),U.copy(this.cameraObject.position).sub(this.cameraObject.target),D.copy(U),U.normalize(),.8<Math.abs(U.dot(Q))&&U.copy(this.cameraObject.up),z.crossVectors(Q,U).normalize(),H.crossVectors(Q,z);var Ee=Q.dot(D),Be=z.dot(D),Ke=H.dot(D),X=Q.dot(this.cameraObject.up),pe=z.dot(this.cameraObject.up),de=H.dot(this.cameraObject.up),ye=Math.cos(we),Me=Math.sin(we);return K.set(ye*z.x+Me*H.x,ye*z.y+Me*H.y,ye*z.z+Me*H.z),le.set(ye*H.x-Me*z.x,ye*H.y-Me*z.y,ye*H.z-Me*z.z),U.copy(this.cameraObject.target),U.x=U.x+Q.x*Ee+K.x*Be+le.x*Ke,U.y=U.y+Q.y*Ee+K.y*Be+le.y*Ke,U.z=U.z+Q.z*Ee+K.z*Be+le.z*Ke,re.set(Q.x*X+K.x*pe+le.x*de,Q.y*X+K.y*pe+le.y*de,Q.z*X+K.z*pe+le.z*de),{position:U,up:re}},this.rotateAboutLookAtpoint=(Q,we)=>{var Ee=this.getVectorsFromRotateAboutLookAtPoints(Q,we);this.cameraObject.position.copy(Ee.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ee.up)};var mt=()=>{if(typeof this.cameraObject<"u"){var Q,we,Ee=(Q=j)===null||Q===void 0?void 0:Q.width,Be=(we=j)===null||we===void 0?void 0:we.height;if(0<Ee&&0<Be){var Ke=.25*(Ee+Be),X=0,pe=0;(W===O.FREE||W===O.HORIZONTAL)&&(X=this.pointer_x-this.previous_pointer_x),(W===O.FREE||W===O.VERTICAL)&&(pe=this.previous_pointer_y-this.pointer_y);var de=Math.sqrt(X*X+pe*pe);if(0<de){var ye=1*-pe/de,Me=1*X/de,fe=0;W===O.FREE&&ye*(this.pointer_x-.5*(Ee-1))+Me*(.5*(Be-1)-this.pointer_y);var xe=Math.acos(fe/Ke)-.5*Math.PI,_e=this.tumble_rate*de/Ke;re.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),z.copy(this.cameraObject.up).normalize(),H.copy(z).cross(re).normalize().multiplyScalar(ye),z.multiplyScalar(Me),se.addVectors(H,z).multiplyScalar(Math.cos(xe)),re.multiplyScalar(Math.sin(xe)),se.add(re),this.rotateAboutLookAtpoint(se,-_e)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},bt=()=>{var Q=0;return this._state===E.ZOOM?Q=this.previous_pointer_y-this.pointer_y:this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM?Q=oe:(Q=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),Q};this.changeZoomByScrollRateUnit=Q=>{var we=Q*this.zoomRate;this.changeZoomByValue(we)},this.changeZoomByValue=Q=>{if(typeof this.cameraObject<"u"){var we=j.height,Ee=this.cameraObject.position.clone();Ee.sub(this.cameraObject.target);var Be=Ee.length(),Ke=1.5*Q/we;if(.01<Be+Ke*Be&&(Ee.normalize(),Y.copy(this.cameraObject.position),Y.x+=Ee.x*Ke*Be,Y.y+=Ee.y*Ke*Be,Y.z+=Ee.z*Ke*Be,me())){this.cameraObject.position.copy(Y),this.updateDirectionalLight();var X=1e-5;if(X*this.cameraObject.far<this.cameraObject.near+Ke*Be+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=Ke*Be,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=Ke*Be,this.cameraObject.far+=Ke*Be));else{if(this.near_plane_fly_debt==0){var pe=this.cameraObject.near-X*this.cameraObject.far;this.cameraObject.near=X*this.cameraObject.far,this.cameraObject.far-=pe,this.near_plane_fly_debt-=X*this.cameraObject.far}this.near_plane_fly_debt+=Ke*Be}ee=!0}}};var Ii=()=>{var Q=bt();this.changeZoomByValue(Q),this._state===E.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),(this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM)&&(oe=0,this._state=E.NONE)};this.setDirectionalLight=Q=>{this.directionalLight=Q},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){N=!0,this.domElement&&this.domElement.addEventListener&&(ue(this.domElement,0),this.domElement.addEventListener("mousedown",he,!1),this.domElement.addEventListener("mousemove",ge,!1),this.domElement.addEventListener("mouseup",Ae,!1),this.domElement.addEventListener("mouseleave",Te,!1),this.domElement.addEventListener("touchstart",De,!1),this.domElement.addEventListener("touchmove",Ye,!1),this.domElement.addEventListener("touchend",ze,!1),this.domElement.addEventListener("wheel",He,!1),this.domElement.addEventListener("mouseenter",st,!1),this.domElement.addEventListener("contextmenu",Q=>{Q.preventDefault()},!1),this.domElement.addEventListener("keydown",Ge,!1),this.domElement.addEventListener("keyup",It,!1))},this.disable=function(){N=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",he,!1),this.domElement.removeEventListener("mousemove",ge,!1),this.domElement.removeEventListener("mouseup",Ae,!1),this.domElement.removeEventListener("mouseleave",Te,!1),this.domElement.removeEventListener("touchstart",De,!1),this.domElement.removeEventListener("touchmove",Ye,!1),this.domElement.removeEventListener("touchend",ze,!1),this.domElement.removeEventListener("wheel",He,!1),this.domElement.removeEventListener("mouseenter",st,!1),this.domElement.removeEventListener("contextmenu",Q=>{Q.preventDefault()},!1),this.domElement.removeEventListener("keydown",Ge,!1),this.domElement.removeEventListener("keyup",It,!1),ue(this.domElement,-1))},this.loadPath=Q=>{I=Q.CameraPath,B=Q.NumberOfPoints},this.loadPathURL=(Q,we)=>{var Ee=new XMLHttpRequest;Ee.onreadystatechange=()=>{if(Ee.readyState==4&&Ee.status==200){var Ke=JSON.parse(Ee.responseText);this.loadPath(Ke),we!=null&&typeof we=="function"&&we()}};var Be=f(Q);Ee.open("GET",Be,!0),Ee.send()},this.setPathDuration=Q=>{R=Q,ne&&ne.setDuration(R),ae&&ae.setDuration(R)},this.getPlayRate=()=>V,this.setPlayRate=Q=>{V=Q};var Oi=Q=>{var we=x+Q;we>R&&(we-=R),x=we};this.getTime=()=>x,this.setTime=Q=>{x=Q>R?R:0>Q?0:Q},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2<B){var Q=x/R*(B-1),we=Math.floor(Q),Ee=1-(Q-we),Be=Math.ceil(Q);return we==Be?we==B-1?[we-1,Be,0]:[we,Be+1,1]:[we,Be,Ee]}return B==1?[0,0,0]:void 0},this.setCurrentTimeFrame=Q=>{2<B&&(x=R*Q/(B-1),0>x&&(x=0),x>R&&(x=R))};var zn=Q=>{if(J===P.PATH&&(Oi(Q),I)){for(var we=this.getCurrentTimeFrame(),Ee=we[0],Be=we[1],Ke=we[2],X=[I[3*Ee],I[3*Ee+1],I[3*Ee+2]],pe=[I[3*Be],I[3*Be+1],I[3*Be+2]],de=[],ye=0;ye<X.length;ye++)de.push(Ke*X[ye]+(1-Ke)*pe[ye]);this.cameraObject.position.set(de[0],de[1],de[2]),this.cameraObject.target.set(pe[0],pe[1],pe[2]),k&&this.cameraObject.lookAt(this.cameraObject.target),F&&(this.directionalLight.position.set(de[0],de[1],de[2]),this.directionalLight.target.position.set(pe[0],pe[1],pe[2]))}};this.calculatePathNow=()=>{zn(0)};var ns=()=>{this._state===E.ROTATE||this._state===E.TOUCH_ROTATE||this._state===E.KEYBOARD_ROTATE?mt():this._state===E.PAN||this._state===E.TOUCH_PAN||this._state===E.KEYBOARD_PAN?(Ot(),ce.triggerCallback()):(this._state===E.ZOOM||this._state===E.TOUCH_ZOOM||this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM)&&(ce.zoom(bt()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,(this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM)&&(this._state=E.NONE),oe=0,ce.triggerCallback())};this.update=Q=>{var we=Q*V,Ee=N,Be=!0;return J===P.PATH?zn(we):J===P.SMOOTH_CAMERA_TRANSITION&&ne?(ne.update(we),ne.isTransitionCompleted()&&(J=P.DEFAULT),Ee=!1):J===P.ROTATE_CAMERA_TRANSITION&&ae?(ae.update(we),ae.isTransitionCompleted()&&(J=P.DEFAULT),Ee=!1):J===P.AUTO_TUMBLE&&ie?ie.update(we):J===P.SYNC_CONTROL&&ce?(ns(),Ee=!1):Be=!1,Ee&&(this._state!==E.NONE&&(Be=!0),this._state===E.ROTATE||this._state===E.TOUCH_ROTATE||this._state===E.KEYBOARD_ROTATE?mt():this._state===E.PAN||this._state===E.TOUCH_PAN||this._state===E.KEYBOARD_PAN?Ot():(this._state===E.ZOOM||this._state===E.TOUCH_ZOOM||this._state===E.SCROLL||this._state===E.KEYBOARD_ZOOM)&&Ii(),this._state!==E.NONE&&J===P.AUTO_TUMBLE&&ie&&ie.stopOnCameraInput,this._state===E.SCROLL&&(this._state=E.NONE)),k?(Be=!0,k.update()):this.cameraObject.lookAt(this.cameraObject.target),Be=Be||ee,ee=!1,Be},this.playPath=()=>{J=P.PATH},this.stopPath=()=>{J=P.DEFAULT},this.isPlayingPath=()=>J===P.PATH,this.enableDirectionalLightUpdateWithPath=Q=>{F=Q},this.enableDeviceOrientation=()=>{k||(k=new w(this.cameraObject))},this.disableDeviceOrientation=()=>{k&&(k.dispose(),k=void 0)},this.isDeviceOrientationEnabled=()=>!!k,this.resetView=()=>{var Q=be[G];this.cameraObject.near=Q.nearPlane,this.cameraObject.far=Q.farPlane,this.cameraObject.position.set(Q.eyePosition[0],Q.eyePosition[1],Q.eyePosition[2]),this.cameraObject.target.set(Q.targetPosition[0],Q.targetPosition[1],Q.targetPosition[2]),this.cameraObject.up.set(Q.upVector[0],Q.upVector[1],Q.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=Q=>{Q.nearPlane&&(this.cameraObject.near=Q.nearPlane),Q.farPlane&&(this.cameraObject.far=Q.farPlane),Q.eyePosition&&this.cameraObject.position.set(Q.eyePosition[0],Q.eyePosition[1],Q.eyePosition[2]),Q.targetPosition&&this.cameraObject.target.set(Q.targetPosition[0],Q.targetPosition[1],Q.targetPosition[2]),Q.upVector&&this.cameraObject.up.set(Q.upVector[0],Q.upVector[1],Q.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight(),ee=!0},this.getViewportFromCentreAndRadius=(Q,we,Ee,Be,Ke,X)=>{var pe=this.cameraObject.position.x-this.cameraObject.target.x,de=this.cameraObject.position.y-this.cameraObject.target.y,ye=this.cameraObject.position.z-this.cameraObject.target.z,Me=1/Math.sqrt(pe*pe+de*de+ye*ye);pe*=Me,de*=Me,ye*=Me;var fe=[Q,we,Ee],xe=Be/Math.tan(Ke*Math.PI/360),_e=[Q+pe*xe,we+de*xe,Ee+ye*xe],Pe=xe+X,Oe=0,Ue=.95;Oe=X>Ue*xe?(1-Ue)*xe:xe-X;var Fe=new h;return Fe.nearPlane=Oe,Fe.farPlane=Pe,Fe.eyePosition=_e,Fe.targetPosition=fe,Fe.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],Fe},this.getViewportFromBoundingBox=(Q,we)=>{var Ee=Q.min.distanceTo(Q.max)/2*we,Be=(Q.min.x+Q.max.x)/2,Ke=(Q.min.y+Q.max.y)/2,X=(Q.min.z+Q.max.z)/2,pe=4,de=this.getViewportFromCentreAndRadius(Be,Ke,X,Ee,40,Ee*pe);return de},this.getCurrentViewport=()=>{var Q=new h;return Q.nearPlane=this.cameraObject.near,Q.farPlane=this.cameraObject.far,Q.eyePosition[0]=this.cameraObject.position.x,Q.eyePosition[1]=this.cameraObject.position.y,Q.eyePosition[2]=this.cameraObject.position.z,Q.targetPosition[0]=this.cameraObject.target.x,Q.targetPosition[1]=this.cameraObject.target.y,Q.targetPosition[2]=this.cameraObject.target.z,Q.upVector[0]=this.cameraObject.up.x,Q.upVector[1]=this.cameraObject.up.y,Q.upVector[2]=this.cameraObject.up.z,Q},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(Q,we,Ee)=>{ae==null&&(ne=new y(Q,we,this,Ee))},this.rotateCameraTransition=(Q,we,Ee)=>{ne==null&&(ae=new m(Q,we,this,Ee))},this.enableCameraTransition=()=>{ne&&(J=P.SMOOTH_CAMERA_TRANSITION),ae&&(J=P.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{J=P.DEFAULT},this.stopCameraTransition=()=>{J=P.DEFAULT,ne=void 0,ae=void 0},this.isTransitioningCamera=()=>J===P.SMOOTH_CAMERA_TRANSITION||J===P.ROTATE_CAMERA_TRANSITION,this.autoTumble=(Q,we,Ee)=>{ie=new b(Q,we,Ee,this)},this.enableAutoTumble=()=>{J=P.AUTO_TUMBLE},this.stopAutoTumble=()=>{J=P.DEFAULT,ie=void 0},this.updateAutoTumble=()=>{ie&&(ie.requireUpdate=!0)},this.isAutoTumble=()=>J===P.AUTO_TUMBLE,this.enableRaycaster=(Q,we,Ee)=>{Z==null&&(Z=new d(Q,this.scene,we,Ee,this.renderer))},this.disableRaycaster=()=>{Z.disable(),Z=void 0},this.isSyncControl=()=>currentMpde===P.SYNC_CONTROL,this.enableSyncControl=()=>(J=P.SYNC_CONTROL,ce||(ce=new S),ce.setCurrentCameraSettings(this.cameraObject,be[G]),ce),this.disableSyncControl=()=>{J=P.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},y=function(M,C,_,P){var E=M.eyePosition,O=M.targetPosition,A=M.upVector,L=C.eyePosition,R=C.targetPosition,N=C.upVector,x=_,I=P,B=0,F=!1;x.near=Math.min(M.nearPlane,C.nearPlane),x.far=Math.max(M.farPlane,C.farPlane),x.cameraObject.up.set(C.upVector[0],C.upVector[1],C.upVector[2]),this.setDuration=G=>{I=G};var V=G=>{var J=B+G;J>I&&(J=I),B=J},k=()=>{var G=B/I,J=[E[0]*(1-G)+L[0]*G,E[1]*(1-G)+L[1]*G,E[2]*(1-G)+L[2]*G],ne=[O[0]*(1-G)+R[0]*G,O[1]*(1-G)+R[1]*G,O[2]*(1-G)+R[2]*G];A[0]*(1-G)+N[0]*G,A[1]*(1-G)+N[1]*G,A[2]*(1-G)+N[2]*G,x.cameraObject.position.set(J[0],J[1],J[2]),x.cameraObject.target.set(ne[0],ne[1],ne[2])};this.update=G=>{this.enabled===!1||(V(G),k(),B==I&&(F=!0))},this.isTransitionCompleted=()=>F},m=function(M,C,_,P){var E=M,O=C,A=_,L=P,R=0,N=!1;this.setDuration=I=>{L=I};var x=I=>{var B=R,F=R+I;F>L&&(F=L),R=F;var V=R-B,k=V/L,G=k*O;A.rotateAboutLookAtpoint(E,G)};this.update=I=>{this.enabled===!1||(x(I),R==L&&(N=!0))},this.isTransitionCompleted=()=>N},d=function(M,C,_,P,E){var O=M,A=C,L=E,R=_,N=P,x=new c.Raycaster;x.params.Line.threshold=.1,x.params.Points.threshold=1;var I=new c.Vector2,B=!1,F=new Date,V=!1,k=0,G=[],J={zincCamera:void 0,x:-1,y:-1},ne=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=oe=>{if(A!==O){var W=O.getThreeJSScene();L.render(W,oe.cameraObject)}var Z=ne||O.getPickableThreeJSObjects();return G.length=0,x.intersectObjects(Z,!0,G)},this.setPickableObjects=oe=>{oe===void 0?ne=void 0:(ne=[],oe.forEach(W=>{W.getGroup()&&W.getGroup().visible&&ne.push(W.getGroup())}))},this.getIntersectsObjectWithOrigin=(oe,W,Z)=>(x.set(W,Z),this.getIntersectsObject(oe)),this.getIntersectsObjectWithCamera=(oe,W,Z)=>(oe.getNDCFromDocumentCoords(W,Z,I),x.setFromCamera(I,oe.cameraObject),this.getIntersectsObject(oe)),this.pick=(oe,W,Z)=>{if(L&&O&&oe&&R){this.getIntersectsObjectWithCamera(oe,W,Z);for(var j,re=G.length,z=0;z<re;z++)if(j=G[z].object?G[z].object.userData:void 0,j&&j.isMarkerCluster&&j.visible&&j.clusterIsVisible(G[z].object.clusterIndex)&&j.zoomToCluster(G[z].object.clusterIndex))return;R(G,W,Z)}};var ae=(oe,W,Z)=>{if(L&&O&&oe&&N){if(this.getIntersectsObjectWithCamera(oe,W,Z),F.setTime(Date.now()),G.length===0){if(V)return;V=!0}else V=!1;N(G,W,Z)}};this.move=(oe,W,Z)=>{L&&O&&oe&&N&&(O.displayMarkers?ae(oe,W,Z):(J.zincCamera=oe,J.x=W,J.y=Z,!B&&(k=F?Date.now()-F.getTime():250,250<=k?ae(oe,W,Z):(B=!0,setTimeout(ie(J),k)))))};var ie=oe=>function(){B=!1,ae(oe.zincCamera,oe.x,oe.y)}},b=function(M,C,_,P){var E=new c.Vector3,O=-C,A=P,L=M;this.stopOnCameraInput=_,this.requireUpdate=!0;var R=new c.Vector3,N=new c.Vector3,x=I=>{var B=Math.sqrt(I[0]*I[0]+I[1]*I[1]),F=4*Math.abs(I[0]),V=4*Math.abs(I[1]),k=.25*(F+V),G=-I[1]/B,J=I[0]/B,ne=G*I[0]+J*-I[1];ne>k?ne=k:ne<-k&&(ne=-k);var ae=Math.acos(ne/k)-.5*Math.PI;E.copy(A.cameraObject.position).sub(A.cameraObject.target).normalize(),R.copy(A.cameraObject.up).normalize(),N.crossVectors(R,E).normalize().multiplyScalar(G),R.multiplyScalar(J),R.add(N).multiplyScalar(Math.cos(ae)),E.multiplyScalar(Math.sin(ae)).add(R)};this.update=I=>{this.enabled===!1||(this.requireUpdate&&(x(L),this.requireUpdate=!1),A.rotateAboutLookAtpoint(E,O*I/1e3))}},v=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new c.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new c.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(v.prototype,{update:(()=>{var T,M,C,_,P,E,O=new c.Matrix4,A=new c.Matrix4;return function(R){var N=T!==R.focus||M!==R.fov||C!==R.aspect*this.aspect||_!==R.near||P!==R.far||E!==R.zoom;if(N){T=R.focus,M=R.fov,C=R.aspect*this.aspect,_=R.near,P=R.far,E=R.zoom;var x,I,B=R.projectionMatrix.clone(),F=.064/2,V=F*_/T,k=_*Math.tan(.5*(c.Math.DEG2RAD*M))/R.zoom;A.elements[12]=-F,O.elements[12]=F,x=-k*C+V,I=k*C+V,B.elements[0]=2*_/(I-x),B.elements[8]=(I+x)/(I-x),this.cameraL.projectionMatrix.copy(B),x=-k*C-V,I=k*C-V,B.elements[0]=2*_/(I-x),B.elements[8]=(I+x)/(I-x),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(R.matrixWorld).multiply(A),this.cameraR.matrixWorld.copy(R.matrixWorld).multiply(O)}})()});var g=function(M){var C=new v;C.aspect=.5,this.setSize=(_,P)=>{M.setSize(_,P)},this.render=(_,P)=>{_.updateMatrixWorld(),P.parent===null&&P.updateMatrixWorld(),C.update(P);var E=M.getSize();M.setScissorTest(!0),M.clear(),M.setScissor(0,0,E.width/2,E.height),M.setViewport(0,0,E.width/2,E.height),M.render(_,C.cameraL),M.setScissor(E.width/2,0,E.width/2,E.height),M.setViewport(E.width/2,0,E.width/2,E.height),M.render(_,C.cameraR),M.setScissorTest(!1)}},w=function(M){var C=this;this.object=M,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var _=O=>{C.deviceOrientation=O},P=()=>{typeof window<"u"&&(C.screenOrientation=window.orientation||0)},E=(()=>{var O=new c.Vector3(0,0,1),A=new c.Euler,L=new c.Quaternion,R=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(N,x,I,B,F)=>{var V=new c.Vector3(0,0,1);V.subVectors(N.target,N.position),A.set(I,x,-B,"YXZ");var k=new c.Quaternion;k.setFromEuler(A),k.multiply(R),k.multiply(L.setFromAxisAngle(O,-F)),V.applyQuaternion(k),V.addVectors(N.position,V),N.lookAt(V)}})();this.connect=()=>{P(),typeof window<"u"&&(window.addEventListener("orientationchange",P,!1),window.addEventListener("deviceorientation",_,!1)),C.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",P,!1),window.removeEventListener("deviceorientation",_,!1)),C.enabled=!1},this.update=()=>{if(C.enabled!==!1){var O=C.deviceOrientation.alpha?c.Math.degToRad(C.deviceOrientation.alpha):0,A=C.deviceOrientation.beta?c.Math.degToRad(C.deviceOrientation.beta):0,L=C.deviceOrientation.gamma?c.Math.degToRad(C.deviceOrientation.gamma):0,R=C.screenOrientation?c.Math.degToRad(C.screenOrientation):0;E(C.object,O,A,L,R)}},this.dispose=function(){this.disconnect()},this.connect()},S=function(){var M=void 0,C=void 0,_=void 0,P=new c.Vector3,E=new c.Vector3,O=new c.Vector3,A=new c.Vector3,L=void 0;this.setCurrentCameraSettings=(R,N)=>{M=R.clone(),C=R,_=N,M.near=_.nearPlane,_.farPlane&&(M.far=_.farPlane),_.eyePosition&&M.position.set(_.eyePosition[0],_.eyePosition[1],_.eyePosition[2]),_.upVector&&M.up.set(_.upVector[0],_.upVector[1],_.upVector[2]),_.targetPosition&&(M.target=new c.Vector3(_.targetPosition[0],_.targetPosition[1],_.targetPosition[2]),M.lookAt(M.target)),M.updateProjectionMatrix(),P.copy(M.position).project(M),E.copy(M.target).project(M)},this.getCurrentPosition=()=>(E.copy(C.target).project(M),[E.x,E.y]),this.zoom=R=>{var N=.002*R,x=Math.max(C.zoom-N,1);C.zoom=x,C.updateProjectionMatrix()},this.zoomToBox=(R,N)=>{R.getCenter(O),O.project(M),this.setCenterZoom([O.x,O.y],N)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:C.zoom}),this.setCenterZoom=(R,N)=>{O.set(R[0],R[1],E.z).unproject(M),A.copy(O).sub(C.target),C.target.copy(O),C.lookAt(C.target),C.position.add(A),C.zoom=N,C.updateProjectionMatrix()},this.setEventCallback=R=>{(R===void 0||typeof R=="function")&&(L=R)},this.triggerCallback=()=>{L!==void 0&&typeof L=="function"&&L()}};l.Viewport=h,l.CameraControls=p,l.SmoothCameraTransition=y,l.RotateCameraTransition=m,l.RayCaster=d,l.CameraAutoTumble=b,l.StereoEffect=g,l.NDCCameraControl=S},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),h=u(22).Pointset;u(24).Lines;var p=u(45).Lines2,y=u(3).Geometry,m=u(4),d=0,b=function(){return"re"+d++},v=function(g,w){var S=g,T=new c;T.matrixAutoUpdate=!1,T.userData=this;var M=[],C="",_=[],P=w,E=new f,O=3e3;E.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=b(),this.hideAllPrimitives=()=>{M.forEach(A=>A.hideAllPrimitives()),_.forEach(A=>A.setVisibility(!1))},this.showAllPrimitives=()=>{M.forEach(A=>A.showAllPrimitives()),_.forEach(A=>A.setVisibility(!0))},this.setVisibility=A=>{A!=T.visible&&(T.visible=A,this.pickableUpdateRequired=!0)},this.getVisibility=()=>T.visible,this.getGroup=()=>T,this.setTransformation=A=>{E.set(...A),T.matrix.copy(E),T.updateMatrixWorld()},this.setName=A=>{A&&A!==""&&(C=A)},this.getName=()=>C,this.getParent=()=>S,this.getFullSeparatedPath=()=>{var A=[];if(C!==""){A.push(C);for(var L,R=S;R!==void 0;)L=R.getName(),L!==""&&A.unshift(L),R=R.getParent()}return A},this.getFullPath=()=>{var A=this.getFullSeparatedPath();if(0<A.length){var L=A.shift();return A.forEach(R=>{L=L.concat("/",R)}),L}return""},this.createChild=A=>{var L=new v(this,P);return L.setName(A),M.push(L),T.add(L.getGroup()),L},this.getChildWithName=A=>{if(A){for(var L=A.toLowerCase(),R=0;R<M.length;R++)if(M[R].getName().toLowerCase()===L)return M[R]}},this.findChildFromSeparatedPath=A=>{if(A&&0<A.length&&A[0]===""&&A.shift(),A&&0<A.length){var L=this.getChildWithName(A[0]);return L?(A.shift(),L.findChildFromSeparatedPath(A)):void 0}return this},this.findChildFromPath=A=>{var L=A.split("/");return this.findChildFromSeparatedPath(L)},this.createChildFromSeparatedPath=A=>{if(0<A.length&&A[0]===""&&A.shift(),0<A.length){var L=this.getChildWithName(A[0]);return L||(L=this.createChild(A[0])),A.shift(),L.createChildFromSeparatedPath(A)}return this},this.createChildFromPath=A=>{var L=A.split("/");return this.createChildFromSeparatedPath(L)},this.findOrCreateChildFromPath=A=>{var L=this.findChildFromPath(A);return L||(L=this.createChildFromPath(A)),L},this.addZincObject=A=>{A&&(A.setRegion(this),T.add(A.getGroup()),_.push(A),this.pickableUpdateRequired=!0,P&&P.triggerObjectAddedCallback(A))},this.removeZincObject=A=>{for(var L=0;L<_.length;L++)if(A===_[L])return T.remove(A.getGroup()),_.splice(L,1),P&&P.triggerObjectRemovedCallback(A),A.dispose(),void(this.pickableUpdateRequired=!0)},this.checkPickableUpdateRequred=A=>{if(this.pickableUpdateRequired)return!0;if(A){for(var L=!1,R=0;R<M.length;R++)if(L=M[R].checkPickableUpdateRequred(A),L)return!0}return!1},this.getPickableThreeJSObjects=(A,L)=>(T.visible&&(_.forEach(R=>{if(R.getGroup()&&R.getGroup().visible){var N=R.marker;N&&N.isEnabled()&&A.push(N.getMorph()),A.push(R.getGroup())}}),L&&M.forEach(R=>{R.getPickableThreeJSObjects(A,L)}),this.pickableUpdateRequired=!1),A),this.setDuration=A=>{O=A,_.forEach(L=>L.setDuration(A)),M.forEach(L=>L.setDuration(A))},this.getDuration=()=>O,this.getBoundingBox=A=>{var L,R;return _.forEach(N=>{R=N.getBoundingBox(),R&&(L==null?L=R.clone():L.union(R))}),A&&M.forEach(N=>{R=N.getBoundingBox(A),R&&(L==null?L=R.clone():L.union(R))}),L},this.clear=A=>{A&&M.forEach(L=>L.clear(A)),_.forEach(L=>{T.remove(L.getGroup()),L.dispose()}),M=[],_=[]},this.objectIsInRegion=(A,L)=>{for(var R=0;R<_.length;R++)if(A===_[R])return!0;if(L){for(var N=0;N<M.length;N++)if(M[N].objectIsInRegion(A,L))return!0}return!1},this.forEachGeometry=(A,L)=>{_.forEach(R=>{R.isGeometry&&A(R)}),L&&M.forEach(R=>R.forEachGeometry(A,L))},this.forEachGlyphset=(A,L)=>{_.forEach(R=>{R.isGlyphset&&A(R)}),L&&M.forEach(R=>R.forEachGlyphset(A,L))},this.forEachPointset=(A,L)=>{_.forEach(R=>{R.isPointset&&A(R)}),L&&M.forEach(R=>R.forEachPointset(A,L))},this.forEachLine=(A,L)=>{_.forEach(R=>{R.isLines&&A(R)}),L&&M.forEach(R=>R.forEachLine(A,L))},this.findObjectsWithAnatomicalId=(A,L)=>(_.forEach(R=>{R.anatomicalId===A&&objectsArray.push(R)}),L&&M.forEach(R=>{var N=R.findObjectsWithAnatomicalId(A,L);objectsArray.push(...N)}),objectsArray),this.findObjectsWithGroupName=(A,L)=>{var R=[];return _.forEach(N=>{var x=N.groupName?N.groupName.toLowerCase():N.groupName,I=A&&A.toLowerCase();x===I&&R.push(N)}),L&&M.forEach(N=>{var x=N.findObjectsWithGroupName(A,L);R.push(...x)}),R},this.findGeometriesWithGroupName=(A,L)=>{var R=this.findObjectsWithGroupName(A,L),N=R.filter(x=>x.isGeometry);return N},this.findPointsetsWithGroupName=(A,L)=>{var R=this.findObjectsWithGroupName(A,L),N=R.filter(x=>x.isPointset);return N},this.findGlyphsetsWithGroupName=(A,L)=>{var R=this.findObjectsWithGroupName(A,L),N=R.filter(x=>x.isGlyphset);return N},this.findLinesWithGroupName=(A,L)=>{var R=this.findObjectsWithGroupName(A,L),N=R.filter(x=>x.isLines);return N},this.getAllObjects=A=>{var L=[..._];return A&&M.forEach(R=>{var N=R.getAllObjects(A);L.push(...N)}),L},this.getChildRegions=A=>{var L=[...M];return A&&M.forEach(R=>{var N=R.getChildRegions(A);L.push(...N)}),L},this.getCurrentTime=()=>{if(_[0]!=null)return _[0].getCurrentTime();for(var A,L=0;L<M.length;L++)if(A=M[L].getCurrentTime(),A!==-1)return A;return-1},this.setMorphTime=(A,L)=>{_.forEach(R=>{R.setMorphTime(A)}),L&&M.forEach(R=>{R.setMorphTime(A)})},this.isTimeVarying=()=>{for(var A=0;A<_.length;A++)if(_[A].isTimeVarying())return!0;for(var L=0;L<M.length;L++)if(M[L].isTimeVarying())return!0;return!1},this.renderGeometries=(A,L,R,N,x,I)=>{var B,F=this.getAllObjects(I);F.forEach(V=>{V.render(A*L,R,N,x)}),x&&R===!1&&(B=x.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&x.markerCluster.calculate()},this.createPoints=(A,L,R,N)=>{var x=!1,I=this.findObjectsWithGroupName(A,!1),B=I.findIndex(V=>V.isPointset),F=-1<B?I[B]:new h;return F.addPoints(L,R,N),B===-1?(F.setName(A),this.addZincObject(F),x=!0):this.pickableUpdateRequired=!0,{zincObject:F,isNew:x}},this.createLines=(A,L,R)=>{var N=!1,x=this.findObjectsWithGroupName(A,!1),I=x.findIndex(F=>F.isLines),B=-1<I?x[I]:new p;return B.addLines(L,R),I===-1?(B.setName(A),this.addZincObject(B),N=!0):this.pickableUpdateRequired=!0,{zincObject:B,isNew:N}},this.createGeometryFromThreeJSGeometry=(A,L,R,N,x,I)=>{var B=new y,F=new m.MeshPhongMaterial({color:R,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:N,side:m.DoubleSide});return B.createMesh(L,F,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(A),B.setRenderOrder(I),this.addZincObject(B),B):void 0}};l.Region=v},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(46).LineSegments2,f=u(48).LineMaterial,h=u(47).LineSegmentsGeometry,p=function(){u(24).Lines.call(this),this.isLines2=!0;var y=Array(300);this.createLineSegment=(m,d,b)=>{if(m&&d){var v=new h;v.setPositions(m),v.colorsNeedUpdate=!0;var g=new c(v,d);g.scale.set(1,1,1),g.computeLineDistances(),this.setMesh(g,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addVertices=function(m){if(m&&m.length){var d=this.getMorph();d||(this.drawRange=0);var b=3*this.drawRange;if(m.forEach(v=>{y[b++]=v[0],y[b++]=v[1],y[b++]=v[2],this.drawRange++}),!d)for(;300>b;)y[b++]=m[0][0],y[b++]=m[0][1],y[b++]=m[0][2];d&&(d.geometry.setPositions(y),d.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return y},this.getVerticesByFaceIndex=function(m){var d=3*(2*m),b=this.getMorph();if(b&&3*this.drawRange>d){var v=b.geometry.getAttribute("instanceStart");return[[v.data.array[d],v.data.array[++d],v.data.array[++d]],[v.data.array[++d],v.data.array[++d],v.data.array[++d]]]}return[]},this.editVertices=function(m,d){if(m&&m.length){var b=this.getMorph(),v=d+m.length-1;if(!b||0>d||v>=this.drawRange)return;var g=3*d;for(m.forEach(w=>{y[g++]=w[0],y[g++]=w[1],y[g++]=w[2]}),g=3*this.drawRange;300>g;)y[g++]=m[0][0],y[g++]=m[0][1],y[g++]=m[0][2];b.geometry.setPositions(y),b.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return y},this.addLines=(m,d)=>{if(m&&0<m.length){this.addVertices(m);var b=this.getMorph();if(!b){var v=new f({color:d,linewidth:1,vertexColors:!1,worldUnits:!1});v.resolution.set(window.innerWidth,window.innerHeight),this.createLineSegment(y,v,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.render=()=>{var m=this.getMorph().material;m.resolution.set(window.innerWidth,window.innerHeight)}};p.prototype=Object.create(u(24).Lines.prototype),p.prototype.constructor=p,l.Lines2=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>_});var c=u(4),f=u(47),h=u(48),p=new c.Vector3,y=new c.Vector3,m=new c.Vector4,d=new c.Vector4,b=new c.Vector4,v=new c.Vector3,g=new c.Matrix4,w=new c.Line3,S=new c.Vector3,T=new c.Box3,M=new c.Sphere,C=new c.Vector4;class _ extends c.Mesh{constructor(){var E=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new f.LineSegmentsGeometry,O=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new h.LineMaterial({color:16777215*Math.random()});super(E,O),this.type="LineSegments2"}computeLineDistances(){for(var E=this.geometry,O=E.attributes.instanceStart,A=E.attributes.instanceEnd,L=new Float32Array(2*O.count),R=0,N=0,x=O.count;R<x;R++,N+=2)p.fromBufferAttribute(O,R),y.fromBufferAttribute(A,R),L[N]=N==0?0:L[N-1],L[N+1]=L[N]+p.distanceTo(y);var I=new c.InstancedInterleavedBuffer(L,2,1);return E.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(I,1,0)),E.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(I,1,1)),this}raycast(E,O){E.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var A=E.params.Line2===void 0?0:E.params.Line2.threshold||0,L=E.ray,R=E.camera,N=R.projectionMatrix,x=this.matrixWorld,I=this.geometry,B=this.material,F=B.resolution,V=B.linewidth+A,k=I.attributes.instanceStart,G=I.attributes.instanceEnd,J=-R.near,ne=2*Math.max(V/F.width,V/F.height);I.boundingSphere===null&&I.computeBoundingSphere(),M.copy(I.boundingSphere).applyMatrix4(x);var ae=Math.max(R.near,M.distanceToPoint(L.origin));C.set(0,0,-ae,1).applyMatrix4(R.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(R.projectionMatrixInverse);var ie=.5*Math.abs(ne/C.w);if(M.radius+=ie,E.ray.intersectsSphere(M)!==!1){I.boundingBox===null&&I.computeBoundingBox(),T.copy(I.boundingBox).applyMatrix4(x);var oe=Math.max(R.near,T.distanceToPoint(L.origin));C.set(0,0,-oe,1).applyMatrix4(R.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(R.projectionMatrixInverse);var W=.5*Math.abs(ne/C.w);if(T.max.x+=W,T.max.y+=W,T.max.z+=W,T.min.x-=W,T.min.y-=W,T.min.z-=W,E.ray.intersectsBox(T)!==!1){L.at(1,b),b.w=1,b.applyMatrix4(R.matrixWorldInverse),b.applyMatrix4(N),b.multiplyScalar(1/b.w),b.x*=F.x/2,b.y*=F.y/2,b.z=0,v.copy(b),g.multiplyMatrices(R.matrixWorldInverse,x);for(var Z=0,j=k.count;Z<j;Z++){m.fromBufferAttribute(k,Z),d.fromBufferAttribute(G,Z),m.w=1,d.w=1,m.applyMatrix4(g),d.applyMatrix4(g);var re=m.z>J&&d.z>J;if(!re){if(m.z>J){var z=m.z-d.z,H=(m.z-J)/z;m.lerp(d,H)}else if(d.z>J){var K=d.z-m.z,le=(d.z-J)/K;d.lerp(m,le)}m.applyMatrix4(N),d.applyMatrix4(N),m.multiplyScalar(1/m.w),d.multiplyScalar(1/d.w),m.x*=F.x/2,m.y*=F.y/2,d.x*=F.x/2,d.y*=F.y/2,w.start.copy(m),w.start.z=0,w.end.copy(d),w.end.z=0;var se=w.closestPointToPointParameter(v,!0);w.at(se,S);var U=c.MathUtils.lerp(m.z,d.z,se),D=-1<=U&&1>=U,$=v.distanceTo(S)<.5*V;if(D&&$){w.start.fromBufferAttribute(k,Z),w.end.fromBufferAttribute(G,Z),w.start.applyMatrix4(x),w.end.applyMatrix4(x);var Y=new c.Vector3,ee=new c.Vector3;L.distanceSqToSegment(w.start,w.end,ee,Y),O.push({point:ee,pointOnLine:Y,distance:L.origin.distanceTo(ee),object:this,face:null,faceIndex:Z,uv:null,uv2:null})}}}}}}}_.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>p});var c=u(4),f=new c.Box3,h=new c.Vector3;class p extends c.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new c.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new c.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(m){var d=this.attributes.instanceStart,b=this.attributes.instanceEnd;return d!==void 0&&(d.applyMatrix4(m),b.applyMatrix4(m),d.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(m){var d;m instanceof Float32Array?d=m:Array.isArray(m)&&(d=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(b,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(m){var d;m instanceof Float32Array?d=m:Array.isArray(m)&&(d=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(d,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(m){return this.setPositions(m.attributes.position.array),this}fromEdgesGeometry(m){return this.setPositions(m.attributes.position.array),this}fromMesh(m){return this.fromWireframeGeometry(new c.WireframeGeometry(m.geometry)),this}fromLineSegments(m){var d=m.geometry;return d.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(d.isBufferGeometry&&this.setPositions(d.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var m=this.attributes.instanceStart,d=this.attributes.instanceEnd;m!==void 0&&d!==void 0&&(this.boundingBox.setFromBufferAttribute(m),f.setFromBufferAttribute(d),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var m=this.attributes.instanceStart,d=this.attributes.instanceEnd;if(m!==void 0&&d!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var v=0,g=0,w=m.count;g<w;g++)h.fromBufferAttribute(m,g),v=Math.max(v,b.distanceToSquared(h)),h.fromBufferAttribute(d,g),v=Math.max(v,b.distanceToSquared(h));this.boundingSphere.radius=Math.sqrt(v),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(m){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(m)}}p.prototype.isLineSegmentsGeometry=!0},(o,l,u)=>{u.r(l),u.d(l,{LineMaterial:()=>f});var c=u(4);c.UniformsLib.line={linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},opacity:{value:1}},c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
3235
3235
  #include <common>
3236
3236
  #include <color_pars_vertex>
3237
3237
  #include <fog_pars_vertex>
@@ -3450,4 +3450,4 @@ void main() {
3450
3450
  #include <fog_fragment>
3451
3451
  #include <premultiplied_alpha_fragment>
3452
3452
 
3453
- }`};class f extends c.ShaderMaterial{constructor(p){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(m){this.uniforms.diffuse.value=m}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(m){this.uniforms.linewidth.value=m}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(y){!!y!="USE_DASH"in this.defines&&(this.needsUpdate=!0),y===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(m){this.uniforms.dashScale.value=m}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(m){this.uniforms.dashSize.value=m}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(m){this.uniforms.dashOffset.value=m}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(m){this.uniforms.gapSize.value=m}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(m){this.uniforms.opacity.value=m}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(m){this.uniforms.resolution.value.copy(m)}},alphaToCoverage:{enumerable:!0,get:function(){return"ALPHA_TO_COVERAGE"in this.defines},set:function(m){!!m!="ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),m===!0?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(p)}}f.prototype.isLineMaterial=!0},(o,l,u)=>{var c=u(4);l.Minimap=function(f){var h=f;this.camera=new c.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var p=new c.BufferGeometry,y=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),m=new c.BufferAttribute(y,3);p.setAttribute("position",m);var d=new c.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new c.Mesh(p,d);var b=new c.Box3,v=new c.Vector3;this.getDiffFromNormalised=(w,S)=>{b.setFromBufferAttribute(m).getCenter(v);var T=v.clone().project(this.camera),M=new c.Vector3(w,S,T.z).unproject(this.camera);return M.sub(v)};var g=(w,S)=>{h.camera.near&&(this.camera.near=h.camera.near),S.farPlane&&(this.camera.far=S.farPlane),S.eyePosition&&this.camera.position.set(S.eyePosition[0],S.eyePosition[1],S.eyePosition[2]),S.upVector&&this.camera.up.set(S.upVector[0],S.upVector[1],S.upVector[2]),S.targetPosition&&this.camera.lookAt(new c.Vector3(S.targetPosition[0],S.targetPosition[1],S.targetPosition[2])),this.camera.zoom=1/w,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var w=new c.Vector3().copy(h.camera.target).project(h.camera),S=new c.Vector3(-1,-1,w.z).unproject(h.camera),T=new c.Vector3(1,-1,w.z).unproject(h.camera),M=new c.Vector3(1,1,w.z).unproject(h.camera),C=new c.Vector3(-1,1,w.z).unproject(h.camera);m.copyVector3sArray([S,T,M,M,C,S]),m.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var w=h.getZincCameraControls(),S=h.getBoundingBox();if(S){var T=S.min.distanceTo(S.max),M=T/2,C=(S.min.x+S.max.x)/2,_=(S.min.y+S.max.y)/2,P=(S.min.z+S.max.z)/2,E=w.getViewportFromCentreAndRadius(C,_,P,M,40,M*4);g(T,E)}}}},(o,l,u)=>{var c=u(4),f=u(51)(c),h=u(3).Geometry,p=u(52),y=u(53).default,m=c.BufferGeometryLoader,d=function(b){var v;b&&b.isGeometry&&(v=b);var g=void 0,w=void 0,S=!1,T=void 0,M=O=>{var A=v.getMorph().material.clone();A.morphTargets=!1;var L=new h,R=new m,N=R.parse(O),x=new c.Mesh(N.geometry,A);return L.geometry=x.geometry,x.userData=L,L.setMorph(x),L},C=O=>{switch(O.data.action){case"message":console.log(O.data.message);break;case"result":var A=new d(M(O.data.object));T&&T(A),T=void 0,S=!1;break;default:throw"Cannot handle specified action."}},_=O=>{if(p!==void 0&&(w=p(54)),!w)g=new(u(55)).GeometryCSGInternal(O);else if(O&&O.isGeometry){var A=O.getMorph(),L=A.geometry.clone().applyMatrix(A.matrix).toJSON();w.addEventListener("message",function(R){C(R)}),w.postMessage({action:"initialise",object:L})}};this.getHostGeometry=()=>{var O=new f(v.getMorph());return new P(O)},this.getGeometry=()=>v;var P=O=>{var A=v.getMorph().material.clone();A.morphTargets=!1;var L=O.toMesh(A),R=new h;return R.geometry=L.geometry,L.userData=R,R.setMorph(L),R};this.setCSG=O=>{g.setCSG(O)};var E=(O,A,L,R)=>{if(S)R("On progress");else{var N=O.getMorph(),x=N.geometry.clone().applyMatrix(N.matrix).toJSON();T=L,S=!0,w.postMessage({action:A,object:x})}};this.intersect=O=>new y((A,L)=>{if(w)E(O,"intersect",A,L);else{var R=g.intersect(O),N=new d(P(R));N.setCSG(R),A(N)}}),this.subtract=O=>new y((A,L)=>{if(w)E(O,"intersect",A,L);else{var R=g.subtract(O),N=new d(P(R));N.setCSG(R),A(N)}}),this.union=O=>new y((A,L)=>{if(w)E(O,"intersect",A,L);else{var R=g.union(O),N=new d(P(R));N.setCSG(R),A(N)}}),this.terminateWorker=()=>{w&&w.terminate()},_(b)};l.GeometryCSG=d},o=>{var l=1e-5,u=0,c=1,f=2,h=3;o.exports=function(p){var y=function(m){var d,b,v,g,w,S,T,M=[];if(m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m instanceof p.Geometry)this.matrix=new p.Matrix4;else if(m.isMesh)m.updateMatrix(),this.matrix=m.matrix.clone(),m=m.geometry,m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m.mergeVertices(),m.computeVertexNormals(!1);else{if(m instanceof y.Node)return this.tree=m,this.matrix=new p.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(d=0,b=m.faces.length;d<b;d++)v=m.faces[d],w=m.faceVertexUvs[0][d],T=new y.Polygon,v instanceof p.Face3?(g=m.vertices[v.a],S=w?new p.Vector2(w[0].x,w[0].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[0],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.b],S=w?new p.Vector2(w[1].x,w[1].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[2],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.c],S=w?new p.Vector2(w[2].x,w[2].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[2],S),g.applyMatrix4(this.matrix),T.vertices.push(g)):(p.Face4,g=m.vertices[v.a],S=w?new p.Vector2(w[0].x,w[0].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[0],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.b],S=w?new p.Vector2(w[1].x,w[1].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[1],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.c],S=w?new p.Vector2(w[2].x,w[2].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[2],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.d],S=w?new p.Vector2(w[3].x,w[3].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[3],S),g.applyMatrix4(this.matrix),T.vertices.push(g)),T.calculateProperties(),M.push(T);this.tree=new y.Node(M)};return y.prototype.subtract=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.invert(),d.clipTo(b),b.clipTo(d),b.invert(),b.clipTo(d),b.invert(),d.build(b.allPolygons()),d.invert(),d=new y(d),d.matrix=this.matrix,d},y.prototype.union=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.clipTo(b),b.clipTo(d),b.invert(),b.clipTo(d),b.invert(),d.build(b.allPolygons()),d=new y(d),d.matrix=this.matrix,d},y.prototype.intersect=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.invert(),b.clipTo(d),b.invert(),d.clipTo(b),b.clipTo(d),d.build(b.allPolygons()),d.invert(),d=new y(d),d.matrix=this.matrix,d},y.prototype.toGeometry=function(){var m,d,b,v,g,w,S,T,M,C,_=new p.Matrix4().getInverse(this.matrix),P=new p.Geometry,E=this.tree.allPolygons(),O=E.length,A={};for(m=0;m<O;m++)for(b=E[m],v=b.vertices.length,d=2;d<v;d++)C=[],T=b.vertices[0],C.push(new p.Vector2(T.uv.x,T.uv.y)),T=new p.Vector3(T.x,T.y,T.z),T.applyMatrix4(_),typeof A[T.x+","+T.y+","+T.z]>"u"?(P.vertices.push(T),g=A[T.x+","+T.y+","+T.z]=P.vertices.length-1):g=A[T.x+","+T.y+","+T.z],T=b.vertices[d-1],C.push(new p.Vector2(T.uv.x,T.uv.y)),T=new p.Vector3(T.x,T.y,T.z),T.applyMatrix4(_),typeof A[T.x+","+T.y+","+T.z]>"u"?(P.vertices.push(T),w=A[T.x+","+T.y+","+T.z]=P.vertices.length-1):w=A[T.x+","+T.y+","+T.z],T=b.vertices[d],C.push(new p.Vector2(T.uv.x,T.uv.y)),T=new p.Vector3(T.x,T.y,T.z),T.applyMatrix4(_),typeof A[T.x+","+T.y+","+T.z]>"u"?(P.vertices.push(T),S=A[T.x+","+T.y+","+T.z]=P.vertices.length-1):S=A[T.x+","+T.y+","+T.z],M=new p.Face3(g,w,S,new p.Vector3(b.normal.x,b.normal.y,b.normal.z)),P.faces.push(M),P.faceVertexUvs[0].push(C);return P},y.prototype.toBufferGeometry=function(){var m=this.toGeometry(),d=new p.BufferGeometry().fromGeometry(m);return d},y.prototype.toMesh=function(m){var d=this.toBufferGeometry(),b=new p.Mesh(d,m);return b.position.setFromMatrixPosition(this.matrix),b.rotation.setFromRotationMatrix(this.matrix),b},y.Polygon=function(m){m instanceof Array||(m=[]),this.vertices=m,0<m.length?this.calculateProperties():this.normal=this.w=void 0},y.Polygon.prototype.calculateProperties=function(){var m=this.vertices[0],d=this.vertices[1],b=this.vertices[2];return this.normal=d.clone().subtract(m).cross(b.clone().subtract(m)).normalize(),this.w=this.normal.clone().dot(m),this},y.Polygon.prototype.clone=function(){var m,d,b=new y.Polygon;for(m=0,d=this.vertices.length;m<d;m++)b.vertices.push(this.vertices[m].clone());return b.calculateProperties(),b},y.Polygon.prototype.flip=function(){var m,d=[];for(this.normal.multiplyScalar(-1),this.w*=-1,m=this.vertices.length-1;0<=m;m--)d.push(this.vertices[m]);return this.vertices=d,this},y.Polygon.prototype.classifyVertex=function(m){var d=this.normal.dot(m)-this.w;return d<-l?f:d>l?c:u},y.Polygon.prototype.classifySide=function(m){var d,b,v,g=0,w=0,S=m.vertices.length;for(d=0;d<S;d++)b=m.vertices[d],v=this.classifyVertex(b),v===c?g++:v===f&&w++;return 0<g&&w===0?c:g===0&&0<w?f:g===0&&w===0?u:h},y.Polygon.prototype.splitPolygon=function(m,d,b,v,g){var w=this.classifySide(m);if(w===u)(0<this.normal.dot(m.normal)?d:b).push(m);else if(w===c)v.push(m);else if(w===f)g.push(m);else{var S,T,M,C,_,P,E,O,A,L=[],R=[];for(T=0,S=m.vertices.length;T<S;T++)M=(T+1)%S,P=m.vertices[T],E=m.vertices[M],C=this.classifyVertex(P),_=this.classifyVertex(E),C!=f&&L.push(P),C!=c&&R.push(P),(C|_)==h&&(O=(this.w-this.normal.dot(P))/this.normal.dot(E.clone().subtract(P)),A=P.interpolate(E,O),L.push(A),R.push(A));3<=L.length&&v.push(new y.Polygon(L).calculateProperties()),3<=R.length&&g.push(new y.Polygon(R).calculateProperties())}},y.Vertex=function(m,d,b,v,g){this.x=m,this.y=d,this.z=b,this.normal=v||new p.Vector3,this.uv=g||new p.Vector2},y.Vertex.prototype.clone=function(){return new y.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},y.Vertex.prototype.add=function(m){return this.x+=m.x,this.y+=m.y,this.z+=m.z,this},y.Vertex.prototype.subtract=function(m){return this.x-=m.x,this.y-=m.y,this.z-=m.z,this},y.Vertex.prototype.multiplyScalar=function(m){return this.x*=m,this.y*=m,this.z*=m,this},y.Vertex.prototype.cross=function(m){var d=this.x,b=this.y,v=this.z;return this.x=b*m.z-v*m.y,this.y=v*m.x-d*m.z,this.z=d*m.y-b*m.x,this},y.Vertex.prototype.normalize=function(){var m=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=m,this.y/=m,this.z/=m,this},y.Vertex.prototype.dot=function(m){return this.x*m.x+this.y*m.y+this.z*m.z},y.Vertex.prototype.lerp=function(m,d){return this.add(m.clone().subtract(this).multiplyScalar(d)),this.normal.add(m.normal.clone().sub(this.normal).multiplyScalar(d)),this.uv.add(m.uv.clone().sub(this.uv).multiplyScalar(d)),this},y.Vertex.prototype.interpolate=function(m,d){return this.clone().lerp(m,d)},y.Vertex.prototype.applyMatrix4=function(m){var d=this.x,b=this.y,v=this.z,g=m.elements;return this.x=g[0]*d+g[4]*b+g[8]*v+g[12],this.y=g[1]*d+g[5]*b+g[9]*v+g[13],this.z=g[2]*d+g[6]*b+g[10]*v+g[14],this},y.Node=function(m){var d,b,v=[],g=[];if(this.polygons=[],this.front=this.back=void 0,m instanceof Array&&m.length!==0){for(this.divider=m[0].clone(),d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],this.polygons,this.polygons,v,g);0<v.length&&(this.front=new y.Node(v)),0<g.length&&(this.back=new y.Node(g))}},y.Node.isConvex=function(m){var d,b;for(d=0;d<m.length;d++)for(b=0;b<m.length;b++)if(d!==b&&m[d].classifySide(m[b])!==f)return!1;return!0},y.Node.prototype.build=function(m){var d,b,v=[],g=[];for(this.divider||(this.divider=m[0].clone()),d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],this.polygons,this.polygons,v,g);0<v.length&&(!this.front&&(this.front=new y.Node),this.front.build(v)),0<g.length&&(!this.back&&(this.back=new y.Node),this.back.build(g))},y.Node.prototype.allPolygons=function(){var m=this.polygons.slice();return this.front&&(m=m.concat(this.front.allPolygons())),this.back&&(m=m.concat(this.back.allPolygons())),m},y.Node.prototype.clone=function(){var m=new y.Node;return m.divider=this.divider.clone(),m.polygons=this.polygons.map(function(d){return d.clone()}),m.front=this.front&&this.front.clone(),m.back=this.back&&this.back.clone(),m},y.Node.prototype.invert=function(){var m,d,b;for(m=0,d=this.polygons.length;m<d;m++)this.polygons[m].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),b=this.front,this.front=this.back,this.back=b,this},y.Node.prototype.clipPolygons=function(m){var d,b,v,g;if(!this.divider)return m.slice();for(v=[],g=[],d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],v,g,v,g);return this.front&&(v=this.front.clipPolygons(v)),g=this.back?this.back.clipPolygons(g):[],v.concat(g)},y.Node.prototype.clipTo=function(m){this.polygons=m.clipPolygons(this.polygons),this.front&&this.front.clipTo(m),this.back&&this.back.clipTo(m)},y}},o=>{o.exports=MB()},o=>{o.exports=LB},(o,l,u)=>{var c=u(3).Geometry,f=u(4),h=f.BufferGeometryLoader;o.exports=function(p){var y=void 0,m=function(S){var T=new h,M=T.parse(S),C=new f.MeshPhongMaterial,_=new f.Mesh(M.geometry,C),P=new c;return P.setMorph(_),P},d=function(S){var T=m(S);y=new(u(55)).GeometryCSGInternal(T),p.postMessage({action:"message",message:"Initialised"})},b=function(S){if(y){var T=m(S),M=y.intersect(T),C=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:C})}},v=function(S){if(y){var T=m(S),M=y.subtract(T),C=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:C})}},g=function(S){if(y){var T=m(S),M=y.union(T),C=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:C})}};p.addEventListener("message",function(w){switch(w.data.action){case"initialise":d(w.data.object);break;case"intersect":b(w.data.object);break;case"subtract":v(w.data.object);break;case"union":g(w.data.object);break;default:throw"Cannot handle specified action."}})}},(o,l,u)=>{var c=u(4),f=u(51)(c);u(3).Geometry,u(50).GeometryCSG;var h=function(p){var y;p&&p.isGeometry&&(y=p);var m;this.setGeometry=b=>{b&&b.isGeometry&&(y=b),m=void 0},this.setCSG=b=>{m=b};var d=b=>{if(y&&y.morph&&b&&b.morph){m===void 0&&(m=new f(y.morph));var v=new f(b.morph);return v}};this.intersect=b=>{var v=d(b);return m&&v?m.intersect(v):void 0},this.subtract=b=>{var v=d(b);return m&&v?m.subtract(v):void 0},this.union=b=>{var v=d(b);return m&&v?m.union(v):void 0}};l.GeometryCSGInternal=h},(o,l,u)=>{var c=u(4),f=u(51)(c);u(18).Glyphset;var h=function(p){var y;p&&p.isGlyphset&&(y=p);var m=[];this.setGlyphset=v=>{v&&v.isGlyphset&&(y=v),hostCSG=void 0},this.getGlyphset=()=>y;var d=()=>v=>{var g=v.getMesh(),w=v.getLabel();if(g){var S=new f(g.geometry.clone().applyMatrix(g.matrix)),T=[];T.csg=S,T.label=w,g.material&&(T.material=g.material.clone()),m.push(T)}},b=v=>{if(y&&v&&v.getMorph()){m.length==0&&y.forEachGlyph(d());var g=new f(v.getMorph());return g}};this.intersect=v=>{var g=b(v);if(0<m.length&&g){for(var w=new(u(18)).Glyphset,S=0;S<m.length;S++){var T=m[S],M=T.csg.intersect(g),C=M.toMesh();if(C&&C.geometry&&0<C.geometry.vertices.length){T.material&&(C.material=T.material,C.material.side=c.DoubleSide,C.material.clippingPlanes=null);var _=w.addMeshAsGlyph(C,S+1);_.setLabel(T.label)}}var P=new h(w);return P}}};l.GlyphsetCSG=h}],i={};function r(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return t[o].call(u.exports,u,u.exports,r),u.exports}r.n=o=>{var l=o&&o.__esModule?()=>o.default:()=>o;return r.d(l,{a:l}),l},r.d=(o,l)=>{for(var u in l)r.o(l,u)&&!r.o(o,u)&&Object.defineProperty(o,u,{enumerable:!0,get:l[u]})},r.o=(o,l)=>Object.prototype.hasOwnProperty.call(o,l),r.r=o=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var s=r(0);return s})())})(Tg);var gr=Tg.exports;const kc=oC(gr),nx=(n,e)=>{if(n){let t="";n.forEach(i=>{t=i.uuid,i.region&&(t=i.region.uuid+"/"+t),i&&i.getVisibility()&&e.push(t)})}return e},mf=(n,e)=>{const t=n[0]-e[0],i=n[1]-e[1],r=n[2]-e[2];return Math.sqrt(t*t+i*i+r*r)},PB=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable&&t.isLines2){const i=n.identifiers[0].extraData.intersected;if(i&&i.faceIndex>-1){const r=t.getVerticesByFaceIndex(i.faceIndex),s=n.identifiers[0].extraData.intersected.pointOnLine;if(r.length>1){const o=mf(r[0],[s.x,s.y,s.z]),l=mf(r[1],[s.x,s.y,s.z]);return o>l?{zincObject:t,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2+1,point:r[0]}:{zincObject:t,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2,point:r[1]}}}}}},IB=n=>{const e=n.zincObjects;if(e.length>0&&e[0])return e[0]},OB=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable)return t}},NB=(n,e,t)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isPointset)){let i=!1;for(let r=0;r<3&&!i;r++)t[r]!==0&&(i=!0);if(i&&e>-1){const r=n.getVerticesByIndex(e);return r&&(r[0]=r[0]+t[0],r[1]=r[1]+t[1],r[2]=r[2]+t[2]),n.editVertices([r],e),n.boundingBoxUpdateRequired=!0,!0}}return!1},zc=(n,e)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isLines2)&&e>-1){const t=n.getVerticesByFaceIndex(e);if(t&&t.length>1)return mf(t[1],t[0])}return 0},gf=(n,e,t,i)=>{if(n&&t!==0&&n.isEditable&&n.isLines2&&e>-1){const r=n.getVerticesByFaceIndex(e);let s=[r[1][0]-r[0][0],r[1][1]-r[0][1],r[1][2]-r[0][2]];const o=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);for(let l=0;l<3;l++)s[l]=s[l]/o*t,i?r[1][l]=r[0][l]+s[l]:(r[0][l]=r[0][l]+s[l],r[1][l]=r[1][l]+s[l]);return n.editVertices(r,e*2),n.boundingBoxUpdateRequired=!0,!0}return!1},DB=(n,e)=>{const t=e.getBoundingBox(),i=new gr.THREE.Vector3().subVectors(t.max,t.min),r=new gr.THREE.BoxGeometry(i.x,i.y,i.z);i.addVectors(t.min,t.max).multiplyScalar(.5);const s=r.getAttribute("position"),o=s.count,l=[];for(let u=0;u<o;u++)l[u]=[s.array[u*3],s.array[u*3+1],s.array[u*3+2]];n.editVertices(l,0),n.setPosition(i.x,i.y,i.z),r.dispose()},ix=(n,e)=>{let t="";n.isRegion&&(t=`__r${n.regionPath}`),n.isPrimitives&&(t=`${n.regionPath}/${n.label}`),e.push(t),n.children&&n.children.forEach(i=>ix(i,e))},wo=(n,e,t,i)=>{let r=n;const s=[];if(t&&(r=n.findChildFromPath(t)),r){const o=Array.isArray(e);let l=e;o||(l=[l]),l.forEach(u=>{const c=r.findObjectsWithGroupName(u,i);s.push(...c)})}return s},yf=(n,e,t)=>{const i=n.findIndex(s=>s.uuid===e);let r;return i>-1&&(r=n[i],t&&n.splice(i,1)),r},BB=(n,e)=>{const t=[];if(n&&e&&e.length>0){const i={},r={},s=[n,...n.getChildRegions(!0)];let o,l,u;e.forEach(c=>{const f=c.split("/");u=f[0],o=yf(s,u,!1),o&&(r[u]||(r[u]=o.getFullPath()),f[1]?(i[u]||(i[u]=o.getAllObjects(!1)),l=yf(i[u],f[1],!0),l&&t.push(`${r[u]}/${l.groupName}`)):t.push(`__r/${r[u]}`))})}return t},FB=n=>{if(n){const e=[];return n.forEach(i=>{i.isZincObject?e.push(i):i.isRegion&&e.push(...i.getAllObjects(!0))}),Object.values(e.reduce((i,r)=>({...i,[r.uuid]:r}),{}))}return[]},rx=(n,e)=>{const t={label:"Multiple selections",regionPath:"",objects:[]};if(e&&n){const i={},r=n.getRootRegion();e.length>0&&(t.regionPath=e[0].data.region,t.label=e[0].data.group),e.forEach(s=>{s.data.region.includes(t.regionPath)||(t.regionPath=""),t.label!==s.data.group&&(t.label="Multiple selections");const o=r.findChildFromPath(s.data.region);i[o.uuid]||(i[o.uuid]=o.getAllObjects(!1));const l=yf(i[o.uuid],s.data.uuid);l&&t.objects.push(l)})}return t},VB=n=>{const e=n.getMorph();let t="position";n.isLines2&&(t="instanceStart");const i=[];let r=0;const s=e.geometry.getAttribute(t);for(let o=0;o<n.drawRange;o++)i.push([s.array[r++],s.array[r++],s.array[r++]]);return i},sx=(n,e,t,i,r)=>{let s;n.isPointset?s="MultiPoint":n.isLines2?s="MultiLineString":s="Feature";const o=s!=="Feature",l=s==="Feature"?"Feature annotation":"Drawn annotation";if(s){const u=VB(n);let c=e.slice(-1)==="/"?e:e+"/";c=c+t;const f=c,h={resource:i,item:{id:f},body:{evidence:[],comment:r},feature:{id:f,properties:{drawn:o,label:l},geometry:{coordinates:u,type:s}}};return r==="Deleted"&&(h.feature=void 0),h}},ox=(n,e,t,i,r,s,o)=>{const l=sx(t,i,r,s,o);if(l)return n&&n.currentUser&&(l.creator={...n.currentUser},l.creator.orcid||(l.creator.orcid="0000-0000-0000-0000"),n.addAnnotation(e,l).then(u=>{u.annotationId||console.log("There is a problem with the submission, please try again later")}).catch(()=>{console.log("There is a problem with the submission, please try again later")})),l},ax=async(n,e,t)=>{const i=t;return await n.drawnFeatures(e,i)},lx=(n,e)=>{n&&e.forEach(t=>{const i=t.geometry,r=decodeURIComponent(t.id),s=r.lastIndexOf("/"),o=r.substring(0,s),l=r.substring(s+1);let u;i.type==="MultiPoint"?u=n.createPoints(o,l,i.coordinates,l,8942):i.type==="MultiLineString"&&(u=n.createLines(o,l,i.coordinates,60962)),u&&(u.zincObject.isEditable=!0)})},Pi=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},kB={name:"LinesControls",components:{Button:bs,Col:Ln,Container:Xn,InputNumber:mi,Main:pi,Slider:Sn,ElIconArrowLeft:Fi,ElIconArrowRight:Vi},props:{createData:{type:Object}},data:function(){return{adjust:0,pAdjust:0,lengthScale:0,distance:0,newDistance:0,width:1,currentIndex:0,ElIconArrowLeft:a.shallowRef(Fi),ElIconArrowRight:a.shallowRef(Vi),edited:!1,zincObject:void 0}},watch:{"createData.faceIndex":{handler:function(n){var e;(e=this.zincObject)!=null&&e.isLines2&&(this.currentIndex=n,this.distance=zc(this.zincObject,this.currentIndex))},immediate:!0}},methods:{changeIndex:function(n){n?zc(this.zincObject,this.currentIndex+1)>0&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onLengthInput:function(){this.newDistance!==0?(this.distance=this.newDistance,this.edited=gf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited):this.newDistance=this.distance},onLengthSliding:function(){this.newDistance=Math.pow(10,this.lengthScale)*this.distance,this.edited=gf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited},onMoveSliding:function(){const n=(this.adjust-this.pAdjust)*this.distance;this.edited=gf(this.zincObject,this.currentIndex,n,!1)||this.edited,this.pAdjust=this.adjust},reset:function(){this.adjust=0,this.pAdjust=0,this.lengthScale=0,this.distance=zc(this.zincObject,this.currentIndex),this.newDistance=this.distance,this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){this.currentIndex=-1,this.distance=0,n.isLines2?(this.zincObject=a.markRaw(n),this.width=this.zincObject.getMorph().material.linewidth,n.isEditable&&(this.currentIndex=0,this.distance=zc(n,this.currentIndex))):(this.zincObject=void 0,this.width=10)},modifyWidth:function(){this.zincObject.setWidth(this.width)}}};function zB(n,e,t,i,r,s){const o=Ln,l=Sn,u=mi,c=Zn,f=bs,h=pi,p=Xn;return a.openBlock(),a.createBlock(p,{class:"lines-container"},{default:a.withCtx(()=>[a.createVNode(h,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[11]||(e[11]=[a.createTextVNode(" Width: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.width,"onUpdate:modelValue":e[0]||(e[0]=y=>n.width=y),class:"my-slider",step:1,min:1,max:100,"show-tooltip":!1,onInput:s.modifyWidth},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.width,"onUpdate:modelValue":e[1]||(e[1]=y=>n.width=y),step:1,min:1,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1}),n.currentIndex>-1&&n.distance>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[2]||(e[2]=y=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Line "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",icon:n.ElIconArrowRight,onClick:e[3]||(e[3]=y=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[12]||(e[12]=[a.createTextVNode(" Move: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.adjust,"onUpdate:modelValue":e[4]||(e[4]=y=>n.adjust=y),step:.01,min:-3,max:3,"show-tooltip":!1,onInput:e[5]||(e[5]=y=>s.onMoveSliding()),onChange:e[6]||(e[6]=y=>s.reset())},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[13]||(e[13]=[a.createTextVNode(" Length: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.lengthScale,"onUpdate:modelValue":e[7]||(e[7]=y=>n.lengthScale=y),step:.01,min:-1,max:1,"show-tooltip":!1,onInput:e[8]||(e[8]=y=>s.onLengthSliding()),onChange:e[9]||(e[9]=y=>s.reset())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.newDistance,"onUpdate:modelValue":e[10]||(e[10]=y=>n.newDistance=y),controls:!1,class:"input-box number-input",onChange:s.onLengthInput},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const cx=Pi(kB,[["render",zB],["__scopeId","data-v-6581aa67"]]),UB={name:"PointsControls",components:{Col:Ln,Container:Xn,InputNumber:mi,Main:pi,Select:xs,Slider:Sn,Row:Zn,Option:ws,ElIconArrowLeft:Fi,ElIconArrowRight:Vi},inject:["boundingDims"],data:function(){return{attenuation:!1,size:10,choices:[{value:!0,label:"On"},{value:!1,label:"off"}],min:[0,0,0],max:[1,1,1],translation:[0,0,0],pTranslation:[0,0,0],currentIndex:-1,ElIconArrowLeft:a.shallowRef(Fi),ElIconArrowRight:a.shallowRef(Vi),edited:!1,zincObject:void 0}},watch:{boundingDims:{handler:function(n){const e=n.size;this.min=[-e[0]/2,-e[1]/2,-e[2]/2],this.max=[e[0]/2,e[1]/2,e[2]/2]},immediate:!0,deep:!0}},methods:{changeIndex:function(n){n?this.zincObject.drawRange>this.currentIndex+1&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onMoveSliding:function(){const n=[this.translation[0]-this.pTranslation[0],this.translation[1]-this.pTranslation[1],this.translation[2]-this.pTranslation[2]];this.edited=NB(this.zincObject,this.currentIndex,n)||this.edited;for(let e=0;e<3;e++)this.pTranslation[e]=this.translation[e]},reset:function(){this.translation=[0,0,0],this.pTranslation=[0,0,0],this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){this.currentIndex=-1,n.isPointset?(this.zincObject=a.markRaw(n),this.size=this.zincObject.morph.material.size,this.attenuation=this.zincObject.morph.material.sizeAttenuation,n.isEditable&&this.zincObject.drawRange>0&&(this.currentIndex=0)):(this.zincObject=void 0,this.size=10,this.attenuation=!1)},modifyAttenuation:function(n){this.attenuation=n,this.zincObject.setSizeAttenuation(n)},modifySize:function(){this.zincObject.setSize(this.size)}}};function GB(n,e,t,i,r,s){const o=Ln,l=Sn,u=mi,c=Zn,f=ws,h=xs,p=bs,y=pi,m=Xn;return a.openBlock(),a.createBlock(m,{class:"pointset-container"},{default:a.withCtx(()=>[a.createVNode(y,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[15]||(e[15]=[a.createTextVNode(" Size: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.size,"onUpdate:modelValue":e[0]||(e[0]=d=>n.size=d),class:"my-slider",step:1,min:0,max:100,"show-tooltip":!1,onInput:e[1]||(e[1]=d=>s.modifySize())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.size,"onUpdate:modelValue":e[2]||(e[2]=d=>n.size=d),step:1,min:0,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" Size attenuation: ")])),_:1}),a.createVNode(o,{offset:0,span:5},{default:a.withCtx(()=>[a.createVNode(h,{teleported:!1,"model-value":n.attenuation,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:e[3]||(e[3]=d=>s.modifyAttenuation(d,n.slide))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.choices,d=>(a.openBlock(),a.createBlock(f,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])]),_:1})]),_:1}),n.currentIndex>-1?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(p,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[4]||(e[4]=d=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Point "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(p,{size:"small",icon:n.ElIconArrowRight,onClick:e[5]||(e[5]=d=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" x: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[0],"onUpdate:modelValue":e[6]||(e[6]=d=>n.translation[0]=d),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[7]||(e[7]=d=>s.onMoveSliding()),onChange:e[8]||(e[8]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" y: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[1],"onUpdate:modelValue":e[9]||(e[9]=d=>n.translation[1]=d),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[10]||(e[10]=d=>s.onMoveSliding()),onChange:e[11]||(e[11]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" z: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[2],"onUpdate:modelValue":e[12]||(e[12]=d=>n.translation[2]=d),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[13]||(e[13]=d=>s.onMoveSliding()),onChange:e[14]||(e[14]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const ux=Pi(UB,[["render",GB],["__scopeId","data-v-d1de9c65"]]),HB={name:"TextureSlidesControls",components:{Col:Ln,Container:Xn,Footer:ug,Icon:ht,InputNumber:mi,Main:pi,Row:Zn,Select:xs,Slider:Sn,Option:ws,ElIconDelete:Ja,ElIconPlus:Ka},data:function(){return{settings:[],directions:[{value:"x",label:"x"},{value:"y",label:"y"},{value:"z",label:"z"}],zincObject:void 0}},methods:{setObject:function(n){n.isTextureSlides?(this.zincObject=a.markRaw(n),this.settings=this.zincObject.getTextureSettings()):(this.zincObject=void 0,this.settings=[])},addNewSlide:function(){const n={direction:"x",value:0},e=this.zincObject.createSlide(n);this.settings.push(e)},modifyDirection:function(n,e){e&&(e.direction=n,this.zincObject.modifySlideSettings(e))},modifySlide:function(n){n&&this.zincObject.modifySlideSettings(n)},removeSlide:function(n,e){this.zincObject.removeSlideWithId(e.id),this.settings.splice(n,1)}}};function WB(n,e,t,i,r,s){const o=ws,l=xs,u=Ln,c=Sn,f=mi,h=Ja,p=ht,y=Zn,m=pi,d=Ka,b=ug,v=Xn;return a.openBlock(),a.createBlock(v,{class:"t-slides-container"},{default:a.withCtx(()=>[a.createVNode(m,{class:"slides-block"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.settings,(g,w)=>(a.openBlock(),a.createBlock(y,{key:g.id,class:"slide-row"},{default:a.withCtx(()=>[a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(l,{teleported:!1,"model-value":g.direction,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:S=>s.modifyDirection(S,g)},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.directions,S=>(a.openBlock(),a.createBlock(o,{key:S.value,label:S.label,value:S.value},null,8,["label","value"]))),128))]),_:2},1032,["model-value","onChange"])]),_:2},1024),a.createVNode(u,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(c,{modelValue:g.value,"onUpdate:modelValue":S=>g.value=S,class:"my-slider",step:.01,min:0,max:1,"show-tooltip":!1,onInput:S=>s.modifySlide(g)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:2},1024),a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(f,{modelValue:g.value,"onUpdate:modelValue":S=>g.value=S,step:.01,min:0,max:1,controls:!1,class:"input-box number-input"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a.createVNode(u,{offset:0,span:2},{default:a.withCtx(()=>[a.createVNode(p,{class:"delete-icon",onClick:S=>s.removeSlide(w,g)},{default:a.withCtx(()=>[a.createVNode(h)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1}),a.createVNode(b,{height:"30px",class:"add-slides-text",onClick:s.addNewSlide},{default:a.withCtx(()=>[a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(u,{span:2},{default:a.withCtx(()=>[a.createVNode(p,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})]),_:1}),a.createVNode(u,{span:20},{default:a.withCtx(()=>e[0]||(e[0]=[a.createTextVNode(" Add a new slide ")])),_:1})]),_:1})]),_:1},8,["onClick"])]),_:1})}const dx=Pi(HB,[["render",WB],["__scopeId","data-v-12185b7f"]]),jB={name:"TransformationControls",components:{Col:Ln,Container:Xn,InputNumber:mi,Main:pi,Slider:Sn},inject:["boundingDims"],data:function(){return{x:0,y:0,z:0,scale:1,min:[0,0,0],max:[1,1,1],zincObject:void 0,enableScaling:!0}},watch:{boundingDims:{handler:function(n){const e=n.centre,t=n.size;this.min=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],this.max=[e[0]+t[0],e[1]+t[1],e[2]+t[2]]},immediate:!0,deep:!0}},methods:{setObject:function(n){if(n.isZincObject){this.zincObject=a.markRaw(n);const e=this.zincObject.getGroup();e&&e.position&&(this.x=e.position.x,this.y=e.position.y,this.z=e.position.z,this.zincObject.isGlyphset?this.scale=this.zincObject.globalScale:this.scale=e.scale.x,this.enableScaling=!this.zincObject.isTextureSlides)}else this.zincObject=void 0,this.x=0,this.y=0,this.z=0,this.scale=1},modifyPosition:function(){this.zincObject.setPosition(this.x,this.y,this.z)},modifyScale:function(){this.zincObject.setScaleAll(this.scale)}}};function $B(n,e,t,i,r,s){const o=Ln,l=Sn,u=mi,c=Zn,f=pi,h=Xn;return a.openBlock(),a.createBlock(h,{class:"transformation-container"},{default:a.withCtx(()=>[a.createVNode(f,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" x: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.x,"onUpdate:modelValue":e[0]||(e[0]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[1]||(e[1]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.x,"onUpdate:modelValue":e[2]||(e[2]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],controls:!1,class:"input-box number-input",onChange:e[3]||(e[3]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" y: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.y,"onUpdate:modelValue":e[4]||(e[4]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[5]||(e[5]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.y,"onUpdate:modelValue":e[6]||(e[6]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],controls:!1,class:"input-box number-input",onChange:e[7]||(e[7]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" z: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.z,"onUpdate:modelValue":e[8]||(e[8]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[9]||(e[9]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.z,"onUpdate:modelValue":e[10]||(e[10]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],controls:!1,class:"input-box number-input",onChange:e[11]||(e[11]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),n.enableScaling?(a.openBlock(),a.createBlock(c,{key:0,class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" Scale: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.scale,"onUpdate:modelValue":e[12]||(e[12]=p=>n.scale=p),step:.01,min:0,max:5,"show-tooltip":!1,onInput:e[13]||(e[13]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.scale,"onUpdate:modelValue":e[14]||(e[14]=p=>n.scale=p),step:.01,min:0,max:5,controls:!1,class:"input-box number-input",onChange:e[15]||(e[15]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1})]),_:1})}const hx=Pi(jB,[["render",$B],["__scopeId","data-v-69c1b94a"]]),ZB={name:"OpacityControls",components:{Container:Xn,Header:JC,Main:pi,Slider:Sn},props:{material:void 0,zincObject:void 0},data:function(){return{displayString:"100%"}},watch:{"material.opacity":function(){this.material&&this.zincObject&&this.zincObject.setAlpha(this.material.opacity)}},methods:{formatTooltip(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString}}},XB={class:"block"},YB={class:"display"};function JB(n,e,t,i,r,s){const o=Sn,l=Xn;return t.material?(a.openBlock(),a.createBlock(l,{key:0,class:"opacity-container"},{default:a.withCtx(()=>[a.createElementVNode("div",XB,[a.createElementVNode("span",YB,a.toDisplayString(n.displayString),1),a.createVNode(o,{modelValue:t.material.opacity,"onUpdate:modelValue":e[0]||(e[0]=u=>t.material.opacity=u),class:"my-slider",step:.01,min:0,max:1,"format-tooltip":s.formatTooltip,"show-tooltip":!1},null,8,["modelValue","format-tooltip"])])]),_:1})):a.createCommentVNode("",!0)}const fx=Pi(ZB,[["render",JB],["__scopeId","data-v-cbfc46a5"]]),KB={name:"PrimitiveControls",components:{Collapse:rg,CollapseItem:sg,LinesControls:cx,OpacityControls:fx,PointsControls:ux,TextureSlidesControls:dx,TransformationControls:hx,ElIconArrowRight:Vi},props:{createData:{type:Object}},data:function(){return{activeName:"oControls",material:void 0,isTextureSlides:!1,isPointset:!1,isLines:!1,drawerOpen:!0,zincObject:void 0,isEditable:!1,displayString:"100%"}},methods:{formatTooltip:function(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setObject:function(n){var e;n?this.zincObject=a.markRaw(n):this.zincObject=void 0,this.isEditable=!!((e=this.zincObject)!=null&&e.isEditable),this.isPointset=!1,this.isTextureSlides=!1,this.isLines=!1,this.activeName="trControls",n&&(n.isTextureSlides?(this.isTextureSlides=!0,this.$refs.tSlidesControls.setObject(n),this.activeName="tsControls"):n.isPointset?(this.isPointset=!0,this.$refs.pointsetControls.setObject(n),this.activeName="pControls"):n.isLines2&&(this.isLines=!0,this.$refs.linesControls.setObject(n),this.activeName="lControls"),this.$refs.transformationControls.setObject(n)),n&&n.getMorph()?this.material=n.getMorph().material:this.material=void 0}}};function qB(n,e,t,i,r,s){const o=fx,l=sg,u=hx,c=dx,f=ux,h=cx,p=rg,y=Vi,m=ht;return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["primitive-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",{class:a.normalizeClass(["my-drawer",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(p,{class:"collapse",modelValue:n.activeName,"onUpdate:modelValue":e[2]||(e[2]=d=>n.activeName=d),accordion:""},{default:a.withCtx(()=>[a.withDirectives(a.createVNode(l,{title:"Opacity",name:"oControls"},{default:a.withCtx(()=>[a.createVNode(o,{material:n.material,zincObject:n.zincObject,ref:"opacityControls"},null,8,["material","zincObject"])]),_:1},512),[[a.vShow,!n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Transformation",name:"trControls"},{default:a.withCtx(()=>[a.createVNode(u,{class:"transformation-controls",ref:"transformationControls"},null,512)]),_:1},512),[[a.vShow,!n.isEditable]]),a.withDirectives(a.createVNode(l,{title:"Texture Slides",name:"tsControls"},{default:a.withCtx(()=>[a.createVNode(c,{class:"texture-controls",ref:"tSlidesControls"},null,512)]),_:1},512),[[a.vShow,n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Points",name:"pControls"},{default:a.withCtx(()=>[a.createVNode(f,{class:"pointset-controls",ref:"pointsetControls",onPrimitivesUpdated:e[0]||(e[0]=d=>n.$emit("primitivesUpdated",d))},null,512)]),_:1},512),[[a.vShow,n.isPointset]]),a.withDirectives(a.createVNode(l,{title:"Lines",name:"lControls"},{default:a.withCtx(()=>[a.createVNode(h,{class:"lines-controls",ref:"linesControls",createData:t.createData,onPrimitivesUpdated:e[1]||(e[1]=d=>n.$emit("primitivesUpdated",d))},null,8,["createData"])]),_:1},512),[[a.vShow,n.isLines]])]),_:1},8,["modelValue"])],2),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[3]||(e[3]=(...d)=>s.toggleDrawer&&s.toggleDrawer(...d))},[a.createVNode(m,null,{default:a.withCtx(()=>[a.createVNode(y)]),_:1})],2)],2)),[[a.vShow,n.material||n.isTextureSlides]])}const px=Pi(KB,[["render",qB],["__scopeId","data-v-d55fc9a4"]]),QB=(n,e)=>{const t=n.label.toUpperCase(),i=e.label.toUpperCase();return t<i?-1:t>i?1:0},eF={name:"ScaffoldTreeControls",components:{ElIconArrowLeft:Fi,TreeControls:Fa.TreeControls},props:{showColourPicker:Boolean,isReady:Boolean},data:function(){return{treeData:[{label:"Root",regionPath:"",id:void 0,children:[]}],active:[],hover:[],drawerOpen:!0,nodeNumbers:0,module:void 0}},computed:{treeDataEntry:function(){return this.treeData[0].children}},watch:{treeDataEntry:{deep:!0,handler:function(n){this.isReady&&this.setColourField(n)}}},methods:{addTreeItem:function(n,e,t){n.some(i=>i.label===e.label)||(Object.assign(e,{activeColour:this.getColour(e)}),n.push(e),n.sort((i,r)=>QB(i,r)),this.nodeNumbers++,this.$nextTick(()=>{!this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id)&&t.getVisibility()&&this.$refs.treeControls.$refs.regionTree.setChecked(e.id,!0)}))},findOrCreateRegion:function(n,e,t){if(this.module&&this.module.scene&&(this.treeData[0].id=this.module.scene.getRootRegion().uuid,this.treeData[0].isRegion=!0),e.length>0){const i=[...e];let r=n.children.find(l=>l.label==i[0]);const s=t+"/"+e[0],o=this.module.scene.getRootRegion().findChildFromPath(s);return r||(r={label:i[0],id:o.uuid,children:[],regionPath:s,isRegion:!0},this.addTreeItem(n.children,r,o),s==="/_helper"&&this.$nextTick(()=>{this.$refs.treeControls.$refs.regionTree.setChecked(r.id,!1)})),i.shift(),this.findOrCreateRegion(r,i,s)}else return n},removeRegion:function(n){if(this.treeData[0].children){for(let e=0;e<this.treeData[0].children.length;e++)if(this.treeData[0].children[e].label===n){this.treeData[0].children.splice(e,1),this.nodeNumbers--;return}}},zincObjectAdded:function(n){const e=n.region;if(e){const t=e.getFullSeparatedPath(),i=this.findOrCreateRegion(this.treeData[0],t,"");if(n.groupName&&i){i.children||(i.children=[]);const r={label:n.groupName,id:e.uuid+"/"+n.uuid,isPrimitives:!0,regionPath:n.region.getFullPath(),isTextureSlides:!!n.isTextureSlides};this.addTreeItem(i.children,r,n)}}},zincObjectRemoved:function(n){const e=n.groupName;if(n.region.findObjectsWithGroupName(e,!1).length===0){const i=n.region.getFullSeparatedPath(),r=this.findOrCreateRegion(this.treeData[0],i,"");if(r.children){for(let s=0;s<r.children.length;s++)if(r.children[s].label===e){r.children.splice(s,1),this.nodeNumbers--;return}}}},checkChanged:function(n,e){const t=n.isRegion,i=n.isPrimitives,r=e.checkedKeys.includes(n.id),s=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);t&&(r?s.showAllPrimitives():s.hideAllPrimitives()),i&&s.findObjectsWithGroupName(n.label).forEach(l=>{l.setVisibility(r)})},updateActiveUI:function(n){this.active.length=0,nx(n,this.active)},changeActiveByPrimitives:function(n,e){n&&n.length>0?(this.updateActiveUI(n),this.$emit("object-selected",n,e)):this.removeActive(e),this.removeHover(e)},updateHoverUI:function(n){this.hover.length=0,nx(n,this.hover)},changeHoverByPrimitives:function(n,e){n&&n.length>0?(this.updateHoverUI(n),this.$emit("object-hovered",n,e)):this.removeHover(e)},changeActiveByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=wo(i,n,e,!0);this.changeActiveByPrimitives(r,t)},changeHoverByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=wo(i,n,e,!0);this.changeHoverByPrimitives(r,t)},changeActiveByNode:function(n,e){if(n.isPrimitives||n.isRegion){const t=!!n.isRegion,i=this.getZincObjectsFromNode(n,t);this.changeActiveByPrimitives(i,e)}},changeHoverByNode:function(n,e){if(n.isPrimitives){const t=this.getZincObjectsFromNode(n,!1);this.changeHoverByPrimitives(t,e)}},removeActive:function(n){this.active=[],this.$emit("object-selected",[],n)},removeHover:function(n){this.hover=[],this.$emit("object-hovered",[],n)},clear:function(){this.active.length=0,this.hover.length=0,this.nodeNumbers=0,this.$refs.treeControls.$refs.regionTree.updateKeyChildren(this.treeData[0].id,[]),this.treeData[0].children.length=0,this.treeData[0].id=void 0,this.$emit("object-selected",[])},getColour:function(n){if(n){let t=this.getZincObjectsFromNode(n,!1)[0];if(t){let i=t.getColourHex();if(i)return"#"+i}}return"#FFFFFF"},getZincObjectsFromNode:function(n,e){const t=this.module.scene.getRootRegion();if(n.isPrimitives)return wo(t,n.label,n.regionPath,e);if(n.isRegion&&n.regionPath){let i=t.findChildFromPath(n.regionPath);if(i)return i.getAllObjects(e)}return[]},setModule:function(n){this.module=a.markRaw(n),this.nodeNumbers=0,this.module.scene.getRootRegion().getAllObjects(!0).forEach(t=>{this.zincObjectAdded(t)}),this.module.addOrganPartAddedCallback(this.zincObjectAdded),this.module.addOrganPartRemovedCallback(this.zincObjectRemoved)},setColourField:function(n,e=void 0){n.filter(t=>e&&!t.children?t.id===e.id:!0).map(t=>{if(t.children)this.setColourField(t.children,e);else{const i=this.getColour(t);t.defaultColour||(t.defaultColour=i),t.activeColour=i}})},setColour:function(n,e){n&&n.isPrimitives&&this.getZincObjectsFromNode(n,!1).forEach(i=>{let s=(e||n.defaultColour).replace("#","0x");i.setColourHex(s),this.setColourField(this.treeData[0].children,n)})},visibilityToggle:function(n,e){this.module.changeOrganPartsVisibility(n,e),e==!1&&(this.activeRegion===n&&this.removeActive(!0),this.hoverRegion===n&&this.removeHover(!0))},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen,this.$emit("drawer-toggled",this.drawerOpen)},setTreeVisibilityWithFullPaths:function(n,e,t,i){let r=!1,s="";n.isRegion&&(s=`__r${n.regionPath}`),n.isPrimitives&&(s=`${n.regionPath}/${n.label}`);const o=e.indexOf(s);o>-1&&(r=!0,e.splice(o,1),t.push(n.id));const l=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);s&&s!=="__r"&&n.isPrimitives&&l.findObjectsWithGroupName(n.label).forEach(c=>c.setVisibility(r)),n.children&&n.children.forEach(u=>{this.setTreeVisibilityWithFullPaths(u,e,t,!0)})},checkAllKeys:function(){const n=[],e=[];ix(this.treeData[0],n),this.setTreeVisibilityWithFullPaths(this.treeData[0],n,e,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e)},getState:function(){let n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();return n.length===this.nodeNumbers?{checkAll:!0,version:"2.0"}:{checkedItems:BB(this.module.scene.getRootRegion(),n),version:"2.0"}},setState:function(n){if(n){if(n.checkAll)this.checkAllKeys();else if(n.checkedItems){let e=[];n.version!=="2.0"?(e=n.checkedItems.map(i=>"/"+i),e.shift("__r/")):e.push(...n.checkedItems);const t=[];this.setTreeVisibilityWithFullPaths(this.treeData[0],e,t,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t)}}}}},tF={class:"traditional-container"};function nF(n,e,t,i,r,s){const o=a.resolveComponent("TreeControls"),l=Fi,u=ht;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["tree-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",tF,[a.createVNode(o,{mapType:"scaffold",title:"Regions",isReady:t.isReady,treeData:s.treeDataEntry,active:n.active,hover:n.hover,showColourPicker:t.showColourPicker,onSetColour:s.setColour,onCheckChanged:s.checkChanged,onChangeActive:s.changeActiveByNode,onChangeHover:s.changeHoverByNode,ref:"treeControls"},null,8,["isReady","treeData","active","hover","showColourPicker","onSetColour","onCheckChanged","onChangeActive","onChangeHover"])]),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[0]||(e[0]=(...c)=>s.toggleDrawer&&s.toggleDrawer(...c))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1})],2)],2)}const mx=Pi(eF,[["render",nF],["__scopeId","data-v-706c7d54"]]),gx=jc.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),iF={name:"ScaffoldTooltip",components:{Col:Ln,CreateTooltipContent:Fa.CreateTooltipContent,ElIconDelete:Ja,Icon:ht,Popover:vl,Row:Zn,Tooltip:Fa.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},annotationFeature:{type:Object,default:{}},offlineAnnotationEnabled:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:[],ElIconDelete:a.shallowRef(Ja)}},computed:{...jc.mapState(gx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry=[{featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}]}}else this.display=!1,this.annotationEntry=[]},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},rF={class:"tooltip-text"},sF={key:0,class:"tooltip-text"},oF={key:1,class:"delete-container"};function aF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=Ln,c=bs,f=Zn,h=vl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",rF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",sF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry,onAnnotation:e[2]||(e[2]=p=>n.$emit("confirm-comment",p))},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",oF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>e[5]||(e[5]=[a.createTextVNode("Delete this feature?")])),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[3]||(e[3]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>e[6]||(e[6]=[a.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[4]||(e[4]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>e[7]||(e[7]=[a.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const yx=Pi(iF,[["render",aF],["__scopeId","data-v-79a4dbaf"]]),Na={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},lF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},cF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Na.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Na.ALL||s.targetEventType===l)){const f=new lF(l,u,c);r(f)}}},uF=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new cF(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},vx={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},vf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},vn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};vn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,vf.NAME_CHANGED)}},vn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,vf.SETTINGS_CHANGED)},vn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},vn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},vn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},vn.prototype.getName=function(){return this.instanceName},vn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,vf.DESTROYED);delete this},vn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},vn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},vn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const Uc=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=gr.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},dF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);if(!h)return!0}for(let f=0;f<c.length;f++){let h=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(h=!0);if(!h)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);h||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];r.resetHighlighted();const f=o(u,e),h=l(f);return Uc(h,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];r.resetHighlighted(),r.resetSelected();const f=l(u);return Uc(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.resetHighlighted=function(){const u=l(n);Uc(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);Uc(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},bf=kc.THREE,hF=function(){const n=document.createElement("div");let e;if(n.style.height="100%",vx.isWebGLAvailable())e=new kc.Renderer(n,window),kc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=vx.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:kc,renderer:e,container:n}},vt=function(){vn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new dF,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new bf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};vt.prototype=Object.create(vn.prototype),vt.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return i.object.name==="_Unnamed"?3:2}return 0});let t=e.indexOf(1);return t>-1||(t=e.indexOf(2),t=t>-1?t:e.indexOf(3)),n[t]}},vt.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.zincObject=i)}r&&e.push(r)}return e},vt.prototype.setHighlightedByObjects=function(n,e,t,i){const r=this.graphicsHighlight.setHighlighted(n),s=this.objectsToZincObjects(n);if(i){let o=Na.MOVE;r&&(o=Na.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},vt.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},vt.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new bf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},vt.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},vt.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=this.objectsToZincObjects(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Na.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},vt.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},vt.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},vt.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},vt.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},vt.prototype.changeBackgroundColour=function(n){const e=new bf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},vt.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},vt.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},vt.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},vt.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},vt.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},vt.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=hF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},vt.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),vn.prototype.destroy.call(this)};const fF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},pF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},bx=function(n){vt.call(this);const e=this;let t;this.sceneData=new pF;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(E){let O=6e3;e.scene&&(O=e.scene.getDuration());const A=E/100*O;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(A),e.sceneData.currentTime=E};const f=function(){let E=3e3;e.scene&&(E=e.scene.getDuration());const O=e.zincRenderer.getCurrentTime();for(let A=0;A<i.length;A++)i[A](O);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(O),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(O/E),e.sceneData.currentTime=O/E*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(E,O)=>{let A=this.scene.getZincCameraControls();E?(A.resetView(),this.NDCCameraControl=A.enableSyncControl(),A.setRotationMode(O)):(A.disableSyncControl(),this.NDCCameraControl=void 0,A.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=E=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(E,2)},this.setSyncControlCallback=E=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(E)},this.setSyncControlCenterZoom=(E,O)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(E,O)};const h=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const E=new gr.THREE.Vector3;E.copy(e.selectedCenter);const O=e.scene.vectorToScreenXY(E);e.selectedScreenCoordinates.x=O.x,e.selectedScreenCoordinates.y=O.y}},p=function(){return function(){f()}},y=function(){return function(){h()}};this.addTimeChangedCallback=function(E){i.push(E)},this.setTexturePos=function(E){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(E)},this.addSceneChangedCallback=function(E){r.push(E)},this.addOrganPartAddedCallback=function(E){s.push(E)},this.addOrganPartRemovedCallback=function(E){o.push(E)},this.setFinishDownloadCallback=function(E){l=E},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(E){u=E},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(E,O){const A=new gr.THREE.Vector3;A.setFromMatrixPosition(obj.matrixWorld);const L=width/2,R=height/2;return A.project(O),A.x=A.x*L+L,A.y=-(A.y*R)+R,A};const m=function(E){let O,A;if(E!==void 0){let L=!1;E.object.userData&&E.object.userData.isMarker?(L=!0,A=E.object.userData.parent.getMorph()):A=E.object;try{A.userData.userData.annotation.data.lastActionOnMarker=L}finally{}if(A)if(A.name)O=A.name;else{const R=e.getAnnotationsFromObjects([A]);R&&R[0]&&(O=R[0].data.group)}}return{id:O,object:A}},d=function(){return function(E,O,A){var I;const L=e.getIntersectedObject(E),R=m(L),N={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0],intersected:L,intersects:E},x={x:O,y:A};if(R.id){N.threeID=(I=R.object)==null?void 0:I.id,R.object.userData.isGlyph?R.object.name?e.setSelectedByObjects([R.object],x,N,!0):e.setSelectedByZincObjects(R.object.userData.getGlyphset(),x,N,!0):e.setSelectedByObjects([R.object],x,N,!0);return}else e.setSelectedByObjects([],x,N,!0)}},b=function(){return function(E,O,A){var I;const L=e.getIntersectedObject(E),R=m(L),N={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0]},x={x:O,y:A};if(R.id){N.threeID=(I=R.object)==null?void 0:I.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([R.object],x,N,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],x,N,!0)}},v=function(E,O,A,L){if(L=="all"||L=="geometries"){const R=E.findGeometriesWithGroupName(O);for(let N=0;N<R.length;N++)R[N].setVisibility(A)}if(L=="all"||L=="glyphsets"){const R=E.findGlyphsetsWithGroupName(O);for(let N=0;N<R.length;N++)R[N].setVisibility(A)}if(L=="all"||L=="pointsets"){const R=E.findPointsetsWithGroupName(O);for(let N=0;N<R.length;N++)R[N].setVisibility(A)}if(L=="all"||L=="lines"){const R=E.findLinesWithGroupName(O);for(let N=0;N<R.length;N++)R[N].setVisibility(A)}};this.changeGeometriesVisibility=function(E,O){v(e.scene,E,O,"geometries")},this.changeGlyphsetsVisibility=function(E,O){v(e.scene,E,O,"glyphsets")},this.changeLinesVisibility=function(E,O){v(e.scene,E,O,"lines")},this.changePointsetsVisibility=function(E,O){v(e.scene,E,O,"pointsets")},this.changeOrganPartsVisibility=function(E,O,A){let L="all";A!==void 0&&(L=A),v(e.scene,E,O,L)},this.changeOrganPartsVisibilityCallback=function(E){return function(O){e.changeOrganPartsVisibility(E,O)}},this.changeBackgroundColour=function(E){const O=new gr.THREE.Color(E);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(O,1)};const g=function(E,O,A,L){for(let x=0;x<s.length;x++)s[x](L,e.scene.isTimeVarying());const R=new fF,N=L.region.getFullPath();R.data={species:e.sceneData.currentSpecies,system:E,part:O,group:L.groupName,region:N,uuid:L.uuid,lastActionOnMarker:!1},L.userData.annotation=R},w=function(E,O,A,L){for(let R=0;R<o.length;R++)o[R](L)},S=function(E,O,A){return function(L){g(E,O,A,L)}},T=function(E,O,A){return function(L){w(E,O,A,L)}},M=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},C=function(){return function(E){if((E==null?void 0:E.type)==="Error"&&u){const O={xhr:E.xhr,type:"download-error"};u(O)}}};this.updateFieldvisibility=function(E,O){for(let A=0;A<E.length;A++)if(O!=A){const L=E[A].PartName;e.changeOrganPartsVisibility(L,!1)}if(O>-1){const A=E[O].PartName;if(e.scene.findGeometriesWithGroupName(A).length>0||e.scene.findGlyphsetsWithGroupName(A).length>0)e.changeOrganPartsVisibility(A,!0);else{const L=getOrganDetails(E[O].SystemName,A);L!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+L.meta)}}},this.getAvailableSpecies=function(E,O,A){const L=new Array;L.push("none");const R=Object.keys(organsFileMap);for(index in R){const N=R[index];N!=E&&organsFileMap[N].hasOwnProperty(O)&&organsFileMap[N][O].hasOwnProperty(A)&&L.push(N)}return L},this.getCentreAndSize=function(){const E=new gr.THREE.Vector3,O=this.scene.getBoundingBox();O.getCenter(E);const A=[E.x,E.y,E.z];O.getSize(E);const L=[E.x,E.y,E.z];return{centre:A,size:L}};const _=function(E,O,A,L){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=E,e.sceneData.currentSystem=O,e.sceneData.currentPart=A,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let R="";E&&(R=E+"/"),O&&(R=O+"/"),A&&(R=A),e.sceneData.currentName=R};this.loadOrgansFromURL=function(E,O,A,L,R,N){if(e.zincRenderer&&L&&e.sceneData.metaURL!==E){_(O,A,L);const x=e.sceneData.currentName;let I=e.zincRenderer.getSceneByName(x);I?N&&I.clearAll():I=e.zincRenderer.createScene(x),e.selectObjectOnPick=!0;for(let F=0;F<r.length;F++)r[F](e.sceneData);R&&R!=""?(e.sceneData.viewURL=R,I.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=E,I.addZincObjectAddedCallbacks(S(A,L,!1)),I.addZincObjectRemovedCallbacks(T(void 0,L,!1)),I.loadMetadataURL(E,C(),M()),e.scene=I,e.zincRenderer.setCurrentScene(I),e.graphicsHighlight.reset();const B=I.getZincCameraControls();B.enableRaycaster(I,d(),b()),B.setMouseButtonAction("AUXILIARY","ZOOM"),B.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(E,O,A){if(e.zincRenderer&&O&&e.sceneData.metaURL!==E){_(void 0,void 0,O);const L=e.sceneData.currentName;let R=e.zincRenderer.getSceneByName(L);R?A&&R.clearAll():R=e.zincRenderer.createScene(L);for(let x=0;x<r.length;x++)r[x](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=E,R.addZincObjectAddedCallbacks(S(void 0,O,!1)),R.addZincObjectRemovedCallbacks(T(void 0,O,!1)),R.loadGLTF(E,void 0,M()),e.scene=R,e.zincRenderer.setCurrentScene(R),e.graphicsHighlight.reset();const N=R.getZincCameraControls();N.enableRaycaster(R,d(),b()),N.setMouseButtonAction("AUXILIARY","ZOOM"),N.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(E){const O=e.graphicsHighlight.getSelected();O&&O[0]&&O[0].userData&&e.scene.alignObjectToCameraView(O[0].userData,E)},this.exportSettings=function(){const E={};return E.name=e.instanceName,e.sceneData.currentSystem&&(E.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(E.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(E.part=e.sceneData.currentPart),E.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(E.viewURL=e.sceneData.viewURL),E.dialog="Organ Viewer",E},this.importSettings=function(E){return E&&E.dialog==this.typeName?(e.setName(E.name),E.metaURL!==void 0&&E.metaURL!=""?e.loadOrgansFromURL(E.metaURL,E.species,E.system,E.part,E.viewURL,!0):e.loadOrgans(E.species,E.system,E.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(p()),e.zincRenderer.addPostRenderCallbackFunction(y()))}()};bx.prototype=Object.create(vt.prototype);var at=function(){return at=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},at.apply(this,arguments)};function mF(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function l(f){try{c(i.next(f))}catch(h){o(h)}}function u(f){try{c(i.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function gF(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Xe(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ct(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var yF="ENTRIES",xx="KEYS",wx="VALUES",Xt="",xf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Mo(this._path),t=e.node,i=e.keys;if(Mo(i)===Xt)return{done:!1,value:this.result()};var r=t.get(Mo(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Mo(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Mo(t)}).filter(function(e){return e!==Xt}).join("")},n.prototype.value=function(){return Mo(this._path).node.get(Xt)},n.prototype.result=function(){switch(this._type){case wx:return this.value();case xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Mo=function(n){return n[n.length-1]},vF=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Mx(n,e,t,i,o,1,r,""),i},Mx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var h=Xe(n.keys()),p=h.next();!p.done;p=h.next()){var y=p.value;if(y===Xt){var m=r[f-1];m<=t&&i.set(l,[n.get(y),m])}else{for(var d=s,b=0;b<y.length;++b,++d){for(var v=y[b],g=o*d,w=g-o,S=r[g],T=Math.max(0,d-t-1),M=Math.min(o-1,d+t),C=T;C<M;++C){var _=v!==e[C],P=r[w+C]+ +_,E=r[w+C+1]+1,O=r[g+C]+1,A=r[g+C+1]=Math.min(P,E,O);A<S&&(S=A)}if(S>t)continue e}Mx(n.get(y),e,t,i,r,d,o,l+y)}}}catch(L){u={error:L}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},wf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Ct(Gc(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Ct(_f(o),2),u=l[0],c=l[1];try{for(var f=Xe(u.keys()),h=f.next();!h.done;h=f.next()){var p=h.value;if(p!==Xt&&p.startsWith(c)){var y=new Map;return y.set(p.slice(c.length),u.get(p)),new n(y,e)}}}catch(m){t={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,bF(this._tree,e)},n.prototype.entries=function(){return new xf(this,yF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Xe(this),s=r.next();!s.done;s=r.next()){var o=Ct(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return vF(this._tree,e,t)},n.prototype.get=function(e){var t=Mf(this._tree,e);return t!==void 0?t.get(Xt):void 0},n.prototype.has=function(e){var t=Mf(this._tree,e);return t!==void 0&&t.has(Xt)},n.prototype.keys=function(){return new xf(this,xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Sf(this._tree,e);return i.set(Xt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Sf(this._tree,e);return i.set(Xt,t(i.get(Xt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Sf(this._tree,e),r=i.get(Xt);return r===void 0&&i.set(Xt,r=t()),r},n.prototype.values=function(){return new xf(this,wx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=Ct(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),Gc=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Xe(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Xt&&e.startsWith(l))return t.push([n,l]),Gc(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),Gc(void 0,"",t)},Mf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Xe(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Xt&&e.startsWith(o))return Mf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Sf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Xe(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Xt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var h=n.get(u);if(f===u.length)n=h;else{var p=new Map;p.set(u.slice(f),h),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var y=new Map;return n.set(e.slice(s),y),y}return n},bF=function(n,e){var t=Ct(Gc(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Xt),i.size===0)Sx(r);else if(i.size===1){var s=Ct(i.entries().next().value,2),o=s[0],l=s[1];_x(r,o,l)}}},Sx=function(n){if(n.length!==0){var e=Ct(_f(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Sx(n.slice(0,-1));else if(t.size===1){var r=Ct(t.entries().next().value,2),s=r[0],o=r[1];s!==Xt&&_x(n.slice(0,-1),s,o)}}},_x=function(n,e,t){if(n.length!==0){var i=Ct(_f(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},_f=function(n){return n[n.length-1]},Da,Tf="or",Tx="and",xF="and_not",wF=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?Lf:e.autoVacuum;this._options=at(at(at({},Af),e),{autoVacuum:t,searchOptions:at(at({},Ex),e.searchOptions||{}),autoSuggestOptions:at(at({},EF),e.autoSuggestOptions||{})}),this._index=new wf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Rf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,h=u.processTerm,p=u.fields,y=u.idField,m=c(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var d=this.addDocumentId(m);this.saveStoredFields(d,e);try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=c(e,g);if(w!=null){var S=f(w.toString(),g),T=this._fieldIds[g],M=new Set(S).size;this.addFieldLength(d,T,this._documentCount-1,M);try{for(var C=(r=void 0,Xe(S)),_=C.next();!_.done;_=C.next()){var P=_.value,E=h(P,g);if(Array.isArray(E))try{for(var O=(o=void 0,Xe(E)),A=O.next();!A.done;A=O.next()){var L=A.value;this.addTerm(T,d,L)}}catch(R){o={error:R}}finally{try{A&&!A.done&&(l=O.return)&&l.call(O)}finally{if(o)throw o.error}}else E&&this.addTerm(T,d,E)}}catch(R){r={error:R}}finally{try{_&&!_.done&&(s=C.return)&&s.call(C)}finally{if(r)throw r.error}}}}}catch(R){t={error:R}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,h,p){var y=f.chunk,m=f.promise;return y.push(h),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(d){return setTimeout(d,0)})}).then(function(){return i.addAll(y)})}:{chunk:y,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,h=u.extractField,p=u.fields,y=u.idField,m=h(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var d=this._idToShortId.get(m);if(d==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=h(e,g);if(w!=null){var S=c(w.toString(),g),T=this._fieldIds[g],M=new Set(S).size;this.removeFieldLength(d,T,this._documentCount,M);try{for(var C=(r=void 0,Xe(S)),_=C.next();!_.done;_=C.next()){var P=_.value,E=f(P,g);if(Array.isArray(E))try{for(var O=(o=void 0,Xe(E)),A=O.next();!A.done;A=O.next()){var L=A.value;this.removeTerm(T,d,L)}}catch(R){o={error:R}}finally{try{A&&!A.done&&(l=O.return)&&l.call(O)}finally{if(o)throw o.error}}else E&&this.removeTerm(T,d,E)}}catch(R){r={error:R}}finally{try{_&&!_.done&&(s=C.return)&&s.call(C)}finally{if(r)throw r.error}}}}}catch(R){t={error:R}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(m),this._fieldLength.delete(d),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new wf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Rf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return mF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,p,y,m,d,b,v,g,w,S,T,M,C,_,P,E,O;return gF(this,function(A){switch(A.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Cf.batchSize,s=e.batchWait||Cf.batchWait,o=1,A.label=1;case 1:A.trys.push([1,7,8,9]),l=Xe(this._index),u=l.next(),A.label=2;case 2:if(u.done)return[3,6];c=Ct(u.value,2),f=c[0],h=c[1];try{for(p=(_=void 0,Xe(h)),y=p.next();!y.done;y=p.next()){m=Ct(y.value,2),d=m[0],b=m[1];try{for(v=(E=void 0,Xe(b)),g=v.next();!g.done;g=v.next())w=Ct(g.value,1),S=w[0],!this._documentIds.has(S)&&(b.size<=1?h.delete(d):b.delete(S))}catch(L){E={error:L}}finally{try{g&&!g.done&&(O=v.return)&&O.call(v)}finally{if(E)throw E.error}}}}catch(L){_={error:L}}finally{try{y&&!y.done&&(P=p.return)&&P.call(p)}finally{if(_)throw _.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(L){return setTimeout(L,s)})];case 3:A.sent(),A.label=4;case 4:o+=1,A.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return T=A.sent(),M={error:T},[3,9];case 8:try{u&&!u.done&&(C=l.return)&&C.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,A.label=10;case 10:return[4,null];case 11:return A.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||Lf.minDirtCount,i=i||Lf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Xe(s),u=l.next();!u.done;u=l.next()){var c=Ct(u.value,2),f=c[0],h=c[1],p=h.score,y=h.terms,m=h.match,d=y.length||1,b={id:this._documentIds.get(f),score:p*d,terms:Object.keys(m),queryTerms:y,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(Cx),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=at(at({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Xe(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,p=f.terms,y=p.join(" "),m=l.get(y);m!=null?(m.score+=h,m.count+=1):l.set(y,{score:h,terms:p,count:1})}}catch(T){i={error:T}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Xe(l),v=b.next();!v.done;v=b.next()){var g=Ct(v.value,2),m=g[0],w=g[1],h=w.score,p=w.terms,S=w.count;d.push({suggestion:m,terms:p,score:h/S})}}catch(T){s={error:T}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(Cx),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Af.hasOwnProperty(e))return Ef(Af,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,p=e.documentIds,y=e.fieldIds,m=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=h,w._documentIds=Hc(p),w._idToShortId=new Map,w._fieldIds=y,w._fieldLength=Hc(m),w._avgFieldLength=d,w._storedFields=Hc(b),w._dirtCount=v||0,w._index=new wf;try{for(var S=Xe(w._documentIds),T=S.next();!T.done;T=S.next()){var M=Ct(T.value,2),C=M[0],_=M[1];w._idToShortId.set(_,C)}}catch(F){i={error:F}}finally{try{T&&!T.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}try{for(var P=Xe(c),E=P.next();!E.done;E=P.next()){var O=Ct(E.value,2),A=O[0],L=O[1],R=new Map;try{for(var N=(l=void 0,Xe(Object.keys(L))),x=N.next();!x.done;x=N.next()){var I=x.value,B=L[I];g===1&&(B=B.ds),R.set(parseInt(I,10),Hc(B))}}catch(F){l={error:F}}finally{try{x&&!x.done&&(u=N.return)&&u.call(N)}finally{if(l)throw l.error}}w._index.set(A,R)}}catch(F){s={error:F}}finally{try{E&&!E.done&&(o=P.return)&&o.call(P)}finally{if(s)throw s.error}}return w},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=at(at(at({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=at(at({tokenize:l,processTerm:u},c),t),h=f.tokenize,p=f.processTerm,y=h(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=y.map(TF(f)),d=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=at(at({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(I,B){var F;return at(at({},I),(F={},F[B]=Ef(l.boost,B)||1,F))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,p=l.bm25,y=at(at({},Ex.weights),f),m=y.fuzzy,d=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var S=e.fuzzy===!0?.2:e.fuzzy,T=S<1?Math.min(h,Math.round(e.term.length*S)):S;T&&(w=this._index.fuzzyGet(e.term,T))}if(g)try{for(var M=Xe(g),C=M.next();!C.done;C=M.next()){var _=Ct(C.value,2),P=_[0],E=_[1],O=P.length-e.term.length;if(O){w==null||w.delete(P);var A=d*P.length/(P.length+.3*O);this.termResults(e.term,P,A,E,u,c,p,v)}}}catch(I){i={error:I}}finally{try{C&&!C.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var L=Xe(w.keys()),R=L.next();!R.done;R=L.next()){var P=R.value,N=Ct(w.get(P),2),x=N[0],O=N[1];if(O){var A=m*P.length/(P.length+O);this.termResults(e.term,P,A,x,u,c,p,v)}}}catch(I){s={error:I}}finally{try{R&&!R.done&&(o=L.return)&&o.call(L)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=at(at({},this._options.searchOptions),e);try{for(var o=Xe(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Tf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(MF[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Xe(this._index),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],h={};try{for(var p=(i=void 0,Xe(f)),y=p.next();!y.done;y=p.next()){var m=Ct(y.value,2),d=m[0],b=m[1];h[d]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,h])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,p,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Xe(Object.keys(s)),d=m.next();!d.done;d=m.next()){var b=d.value,v=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var S=w.size,T=this._avgFieldLength[g];try{for(var M=(h=void 0,Xe(w.keys())),C=M.next();!C.done;C=M.next()){var _=C.value;if(!this._documentIds.has(_)){this.removeTerm(g,_,t),S-=1;continue}var P=o?o(this._documentIds.get(_),t,this._storedFields.get(_)):1;if(P){var E=w.get(_),O=this._fieldLength.get(_)[g],A=_F(E,S,this._documentCount,O,T,l),L=i*v*P*A,R=u.get(_);if(R){R.score+=L,AF(R.terms,e);var N=Ef(R.match,t);N?N.push(b):R.match[t]=[b]}else u.set(_,{score:L,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){h={error:x}}finally{try{C&&!C.done&&(p=M.return)&&p.call(M)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,Rx),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,Rx),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Xe(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Xe(o),f=c.next();!f.done;f=c.next()){var h=f.value,p=l(t,h);p!==void 0&&(u[h]=p)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Ef=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},MF=(Da={},Da[Tf]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,h=u.match;l.score=l.score+c,l.match=Object.assign(l.match,h),Ax(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Da[Tx]=function(n,e){var t,i,r=new Map;try{for(var s=Xe(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,h=c.terms,p=c.match;Ax(u.terms,h),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(y){t={error:y}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},Da[xF]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Da),SF={k:1.2,b:.7,d:.5},_F=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},TF=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Af={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(CF)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},Ex={combineWith:Tf,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:SF},EF={combineWith:Tx,prefix:function(n,e,t){return e===t.length-1}},Cf={batchSize:1e3,batchWait:10},Rf={minDirtFactor:.1,minDirtCount:20},Lf=at(at({},Cf),Rf),AF=function(n,e){n.includes(e)||n.push(e)},Ax=function(n,e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Cx=function(n,e){var t=n.score,i=e.score;return i-t},Rx=function(){return new Map},Hc=function(n){var e,t,i=new Map;try{for(var r=Xe(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},CF=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class RF{constructor(){this._searchEngine=new wF({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=FB(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const LF={name:"ScaffoldVuer",components:{Button:bs,Col:Ln,Loading:MR,Option:ws,Popover:vl,Row:Zn,Select:xs,Slider:Sn,TabPane:Mg,Tabs:wg,MapSvgIcon:Pf.MapSvgIcon,MapSvgSpriteColor:Pf.MapSvgSpriteColor,PrimitiveControls:px,ScaffoldTooltip:yx,ElIconWarningFilled:kp,ElIconArrowDown:pu,ElIconArrowLeft:Fi,DrawToolbar:Fa.DrawToolbar,ScaffoldTreeControls:mx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new Lx.AnnotationService(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},showLocalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,annotationFeature:{},offlineAnnotationEnabled:!1,offlineAnnotations:a.markRaw([]),authorisedUser:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],existDrawnFeatures:a.markRaw([]),activeDrawTool:void 0,activeDrawMode:void 0,boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new bx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new RF},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new uF;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...jc.mapState(gx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?n[1]:n[0]:n}},methods:{enableAxisDisplay:function(n,e){this.$module.scene&&this.$module.scene.enableAxisDisplay(n,e)},createAxisDisplay:function(n){this.$module.scene&&this.$module.scene.createAxisDisplay(n)},addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromOfflineAnnotation:function(n,e){for(let t=0;t<this.offlineAnnotations.length;t++){const i=this.offlineAnnotations[t];if(i.region===n&&i.group===e){this.offlineAnnotations.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.groupName;n.region.findObjectsWithGroupName(e,!1).length===0&&this.$_searchIndex.removeZincObject(n,n.uuid)}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=ox(this.annotator,this.userToken,t,n,e,this.url,i);if(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==r.item.id)),this.existDrawnFeatures.push(r.feature),this.offlineAnnotationEnabled){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(r),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmComment:function(n){if(this._editingZincObject){let e=n;this._editingZincObject.isEditable&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(t=>t.id!==e.item.id)),this.existDrawnFeatures.push(n.feature)),this.offlineAnnotationEnabled&&(e.group=this._editingZincObject.groupName,e.region=this._editingZincObject.region.getFullPath(),this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(e),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations)))}},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName,i=ox(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted");i&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==i.item.id)),this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject),this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations=this.offlineAnnotations.filter(s=>s.item.id!==i.item.id),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))))}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(DB(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){this.createData.toBeDeleted=!1,n==="mode"?(this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0):n==="tool"&&(this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1)},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=wo(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.authorisedUser||this.offlineAnnotationEnabled)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=PB(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=OB(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)if(this.viewingMode==="Annotation"){this.tData.label=i,this.tData.region=r;const s=IB(n);if(this._editingZincObject=s,s){const o=this._editingZincObject.region.getFullPath()+"/",l=this._editingZincObject.groupName;this.annotationFeature=sx(this._editingZincObject,o,l,this.url,"").feature}this.activateAnnotationMode(e,n)}else this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers);else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=wo(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=rx(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s=[{featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}];this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete,confirmComment:this.confirmComment});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},clearAnnotationFeature:function(){const n=this.getOfflineAnnotations();this.existDrawnFeatures.map(t=>decodeURIComponent(t.id).split("/").pop()).forEach(t=>{const i=this.$module.scene.findObjectsWithGroupName(t,!1);if(i&&i.length){const r=i[0].region.getFullPath()+"/";this.$module.scene.getRootRegion().findChildFromPath(r).removeZincObject(i[0])}}),this.$refs.scaffoldTreeControls.removeRegion("__annotation"),this.offlineAnnotations=n},addAnnotationFeature:async function(){let n;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],n=this.offlineAnnotations.filter(e=>e.resource===this.url&&e.feature.properties.drawn).map(e=>e.feature);else{n=[];const e=await ax(this.annotator,this.userToken,this.url);e&&e.features&&(n=[...e.features]);const t=await ax(this.annotator,this.userToken,encodeURIComponent(this.url));t&&t.features&&(n=[...n,...t.features])}this.existDrawnFeatures=a.markRaw(n),lx(this.$module.scene,n)},changeViewingMode:function(n){this.$module&&(n&&(this.viewingMode=n),this.clearAnnotationFeature(),this.viewingMode==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&e.canUpdate?(this.authorisedUser=e,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.addAnnotationFeature(),this.loading=!1})):this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape=""),this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate())},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();wo(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=rx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.offlineAnnotations&&sessionStorage.setItem("anonymous-annotation",n.offlineAnnotations),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.offlineAnnotations.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),this.offlineAnnotationEnabled&&(n.offlineAnnotations=sessionStorage.getItem("anonymous-annotation")),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:n.viewingMode,search:n.search,offlineAnnotations:n.offlineAnnotations}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search,offlineAnnotations:n.offlineAnnotations}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getOfflineAnnotations:function(){return[...this.offlineAnnotations]},importOfflineAnnotations:function(n){if(this.offlineAnnotationEnabled){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);lx(this.$module.scene,e),n.forEach(t=>{this.offlineAnnotations.push({...t})}),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility,offlineAnnotations:e==null?void 0:e.offlineAnnotations})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},PF={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},IF={class:"primitive-controls-box"},OF={class:"animation-data"},NF={class:"purple"},DF={class:"animation-data"},BF={class:"purple"},FF={class:"animation-data"},VF={class:"bottom-right-control"},kF={style:{"margin-bottom":"2px"}},zF={key:0,class:"viewing-mode-title"},UF=["onClick"],GF=["onClick"];function HF(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=yx,u=a.resolveComponent("DrawToolbar"),c=kp,f=ht,h=vl,p=mx,y=px,m=a.resolveComponent("map-svg-icon"),d=Sn,b=Zn,v=Mg,g=ws,w=xs,S=wg,T=bs,M=Qu;return a.withDirectives((a.openBlock(),a.createElementBlock("div",PF,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,annotationFeature:n.annotationFeature,offlineAnnotationEnabled:n.offlineAnnotationEnabled,onConfirmCreate:e[0]||(e[0]=C=>s.confirmCreate(C)),onCancelCreate:e[1]||(e[1]=C=>s.cancelCreate()),onConfirmComment:e[2]||(e[2]=C=>s.confirmComment(C)),onConfirmDelete:e[3]||(e[3]=C=>s.confirmDelete()),onTooltipHide:e[4]||(e[4]=C=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay","annotationFeature","offlineAnnotationEnabled"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[5]||(e[5]=a.withKeys((...C)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(...C),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.authorisedUser||n.offlineAnnotationEnabled)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[6]||(e[6]=C=>s.showHelpText(7)),onMouseout:e[7]||(e[7]=C=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[27]||(e[27]=a.createElementVNode("span",{class:"message-text"},"Beta",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[8]||(e[8]=C=>s.showHelpText(8)),onMouseout:e[9]||(e[9]=C=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[28]||(e[28]=a.createElementVNode("span",{class:"message-text"},"What's new?",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",IF,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(S,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[10]||(e[10]=C=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[11]||(e[11]=C=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[12]||(e[12]=C=>s.timeChange(C))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",OF,[e[29]||(e[29]=a.createTextVNode(" Original duration: ")),a.createElementVNode("div",NF,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",DF,[e[30]||(e[30]=a.createTextVNode(" Animation duration: ")),a.createElementVNode("div",BF,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",FF,[e[31]||(e[31]=a.createTextVNode(" Playback speed ")),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[13]||(e[13]=C=>s.speedChanged(C))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,C=>(a.openBlock(),a.createBlock(g,{key:C.value,label:C.label,value:C.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",VF,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[14]||(e[14]=C=>s.zoomIn()),onMouseover:e[15]||(e[15]=C=>s.showHelpText(0)),onMouseout:e[16]||(e[16]=C=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[17]||(e[17]=C=>s.zoomOut()),onMouseover:e[18]||(e[18]=C=>s.showHelpText(1)),onMouseout:e[19]||(e[19]=C=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[20]||(e[20]=C=>s.fitWindow()),onMouseover:e[21]||(e[21]=C=>s.showHelpText(2)),onMouseout:e[22]||(e[22]=C=>s.hideHelpText(2))})]),default:a.withCtx(()=>[e[32]||(e[32]=a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1))]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,C=>(a.openBlock(),a.createBlock(b,{key:C.key},{default:a.withCtx(()=>[a.createVNode(T,{type:"primary",plain:"",onClick:_=>n.$emit("open-map",C.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(C.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[33]||(e[33]=[a.createTextVNode("Viewing Mode")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",kF,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(C,_,P)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:_},[_===n.viewingMode?(a.openBlock(),a.createElementBlock("span",zF,[a.createElementVNode("b",null,a.toDisplayString(_),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:E=>s.changeViewingMode(_)},a.toDisplayString(_),9,UF))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1}),n.viewingMode==="Annotation"&&n.offlineAnnotationEnabled?(a.openBlock(),a.createBlock(b,{key:0,class:"viewing-mode-description"},{default:a.withCtx(()=>e[34]||(e[34]=[a.createTextVNode(" (Anonymous annotate) ")])),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[35]||(e[35]=[a.createTextVNode(" Change background ")])),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,C=>(a.openBlock(),a.createElementBlock("div",{key:C,class:a.normalizeClass(["backgroundChoice",C,C==n.currentBackground?"active":""]),onClick:_=>s.backgroundChangeCallback(C)},null,10,GF))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[t.showOpenMapButton?(a.openBlock(),a.createBlock(b,{key:0},{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[23]||(e[23]=C=>s.showHelpText(3)),onMouseout:e[24]||(e[24]=C=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0),t.showLocalSettings?(a.openBlock(),a.createBlock(b,{key:1},{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[25]||(e[25]=C=>s.showHelpText(4)),onMouseout:e[26]||(e[26]=C=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0)],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[M,n.loading]])}const WF=Pi(LF,[["render",HF],["__scopeId","data-v-37201f15"]]);Nt.ScaffoldVuer=WF,Object.defineProperty(Nt,Symbol.toStringTag,{value:"Module"})});
3453
+ }`};class f extends c.ShaderMaterial{constructor(p){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(m){this.uniforms.diffuse.value=m}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(m){this.uniforms.linewidth.value=m}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(y){!!y!="USE_DASH"in this.defines&&(this.needsUpdate=!0),y===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(m){this.uniforms.dashScale.value=m}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(m){this.uniforms.dashSize.value=m}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(m){this.uniforms.dashOffset.value=m}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(m){this.uniforms.gapSize.value=m}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(m){this.uniforms.opacity.value=m}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(m){this.uniforms.resolution.value.copy(m)}},alphaToCoverage:{enumerable:!0,get:function(){return"ALPHA_TO_COVERAGE"in this.defines},set:function(m){!!m!="ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),m===!0?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(p)}}f.prototype.isLineMaterial=!0},(o,l,u)=>{var c=u(4);l.Minimap=function(f){var h=f;this.camera=new c.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var p=new c.BufferGeometry,y=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),m=new c.BufferAttribute(y,3);p.setAttribute("position",m);var d=new c.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new c.Mesh(p,d);var b=new c.Box3,v=new c.Vector3;this.getDiffFromNormalised=(w,S)=>{b.setFromBufferAttribute(m).getCenter(v);var T=v.clone().project(this.camera),M=new c.Vector3(w,S,T.z).unproject(this.camera);return M.sub(v)};var g=(w,S)=>{h.camera.near&&(this.camera.near=h.camera.near),S.farPlane&&(this.camera.far=S.farPlane),S.eyePosition&&this.camera.position.set(S.eyePosition[0],S.eyePosition[1],S.eyePosition[2]),S.upVector&&this.camera.up.set(S.upVector[0],S.upVector[1],S.upVector[2]),S.targetPosition&&this.camera.lookAt(new c.Vector3(S.targetPosition[0],S.targetPosition[1],S.targetPosition[2])),this.camera.zoom=1/w,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var w=new c.Vector3().copy(h.camera.target).project(h.camera),S=new c.Vector3(-1,-1,w.z).unproject(h.camera),T=new c.Vector3(1,-1,w.z).unproject(h.camera),M=new c.Vector3(1,1,w.z).unproject(h.camera),C=new c.Vector3(-1,1,w.z).unproject(h.camera);m.copyVector3sArray([S,T,M,M,C,S]),m.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var w=h.getZincCameraControls(),S=h.getBoundingBox();if(S){var T=S.min.distanceTo(S.max),M=T/2,C=(S.min.x+S.max.x)/2,_=(S.min.y+S.max.y)/2,P=(S.min.z+S.max.z)/2,E=w.getViewportFromCentreAndRadius(C,_,P,M,40,M*4);g(T,E)}}}},(o,l,u)=>{var c=u(4),f=u(51)(c),h=u(3).Geometry,p=u(52),y=u(53).default,m=c.BufferGeometryLoader,d=function(b){var v;b&&b.isGeometry&&(v=b);var g=void 0,w=void 0,S=!1,T=void 0,M=O=>{var A=v.getMorph().material.clone();A.morphTargets=!1;var L=new h,R=new m,N=R.parse(O),x=new c.Mesh(N.geometry,A);return L.geometry=x.geometry,x.userData=L,L.setMorph(x),L},C=O=>{switch(O.data.action){case"message":console.log(O.data.message);break;case"result":var A=new d(M(O.data.object));T&&T(A),T=void 0,S=!1;break;default:throw"Cannot handle specified action."}},_=O=>{if(p!==void 0&&(w=p(54)),!w)g=new(u(55)).GeometryCSGInternal(O);else if(O&&O.isGeometry){var A=O.getMorph(),L=A.geometry.clone().applyMatrix(A.matrix).toJSON();w.addEventListener("message",function(R){C(R)}),w.postMessage({action:"initialise",object:L})}};this.getHostGeometry=()=>{var O=new f(v.getMorph());return new P(O)},this.getGeometry=()=>v;var P=O=>{var A=v.getMorph().material.clone();A.morphTargets=!1;var L=O.toMesh(A),R=new h;return R.geometry=L.geometry,L.userData=R,R.setMorph(L),R};this.setCSG=O=>{g.setCSG(O)};var E=(O,A,L,R)=>{if(S)R("On progress");else{var N=O.getMorph(),x=N.geometry.clone().applyMatrix(N.matrix).toJSON();T=L,S=!0,w.postMessage({action:A,object:x})}};this.intersect=O=>new y((A,L)=>{if(w)E(O,"intersect",A,L);else{var R=g.intersect(O),N=new d(P(R));N.setCSG(R),A(N)}}),this.subtract=O=>new y((A,L)=>{if(w)E(O,"intersect",A,L);else{var R=g.subtract(O),N=new d(P(R));N.setCSG(R),A(N)}}),this.union=O=>new y((A,L)=>{if(w)E(O,"intersect",A,L);else{var R=g.union(O),N=new d(P(R));N.setCSG(R),A(N)}}),this.terminateWorker=()=>{w&&w.terminate()},_(b)};l.GeometryCSG=d},o=>{var l=1e-5,u=0,c=1,f=2,h=3;o.exports=function(p){var y=function(m){var d,b,v,g,w,S,T,M=[];if(m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m instanceof p.Geometry)this.matrix=new p.Matrix4;else if(m.isMesh)m.updateMatrix(),this.matrix=m.matrix.clone(),m=m.geometry,m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m.mergeVertices(),m.computeVertexNormals(!1);else{if(m instanceof y.Node)return this.tree=m,this.matrix=new p.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(d=0,b=m.faces.length;d<b;d++)v=m.faces[d],w=m.faceVertexUvs[0][d],T=new y.Polygon,v instanceof p.Face3?(g=m.vertices[v.a],S=w?new p.Vector2(w[0].x,w[0].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[0],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.b],S=w?new p.Vector2(w[1].x,w[1].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[2],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.c],S=w?new p.Vector2(w[2].x,w[2].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[2],S),g.applyMatrix4(this.matrix),T.vertices.push(g)):(p.Face4,g=m.vertices[v.a],S=w?new p.Vector2(w[0].x,w[0].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[0],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.b],S=w?new p.Vector2(w[1].x,w[1].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[1],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.c],S=w?new p.Vector2(w[2].x,w[2].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[2],S),g.applyMatrix4(this.matrix),T.vertices.push(g),g=m.vertices[v.d],S=w?new p.Vector2(w[3].x,w[3].y):null,g=new y.Vertex(g.x,g.y,g.z,v.vertexNormals[3],S),g.applyMatrix4(this.matrix),T.vertices.push(g)),T.calculateProperties(),M.push(T);this.tree=new y.Node(M)};return y.prototype.subtract=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.invert(),d.clipTo(b),b.clipTo(d),b.invert(),b.clipTo(d),b.invert(),d.build(b.allPolygons()),d.invert(),d=new y(d),d.matrix=this.matrix,d},y.prototype.union=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.clipTo(b),b.clipTo(d),b.invert(),b.clipTo(d),b.invert(),d.build(b.allPolygons()),d=new y(d),d.matrix=this.matrix,d},y.prototype.intersect=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.invert(),b.clipTo(d),b.invert(),d.clipTo(b),b.clipTo(d),d.build(b.allPolygons()),d.invert(),d=new y(d),d.matrix=this.matrix,d},y.prototype.toGeometry=function(){var m,d,b,v,g,w,S,T,M,C,_=new p.Matrix4().getInverse(this.matrix),P=new p.Geometry,E=this.tree.allPolygons(),O=E.length,A={};for(m=0;m<O;m++)for(b=E[m],v=b.vertices.length,d=2;d<v;d++)C=[],T=b.vertices[0],C.push(new p.Vector2(T.uv.x,T.uv.y)),T=new p.Vector3(T.x,T.y,T.z),T.applyMatrix4(_),typeof A[T.x+","+T.y+","+T.z]>"u"?(P.vertices.push(T),g=A[T.x+","+T.y+","+T.z]=P.vertices.length-1):g=A[T.x+","+T.y+","+T.z],T=b.vertices[d-1],C.push(new p.Vector2(T.uv.x,T.uv.y)),T=new p.Vector3(T.x,T.y,T.z),T.applyMatrix4(_),typeof A[T.x+","+T.y+","+T.z]>"u"?(P.vertices.push(T),w=A[T.x+","+T.y+","+T.z]=P.vertices.length-1):w=A[T.x+","+T.y+","+T.z],T=b.vertices[d],C.push(new p.Vector2(T.uv.x,T.uv.y)),T=new p.Vector3(T.x,T.y,T.z),T.applyMatrix4(_),typeof A[T.x+","+T.y+","+T.z]>"u"?(P.vertices.push(T),S=A[T.x+","+T.y+","+T.z]=P.vertices.length-1):S=A[T.x+","+T.y+","+T.z],M=new p.Face3(g,w,S,new p.Vector3(b.normal.x,b.normal.y,b.normal.z)),P.faces.push(M),P.faceVertexUvs[0].push(C);return P},y.prototype.toBufferGeometry=function(){var m=this.toGeometry(),d=new p.BufferGeometry().fromGeometry(m);return d},y.prototype.toMesh=function(m){var d=this.toBufferGeometry(),b=new p.Mesh(d,m);return b.position.setFromMatrixPosition(this.matrix),b.rotation.setFromRotationMatrix(this.matrix),b},y.Polygon=function(m){m instanceof Array||(m=[]),this.vertices=m,0<m.length?this.calculateProperties():this.normal=this.w=void 0},y.Polygon.prototype.calculateProperties=function(){var m=this.vertices[0],d=this.vertices[1],b=this.vertices[2];return this.normal=d.clone().subtract(m).cross(b.clone().subtract(m)).normalize(),this.w=this.normal.clone().dot(m),this},y.Polygon.prototype.clone=function(){var m,d,b=new y.Polygon;for(m=0,d=this.vertices.length;m<d;m++)b.vertices.push(this.vertices[m].clone());return b.calculateProperties(),b},y.Polygon.prototype.flip=function(){var m,d=[];for(this.normal.multiplyScalar(-1),this.w*=-1,m=this.vertices.length-1;0<=m;m--)d.push(this.vertices[m]);return this.vertices=d,this},y.Polygon.prototype.classifyVertex=function(m){var d=this.normal.dot(m)-this.w;return d<-l?f:d>l?c:u},y.Polygon.prototype.classifySide=function(m){var d,b,v,g=0,w=0,S=m.vertices.length;for(d=0;d<S;d++)b=m.vertices[d],v=this.classifyVertex(b),v===c?g++:v===f&&w++;return 0<g&&w===0?c:g===0&&0<w?f:g===0&&w===0?u:h},y.Polygon.prototype.splitPolygon=function(m,d,b,v,g){var w=this.classifySide(m);if(w===u)(0<this.normal.dot(m.normal)?d:b).push(m);else if(w===c)v.push(m);else if(w===f)g.push(m);else{var S,T,M,C,_,P,E,O,A,L=[],R=[];for(T=0,S=m.vertices.length;T<S;T++)M=(T+1)%S,P=m.vertices[T],E=m.vertices[M],C=this.classifyVertex(P),_=this.classifyVertex(E),C!=f&&L.push(P),C!=c&&R.push(P),(C|_)==h&&(O=(this.w-this.normal.dot(P))/this.normal.dot(E.clone().subtract(P)),A=P.interpolate(E,O),L.push(A),R.push(A));3<=L.length&&v.push(new y.Polygon(L).calculateProperties()),3<=R.length&&g.push(new y.Polygon(R).calculateProperties())}},y.Vertex=function(m,d,b,v,g){this.x=m,this.y=d,this.z=b,this.normal=v||new p.Vector3,this.uv=g||new p.Vector2},y.Vertex.prototype.clone=function(){return new y.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},y.Vertex.prototype.add=function(m){return this.x+=m.x,this.y+=m.y,this.z+=m.z,this},y.Vertex.prototype.subtract=function(m){return this.x-=m.x,this.y-=m.y,this.z-=m.z,this},y.Vertex.prototype.multiplyScalar=function(m){return this.x*=m,this.y*=m,this.z*=m,this},y.Vertex.prototype.cross=function(m){var d=this.x,b=this.y,v=this.z;return this.x=b*m.z-v*m.y,this.y=v*m.x-d*m.z,this.z=d*m.y-b*m.x,this},y.Vertex.prototype.normalize=function(){var m=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=m,this.y/=m,this.z/=m,this},y.Vertex.prototype.dot=function(m){return this.x*m.x+this.y*m.y+this.z*m.z},y.Vertex.prototype.lerp=function(m,d){return this.add(m.clone().subtract(this).multiplyScalar(d)),this.normal.add(m.normal.clone().sub(this.normal).multiplyScalar(d)),this.uv.add(m.uv.clone().sub(this.uv).multiplyScalar(d)),this},y.Vertex.prototype.interpolate=function(m,d){return this.clone().lerp(m,d)},y.Vertex.prototype.applyMatrix4=function(m){var d=this.x,b=this.y,v=this.z,g=m.elements;return this.x=g[0]*d+g[4]*b+g[8]*v+g[12],this.y=g[1]*d+g[5]*b+g[9]*v+g[13],this.z=g[2]*d+g[6]*b+g[10]*v+g[14],this},y.Node=function(m){var d,b,v=[],g=[];if(this.polygons=[],this.front=this.back=void 0,m instanceof Array&&m.length!==0){for(this.divider=m[0].clone(),d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],this.polygons,this.polygons,v,g);0<v.length&&(this.front=new y.Node(v)),0<g.length&&(this.back=new y.Node(g))}},y.Node.isConvex=function(m){var d,b;for(d=0;d<m.length;d++)for(b=0;b<m.length;b++)if(d!==b&&m[d].classifySide(m[b])!==f)return!1;return!0},y.Node.prototype.build=function(m){var d,b,v=[],g=[];for(this.divider||(this.divider=m[0].clone()),d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],this.polygons,this.polygons,v,g);0<v.length&&(!this.front&&(this.front=new y.Node),this.front.build(v)),0<g.length&&(!this.back&&(this.back=new y.Node),this.back.build(g))},y.Node.prototype.allPolygons=function(){var m=this.polygons.slice();return this.front&&(m=m.concat(this.front.allPolygons())),this.back&&(m=m.concat(this.back.allPolygons())),m},y.Node.prototype.clone=function(){var m=new y.Node;return m.divider=this.divider.clone(),m.polygons=this.polygons.map(function(d){return d.clone()}),m.front=this.front&&this.front.clone(),m.back=this.back&&this.back.clone(),m},y.Node.prototype.invert=function(){var m,d,b;for(m=0,d=this.polygons.length;m<d;m++)this.polygons[m].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),b=this.front,this.front=this.back,this.back=b,this},y.Node.prototype.clipPolygons=function(m){var d,b,v,g;if(!this.divider)return m.slice();for(v=[],g=[],d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],v,g,v,g);return this.front&&(v=this.front.clipPolygons(v)),g=this.back?this.back.clipPolygons(g):[],v.concat(g)},y.Node.prototype.clipTo=function(m){this.polygons=m.clipPolygons(this.polygons),this.front&&this.front.clipTo(m),this.back&&this.back.clipTo(m)},y}},o=>{o.exports=MB()},o=>{o.exports=LB},(o,l,u)=>{var c=u(3).Geometry,f=u(4),h=f.BufferGeometryLoader;o.exports=function(p){var y=void 0,m=function(S){var T=new h,M=T.parse(S),C=new f.MeshPhongMaterial,_=new f.Mesh(M.geometry,C),P=new c;return P.setMorph(_),P},d=function(S){var T=m(S);y=new(u(55)).GeometryCSGInternal(T),p.postMessage({action:"message",message:"Initialised"})},b=function(S){if(y){var T=m(S),M=y.intersect(T),C=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:C})}},v=function(S){if(y){var T=m(S),M=y.subtract(T),C=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:C})}},g=function(S){if(y){var T=m(S),M=y.union(T),C=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:C})}};p.addEventListener("message",function(w){switch(w.data.action){case"initialise":d(w.data.object);break;case"intersect":b(w.data.object);break;case"subtract":v(w.data.object);break;case"union":g(w.data.object);break;default:throw"Cannot handle specified action."}})}},(o,l,u)=>{var c=u(4),f=u(51)(c);u(3).Geometry,u(50).GeometryCSG;var h=function(p){var y;p&&p.isGeometry&&(y=p);var m;this.setGeometry=b=>{b&&b.isGeometry&&(y=b),m=void 0},this.setCSG=b=>{m=b};var d=b=>{if(y&&y.morph&&b&&b.morph){m===void 0&&(m=new f(y.morph));var v=new f(b.morph);return v}};this.intersect=b=>{var v=d(b);return m&&v?m.intersect(v):void 0},this.subtract=b=>{var v=d(b);return m&&v?m.subtract(v):void 0},this.union=b=>{var v=d(b);return m&&v?m.union(v):void 0}};l.GeometryCSGInternal=h},(o,l,u)=>{var c=u(4),f=u(51)(c);u(18).Glyphset;var h=function(p){var y;p&&p.isGlyphset&&(y=p);var m=[];this.setGlyphset=v=>{v&&v.isGlyphset&&(y=v),hostCSG=void 0},this.getGlyphset=()=>y;var d=()=>v=>{var g=v.getMesh(),w=v.getLabel();if(g){var S=new f(g.geometry.clone().applyMatrix(g.matrix)),T=[];T.csg=S,T.label=w,g.material&&(T.material=g.material.clone()),m.push(T)}},b=v=>{if(y&&v&&v.getMorph()){m.length==0&&y.forEachGlyph(d());var g=new f(v.getMorph());return g}};this.intersect=v=>{var g=b(v);if(0<m.length&&g){for(var w=new(u(18)).Glyphset,S=0;S<m.length;S++){var T=m[S],M=T.csg.intersect(g),C=M.toMesh();if(C&&C.geometry&&0<C.geometry.vertices.length){T.material&&(C.material=T.material,C.material.side=c.DoubleSide,C.material.clippingPlanes=null);var _=w.addMeshAsGlyph(C,S+1);_.setLabel(T.label)}}var P=new h(w);return P}}};l.GlyphsetCSG=h}],i={};function r(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return t[o].call(u.exports,u,u.exports,r),u.exports}r.n=o=>{var l=o&&o.__esModule?()=>o.default:()=>o;return r.d(l,{a:l}),l},r.d=(o,l)=>{for(var u in l)r.o(l,u)&&!r.o(o,u)&&Object.defineProperty(o,u,{enumerable:!0,get:l[u]})},r.o=(o,l)=>Object.prototype.hasOwnProperty.call(o,l),r.r=o=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var s=r(0);return s})())})(Tg);var gr=Tg.exports;const kc=oC(gr),nx=(n,e)=>{if(n){let t="";n.forEach(i=>{t=i.uuid,i.region&&(t=i.region.uuid+"/"+t),i&&i.getVisibility()&&e.push(t)})}return e},mf=(n,e)=>{const t=n[0]-e[0],i=n[1]-e[1],r=n[2]-e[2];return Math.sqrt(t*t+i*i+r*r)},PB=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable&&t.isLines2){const i=n.identifiers[0].extraData.intersected;if(i&&i.faceIndex>-1){const r=t.getVerticesByFaceIndex(i.faceIndex),s=n.identifiers[0].extraData.intersected.pointOnLine;if(r.length>1){const o=mf(r[0],[s.x,s.y,s.z]),l=mf(r[1],[s.x,s.y,s.z]);return o>l?{zincObject:t,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2+1,point:r[0]}:{zincObject:t,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2,point:r[1]}}}}}},IB=n=>{const e=n.zincObjects;if(e.length>0&&e[0])return e[0]},OB=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable)return t}},NB=(n,e,t)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isPointset)){let i=!1;for(let r=0;r<3&&!i;r++)t[r]!==0&&(i=!0);if(i&&e>-1){const r=n.getVerticesByIndex(e);return r&&(r[0]=r[0]+t[0],r[1]=r[1]+t[1],r[2]=r[2]+t[2]),n.editVertices([r],e),n.boundingBoxUpdateRequired=!0,!0}}return!1},zc=(n,e)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isLines2)&&e>-1){const t=n.getVerticesByFaceIndex(e);if(t&&t.length>1)return mf(t[1],t[0])}return 0},gf=(n,e,t,i)=>{if(n&&t!==0&&n.isEditable&&n.isLines2&&e>-1){const r=n.getVerticesByFaceIndex(e);let s=[r[1][0]-r[0][0],r[1][1]-r[0][1],r[1][2]-r[0][2]];const o=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);for(let l=0;l<3;l++)s[l]=s[l]/o*t,i?r[1][l]=r[0][l]+s[l]:(r[0][l]=r[0][l]+s[l],r[1][l]=r[1][l]+s[l]);return n.editVertices(r,e*2),n.boundingBoxUpdateRequired=!0,!0}return!1},DB=(n,e)=>{const t=e.getBoundingBox(),i=new gr.THREE.Vector3().subVectors(t.max,t.min),r=new gr.THREE.BoxGeometry(i.x,i.y,i.z);i.addVectors(t.min,t.max).multiplyScalar(.5);const s=r.getAttribute("position"),o=s.count,l=[];for(let u=0;u<o;u++)l[u]=[s.array[u*3],s.array[u*3+1],s.array[u*3+2]];n.editVertices(l,0),n.setPosition(i.x,i.y,i.z),r.dispose()},ix=(n,e)=>{let t="";n.isRegion&&(t=`__r${n.regionPath}`),n.isPrimitives&&(t=`${n.regionPath}/${n.label}`),e.push(t),n.children&&n.children.forEach(i=>ix(i,e))},wo=(n,e,t,i)=>{let r=n;const s=[];if(t&&(r=n.findChildFromPath(t)),r){const o=Array.isArray(e);let l=e;o||(l=[l]),l.forEach(u=>{const c=r.findObjectsWithGroupName(u,i);s.push(...c)})}return s},yf=(n,e,t)=>{const i=n.findIndex(s=>s.uuid===e);let r;return i>-1&&(r=n[i],t&&n.splice(i,1)),r},BB=(n,e)=>{const t=[];if(n&&e&&e.length>0){const i={},r={},s=[n,...n.getChildRegions(!0)];let o,l,u;e.forEach(c=>{const f=c.split("/");u=f[0],o=yf(s,u,!1),o&&(r[u]||(r[u]=o.getFullPath()),f[1]?(i[u]||(i[u]=o.getAllObjects(!1)),l=yf(i[u],f[1],!0),l&&t.push(`${r[u]}/${l.groupName}`)):t.push(`__r/${r[u]}`))})}return t},FB=n=>{if(n){const e=[];return n.forEach(i=>{i.isZincObject?e.push(i):i.isRegion&&e.push(...i.getAllObjects(!0))}),Object.values(e.reduce((i,r)=>({...i,[r.uuid]:r}),{}))}return[]},rx=(n,e)=>{const t={label:"Multiple selections",regionPath:"",objects:[]};if(e&&n){const i={},r=n.getRootRegion();e.length>0&&(t.regionPath=e[0].data.region,t.label=e[0].data.group),e.forEach(s=>{s.data.region.includes(t.regionPath)||(t.regionPath=""),t.label!==s.data.group&&(t.label="Multiple selections");const o=r.findChildFromPath(s.data.region);i[o.uuid]||(i[o.uuid]=o.getAllObjects(!1));const l=yf(i[o.uuid],s.data.uuid);l&&t.objects.push(l)})}return t},VB=n=>{const e=n.getMorph();let t="position";n.isLines2&&(t="instanceStart");const i=[];let r=0;const s=e.geometry.getAttribute(t);for(let o=0;o<n.drawRange;o++)i.push([s.array[r++],s.array[r++],s.array[r++]]);return i},sx=(n,e,t,i,r)=>{let s;n.isPointset?s="MultiPoint":n.isLines2?s="MultiLineString":s="Feature";const o=s!=="Feature",l=s==="Feature"?"Feature annotation":"Drawn annotation";if(s){const u=VB(n);let c=e.slice(-1)==="/"?e:e+"/";c=c+t;const f=c,h={resource:i,item:{id:f},body:{evidence:[],comment:r},feature:{id:f,properties:{drawn:o,label:l},geometry:{coordinates:u,type:s}}};return r==="Deleted"&&(h.feature=void 0),h}},ox=(n,e,t,i,r,s,o)=>{const l=sx(t,i,r,s,o);if(l)return n&&n.currentUser&&(l.creator={...n.currentUser},l.creator.orcid||(l.creator.orcid="0000-0000-0000-0000"),n.addAnnotation(e,l).then(u=>{u.annotationId||console.log("There is a problem with the submission, please try again later")}).catch(()=>{console.log("There is a problem with the submission, please try again later")})),l},ax=async(n,e,t)=>{const i=t;return await n.drawnFeatures(e,i)},lx=(n,e)=>{n&&e.forEach(t=>{const i=t.geometry,r=decodeURIComponent(t.id),s=r.lastIndexOf("/"),o=r.substring(0,s),l=r.substring(s+1);let u;i.type==="MultiPoint"?u=n.createPoints(o,l,i.coordinates,l,8942):i.type==="MultiLineString"&&(u=n.createLines(o,l,i.coordinates,60962)),u&&(u.zincObject.isEditable=!0)})},Pi=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},kB={name:"LinesControls",components:{Button:bs,Col:Ln,Container:Xn,InputNumber:mi,Main:pi,Slider:Sn,ElIconArrowLeft:Fi,ElIconArrowRight:Vi},props:{createData:{type:Object}},data:function(){return{adjust:0,pAdjust:0,lengthScale:0,distance:0,newDistance:0,width:1,currentIndex:0,ElIconArrowLeft:a.shallowRef(Fi),ElIconArrowRight:a.shallowRef(Vi),edited:!1,zincObject:void 0}},watch:{"createData.faceIndex":{handler:function(n){var e;(e=this.zincObject)!=null&&e.isLines2&&(this.currentIndex=n,this.distance=zc(this.zincObject,this.currentIndex))},immediate:!0}},methods:{changeIndex:function(n){n?zc(this.zincObject,this.currentIndex+1)>0&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onLengthInput:function(){this.newDistance!==0?(this.distance=this.newDistance,this.edited=gf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited):this.newDistance=this.distance},onLengthSliding:function(){this.newDistance=Math.pow(10,this.lengthScale)*this.distance,this.edited=gf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited},onMoveSliding:function(){const n=(this.adjust-this.pAdjust)*this.distance;this.edited=gf(this.zincObject,this.currentIndex,n,!1)||this.edited,this.pAdjust=this.adjust},reset:function(){this.adjust=0,this.pAdjust=0,this.lengthScale=0,this.distance=zc(this.zincObject,this.currentIndex),this.newDistance=this.distance,this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){this.currentIndex=-1,this.distance=0,n.isLines2?(this.zincObject=a.markRaw(n),this.width=this.zincObject.getMorph().material.linewidth,n.isEditable&&(this.currentIndex=0,this.distance=zc(n,this.currentIndex))):(this.zincObject=void 0,this.width=10)},modifyWidth:function(){this.zincObject.setWidth(this.width)}}};function zB(n,e,t,i,r,s){const o=Ln,l=Sn,u=mi,c=Zn,f=bs,h=pi,p=Xn;return a.openBlock(),a.createBlock(p,{class:"lines-container"},{default:a.withCtx(()=>[a.createVNode(h,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[11]||(e[11]=[a.createTextVNode(" Width: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.width,"onUpdate:modelValue":e[0]||(e[0]=y=>n.width=y),class:"my-slider",step:1,min:1,max:100,"show-tooltip":!1,onInput:s.modifyWidth},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.width,"onUpdate:modelValue":e[1]||(e[1]=y=>n.width=y),step:1,min:1,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1}),n.currentIndex>-1&&n.distance>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[2]||(e[2]=y=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Line "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",icon:n.ElIconArrowRight,onClick:e[3]||(e[3]=y=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[12]||(e[12]=[a.createTextVNode(" Move: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.adjust,"onUpdate:modelValue":e[4]||(e[4]=y=>n.adjust=y),step:.01,min:-3,max:3,"show-tooltip":!1,onInput:e[5]||(e[5]=y=>s.onMoveSliding()),onChange:e[6]||(e[6]=y=>s.reset())},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[13]||(e[13]=[a.createTextVNode(" Length: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.lengthScale,"onUpdate:modelValue":e[7]||(e[7]=y=>n.lengthScale=y),step:.01,min:-1,max:1,"show-tooltip":!1,onInput:e[8]||(e[8]=y=>s.onLengthSliding()),onChange:e[9]||(e[9]=y=>s.reset())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.newDistance,"onUpdate:modelValue":e[10]||(e[10]=y=>n.newDistance=y),controls:!1,class:"input-box number-input",onChange:s.onLengthInput},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const cx=Pi(kB,[["render",zB],["__scopeId","data-v-6581aa67"]]),UB={name:"PointsControls",components:{Col:Ln,Container:Xn,InputNumber:mi,Main:pi,Select:xs,Slider:Sn,Row:Zn,Option:ws,ElIconArrowLeft:Fi,ElIconArrowRight:Vi},inject:["boundingDims"],data:function(){return{attenuation:!1,size:10,choices:[{value:!0,label:"On"},{value:!1,label:"off"}],min:[0,0,0],max:[1,1,1],translation:[0,0,0],pTranslation:[0,0,0],currentIndex:-1,ElIconArrowLeft:a.shallowRef(Fi),ElIconArrowRight:a.shallowRef(Vi),edited:!1,zincObject:void 0}},watch:{boundingDims:{handler:function(n){const e=n.size;this.min=[-e[0]/2,-e[1]/2,-e[2]/2],this.max=[e[0]/2,e[1]/2,e[2]/2]},immediate:!0,deep:!0}},methods:{changeIndex:function(n){n?this.zincObject.drawRange>this.currentIndex+1&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onMoveSliding:function(){const n=[this.translation[0]-this.pTranslation[0],this.translation[1]-this.pTranslation[1],this.translation[2]-this.pTranslation[2]];this.edited=NB(this.zincObject,this.currentIndex,n)||this.edited;for(let e=0;e<3;e++)this.pTranslation[e]=this.translation[e]},reset:function(){this.translation=[0,0,0],this.pTranslation=[0,0,0],this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){this.currentIndex=-1,n.isPointset?(this.zincObject=a.markRaw(n),this.size=this.zincObject.morph.material.size,this.attenuation=this.zincObject.morph.material.sizeAttenuation,n.isEditable&&this.zincObject.drawRange>0&&(this.currentIndex=0)):(this.zincObject=void 0,this.size=10,this.attenuation=!1)},modifyAttenuation:function(n){this.attenuation=n,this.zincObject.setSizeAttenuation(n)},modifySize:function(){this.zincObject.setSize(this.size)}}};function GB(n,e,t,i,r,s){const o=Ln,l=Sn,u=mi,c=Zn,f=ws,h=xs,p=bs,y=pi,m=Xn;return a.openBlock(),a.createBlock(m,{class:"pointset-container"},{default:a.withCtx(()=>[a.createVNode(y,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[15]||(e[15]=[a.createTextVNode(" Size: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.size,"onUpdate:modelValue":e[0]||(e[0]=d=>n.size=d),class:"my-slider",step:1,min:0,max:100,"show-tooltip":!1,onInput:e[1]||(e[1]=d=>s.modifySize())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.size,"onUpdate:modelValue":e[2]||(e[2]=d=>n.size=d),step:1,min:0,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" Size attenuation: ")])),_:1}),a.createVNode(o,{offset:0,span:5},{default:a.withCtx(()=>[a.createVNode(h,{teleported:!1,"model-value":n.attenuation,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:e[3]||(e[3]=d=>s.modifyAttenuation(d,n.slide))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.choices,d=>(a.openBlock(),a.createBlock(f,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])]),_:1})]),_:1}),n.currentIndex>-1?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(p,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[4]||(e[4]=d=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Point "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(p,{size:"small",icon:n.ElIconArrowRight,onClick:e[5]||(e[5]=d=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" x: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[0],"onUpdate:modelValue":e[6]||(e[6]=d=>n.translation[0]=d),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[7]||(e[7]=d=>s.onMoveSliding()),onChange:e[8]||(e[8]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" y: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[1],"onUpdate:modelValue":e[9]||(e[9]=d=>n.translation[1]=d),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[10]||(e[10]=d=>s.onMoveSliding()),onChange:e[11]||(e[11]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" z: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[2],"onUpdate:modelValue":e[12]||(e[12]=d=>n.translation[2]=d),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[13]||(e[13]=d=>s.onMoveSliding()),onChange:e[14]||(e[14]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const ux=Pi(UB,[["render",GB],["__scopeId","data-v-d1de9c65"]]),HB={name:"TextureSlidesControls",components:{Col:Ln,Container:Xn,Footer:ug,Icon:ht,InputNumber:mi,Main:pi,Row:Zn,Select:xs,Slider:Sn,Option:ws,ElIconDelete:Ja,ElIconPlus:Ka},data:function(){return{settings:[],directions:[{value:"x",label:"x"},{value:"y",label:"y"},{value:"z",label:"z"}],zincObject:void 0}},methods:{setObject:function(n){n.isTextureSlides?(this.zincObject=a.markRaw(n),this.settings=this.zincObject.getTextureSettings()):(this.zincObject=void 0,this.settings=[])},addNewSlide:function(){const n={direction:"x",value:0},e=this.zincObject.createSlide(n);this.settings.push(e)},modifyDirection:function(n,e){e&&(e.direction=n,this.zincObject.modifySlideSettings(e))},modifySlide:function(n){n&&this.zincObject.modifySlideSettings(n)},removeSlide:function(n,e){this.zincObject.removeSlideWithId(e.id),this.settings.splice(n,1)}}};function WB(n,e,t,i,r,s){const o=ws,l=xs,u=Ln,c=Sn,f=mi,h=Ja,p=ht,y=Zn,m=pi,d=Ka,b=ug,v=Xn;return a.openBlock(),a.createBlock(v,{class:"t-slides-container"},{default:a.withCtx(()=>[a.createVNode(m,{class:"slides-block"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.settings,(g,w)=>(a.openBlock(),a.createBlock(y,{key:g.id,class:"slide-row"},{default:a.withCtx(()=>[a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(l,{teleported:!1,"model-value":g.direction,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:S=>s.modifyDirection(S,g)},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.directions,S=>(a.openBlock(),a.createBlock(o,{key:S.value,label:S.label,value:S.value},null,8,["label","value"]))),128))]),_:2},1032,["model-value","onChange"])]),_:2},1024),a.createVNode(u,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(c,{modelValue:g.value,"onUpdate:modelValue":S=>g.value=S,class:"my-slider",step:.01,min:0,max:1,"show-tooltip":!1,onInput:S=>s.modifySlide(g)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:2},1024),a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(f,{modelValue:g.value,"onUpdate:modelValue":S=>g.value=S,step:.01,min:0,max:1,controls:!1,class:"input-box number-input"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a.createVNode(u,{offset:0,span:2},{default:a.withCtx(()=>[a.createVNode(p,{class:"delete-icon",onClick:S=>s.removeSlide(w,g)},{default:a.withCtx(()=>[a.createVNode(h)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1}),a.createVNode(b,{height:"30px",class:"add-slides-text",onClick:s.addNewSlide},{default:a.withCtx(()=>[a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(u,{span:2},{default:a.withCtx(()=>[a.createVNode(p,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})]),_:1}),a.createVNode(u,{span:20},{default:a.withCtx(()=>e[0]||(e[0]=[a.createTextVNode(" Add a new slide ")])),_:1})]),_:1})]),_:1},8,["onClick"])]),_:1})}const dx=Pi(HB,[["render",WB],["__scopeId","data-v-12185b7f"]]),jB={name:"TransformationControls",components:{Col:Ln,Container:Xn,InputNumber:mi,Main:pi,Slider:Sn},inject:["boundingDims"],data:function(){return{x:0,y:0,z:0,scale:1,min:[0,0,0],max:[1,1,1],zincObject:void 0,enableScaling:!0}},watch:{boundingDims:{handler:function(n){const e=n.centre,t=n.size;this.min=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],this.max=[e[0]+t[0],e[1]+t[1],e[2]+t[2]]},immediate:!0,deep:!0}},methods:{setObject:function(n){if(n.isZincObject){this.zincObject=a.markRaw(n);const e=this.zincObject.getGroup();e&&e.position&&(this.x=e.position.x,this.y=e.position.y,this.z=e.position.z,this.zincObject.isGlyphset?this.scale=this.zincObject.globalScale:this.scale=e.scale.x,this.enableScaling=!this.zincObject.isTextureSlides)}else this.zincObject=void 0,this.x=0,this.y=0,this.z=0,this.scale=1},modifyPosition:function(){this.zincObject.setPosition(this.x,this.y,this.z)},modifyScale:function(){this.zincObject.setScaleAll(this.scale)}}};function $B(n,e,t,i,r,s){const o=Ln,l=Sn,u=mi,c=Zn,f=pi,h=Xn;return a.openBlock(),a.createBlock(h,{class:"transformation-container"},{default:a.withCtx(()=>[a.createVNode(f,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" x: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.x,"onUpdate:modelValue":e[0]||(e[0]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[1]||(e[1]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.x,"onUpdate:modelValue":e[2]||(e[2]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],controls:!1,class:"input-box number-input",onChange:e[3]||(e[3]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" y: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.y,"onUpdate:modelValue":e[4]||(e[4]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[5]||(e[5]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.y,"onUpdate:modelValue":e[6]||(e[6]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],controls:!1,class:"input-box number-input",onChange:e[7]||(e[7]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" z: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.z,"onUpdate:modelValue":e[8]||(e[8]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[9]||(e[9]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.z,"onUpdate:modelValue":e[10]||(e[10]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],controls:!1,class:"input-box number-input",onChange:e[11]||(e[11]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),n.enableScaling?(a.openBlock(),a.createBlock(c,{key:0,class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" Scale: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.scale,"onUpdate:modelValue":e[12]||(e[12]=p=>n.scale=p),step:.01,min:0,max:5,"show-tooltip":!1,onInput:e[13]||(e[13]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.scale,"onUpdate:modelValue":e[14]||(e[14]=p=>n.scale=p),step:.01,min:0,max:5,controls:!1,class:"input-box number-input",onChange:e[15]||(e[15]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1})]),_:1})}const hx=Pi(jB,[["render",$B],["__scopeId","data-v-69c1b94a"]]),ZB={name:"OpacityControls",components:{Container:Xn,Header:JC,Main:pi,Slider:Sn},props:{material:void 0,zincObject:void 0},data:function(){return{displayString:"100%"}},watch:{"material.opacity":function(){this.material&&this.zincObject&&this.zincObject.setAlpha(this.material.opacity)}},methods:{formatTooltip(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString}}},XB={class:"block"},YB={class:"display"};function JB(n,e,t,i,r,s){const o=Sn,l=Xn;return t.material?(a.openBlock(),a.createBlock(l,{key:0,class:"opacity-container"},{default:a.withCtx(()=>[a.createElementVNode("div",XB,[a.createElementVNode("span",YB,a.toDisplayString(n.displayString),1),a.createVNode(o,{modelValue:t.material.opacity,"onUpdate:modelValue":e[0]||(e[0]=u=>t.material.opacity=u),class:"my-slider",step:.01,min:0,max:1,"format-tooltip":s.formatTooltip,"show-tooltip":!1},null,8,["modelValue","format-tooltip"])])]),_:1})):a.createCommentVNode("",!0)}const fx=Pi(ZB,[["render",JB],["__scopeId","data-v-cbfc46a5"]]),KB={name:"PrimitiveControls",components:{Collapse:rg,CollapseItem:sg,LinesControls:cx,OpacityControls:fx,PointsControls:ux,TextureSlidesControls:dx,TransformationControls:hx,ElIconArrowRight:Vi},props:{createData:{type:Object}},data:function(){return{activeName:"oControls",material:void 0,isTextureSlides:!1,isPointset:!1,isLines:!1,drawerOpen:!0,zincObject:void 0,isEditable:!1,displayString:"100%"}},methods:{formatTooltip:function(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setObject:function(n){var e;n?this.zincObject=a.markRaw(n):this.zincObject=void 0,this.isEditable=!!((e=this.zincObject)!=null&&e.isEditable),this.isPointset=!1,this.isTextureSlides=!1,this.isLines=!1,this.activeName="trControls",n&&(n.isTextureSlides?(this.isTextureSlides=!0,this.$refs.tSlidesControls.setObject(n),this.activeName="tsControls"):n.isPointset?(this.isPointset=!0,this.$refs.pointsetControls.setObject(n),this.activeName="pControls"):n.isLines2&&(this.isLines=!0,this.$refs.linesControls.setObject(n),this.activeName="lControls"),this.$refs.transformationControls.setObject(n)),n&&n.getMorph()?this.material=n.getMorph().material:this.material=void 0}}};function qB(n,e,t,i,r,s){const o=fx,l=sg,u=hx,c=dx,f=ux,h=cx,p=rg,y=Vi,m=ht;return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["primitive-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",{class:a.normalizeClass(["my-drawer",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(p,{class:"collapse",modelValue:n.activeName,"onUpdate:modelValue":e[2]||(e[2]=d=>n.activeName=d),accordion:""},{default:a.withCtx(()=>[a.withDirectives(a.createVNode(l,{title:"Opacity",name:"oControls"},{default:a.withCtx(()=>[a.createVNode(o,{material:n.material,zincObject:n.zincObject,ref:"opacityControls"},null,8,["material","zincObject"])]),_:1},512),[[a.vShow,!n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Transformation",name:"trControls"},{default:a.withCtx(()=>[a.createVNode(u,{class:"transformation-controls",ref:"transformationControls"},null,512)]),_:1},512),[[a.vShow,!n.isEditable]]),a.withDirectives(a.createVNode(l,{title:"Texture Slides",name:"tsControls"},{default:a.withCtx(()=>[a.createVNode(c,{class:"texture-controls",ref:"tSlidesControls"},null,512)]),_:1},512),[[a.vShow,n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Points",name:"pControls"},{default:a.withCtx(()=>[a.createVNode(f,{class:"pointset-controls",ref:"pointsetControls",onPrimitivesUpdated:e[0]||(e[0]=d=>n.$emit("primitivesUpdated",d))},null,512)]),_:1},512),[[a.vShow,n.isPointset]]),a.withDirectives(a.createVNode(l,{title:"Lines",name:"lControls"},{default:a.withCtx(()=>[a.createVNode(h,{class:"lines-controls",ref:"linesControls",createData:t.createData,onPrimitivesUpdated:e[1]||(e[1]=d=>n.$emit("primitivesUpdated",d))},null,8,["createData"])]),_:1},512),[[a.vShow,n.isLines]])]),_:1},8,["modelValue"])],2),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[3]||(e[3]=(...d)=>s.toggleDrawer&&s.toggleDrawer(...d))},[a.createVNode(m,null,{default:a.withCtx(()=>[a.createVNode(y)]),_:1})],2)],2)),[[a.vShow,n.material||n.isTextureSlides]])}const px=Pi(KB,[["render",qB],["__scopeId","data-v-d55fc9a4"]]),QB=(n,e)=>{const t=n.label.toUpperCase(),i=e.label.toUpperCase();return t<i?-1:t>i?1:0},eF={name:"ScaffoldTreeControls",components:{ElIconArrowLeft:Fi,TreeControls:Fa.TreeControls},props:{showColourPicker:Boolean,isReady:Boolean},data:function(){return{treeData:[{label:"Root",regionPath:"",id:void 0,children:[]}],active:[],hover:[],drawerOpen:!0,nodeNumbers:0,module:void 0}},computed:{treeDataEntry:function(){return this.treeData[0].children}},watch:{treeDataEntry:{deep:!0,handler:function(n){this.isReady&&this.setColourField(n)}}},methods:{addTreeItem:function(n,e,t){n.some(i=>i.label===e.label)||(Object.assign(e,{activeColour:this.getColour(e)}),n.push(e),n.sort((i,r)=>QB(i,r)),this.nodeNumbers++,this.$nextTick(()=>{!this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id)&&t.getVisibility()&&this.$refs.treeControls.$refs.regionTree.setChecked(e.id,!0)}))},findOrCreateRegion:function(n,e,t){if(this.module&&this.module.scene&&(this.treeData[0].id=this.module.scene.getRootRegion().uuid,this.treeData[0].isRegion=!0),e.length>0){const i=[...e];let r=n.children.find(l=>l.label==i[0]);const s=t+"/"+e[0],o=this.module.scene.getRootRegion().findChildFromPath(s);return r||(r={label:i[0],id:o.uuid,children:[],regionPath:s,isRegion:!0},this.addTreeItem(n.children,r,o),s==="/_helper"&&this.$nextTick(()=>{this.$refs.treeControls.$refs.regionTree.setChecked(r.id,!1)})),i.shift(),this.findOrCreateRegion(r,i,s)}else return n},removeRegion:function(n){if(this.treeData[0].children){for(let e=0;e<this.treeData[0].children.length;e++)if(this.treeData[0].children[e].label===n){this.treeData[0].children.splice(e,1),this.nodeNumbers--;return}}},zincObjectAdded:function(n){const e=n.region;if(e){const t=e.getFullSeparatedPath(),i=this.findOrCreateRegion(this.treeData[0],t,"");if(n.groupName&&i){i.children||(i.children=[]);const r={label:n.groupName,id:e.uuid+"/"+n.uuid,isPrimitives:!0,regionPath:n.region.getFullPath(),isTextureSlides:!!n.isTextureSlides};this.addTreeItem(i.children,r,n)}}},zincObjectRemoved:function(n){const e=n.groupName;if(n.region.findObjectsWithGroupName(e,!1).length===0){const i=n.region.getFullSeparatedPath(),r=this.findOrCreateRegion(this.treeData[0],i,"");if(r.children){for(let s=0;s<r.children.length;s++)if(r.children[s].label===e){r.children.splice(s,1),this.nodeNumbers--;return}}}},checkChanged:function(n,e){const t=n.isRegion,i=n.isPrimitives,r=e.checkedKeys.includes(n.id),s=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);t&&(r?s.showAllPrimitives():s.hideAllPrimitives()),i&&s.findObjectsWithGroupName(n.label).forEach(l=>{l.setVisibility(r)})},updateActiveUI:function(n){this.active.length=0,nx(n,this.active)},changeActiveByPrimitives:function(n,e){n&&n.length>0?(this.updateActiveUI(n),this.$emit("object-selected",n,e)):this.removeActive(e),this.removeHover(e)},updateHoverUI:function(n){this.hover.length=0,nx(n,this.hover)},changeHoverByPrimitives:function(n,e){n&&n.length>0?(this.updateHoverUI(n),this.$emit("object-hovered",n,e)):this.removeHover(e)},changeActiveByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=wo(i,n,e,!0);this.changeActiveByPrimitives(r,t)},changeHoverByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=wo(i,n,e,!0);this.changeHoverByPrimitives(r,t)},changeActiveByNode:function(n,e){if(n.isPrimitives||n.isRegion){const t=!!n.isRegion,i=this.getZincObjectsFromNode(n,t);this.changeActiveByPrimitives(i,e)}},changeHoverByNode:function(n,e){if(n.isPrimitives){const t=this.getZincObjectsFromNode(n,!1);this.changeHoverByPrimitives(t,e)}},removeActive:function(n){this.active=[],this.$emit("object-selected",[],n)},removeHover:function(n){this.hover=[],this.$emit("object-hovered",[],n)},clear:function(){this.active.length=0,this.hover.length=0,this.nodeNumbers=0,this.$refs.treeControls.$refs.regionTree.updateKeyChildren(this.treeData[0].id,[]),this.treeData[0].children.length=0,this.treeData[0].id=void 0,this.$emit("object-selected",[])},getColour:function(n){if(n){let t=this.getZincObjectsFromNode(n,!1)[0];if(t){let i=t.getColourHex();if(i)return"#"+i}}return"#FFFFFF"},getZincObjectsFromNode:function(n,e){const t=this.module.scene.getRootRegion();if(n.isPrimitives)return wo(t,n.label,n.regionPath,e);if(n.isRegion&&n.regionPath){let i=t.findChildFromPath(n.regionPath);if(i)return i.getAllObjects(e)}return[]},setModule:function(n){this.module=a.markRaw(n),this.nodeNumbers=0,this.module.scene.getRootRegion().getAllObjects(!0).forEach(t=>{this.zincObjectAdded(t)}),this.module.addOrganPartAddedCallback(this.zincObjectAdded),this.module.addOrganPartRemovedCallback(this.zincObjectRemoved)},setColourField:function(n,e=void 0){n.filter(t=>e&&!t.children?t.id===e.id:!0).map(t=>{if(t.children)this.setColourField(t.children,e);else{const i=this.getColour(t);t.defaultColour||(t.defaultColour=i),t.activeColour=i}})},setColour:function(n,e){n&&n.isPrimitives&&this.getZincObjectsFromNode(n,!1).forEach(i=>{let s=(e||n.defaultColour).replace("#","0x");i.setColourHex(s),this.setColourField(this.treeData[0].children,n)})},visibilityToggle:function(n,e){this.module.changeOrganPartsVisibility(n,e),e==!1&&(this.activeRegion===n&&this.removeActive(!0),this.hoverRegion===n&&this.removeHover(!0))},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen,this.$emit("drawer-toggled",this.drawerOpen)},setTreeVisibilityWithFullPaths:function(n,e,t,i){let r=!1,s="";n.isRegion&&(s=`__r${n.regionPath}`),n.isPrimitives&&(s=`${n.regionPath}/${n.label}`);const o=e.indexOf(s);o>-1&&(r=!0,e.splice(o,1),t.push(n.id));const l=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);s&&s!=="__r"&&n.isPrimitives&&l.findObjectsWithGroupName(n.label).forEach(c=>c.setVisibility(r)),n.children&&n.children.forEach(u=>{this.setTreeVisibilityWithFullPaths(u,e,t,!0)})},checkAllKeys:function(){const n=[],e=[];ix(this.treeData[0],n),this.setTreeVisibilityWithFullPaths(this.treeData[0],n,e,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e)},getState:function(){let n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();return n.length===this.nodeNumbers?{checkAll:!0,version:"2.0"}:{checkedItems:BB(this.module.scene.getRootRegion(),n),version:"2.0"}},setState:function(n){if(n){if(n.checkAll)this.checkAllKeys();else if(n.checkedItems){let e=[];n.version!=="2.0"?(e=n.checkedItems.map(i=>"/"+i),e.shift("__r/")):e.push(...n.checkedItems);const t=[];this.setTreeVisibilityWithFullPaths(this.treeData[0],e,t,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t)}}}}},tF={class:"traditional-container"};function nF(n,e,t,i,r,s){const o=a.resolveComponent("TreeControls"),l=Fi,u=ht;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["tree-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",tF,[a.createVNode(o,{mapType:"scaffold",title:"Regions",isReady:t.isReady,treeData:s.treeDataEntry,active:n.active,hover:n.hover,showColourPicker:t.showColourPicker,onSetColour:s.setColour,onCheckChanged:s.checkChanged,onChangeActive:s.changeActiveByNode,onChangeHover:s.changeHoverByNode,ref:"treeControls"},null,8,["isReady","treeData","active","hover","showColourPicker","onSetColour","onCheckChanged","onChangeActive","onChangeHover"])]),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[0]||(e[0]=(...c)=>s.toggleDrawer&&s.toggleDrawer(...c))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1})],2)],2)}const mx=Pi(eF,[["render",nF],["__scopeId","data-v-706c7d54"]]),gx=jc.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),iF={name:"ScaffoldTooltip",components:{Col:Ln,CreateTooltipContent:Fa.CreateTooltipContent,ElIconDelete:Ja,Icon:ht,Popover:vl,Row:Zn,Tooltip:Fa.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},annotationFeature:{type:Object,default:{}},offlineAnnotationEnabled:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:[],ElIconDelete:a.shallowRef(Ja)}},computed:{...jc.mapState(gx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry=[{featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}]}}else this.display=!1,this.annotationEntry=[]},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},rF={class:"tooltip-text"},sF={key:0,class:"tooltip-text"},oF={key:1,class:"delete-container"};function aF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=Ln,c=bs,f=Zn,h=vl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",rF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",sF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry,onAnnotation:e[2]||(e[2]=p=>n.$emit("confirm-comment",p))},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",oF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>e[5]||(e[5]=[a.createTextVNode("Delete this feature?")])),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[3]||(e[3]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>e[6]||(e[6]=[a.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[4]||(e[4]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>e[7]||(e[7]=[a.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const yx=Pi(iF,[["render",aF],["__scopeId","data-v-79a4dbaf"]]),Na={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},lF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},cF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Na.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Na.ALL||s.targetEventType===l)){const f=new lF(l,u,c);r(f)}}},uF=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new cF(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},vx={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},vf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},vn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};vn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,vf.NAME_CHANGED)}},vn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,vf.SETTINGS_CHANGED)},vn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},vn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},vn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},vn.prototype.getName=function(){return this.instanceName},vn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,vf.DESTROYED);delete this},vn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},vn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},vn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const Uc=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=gr.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},dF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);if(!h)return!0}for(let f=0;f<c.length;f++){let h=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(h=!0);if(!h)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);h||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];r.resetHighlighted();const f=o(u,e),h=l(f);return Uc(h,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];r.resetHighlighted(),r.resetSelected();const f=l(u);return Uc(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.resetHighlighted=function(){const u=l(n);Uc(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);Uc(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},bf=kc.THREE,hF=function(){const n=document.createElement("div");let e;if(n.style.height="100%",vx.isWebGLAvailable())e=new kc.Renderer(n,window),kc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=vx.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:kc,renderer:e,container:n}},vt=function(){vn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new dF,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new bf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};vt.prototype=Object.create(vn.prototype),vt.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return i.object.name==="_Unnamed"?3:2}return 0});let t=e.indexOf(1);return t>-1||(t=e.indexOf(2),t=t>-1?t:e.indexOf(3)),n[t]}},vt.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.zincObject=i)}r&&e.push(r)}return e},vt.prototype.setHighlightedByObjects=function(n,e,t,i){const r=this.graphicsHighlight.setHighlighted(n),s=this.objectsToZincObjects(n);if(i){let o=Na.MOVE;r&&(o=Na.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},vt.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},vt.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new bf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},vt.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},vt.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=this.objectsToZincObjects(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Na.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},vt.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},vt.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},vt.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},vt.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},vt.prototype.changeBackgroundColour=function(n){const e=new bf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},vt.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},vt.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},vt.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},vt.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},vt.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},vt.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=hF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},vt.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),vn.prototype.destroy.call(this)};const fF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},pF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},bx=function(n){vt.call(this);const e=this;let t;this.sceneData=new pF;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(E){let O=6e3;e.scene&&(O=e.scene.getDuration());const A=E/100*O;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(A),e.sceneData.currentTime=E};const f=function(){let E=3e3;e.scene&&(E=e.scene.getDuration());const O=e.zincRenderer.getCurrentTime();for(let A=0;A<i.length;A++)i[A](O);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(O),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(O/E),e.sceneData.currentTime=O/E*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(E,O)=>{let A=this.scene.getZincCameraControls();E?(A.resetView(),this.NDCCameraControl=A.enableSyncControl(),A.setRotationMode(O)):(A.disableSyncControl(),this.NDCCameraControl=void 0,A.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=E=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(E,2)},this.setSyncControlCallback=E=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(E)},this.setSyncControlCenterZoom=(E,O)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(E,O)};const h=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const E=new gr.THREE.Vector3;E.copy(e.selectedCenter);const O=e.scene.vectorToScreenXY(E);e.selectedScreenCoordinates.x=O.x,e.selectedScreenCoordinates.y=O.y}},p=function(){return function(){f()}},y=function(){return function(){h()}};this.addTimeChangedCallback=function(E){i.push(E)},this.setTexturePos=function(E){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(E)},this.addSceneChangedCallback=function(E){r.push(E)},this.addOrganPartAddedCallback=function(E){s.push(E)},this.addOrganPartRemovedCallback=function(E){o.push(E)},this.setFinishDownloadCallback=function(E){l=E},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(E){u=E},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(E,O){const A=new gr.THREE.Vector3;A.setFromMatrixPosition(obj.matrixWorld);const L=width/2,R=height/2;return A.project(O),A.x=A.x*L+L,A.y=-(A.y*R)+R,A};const m=function(E){let O,A;if(E!==void 0){let L=!1;E.object.userData&&E.object.userData.isMarker?(L=!0,A=E.object.userData.parent.getMorph()):A=E.object;try{A.userData.userData.annotation.data.lastActionOnMarker=L}finally{}if(A)if(A.name)O=A.name;else{const R=e.getAnnotationsFromObjects([A]);R&&R[0]&&(O=R[0].data.group)}}return{id:O,object:A}},d=function(){return function(E,O,A){var I;const L=e.getIntersectedObject(E),R=m(L),N={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0],intersected:L,intersects:E},x={x:O,y:A};if(R.id){N.threeID=(I=R.object)==null?void 0:I.id,R.object.userData.isGlyph?R.object.name?e.setSelectedByObjects([R.object],x,N,!0):e.setSelectedByZincObjects(R.object.userData.getGlyphset(),x,N,!0):e.setSelectedByObjects([R.object],x,N,!0);return}else e.setSelectedByObjects([],x,N,!0)}},b=function(){return function(E,O,A){var I;const L=e.getIntersectedObject(E),R=m(L),N={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0]},x={x:O,y:A};if(R.id){N.threeID=(I=R.object)==null?void 0:I.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([R.object],x,N,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],x,N,!0)}},v=function(E,O,A,L){if(L=="all"||L=="geometries"){const R=E.findGeometriesWithGroupName(O);for(let N=0;N<R.length;N++)R[N].setVisibility(A)}if(L=="all"||L=="glyphsets"){const R=E.findGlyphsetsWithGroupName(O);for(let N=0;N<R.length;N++)R[N].setVisibility(A)}if(L=="all"||L=="pointsets"){const R=E.findPointsetsWithGroupName(O);for(let N=0;N<R.length;N++)R[N].setVisibility(A)}if(L=="all"||L=="lines"){const R=E.findLinesWithGroupName(O);for(let N=0;N<R.length;N++)R[N].setVisibility(A)}};this.changeGeometriesVisibility=function(E,O){v(e.scene,E,O,"geometries")},this.changeGlyphsetsVisibility=function(E,O){v(e.scene,E,O,"glyphsets")},this.changeLinesVisibility=function(E,O){v(e.scene,E,O,"lines")},this.changePointsetsVisibility=function(E,O){v(e.scene,E,O,"pointsets")},this.changeOrganPartsVisibility=function(E,O,A){let L="all";A!==void 0&&(L=A),v(e.scene,E,O,L)},this.changeOrganPartsVisibilityCallback=function(E){return function(O){e.changeOrganPartsVisibility(E,O)}},this.changeBackgroundColour=function(E){const O=new gr.THREE.Color(E);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(O,1)};const g=function(E,O,A,L){for(let x=0;x<s.length;x++)s[x](L,e.scene.isTimeVarying());const R=new fF,N=L.region.getFullPath();R.data={species:e.sceneData.currentSpecies,system:E,part:O,group:L.groupName,region:N,uuid:L.uuid,lastActionOnMarker:!1},L.userData.annotation=R},w=function(E,O,A,L){for(let R=0;R<o.length;R++)o[R](L)},S=function(E,O,A){return function(L){g(E,O,A,L)}},T=function(E,O,A){return function(L){w(E,O,A,L)}},M=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},C=function(){return function(E){if((E==null?void 0:E.type)==="Error"&&u){const O={xhr:E.xhr,type:"download-error"};u(O)}}};this.updateFieldvisibility=function(E,O){for(let A=0;A<E.length;A++)if(O!=A){const L=E[A].PartName;e.changeOrganPartsVisibility(L,!1)}if(O>-1){const A=E[O].PartName;if(e.scene.findGeometriesWithGroupName(A).length>0||e.scene.findGlyphsetsWithGroupName(A).length>0)e.changeOrganPartsVisibility(A,!0);else{const L=getOrganDetails(E[O].SystemName,A);L!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+L.meta)}}},this.getAvailableSpecies=function(E,O,A){const L=new Array;L.push("none");const R=Object.keys(organsFileMap);for(index in R){const N=R[index];N!=E&&organsFileMap[N].hasOwnProperty(O)&&organsFileMap[N][O].hasOwnProperty(A)&&L.push(N)}return L},this.getCentreAndSize=function(){const E=new gr.THREE.Vector3,O=this.scene.getBoundingBox();O.getCenter(E);const A=[E.x,E.y,E.z];O.getSize(E);const L=[E.x,E.y,E.z];return{centre:A,size:L}};const _=function(E,O,A,L){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=E,e.sceneData.currentSystem=O,e.sceneData.currentPart=A,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let R="";E&&(R=E+"/"),O&&(R=O+"/"),A&&(R=A),e.sceneData.currentName=R};this.loadOrgansFromURL=function(E,O,A,L,R,N){if(e.zincRenderer&&L&&e.sceneData.metaURL!==E){_(O,A,L);const x=e.sceneData.currentName;let I=e.zincRenderer.getSceneByName(x);I?N&&I.clearAll():I=e.zincRenderer.createScene(x),e.selectObjectOnPick=!0;for(let F=0;F<r.length;F++)r[F](e.sceneData);R&&R!=""?(e.sceneData.viewURL=R,I.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=E,I.addZincObjectAddedCallbacks(S(A,L,!1)),I.addZincObjectRemovedCallbacks(T(void 0,L,!1)),I.loadMetadataURL(E,C(),M()),e.scene=I,e.zincRenderer.setCurrentScene(I),e.graphicsHighlight.reset();const B=I.getZincCameraControls();B.enableRaycaster(I,d(),b()),B.setMouseButtonAction("AUXILIARY","ZOOM"),B.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(E,O,A){if(e.zincRenderer&&O&&e.sceneData.metaURL!==E){_(void 0,void 0,O);const L=e.sceneData.currentName;let R=e.zincRenderer.getSceneByName(L);R?A&&R.clearAll():R=e.zincRenderer.createScene(L);for(let x=0;x<r.length;x++)r[x](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=E,R.addZincObjectAddedCallbacks(S(void 0,O,!1)),R.addZincObjectRemovedCallbacks(T(void 0,O,!1)),R.loadGLTF(E,void 0,M()),e.scene=R,e.zincRenderer.setCurrentScene(R),e.graphicsHighlight.reset();const N=R.getZincCameraControls();N.enableRaycaster(R,d(),b()),N.setMouseButtonAction("AUXILIARY","ZOOM"),N.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(E){const O=e.graphicsHighlight.getSelected();O&&O[0]&&O[0].userData&&e.scene.alignObjectToCameraView(O[0].userData,E)},this.exportSettings=function(){const E={};return E.name=e.instanceName,e.sceneData.currentSystem&&(E.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(E.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(E.part=e.sceneData.currentPart),E.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(E.viewURL=e.sceneData.viewURL),E.dialog="Organ Viewer",E},this.importSettings=function(E){return E&&E.dialog==this.typeName?(e.setName(E.name),E.metaURL!==void 0&&E.metaURL!=""?e.loadOrgansFromURL(E.metaURL,E.species,E.system,E.part,E.viewURL,!0):e.loadOrgans(E.species,E.system,E.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(p()),e.zincRenderer.addPostRenderCallbackFunction(y()))}()};bx.prototype=Object.create(vt.prototype);var at=function(){return at=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},at.apply(this,arguments)};function mF(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function l(f){try{c(i.next(f))}catch(h){o(h)}}function u(f){try{c(i.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function gF(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Xe(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ct(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var yF="ENTRIES",xx="KEYS",wx="VALUES",Xt="",xf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Mo(this._path),t=e.node,i=e.keys;if(Mo(i)===Xt)return{done:!1,value:this.result()};var r=t.get(Mo(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Mo(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Mo(t)}).filter(function(e){return e!==Xt}).join("")},n.prototype.value=function(){return Mo(this._path).node.get(Xt)},n.prototype.result=function(){switch(this._type){case wx:return this.value();case xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Mo=function(n){return n[n.length-1]},vF=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Mx(n,e,t,i,o,1,r,""),i},Mx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var h=Xe(n.keys()),p=h.next();!p.done;p=h.next()){var y=p.value;if(y===Xt){var m=r[f-1];m<=t&&i.set(l,[n.get(y),m])}else{for(var d=s,b=0;b<y.length;++b,++d){for(var v=y[b],g=o*d,w=g-o,S=r[g],T=Math.max(0,d-t-1),M=Math.min(o-1,d+t),C=T;C<M;++C){var _=v!==e[C],P=r[w+C]+ +_,E=r[w+C+1]+1,O=r[g+C]+1,A=r[g+C+1]=Math.min(P,E,O);A<S&&(S=A)}if(S>t)continue e}Mx(n.get(y),e,t,i,r,d,o,l+y)}}}catch(L){u={error:L}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},wf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Ct(Gc(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Ct(_f(o),2),u=l[0],c=l[1];try{for(var f=Xe(u.keys()),h=f.next();!h.done;h=f.next()){var p=h.value;if(p!==Xt&&p.startsWith(c)){var y=new Map;return y.set(p.slice(c.length),u.get(p)),new n(y,e)}}}catch(m){t={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,bF(this._tree,e)},n.prototype.entries=function(){return new xf(this,yF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Xe(this),s=r.next();!s.done;s=r.next()){var o=Ct(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return vF(this._tree,e,t)},n.prototype.get=function(e){var t=Mf(this._tree,e);return t!==void 0?t.get(Xt):void 0},n.prototype.has=function(e){var t=Mf(this._tree,e);return t!==void 0&&t.has(Xt)},n.prototype.keys=function(){return new xf(this,xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Sf(this._tree,e);return i.set(Xt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Sf(this._tree,e);return i.set(Xt,t(i.get(Xt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Sf(this._tree,e),r=i.get(Xt);return r===void 0&&i.set(Xt,r=t()),r},n.prototype.values=function(){return new xf(this,wx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=Ct(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),Gc=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Xe(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Xt&&e.startsWith(l))return t.push([n,l]),Gc(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),Gc(void 0,"",t)},Mf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Xe(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Xt&&e.startsWith(o))return Mf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Sf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Xe(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Xt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var h=n.get(u);if(f===u.length)n=h;else{var p=new Map;p.set(u.slice(f),h),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var y=new Map;return n.set(e.slice(s),y),y}return n},bF=function(n,e){var t=Ct(Gc(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Xt),i.size===0)Sx(r);else if(i.size===1){var s=Ct(i.entries().next().value,2),o=s[0],l=s[1];_x(r,o,l)}}},Sx=function(n){if(n.length!==0){var e=Ct(_f(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Sx(n.slice(0,-1));else if(t.size===1){var r=Ct(t.entries().next().value,2),s=r[0],o=r[1];s!==Xt&&_x(n.slice(0,-1),s,o)}}},_x=function(n,e,t){if(n.length!==0){var i=Ct(_f(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},_f=function(n){return n[n.length-1]},Da,Tf="or",Tx="and",xF="and_not",wF=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?Lf:e.autoVacuum;this._options=at(at(at({},Af),e),{autoVacuum:t,searchOptions:at(at({},Ex),e.searchOptions||{}),autoSuggestOptions:at(at({},EF),e.autoSuggestOptions||{})}),this._index=new wf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Rf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,h=u.processTerm,p=u.fields,y=u.idField,m=c(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var d=this.addDocumentId(m);this.saveStoredFields(d,e);try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=c(e,g);if(w!=null){var S=f(w.toString(),g),T=this._fieldIds[g],M=new Set(S).size;this.addFieldLength(d,T,this._documentCount-1,M);try{for(var C=(r=void 0,Xe(S)),_=C.next();!_.done;_=C.next()){var P=_.value,E=h(P,g);if(Array.isArray(E))try{for(var O=(o=void 0,Xe(E)),A=O.next();!A.done;A=O.next()){var L=A.value;this.addTerm(T,d,L)}}catch(R){o={error:R}}finally{try{A&&!A.done&&(l=O.return)&&l.call(O)}finally{if(o)throw o.error}}else E&&this.addTerm(T,d,E)}}catch(R){r={error:R}}finally{try{_&&!_.done&&(s=C.return)&&s.call(C)}finally{if(r)throw r.error}}}}}catch(R){t={error:R}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,h,p){var y=f.chunk,m=f.promise;return y.push(h),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(d){return setTimeout(d,0)})}).then(function(){return i.addAll(y)})}:{chunk:y,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,h=u.extractField,p=u.fields,y=u.idField,m=h(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var d=this._idToShortId.get(m);if(d==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=h(e,g);if(w!=null){var S=c(w.toString(),g),T=this._fieldIds[g],M=new Set(S).size;this.removeFieldLength(d,T,this._documentCount,M);try{for(var C=(r=void 0,Xe(S)),_=C.next();!_.done;_=C.next()){var P=_.value,E=f(P,g);if(Array.isArray(E))try{for(var O=(o=void 0,Xe(E)),A=O.next();!A.done;A=O.next()){var L=A.value;this.removeTerm(T,d,L)}}catch(R){o={error:R}}finally{try{A&&!A.done&&(l=O.return)&&l.call(O)}finally{if(o)throw o.error}}else E&&this.removeTerm(T,d,E)}}catch(R){r={error:R}}finally{try{_&&!_.done&&(s=C.return)&&s.call(C)}finally{if(r)throw r.error}}}}}catch(R){t={error:R}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(m),this._fieldLength.delete(d),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new wf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Rf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return mF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,p,y,m,d,b,v,g,w,S,T,M,C,_,P,E,O;return gF(this,function(A){switch(A.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Cf.batchSize,s=e.batchWait||Cf.batchWait,o=1,A.label=1;case 1:A.trys.push([1,7,8,9]),l=Xe(this._index),u=l.next(),A.label=2;case 2:if(u.done)return[3,6];c=Ct(u.value,2),f=c[0],h=c[1];try{for(p=(_=void 0,Xe(h)),y=p.next();!y.done;y=p.next()){m=Ct(y.value,2),d=m[0],b=m[1];try{for(v=(E=void 0,Xe(b)),g=v.next();!g.done;g=v.next())w=Ct(g.value,1),S=w[0],!this._documentIds.has(S)&&(b.size<=1?h.delete(d):b.delete(S))}catch(L){E={error:L}}finally{try{g&&!g.done&&(O=v.return)&&O.call(v)}finally{if(E)throw E.error}}}}catch(L){_={error:L}}finally{try{y&&!y.done&&(P=p.return)&&P.call(p)}finally{if(_)throw _.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(L){return setTimeout(L,s)})];case 3:A.sent(),A.label=4;case 4:o+=1,A.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return T=A.sent(),M={error:T},[3,9];case 8:try{u&&!u.done&&(C=l.return)&&C.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,A.label=10;case 10:return[4,null];case 11:return A.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||Lf.minDirtCount,i=i||Lf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Xe(s),u=l.next();!u.done;u=l.next()){var c=Ct(u.value,2),f=c[0],h=c[1],p=h.score,y=h.terms,m=h.match,d=y.length||1,b={id:this._documentIds.get(f),score:p*d,terms:Object.keys(m),queryTerms:y,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(Cx),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=at(at({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Xe(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,p=f.terms,y=p.join(" "),m=l.get(y);m!=null?(m.score+=h,m.count+=1):l.set(y,{score:h,terms:p,count:1})}}catch(T){i={error:T}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Xe(l),v=b.next();!v.done;v=b.next()){var g=Ct(v.value,2),m=g[0],w=g[1],h=w.score,p=w.terms,S=w.count;d.push({suggestion:m,terms:p,score:h/S})}}catch(T){s={error:T}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(Cx),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Af.hasOwnProperty(e))return Ef(Af,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,p=e.documentIds,y=e.fieldIds,m=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=h,w._documentIds=Hc(p),w._idToShortId=new Map,w._fieldIds=y,w._fieldLength=Hc(m),w._avgFieldLength=d,w._storedFields=Hc(b),w._dirtCount=v||0,w._index=new wf;try{for(var S=Xe(w._documentIds),T=S.next();!T.done;T=S.next()){var M=Ct(T.value,2),C=M[0],_=M[1];w._idToShortId.set(_,C)}}catch(F){i={error:F}}finally{try{T&&!T.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}try{for(var P=Xe(c),E=P.next();!E.done;E=P.next()){var O=Ct(E.value,2),A=O[0],L=O[1],R=new Map;try{for(var N=(l=void 0,Xe(Object.keys(L))),x=N.next();!x.done;x=N.next()){var I=x.value,B=L[I];g===1&&(B=B.ds),R.set(parseInt(I,10),Hc(B))}}catch(F){l={error:F}}finally{try{x&&!x.done&&(u=N.return)&&u.call(N)}finally{if(l)throw l.error}}w._index.set(A,R)}}catch(F){s={error:F}}finally{try{E&&!E.done&&(o=P.return)&&o.call(P)}finally{if(s)throw s.error}}return w},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=at(at(at({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=at(at({tokenize:l,processTerm:u},c),t),h=f.tokenize,p=f.processTerm,y=h(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=y.map(TF(f)),d=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=at(at({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(I,B){var F;return at(at({},I),(F={},F[B]=Ef(l.boost,B)||1,F))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,p=l.bm25,y=at(at({},Ex.weights),f),m=y.fuzzy,d=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var S=e.fuzzy===!0?.2:e.fuzzy,T=S<1?Math.min(h,Math.round(e.term.length*S)):S;T&&(w=this._index.fuzzyGet(e.term,T))}if(g)try{for(var M=Xe(g),C=M.next();!C.done;C=M.next()){var _=Ct(C.value,2),P=_[0],E=_[1],O=P.length-e.term.length;if(O){w==null||w.delete(P);var A=d*P.length/(P.length+.3*O);this.termResults(e.term,P,A,E,u,c,p,v)}}}catch(I){i={error:I}}finally{try{C&&!C.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var L=Xe(w.keys()),R=L.next();!R.done;R=L.next()){var P=R.value,N=Ct(w.get(P),2),x=N[0],O=N[1];if(O){var A=m*P.length/(P.length+O);this.termResults(e.term,P,A,x,u,c,p,v)}}}catch(I){s={error:I}}finally{try{R&&!R.done&&(o=L.return)&&o.call(L)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=at(at({},this._options.searchOptions),e);try{for(var o=Xe(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Tf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(MF[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Xe(this._index),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],h={};try{for(var p=(i=void 0,Xe(f)),y=p.next();!y.done;y=p.next()){var m=Ct(y.value,2),d=m[0],b=m[1];h[d]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,h])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,p,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Xe(Object.keys(s)),d=m.next();!d.done;d=m.next()){var b=d.value,v=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var S=w.size,T=this._avgFieldLength[g];try{for(var M=(h=void 0,Xe(w.keys())),C=M.next();!C.done;C=M.next()){var _=C.value;if(!this._documentIds.has(_)){this.removeTerm(g,_,t),S-=1;continue}var P=o?o(this._documentIds.get(_),t,this._storedFields.get(_)):1;if(P){var E=w.get(_),O=this._fieldLength.get(_)[g],A=_F(E,S,this._documentCount,O,T,l),L=i*v*P*A,R=u.get(_);if(R){R.score+=L,AF(R.terms,e);var N=Ef(R.match,t);N?N.push(b):R.match[t]=[b]}else u.set(_,{score:L,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){h={error:x}}finally{try{C&&!C.done&&(p=M.return)&&p.call(M)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,Rx),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,Rx),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Xe(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Xe(o),f=c.next();!f.done;f=c.next()){var h=f.value,p=l(t,h);p!==void 0&&(u[h]=p)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Ef=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},MF=(Da={},Da[Tf]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,h=u.match;l.score=l.score+c,l.match=Object.assign(l.match,h),Ax(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Da[Tx]=function(n,e){var t,i,r=new Map;try{for(var s=Xe(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,h=c.terms,p=c.match;Ax(u.terms,h),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(y){t={error:y}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},Da[xF]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Da),SF={k:1.2,b:.7,d:.5},_F=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},TF=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Af={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(CF)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},Ex={combineWith:Tf,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:SF},EF={combineWith:Tx,prefix:function(n,e,t){return e===t.length-1}},Cf={batchSize:1e3,batchWait:10},Rf={minDirtFactor:.1,minDirtCount:20},Lf=at(at({},Cf),Rf),AF=function(n,e){n.includes(e)||n.push(e)},Ax=function(n,e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Cx=function(n,e){var t=n.score,i=e.score;return i-t},Rx=function(){return new Map},Hc=function(n){var e,t,i=new Map;try{for(var r=Xe(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},CF=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class RF{constructor(){this._searchEngine=new wF({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=FB(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const LF={name:"ScaffoldVuer",components:{Button:bs,Col:Ln,Loading:MR,Option:ws,Popover:vl,Row:Zn,Select:xs,Slider:Sn,TabPane:Mg,Tabs:wg,MapSvgIcon:Pf.MapSvgIcon,MapSvgSpriteColor:Pf.MapSvgSpriteColor,PrimitiveControls:px,ScaffoldTooltip:yx,ElIconWarningFilled:kp,ElIconArrowDown:pu,ElIconArrowLeft:Fi,DrawToolbar:Fa.DrawToolbar,ScaffoldTreeControls:mx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new Lx.AnnotationService(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},showLocalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,annotationFeature:{},offlineAnnotationEnabled:!1,offlineAnnotations:a.markRaw([]),authorisedUser:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],existDrawnFeatures:a.markRaw([]),activeDrawTool:void 0,activeDrawMode:void 0,boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new bx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new RF},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new uF;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...jc.mapState(gx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?n[1]:n[0]:n}},methods:{enableAxisDisplay:function(n,e){this.$module.scene&&this.$module.scene.enableAxisDisplay(n,e)},createAxisDisplay:function(n){this.$module.scene&&this.$module.scene.createAxisDisplay(n)},addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromOfflineAnnotation:function(n,e){for(let t=0;t<this.offlineAnnotations.length;t++){const i=this.offlineAnnotations[t];if(i.region===n&&i.group===e){this.offlineAnnotations.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.groupName;n.region.findObjectsWithGroupName(e,!1).length===0&&this.$_searchIndex.removeZincObject(n,n.uuid)}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=ox(this.annotator,this.userToken,t,n,e,this.url,i);if(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==r.item.id)),this.existDrawnFeatures.push(r.feature),this.offlineAnnotationEnabled){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(r),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmComment:function(n){if(this._editingZincObject){let e=n;this._editingZincObject.isEditable&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(t=>t.id!==e.item.id)),this.existDrawnFeatures.push(n.feature)),this.offlineAnnotationEnabled&&(e.group=this._editingZincObject.groupName,e.region=this._editingZincObject.region.getFullPath(),this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(e),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations)))}},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName,i=ox(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted");i&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==i.item.id)),this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject),this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations=this.offlineAnnotations.filter(s=>s.item.id!==i.item.id),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))))}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(DB(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){this.createData.toBeDeleted=!1,n==="mode"?(this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0):n==="tool"&&(this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1)},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=wo(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.authorisedUser||this.offlineAnnotationEnabled)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=PB(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=OB(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)if(this.viewingMode==="Annotation"){this.tData.label=i,this.tData.region=r;const s=IB(n);if(this._editingZincObject=s,s){const o=this._editingZincObject.region.getFullPath()+"/",l=this._editingZincObject.groupName;this.annotationFeature=sx(this._editingZincObject,o,l,this.url,"").feature}this.activateAnnotationMode(e,n)}else this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers);else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=wo(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=rx(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s=[{featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}];this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete,confirmComment:this.confirmComment});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},clearAnnotationFeature:function(){const n=this.getOfflineAnnotations();this.existDrawnFeatures.map(t=>decodeURIComponent(t.id).split("/").pop()).forEach(t=>{const i=this.$module.scene.findObjectsWithGroupName(t,!1);if(i&&i.length){const r=i[0].region.getFullPath()+"/";this.$module.scene.getRootRegion().findChildFromPath(r).removeZincObject(i[0])}}),this.$refs.scaffoldTreeControls.removeRegion("__annotation"),this.offlineAnnotations=n},addAnnotationFeature:async function(){let n;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],n=this.offlineAnnotations.filter(e=>e.resource===this.url&&e.feature.properties.drawn).map(e=>e.feature);else{n=[];const e=await ax(this.annotator,this.userToken,this.url);e&&e.features&&(n=[...e.features]);const t=await ax(this.annotator,this.userToken,encodeURIComponent(this.url));t&&t.features&&(n=[...n,...t.features])}this.existDrawnFeatures=a.markRaw(n),lx(this.$module.scene,n)},changeViewingMode:function(n){this.$module&&(n&&(this.viewingMode=n),this.clearAnnotationFeature(),this.viewingMode==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&e.canUpdate?(this.authorisedUser=e,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.emitOfflineAnnotationUpdate(),this.addAnnotationFeature(),this.loading=!1})):this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape=""),this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate())},emitOfflineAnnotationUpdate:function(){this.$emit("update-offline-annotation-enabled",this.offlineAnnotationEnabled)},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();wo(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=rx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.offlineAnnotations&&sessionStorage.setItem("anonymous-annotation",n.offlineAnnotations),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.offlineAnnotations.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),this.offlineAnnotationEnabled&&(n.offlineAnnotations=sessionStorage.getItem("anonymous-annotation")),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:n.viewingMode,search:n.search,offlineAnnotations:n.offlineAnnotations}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search,offlineAnnotations:n.offlineAnnotations}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getOfflineAnnotations:function(){return[...this.offlineAnnotations]},importOfflineAnnotations:function(n){if(this.offlineAnnotationEnabled){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);lx(this.$module.scene,e),n.forEach(t=>{this.offlineAnnotations.push({...t})}),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility,offlineAnnotations:e==null?void 0:e.offlineAnnotations})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},PF={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},IF={class:"primitive-controls-box"},OF={class:"animation-data"},NF={class:"purple"},DF={class:"animation-data"},BF={class:"purple"},FF={class:"animation-data"},VF={class:"bottom-right-control"},kF={style:{"margin-bottom":"2px"}},zF={key:0,class:"viewing-mode-title"},UF=["onClick"],GF=["onClick"];function HF(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=yx,u=a.resolveComponent("DrawToolbar"),c=kp,f=ht,h=vl,p=mx,y=px,m=a.resolveComponent("map-svg-icon"),d=Sn,b=Zn,v=Mg,g=ws,w=xs,S=wg,T=bs,M=Qu;return a.withDirectives((a.openBlock(),a.createElementBlock("div",PF,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,annotationFeature:n.annotationFeature,offlineAnnotationEnabled:n.offlineAnnotationEnabled,onConfirmCreate:e[0]||(e[0]=C=>s.confirmCreate(C)),onCancelCreate:e[1]||(e[1]=C=>s.cancelCreate()),onConfirmComment:e[2]||(e[2]=C=>s.confirmComment(C)),onConfirmDelete:e[3]||(e[3]=C=>s.confirmDelete()),onTooltipHide:e[4]||(e[4]=C=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay","annotationFeature","offlineAnnotationEnabled"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[5]||(e[5]=a.withKeys((...C)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(...C),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.authorisedUser||n.offlineAnnotationEnabled)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[6]||(e[6]=C=>s.showHelpText(7)),onMouseout:e[7]||(e[7]=C=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[27]||(e[27]=a.createElementVNode("span",{class:"message-text"},"Beta",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[8]||(e[8]=C=>s.showHelpText(8)),onMouseout:e[9]||(e[9]=C=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[28]||(e[28]=a.createElementVNode("span",{class:"message-text"},"What's new?",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",IF,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(S,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[10]||(e[10]=C=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[11]||(e[11]=C=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[12]||(e[12]=C=>s.timeChange(C))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",OF,[e[29]||(e[29]=a.createTextVNode(" Original duration: ")),a.createElementVNode("div",NF,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",DF,[e[30]||(e[30]=a.createTextVNode(" Animation duration: ")),a.createElementVNode("div",BF,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",FF,[e[31]||(e[31]=a.createTextVNode(" Playback speed ")),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[13]||(e[13]=C=>s.speedChanged(C))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,C=>(a.openBlock(),a.createBlock(g,{key:C.value,label:C.label,value:C.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",VF,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[14]||(e[14]=C=>s.zoomIn()),onMouseover:e[15]||(e[15]=C=>s.showHelpText(0)),onMouseout:e[16]||(e[16]=C=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[17]||(e[17]=C=>s.zoomOut()),onMouseover:e[18]||(e[18]=C=>s.showHelpText(1)),onMouseout:e[19]||(e[19]=C=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[20]||(e[20]=C=>s.fitWindow()),onMouseover:e[21]||(e[21]=C=>s.showHelpText(2)),onMouseout:e[22]||(e[22]=C=>s.hideHelpText(2))})]),default:a.withCtx(()=>[e[32]||(e[32]=a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1))]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,C=>(a.openBlock(),a.createBlock(b,{key:C.key},{default:a.withCtx(()=>[a.createVNode(T,{type:"primary",plain:"",onClick:_=>n.$emit("open-map",C.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(C.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[33]||(e[33]=[a.createTextVNode("Viewing Mode")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",kF,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(C,_,P)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:_},[_===n.viewingMode?(a.openBlock(),a.createElementBlock("span",zF,[a.createElementVNode("b",null,a.toDisplayString(_),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:E=>s.changeViewingMode(_)},a.toDisplayString(_),9,UF))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1}),n.viewingMode==="Annotation"&&n.offlineAnnotationEnabled?(a.openBlock(),a.createBlock(b,{key:0,class:"viewing-mode-description"},{default:a.withCtx(()=>e[34]||(e[34]=[a.createTextVNode(" (Anonymous annotate) ")])),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[35]||(e[35]=[a.createTextVNode(" Change background ")])),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,C=>(a.openBlock(),a.createElementBlock("div",{key:C,class:a.normalizeClass(["backgroundChoice",C,C==n.currentBackground?"active":""]),onClick:_=>s.backgroundChangeCallback(C)},null,10,GF))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[t.showOpenMapButton?(a.openBlock(),a.createBlock(b,{key:0},{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[23]||(e[23]=C=>s.showHelpText(3)),onMouseout:e[24]||(e[24]=C=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0),t.showLocalSettings?(a.openBlock(),a.createBlock(b,{key:1},{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[25]||(e[25]=C=>s.showHelpText(4)),onMouseout:e[26]||(e[26]=C=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0)],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[M,n.loading]])}const WF=Pi(LF,[["render",HF],["__scopeId","data-v-e4742c36"]]);Nt.ScaffoldVuer=WF,Object.defineProperty(Nt,Symbol.toStringTag,{value:"Module"})});