diff --git a/dist/himp.platform.angular/browser/chunk-DNECFSH6.js b/dist/himp.platform.angular/browser/chunk-DNECFSH6.js new file mode 100644 index 0000000..340dc58 --- /dev/null +++ b/dist/himp.platform.angular/browser/chunk-DNECFSH6.js @@ -0,0 +1,9 @@ +import{$ as Rt,$a as ct,A as We,C as Ve,Ca as tt,Ga as rt,Ia as nt,La as ot,O as sr,P as ar,Pa as st,S as lr,Sa as at,T as ur,U as cr,Ua as lt,V as He,Xa as ut,_ as qe,aa as Ke,bb as ft,ca as Qe,da as fr,db as ht,e as Ue,fa as hr,fb as pt,ga as pr,ha as dr,hb as dt,ia as gr,j as ir,ja as mr,jb as gt,ka as yr,kb as kt,la as Ye,n as nr,pa as Ge,ra as $e,ta as Je,u as je,ua as Xe,v as ze,wa as Ze,ya as et,z as or}from"./chunk-WD6SV3WH.js";import{Ab as Ct,Bb as xt,Cb as It,Db as Tt,Eb as we,Fb as Se,Fe as Mt,Gb as At,Ge as Ne,He as Ot,I as Yt,J as Gt,Jb as Ee,K as $t,Ka as pe,Le as De,Nf as it,Oa as be,Ta as Ae,Va as _e,X as Jt,Y as Xt,Za as vt,a as bt,b as wt,c as _t,cc as Pt,dc as rr,f as Zr,gb as ge,h as Vt,ha as Zt,hb as de,hf as Le,ib as Ie,ja as Dt,k as Re,ka as Lt,l as Ht,lf as Fe,m as qt,mb as er,n as Kt,na as ve,nc as Be,o as Nt,p as Qt,qb as Te,sa as Ft,sb as ke,ta as Ut,tb as Et,ub as St,vb as tr}from"./chunk-VDRVUQCF.js";var zt=Zr((Jr,jt)=>{"use strict";(function(se){if(typeof Jr=="object"&&typeof jt<"u")jt.exports=se();else if(typeof define=="function"&&define.amd)define([],se);else{var ae;typeof window<"u"?ae=window:typeof global<"u"?ae=global:typeof self<"u"?ae=self:ae=this,ae.mqtt=se()}})(function(){var se,ae,me;return function(){function m(T,v,h){function p(o,i){if(!v[o]){if(!T[o]){var r=typeof _t=="function"&&_t;if(!i&&r)return r(o,!0);if(y)return y(o,!0);var e=new Error("Cannot find module '"+o+"'");throw e.code="MODULE_NOT_FOUND",e}var t=v[o]={exports:{}};T[o][0].call(t.exports,function(s){var u=T[o][1][s];return p(u||s)},t,t.exports,m,T,v,h)}return v[o].exports}for(var y=typeof _t=="function"&&_t,c=0;c0)throw new Error("Invalid string. Length must be a multiple of 4");var E=_.indexOf("=");E===-1&&(E=f);var M=E===f?0:4-E%4;return[E,M]}function e(_){var f=r(_),E=f[0],M=f[1];return(E+M)*3/4-M}function t(_,f,E){return(f+E)*3/4-E}function s(_){var f,E=r(_),M=E[0],A=E[1],z=new y(t(_,M,A)),j=0,x=A>0?M-4:M,O;for(O=0;O>16&255,z[j++]=f>>8&255,z[j++]=f&255;return A===2&&(f=p[_.charCodeAt(O)]<<2|p[_.charCodeAt(O+1)]>>4,z[j++]=f&255),A===1&&(f=p[_.charCodeAt(O)]<<10|p[_.charCodeAt(O+1)]<<4|p[_.charCodeAt(O+2)]>>2,z[j++]=f>>8&255,z[j++]=f&255),z}function u(_){return h[_>>18&63]+h[_>>12&63]+h[_>>6&63]+h[_&63]}function d(_,f,E){for(var M,A=[],z=f;zx?x:j+z));return M===1?(f=_[E-1],A.push(h[f>>2]+h[f<<4&63]+"==")):M===2&&(f=(_[E-2]<<8)+_[E-1],A.push(h[f>>10]+h[f>>4&63]+h[f<<2&63]+"=")),A.join("")}},{}],2:[function(m,T,v){},{}],3:[function(m,T,v){(function(h){(function(){"use strict";var p=m("base64-js"),y=m("ieee754");v.Buffer=r,v.SlowBuffer=M,v.INSPECT_MAX_BYTES=50;var c=2147483647;v.kMaxLength=c,r.TYPED_ARRAY_SUPPORT=o(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{var l=new Uint8Array(1);return l.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},l.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function i(l){if(l>c)throw new RangeError('The value "'+l+'" is invalid for option "size"');var n=new Uint8Array(l);return n.__proto__=r.prototype,n}function r(l,n,a){if(typeof l=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(l)}return e(l,n,a)}typeof Symbol<"u"&&Symbol.species!=null&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),r.poolSize=8192;function e(l,n,a){if(typeof l=="string")return d(l,n);if(ArrayBuffer.isView(l))return g(l);if(l==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(Y(l,ArrayBuffer)||l&&Y(l.buffer,ArrayBuffer))return _(l,n,a);if(typeof l=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var w=l.valueOf&&l.valueOf();if(w!=null&&w!==l)return r.from(w,n,a);var D=f(l);if(D)return D;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof l[Symbol.toPrimitive]=="function")return r.from(l[Symbol.toPrimitive]("string"),n,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}r.from=function(l,n,a){return e(l,n,a)},r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array;function t(l){if(typeof l!="number")throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function s(l,n,a){return t(l),l<=0?i(l):n!==void 0?typeof a=="string"?i(l).fill(n,a):i(l).fill(n):i(l)}r.alloc=function(l,n,a){return s(l,n,a)};function u(l){return t(l),i(l<0?0:E(l)|0)}r.allocUnsafe=function(l){return u(l)},r.allocUnsafeSlow=function(l){return u(l)};function d(l,n){if((typeof n!="string"||n==="")&&(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var a=A(l,n)|0,w=i(a),D=w.write(l,n);return D!==a&&(w=w.slice(0,D)),w}function g(l){for(var n=l.length<0?0:E(l.length)|0,a=i(n),w=0;w=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return l|0}function M(l){return+l!=l&&(l=0),r.alloc(+l)}r.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==r.prototype},r.compare=function(n,a){if(Y(n,Uint8Array)&&(n=r.from(n,n.offset,n.byteLength)),Y(a,Uint8Array)&&(a=r.from(a,a.offset,a.byteLength)),!r.isBuffer(n)||!r.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===a)return 0;for(var w=n.length,D=a.length,K=0,J=Math.min(w,D);K2&&arguments[2]===!0;if(!w&&a===0)return 0;for(var D=!1;;)switch(n){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return te(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return N(l).length;default:if(D)return w?-1:te(l).length;n=(""+n).toLowerCase(),D=!0}}r.byteLength=A;function z(l,n,a){var w=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,n>>>=0,a<=n))return"";for(l||(l="utf8");;)switch(l){case"hex":return ee(this,n,a);case"utf8":case"utf-8":return S(this,n,a);case"ascii":return H(this,n,a);case"latin1":case"binary":return re(this,n,a);case"base64":return G(this,n,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,n,a);default:if(w)throw new TypeError("Unknown encoding: "+l);l=(l+"").toLowerCase(),w=!0}}r.prototype._isBuffer=!0;function j(l,n,a){var w=l[n];l[n]=l[a],l[a]=w}r.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;aa&&(n+=" ... "),""},r.prototype.compare=function(n,a,w,D,K){if(Y(n,Uint8Array)&&(n=r.from(n,n.offset,n.byteLength)),!r.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(a===void 0&&(a=0),w===void 0&&(w=n?n.length:0),D===void 0&&(D=0),K===void 0&&(K=this.length),a<0||w>n.length||D<0||K>this.length)throw new RangeError("out of range index");if(D>=K&&a>=w)return 0;if(D>=K)return-1;if(a>=w)return 1;if(a>>>=0,w>>>=0,D>>>=0,K>>>=0,this===n)return 0;for(var J=K-D,ue=w-a,ce=Math.min(J,ue),fe=this.slice(D,K),ye=n.slice(a,w),he=0;he2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,b(a)&&(a=D?0:l.length-1),a<0&&(a=l.length+a),a>=l.length){if(D)return-1;a=l.length-1}else if(a<0)if(D)a=0;else return-1;if(typeof n=="string"&&(n=r.from(n,w)),r.isBuffer(n))return n.length===0?-1:O(l,n,a,w,D);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?D?Uint8Array.prototype.indexOf.call(l,n,a):Uint8Array.prototype.lastIndexOf.call(l,n,a):O(l,[n],a,w,D);throw new TypeError("val must be string, number or Buffer")}function O(l,n,a,w,D){var K=1,J=l.length,ue=n.length;if(w!==void 0&&(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le")){if(l.length<2||n.length<2)return-1;K=2,J/=2,ue/=2,a/=2}function ce(Pe,xe){return K===1?Pe[xe]:Pe.readUInt16BE(xe*K)}var fe;if(D){var ye=-1;for(fe=a;feJ&&(a=J-ue),fe=a;fe>=0;fe--){for(var he=!0,Ce=0;CeD&&(w=D)):w=D;var K=n.length;w>K/2&&(w=K/2);for(var J=0;J>>0,isFinite(w)?(w=w>>>0,D===void 0&&(D="utf8")):(D=w,w=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var K=this.length-a;if((w===void 0||w>K)&&(w=K),n.length>0&&(w<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");D||(D="utf8");for(var J=!1;;)switch(D){case"hex":return C(this,n,a,w);case"utf8":case"utf-8":return V(this,n,a,w);case"ascii":return B(this,n,a,w);case"latin1":case"binary":return ne(this,n,a,w);case"base64":return oe(this,n,a,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,n,a,w);default:if(J)throw new TypeError("Unknown encoding: "+D);D=(""+D).toLowerCase(),J=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function G(l,n,a){return n===0&&a===l.length?p.fromByteArray(l):p.fromByteArray(l.slice(n,a))}function S(l,n,a){a=Math.min(l.length,a);for(var w=[],D=n;D239?4:K>223?3:K>191?2:1;if(D+ue<=a){var ce,fe,ye,he;switch(ue){case 1:K<128&&(J=K);break;case 2:ce=l[D+1],(ce&192)===128&&(he=(K&31)<<6|ce&63,he>127&&(J=he));break;case 3:ce=l[D+1],fe=l[D+2],(ce&192)===128&&(fe&192)===128&&(he=(K&15)<<12|(ce&63)<<6|fe&63,he>2047&&(he<55296||he>57343)&&(J=he));break;case 4:ce=l[D+1],fe=l[D+2],ye=l[D+3],(ce&192)===128&&(fe&192)===128&&(ye&192)===128&&(he=(K&15)<<18|(ce&63)<<12|(fe&63)<<6|ye&63,he>65535&&he<1114112&&(J=he))}}J===null?(J=65533,ue=1):J>65535&&(J-=65536,w.push(J>>>10&1023|55296),J=56320|J&1023),w.push(J),D+=ue}return L(w)}var P=4096;function L(l){var n=l.length;if(n<=P)return String.fromCharCode.apply(String,l);for(var a="",w=0;ww)&&(a=w);for(var D="",K=n;Kw&&(n=w),a<0?(a+=w,a<0&&(a=0)):a>w&&(a=w),aa)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUIntLE=function(n,a,w){n=n>>>0,a=a>>>0,w||U(n,a,this.length);for(var D=this[n],K=1,J=0;++J>>0,a=a>>>0,w||U(n,a,this.length);for(var D=this[n+--a],K=1;a>0&&(K*=256);)D+=this[n+--a]*K;return D},r.prototype.readUInt8=function(n,a){return n=n>>>0,a||U(n,1,this.length),this[n]},r.prototype.readUInt16LE=function(n,a){return n=n>>>0,a||U(n,2,this.length),this[n]|this[n+1]<<8},r.prototype.readUInt16BE=function(n,a){return n=n>>>0,a||U(n,2,this.length),this[n]<<8|this[n+1]},r.prototype.readUInt32LE=function(n,a){return n=n>>>0,a||U(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},r.prototype.readUInt32BE=function(n,a){return n=n>>>0,a||U(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},r.prototype.readIntLE=function(n,a,w){n=n>>>0,a=a>>>0,w||U(n,a,this.length);for(var D=this[n],K=1,J=0;++J=K&&(D-=Math.pow(2,8*a)),D},r.prototype.readIntBE=function(n,a,w){n=n>>>0,a=a>>>0,w||U(n,a,this.length);for(var D=a,K=1,J=this[n+--D];D>0&&(K*=256);)J+=this[n+--D]*K;return K*=128,J>=K&&(J-=Math.pow(2,8*a)),J},r.prototype.readInt8=function(n,a){return n=n>>>0,a||U(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},r.prototype.readInt16LE=function(n,a){n=n>>>0,a||U(n,2,this.length);var w=this[n]|this[n+1]<<8;return w&32768?w|4294901760:w},r.prototype.readInt16BE=function(n,a){n=n>>>0,a||U(n,2,this.length);var w=this[n+1]|this[n]<<8;return w&32768?w|4294901760:w},r.prototype.readInt32LE=function(n,a){return n=n>>>0,a||U(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},r.prototype.readInt32BE=function(n,a){return n=n>>>0,a||U(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},r.prototype.readFloatLE=function(n,a){return n=n>>>0,a||U(n,4,this.length),y.read(this,n,!0,23,4)},r.prototype.readFloatBE=function(n,a){return n=n>>>0,a||U(n,4,this.length),y.read(this,n,!1,23,4)},r.prototype.readDoubleLE=function(n,a){return n=n>>>0,a||U(n,8,this.length),y.read(this,n,!0,52,8)},r.prototype.readDoubleBE=function(n,a){return n=n>>>0,a||U(n,8,this.length),y.read(this,n,!1,52,8)};function X(l,n,a,w,D,K){if(!r.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>D||nl.length)throw new RangeError("Index out of range")}r.prototype.writeUIntLE=function(n,a,w,D){if(n=+n,a=a>>>0,w=w>>>0,!D){var K=Math.pow(2,8*w)-1;X(this,n,a,w,K,0)}var J=1,ue=0;for(this[a]=n&255;++ue>>0,w=w>>>0,!D){var K=Math.pow(2,8*w)-1;X(this,n,a,w,K,0)}var J=w-1,ue=1;for(this[a+J]=n&255;--J>=0&&(ue*=256);)this[a+J]=n/ue&255;return a+w},r.prototype.writeUInt8=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,1,255,0),this[a]=n&255,a+1},r.prototype.writeUInt16LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,65535,0),this[a]=n&255,this[a+1]=n>>>8,a+2},r.prototype.writeUInt16BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,65535,0),this[a]=n>>>8,this[a+1]=n&255,a+2},r.prototype.writeUInt32LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,4294967295,0),this[a+3]=n>>>24,this[a+2]=n>>>16,this[a+1]=n>>>8,this[a]=n&255,a+4},r.prototype.writeUInt32BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,4294967295,0),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4},r.prototype.writeIntLE=function(n,a,w,D){if(n=+n,a=a>>>0,!D){var K=Math.pow(2,8*w-1);X(this,n,a,w,K-1,-K)}var J=0,ue=1,ce=0;for(this[a]=n&255;++J>0)-ce&255;return a+w},r.prototype.writeIntBE=function(n,a,w,D){if(n=+n,a=a>>>0,!D){var K=Math.pow(2,8*w-1);X(this,n,a,w,K-1,-K)}var J=w-1,ue=1,ce=0;for(this[a+J]=n&255;--J>=0&&(ue*=256);)n<0&&ce===0&&this[a+J+1]!==0&&(ce=1),this[a+J]=(n/ue>>0)-ce&255;return a+w},r.prototype.writeInt8=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,1,127,-128),n<0&&(n=255+n+1),this[a]=n&255,a+1},r.prototype.writeInt16LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,32767,-32768),this[a]=n&255,this[a+1]=n>>>8,a+2},r.prototype.writeInt16BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,32767,-32768),this[a]=n>>>8,this[a+1]=n&255,a+2},r.prototype.writeInt32LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,2147483647,-2147483648),this[a]=n&255,this[a+1]=n>>>8,this[a+2]=n>>>16,this[a+3]=n>>>24,a+4},r.prototype.writeInt32BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4};function $(l,n,a,w,D,K){if(a+w>l.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function le(l,n,a,w,D){return n=+n,a=a>>>0,D||$(l,n,a,4,34028234663852886e22,-34028234663852886e22),y.write(l,n,a,w,23,4),a+4}r.prototype.writeFloatLE=function(n,a,w){return le(this,n,a,!0,w)},r.prototype.writeFloatBE=function(n,a,w){return le(this,n,a,!1,w)};function Z(l,n,a,w,D){return n=+n,a=a>>>0,D||$(l,n,a,8,17976931348623157e292,-17976931348623157e292),y.write(l,n,a,w,52,8),a+8}r.prototype.writeDoubleLE=function(n,a,w){return Z(this,n,a,!0,w)},r.prototype.writeDoubleBE=function(n,a,w){return Z(this,n,a,!1,w)},r.prototype.copy=function(n,a,w,D){if(!r.isBuffer(n))throw new TypeError("argument should be a Buffer");if(w||(w=0),!D&&D!==0&&(D=this.length),a>=n.length&&(a=n.length),a||(a=0),D>0&&D=this.length)throw new RangeError("Index out of range");if(D<0)throw new RangeError("sourceEnd out of bounds");D>this.length&&(D=this.length),n.length-a=0;--J)n[J+a]=this[J+w];else Uint8Array.prototype.set.call(n,this.subarray(w,D),a);return K},r.prototype.fill=function(n,a,w,D){if(typeof n=="string"){if(typeof a=="string"?(D=a,a=0,w=this.length):typeof w=="string"&&(D=w,w=this.length),D!==void 0&&typeof D!="string")throw new TypeError("encoding must be a string");if(typeof D=="string"&&!r.isEncoding(D))throw new TypeError("Unknown encoding: "+D);if(n.length===1){var K=n.charCodeAt(0);(D==="utf8"&&K<128||D==="latin1")&&(n=K)}}else typeof n=="number"&&(n=n&255);if(a<0||this.length>>0,w=w===void 0?this.length:w>>>0,n||(n=0);var J;if(typeof n=="number")for(J=a;J55295&&a<57344){if(!D){if(a>56319){(n-=3)>-1&&K.push(239,191,189);continue}else if(J+1===w){(n-=3)>-1&&K.push(239,191,189);continue}D=a;continue}if(a<56320){(n-=3)>-1&&K.push(239,191,189),D=a;continue}a=(D-55296<<10|a-56320)+65536}else D&&(n-=3)>-1&&K.push(239,191,189);if(D=null,a<128){if((n-=1)<0)break;K.push(a)}else if(a<2048){if((n-=2)<0)break;K.push(a>>6|192,a&63|128)}else if(a<65536){if((n-=3)<0)break;K.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((n-=4)<0)break;K.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return K}function R(l){for(var n=[],a=0;a>8,D=a%256,K.push(D),K.push(w);return K}function N(l){return p.toByteArray(k(l))}function q(l,n,a,w){for(var D=0;D=n.length||D>=l.length);++D)n[D+a]=l[D];return D}function Y(l,n){return l instanceof n||l!=null&&l.constructor!=null&&l.constructor.name!=null&&l.constructor.name===n.name}function b(l){return l!==l}}).call(this)}).call(this,m("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:5}],4:[function(m,T,v){"use strict";var h=typeof Reflect=="object"?Reflect:null,p=h&&typeof h.apply=="function"?h.apply:function(O,C,V){return Function.prototype.apply.call(O,C,V)},y;h&&typeof h.ownKeys=="function"?y=h.ownKeys:Object.getOwnPropertySymbols?y=function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:y=function(O){return Object.getOwnPropertyNames(O)};function c(x){console&&console.warn&&console.warn(x)}var o=Number.isNaN||function(O){return O!==O};function i(){i.init.call(this)}T.exports=i,T.exports.once=A,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var r=10;function e(x){if(typeof x!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof x)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(x){if(typeof x!="number"||x<0||o(x))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+x+".");r=x}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(O){if(typeof O!="number"||O<0||o(O))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+O+".");return this._maxListeners=O,this};function t(x){return x._maxListeners===void 0?i.defaultMaxListeners:x._maxListeners}i.prototype.getMaxListeners=function(){return t(this)},i.prototype.emit=function(O){for(var C=[],V=1;V0&&(oe=C[0]),oe instanceof Error)throw oe;var ie=new Error("Unhandled error."+(oe?" ("+oe.message+")":""));throw ie.context=oe,ie}var G=ne[O];if(G===void 0)return!1;if(typeof G=="function")p(G,this,C);else for(var S=G.length,P=f(G,S),V=0;V0&&oe.length>B&&!oe.warned){oe.warned=!0;var ie=new Error("Possible EventEmitter memory leak detected. "+oe.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");ie.name="MaxListenersExceededWarning",ie.emitter=x,ie.type=O,ie.count=oe.length,c(ie)}return x}i.prototype.addListener=function(O,C){return s(this,O,C,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(O,C){return s(this,O,C,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(x,O,C){var V={fired:!1,wrapFn:void 0,target:x,type:O,listener:C},B=u.bind(V);return B.listener=C,V.wrapFn=B,B}i.prototype.once=function(O,C){return e(C),this.on(O,d(this,O,C)),this},i.prototype.prependOnceListener=function(O,C){return e(C),this.prependListener(O,d(this,O,C)),this},i.prototype.removeListener=function(O,C){var V,B,ne,oe,ie;if(e(C),B=this._events,B===void 0)return this;if(V=B[O],V===void 0)return this;if(V===C||V.listener===C)--this._eventsCount===0?this._events=Object.create(null):(delete B[O],B.removeListener&&this.emit("removeListener",O,V.listener||C));else if(typeof V!="function"){for(ne=-1,oe=V.length-1;oe>=0;oe--)if(V[oe]===C||V[oe].listener===C){ie=V[oe].listener,ne=oe;break}if(ne<0)return this;ne===0?V.shift():E(V,ne),V.length===1&&(B[O]=V[0]),B.removeListener!==void 0&&this.emit("removeListener",O,ie||C)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(O){var C,V,B;if(V=this._events,V===void 0)return this;if(V.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):V[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete V[O]),this;if(arguments.length===0){var ne=Object.keys(V),oe;for(B=0;B=0;B--)this.removeListener(O,C[B]);return this};function g(x,O,C){var V=x._events;if(V===void 0)return[];var B=V[O];return B===void 0?[]:typeof B=="function"?C?[B.listener||B]:[B]:C?M(B):f(B,B.length)}i.prototype.listeners=function(O){return g(this,O,!0)},i.prototype.rawListeners=function(O){return g(this,O,!1)},i.listenerCount=function(x,O){return typeof x.listenerCount=="function"?x.listenerCount(O):_.call(x,O)},i.prototype.listenerCount=_;function _(x){var O=this._events;if(O!==void 0){var C=O[x];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?y(this._events):[]};function f(x,O){for(var C=new Array(O),V=0;V>1,u=-7,d=y?o-1:0,g=y?-1:1,_=h[p+d];for(d+=g,i=_&(1<<-u)-1,_>>=-u,u+=e;u>0;i=i*256+h[p+d],d+=g,u-=8);for(r=i&(1<<-u)-1,i>>=-u,u+=c;u>0;r=r*256+h[p+d],d+=g,u-=8);if(i===0)i=1-s;else{if(i===t)return r?NaN:(_?-1:1)*(1/0);r=r+Math.pow(2,c),i=i-s}return(_?-1:1)*r*Math.pow(2,i-c)},v.write=function(h,p,y,c,o,i){var r,e,t,s=i*8-o-1,u=(1<>1,g=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=c?0:i-1,f=c?1:-1,E=p<0||p===0&&1/p<0?1:0;for(p=Math.abs(p),isNaN(p)||p===1/0?(e=isNaN(p)?1:0,r=u):(r=Math.floor(Math.log(p)/Math.LN2),p*(t=Math.pow(2,-r))<1&&(r--,t*=2),r+d>=1?p+=g/t:p+=g*Math.pow(2,1-d),p*t>=2&&(r++,t/=2),r+d>=u?(e=0,r=u):r+d>=1?(e=(p*t-1)*Math.pow(2,o),r=r+d):(e=p*Math.pow(2,d-1)*Math.pow(2,o),r=0));o>=8;h[y+_]=e&255,_+=f,e/=256,o-=8);for(r=r<0;h[y+_]=r&255,_+=f,r/=256,s-=8);h[y+_-f]|=E*128}},{}],6:[function(m,T,v){(function(h,p){(function(){"use strict";let y=m("events").EventEmitter,c=m("./store"),o=m("./topic-alias-recv"),i=m("./topic-alias-send"),r=m("mqtt-packet"),e=m("./default-message-id-provider"),t=m("readable-stream").Writable,s=m("inherits"),u=m("reinterval"),d=m("rfdc/default"),g=m("./validations"),_=m("xtend"),f=m("debug")("mqttjs:client"),E=h?h.nextTick:function(S){setTimeout(S,0)},M=p.setImmediate||function(S){E(S)},A={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},z=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],j={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function x(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function O(S,P){if(S.options.protocolVersion===5&&P.cmd==="publish"){let L;P.properties&&(L=P.properties.topicAlias);let H=P.topic.toString();if(S.topicAliasSend)if(L){if(H.length!==0&&(f("applyTopicAlias :: register topic: %s - alias: %d",H,L),!S.topicAliasSend.put(H,L)))return f("applyTopicAlias :: error out of range. topic: %s - alias: %d",H,L),new Error("Sending Topic Alias out of range")}else H.length!==0&&(S.options.autoAssignTopicAlias?(L=S.topicAliasSend.getAliasByTopic(H),L?(P.topic="",P.properties=wt(bt({},P.properties),{topicAlias:L}),f("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",H,L)):(L=S.topicAliasSend.getLruAlias(),S.topicAliasSend.put(H,L),P.properties=wt(bt({},P.properties),{topicAlias:L}),f("applyTopicAlias :: auto assign topic: %s - alias: %d",H,L))):S.options.autoUseTopicAlias&&(L=S.topicAliasSend.getAliasByTopic(H),L&&(P.topic="",P.properties=wt(bt({},P.properties),{topicAlias:L}),f("applyTopicAlias :: auto use topic: %s - alias: %d",H,L))));else if(L)return f("applyTopicAlias :: error out of range. topic: %s - alias: %d",H,L),new Error("Sending Topic Alias out of range")}}function C(S,P){let L;P.properties&&(L=P.properties.topicAlias);let H=P.topic.toString();if(H.length===0){if(typeof L>"u")return new Error("Unregistered Topic Alias");if(H=S.topicAliasSend.getTopicByAlias(L),typeof H>"u")return new Error("Unregistered Topic Alias");P.topic=H}L&&delete P.properties.topicAlias}function V(S,P,L){f("sendPacket :: packet: %O",P),f("sendPacket :: emitting `packetsend`"),S.emit("packetsend",P),f("sendPacket :: writing to stream");let H=r.writeToStream(P,S.stream,S.options);f("sendPacket :: writeToStream result %s",H),!H&&L&&L!==ie?(f("sendPacket :: handle events on `drain` once through callback."),S.stream.once("drain",L)):L&&(f("sendPacket :: invoking cb"),L())}function B(S){S&&(f("flush: queue exists? %b",!!S),Object.keys(S).forEach(function(P){typeof S[P].cb=="function"&&(S[P].cb(new Error("Connection closed")),delete S[P])}))}function ne(S){S&&(f("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(S).forEach(function(P){S[P].volatile&&typeof S[P].cb=="function"&&(S[P].cb(new Error("Connection closed")),delete S[P])}))}function oe(S,P,L,H){f("storeAndSend :: store packet with cmd %s to outgoingStore",P.cmd);let re=P,ee;if(re.cmd==="publish"&&(re=d(P),ee=C(S,re),ee))return L&&L(ee);S.outgoingStore.put(re,function(U){if(U)return L&&L(U);H(),V(S,P,L)})}function ie(S){f("nop ::",S)}function G(S,P){let L,H=this;if(!(this instanceof G))return new G(S,P);this.options=P||{};for(L in A)typeof this.options[L]>"u"?this.options[L]=A[L]:this.options[L]=P[L];f("MqttClient :: options.protocol",P.protocol),f("MqttClient :: options.protocolVersion",P.protocolVersion),f("MqttClient :: options.username",P.username),f("MqttClient :: options.keepalive",P.keepalive),f("MqttClient :: options.reconnectPeriod",P.reconnectPeriod),f("MqttClient :: options.rejectUnauthorized",P.rejectUnauthorized),f("MqttClient :: options.topicAliasMaximum",P.topicAliasMaximum),this.options.clientId=typeof P.clientId=="string"?P.clientId:x(),f("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=P.protocolVersion===5&&P.customHandleAcks?P.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=S,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new e:this.options.messageIdProvider,this.outgoingStore=P.outgoingStore||new c,this.incomingStore=P.incomingStore||new c,this.queueQoSZero=P.queueQoSZero===void 0?!0:P.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,P.topicAliasMaximum>0&&(P.topicAliasMaximum>65535?f("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new o(P.topicAliasMaximum)),this.on("connect",function(){let re=this.queue;function ee(){let W=re.shift();f("deliver :: entry %o",W);let U=null;if(!W){H._resubscribe();return}U=W.packet,f("deliver :: call _sendPacket for %o",U);let X=!0;U.messageId&&U.messageId!==0&&(H.messageIdProvider.register(U.messageId)||(X=!1)),X?H._sendPacket(U,function($){W.cb&&W.cb($),ee()}):(f("messageId: %d has already used. The message is skipped and removed.",U.messageId),ee())}f("connect :: sending queued packets"),ee()}),this.on("close",function(){f("close :: connected set to `false`"),this.connected=!1,f("close :: clearing connackTimer"),clearTimeout(this.connackTimer),f("close :: clearing ping timer"),H.pingTimer!==null&&(H.pingTimer.clear(),H.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),f("close :: calling _setupReconnect"),this._setupReconnect()}),y.call(this),f("MqttClient :: setting up stream"),this._setupStream()}s(G,y),G.prototype._setupStream=function(){let S=this,P=new t,L=r.parser(this.options),H=null,re=[];f("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),f("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),L.on("packet",function($){f("parser :: on packet push to packets array."),re.push($)});function ee(){if(re.length)E(W);else{let $=H;H=null,$()}}function W(){f("work :: getting next packet in queue");let $=re.shift();if($)f("work :: packet pulled from queue"),S._handlePacket($,ee);else{f("work :: no packets in queue");let le=H;H=null,f("work :: done flag is %s",!!le),le&&le()}}P._write=function($,le,Z){H=Z,f("writable stream :: parsing buffer"),L.parse($),W()};function U($){f("streamErrorHandler :: error",$.message),z.includes($.code)?(f("streamErrorHandler :: emitting error"),S.emit("error",$)):ie($)}f("_setupStream :: pipe stream to writable stream"),this.stream.pipe(P),this.stream.on("error",U),this.stream.on("close",function(){f("(%s)stream :: on close",S.options.clientId),ne(S.outgoing),f("stream: emit close to MqttClient"),S.emit("close")}),f("_setupStream: sending packet `connect`");let X=Object.create(this.options);if(X.cmd="connect",this.topicAliasRecv&&(X.properties||(X.properties={}),this.topicAliasRecv&&(X.properties.topicAliasMaximum=this.topicAliasRecv.max)),V(this,X),L.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return S.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let $=_({cmd:"auth",reasonCode:0},this.options.authPacket);V(this,$)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){f("!!connectTimeout hit!! Calling _cleanUp with force `true`"),S._cleanUp(!0)},this.options.connectTimeout)},G.prototype._handlePacket=function(S,P){let L=this.options;if(L.protocolVersion===5&&L.properties&&L.properties.maximumPacketSize&&L.properties.maximumPacketSize0||!U())&&this._storeProcessingQueue.push({invoke:U,cbStorePut:L.cbStorePut,callback:H}),this},G.prototype.subscribe=function(){let S=this,P=new Array(arguments.length);for(let Z=0;Z0){let te={qos:Q.qos};U===5&&(te.nl=Q.nl||!1,te.rap=Q.rap||!1,te.rh=Q.rh||0,te.properties=Q.properties),S._resubscribeTopics[Q.topic]=te,k.push(Q.topic)}}),S.messageIdToTopic[F.messageId]=k}return S.outgoing[F.messageId]={volatile:!0,cb:function(k,Q){if(!k){let te=Q.granted;for(let R=0;R0||!le())&&this._storeProcessingQueue.push({invoke:le,callback:ee}),this},G.prototype.unsubscribe=function(){let S=this,P=new Array(arguments.length);for(let U=0;U0||!W())&&this._storeProcessingQueue.push({invoke:W,callback:H}),this},G.prototype.end=function(S,P,L){let H=this;f("end :: (%s)",this.options.clientId),(S==null||typeof S!="boolean")&&(L=P||ie,P=S,S=!1,typeof P!="object"&&(L=P,P=null,typeof L!="function"&&(L=ie))),typeof P!="object"&&(L=P,P=null),f("end :: cb? %s",!!L),L=L||ie;function re(){f("end :: closeStores: closing incoming and outgoing stores"),H.disconnected=!0,H.incomingStore.close(function(W){H.outgoingStore.close(function(U){if(f("end :: closeStores: emitting end"),H.emit("end"),L){let X=W||U;f("end :: closeStores: invoking callback with args"),L(X)}})}),H._deferredReconnect&&H._deferredReconnect()}function ee(){f("end :: (%s) :: finish :: calling _cleanUp with force %s",H.options.clientId,S),H._cleanUp(S,()=>{f("end :: finish :: calling process.nextTick on closeStores"),E(re.bind(H))},P)}return this.disconnecting?(L(),this):(this._clearReconnect(),this.disconnecting=!0,!S&&Object.keys(this.outgoing).length>0?(f("end :: (%s) :: calling finish in 10ms once outgoing is empty",H.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,ee,10))):(f("end :: (%s) :: immediately calling finish",H.options.clientId),ee()),this)},G.prototype.removeOutgoingMessage=function(S){let P=this.outgoing[S]?this.outgoing[S].cb:null;return delete this.outgoing[S],this.outgoingStore.del({messageId:S},function(){P(new Error("Message removed"))}),this},G.prototype.reconnect=function(S){f("client reconnect");let P=this,L=function(){S?(P.options.incomingStore=S.incomingStore,P.options.outgoingStore=S.outgoingStore):(P.options.incomingStore=null,P.options.outgoingStore=null),P.incomingStore=P.options.incomingStore||new c,P.outgoingStore=P.options.outgoingStore||new c,P.disconnecting=!1,P.disconnected=!1,P._deferredReconnect=null,P._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=L:L(),this},G.prototype._reconnect=function(){f("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),f("client already connected. disconnecting first.")):(f("_reconnect: calling _setupStream"),this._setupStream())},G.prototype._setupReconnect=function(){let S=this;!S.disconnecting&&!S.reconnectTimer&&S.options.reconnectPeriod>0?(this.reconnecting||(f("_setupReconnect :: emit `offline` state"),this.emit("offline"),f("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),f("_setupReconnect :: setting reconnectTimer for %d ms",S.options.reconnectPeriod),S.reconnectTimer=setInterval(function(){f("reconnectTimer :: reconnect triggered!"),S._reconnect()},S.options.reconnectPeriod)):f("_setupReconnect :: doing nothing...")},G.prototype._clearReconnect=function(){f("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},G.prototype._cleanUp=function(S,P){let L=arguments[2];if(P&&(f("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",P)),f("_cleanUp :: forced? %s",S),S)this.options.reconnectPeriod===0&&this.options.clean&&B(this.outgoing),f("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let H=_({cmd:"disconnect"},L);f("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(H,M.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(f("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(f("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),P&&!this.connected&&(f("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",P),P())},G.prototype._sendPacket=function(S,P,L){f("_sendPacket :: (%s) :: start",this.options.clientId),L=L||ie,P=P||ie;let H=O(this,S);if(H){P(H);return}if(!this.connected){if(S.cmd==="auth"){this._shiftPingInterval(),V(this,S,P);return}f("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(S,P,L);return}switch(this._shiftPingInterval(),S.cmd){case"publish":break;case"pubrel":oe(this,S,P,L);return;default:V(this,S,P);return}switch(S.qos){case 2:case 1:oe(this,S,P,L);break;case 0:default:V(this,S,P);break}f("_sendPacket :: (%s) :: end",this.options.clientId)},G.prototype._storePacket=function(S,P,L){f("_storePacket :: packet: %o",S),f("_storePacket :: cb? %s",!!P),L=L||ie;let H=S;if(H.cmd==="publish"){H=d(S);let re=C(this,H);if(re)return P&&P(re)}(H.qos||0)===0&&this.queueQoSZero||H.cmd!=="publish"?this.queue.push({packet:H,cb:P}):H.qos>0?(P=this.outgoing[H.messageId]?this.outgoing[H.messageId].cb:null,this.outgoingStore.put(H,function(re){if(re)return P&&P(re);L()})):P&&P(new Error("No connection to broker"))},G.prototype._setupPingTimer=function(){f("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);let S=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=u(function(){S._checkPing()},this.options.keepalive*1e3))},G.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)},G.prototype._checkPing=function(){f("_checkPing :: checking ping..."),this.pingResp?(f("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(f("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},G.prototype._handlePingresp=function(){this.pingResp=!0},G.prototype._handleConnack=function(S){f("_handleConnack");let P=this.options,H=P.protocolVersion===5?S.reasonCode:S.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,S.properties){if(S.properties.topicAliasMaximum){if(S.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}S.properties.topicAliasMaximum>0&&(this.topicAliasSend=new i(S.properties.topicAliasMaximum))}S.properties.serverKeepAlive&&P.keepalive&&(P.keepalive=S.properties.serverKeepAlive,this._shiftPingInterval()),S.properties.maximumPacketSize&&(P.properties||(P.properties={}),P.properties.maximumPacketSize=S.properties.maximumPacketSize)}if(H===0)this.reconnecting=!1,this._onConnect(S);else if(H>0){let re=new Error("Connection refused: "+j[H]);re.code=H,this.emit("error",re)}},G.prototype._handleAuth=function(S){let L=this.options.protocolVersion,H=L===5?S.reasonCode:S.returnCode;if(L!==5){let ee=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+L);ee.code=H,this.emit("error",ee);return}let re=this;this.handleAuth(S,function(ee,W){if(ee){re.emit("error",ee);return}if(H===24)re.reconnecting=!1,re._sendPacket(W);else{let U=new Error("Connection refused: "+j[H]);ee.code=H,re.emit("error",U)}})},G.prototype.handleAuth=function(S,P){P()},G.prototype._handlePublish=function(S,P){f("_handlePublish: packet %o",S),P=typeof P<"u"?P:ie;let L=S.topic.toString(),H=S.payload,re=S.qos,ee=S.messageId,W=this,U=this.options,X=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let $;if(S.properties&&($=S.properties.topicAlias),typeof $<"u")if(L.length===0)if($>0&&$<=65535){let le=this.topicAliasRecv.getTopicByAlias($);if(le)L=le,f("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",L,$);else{f("_handlePublish :: unregistered topic alias. alias: %d",$),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{f("_handlePublish :: topic alias out of range. alias: %d",$),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(L,$))f("_handlePublish :: registered topic: %s - alias: %d",L,$);else{f("_handlePublish :: topic alias out of range. alias: %d",$),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(f("_handlePublish: qos %d",re),re){case 2:{U.customHandleAcks(L,H,S,function($,le){if($ instanceof Error||(le=$,$=null),$)return W.emit("error",$);if(X.indexOf(le)===-1)return W.emit("error",new Error("Wrong reason code for pubrec"));le?W._sendPacket({cmd:"pubrec",messageId:ee,reasonCode:le},P):W.incomingStore.put(S,function(){W._sendPacket({cmd:"pubrec",messageId:ee},P)})});break}case 1:{U.customHandleAcks(L,H,S,function($,le){if($ instanceof Error||(le=$,$=null),$)return W.emit("error",$);if(X.indexOf(le)===-1)return W.emit("error",new Error("Wrong reason code for puback"));le||W.emit("message",L,H,S),W.handleMessage(S,function(Z){if(Z)return P&&P(Z);W._sendPacket({cmd:"puback",messageId:ee,reasonCode:le},P)})});break}case 0:this.emit("message",L,H,S),this.handleMessage(S,P);break;default:f("_handlePublish: unknown QoS. Doing nothing.");break}},G.prototype.handleMessage=function(S,P){P()},G.prototype._handleAck=function(S){let P=S.messageId,L=S.cmd,H=null,re=this.outgoing[P]?this.outgoing[P].cb:null,ee=this,W;if(!re){f("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(f("_handleAck :: packet type",L),L){case"pubcomp":case"puback":{let U=S.reasonCode;U&&U>0&&U!==16&&(W=new Error("Publish error: "+j[U]),W.code=U,re(W,S)),delete this.outgoing[P],this.outgoingStore.del(S,re),this.messageIdProvider.deallocate(P),this._invokeStoreProcessingQueue();break}case"pubrec":{H={cmd:"pubrel",qos:2,messageId:P};let U=S.reasonCode;U&&U>0&&U!==16?(W=new Error("Publish error: "+j[U]),W.code=U,re(W,S)):this._sendPacket(H);break}case"suback":{delete this.outgoing[P],this.messageIdProvider.deallocate(P);for(let U=0;U0)if(this.options.resubscribe)if(this.options.protocolVersion===5){f("_resubscribe: protocolVersion 5");for(let P=0;P0){let S=this._storeProcessingQueue[0];if(S&&S.invoke())return this._storeProcessingQueue.shift(),!0}return!1},G.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},G.prototype._flushStoreProcessingQueue=function(){for(let S of this._storeProcessingQueue)S.cbStorePut&&S.cbStorePut(new Error("Connection closed")),S.callback&&S.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},T.exports=G}).call(this)}).call(this,m("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"./default-message-id-provider":12,"./store":13,"./topic-alias-recv":14,"./topic-alias-send":15,"./validations":16,_process:85,debug:20,events:4,inherits:24,"mqtt-packet":48,"readable-stream":72,reinterval:73,"rfdc/default":74,xtend:82}],7:[function(m,T,v){"use strict";let{Buffer:h}=m("buffer"),p=m("readable-stream").Transform,y=m("duplexify"),c,o,i,r=!1;function e(){let g=new p;return g._write=function(_,f,E){c.sendSocketMessage({data:_.buffer,success:function(){E()},fail:function(){E(new Error)}})},g._flush=function(f){c.closeSocket({success:function(){f()}})},g}function t(g){g.hostname||(g.hostname="localhost"),g.path||(g.path="/"),g.wsOptions||(g.wsOptions={})}function s(g,_){let f=g.protocol==="alis"?"wss":"ws",E=f+"://"+g.hostname+g.path;return g.port&&g.port!==80&&g.port!==443&&(E=f+"://"+g.hostname+":"+g.port+g.path),typeof g.transformWsUrl=="function"&&(E=g.transformWsUrl(E,g,_)),E}function u(){r||(r=!0,c.onSocketOpen(function(){i.setReadable(o),i.setWritable(o),i.emit("connect")}),c.onSocketMessage(function(g){if(typeof g.data=="string"){let _=h.from(g.data,"base64");o.push(_)}else{let _=new FileReader;_.addEventListener("load",function(){let f=_.result;f instanceof ArrayBuffer?f=h.from(f):f=h.from(f,"utf8"),o.push(f)}),_.readAsArrayBuffer(g.data)}}),c.onSocketClose(function(){i.end(),i.destroy()}),c.onSocketError(function(g){i.destroy(g)}))}function d(g,_){if(_.hostname=_.hostname||_.host,!_.hostname)throw new Error("Could not determine host. Specify host manually.");let f=_.protocolId==="MQIsdp"&&_.protocolVersion===3?"mqttv3.1":"mqtt";t(_);let E=s(_,g);return c=_.my,c.connectSocket({url:E,protocols:f}),o=e(),i=y.obj(),u(),i}T.exports=d},{buffer:3,duplexify:22,"readable-stream":72}],8:[function(m,T,v){"use strict";let h=m("net"),p=m("debug")("mqttjs:tcp");function y(c,o){o.port=o.port||1883,o.hostname=o.hostname||o.host||"localhost";let i=o.port,r=o.hostname;return p("port %d and host %s",i,r),h.createConnection(i,r)}T.exports=y},{debug:20,net:2}],9:[function(m,T,v){"use strict";let h=m("tls"),p=m("net"),y=m("debug")("mqttjs:tls");function c(o,i){i.port=i.port||8883,i.host=i.hostname||i.host||"localhost",p.isIP(i.host)===0&&(i.servername=i.host),i.rejectUnauthorized=i.rejectUnauthorized!==!1,delete i.path,y("port %d host %s rejectUnauthorized %b",i.port,i.host,i.rejectUnauthorized);let r=h.connect(i);r.on("secureConnect",function(){i.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",e)});function e(t){i.rejectUnauthorized&&o.emit("error",t),r.end()}return r.on("error",e),r}T.exports=c},{debug:20,net:2,tls:2}],10:[function(m,T,v){(function(h){(function(){"use strict";let{Buffer:p}=m("buffer"),y=m("ws"),c=m("debug")("mqttjs:ws"),o=m("duplexify"),i=m("readable-stream").Transform,r=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],e=typeof h<"u"&&h.title==="browser"||typeof __webpack_require__=="function";function t(E,M){let A=E.protocol+"://"+E.hostname+":"+E.port+E.path;return typeof E.transformWsUrl=="function"&&(A=E.transformWsUrl(A,E,M)),A}function s(E){let M=E;return E.hostname||(M.hostname="localhost"),E.port||(E.protocol==="wss"?M.port=443:M.port=80),E.path||(M.path="/"),E.wsOptions||(M.wsOptions={}),!e&&E.protocol==="wss"&&r.forEach(function(A){Object.prototype.hasOwnProperty.call(E,A)&&!Object.prototype.hasOwnProperty.call(E.wsOptions,A)&&(M.wsOptions[A]=E[A])}),M}function u(E){let M=s(E);if(M.hostname||(M.hostname=M.host),!M.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let A=new URL(document.URL);M.hostname=A.hostname,M.port||(M.port=A.port)}return M.objectMode===void 0&&(M.objectMode=!(M.binary===!0||M.binary===void 0)),M}function d(E,M,A){c("createWebSocket"),c("protocol: "+A.protocolId+" "+A.protocolVersion);let z=A.protocolId==="MQIsdp"&&A.protocolVersion===3?"mqttv3.1":"mqtt";return c("creating new Websocket for url: "+M+" and protocol: "+z),new y(M,[z],A.wsOptions)}function g(E,M){let A=M.protocolId==="MQIsdp"&&M.protocolVersion===3?"mqttv3.1":"mqtt",z=t(M,E),j=new WebSocket(z,[A]);return j.binaryType="arraybuffer",j}function _(E,M){c("streamBuilder");let A=s(M),z=t(A,E),j=d(E,z,A),x=y.createWebSocketStream(j,A.wsOptions);return x.url=z,j.on("close",()=>{x.destroy()}),x}function f(E,M){c("browserStreamBuilder");let A,j=u(M).browserBufferSize||1024*512,x=M.browserBufferTimeout||1e3,O=!M.objectMode,C=g(E,M),V=ne(M,L,H);M.objectMode||(V._writev=P),V.on("close",()=>{C.close()});let B=typeof C.addEventListener<"u";C.readyState===C.OPEN?A=V:(A=A=o(void 0,void 0,M),M.objectMode||(A._writev=P),B?C.addEventListener("open",oe):C.onopen=oe),A.socket=C,B?(C.addEventListener("close",ie),C.addEventListener("error",G),C.addEventListener("message",S)):(C.onclose=ie,C.onerror=G,C.onmessage=S);function ne(re,ee,W){let U=new i({objectModeMode:re.objectMode});return U._write=ee,U._flush=W,U}function oe(){A.setReadable(V),A.setWritable(V),A.emit("connect")}function ie(){A.end(),A.destroy()}function G(re){A.destroy(re)}function S(re){let ee=re.data;ee instanceof ArrayBuffer?ee=p.from(ee):ee=p.from(ee,"utf8"),V.push(ee)}function P(re,ee){let W=new Array(re.length);for(let U=0;Uj&&setTimeout(L,x,re,ee,W),O&&typeof re=="string"&&(re=p.from(re,"utf8"));try{C.send(re)}catch(U){return W(U)}W()}function H(re){C.close(),re()}return A}e?T.exports=f:T.exports=_}).call(this)}).call(this,m("_process"))},{_process:85,buffer:3,debug:20,duplexify:22,"readable-stream":72,ws:81}],11:[function(m,T,v){"use strict";let{Buffer:h}=m("buffer"),p=m("readable-stream").Transform,y=m("duplexify"),c,o,i;function r(){let d=new p;return d._write=function(g,_,f){c.send({data:g.buffer,success:function(){f()},fail:function(E){f(new Error(E))}})},d._flush=function(_){c.close({success:function(){_()}})},d}function e(d){d.hostname||(d.hostname="localhost"),d.path||(d.path="/"),d.wsOptions||(d.wsOptions={})}function t(d,g){let _=d.protocol==="wxs"?"wss":"ws",f=_+"://"+d.hostname+d.path;return d.port&&d.port!==80&&d.port!==443&&(f=_+"://"+d.hostname+":"+d.port+d.path),typeof d.transformWsUrl=="function"&&(f=d.transformWsUrl(f,d,g)),f}function s(){c.onOpen(function(){i.setReadable(o),i.setWritable(o),i.emit("connect")}),c.onMessage(function(d){let g=d.data;g instanceof ArrayBuffer?g=h.from(g):g=h.from(g,"utf8"),o.push(g)}),c.onClose(function(){i.end(),i.destroy()}),c.onError(function(d){i.destroy(new Error(d.errMsg))})}function u(d,g){if(g.hostname=g.hostname||g.host,!g.hostname)throw new Error("Could not determine host. Specify host manually.");let _=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt";e(g);let f=t(g,d);c=wx.connectSocket({url:f,protocols:[_]}),o=r(),i=y.obj(),i._destroy=function(M,A){c.close({success:function(){A&&A(M)}})};let E=i.destroy;return i.destroy=(function(){i.destroy=E;let M=this;setTimeout(function(){c.close({fail:function(){M._destroy(new Error)}})},0)}).bind(i),s(),i}T.exports=u},{buffer:3,duplexify:22,"readable-stream":72}],12:[function(m,T,v){"use strict";function h(){if(!(this instanceof h))return new h;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}h.prototype.allocate=function(){let p=this.nextId++;return this.nextId===65536&&(this.nextId=1),p},h.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},h.prototype.register=function(p){return!0},h.prototype.deallocate=function(p){},h.prototype.clear=function(){},T.exports=h},{}],13:[function(m,T,v){"use strict";let h=m("xtend"),p=m("readable-stream").Readable,y={objectMode:!0},c={clean:!0};function o(i){if(!(this instanceof o))return new o(i);this.options=i||{},this.options=h(c,i),this._inflights=new Map}o.prototype.put=function(i,r){return this._inflights.set(i.messageId,i),r&&r(),this},o.prototype.createStream=function(){let i=new p(y),r=[],e=!1,t=0;return this._inflights.forEach(function(s,u){r.push(s)}),i._read=function(){!e&&tthis.max?!1:(this.aliasToTopic[y]=p,this.length=Object.keys(this.aliasToTopic).length,!0)},h.prototype.getTopicByAlias=function(p){return this.aliasToTopic[p]},h.prototype.clear=function(){this.aliasToTopic={}},T.exports=h},{}],15:[function(m,T,v){"use strict";let h=m("lru-cache"),p=m("number-allocator").NumberAllocator;function y(c){if(!(this instanceof y))return new y(c);c>0&&(this.aliasToTopic=new h({max:c}),this.topicToAlias={},this.numberAllocator=new p(1,c),this.max=c,this.length=0)}y.prototype.put=function(c,o){if(o===0||o>this.max)return!1;let i=this.aliasToTopic.get(o);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(o,c),this.topicToAlias[c]=o,this.numberAllocator.use(o),this.length=this.aliasToTopic.length,!0},y.prototype.getTopicByAlias=function(c){return this.aliasToTopic.get(c)},y.prototype.getAliasByTopic=function(c){let o=this.topicToAlias[c];return typeof o<"u"&&this.aliasToTopic.get(o),o},y.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},y.prototype.getLruAlias=function(){let c=this.numberAllocator.firstVacant();return c||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},T.exports=y},{"lru-cache":45,"number-allocator":54}],16:[function(m,T,v){"use strict";function h(y){let c=y.split("/");for(let o=0;othis.length||o<0)return;let i=this._offset(o);return this._bufs[i[0]][i[1]]},y.prototype.slice=function(o,i){return typeof o=="number"&&o<0&&(o+=this.length),typeof i=="number"&&i<0&&(i+=this.length),this.copy(null,0,o,i)},y.prototype.copy=function(o,i,r,e){if((typeof r!="number"||r<0)&&(r=0),(typeof e!="number"||e>this.length)&&(e=this.length),r>=this.length||e<=0)return o||h.alloc(0);let t=!!o,s=this._offset(r),u=e-r,d=u,g=t&&i||0,_=s[1];if(r===0&&e===this.length){if(!t)return this._bufs.length===1?this._bufs[0]:h.concat(this._bufs,this.length);for(let f=0;fE)this._bufs[f].copy(o,g,_),g+=E;else{this._bufs[f].copy(o,g,_,_+d),g+=E;break}d-=E,_&&(_=0)}return o.length>g?o.slice(0,g):o},y.prototype.shallowSlice=function(o,i){if(o=o||0,i=typeof i!="number"?this.length:i,o<0&&(o+=this.length),i<0&&(i+=this.length),o===i)return this._new();let r=this._offset(o),e=this._offset(i),t=this._bufs.slice(r[0],e[0]+1);return e[1]===0?t.pop():t[t.length-1]=t[t.length-1].slice(0,e[1]),r[1]!==0&&(t[0]=t[0].slice(r[1])),this._new(t)},y.prototype.toString=function(o,i,r){return this.slice(i,r).toString(o)},y.prototype.consume=function(o){if(o=Math.trunc(o),Number.isNaN(o)||o<=0)return this;for(;this._bufs.length;)if(o>=this._bufs[0].length)o-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(o),this.length-=o;break}return this},y.prototype.duplicate=function(){let o=this._new();for(let i=0;ithis.length?this.length:o;let r=this._offset(o),e=r[0],t=r[1];for(;e=c.length){let d=s.indexOf(c,t);if(d!==-1)return this._reverseOffset([e,d]);t=s.length-c.length+1}else{let d=this._reverseOffset([e,t]);if(this._match(d,c))return d;t++}t=0}return-1},y.prototype._match=function(c,o){if(this.length-c{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),v.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function p(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function y(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+T.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let s=0,u=0;e[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(s++,d==="%c"&&(u=s))}),e.splice(u,0,t)}v.log=console.debug||console.log||(()=>{});function c(e){try{e?v.storage.setItem("debug",e):v.storage.removeItem("debug")}catch{}}function o(){let e;try{e=v.storage.getItem("debug")}catch{}return!e&&typeof h<"u"&&"env"in h&&(e=h.env.DEBUG),e}function i(){try{return localStorage}catch{}}T.exports=m("./common")(v);let{formatters:r}=T.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this)}).call(this,m("_process"))},{"./common":21,_process:85}],21:[function(m,T,v){function h(p){c.debug=c,c.default=c,c.coerce=s,c.disable=r,c.enable=i,c.enabled=e,c.humanize=m("ms"),c.destroy=u,Object.keys(p).forEach(d=>{c[d]=p[d]}),c.names=[],c.skips=[],c.formatters={};function y(d){let g=0;for(let _=0;_{if(V==="%%")return"%";O++;let ne=c.formatters[B];if(typeof ne=="function"){let oe=A[O];V=ne.call(z,oe),A.splice(O,1),O--}return V}),c.formatArgs.call(z,A),(z.log||c.log).apply(z,A)}return M.namespace=d,M.useColors=c.useColors(),M.color=c.selectColor(d),M.extend=o,M.destroy=c.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(f!==c.namespaces&&(f=c.namespaces,E=c.enabled(d)),E),set:A=>{_=A}}),typeof c.init=="function"&&c.init(M),M}function o(d,g){let _=c(this.namespace+(typeof g>"u"?":":g)+d);return _.log=this.log,_}function i(d){c.save(d),c.namespaces=d,c.names=[],c.skips=[];let g,_=(typeof d=="string"?d:"").split(/[\s,]+/),f=_.length;for(g=0;g"-"+g)].join(",");return c.enable(""),d}function e(d){if(d[d.length-1]==="*")return!0;let g,_;for(g=0,_=c.skips.length;g<_;g++)if(c.skips[g].test(d))return!1;for(g=0,_=c.names.length;g<_;g++)if(c.names[g].test(d))return!0;return!1}function t(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function s(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return c.enable(c.load()),c}T.exports=h},{ms:53}],22:[function(m,T,v){(function(h,p){(function(){var y=m("readable-stream"),c=m("end-of-stream"),o=m("inherits"),i=m("stream-shift"),r=p.from&&p.from!==Uint8Array.from?p.from([0]):new p([0]),e=function(f,E){f._corked?f.once("uncork",E):E()},t=function(f,E){f._autoDestroy&&f.destroy(E)},s=function(f,E){return function(M){M?t(f,M.message==="premature close"?null:M):E&&!f._ended&&f.end()}},u=function(f,E){if(!f||f._writableState&&f._writableState.finished)return E();if(f._writableState)return f.end(E);f.end(),E()},d=function(){},g=function(f){return new y.Readable({objectMode:!0,highWaterMark:16}).wrap(f)},_=function(f,E,M){if(!(this instanceof _))return new _(f,E,M);y.Duplex.call(this,M),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!M||M.autoDestroy!==!1,this._forwardDestroy=!M||M.destroy!==!1,this._forwardEnd=!M||M.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,f&&this.setWritable(f),E&&this.setReadable(E)};o(_,y.Duplex),_.obj=function(f,E,M){return M||(M={}),M.objectMode=!0,M.highWaterMark=16,new _(f,E,M)},_.prototype.cork=function(){++this._corked===1&&this.emit("cork")},_.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},_.prototype.setWritable=function(f){if(this._unwrite&&this._unwrite(),this.destroyed){f&&f.destroy&&f.destroy();return}if(f===null||f===!1){this.end();return}var E=this,M=c(f,{writable:!0,readable:!1},s(this,this._forwardEnd)),A=function(){var j=E._ondrain;E._ondrain=null,j&&j()},z=function(){E._writable.removeListener("drain",A),M()};this._unwrite&&h.nextTick(A),this._writable=f,this._writable.on("drain",A),this._unwrite=z,this.uncork()},_.prototype.setReadable=function(f){if(this._unread&&this._unread(),this.destroyed){f&&f.destroy&&f.destroy();return}if(f===null||f===!1){this.push(null),this.resume();return}var E=this,M=c(f,{writable:!1,readable:!0},s(this)),A=function(){E._forward()},z=function(){E.push(null)},j=function(){E._readable2.removeListener("readable",A),E._readable2.removeListener("end",z),M()};this._drained=!0,this._readable=f,this._readable2=f._readableState?f:g(f),this._readable2.on("readable",A),this._readable2.on("end",z),this._unread=j,this._forward()},_.prototype._read=function(){this._drained=!0,this._forward()},_.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var f;this._drained&&(f=i(this._readable2))!==null;)this.destroyed||(this._drained=this.push(f));this._forwarding=!1}},_.prototype.destroy=function(f,E){if(E||(E=d),this.destroyed)return E(null);this.destroyed=!0;var M=this;h.nextTick(function(){M._destroy(f),E(null)})},_.prototype._destroy=function(f){if(f){var E=this._ondrain;this._ondrain=null,E?E(f):this.emit("error",f)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},_.prototype._write=function(f,E,M){if(!this.destroyed){if(this._corked)return e(this,this._write.bind(this,f,E,M));if(f===r)return this._finish(M);if(!this._writable)return M();this._writable.write(f)===!1?this._ondrain=M:this.destroyed||M()}},_.prototype._finish=function(f){var E=this;this.emit("preend"),e(this,function(){u(E._forwardEnd&&E._writable,function(){E._writableState.prefinished===!1&&(E._writableState.prefinished=!0),E.emit("prefinish"),e(E,f)})})},_.prototype.end=function(f,E,M){return typeof f=="function"?this.end(null,null,f):typeof E=="function"?this.end(f,null,E):(this._ended=!0,f&&this.write(f),!this._writableState.ending&&!this._writableState.destroyed&&this.write(r),y.Writable.prototype.end.call(this,M))},T.exports=_}).call(this)}).call(this,m("_process"),m("buffer").Buffer)},{_process:85,buffer:3,"end-of-stream":23,inherits:24,"readable-stream":72,"stream-shift":77}],23:[function(m,T,v){(function(h){(function(){var p=m("once"),y=function(){},c=function(r){return r.setHeader&&typeof r.abort=="function"},o=function(r){return r.stdio&&Array.isArray(r.stdio)&&r.stdio.length===3},i=function(r,e,t){if(typeof e=="function")return i(r,null,e);e||(e={}),t=p(t||y);var s=r._writableState,u=r._readableState,d=e.readable||e.readable!==!1&&r.readable,g=e.writable||e.writable!==!1&&r.writable,_=!1,f=function(){r.writable||E()},E=function(){g=!1,d||t.call(r)},M=function(){d=!1,g||t.call(r)},A=function(C){t.call(r,C?new Error("exited with error code: "+C):null)},z=function(C){t.call(r,C)},j=function(){h.nextTick(x)},x=function(){if(!_){if(d&&!(u&&u.ended&&!u.destroyed))return t.call(r,new Error("premature close"));if(g&&!(s&&s.ended&&!s.destroyed))return t.call(r,new Error("premature close"))}},O=function(){r.req.on("finish",E)};return c(r)?(r.on("complete",E),r.on("abort",j),r.req?O():r.on("request",O)):g&&!s&&(r.on("end",f),r.on("close",f)),o(r)&&r.on("exit",A),r.on("end",M),r.on("finish",E),e.error!==!1&&r.on("error",z),r.on("close",j),function(){_=!0,r.removeListener("complete",E),r.removeListener("abort",j),r.removeListener("request",O),r.req&&r.req.removeListener("finish",E),r.removeListener("end",f),r.removeListener("close",f),r.removeListener("finish",E),r.removeListener("exit",A),r.removeListener("end",M),r.removeListener("error",z),r.removeListener("close",j)}};T.exports=i}).call(this)}).call(this,m("_process"))},{_process:85,once:56}],24:[function(m,T,v){typeof Object.create=="function"?T.exports=function(p,y){y&&(p.super_=y,p.prototype=Object.create(y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}))}:T.exports=function(p,y){if(y){p.super_=y;var c=function(){};c.prototype=y.prototype,p.prototype=new c,p.prototype.constructor=p}}},{}],25:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.ContainerIterator=v.Container=v.Base=void 0;class h{constructor(o=0){this.iteratorType=o}equals(o){return this.o===o.o}}v.ContainerIterator=h;class p{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}}v.Base=p;class y extends p{}v.Container=y},{}],26:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.HashContainerIterator=v.HashContainer=void 0;var h=m("../../ContainerBase"),p=c(m("../../../utils/checkObject")),y=m("../../../utils/throwError");function c(r){return r&&r.t?r:{default:r}}class o extends h.ContainerIterator{constructor(e,t,s){super(s),this.o=e,this.h=t,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,y.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,y.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,y.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,y.throwIteratorAccessError)(),this.o=this.o.L,this})}}v.HashContainerIterator=o;class i extends h.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:t,B:s}=e;t.B=s,s.L=t,e===this.p&&(this.p=s),e===this._&&(this._=t),this.i-=1}M(e,t,s){s===void 0&&(s=(0,p.default)(e));let u;if(s){let d=e[this.HASH_TAG];if(d!==void 0)return this.H[d].l=t,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),u={u:e,l:t,L:this._,B:this.h},this.H.push(u)}else{let d=this.g[e];if(d)return d.l=t,this.i;u={u:e,l:t,L:this._,B:this.h},this.g[e]=u}return this.i===0?(this.p=u,this.h.B=u):this._.B=u,this._=u,this.h.L=u,++this.i}I(e,t){if(t===void 0&&(t=(0,p.default)(e)),t){let s=e[this.HASH_TAG];return s===void 0?this.h:this.H[s]}else return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(t){delete t.u[e]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,t){let s;if(t===void 0&&(t=(0,p.default)(e)),t){let u=e[this.HASH_TAG];if(u===void 0)return!1;delete e[this.HASH_TAG],s=this.H[u],delete this.H[u]}else{if(s=this.g[e],s===void 0)return!1;delete this.g[e]}return this.V(s),!0}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,y.throwIteratorAccessError)(),this.V(t),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}}v.HashContainer=i},{"../../../utils/checkObject":43,"../../../utils/throwError":44,"../../ContainerBase":25}],27:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var h=m("./Base"),p=c(m("../../utils/checkObject")),y=m("../../utils/throwError");function c(e){return e&&e.t?e:{default:e}}class o extends h.HashContainerIterator{constructor(t,s,u,d){super(t,s,d),this.container=u}get pointer(){this.o===this.h&&(0,y.throwIteratorAccessError)();let t=this;return new Proxy([],{get(s,u){if(u==="0")return t.o.u;if(u==="1")return t.o.l},set(s,u,d){if(u!=="1")throw new TypeError("props must be 1");return t.o.l=d,!0}})}copy(){return new o(this.o,this.h,this.container,this.iteratorType)}}class i extends h.HashContainer{constructor(t=[]){super();let s=this;t.forEach(function(u){s.setElement(u[0],u[1])})}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(t,s,u){return this.M(t,s,u)}getElementByKey(t,s){if(s===void 0&&(s=(0,p.default)(t)),s){let d=t[this.HASH_TAG];return d!==void 0?this.H[d].l:void 0}let u=this.g[t];return u?u.l:void 0}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return[s.u,s.l]}find(t,s){let u=this.I(t,s);return new o(u,this.h,this)}forEach(t){let s=0,u=this.p;for(;u!==this.h;)t([u.u,u.l],s++,this),u=u.B}[Symbol.iterator](){return(function*(){let t=this.p;for(;t!==this.h;)yield[t.u,t.l],t=t.B}).bind(this)()}}var r=i;v.default=r},{"../../utils/checkObject":43,"../../utils/throwError":44,"./Base":26}],28:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var h=m("./Base"),p=m("../../utils/throwError");class y extends h.HashContainerIterator{constructor(r,e,t,s){super(r,e,s),this.container=t}get pointer(){return this.o===this.h&&(0,p.throwIteratorAccessError)(),this.o.u}copy(){return new y(this.o,this.h,this.container,this.iteratorType)}}class c extends h.HashContainer{constructor(r=[]){super();let e=this;r.forEach(function(t){e.insert(t)})}begin(){return new y(this.p,this.h,this)}end(){return new y(this.h,this.h,this)}rBegin(){return new y(this._,this.h,this,1)}rEnd(){return new y(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(r,e){return this.M(r,void 0,e)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e=this.p;for(;r--;)e=e.B;return e.u}find(r,e){let t=this.I(r,e);return new y(t,this.h,this)}forEach(r){let e=0,t=this.p;for(;t!==this.h;)r(t.u,e++,this),t=t.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}}var o=c;v.default=o},{"../../utils/throwError":44,"./Base":26}],29:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var h=m("../ContainerBase");class p extends h.Base{constructor(o=[],i=function(e,t){return e>t?-1:e>1;for(let t=this.i-1>>1;t>=0;--t)this.k(t,e)}m(o){let i=this.C[o];for(;o>0;){let r=o-1>>1,e=this.C[r];if(this.v(e,i)<=0)break;this.C[o]=e,o=r}this.C[o]=i}k(o,i){let r=this.C[o];for(;o0&&(e=t,s=this.C[t]),this.v(s,r)>=0)break;this.C[o]=s,o=e}this.C[o]=r}clear(){this.i=0,this.C.length=0}push(o){this.C.push(o),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let o=this.C[0],i=this.C.pop();return this.i-=1,this.i&&(this.C[0]=i,this.k(0,this.i>>1)),o}top(){return this.C[0]}find(o){return this.C.indexOf(o)>=0}remove(o){let i=this.C.indexOf(o);return i<0?!1:(i===0?this.pop():i===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(i,1,this.C.pop()),this.i-=1,this.m(i),this.k(i,this.i>>1)),!0)}updateItem(o){let i=this.C.indexOf(o);return i<0?!1:(this.m(i),this.k(i,this.i>>1),!0)}toArray(){return[...this.C]}}var y=p;v.default=y},{"../ContainerBase":25}],30:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var h=m("../ContainerBase");class p extends h.Base{constructor(o=[]){super(),this.j=0,this.q=[];let i=this;o.forEach(function(r){i.push(r)})}clear(){this.q=[],this.i=this.j=0}push(o){let i=this.q.length;if(this.j/i>.5&&this.j+this.i>=i&&i>4096){let r=this.i;for(let e=0;e{if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.size=="function")return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(s/this.F),1);for(let g=0;g>1)-(u>>1),this.D=this.N=this.F-s%this.F>>1;let d=this;e.forEach(function(g){d.pushBack(g)})}T(){let e=[],t=Math.max(this.P>>1,1);for(let s=0;s>1}begin(){return new c(0,this)}end(){return new c(this.i,this)}rBegin(){return new c(this.i-1,this,1)}rEnd(){return new c(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(this.i===0)return;let e=this.A[this.j][this.D];return this.i!==1&&(this.Dthis.i-1)throw new RangeError;let{curNodeBucketIndex:t,curNodePointerIndex:s}=this.O(e);return this.A[t][s]}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:s,curNodePointerIndex:u}=this.O(e);this.A[s][u]=t}insert(e,t,s=1){if(e<0||e>this.i)throw new RangeError;if(e===0)for(;s--;)this.pushFront(t);else if(e===this.i)for(;s--;)this.pushBack(t);else{let u=[];for(let d=e;dthis.i-1)throw new RangeError;if(e===0)this.popFront();else if(e===this.i-1)this.popBack();else{let t=[];for(let u=e+1;ue;)this.popBack();return this.i}sort(e){let t=[];for(let s=0;sthis.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return s.l}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return this.V(s),this.i}eraseElementByValue(t){let s=this.p;for(;s!==this.h;)s.l===t&&this.V(s),s=s.B;return this.i}eraseElementByIterator(t){let s=t.o;return s===this.h&&(0,y.throwIteratorAccessError)(),t=t.next(),this.V(s),t}pushBack(t){return this.G(t,this._),this.i}popBack(){if(this.i===0)return;let t=this._.l;return this.V(this._),t}pushFront(t){return this.G(t,this.h),this.i}popFront(){if(this.i===0)return;let t=this.p.l;return this.V(this.p),t}setElementByPos(t,s){if(t<0||t>this.i-1)throw new RangeError;let u=this.p;for(;t--;)u=u.B;u.l=s}insert(t,s,u=1){if(t<0||t>this.i)throw new RangeError;if(u<=0)return this.i;if(t===0)for(;u--;)this.pushFront(s);else if(t===this.i)for(;u--;)this.pushBack(s);else{let d=this.p;for(let _=1;_this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let t=0;for(let s=0;sthis.i-1)throw new RangeError;this.J[e]=t}insert(e,t,s=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(s).fill(t)),this.i+=s,this.i}find(e){for(let t=0;ts?1:0},e=!1){super(),this.Y=void 0,this.v=r,e?(this.re=h.TreeNodeEnableIndex,this.M=function(t,s,u){let d=this.ne(t,s,u);if(d){let g=d.tt;for(;g!==this.h;)g.rt+=1,g=g.tt;let _=this.he(d);if(_){let{parentNode:f,grandParent:E,curNode:M}=_;f.ie(),E.ie(),M.ie()}}return this.i},this.V=function(t){let s=this.fe(t);for(;s!==this.h;)s.rt-=1,s=s.tt}):(this.re=h.TreeNode,this.M=function(t,s,u){let d=this.ne(t,s,u);return d&&this.he(d),this.i},this.V=this.fe),this.h=new this.re}X(r,e){let t=this.h;for(;r;){let s=this.v(r.u,e);if(s<0)r=r.W;else if(s>0)t=r,r=r.U;else return r}return t}Z(r,e){let t=this.h;for(;r;)this.v(r.u,e)<=0?r=r.W:(t=r,r=r.U);return t}$(r,e){let t=this.h;for(;r;){let s=this.v(r.u,e);if(s<0)t=r,r=r.W;else if(s>0)r=r.U;else return r}return t}rr(r,e){let t=this.h;for(;r;)this.v(r.u,e)<0?(t=r,r=r.W):r=r.U;return t}ue(r){for(;;){let e=r.tt;if(e===this.h)return;if(r.ee===1){r.ee=0;return}if(r===e.U){let t=e.W;if(t.ee===1)t.ee=0,e.ee=1,e===this.Y?this.Y=e.te():e.te();else if(t.W&&t.W.ee===1){t.ee=e.ee,e.ee=0,t.W.ee=0,e===this.Y?this.Y=e.te():e.te();return}else t.U&&t.U.ee===1?(t.ee=1,t.U.ee=0,t.se()):(t.ee=1,r=e)}else{let t=e.U;if(t.ee===1)t.ee=0,e.ee=1,e===this.Y?this.Y=e.se():e.se();else if(t.U&&t.U.ee===1){t.ee=e.ee,e.ee=0,t.U.ee=0,e===this.Y?this.Y=e.se():e.se();return}else t.W&&t.W.ee===1?(t.ee=1,t.W.ee=0,t.te()):(t.ee=1,r=e)}}}fe(r){if(this.i===1)return this.clear(),this.h;let e=r;for(;e.U||e.W;){if(e.W)for(e=e.W;e.U;)e=e.U;else e=e.U;[r.u,e.u]=[e.u,r.u],[r.l,e.l]=[e.l,r.l],r=e}this.h.U===e?this.h.U=e.tt:this.h.W===e&&(this.h.W=e.tt),this.ue(e);let t=e.tt;return e===t.U?t.U=void 0:t.W=void 0,this.i-=1,this.Y.ee=0,t}oe(r,e){return r===void 0?!1:this.oe(r.U,e)||e(r)?!0:this.oe(r.W,e)}he(r){for(;;){let e=r.tt;if(e.ee===0)return;let t=e.tt;if(e===t.U){let s=t.W;if(s&&s.ee===1){if(s.ee=e.ee=0,t===this.Y)return;t.ee=1,r=t;continue}else if(r===e.W){if(r.ee=0,r.U&&(r.U.tt=e),r.W&&(r.W.tt=t),e.W=r.U,t.U=r.W,r.U=e,r.W=t,t===this.Y)this.Y=r,this.h.tt=r;else{let u=t.tt;u.U===t?u.U=r:u.W=r}return r.tt=t.tt,e.tt=r,t.tt=r,t.ee=1,{parentNode:e,grandParent:t,curNode:r}}else e.ee=0,t===this.Y?this.Y=t.se():t.se(),t.ee=1}else{let s=t.U;if(s&&s.ee===1){if(s.ee=e.ee=0,t===this.Y)return;t.ee=1,r=t;continue}else if(r===e.U){if(r.ee=0,r.U&&(r.U.tt=t),r.W&&(r.W.tt=e),t.W=r.U,e.U=r.W,r.U=t,r.W=e,t===this.Y)this.Y=r,this.h.tt=r;else{let u=t.tt;u.U===t?u.U=r:u.W=r}return r.tt=t.tt,e.tt=r,t.tt=r,t.ee=1,{parentNode:e,grandParent:t,curNode:r}}else e.ee=0,t===this.Y?this.Y=t.te():t.te(),t.ee=1}return}}ne(r,e,t){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,e),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let s,u=this.h.U,d=this.v(u.u,r);if(d===0){u.l=e;return}else if(d>0)u.U=new this.re(r,e),u.U.tt=u,s=u.U,this.h.U=s;else{let g=this.h.W,_=this.v(g.u,r);if(_===0){g.l=e;return}else if(_<0)g.W=new this.re(r,e),g.W.tt=g,s=g.W,this.h.W=s;else{if(t!==void 0){let f=t.o;if(f!==this.h){let E=this.v(f.u,r);if(E===0){f.l=e;return}else if(E>0){let M=f.L(),A=this.v(M.u,r);if(A===0){M.l=e;return}else A<0&&(s=new this.re(r,e),M.W===void 0?(M.W=s,s.tt=M):(f.U=s,s.tt=f))}}}if(s===void 0)for(s=this.Y;;){let f=this.v(s.u,r);if(f>0){if(s.U===void 0){s.U=new this.re(r,e),s.U.tt=s,s=s.U;break}s=s.U}else if(f<0){if(s.W===void 0){s.W=new this.re(r,e),s.W.tt=s,s=s.W;break}s=s.W}else{s.l=e;return}}}}return this.i+=1,s}I(r,e){for(;r;){let t=this.v(r.u,e);if(t<0)r=r.W;else if(t>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,e){let t=r.o;if(t===this.h&&(0,y.throwIteratorAccessError)(),this.i===1)return t.u=e,!0;if(t===this.h.U)return this.v(t.B().u,e)>0?(t.u=e,!0):!1;if(t===this.h.W)return this.v(t.L().u,e)<0?(t.u=e,!0):!1;let s=t.L().u;if(this.v(s,e)>=0)return!1;let u=t.B().u;return this.v(u,e)<=0?!1:(t.u=e,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e=0,t=this;return this.oe(this.Y,function(s){return r===e?(t.V(s),!0):(e+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let e=this.I(this.Y,r);return e===this.h?!1:(this.V(e),!0)}eraseElementByIterator(r){let e=r.o;e===this.h&&(0,y.throwIteratorAccessError)();let t=e.W===void 0;return r.iteratorType===0?t&&r.next():(!t||e.U===void 0)&&r.next(),this.V(e),r}forEach(r){let e=0;for(let t of this)r(t,e++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e,t=0;for(let s of this){if(t===r){e=s;break}t+=1}return e}getHeight(){if(this.i===0)return 0;let r=function(e){return e?Math.max(r(e.U),r(e.W))+1:0};return r(this.Y)}}var o=c;v.default=o},{"../../../utils/throwError":44,"../../ContainerBase":25,"./TreeNode":38}],40:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var h=c(m("./Base")),p=c(m("./Base/TreeIterator")),y=m("../../utils/throwError");function c(e){return e&&e.t?e:{default:e}}class o extends p.default{constructor(t,s,u,d){super(t,s,d),this.container=u}get pointer(){this.o===this.h&&(0,y.throwIteratorAccessError)();let t=this;return new Proxy([],{get(s,u){if(u==="0")return t.o.u;if(u==="1")return t.o.l},set(s,u,d){if(u!=="1")throw new TypeError("props must be 1");return t.o.l=d,!0}})}copy(){return new o(this.o,this.h,this.container,this.iteratorType)}}class i extends h.default{constructor(t=[],s,u){super(s,u);let d=this;t.forEach(function(g){d.setElement(g[0],g[1])})}*K(t){t!==void 0&&(yield*Re(this.K(t.U)),yield[t.u,t.l],yield*Re(this.K(t.W)))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(this.i===0)return;let t=this.h.U;return[t.u,t.l]}back(){if(this.i===0)return;let t=this.h.W;return[t.u,t.l]}lowerBound(t){let s=this.X(this.Y,t);return new o(s,this.h,this)}upperBound(t){let s=this.Z(this.Y,t);return new o(s,this.h,this)}reverseLowerBound(t){let s=this.$(this.Y,t);return new o(s,this.h,this)}reverseUpperBound(t){let s=this.rr(this.Y,t);return new o(s,this.h,this)}setElement(t,s,u){return this.M(t,s,u)}find(t){let s=this.I(this.Y,t);return new o(s,this.h,this)}getElementByKey(t){return this.I(this.Y,t).l}union(t){let s=this;return t.forEach(function(u){s.setElement(u[0],u[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var r=i;v.default=r},{"../../utils/throwError":44,"./Base":39,"./Base/TreeIterator":37}],41:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var h=c(m("./Base")),p=c(m("./Base/TreeIterator")),y=m("../../utils/throwError");function c(e){return e&&e.t?e:{default:e}}class o extends p.default{constructor(t,s,u,d){super(t,s,d),this.container=u}get pointer(){return this.o===this.h&&(0,y.throwIteratorAccessError)(),this.o.u}copy(){return new o(this.o,this.h,this.container,this.iteratorType)}}class i extends h.default{constructor(t=[],s,u){super(s,u);let d=this;t.forEach(function(g){d.insert(g)})}*K(t){t!==void 0&&(yield*Re(this.K(t.U)),yield t.u,yield*Re(this.K(t.W)))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(t,s){return this.M(t,void 0,s)}find(t){let s=this.I(this.Y,t);return new o(s,this.h,this)}lowerBound(t){let s=this.X(this.Y,t);return new o(s,this.h,this)}upperBound(t){let s=this.Z(this.Y,t);return new o(s,this.h,this)}reverseLowerBound(t){let s=this.$(this.Y,t);return new o(s,this.h,this)}reverseUpperBound(t){let s=this.rr(this.Y,t);return new o(s,this.h,this)}union(t){let s=this;return t.forEach(function(u){s.insert(u)}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var r=i;v.default=r},{"../../utils/throwError":44,"./Base":39,"./Base/TreeIterator":37}],42:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),Object.defineProperty(v,"Deque",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(v,"HashMap",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(v,"HashSet",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(v,"LinkList",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(v,"OrderedMap",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(v,"OrderedSet",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(v,"PriorityQueue",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(v,"Queue",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(v,"Stack",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(v,"Vector",{enumerable:!0,get:function(){return c.default}});var h=u(m("./container/OtherContainer/Stack")),p=u(m("./container/OtherContainer/Queue")),y=u(m("./container/OtherContainer/PriorityQueue")),c=u(m("./container/SequentialContainer/Vector")),o=u(m("./container/SequentialContainer/LinkList")),i=u(m("./container/SequentialContainer/Deque")),r=u(m("./container/TreeContainer/OrderedSet")),e=u(m("./container/TreeContainer/OrderedMap")),t=u(m("./container/HashContainer/HashSet")),s=u(m("./container/HashContainer/HashMap"));function u(d){return d&&d.t?d:{default:d}}},{"./container/HashContainer/HashMap":27,"./container/HashContainer/HashSet":28,"./container/OtherContainer/PriorityQueue":29,"./container/OtherContainer/Queue":30,"./container/OtherContainer/Stack":31,"./container/SequentialContainer/Deque":34,"./container/SequentialContainer/LinkList":35,"./container/SequentialContainer/Vector":36,"./container/TreeContainer/OrderedMap":40,"./container/TreeContainer/OrderedSet":41}],43:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=h;function h(p){let y=typeof p;return y==="object"&&p!==null||y==="function"}},{}],44:[function(m,T,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.throwIteratorAccessError=h;function h(){throw new RangeError("Iterator access denied!")}},{}],45:[function(m,T,v){"use strict";let h=m("yallist"),p=Symbol("max"),y=Symbol("length"),c=Symbol("lengthCalculator"),o=Symbol("allowStale"),i=Symbol("maxAge"),r=Symbol("dispose"),e=Symbol("noDisposeOnSet"),t=Symbol("lruList"),s=Symbol("cache"),u=Symbol("updateAgeOnGet"),d=()=>1;class g{constructor(x){if(typeof x=="number"&&(x={max:x}),x||(x={}),x.max&&(typeof x.max!="number"||x.max<0))throw new TypeError("max must be a non-negative number");let O=this[p]=x.max||1/0,C=x.length||d;if(this[c]=typeof C!="function"?d:C,this[o]=x.stale||!1,x.maxAge&&typeof x.maxAge!="number")throw new TypeError("maxAge must be a number");this[i]=x.maxAge||0,this[r]=x.dispose,this[e]=x.noDisposeOnSet||!1,this[u]=x.updateAgeOnGet||!1,this.reset()}set max(x){if(typeof x!="number"||x<0)throw new TypeError("max must be a non-negative number");this[p]=x||1/0,E(this)}get max(){return this[p]}set allowStale(x){this[o]=!!x}get allowStale(){return this[o]}set maxAge(x){if(typeof x!="number")throw new TypeError("maxAge must be a non-negative number");this[i]=x,E(this)}get maxAge(){return this[i]}set lengthCalculator(x){typeof x!="function"&&(x=d),x!==this[c]&&(this[c]=x,this[y]=0,this[t].forEach(O=>{O.length=this[c](O.value,O.key),this[y]+=O.length})),E(this)}get lengthCalculator(){return this[c]}get length(){return this[y]}get itemCount(){return this[t].length}rforEach(x,O){O=O||this;for(let C=this[t].tail;C!==null;){let V=C.prev;z(this,x,C,O),C=V}}forEach(x,O){O=O||this;for(let C=this[t].head;C!==null;){let V=C.next;z(this,x,C,O),C=V}}keys(){return this[t].toArray().map(x=>x.key)}values(){return this[t].toArray().map(x=>x.value)}reset(){this[r]&&this[t]&&this[t].length&&this[t].forEach(x=>this[r](x.key,x.value)),this[s]=new Map,this[t]=new h,this[y]=0}dump(){return this[t].map(x=>f(this,x)?!1:{k:x.key,v:x.value,e:x.now+(x.maxAge||0)}).toArray().filter(x=>x)}dumpLru(){return this[t]}set(x,O,C){if(C=C||this[i],C&&typeof C!="number")throw new TypeError("maxAge must be a number");let V=C?Date.now():0,B=this[c](O,x);if(this[s].has(x)){if(B>this[p])return M(this,this[s].get(x)),!1;let ie=this[s].get(x).value;return this[r]&&(this[e]||this[r](x,ie.value)),ie.now=V,ie.maxAge=C,ie.value=O,this[y]+=B-ie.length,ie.length=B,this.get(x),E(this),!0}let ne=new A(x,O,B,V,C);return ne.length>this[p]?(this[r]&&this[r](x,O),!1):(this[y]+=ne.length,this[t].unshift(ne),this[s].set(x,this[t].head),E(this),!0)}has(x){if(!this[s].has(x))return!1;let O=this[s].get(x).value;return!f(this,O)}get(x){return _(this,x,!0)}peek(x){return _(this,x,!1)}pop(){let x=this[t].tail;return x?(M(this,x),x.value):null}del(x){M(this,this[s].get(x))}load(x){this.reset();let O=Date.now();for(let C=x.length-1;C>=0;C--){let V=x[C],B=V.e||0;if(B===0)this.set(V.k,V.v);else{let ne=B-O;ne>0&&this.set(V.k,V.v,ne)}}}prune(){this[s].forEach((x,O)=>_(this,O,!1))}}let _=(j,x,O)=>{let C=j[s].get(x);if(C){let V=C.value;if(f(j,V)){if(M(j,C),!j[o])return}else O&&(j[u]&&(C.value.now=Date.now()),j[t].unshiftNode(C));return V.value}},f=(j,x)=>{if(!x||!x.maxAge&&!j[i])return!1;let O=Date.now()-x.now;return x.maxAge?O>x.maxAge:j[i]&&O>j[i]},E=j=>{if(j[y]>j[p])for(let x=j[t].tail;j[y]>j[p]&&x!==null;){let O=x.prev;M(j,x),x=O}},M=(j,x)=>{if(x){let O=x.value;j[r]&&j[r](O.key,O.value),j[y]-=O.length,j[s].delete(O.key),j[t].removeNode(x)}};class A{constructor(x,O,C,V,B){this.key=x,this.value=O,this.length=C,this.now=V,this.maxAge=B||0}}let z=(j,x,O,C)=>{let V=O.value;f(j,V)&&(M(j,O),j[o]||(V=void 0)),V&&x.call(C,V.value,V.key,j)};T.exports=g},{yallist:84}],46:[function(m,T,v){(function(h){(function(){let p=T.exports;p.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},p.codes={};for(let c in p.types){let o=p.types[c];p.codes[o]=c}p.CMD_SHIFT=4,p.CMD_MASK=240,p.DUP_MASK=8,p.QOS_MASK=3,p.QOS_SHIFT=1,p.RETAIN_MASK=1,p.VARBYTEINT_MASK=127,p.VARBYTEINT_FIN_MASK=128,p.VARBYTEINT_MAX=268435455,p.SESSIONPRESENT_MASK=1,p.SESSIONPRESENT_HEADER=h.from([p.SESSIONPRESENT_MASK]),p.CONNACK_HEADER=h.from([p.codes.connack<[0,1].map(i=>[0,1].map(r=>{let e=h.alloc(1);return e.writeUInt8(p.codes[c]<h.from([c])),p.EMPTY={pingreq:h.from([p.codes.pingreq<<4,0]),pingresp:h.from([p.codes.pingresp<<4,0]),disconnect:h.from([p.codes.disconnect<<4,0])}}).call(this)}).call(this,m("buffer").Buffer)},{buffer:3}],47:[function(m,T,v){(function(h){(function(){let p=m("./writeToStream"),y=m("events");function c(i,r){let e=new o;return p(i,e,r),e.concat()}class o extends y{constructor(){super(),this._array=new Array(20),this._i=0}write(r){return this._array[this._i++]=r,!0}concat(){let r=0,e=new Array(this._array.length),t=this._array,s=0,u;for(u=0;u>8,0),s.writeUInt8(t&255,1),s}function i(){for(let t=0;t<65536;t++)y[t]=o(t)}function r(t){let u=0,d=0,g=h.allocUnsafe(4);do u=t%128|0,t=t/128|0,t>0&&(u=u|128),g.writeUInt8(u,d++);while(t>0&&d<4);return t>0&&(d=0),c?g.subarray(0,d):g.slice(0,d)}function e(t){let s=h.allocUnsafe(4);return s.writeUInt32BE(t,0),s}T.exports={cache:y,generateCache:i,generateNumber:o,genBufVariableByteInt:r,generate4ByteBuffer:e}}).call(this)}).call(this,m("buffer").Buffer)},{buffer:3}],50:[function(m,T,v){class h{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}T.exports=h},{}],51:[function(m,T,v){let h=m("bl"),p=m("events"),y=m("./packet"),c=m("./constants"),o=m("debug")("mqtt-packet:parser");class i extends p{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof i?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new i().parser(e)}_resetState(){o("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new y,this.error=null,this._list=h(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),o("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,o("parse: state complete. _stateCounter is now: %d",this._stateCounter),o("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return o("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0);return this.packet.cmd=c.types[e>>c.CMD_SHIFT],this.packet.retain=(e&c.RETAIN_MASK)!==0,this.packet.qos=e>>c.QOS_SHIFT&c.QOS_MASK,this.packet.dup=(e&c.DUP_MASK)!==0,o("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),o("_parseLength %d",e.value),!!e}_parsePayload(){o("_parsePayload: payload %O",this._list);let e=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return o("_parsePayload complete result: %s",e),e}_parseConnect(){o("_parseConnect");let e,t,s,u,d={},g=this.packet,_=this._parseString();if(_===null)return this._emitError(new Error("Cannot parse protocolId"));if(_!=="MQTT"&&_!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(g.protocolId=_,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(g.protocolVersion=this._list.readUInt8(this._pos),g.protocolVersion>=128&&(g.bridgeMode=!0,g.protocolVersion=g.protocolVersion-128),g.protocolVersion!==3&&g.protocolVersion!==4&&g.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(d.username=this._list.readUInt8(this._pos)&c.USERNAME_MASK,d.password=this._list.readUInt8(this._pos)&c.PASSWORD_MASK,d.will=this._list.readUInt8(this._pos)&c.WILL_FLAG_MASK,d.will&&(g.will={},g.will.retain=(this._list.readUInt8(this._pos)&c.WILL_RETAIN_MASK)!==0,g.will.qos=(this._list.readUInt8(this._pos)&c.WILL_QOS_MASK)>>c.WILL_QOS_SHIFT),g.clean=(this._list.readUInt8(this._pos)&c.CLEAN_SESSION_MASK)!==0,this._pos++,g.keepalive=this._parseNum(),g.keepalive===-1)return this._emitError(new Error("Packet too short"));if(g.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(g.properties=E)}let f=this._parseString();if(f===null)return this._emitError(new Error("Packet too short"));if(g.clientId=f,o("_parseConnect: packet.clientId: %s",g.clientId),d.will){if(g.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(g.will.properties=E)}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(g.will.topic=e,o("_parseConnect: packet.will.topic: %s",g.will.topic),t=this._parseBuffer(),t===null)return this._emitError(new Error("Cannot parse will payload"));g.will.payload=t,o("_parseConnect: packet.will.paylaod: %s",g.will.payload)}if(d.username){if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse username"));g.username=u,o("_parseConnect: packet.username: %s",g.username)}if(d.password){if(s=this._parseBuffer(),s===null)return this._emitError(new Error("Cannot parse password"));g.password=s}return this.settings=g,o("_parseConnect: complete"),g}_parseConnack(){o("_parseConnack");let e=this.packet;if(this._list.length<1)return null;if(e.sessionPresent=!!(this._list.readUInt8(this._pos++)&c.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(e.returnCode===-1||e.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}o("_parseConnack: complete")}_parsePublish(){o("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),e.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),o("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){o("_parseSubscribe");let e=this.packet,t,s,u,d,g,_,f;if(e.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(e.properties=E)}for(;this._pos=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));s=this._parseByte(),u=s&c.SUBSCRIBE_OPTIONS_QOS_MASK,_=(s>>c.SUBSCRIBE_OPTIONS_NL_SHIFT&c.SUBSCRIBE_OPTIONS_NL_MASK)!==0,g=(s>>c.SUBSCRIBE_OPTIONS_RAP_SHIFT&c.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,d=s>>c.SUBSCRIBE_OPTIONS_RH_SHIFT&c.SUBSCRIBE_OPTIONS_RH_MASK,f={topic:t,qos:u},this.settings.protocolVersion===5?(f.nl=_,f.rap=g,f.rh=d):this.settings.bridgeMode&&(f.rh=0,f.rap=!0,f.nl=!0),o("_parseSubscribe: push subscription `%s` to subscription",f),e.subscriptions.push(f)}}}_parseSuback(){o("_parseSuback");let e=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos2?(e.reasonCode=this._parseByte(),o("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)):e.reasonCode=0,e.length>3)){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return!0}_parseDisconnect(){let e=this.packet;if(o("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?e.reasonCode=this._parseByte():e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return o("_parseDisconnect result: true"),!0}_parseAuth(){o("_parseAuth");let e=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));e.reasonCode=this._parseByte();let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),o("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),e.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(o("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),s=t+this._pos;if(t===-1||s>this._list.length||s>this.packet.length)return null;let u=this._list.toString("utf8",this._pos,s);return this._pos+=t,o("_parseString: result: %s",u),u}_parseStringPair(){return o("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(e===-1||t>this._list.length||t>this.packet.length)return null;let s=this._list.slice(this._pos,t);return this._pos+=e,o("_parseBuffer: result: %o",s),s}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,o("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,o("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){o("_parseVarByteNum");let t=4,s=0,u=1,d=0,g=!1,_,f=this._pos?this._pos:0;for(;s=s&&this._emitError(new Error("Invalid variable byte integer")),f&&(this._pos+=s),g=g?e?{bytes:s,value:d}:d:!1,o("_parseVarByteNum: result: %o",g),g}_parseByte(){let e;return this._pos=4)&&(b||q))w+=h.byteLength(b)+2;else{if(I<4)return k.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(q*1===0)return k.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof Y!="number"||Y<0||Y>65535||Y%1!==0)return k.emit("error",new Error("Invalid keepalive")),!1;if(w+=2,w+=1,I===5){var D=W(k,a);if(!D)return!1;w+=D.length}if(N){if(typeof N!="object")return k.emit("error",new Error("Invalid will")),!1;if(!N.topic||typeof N.topic!="string")return k.emit("error",new Error("Invalid will topic")),!1;if(w+=h.byteLength(N.topic)+2,w+=2,N.payload)if(N.payload.length>=0)typeof N.payload=="string"?w+=h.byteLength(N.payload):w+=N.payload.length;else return k.emit("error",new Error("Invalid will payload")),!1;var K={};if(I===5){if(K=W(k,N.properties),!K)return!1;w+=K.length}}let J=!1;if(l!=null)if(Z(l))J=!0,w+=h.byteLength(l)+2;else return k.emit("error",new Error("Invalid username")),!1;if(n!=null){if(!J)return k.emit("error",new Error("Username is required to use password")),!1;if(Z(n))w+=le(n)+2;else return k.emit("error",new Error("Invalid password")),!1}k.write(p.CONNECT_HEADER),G(k,w),ee(k,R),te.bridgeMode&&(I+=128),k.write(I===131?p.VERSION131:I===132?p.VERSION132:I===4?p.VERSION4:I===5?p.VERSION5:p.VERSION3);let ue=0;return ue|=l!=null?p.USERNAME_MASK:0,ue|=n!=null?p.PASSWORD_MASK:0,ue|=N&&N.retain?p.WILL_RETAIN_MASK:0,ue|=N&&N.qos?N.qos<0&&g(k,b),a?.write(),r("publish: payload: %o",Y),k.write(Y)}function j(F,k,Q){let te=Q?Q.protocolVersion:4,R=F||{},I=R.cmd||"puback",N=R.messageId,q=R.dup&&I==="pubrel"?p.DUP_MASK:0,Y=0,b=R.reasonCode,l=R.properties,n=te===5?3:2;if(I==="pubrel"&&(Y=1),typeof N!="number")return k.emit("error",new Error("Invalid messageId")),!1;let a=null;if(te===5&&typeof l=="object"){if(a=U(k,l,Q,n),!a)return!1;n+=a.length}return k.write(p.ACKS[I][Y][q][0]),G(k,n),g(k,N),te===5&&k.write(h.from([b])),a!==null&&a.write(),!0}function x(F,k,Q){r("subscribe: packet: ");let te=Q?Q.protocolVersion:4,R=F||{},I=R.dup?p.DUP_MASK:0,N=R.messageId,q=R.subscriptions,Y=R.properties,b=0;if(typeof N!="number")return k.emit("error",new Error("Invalid messageId")),!1;b+=2;let l=null;if(te===5){if(l=W(k,Y),!l)return!1;b+=l.length}if(typeof q=="object"&&q.length)for(let a=0;a2)return k.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}b+=h.byteLength(w)+2+1}else return k.emit("error",new Error("Invalid subscriptions")),!1;r("subscribe: writing to stream: %o",p.SUBSCRIBE_HEADER),k.write(p.SUBSCRIBE_HEADER[1][I?1:0][0]),G(k,b),g(k,N),l!==null&&l.write();let n=!0;for(let a of q){let w=a.topic,D=a.qos,K=+a.nl,J=+a.rap,ue=a.rh,ce;S(k,w),ce=p.SUBSCRIBE_OPTIONS_QOS[D],te===5&&(ce|=K?p.SUBSCRIBE_OPTIONS_NL:0,ce|=J?p.SUBSCRIBE_OPTIONS_RAP:0,ce|=ue?p.SUBSCRIBE_OPTIONS_RH[ue]:0),n=k.write(h.from([ce]))}return n}function O(F,k,Q){let te=Q?Q.protocolVersion:4,R=F||{},I=R.messageId,N=R.granted,q=R.properties,Y=0;if(typeof I!="number")return k.emit("error",new Error("Invalid messageId")),!1;if(Y+=2,typeof N=="object"&&N.length)for(let l=0;lp.VARBYTEINT_MAX)return F.emit("error",new Error(`Invalid variable byte integer: ${k}`)),!1;let Q=ie[k];return Q||(Q=u(k),k<16384&&(ie[k]=Q)),r("writeVarByteInt: writing to stream: %o",Q),F.write(Q)}function S(F,k){let Q=h.byteLength(k);return g(F,Q),r("writeString: %s",k),F.write(k,"utf8")}function P(F,k,Q){S(F,k),S(F,Q)}function L(F,k){return r("writeNumberCached: number: %d",k),r("writeNumberCached: %o",e[k]),F.write(e[k])}function H(F,k){let Q=t(k);return r("writeNumberGenerated: %o",Q),F.write(Q)}function re(F,k){let Q=d(k);return r("write4ByteNumber: %o",Q),F.write(Q)}function ee(F,k){typeof k=="string"?S(F,k):k?(g(F,k.length),F.write(k)):g(F,0)}function W(F,k){if(typeof k!="object"||k.length!=null)return{length:1,write(){$(F,{},0)}};let Q=0;function te(I,N){let q=p.propertiesTypes[I],Y=0;switch(q){case"byte":{if(typeof N!="boolean")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Y+=2;break}case"int8":{if(typeof N!="number"||N<0||N>255)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Y+=2;break}case"binary":{if(N&&N===null)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Y+=1+h.byteLength(N)+2;break}case"int16":{if(typeof N!="number"||N<0||N>65535)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Y+=3;break}case"int32":{if(typeof N!="number"||N<0||N>4294967295)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Y+=5;break}case"var":{if(typeof N!="number"||N<0||N>268435455)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Y+=1+h.byteLength(u(N));break}case"string":{if(typeof N!="string")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Y+=3+h.byteLength(N.toString());break}case"pair":{if(typeof N!="object")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Y+=Object.getOwnPropertyNames(N).reduce((b,l)=>{let n=N[l];return Array.isArray(n)?b+=n.reduce((a,w)=>(a+=3+h.byteLength(l.toString())+2+h.byteLength(w.toString()),a),0):b+=3+h.byteLength(l.toString())+2+h.byteLength(N[l].toString()),b},0);break}default:return F.emit("error",new Error(`Invalid property ${I}: ${N}`)),!1}return Y}if(k)for(let I in k){let N=0,q=0,Y=k[I];if(Array.isArray(Y))for(let b=0;bI;){let q=R.shift();if(q&&k[q])delete k[q],N=W(F,k);else return!1}return N}function X(F,k,Q){switch(p.propertiesTypes[k]){case"byte":{F.write(h.from([p.properties[k]])),F.write(h.from([+Q]));break}case"int8":{F.write(h.from([p.properties[k]])),F.write(h.from([Q]));break}case"binary":{F.write(h.from([p.properties[k]])),ee(F,Q);break}case"int16":{F.write(h.from([p.properties[k]])),g(F,Q);break}case"int32":{F.write(h.from([p.properties[k]])),re(F,Q);break}case"var":{F.write(h.from([p.properties[k]])),G(F,Q);break}case"string":{F.write(h.from([p.properties[k]])),S(F,Q);break}case"pair":{Object.getOwnPropertyNames(Q).forEach(R=>{let I=Q[R];Array.isArray(I)?I.forEach(N=>{F.write(h.from([p.properties[k]])),P(F,R.toString(),N.toString())}):(F.write(h.from([p.properties[k]])),P(F,R.toString(),I.toString()))});break}default:return F.emit("error",new Error(`Invalid property ${k} value: ${Q}`)),!1}}function $(F,k,Q){G(F,Q);for(let te in k)if(Object.prototype.hasOwnProperty.call(k,te)&&k[te]!==null){let R=k[te];if(Array.isArray(R))for(let I=0;I0)return r(u);if(g==="number"&&isFinite(u))return d.long?t(u):e(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var g=parseFloat(d[1]),_=(d[2]||"ms").toLowerCase();switch(_){case"years":case"year":case"yrs":case"yr":case"y":return g*i;case"weeks":case"week":case"w":return g*o;case"days":case"day":case"d":return g*c;case"hours":case"hour":case"hrs":case"hr":case"h":return g*y;case"minutes":case"minute":case"mins":case"min":case"m":return g*p;case"seconds":case"second":case"secs":case"sec":case"s":return g*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function e(u){var d=Math.abs(u);return d>=c?Math.round(u/c)+"d":d>=y?Math.round(u/y)+"h":d>=p?Math.round(u/p)+"m":d>=h?Math.round(u/h)+"s":u+"ms"}function t(u){var d=Math.abs(u);return d>=c?s(u,d,c,"day"):d>=y?s(u,d,y,"hour"):d>=p?s(u,d,p,"minute"):d>=h?s(u,d,h,"second"):u+" ms"}function s(u,d,g,_){var f=d>=g*1.5;return Math.round(u/g)+" "+_+(f?"s":"")}},{}],54:[function(m,T,v){let h=m("./lib/number-allocator.js");T.exports.NumberAllocator=h},{"./lib/number-allocator.js":55}],55:[function(m,T,v){"use strict";let h=m("js-sdsl").OrderedSet,p=m("debug")("number-allocator:trace"),y=m("debug")("number-allocator:error");function c(i,r){this.low=i,this.high=r}c.prototype.equals=function(i){return this.low===i.low&&this.high===i.high},c.prototype.compare=function(i){return this.lowe.compare(t)),p("Create"),this.clear()}o.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},o.prototype.alloc=function(){if(this.ss.size()===0)return p("alloc():empty"),null;let i=this.ss.begin(),r=i.pointer.low,e=i.pointer.high,t=r;return t+1<=e?this.ss.updateKeyByIterator(i,new c(r+1,e)):this.ss.eraseElementByPos(0),p("alloc():"+t),t},o.prototype.use=function(i){let r=new c(i,i),e=this.ss.lowerBound(r);if(!e.equals(this.ss.end())){let t=e.pointer.low,s=e.pointer.high;return e.pointer.equals(r)?(this.ss.eraseElementByIterator(e),p("use():"+i),!0):t>i?!1:t===i?(this.ss.updateKeyByIterator(e,new c(t+1,s)),p("use():"+i),!0):s===i?(this.ss.updateKeyByIterator(e,new c(t,s-1)),p("use():"+i),!0):(this.ss.updateKeyByIterator(e,new c(i+1,s)),this.ss.insert(new c(t,i-1)),p("use():"+i),!0)}return p("use():failed"),!1},o.prototype.free=function(i){if(ithis.max){y("free():"+i+" is out of range");return}let r=new c(i,i),e=this.ss.upperBound(r);if(e.equals(this.ss.end())){if(e.equals(this.ss.begin())){this.ss.insert(r);return}e.pre();let t=e.pointer.high;e.pointer.high+1===i?this.ss.updateKeyByIterator(e,new c(t,i)):this.ss.insert(r)}else if(e.equals(this.ss.begin()))if(i+1===e.pointer.low){let t=e.pointer.high;this.ss.updateKeyByIterator(e,new c(i,t))}else this.ss.insert(r);else{let t=e.pointer.low,s=e.pointer.high;e.pre();let u=e.pointer.low;e.pointer.high+1===i?i+1===t?(this.ss.eraseElementByIterator(e),this.ss.updateKeyByIterator(e,new c(u,s))):this.ss.updateKeyByIterator(e,new c(u,i)):i+1===t?(this.ss.eraseElementByIterator(e.next()),this.ss.insert(new c(i,s))):this.ss.insert(r)}p("free():"+i)},o.prototype.clear=function(){p("clear()"),this.ss.clear(),this.ss.insert(new c(this.min,this.max))},o.prototype.intervalCount=function(){return this.ss.size()},o.prototype.dump=function(){console.log("length:"+this.ss.size());for(let i of this.ss)console.log(i)},T.exports=o},{debug:20,"js-sdsl":42}],56:[function(m,T,v){var h=m("wrappy");T.exports=h(p),T.exports.strict=h(y),p.proto=p(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return p(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return y(this)},configurable:!0})});function p(c){var o=function(){return o.called?o.value:(o.called=!0,o.value=c.apply(this,arguments))};return o.called=!1,o}function y(c){var o=function(){if(o.called)throw new Error(o.onceError);return o.called=!0,o.value=c.apply(this,arguments)},i=c.name||"Function wrapped with `once`";return o.onceError=i+" shouldn't be called more than once",o.called=!1,o}},{wrappy:80}],57:[function(m,T,v){(function(h){(function(){"use strict";typeof h>"u"||!h.version||h.version.indexOf("v0.")===0||h.version.indexOf("v1.")===0&&h.version.indexOf("v1.8.")!==0?T.exports={nextTick:p}:T.exports=h;function p(y,c,o,i){if(typeof y!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,e,t;switch(r){case 0:case 1:return h.nextTick(y);case 2:return h.nextTick(function(){y.call(null,c)});case 3:return h.nextTick(function(){y.call(null,c,o)});case 4:return h.nextTick(function(){y.call(null,c,o,i)});default:for(e=new Array(r-1),t=0;t2?"one of ".concat(t," ").concat(e.slice(0,s-1).join(", "),", or ")+e[s-1]:s===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function o(e,t,s){return e.substr(!s||s<0?0:+s,t.length)===t}function i(e,t,s){return(s===void 0||s>e.length)&&(s=e.length),e.substring(s-t.length,s)===t}function r(e,t,s){return typeof s!="number"&&(s=0),s+t.length>e.length?!1:e.indexOf(t,s)!==-1}y("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),y("ERR_INVALID_ARG_TYPE",function(e,t,s){var u;typeof t=="string"&&o(t,"not ")?(u="must not be",t=t.replace(/^not /,"")):u="must be";var d;if(i(e," argument"))d="The ".concat(e," ").concat(u," ").concat(c(t,"type"));else{var g=r(e,".")?"property":"argument";d='The "'.concat(e,'" ').concat(g," ").concat(u," ").concat(c(t,"type"))}return d+=". Received type ".concat(typeof s),d},TypeError),y("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),y("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),y("ERR_STREAM_PREMATURE_CLOSE","Premature close"),y("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),y("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),y("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),y("ERR_STREAM_WRITE_AFTER_END","write after end"),y("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),y("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),y("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),T.exports.codes=p},{}],59:[function(m,T,v){(function(h){(function(){"use strict";var p=Object.keys||function(u){var d=[];for(var g in u)d.push(g);return d};T.exports=e;var y=m("./_stream_readable"),c=m("./_stream_writable");m("inherits")(e,y);for(var o=p(c.prototype),i=0;i0)if(typeof l!="string"&&!D.objectMode&&Object.getPrototypeOf(l)!==r.prototype&&(l=t(l)),a)D.endEmitted?B(b,new x):P(b,D,l,!0);else if(D.ended)B(b,new z);else{if(D.destroyed)return!1;D.reading=!1,D.decoder&&!n?(l=D.decoder.write(l),D.objectMode||l.length!==0?P(b,D,l,!1):$(b,D)):P(b,D,l,!1)}else a||(D.reading=!1,$(b,D))}return!D.ended&&(D.length=H?b=H:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function ee(b,l){return b<=0||l.length===0&&l.ended?0:l.objectMode?1:b!==b?l.flowing&&l.length?l.buffer.head.data.length:l.length:(b>l.highWaterMark&&(l.highWaterMark=re(b)),b<=l.length?b:l.ended?l.length:(l.needReadable=!0,0))}G.prototype.read=function(b){d("read",b),b=parseInt(b,10);var l=this._readableState,n=b;if(b!==0&&(l.emittedReadable=!1),b===0&&l.needReadable&&((l.highWaterMark!==0?l.length>=l.highWaterMark:l.length>0)||l.ended))return d("read: emitReadable",l.length,l.ended),l.length===0&&l.ended?N(this):U(this),null;if(b=ee(b,l),b===0&&l.ended)return l.length===0&&N(this),null;var a=l.needReadable;d("need readable",a),(l.length===0||l.length-b0?w=I(b,l):w=null,w===null?(l.needReadable=l.length<=l.highWaterMark,b=0):(l.length-=b,l.awaitDrain=0),l.length===0&&(l.ended||(l.needReadable=!0),n!==b&&l.ended&&N(this)),w!==null&&this.emit("data",w),w};function W(b,l){if(d("onEofChunk"),!l.ended){if(l.decoder){var n=l.decoder.end();n&&n.length&&(l.buffer.push(n),l.length+=l.objectMode?1:n.length)}l.ended=!0,l.sync?U(b):(l.needReadable=!1,l.emittedReadable||(l.emittedReadable=!0,X(b)))}}function U(b){var l=b._readableState;d("emitReadable",l.needReadable,l.emittedReadable),l.needReadable=!1,l.emittedReadable||(d("emitReadable",l.flowing),l.emittedReadable=!0,h.nextTick(X,b))}function X(b){var l=b._readableState;d("emitReadable_",l.destroyed,l.length,l.ended),!l.destroyed&&(l.length||l.ended)&&(b.emit("readable"),l.emittedReadable=!1),l.needReadable=!l.flowing&&!l.ended&&l.length<=l.highWaterMark,R(b)}function $(b,l){l.readingMore||(l.readingMore=!0,h.nextTick(le,b,l))}function le(b,l){for(;!l.reading&&!l.ended&&(l.length1&&Y(a.pipes,b)!==-1)&&!ce&&(d("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function he(Me){d("onerror",Me),xe(),b.removeListener("error",he),o(b,"error")===0&&B(b,Me)}oe(b,"error",he);function Ce(){b.removeListener("finish",Pe),xe()}b.once("close",Ce);function Pe(){d("onfinish"),b.removeListener("close",Ce),xe()}b.once("finish",Pe);function xe(){d("unpipe"),n.unpipe(b)}return b.emit("pipe",n),a.flowing||(d("pipe resume"),n.resume()),b};function Z(b){return function(){var n=b._readableState;d("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,n.awaitDrain===0&&o(b,"data")&&(n.flowing=!0,R(b))}}G.prototype.unpipe=function(b){var l=this._readableState,n={hasUnpiped:!1};if(l.pipesCount===0)return this;if(l.pipesCount===1)return b&&b!==l.pipes?this:(b||(b=l.pipes),l.pipes=null,l.pipesCount=0,l.flowing=!1,b&&b.emit("unpipe",this,n),this);if(!b){var a=l.pipes,w=l.pipesCount;l.pipes=null,l.pipesCount=0,l.flowing=!1;for(var D=0;D0,a.flowing!==!1&&this.resume()):b==="readable"&&!a.endEmitted&&!a.readableListening&&(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,d("on readable",a.length,a.reading),a.length?U(this):a.reading||h.nextTick(k,this)),n},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(b,l){var n=i.prototype.removeListener.call(this,b,l);return b==="readable"&&h.nextTick(F,this),n},G.prototype.removeAllListeners=function(b){var l=i.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&h.nextTick(F,this),l};function F(b){var l=b._readableState;l.readableListening=b.listenerCount("readable")>0,l.resumeScheduled&&!l.paused?l.flowing=!0:b.listenerCount("data")>0&&b.resume()}function k(b){d("readable nexttick read 0"),b.read(0)}G.prototype.resume=function(){var b=this._readableState;return b.flowing||(d("resume"),b.flowing=!b.readableListening,Q(this,b)),b.paused=!1,this};function Q(b,l){l.resumeScheduled||(l.resumeScheduled=!0,h.nextTick(te,b,l))}function te(b,l){d("resume",l.reading),l.reading||b.read(0),l.resumeScheduled=!1,b.emit("resume"),R(b),l.flowing&&!l.reading&&b.read(0)}G.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function R(b){var l=b._readableState;for(d("flow",l.flowing);l.flowing&&b.read()!==null;);}G.prototype.wrap=function(b){var l=this,n=this._readableState,a=!1;b.on("end",function(){if(d("wrapped end"),n.decoder&&!n.ended){var K=n.decoder.end();K&&K.length&&l.push(K)}l.push(null)}),b.on("data",function(K){if(d("wrapped data"),n.decoder&&(K=n.decoder.write(K)),!(n.objectMode&&K==null)&&!(!n.objectMode&&(!K||!K.length))){var J=l.push(K);J||(a=!0,b.pause())}});for(var w in b)this[w]===void 0&&typeof b[w]=="function"&&(this[w]=function(J){return function(){return b[J].apply(b,arguments)}}(w));for(var D=0;D=l.length?(l.decoder?n=l.buffer.join(""):l.buffer.length===1?n=l.buffer.first():n=l.buffer.concat(l.length),l.buffer.clear()):n=l.buffer.consume(b,l.decoder),n}function N(b){var l=b._readableState;d("endReadable",l.endEmitted),l.endEmitted||(l.ended=!0,h.nextTick(q,l,b))}function q(b,l){if(d("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,l.readable=!1,l.emit("end"),b.autoDestroy)){var n=l._writableState;(!n||n.autoDestroy&&n.finished)&&l.destroy()}}typeof Symbol=="function"&&(G.from=function(b,l){return V===void 0&&(V=m("./internal/streams/from")),V(G,b,l)});function Y(b,l){for(var n=0,a=b.length;n-1))throw new C(I);return this._writableState.defaultEncoding=I,this},Object.defineProperty(ie.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function P(R,I,N){return!R.objectMode&&R.decodeStrings!==!1&&typeof I=="string"&&(I=e.from(I,N)),I}Object.defineProperty(ie.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function L(R,I,N,q,Y,b){if(!N){var l=P(I,q,Y);q!==l&&(N=!0,Y="buffer",q=l)}var n=I.objectMode?1:q.length;I.length+=n;var a=I.length0?this.tail.next=E:this.head=E,this.tail=E,++this.length}},{key:"unshift",value:function(f){var E={data:f,next:this.head};this.length===0&&(this.tail=E),this.head=E,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var E=this.head,M=""+E.data;E=E.next;)M+=f+E.data;return M}},{key:"concat",value:function(f){if(this.length===0)return e.alloc(0);for(var E=e.allocUnsafe(f>>>0),M=this.head,A=0;M;)d(M.data,E,A),A+=M.data.length,M=M.next;return E}},{key:"consume",value:function(f,E){var M;return fz.length?z.length:f;if(j===z.length?A+=z:A+=z.slice(0,f),f-=j,f===0){j===z.length?(++M,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=z.slice(j));break}++M}return this.length-=M,A}},{key:"_getBuffer",value:function(f){var E=e.allocUnsafe(f),M=this.head,A=1;for(M.data.copy(E),f-=M.data.length;M=M.next;){var z=M.data,j=f>z.length?z.length:f;if(z.copy(E,E.length-f,0,j),f-=j,f===0){j===z.length?(++A,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=z.slice(j));break}++A}return this.length-=A,E}},{key:u,value:function(f,E){return s(this,p({},E,{depth:0,customInspect:!1}))}}]),g}()},{buffer:3,util:2}],66:[function(m,T,v){(function(h){(function(){"use strict";function p(e,t){var s=this,u=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return u||d?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,h.nextTick(i,this,e)):h.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(g){!t&&g?s._writableState?s._writableState.errorEmitted?h.nextTick(c,s):(s._writableState.errorEmitted=!0,h.nextTick(y,s,g)):h.nextTick(y,s,g):t?(h.nextTick(c,s),t(g)):h.nextTick(c,s)}),this)}function y(e,t){i(e,t),c(e)}function c(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(e,t){e.emit("error",t)}function r(e,t){var s=e._readableState,u=e._writableState;s&&s.autoDestroy||u&&u.autoDestroy?e.destroy(t):e.emit("error",t)}T.exports={destroy:p,undestroy:o,errorOrDestroy:r}}).call(this)}).call(this,m("_process"))},{_process:85}],67:[function(m,T,v){"use strict";var h=m("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function p(i){var r=!1;return function(){if(!r){r=!0;for(var e=arguments.length,t=new Array(e),s=0;s0;return e(z,x,O,function(C){M||(M=C),C&&A.forEach(t),!x&&(A.forEach(t),E(M))})});return _.reduce(s)}T.exports=d},{"../../../errors":58,"./end-of-stream":67}],70:[function(m,T,v){"use strict";var h=m("../../../errors").codes.ERR_INVALID_OPT_VALUE;function p(c,o,i){return c.highWaterMark!=null?c.highWaterMark:o?c[i]:null}function y(c,o,i,r){var e=p(o,r,i);if(e!=null){if(!(isFinite(e)&&Math.floor(e)===e)||e<0){var t=r?i:"highWaterMark";throw new h(t,e)}return Math.floor(e)}return c.objectMode?16:16*1024}T.exports={getHighWaterMark:y}},{"../../../errors":58}],71:[function(m,T,v){T.exports=m("events").EventEmitter},{events:4}],72:[function(m,T,v){v=T.exports=m("./lib/_stream_readable.js"),v.Stream=v,v.Readable=v,v.Writable=m("./lib/_stream_writable.js"),v.Duplex=m("./lib/_stream_duplex.js"),v.Transform=m("./lib/_stream_transform.js"),v.PassThrough=m("./lib/_stream_passthrough.js"),v.finished=m("./lib/internal/streams/end-of-stream.js"),v.pipeline=m("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":59,"./lib/_stream_passthrough.js":60,"./lib/_stream_readable.js":61,"./lib/_stream_transform.js":62,"./lib/_stream_writable.js":63,"./lib/internal/streams/end-of-stream.js":67,"./lib/internal/streams/pipeline.js":69}],73:[function(m,T,v){"use strict";function h(y,c,o){var i=this;this._callback=y,this._args=o,this._interval=setInterval(y,c,this._args),this.reschedule=function(r){r||(r=i._interval),i._interval&&clearInterval(i._interval),i._interval=setInterval(i._callback,r,i._args)},this.clear=function(){i._interval&&(clearInterval(i._interval),i._interval=void 0)},this.destroy=function(){i._interval&&clearInterval(i._interval),i._callback=void 0,i._interval=void 0,i._args=void 0}}function p(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var y;if(arguments.length>0){y=new Array(arguments.length-2);for(var c=0;c>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function r(A,z,j){var x=z.length-1;if(x=0?(O>0&&(A.lastNeed=O-1),O):--x=0?(O>0&&(A.lastNeed=O-2),O):--x=0?(O>0&&(O===2?O=0:A.lastNeed=O-3),O):0))}function e(A,z,j){if((z[0]&192)!==128)return A.lastNeed=0,"\uFFFD";if(A.lastNeed>1&&z.length>1){if((z[1]&192)!==128)return A.lastNeed=1,"\uFFFD";if(A.lastNeed>2&&z.length>2&&(z[2]&192)!==128)return A.lastNeed=2,"\uFFFD"}}function t(A){var z=this.lastTotal-this.lastNeed,j=e(this,A,z);if(j!==void 0)return j;if(this.lastNeed<=A.length)return A.copy(this.lastChar,z,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,z,0,A.length),this.lastNeed-=A.length}function s(A,z){var j=r(this,A,z);if(!this.lastNeed)return A.toString("utf8",z);this.lastTotal=j;var x=A.length-(j-this.lastNeed);return A.copy(this.lastChar,0,x),A.toString("utf8",z,x)}function u(A){var z=A&&A.length?this.write(A):"";return this.lastNeed?z+"\uFFFD":z}function d(A,z){if((A.length-z)%2===0){var j=A.toString("utf16le",z);if(j){var x=j.charCodeAt(j.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],j.slice(0,-1)}return j}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",z,A.length-1)}function g(A){var z=A&&A.length?this.write(A):"";if(this.lastNeed){var j=this.lastTotal-this.lastNeed;return z+this.lastChar.toString("utf16le",0,j)}return z}function _(A,z){var j=(A.length-z)%3;return j===0?A.toString("base64",z):(this.lastNeed=3-j,this.lastTotal=3,j===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",z,A.length-j))}function f(A){var z=A&&A.length?this.write(A):"";return this.lastNeed?z+this.lastChar.toString("base64",0,3-this.lastNeed):z}function E(A){return A.toString(this.encoding)}function M(A){return A&&A.length?this.write(A):""}},{"safe-buffer":76}],79:[function(m,T,v){(function(h){(function(){T.exports=p;function p(c,o){if(y("noDeprecation"))return c;var i=!1;function r(){if(!i){if(y("throwDeprecation"))throw new Error(o);y("traceDeprecation")?console.trace(o):console.warn(o),i=!0}return c.apply(this,arguments)}return r}function y(c){try{if(!h.localStorage)return!1}catch{return!1}var o=h.localStorage[c];return o==null?!1:String(o).toLowerCase()==="true"}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],80:[function(m,T,v){T.exports=h;function h(p,y){if(p&&y)return h(p)(y);if(typeof p!="function")throw new TypeError("need wrapper function");return Object.keys(p).forEach(function(o){c[o]=p[o]}),c;function c(){for(var o=new Array(arguments.length),i=0;i0)for(var e=0,t=arguments.length;e1)e=r;else if(this.head)t=this.head.next,e=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;t!==null;s++)e=i(e,t.value,s),t=t.next;return e},h.prototype.reduceReverse=function(i,r){var e,t=this.tail;if(arguments.length>1)e=r;else if(this.tail)t=this.tail.prev,e=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;t!==null;s--)e=i(e,t.value,s),t=t.prev;return e},h.prototype.toArray=function(){for(var i=new Array(this.length),r=0,e=this.head;e!==null;r++)i[r]=e.value,e=e.next;return i},h.prototype.toArrayReverse=function(){for(var i=new Array(this.length),r=0,e=this.tail;e!==null;r++)i[r]=e.value,e=e.prev;return i},h.prototype.slice=function(i,r){r=r||this.length,r<0&&(r+=this.length),i=i||0,i<0&&(i+=this.length);var e=new h;if(rthis.length&&(r=this.length);for(var t=0,s=this.head;s!==null&&tthis.length&&(r=this.length);for(var t=this.length,s=this.tail;s!==null&&t>r;t--)s=s.prev;for(;s!==null&&t>i;t--,s=s.prev)e.push(s.value);return e},h.prototype.splice=function(i,r,...e){i>this.length&&(i=this.length-1),i<0&&(i=this.length+i);for(var t=0,s=this.head;s!==null&&t1)for(var A=1;A= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=e-t,x=Math.floor,O=String.fromCharCode,C;function V(W){throw new RangeError(z[W])}function B(W,U){for(var X=W.length,$=[];X--;)$[X]=U(W[X]);return $}function ne(W,U){var X=W.split("@"),$="";X.length>1&&($=X[0]+"@",W=X[1]),W=W.replace(A,".");var le=W.split("."),Z=B(le,U).join(".");return $+Z}function oe(W){for(var U=[],X=0,$=W.length,le,Z;X<$;)le=W.charCodeAt(X++),le>=55296&&le<=56319&&X<$?(Z=W.charCodeAt(X++),(Z&64512)==56320?U.push(((le&1023)<<10)+(Z&1023)+65536):(U.push(le),X--)):U.push(le);return U}function ie(W){return B(W,function(U){var X="";return U>65535&&(U-=65536,X+=O(U>>>10&1023|55296),U=56320|U&1023),X+=O(U),X}).join("")}function G(W){return W-48<10?W-22:W-65<26?W-65:W-97<26?W-97:e}function S(W,U){return W+22+75*(W<26)-((U!=0)<<5)}function P(W,U,X){var $=0;for(W=X?x(W/d):W>>1,W+=x(W/U);W>j*s>>1;$+=e)W=x(W/j);return x($+(j+1)*W/(W+u))}function L(W){var U=[],X=W.length,$,le=0,Z=_,F=g,k,Q,te,R,I,N,q,Y,b;for(k=W.lastIndexOf(f),k<0&&(k=0),Q=0;Q=128&&V("not-basic"),U.push(W.charCodeAt(Q));for(te=k>0?k+1:0;te=X&&V("invalid-input"),q=G(W.charCodeAt(te++)),(q>=e||q>x((r-le)/I))&&V("overflow"),le+=q*I,Y=N<=F?t:N>=F+s?s:N-F,!(qx(r/b)&&V("overflow"),I*=b;$=U.length+1,F=P(le-R,$,R==0),x(le/$)>r-Z&&V("overflow"),Z+=x(le/$),le%=$,U.splice(le++,0,Z)}return ie(U)}function H(W){var U,X,$,le,Z,F,k,Q,te,R,I,N=[],q,Y,b,l;for(W=oe(W),q=W.length,U=_,X=0,Z=g,F=0;F=U&&Ix((r-X)/Y)&&V("overflow"),X+=(k-U)*Y,U=k,F=0;Fr&&V("overflow"),I==U){for(Q=X,te=e;R=te<=Z?t:te>=Z+s?s:te-Z,!(Q0&&s>t&&(s=t);for(var u=0;u=0?(_=d.substr(0,g),f=d.substr(g+1)):(_=d,f=""),E=decodeURIComponent(_),M=decodeURIComponent(f),h(r,E)?p(r[E])?r[E].push(M):r[E]=[r[E],M]:r[E]=M}return r};var p=Array.isArray||function(y){return Object.prototype.toString.call(y)==="[object Array]"}},{}],88:[function(m,T,v){"use strict";var h=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}};T.exports=function(o,i,r,e){return i=i||"&",r=r||"=",o===null&&(o=void 0),typeof o=="object"?y(c(o),function(t){var s=encodeURIComponent(h(t))+r;return p(o[t])?y(o[t],function(u){return s+encodeURIComponent(h(u))}).join(i):s+encodeURIComponent(h(o[t]))}).join(i):e?encodeURIComponent(h(e))+r+encodeURIComponent(h(o)):""};var p=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function y(o,i){if(o.map)return o.map(i);for(var r=[],e=0;e",'"',"`"," ","\r",` +`," "],e=["{","}","|","\\","^","`"].concat(r),t=["'"].concat(e),s=["%","/","?",";","#"].concat(t),u=["/","?","#"],d=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},M={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=m("querystring");function z(C,V,B){if(C&&p.isObject(C)&&C instanceof y)return C;var ne=new y;return ne.parse(C,V,B),ne}y.prototype.parse=function(C,V,B){if(!p.isString(C))throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var ne=C.indexOf("?"),oe=ne!==-1&&ne127?Q+="x":Q+=k[te];if(!Q.match(g)){var I=Z.slice(0,W),N=Z.slice(W+1),q=k.match(_);q&&(I.push(q[1]),N.unshift(q[2])),N.length&&(S="/"+N.join(".")+S),this.hostname=I.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),le||(this.hostname=h.toASCII(this.hostname));var Y=this.port?":"+this.port:"",b=this.hostname||"";this.host=b+Y,this.href+=this.host,le&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),S[0]!=="/"&&(S="/"+S))}if(!f[H])for(var W=0,F=t.length;W0?B.host.split("@"):!1;Q&&(B.auth=Q.shift(),B.host=B.hostname=Q.shift())}return B.search=C.search,B.query=C.query,(!p.isNull(B.pathname)||!p.isNull(B.search))&&(B.path=(B.pathname?B.pathname:"")+(B.search?B.search:"")),B.href=B.format(),B}if(!Z.length)return B.pathname=null,B.search?B.path="/"+B.search:B.path=null,B.href=B.format(),B;for(var te=Z.slice(-1)[0],R=(B.host||C.host||Z.length>1)&&(te==="."||te==="..")||te==="",I=0,N=Z.length;N>=0;N--)te=Z[N],te==="."?Z.splice(N,1):te===".."?(Z.splice(N,1),I++):I&&(Z.splice(N,1),I--);if(!$&&!le)for(;I--;I)Z.unshift("..");$&&Z[0]!==""&&(!Z[0]||Z[0].charAt(0)!=="/")&&Z.unshift(""),R&&Z.join("/").substr(-1)!=="/"&&Z.push("");var q=Z[0]===""||Z[0]&&Z[0].charAt(0)==="/";if(k){B.hostname=B.host=q?"":Z.length?Z.shift():"";var Q=B.host&&B.host.indexOf("@")>0?B.host.split("@"):!1;Q&&(B.auth=Q.shift(),B.host=B.hostname=Q.shift())}return $=$||B.host&&Z.length,$&&!q&&Z.unshift(""),Z.length?B.pathname=Z.join("/"):(B.pathname=null,B.path=null),(!p.isNull(B.pathname)||!p.isNull(B.search))&&(B.path=(B.pathname?B.pathname:"")+(B.search?B.search:"")),B.auth=C.auth||B.auth,B.slashes=B.slashes||C.slashes,B.href=B.format(),B},y.prototype.parseHost=function(){var C=this.host,V=o.exec(C);V&&(V=V[0],V!==":"&&(this.port=V.substr(1)),C=C.substr(0,C.length-V.length)),C&&(this.hostname=C)}},{"./util":91,punycode:86,querystring:89}],91:[function(m,T,v){"use strict";T.exports={isString:function(h){return typeof h=="string"},isObject:function(h){return typeof h=="object"&&h!==null},isNull:function(h){return h===null},isNullOrUndefined:function(h){return h==null}}},{}]},{},[17])(17)})});function ri(se,ae){if(se&1&&(ge(0,"th",5),we(1),de()),se&2){let me=ae.$implicit;pe(),Se(me.title)}}function ii(se,ae){if(se&1&&(ge(0,"td",7),we(1),de()),se&2){let me=ae.$implicit,m=ke().$implicit;pe(),Se(m[me.key])}}function ni(se,ae){if(se&1&&(ge(0,"tr"),Ae(1,ii,2,1,"td",6),de()),se&2){let me=ke();pe(),_e("ngForOf",me.columns)}}var bi=(()=>{let ae=class ae{constructor(){this.columns=[],this.data=[]}ngOnInit(){console.log(this.data)}};ae.\u0275fac=function(T){return new(T||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["app-data-v-lj-table"]],inputs:{columns:"columns",data:"data"},standalone:!0,features:[Ee],decls:7,vars:4,consts:[["nzBordered","","nzSize","small",3,"nzData","nzPageSize"],["dynamicTable",""],["style",` + background: rgb(8 22 48); + /* color: #bfceff !important; */ + color: #75f9fd; + text-align: center; + border: 0.5px solid #ffffff !important; + `,"nzShowSort","true",4,"ngFor","ngForOf"],[2,"background","rgb(8 22 48)"],[4,"ngFor","ngForOf"],["nzShowSort","true",2,"background","rgb(8 22 48)","/* color","#bfceff !important",`*/ + color`,"#75f9fd","text-align","center","border","0.5px solid #ffffff !important"],["style","text-align: center; color: #75f9fd; border: 0.5px solid #ffffff !important; transition: background 0.3s",4,"ngFor","ngForOf"],[2,"text-align","center","color","#75f9fd","border","0.5px solid #ffffff !important","transition","background 0.3s"]],template:function(T,v){if(T&1&&(ge(0,"nz-table",0,1)(2,"thead")(3,"tr"),Ae(4,ri,2,1,"th",2),de()(),ge(5,"tbody",3),Ae(6,ni,2,1,"tr",4),de()()),T&2){let h=Tt(1);_e("nzData",v.data)("nzPageSize",5),pe(4),_e("ngForOf",v.columns),pe(2),_e("ngForOf",h.data)}},dependencies:[je,ze,at,et,ut,ct,lt,ot,Ue,Je,Ze,gt,nt,rt,tt,De,Ge,$e,ft,dt,qe,ht,it,He,Xe,Ye,dr,hr,fr,pr,yr,gr,mr,pt,Fe,Le,st,Ve,Ne,We,Qe,Be,Pt,Ke],styles:[".ant-table-bordered[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], .ant-table-bordered[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-color:#fff!important}.tableColor[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-right:3px solid #2b3e71!important;border-bottom:1px solid #334474!important;transition:background .3s}.tableColor[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#bfceff!important;background-color:transparent!important;border-right:3px solid #2b3e71!important;border-bottom:1px solid #334474!important}"]});let se=ae;return se})();var si=["myGrid"],Si=(()=>{let ae=class ae{constructor(){this.defaultColDef={width:130,editable:!1},this.columnDefs=[],this.rowData=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz"}ngOnInit(){console.log("-----\u8868\u683C\u521D\u59CB\u5316-----"),this.pageSize=10,this.pageIndex=1,this.pageRowTotal=this.rowData.length}nzPageSizeChange(m){this.pageSize=m}nzPageIndexChange(m){console.log(`nzPageIndexChange${m}`),this.grid.api&&(m==1?this.grid.api.paginationGoToFirstPage():this.grid.api.paginationGoToPage(m))}};ae.\u0275fac=function(T){return new(T||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["app-ag-grid-component"]],viewQuery:function(T,v){if(T&1&&Ct(si,5),T&2){let h;xt(h=It())&&(v.grid=h.first)}},inputs:{defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData:"rowData",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[Ee],decls:7,vars:15,consts:[[3,"pagination","suppressPaginationPanel","suppressScrollOnNewData","paginationPageSize","defaultColDef","rowData","columnDefs"],["myGrid",""],[1,"grid-pagination"],[1,"page-total-style"],["nzShowSizeChanger","",3,"nzPageIndex","nzPageSize","nzTotal","className","nzPageSizeChange","nzPageIndexChange"]],template:function(T,v){T&1&&(Ie(0,"ag-grid-angular",0,1)(2,"br"),ge(3,"div",2)(4,"div",3),we(5),de(),ge(6,"nz-pagination",4),Te("nzPageSizeChange",function(p){return v.nzPageSizeChange(p)})("nzPageIndexChange",function(p){return v.nzPageIndexChange(p)}),de()()),T&2&&(vt(v.gridThemeClass),_e("pagination",!0)("suppressPaginationPanel",!0)("suppressPaginationPanel",!0)("suppressScrollOnNewData",!0)("paginationPageSize",v.pageSize)("defaultColDef",v.defaultColDef)("rowData",v.rowData)("columnDefs",v.columnDefs),pe(5),At("\u5171 ",v.pageRowTotal," \u9879\u6570\u636E"),pe(),_e("nzPageIndex",v.pageIndex)("nzPageSize",v.pageSize)("nzTotal",v.pageRowTotal)("className",v.paginationThemeClass))},dependencies:[kt,Ke,Rt],styles:[".grid-pagination[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:32px}.grid-pagination[_ngcontent-%COMP%] .ant-select-selection-item, .ant-select-selector[_ngcontent-%COMP%]{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .page-total-style{font-size:medium;font-weight:700;color:#00eff8} .ant-select-item-option{color:#00eff8!important} .ant-select-item-option-active div{font-weight:800!important;color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .anticon{color:#00eff8}.grid-pagination[_ngcontent-%COMP%] .ant-select-selector{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-prev .ant-pagination-item-link{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item a{color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active a{color:#000!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-next button, .ant-pagination-prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active:focus-visible, .ant-pagination-item-active[_ngcontent-%COMP%]:hover, .ant-pagination-next[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%], .ant-pagination-prev[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%]{border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active{font-weight:500;background-color:#00eff8;border-color:#00eff8;border-width:2px}"]});let se=ae;return se})();var xi=(()=>{let ae=class ae{agInit(m){this.cellValue=this.getValueToDisplay(m)}refresh(m){return this.cellValue=this.getValueToDisplay(m),!0}buttonClicked(){alert(`\u70B9\u51FB\u4E86 ${this.cellValue}`)}getValueToDisplay(m){return m.valueFormatted?m.valueFormatted:m.value}};ae.\u0275fac=function(T){return new(T||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["ng-component"]],standalone:!0,features:[Ee],decls:3,vars:1,consts:[[2,"display","flex","justify-content","center","align-items","center","height","100%"],[1,"ag-grid-button-style",3,"click"]],template:function(T,v){T&1&&(ge(0,"span",0)(1,"button",1),Te("click",function(){return v.buttonClicked()}),we(2),de()()),T&2&&(pe(2),Se(v.cellValue))},styles:[".ag-grid-button-style[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;width:90px;margin:4px;padding:8px 12px;font-weight:800;color:#e0e0e0;text-align:center;text-decoration:none;background-color:#1e4d6b;border:none;transition:background-color .3s,color .3s}.ag-grid-button-style[_ngcontent-%COMP%]:hover{color:#fff;text-decoration:underline;background-color:#3a6d8c}"]});let se=ae;return se})();var li=["*"],$r=(()=>{let ae=class ae{constructor(){this.showSetting=!1,this.optionsList=[],this.onCheckedItemsChange=new be,this.title=""}getCheckedItems(){return this.optionsList.filter(m=>m.checked)}onCheckChange(){let m=this.getCheckedItems();this.onCheckedItemsChange.emit(m)}};ae.\u0275fac=function(T){return new(T||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["lj-data-v-card"]],inputs:{showSetting:"showSetting",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[Ee],ngContentSelectors:li,decls:7,vars:1,consts:[[1,"card-content"],[1,"card-top-content"],[1,"card-content-title"],[1,"card-content-l"],["nz-icon","","nzType","setting","nzTheme","outline"]],template:function(T,v){T&1&&(Et(),ge(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),we(4),de()(),Ie(5,"span",4),de(),St(6),de()),T&2&&(pe(4),Se(v.title))},dependencies:[Ne,Mt,Be,He,je,ze,at,et,ut,ct,lt,ot,Ue,Je,Ze,gt,nt,rt,tt,De,Ot,Ge,$e,ft,dt,qe,ht,it,Xe,Ye,pt,Fe,Le,st,Ve,We,Qe],styles:['.card-content-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:fit-content;height:fit-content;padding:5px 20px 0;font-size:16px;color:#29b6f6;text-align:center;background-color:#19426e;border:1px solid #1f6f97;border-radius:10px 10px 0 0;box-shadow:inset 0 0 10px #1f6f97}.card-top-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto;align-items:center;justify-content:space-between}.card-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:.5rem;padding:1rem 1.5rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-repeat:no-repeat;background-position:center;background-size:100% 100%}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;margin-bottom:.5rem;font-size:18px;font-weight:600;color:#74fafb}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{flex:1;align-self:flex-start}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let se=ae;return se})();var ui=["myGrid"],Wi=(()=>{let ae=class ae{constructor(){this.title="",this.showSetting=!0,this.defaultColDef={width:130,editable:!1,headerClass:"ag-header-center",cellStyle:{"font-weight":"bold",textAlign:"center","justify-content":"center","line-height":"38px"}},this.columnDefs=[],this.rowData=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz",this.tableColumns=[{key:"sort",title:"\u5E8F\u53F7"},{key:"time",title:"\u65F6\u95F4"},{key:"option",title:"\u64CD\u4F5C"},{key:"optionDesc",title:"\u64CD\u4F5C\u63CF\u8FF0"},{key:"optionMan",title:"\u64CD\u4F5C\u4EBA\u5458"},{key:"mark",title:"\u5907\u6CE8"},{key:"edit",title:"\u7F16\u8F91"}],this.tableData=[{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"}]}ngOnInit(){this.title?console.log("Title has been passed:",this.title):console.log("Title has not been passed"),console.log("-----\u8868\u683C\u521D\u59CB\u5316-----"),this.pageSize=10,this.pageIndex=1,this.pageRowTotal=this.rowData.length}nzPageSizeChange(m){this.pageSize=m}nzPageIndexChange(m){console.log(`nzPageIndexChange${m}`),this.grid.api&&(m==1?this.grid.api.paginationGoToFirstPage():this.grid.api.paginationGoToPage(m))}};ae.\u0275fac=function(T){return new(T||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["lj-app-ag-grid-component"]],viewQuery:function(T,v){if(T&1&&Ct(ui,5),T&2){let h;xt(h=It())&&(v.grid=h.first)}},inputs:{title:"title",defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData:"rowData",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[Ee],decls:8,vars:17,consts:[["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12",3,"title"],[3,"pagination","suppressPaginationPanel","suppressScrollOnNewData","paginationPageSize","defaultColDef","rowData","columnDefs","rowHeight"],["myGrid",""],[1,"grid-pagination"],[1,"page-total-style"],["nzShowSizeChanger","",3,"nzPageIndex","nzPageSize","nzTotal","className","nzPageSizeChange","nzPageIndexChange"]],template:function(T,v){T&1&&(ge(0,"lj-data-v-card",0),Ie(1,"ag-grid-angular",1,2)(3,"br"),ge(4,"div",3)(5,"div",4),we(6),de(),ge(7,"nz-pagination",5),Te("nzPageSizeChange",function(p){return v.nzPageSizeChange(p)})("nzPageIndexChange",function(p){return v.nzPageIndexChange(p)}),de()()()),T&2&&(tr("title",v.title),pe(),vt(v.gridThemeClass),_e("pagination",!0)("suppressPaginationPanel",!0)("suppressPaginationPanel",!0)("suppressScrollOnNewData",!0)("paginationPageSize",v.pageSize)("defaultColDef",v.defaultColDef)("rowData",v.rowData)("columnDefs",v.columnDefs)("rowHeight",38),pe(5),At("\u5171 ",v.pageRowTotal," \u9879\u6570\u636E"),pe(),_e("nzPageIndex",v.pageIndex)("nzPageSize",v.pageSize)("nzTotal",v.pageRowTotal)("className",v.paginationThemeClass))},dependencies:[kt,Ke,Rt,$r],styles:[".grid-pagination[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:32px}.grid-pagination[_ngcontent-%COMP%] .ant-select-selection-item, .ant-select-selector[_ngcontent-%COMP%]{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .page-total-style{font-size:medium;font-weight:700;color:#00eff8} .ant-select-item-option{color:#00eff8!important} .ant-select-item-option-active div{font-weight:800!important;color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .anticon{color:#00eff8}.grid-pagination[_ngcontent-%COMP%] .ant-select-selector{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-prev .ant-pagination-item-link{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item a{color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active a{color:#000!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-next button, .ant-pagination-prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active:focus-visible, .ant-pagination-item-active[_ngcontent-%COMP%]:hover, .ant-pagination-next[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%], .ant-pagination-prev[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%]{border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active{font-weight:500;background-color:#00eff8;border-color:#00eff8;border-width:2px}"]});let se=ae;return se})();function ci(se,ae){if(se&1){let me=er();ge(0,"li",9)(1,"label",10),Te("ngModelChange",function(T){let h=Ft(me).$implicit;return Ut(h.checked=T)})("ngModelChange",function(){Ft(me);let T=ke(2);return Ut(T.onCheckChange())}),we(2),de()()}if(se&2){let me=ae.$implicit;pe(),_e("ngModel",me.checked),pe(),Se(me.label)}}function fi(se,ae){if(se&1&&(ge(0,"div",4),Ie(1,"a",5),ge(2,"nz-dropdown-menu",null,6)(4,"ul",7),Ae(5,ci,3,2,"li",8),de()()()),se&2){let me=Tt(3),m=ke();pe(),_e("nzDropdownMenu",me),pe(4),_e("ngForOf",m.optionsList)}}var hi=["*"],en=(()=>{let ae=class ae{constructor(){this.showSetting=!1,this.optionsList=[],this.onCheckedItemsChange=new be,this.title=""}getCheckedItems(){return this.optionsList.filter(m=>m.checked)}onCheckChange(){let m=this.getCheckedItems();this.onCheckedItemsChange.emit(m)}};ae.\u0275fac=function(T){return new(T||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["data-v-card"]],inputs:{showSetting:"showSetting",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[Ee],ngContentSelectors:hi,decls:6,vars:2,consts:[[1,"card-content"],[1,"card-content-title"],[1,"card-content-l"],["class","card-content-r",4,"ngIf"],[1,"card-content-r"],["nz-dropdown","","nz-icon","","nzType","setting","nzTrigger","click","nzTheme","outline",3,"nzDropdownMenu"],["menu","nzDropdownMenu"],["nz-menu","","nzSelectable",""],["nz-menu-item","",4,"ngFor","ngForOf"],["nz-menu-item",""],["nz-checkbox","",3,"ngModel","ngModelChange"]],template:function(T,v){T&1&&(Et(),ge(0,"div",0)(1,"div",1)(2,"div",2),we(3),de(),Ae(4,fi,6,2,"div",3),de(),St(5),de()),T&2&&(pe(3),Se(v.title),pe(),_e("ngIf",v.showSetting))},dependencies:[Ne,Mt,Be,Pt,rr,He,ar,sr,lr,ur,cr,je,ir,nr,ze,at,et,ut,ct,lt,ot,Ue,Je,Ze,gt,nt,rt,tt,De,Ot,Ge,$e,ft,dt,qe,ht,it,Xe,Ye,pt,Fe,Le,st,Ve,We,or,Qe],styles:['.card-content[_ngcontent-%COMP%]{overflow:hidden;padding:1rem 1.5rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-position:top;background-size:cover;margin-bottom:.5rem}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;margin-bottom:.5rem;font-size:18px;font-weight:600;color:#74fafb}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{align-self:flex-start;flex:1}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let se=ae;return se})();var fn=Vt(zt(),1),Xr=Vt(zt(),1);var yt=function(se){return se[se.CLOSED=0]="CLOSED",se[se.CONNECTING=1]="CONNECTING",se[se.CONNECTED=2]="CONNECTED",se}(yt||{});var pi=new Dt("NgxMqttServiceConfig"),di=new Dt("NgxMqttClientService");function Bt(se,...ae){if(!ae.length)return se;let me=ae.shift();if(Wt(se)&&Wt(me))for(let m in me)Wt(me[m])?(se[m]||Object.assign(se,{[m]:{}}),Bt(se[m],me[m])):Object.assign(se,{[m]:me[m]});return Bt(se,...ae)}function Wt(se){return se&&typeof se=="object"&&!Array.isArray(se)}var dn=(()=>{let ae=class ae{constructor(m,T){this.options=m,this.observables={},this.state=new Qt(yt.CLOSED),this.messages=new Nt,this._clientId=this._generateClientId(),this._connectTimeout=1e4,this._reconnectPeriod=1e4,this._onConnect=new be,this._onReconnect=new be,this._onClose=new be,this._onOffline=new be,this._onError=new be,this._onEnd=new be,this._onMessage=new be,this._onSuback=new be,this._onPacketsend=new be,this._onPacketreceive=new be,this._handleOnConnect=v=>{this.options.connectOnCreate===!0&&Object.keys(this.observables).forEach(h=>{this.client.subscribe(h)}),this.state.next(yt.CONNECTED),this._onConnect.emit(v)},this._handleOnReconnect=()=>{this.options.connectOnCreate===!0&&Object.keys(this.observables).forEach(v=>{this.client.subscribe(v)}),this.state.next(yt.CONNECTING),this._onReconnect.emit()},this._handleOnClose=()=>{this.state.next(yt.CLOSED),this._onClose.emit()},this._handleOnOffline=()=>{this._onOffline.emit()},this._handleOnError=v=>{this._onError.emit(v),console.error(v)},this._handleOnEnd=()=>{this._onEnd.emit()},this._handleOnMessage=(v,h,p)=>{this._onMessage.emit(p),p.cmd==="publish"&&this.messages.next(p)},this._handleOnPacketsend=v=>{this._onPacketsend.emit(v)},this._handleOnPacketreceive=v=>{this._onPacketreceive.emit(v)},m.connectOnCreate!==!1&&this.connect({},T),this.state.subscribe()}get clientId(){return this._clientId}get onConnect(){return this._onConnect}get onReconnect(){return this._onReconnect}get onClose(){return this._onClose}get onOffline(){return this._onOffline}get onError(){return this._onError}get onEnd(){return this._onEnd}get onMessage(){return this._onMessage}get onPacketsend(){return this._onPacketsend}get onPacketreceive(){return this._onPacketreceive}get onSuback(){return this._onSuback}static filterMatchesTopic(m,T){if(m[0]==="#"&&T[0]==="$")return!1;let v=(m||"").split("/").reverse(),h=(T||"").split("/").reverse(),p=()=>{let y=v.pop(),c=h.pop();switch(y){case"#":return!0;case"+":return c?p():!1;default:return y===c&&(y===void 0?!0:p())}};return p()}connect(m,T){let v=Bt(this.options||{},m),h=v.protocol||"ws",p=v.hostname||"localhost";v.url?this._url=v.url:(this._url=`${h}://${p}`,this._url+=v.port?`:${v.port}`:"",this._url+=v.path?`${v.path}`:""),this.state.next(yt.CONNECTING);let y=Bt({clientId:this._clientId,reconnectPeriod:this._reconnectPeriod,connectTimeout:this._connectTimeout},v);this.client&&this.client.end(!0),T?this.client=T:this.client=(0,Xr.connect)(this._url,y),this._clientId=y.clientId,this.client.on("connect",this._handleOnConnect),this.client.on("reconnect",this._handleOnReconnect),this.client.on("close",this._handleOnClose),this.client.on("offline",this._handleOnOffline),this.client.on("error",this._handleOnError),this.client.stream.on("error",this._handleOnError),this.client.on("end",this._handleOnEnd),this.client.on("message",this._handleOnMessage),this.client.on("packetsend",this._handleOnPacketsend),this.client.on("packetreceive",this._handleOnPacketreceive)}disconnect(m=!0){if(!this.client)throw new Error("mqtt client not connected");this.client.end(m)}observeRetained(m,T={qos:1}){return this._generalObserve(m,()=>Xt(1),T)}observe(m,T={qos:1}){return this._generalObserve(m,()=>Jt(),T)}_generalObserve(m,T,v){if(!this.client)throw new Error("mqtt client not connected");if(!this.observables[m]){let h=new Nt;this.observables[m]=$t(()=>{let p=new Ht;return this.client.subscribe(m,v,(y,c)=>{c&&c.forEach(o=>{o.qos===128&&(delete this.observables[o.topic],this.client.unsubscribe(o.topic),h.error(`subscription for '${o.topic}' rejected!`)),this._onSuback.emit({filter:m,granted:o.qos!==128})})}),p.add(()=>{delete this.observables[m],this.client.unsubscribe(m)}),p},p=>Yt(h,this.messages)).pipe(Gt(p=>ae.filterMatchesTopic(m,p.topic)),T(),Kt())}return this.observables[m]}publish(m,T,v={}){if(!this.client)throw new Error("mqtt client not connected");return qt.create(h=>{this.client.publish(m,T,v,p=>{p?h.error(p):(h.next(),h.complete())})})}unsafePublish(m,T,v={}){if(!this.client)throw new Error("mqtt client not connected");this.client.publish(m,T,v,h=>{if(h)throw h})}_generateClientId(){return"client-"+Math.random().toString(36).substr(2,19)}};ae.\u0275fac=function(T){return new(T||ae)(Lt(pi),Lt(di))},ae.\u0275prov=Zt({token:ae,factory:ae.\u0275fac,providedIn:"root"});let se=ae;return se})();export{Si as a,xi as b,bi as c,Wi as d,en as e,dn as f}; diff --git a/dist/himp.platform.angular/browser/chunk-M4HTTI2X.js b/dist/himp.platform.angular/browser/chunk-M4HTTI2X.js deleted file mode 100644 index e5962de..0000000 --- a/dist/himp.platform.angular/browser/chunk-M4HTTI2X.js +++ /dev/null @@ -1,9 +0,0 @@ -import{$a as pt,A as Ke,C as Ye,Ca as nt,Ga as st,Ia as at,La as lt,O as $t,P as Jt,Pa as ut,S as Xt,Sa as ht,T as Zt,U as er,Ua as ft,V as Qe,Xa as ct,_ as Ge,aa as tr,bb as dt,ca as $e,da as rr,db as gt,e as Ve,fa as ir,fb as mt,ga as nr,ha as sr,hb as yt,ia as or,j as Yt,ja as ar,jb as _t,ka as lr,la as Je,n as Qt,pa as Xe,ra as Ze,ta as et,u as ze,ua as tt,v as qe,wa as rt,ya as it,z as Gt}from"./chunk-WD6SV3WH.js";import{Db as Ne,Eb as Te,Fb as Re,Fe as qt,Ge as De,He as Kt,I as Bt,J as kt,Jb as Le,K as Nt,Ka as ge,Le as je,Nf as ot,Oa as me,Ta as Ee,Va as be,X as Lt,Y as Ut,a as Me,b as Be,c as Oe,cc as Ue,dc as zt,f as cr,gb as _e,h as Tt,ha as Ft,hb as ye,hf as We,ib as Dt,ja as vt,k as Ie,ka as Et,l as Rt,lf as He,m as Pt,mb as jt,n as Ot,na as ke,nc as Fe,o as wt,p as Mt,qb as Wt,sa as St,sb as Ae,ta as xt,tb as Ht,ub as Vt}from"./chunk-VDRVUQCF.js";var It=cr((hr,Ct)=>{"use strict";(function(ae){if(typeof hr=="object"&&typeof Ct<"u")Ct.exports=ae();else if(typeof define=="function"&&define.amd)define([],ae);else{var ue;typeof window<"u"?ue=window:typeof global<"u"?ue=global:typeof self<"u"?ue=self:ue=this,ue.mqtt=ae()}})(function(){var ae,ue,pe;return function(){function y(k,x,p){function c(s,i){if(!x[s]){if(!k[s]){var r=typeof Oe=="function"&&Oe;if(!i&&r)return r(s,!0);if(m)return m(s,!0);var e=new Error("Cannot find module '"+s+"'");throw e.code="MODULE_NOT_FOUND",e}var t=x[s]={exports:{}};k[s][0].call(t.exports,function(o){var u=k[s][1][o];return c(u||o)},t,t.exports,y,k,x,p)}return x[s].exports}for(var m=typeof Oe=="function"&&Oe,h=0;h0)throw new Error("Invalid string. Length must be a multiple of 4");var v=_.indexOf("=");v===-1&&(v=f);var R=v===f?0:4-v%4;return[v,R]}function e(_){var f=r(_),v=f[0],R=f[1];return(v+R)*3/4-R}function t(_,f,v){return(f+v)*3/4-v}function o(_){var f,v=r(_),R=v[0],A=v[1],W=new m(t(_,R,A)),j=0,C=A>0?R-4:R,P;for(P=0;P>16&255,W[j++]=f>>8&255,W[j++]=f&255;return A===2&&(f=c[_.charCodeAt(P)]<<2|c[_.charCodeAt(P+1)]>>4,W[j++]=f&255),A===1&&(f=c[_.charCodeAt(P)]<<10|c[_.charCodeAt(P+1)]<<4|c[_.charCodeAt(P+2)]>>2,W[j++]=f>>8&255,W[j++]=f&255),W}function u(_){return p[_>>18&63]+p[_>>12&63]+p[_>>6&63]+p[_&63]}function d(_,f,v){for(var R,A=[],W=f;WC?C:j+W));return R===1?(f=_[v-1],A.push(p[f>>2]+p[f<<4&63]+"==")):R===2&&(f=(_[v-2]<<8)+_[v-1],A.push(p[f>>10]+p[f>>4&63]+p[f<<2&63]+"=")),A.join("")}},{}],2:[function(y,k,x){},{}],3:[function(y,k,x){(function(p){(function(){"use strict";var c=y("base64-js"),m=y("ieee754");x.Buffer=r,x.SlowBuffer=R,x.INSPECT_MAX_BYTES=50;var h=2147483647;x.kMaxLength=h,r.TYPED_ARRAY_SUPPORT=s(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{var l=new Uint8Array(1);return l.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},l.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function i(l){if(l>h)throw new RangeError('The value "'+l+'" is invalid for option "size"');var n=new Uint8Array(l);return n.__proto__=r.prototype,n}function r(l,n,a){if(typeof l=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(l)}return e(l,n,a)}typeof Symbol<"u"&&Symbol.species!=null&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),r.poolSize=8192;function e(l,n,a){if(typeof l=="string")return d(l,n);if(ArrayBuffer.isView(l))return g(l);if(l==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(Q(l,ArrayBuffer)||l&&Q(l.buffer,ArrayBuffer))return _(l,n,a);if(typeof l=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var w=l.valueOf&&l.valueOf();if(w!=null&&w!==l)return r.from(w,n,a);var L=f(l);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof l[Symbol.toPrimitive]=="function")return r.from(l[Symbol.toPrimitive]("string"),n,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}r.from=function(l,n,a){return e(l,n,a)},r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array;function t(l){if(typeof l!="number")throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function o(l,n,a){return t(l),l<=0?i(l):n!==void 0?typeof a=="string"?i(l).fill(n,a):i(l).fill(n):i(l)}r.alloc=function(l,n,a){return o(l,n,a)};function u(l){return t(l),i(l<0?0:v(l)|0)}r.allocUnsafe=function(l){return u(l)},r.allocUnsafeSlow=function(l){return u(l)};function d(l,n){if((typeof n!="string"||n==="")&&(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var a=A(l,n)|0,w=i(a),L=w.write(l,n);return L!==a&&(w=w.slice(0,L)),w}function g(l){for(var n=l.length<0?0:v(l.length)|0,a=i(n),w=0;w=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return l|0}function R(l){return+l!=l&&(l=0),r.alloc(+l)}r.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==r.prototype},r.compare=function(n,a){if(Q(n,Uint8Array)&&(n=r.from(n,n.offset,n.byteLength)),Q(a,Uint8Array)&&(a=r.from(a,a.offset,a.byteLength)),!r.isBuffer(n)||!r.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===a)return 0;for(var w=n.length,L=a.length,K=0,J=Math.min(w,L);K2&&arguments[2]===!0;if(!w&&a===0)return 0;for(var L=!1;;)switch(n){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return te(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return N(l).length;default:if(L)return w?-1:te(l).length;n=(""+n).toLowerCase(),L=!0}}r.byteLength=A;function W(l,n,a){var w=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,n>>>=0,a<=n))return"";for(l||(l="utf8");;)switch(l){case"hex":return ee(this,n,a);case"utf8":case"utf-8":return E(this,n,a);case"ascii":return z(this,n,a);case"latin1":case"binary":return re(this,n,a);case"base64":return G(this,n,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,n,a);default:if(w)throw new TypeError("Unknown encoding: "+l);l=(l+"").toLowerCase(),w=!0}}r.prototype._isBuffer=!0;function j(l,n,a){var w=l[n];l[n]=l[a],l[a]=w}r.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;aa&&(n+=" ... "),""},r.prototype.compare=function(n,a,w,L,K){if(Q(n,Uint8Array)&&(n=r.from(n,n.offset,n.byteLength)),!r.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(a===void 0&&(a=0),w===void 0&&(w=n?n.length:0),L===void 0&&(L=0),K===void 0&&(K=this.length),a<0||w>n.length||L<0||K>this.length)throw new RangeError("out of range index");if(L>=K&&a>=w)return 0;if(L>=K)return-1;if(a>=w)return 1;if(a>>>=0,w>>>=0,L>>>=0,K>>>=0,this===n)return 0;for(var J=K-L,le=w-a,he=Math.min(J,le),fe=this.slice(L,K),de=n.slice(a,w),ce=0;ce2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,b(a)&&(a=L?0:l.length-1),a<0&&(a=l.length+a),a>=l.length){if(L)return-1;a=l.length-1}else if(a<0)if(L)a=0;else return-1;if(typeof n=="string"&&(n=r.from(n,w)),r.isBuffer(n))return n.length===0?-1:P(l,n,a,w,L);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(l,n,a):Uint8Array.prototype.lastIndexOf.call(l,n,a):P(l,[n],a,w,L);throw new TypeError("val must be string, number or Buffer")}function P(l,n,a,w,L){var K=1,J=l.length,le=n.length;if(w!==void 0&&(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le")){if(l.length<2||n.length<2)return-1;K=2,J/=2,le/=2,a/=2}function he(Se,ve){return K===1?Se[ve]:Se.readUInt16BE(ve*K)}var fe;if(L){var de=-1;for(fe=a;feJ&&(a=J-le),fe=a;fe>=0;fe--){for(var ce=!0,we=0;weL&&(w=L)):w=L;var K=n.length;w>K/2&&(w=K/2);for(var J=0;J>>0,isFinite(w)?(w=w>>>0,L===void 0&&(L="utf8")):(L=w,w=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var K=this.length-a;if((w===void 0||w>K)&&(w=K),n.length>0&&(w<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");L||(L="utf8");for(var J=!1;;)switch(L){case"hex":return S(this,n,a,w);case"utf8":case"utf-8":return V(this,n,a,w);case"ascii":return B(this,n,a,w);case"latin1":case"binary":return ne(this,n,a,w);case"base64":return se(this,n,a,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,n,a,w);default:if(J)throw new TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),J=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function G(l,n,a){return n===0&&a===l.length?c.fromByteArray(l):c.fromByteArray(l.slice(n,a))}function E(l,n,a){a=Math.min(l.length,a);for(var w=[],L=n;L239?4:K>223?3:K>191?2:1;if(L+le<=a){var he,fe,de,ce;switch(le){case 1:K<128&&(J=K);break;case 2:he=l[L+1],(he&192)===128&&(ce=(K&31)<<6|he&63,ce>127&&(J=ce));break;case 3:he=l[L+1],fe=l[L+2],(he&192)===128&&(fe&192)===128&&(ce=(K&15)<<12|(he&63)<<6|fe&63,ce>2047&&(ce<55296||ce>57343)&&(J=ce));break;case 4:he=l[L+1],fe=l[L+2],de=l[L+3],(he&192)===128&&(fe&192)===128&&(de&192)===128&&(ce=(K&15)<<18|(he&63)<<12|(fe&63)<<6|de&63,ce>65535&&ce<1114112&&(J=ce))}}J===null?(J=65533,le=1):J>65535&&(J-=65536,w.push(J>>>10&1023|55296),J=56320|J&1023),w.push(J),L+=le}return U(w)}var T=4096;function U(l){var n=l.length;if(n<=T)return String.fromCharCode.apply(String,l);for(var a="",w=0;ww)&&(a=w);for(var L="",K=n;Kw&&(n=w),a<0?(a+=w,a<0&&(a=0)):a>w&&(a=w),aa)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUIntLE=function(n,a,w){n=n>>>0,a=a>>>0,w||D(n,a,this.length);for(var L=this[n],K=1,J=0;++J>>0,a=a>>>0,w||D(n,a,this.length);for(var L=this[n+--a],K=1;a>0&&(K*=256);)L+=this[n+--a]*K;return L},r.prototype.readUInt8=function(n,a){return n=n>>>0,a||D(n,1,this.length),this[n]},r.prototype.readUInt16LE=function(n,a){return n=n>>>0,a||D(n,2,this.length),this[n]|this[n+1]<<8},r.prototype.readUInt16BE=function(n,a){return n=n>>>0,a||D(n,2,this.length),this[n]<<8|this[n+1]},r.prototype.readUInt32LE=function(n,a){return n=n>>>0,a||D(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},r.prototype.readUInt32BE=function(n,a){return n=n>>>0,a||D(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},r.prototype.readIntLE=function(n,a,w){n=n>>>0,a=a>>>0,w||D(n,a,this.length);for(var L=this[n],K=1,J=0;++J=K&&(L-=Math.pow(2,8*a)),L},r.prototype.readIntBE=function(n,a,w){n=n>>>0,a=a>>>0,w||D(n,a,this.length);for(var L=a,K=1,J=this[n+--L];L>0&&(K*=256);)J+=this[n+--L]*K;return K*=128,J>=K&&(J-=Math.pow(2,8*a)),J},r.prototype.readInt8=function(n,a){return n=n>>>0,a||D(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},r.prototype.readInt16LE=function(n,a){n=n>>>0,a||D(n,2,this.length);var w=this[n]|this[n+1]<<8;return w&32768?w|4294901760:w},r.prototype.readInt16BE=function(n,a){n=n>>>0,a||D(n,2,this.length);var w=this[n+1]|this[n]<<8;return w&32768?w|4294901760:w},r.prototype.readInt32LE=function(n,a){return n=n>>>0,a||D(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},r.prototype.readInt32BE=function(n,a){return n=n>>>0,a||D(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},r.prototype.readFloatLE=function(n,a){return n=n>>>0,a||D(n,4,this.length),m.read(this,n,!0,23,4)},r.prototype.readFloatBE=function(n,a){return n=n>>>0,a||D(n,4,this.length),m.read(this,n,!1,23,4)},r.prototype.readDoubleLE=function(n,a){return n=n>>>0,a||D(n,8,this.length),m.read(this,n,!0,52,8)},r.prototype.readDoubleBE=function(n,a){return n=n>>>0,a||D(n,8,this.length),m.read(this,n,!1,52,8)};function X(l,n,a,w,L,K){if(!r.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>L||nl.length)throw new RangeError("Index out of range")}r.prototype.writeUIntLE=function(n,a,w,L){if(n=+n,a=a>>>0,w=w>>>0,!L){var K=Math.pow(2,8*w)-1;X(this,n,a,w,K,0)}var J=1,le=0;for(this[a]=n&255;++le>>0,w=w>>>0,!L){var K=Math.pow(2,8*w)-1;X(this,n,a,w,K,0)}var J=w-1,le=1;for(this[a+J]=n&255;--J>=0&&(le*=256);)this[a+J]=n/le&255;return a+w},r.prototype.writeUInt8=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,1,255,0),this[a]=n&255,a+1},r.prototype.writeUInt16LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,65535,0),this[a]=n&255,this[a+1]=n>>>8,a+2},r.prototype.writeUInt16BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,65535,0),this[a]=n>>>8,this[a+1]=n&255,a+2},r.prototype.writeUInt32LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,4294967295,0),this[a+3]=n>>>24,this[a+2]=n>>>16,this[a+1]=n>>>8,this[a]=n&255,a+4},r.prototype.writeUInt32BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,4294967295,0),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4},r.prototype.writeIntLE=function(n,a,w,L){if(n=+n,a=a>>>0,!L){var K=Math.pow(2,8*w-1);X(this,n,a,w,K-1,-K)}var J=0,le=1,he=0;for(this[a]=n&255;++J>0)-he&255;return a+w},r.prototype.writeIntBE=function(n,a,w,L){if(n=+n,a=a>>>0,!L){var K=Math.pow(2,8*w-1);X(this,n,a,w,K-1,-K)}var J=w-1,le=1,he=0;for(this[a+J]=n&255;--J>=0&&(le*=256);)n<0&&he===0&&this[a+J+1]!==0&&(he=1),this[a+J]=(n/le>>0)-he&255;return a+w},r.prototype.writeInt8=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,1,127,-128),n<0&&(n=255+n+1),this[a]=n&255,a+1},r.prototype.writeInt16LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,32767,-32768),this[a]=n&255,this[a+1]=n>>>8,a+2},r.prototype.writeInt16BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,32767,-32768),this[a]=n>>>8,this[a+1]=n&255,a+2},r.prototype.writeInt32LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,2147483647,-2147483648),this[a]=n&255,this[a+1]=n>>>8,this[a+2]=n>>>16,this[a+3]=n>>>24,a+4},r.prototype.writeInt32BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4};function $(l,n,a,w,L,K){if(a+w>l.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function oe(l,n,a,w,L){return n=+n,a=a>>>0,L||$(l,n,a,4,34028234663852886e22,-34028234663852886e22),m.write(l,n,a,w,23,4),a+4}r.prototype.writeFloatLE=function(n,a,w){return oe(this,n,a,!0,w)},r.prototype.writeFloatBE=function(n,a,w){return oe(this,n,a,!1,w)};function Z(l,n,a,w,L){return n=+n,a=a>>>0,L||$(l,n,a,8,17976931348623157e292,-17976931348623157e292),m.write(l,n,a,w,52,8),a+8}r.prototype.writeDoubleLE=function(n,a,w){return Z(this,n,a,!0,w)},r.prototype.writeDoubleBE=function(n,a,w){return Z(this,n,a,!1,w)},r.prototype.copy=function(n,a,w,L){if(!r.isBuffer(n))throw new TypeError("argument should be a Buffer");if(w||(w=0),!L&&L!==0&&(L=this.length),a>=n.length&&(a=n.length),a||(a=0),L>0&&L=this.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("sourceEnd out of bounds");L>this.length&&(L=this.length),n.length-a=0;--J)n[J+a]=this[J+w];else Uint8Array.prototype.set.call(n,this.subarray(w,L),a);return K},r.prototype.fill=function(n,a,w,L){if(typeof n=="string"){if(typeof a=="string"?(L=a,a=0,w=this.length):typeof w=="string"&&(L=w,w=this.length),L!==void 0&&typeof L!="string")throw new TypeError("encoding must be a string");if(typeof L=="string"&&!r.isEncoding(L))throw new TypeError("Unknown encoding: "+L);if(n.length===1){var K=n.charCodeAt(0);(L==="utf8"&&K<128||L==="latin1")&&(n=K)}}else typeof n=="number"&&(n=n&255);if(a<0||this.length>>0,w=w===void 0?this.length:w>>>0,n||(n=0);var J;if(typeof n=="number")for(J=a;J55295&&a<57344){if(!L){if(a>56319){(n-=3)>-1&&K.push(239,191,189);continue}else if(J+1===w){(n-=3)>-1&&K.push(239,191,189);continue}L=a;continue}if(a<56320){(n-=3)>-1&&K.push(239,191,189),L=a;continue}a=(L-55296<<10|a-56320)+65536}else L&&(n-=3)>-1&&K.push(239,191,189);if(L=null,a<128){if((n-=1)<0)break;K.push(a)}else if(a<2048){if((n-=2)<0)break;K.push(a>>6|192,a&63|128)}else if(a<65536){if((n-=3)<0)break;K.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((n-=4)<0)break;K.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return K}function O(l){for(var n=[],a=0;a>8,L=a%256,K.push(L),K.push(w);return K}function N(l){return c.toByteArray(M(l))}function q(l,n,a,w){for(var L=0;L=n.length||L>=l.length);++L)n[L+a]=l[L];return L}function Q(l,n){return l instanceof n||l!=null&&l.constructor!=null&&l.constructor.name!=null&&l.constructor.name===n.name}function b(l){return l!==l}}).call(this)}).call(this,y("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:5}],4:[function(y,k,x){"use strict";var p=typeof Reflect=="object"?Reflect:null,c=p&&typeof p.apply=="function"?p.apply:function(P,S,V){return Function.prototype.apply.call(P,S,V)},m;p&&typeof p.ownKeys=="function"?m=p.ownKeys:Object.getOwnPropertySymbols?m=function(P){return Object.getOwnPropertyNames(P).concat(Object.getOwnPropertySymbols(P))}:m=function(P){return Object.getOwnPropertyNames(P)};function h(C){console&&console.warn&&console.warn(C)}var s=Number.isNaN||function(P){return P!==P};function i(){i.init.call(this)}k.exports=i,k.exports.once=A,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var r=10;function e(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(C){if(typeof C!="number"||C<0||s(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");r=C}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(P){if(typeof P!="number"||P<0||s(P))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+P+".");return this._maxListeners=P,this};function t(C){return C._maxListeners===void 0?i.defaultMaxListeners:C._maxListeners}i.prototype.getMaxListeners=function(){return t(this)},i.prototype.emit=function(P){for(var S=[],V=1;V0&&(se=S[0]),se instanceof Error)throw se;var ie=new Error("Unhandled error."+(se?" ("+se.message+")":""));throw ie.context=se,ie}var G=ne[P];if(G===void 0)return!1;if(typeof G=="function")c(G,this,S);else for(var E=G.length,T=f(G,E),V=0;V0&&se.length>B&&!se.warned){se.warned=!0;var ie=new Error("Possible EventEmitter memory leak detected. "+se.length+" "+String(P)+" listeners added. Use emitter.setMaxListeners() to increase limit");ie.name="MaxListenersExceededWarning",ie.emitter=C,ie.type=P,ie.count=se.length,h(ie)}return C}i.prototype.addListener=function(P,S){return o(this,P,S,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(P,S){return o(this,P,S,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(C,P,S){var V={fired:!1,wrapFn:void 0,target:C,type:P,listener:S},B=u.bind(V);return B.listener=S,V.wrapFn=B,B}i.prototype.once=function(P,S){return e(S),this.on(P,d(this,P,S)),this},i.prototype.prependOnceListener=function(P,S){return e(S),this.prependListener(P,d(this,P,S)),this},i.prototype.removeListener=function(P,S){var V,B,ne,se,ie;if(e(S),B=this._events,B===void 0)return this;if(V=B[P],V===void 0)return this;if(V===S||V.listener===S)--this._eventsCount===0?this._events=Object.create(null):(delete B[P],B.removeListener&&this.emit("removeListener",P,V.listener||S));else if(typeof V!="function"){for(ne=-1,se=V.length-1;se>=0;se--)if(V[se]===S||V[se].listener===S){ie=V[se].listener,ne=se;break}if(ne<0)return this;ne===0?V.shift():v(V,ne),V.length===1&&(B[P]=V[0]),B.removeListener!==void 0&&this.emit("removeListener",P,ie||S)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(P){var S,V,B;if(V=this._events,V===void 0)return this;if(V.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):V[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete V[P]),this;if(arguments.length===0){var ne=Object.keys(V),se;for(B=0;B=0;B--)this.removeListener(P,S[B]);return this};function g(C,P,S){var V=C._events;if(V===void 0)return[];var B=V[P];return B===void 0?[]:typeof B=="function"?S?[B.listener||B]:[B]:S?R(B):f(B,B.length)}i.prototype.listeners=function(P){return g(this,P,!0)},i.prototype.rawListeners=function(P){return g(this,P,!1)},i.listenerCount=function(C,P){return typeof C.listenerCount=="function"?C.listenerCount(P):_.call(C,P)},i.prototype.listenerCount=_;function _(C){var P=this._events;if(P!==void 0){var S=P[C];if(typeof S=="function")return 1;if(S!==void 0)return S.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]};function f(C,P){for(var S=new Array(P),V=0;V>1,u=-7,d=m?s-1:0,g=m?-1:1,_=p[c+d];for(d+=g,i=_&(1<<-u)-1,_>>=-u,u+=e;u>0;i=i*256+p[c+d],d+=g,u-=8);for(r=i&(1<<-u)-1,i>>=-u,u+=h;u>0;r=r*256+p[c+d],d+=g,u-=8);if(i===0)i=1-o;else{if(i===t)return r?NaN:(_?-1:1)*(1/0);r=r+Math.pow(2,h),i=i-o}return(_?-1:1)*r*Math.pow(2,i-h)},x.write=function(p,c,m,h,s,i){var r,e,t,o=i*8-s-1,u=(1<>1,g=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=h?0:i-1,f=h?1:-1,v=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(e=isNaN(c)?1:0,r=u):(r=Math.floor(Math.log(c)/Math.LN2),c*(t=Math.pow(2,-r))<1&&(r--,t*=2),r+d>=1?c+=g/t:c+=g*Math.pow(2,1-d),c*t>=2&&(r++,t/=2),r+d>=u?(e=0,r=u):r+d>=1?(e=(c*t-1)*Math.pow(2,s),r=r+d):(e=c*Math.pow(2,d-1)*Math.pow(2,s),r=0));s>=8;p[m+_]=e&255,_+=f,e/=256,s-=8);for(r=r<0;p[m+_]=r&255,_+=f,r/=256,o-=8);p[m+_-f]|=v*128}},{}],6:[function(y,k,x){(function(p,c){(function(){"use strict";let m=y("events").EventEmitter,h=y("./store"),s=y("./topic-alias-recv"),i=y("./topic-alias-send"),r=y("mqtt-packet"),e=y("./default-message-id-provider"),t=y("readable-stream").Writable,o=y("inherits"),u=y("reinterval"),d=y("rfdc/default"),g=y("./validations"),_=y("xtend"),f=y("debug")("mqttjs:client"),v=p?p.nextTick:function(E){setTimeout(E,0)},R=c.setImmediate||function(E){v(E)},A={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},W=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],j={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function C(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function P(E,T){if(E.options.protocolVersion===5&&T.cmd==="publish"){let U;T.properties&&(U=T.properties.topicAlias);let z=T.topic.toString();if(E.topicAliasSend)if(U){if(z.length!==0&&(f("applyTopicAlias :: register topic: %s - alias: %d",z,U),!E.topicAliasSend.put(z,U)))return f("applyTopicAlias :: error out of range. topic: %s - alias: %d",z,U),new Error("Sending Topic Alias out of range")}else z.length!==0&&(E.options.autoAssignTopicAlias?(U=E.topicAliasSend.getAliasByTopic(z),U?(T.topic="",T.properties=Be(Me({},T.properties),{topicAlias:U}),f("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",z,U)):(U=E.topicAliasSend.getLruAlias(),E.topicAliasSend.put(z,U),T.properties=Be(Me({},T.properties),{topicAlias:U}),f("applyTopicAlias :: auto assign topic: %s - alias: %d",z,U))):E.options.autoUseTopicAlias&&(U=E.topicAliasSend.getAliasByTopic(z),U&&(T.topic="",T.properties=Be(Me({},T.properties),{topicAlias:U}),f("applyTopicAlias :: auto use topic: %s - alias: %d",z,U))));else if(U)return f("applyTopicAlias :: error out of range. topic: %s - alias: %d",z,U),new Error("Sending Topic Alias out of range")}}function S(E,T){let U;T.properties&&(U=T.properties.topicAlias);let z=T.topic.toString();if(z.length===0){if(typeof U>"u")return new Error("Unregistered Topic Alias");if(z=E.topicAliasSend.getTopicByAlias(U),typeof z>"u")return new Error("Unregistered Topic Alias");T.topic=z}U&&delete T.properties.topicAlias}function V(E,T,U){f("sendPacket :: packet: %O",T),f("sendPacket :: emitting `packetsend`"),E.emit("packetsend",T),f("sendPacket :: writing to stream");let z=r.writeToStream(T,E.stream,E.options);f("sendPacket :: writeToStream result %s",z),!z&&U&&U!==ie?(f("sendPacket :: handle events on `drain` once through callback."),E.stream.once("drain",U)):U&&(f("sendPacket :: invoking cb"),U())}function B(E){E&&(f("flush: queue exists? %b",!!E),Object.keys(E).forEach(function(T){typeof E[T].cb=="function"&&(E[T].cb(new Error("Connection closed")),delete E[T])}))}function ne(E){E&&(f("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(E).forEach(function(T){E[T].volatile&&typeof E[T].cb=="function"&&(E[T].cb(new Error("Connection closed")),delete E[T])}))}function se(E,T,U,z){f("storeAndSend :: store packet with cmd %s to outgoingStore",T.cmd);let re=T,ee;if(re.cmd==="publish"&&(re=d(T),ee=S(E,re),ee))return U&&U(ee);E.outgoingStore.put(re,function(D){if(D)return U&&U(D);z(),V(E,T,U)})}function ie(E){f("nop ::",E)}function G(E,T){let U,z=this;if(!(this instanceof G))return new G(E,T);this.options=T||{};for(U in A)typeof this.options[U]>"u"?this.options[U]=A[U]:this.options[U]=T[U];f("MqttClient :: options.protocol",T.protocol),f("MqttClient :: options.protocolVersion",T.protocolVersion),f("MqttClient :: options.username",T.username),f("MqttClient :: options.keepalive",T.keepalive),f("MqttClient :: options.reconnectPeriod",T.reconnectPeriod),f("MqttClient :: options.rejectUnauthorized",T.rejectUnauthorized),f("MqttClient :: options.topicAliasMaximum",T.topicAliasMaximum),this.options.clientId=typeof T.clientId=="string"?T.clientId:C(),f("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=T.protocolVersion===5&&T.customHandleAcks?T.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=E,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new e:this.options.messageIdProvider,this.outgoingStore=T.outgoingStore||new h,this.incomingStore=T.incomingStore||new h,this.queueQoSZero=T.queueQoSZero===void 0?!0:T.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,T.topicAliasMaximum>0&&(T.topicAliasMaximum>65535?f("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new s(T.topicAliasMaximum)),this.on("connect",function(){let re=this.queue;function ee(){let H=re.shift();f("deliver :: entry %o",H);let D=null;if(!H){z._resubscribe();return}D=H.packet,f("deliver :: call _sendPacket for %o",D);let X=!0;D.messageId&&D.messageId!==0&&(z.messageIdProvider.register(D.messageId)||(X=!1)),X?z._sendPacket(D,function($){H.cb&&H.cb($),ee()}):(f("messageId: %d has already used. The message is skipped and removed.",D.messageId),ee())}f("connect :: sending queued packets"),ee()}),this.on("close",function(){f("close :: connected set to `false`"),this.connected=!1,f("close :: clearing connackTimer"),clearTimeout(this.connackTimer),f("close :: clearing ping timer"),z.pingTimer!==null&&(z.pingTimer.clear(),z.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),f("close :: calling _setupReconnect"),this._setupReconnect()}),m.call(this),f("MqttClient :: setting up stream"),this._setupStream()}o(G,m),G.prototype._setupStream=function(){let E=this,T=new t,U=r.parser(this.options),z=null,re=[];f("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),f("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),U.on("packet",function($){f("parser :: on packet push to packets array."),re.push($)});function ee(){if(re.length)v(H);else{let $=z;z=null,$()}}function H(){f("work :: getting next packet in queue");let $=re.shift();if($)f("work :: packet pulled from queue"),E._handlePacket($,ee);else{f("work :: no packets in queue");let oe=z;z=null,f("work :: done flag is %s",!!oe),oe&&oe()}}T._write=function($,oe,Z){z=Z,f("writable stream :: parsing buffer"),U.parse($),H()};function D($){f("streamErrorHandler :: error",$.message),W.includes($.code)?(f("streamErrorHandler :: emitting error"),E.emit("error",$)):ie($)}f("_setupStream :: pipe stream to writable stream"),this.stream.pipe(T),this.stream.on("error",D),this.stream.on("close",function(){f("(%s)stream :: on close",E.options.clientId),ne(E.outgoing),f("stream: emit close to MqttClient"),E.emit("close")}),f("_setupStream: sending packet `connect`");let X=Object.create(this.options);if(X.cmd="connect",this.topicAliasRecv&&(X.properties||(X.properties={}),this.topicAliasRecv&&(X.properties.topicAliasMaximum=this.topicAliasRecv.max)),V(this,X),U.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return E.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let $=_({cmd:"auth",reasonCode:0},this.options.authPacket);V(this,$)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){f("!!connectTimeout hit!! Calling _cleanUp with force `true`"),E._cleanUp(!0)},this.options.connectTimeout)},G.prototype._handlePacket=function(E,T){let U=this.options;if(U.protocolVersion===5&&U.properties&&U.properties.maximumPacketSize&&U.properties.maximumPacketSize0||!D())&&this._storeProcessingQueue.push({invoke:D,cbStorePut:U.cbStorePut,callback:z}),this},G.prototype.subscribe=function(){let E=this,T=new Array(arguments.length);for(let Z=0;Z0){let te={qos:Y.qos};D===5&&(te.nl=Y.nl||!1,te.rap=Y.rap||!1,te.rh=Y.rh||0,te.properties=Y.properties),E._resubscribeTopics[Y.topic]=te,M.push(Y.topic)}}),E.messageIdToTopic[F.messageId]=M}return E.outgoing[F.messageId]={volatile:!0,cb:function(M,Y){if(!M){let te=Y.granted;for(let O=0;O0||!oe())&&this._storeProcessingQueue.push({invoke:oe,callback:ee}),this},G.prototype.unsubscribe=function(){let E=this,T=new Array(arguments.length);for(let D=0;D0||!H())&&this._storeProcessingQueue.push({invoke:H,callback:z}),this},G.prototype.end=function(E,T,U){let z=this;f("end :: (%s)",this.options.clientId),(E==null||typeof E!="boolean")&&(U=T||ie,T=E,E=!1,typeof T!="object"&&(U=T,T=null,typeof U!="function"&&(U=ie))),typeof T!="object"&&(U=T,T=null),f("end :: cb? %s",!!U),U=U||ie;function re(){f("end :: closeStores: closing incoming and outgoing stores"),z.disconnected=!0,z.incomingStore.close(function(H){z.outgoingStore.close(function(D){if(f("end :: closeStores: emitting end"),z.emit("end"),U){let X=H||D;f("end :: closeStores: invoking callback with args"),U(X)}})}),z._deferredReconnect&&z._deferredReconnect()}function ee(){f("end :: (%s) :: finish :: calling _cleanUp with force %s",z.options.clientId,E),z._cleanUp(E,()=>{f("end :: finish :: calling process.nextTick on closeStores"),v(re.bind(z))},T)}return this.disconnecting?(U(),this):(this._clearReconnect(),this.disconnecting=!0,!E&&Object.keys(this.outgoing).length>0?(f("end :: (%s) :: calling finish in 10ms once outgoing is empty",z.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,ee,10))):(f("end :: (%s) :: immediately calling finish",z.options.clientId),ee()),this)},G.prototype.removeOutgoingMessage=function(E){let T=this.outgoing[E]?this.outgoing[E].cb:null;return delete this.outgoing[E],this.outgoingStore.del({messageId:E},function(){T(new Error("Message removed"))}),this},G.prototype.reconnect=function(E){f("client reconnect");let T=this,U=function(){E?(T.options.incomingStore=E.incomingStore,T.options.outgoingStore=E.outgoingStore):(T.options.incomingStore=null,T.options.outgoingStore=null),T.incomingStore=T.options.incomingStore||new h,T.outgoingStore=T.options.outgoingStore||new h,T.disconnecting=!1,T.disconnected=!1,T._deferredReconnect=null,T._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=U:U(),this},G.prototype._reconnect=function(){f("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),f("client already connected. disconnecting first.")):(f("_reconnect: calling _setupStream"),this._setupStream())},G.prototype._setupReconnect=function(){let E=this;!E.disconnecting&&!E.reconnectTimer&&E.options.reconnectPeriod>0?(this.reconnecting||(f("_setupReconnect :: emit `offline` state"),this.emit("offline"),f("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),f("_setupReconnect :: setting reconnectTimer for %d ms",E.options.reconnectPeriod),E.reconnectTimer=setInterval(function(){f("reconnectTimer :: reconnect triggered!"),E._reconnect()},E.options.reconnectPeriod)):f("_setupReconnect :: doing nothing...")},G.prototype._clearReconnect=function(){f("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},G.prototype._cleanUp=function(E,T){let U=arguments[2];if(T&&(f("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",T)),f("_cleanUp :: forced? %s",E),E)this.options.reconnectPeriod===0&&this.options.clean&&B(this.outgoing),f("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let z=_({cmd:"disconnect"},U);f("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(z,R.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(f("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(f("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),T&&!this.connected&&(f("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",T),T())},G.prototype._sendPacket=function(E,T,U){f("_sendPacket :: (%s) :: start",this.options.clientId),U=U||ie,T=T||ie;let z=P(this,E);if(z){T(z);return}if(!this.connected){if(E.cmd==="auth"){this._shiftPingInterval(),V(this,E,T);return}f("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(E,T,U);return}switch(this._shiftPingInterval(),E.cmd){case"publish":break;case"pubrel":se(this,E,T,U);return;default:V(this,E,T);return}switch(E.qos){case 2:case 1:se(this,E,T,U);break;case 0:default:V(this,E,T);break}f("_sendPacket :: (%s) :: end",this.options.clientId)},G.prototype._storePacket=function(E,T,U){f("_storePacket :: packet: %o",E),f("_storePacket :: cb? %s",!!T),U=U||ie;let z=E;if(z.cmd==="publish"){z=d(E);let re=S(this,z);if(re)return T&&T(re)}(z.qos||0)===0&&this.queueQoSZero||z.cmd!=="publish"?this.queue.push({packet:z,cb:T}):z.qos>0?(T=this.outgoing[z.messageId]?this.outgoing[z.messageId].cb:null,this.outgoingStore.put(z,function(re){if(re)return T&&T(re);U()})):T&&T(new Error("No connection to broker"))},G.prototype._setupPingTimer=function(){f("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);let E=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=u(function(){E._checkPing()},this.options.keepalive*1e3))},G.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)},G.prototype._checkPing=function(){f("_checkPing :: checking ping..."),this.pingResp?(f("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(f("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},G.prototype._handlePingresp=function(){this.pingResp=!0},G.prototype._handleConnack=function(E){f("_handleConnack");let T=this.options,z=T.protocolVersion===5?E.reasonCode:E.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,E.properties){if(E.properties.topicAliasMaximum){if(E.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}E.properties.topicAliasMaximum>0&&(this.topicAliasSend=new i(E.properties.topicAliasMaximum))}E.properties.serverKeepAlive&&T.keepalive&&(T.keepalive=E.properties.serverKeepAlive,this._shiftPingInterval()),E.properties.maximumPacketSize&&(T.properties||(T.properties={}),T.properties.maximumPacketSize=E.properties.maximumPacketSize)}if(z===0)this.reconnecting=!1,this._onConnect(E);else if(z>0){let re=new Error("Connection refused: "+j[z]);re.code=z,this.emit("error",re)}},G.prototype._handleAuth=function(E){let U=this.options.protocolVersion,z=U===5?E.reasonCode:E.returnCode;if(U!==5){let ee=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+U);ee.code=z,this.emit("error",ee);return}let re=this;this.handleAuth(E,function(ee,H){if(ee){re.emit("error",ee);return}if(z===24)re.reconnecting=!1,re._sendPacket(H);else{let D=new Error("Connection refused: "+j[z]);ee.code=z,re.emit("error",D)}})},G.prototype.handleAuth=function(E,T){T()},G.prototype._handlePublish=function(E,T){f("_handlePublish: packet %o",E),T=typeof T<"u"?T:ie;let U=E.topic.toString(),z=E.payload,re=E.qos,ee=E.messageId,H=this,D=this.options,X=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let $;if(E.properties&&($=E.properties.topicAlias),typeof $<"u")if(U.length===0)if($>0&&$<=65535){let oe=this.topicAliasRecv.getTopicByAlias($);if(oe)U=oe,f("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",U,$);else{f("_handlePublish :: unregistered topic alias. alias: %d",$),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{f("_handlePublish :: topic alias out of range. alias: %d",$),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(U,$))f("_handlePublish :: registered topic: %s - alias: %d",U,$);else{f("_handlePublish :: topic alias out of range. alias: %d",$),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(f("_handlePublish: qos %d",re),re){case 2:{D.customHandleAcks(U,z,E,function($,oe){if($ instanceof Error||(oe=$,$=null),$)return H.emit("error",$);if(X.indexOf(oe)===-1)return H.emit("error",new Error("Wrong reason code for pubrec"));oe?H._sendPacket({cmd:"pubrec",messageId:ee,reasonCode:oe},T):H.incomingStore.put(E,function(){H._sendPacket({cmd:"pubrec",messageId:ee},T)})});break}case 1:{D.customHandleAcks(U,z,E,function($,oe){if($ instanceof Error||(oe=$,$=null),$)return H.emit("error",$);if(X.indexOf(oe)===-1)return H.emit("error",new Error("Wrong reason code for puback"));oe||H.emit("message",U,z,E),H.handleMessage(E,function(Z){if(Z)return T&&T(Z);H._sendPacket({cmd:"puback",messageId:ee,reasonCode:oe},T)})});break}case 0:this.emit("message",U,z,E),this.handleMessage(E,T);break;default:f("_handlePublish: unknown QoS. Doing nothing.");break}},G.prototype.handleMessage=function(E,T){T()},G.prototype._handleAck=function(E){let T=E.messageId,U=E.cmd,z=null,re=this.outgoing[T]?this.outgoing[T].cb:null,ee=this,H;if(!re){f("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(f("_handleAck :: packet type",U),U){case"pubcomp":case"puback":{let D=E.reasonCode;D&&D>0&&D!==16&&(H=new Error("Publish error: "+j[D]),H.code=D,re(H,E)),delete this.outgoing[T],this.outgoingStore.del(E,re),this.messageIdProvider.deallocate(T),this._invokeStoreProcessingQueue();break}case"pubrec":{z={cmd:"pubrel",qos:2,messageId:T};let D=E.reasonCode;D&&D>0&&D!==16?(H=new Error("Publish error: "+j[D]),H.code=D,re(H,E)):this._sendPacket(z);break}case"suback":{delete this.outgoing[T],this.messageIdProvider.deallocate(T);for(let D=0;D0)if(this.options.resubscribe)if(this.options.protocolVersion===5){f("_resubscribe: protocolVersion 5");for(let T=0;T0){let E=this._storeProcessingQueue[0];if(E&&E.invoke())return this._storeProcessingQueue.shift(),!0}return!1},G.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},G.prototype._flushStoreProcessingQueue=function(){for(let E of this._storeProcessingQueue)E.cbStorePut&&E.cbStorePut(new Error("Connection closed")),E.callback&&E.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},k.exports=G}).call(this)}).call(this,y("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"./default-message-id-provider":12,"./store":13,"./topic-alias-recv":14,"./topic-alias-send":15,"./validations":16,_process:85,debug:20,events:4,inherits:24,"mqtt-packet":48,"readable-stream":72,reinterval:73,"rfdc/default":74,xtend:82}],7:[function(y,k,x){"use strict";let{Buffer:p}=y("buffer"),c=y("readable-stream").Transform,m=y("duplexify"),h,s,i,r=!1;function e(){let g=new c;return g._write=function(_,f,v){h.sendSocketMessage({data:_.buffer,success:function(){v()},fail:function(){v(new Error)}})},g._flush=function(f){h.closeSocket({success:function(){f()}})},g}function t(g){g.hostname||(g.hostname="localhost"),g.path||(g.path="/"),g.wsOptions||(g.wsOptions={})}function o(g,_){let f=g.protocol==="alis"?"wss":"ws",v=f+"://"+g.hostname+g.path;return g.port&&g.port!==80&&g.port!==443&&(v=f+"://"+g.hostname+":"+g.port+g.path),typeof g.transformWsUrl=="function"&&(v=g.transformWsUrl(v,g,_)),v}function u(){r||(r=!0,h.onSocketOpen(function(){i.setReadable(s),i.setWritable(s),i.emit("connect")}),h.onSocketMessage(function(g){if(typeof g.data=="string"){let _=p.from(g.data,"base64");s.push(_)}else{let _=new FileReader;_.addEventListener("load",function(){let f=_.result;f instanceof ArrayBuffer?f=p.from(f):f=p.from(f,"utf8"),s.push(f)}),_.readAsArrayBuffer(g.data)}}),h.onSocketClose(function(){i.end(),i.destroy()}),h.onSocketError(function(g){i.destroy(g)}))}function d(g,_){if(_.hostname=_.hostname||_.host,!_.hostname)throw new Error("Could not determine host. Specify host manually.");let f=_.protocolId==="MQIsdp"&&_.protocolVersion===3?"mqttv3.1":"mqtt";t(_);let v=o(_,g);return h=_.my,h.connectSocket({url:v,protocols:f}),s=e(),i=m.obj(),u(),i}k.exports=d},{buffer:3,duplexify:22,"readable-stream":72}],8:[function(y,k,x){"use strict";let p=y("net"),c=y("debug")("mqttjs:tcp");function m(h,s){s.port=s.port||1883,s.hostname=s.hostname||s.host||"localhost";let i=s.port,r=s.hostname;return c("port %d and host %s",i,r),p.createConnection(i,r)}k.exports=m},{debug:20,net:2}],9:[function(y,k,x){"use strict";let p=y("tls"),c=y("net"),m=y("debug")("mqttjs:tls");function h(s,i){i.port=i.port||8883,i.host=i.hostname||i.host||"localhost",c.isIP(i.host)===0&&(i.servername=i.host),i.rejectUnauthorized=i.rejectUnauthorized!==!1,delete i.path,m("port %d host %s rejectUnauthorized %b",i.port,i.host,i.rejectUnauthorized);let r=p.connect(i);r.on("secureConnect",function(){i.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",e)});function e(t){i.rejectUnauthorized&&s.emit("error",t),r.end()}return r.on("error",e),r}k.exports=h},{debug:20,net:2,tls:2}],10:[function(y,k,x){(function(p){(function(){"use strict";let{Buffer:c}=y("buffer"),m=y("ws"),h=y("debug")("mqttjs:ws"),s=y("duplexify"),i=y("readable-stream").Transform,r=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],e=typeof p<"u"&&p.title==="browser"||typeof __webpack_require__=="function";function t(v,R){let A=v.protocol+"://"+v.hostname+":"+v.port+v.path;return typeof v.transformWsUrl=="function"&&(A=v.transformWsUrl(A,v,R)),A}function o(v){let R=v;return v.hostname||(R.hostname="localhost"),v.port||(v.protocol==="wss"?R.port=443:R.port=80),v.path||(R.path="/"),v.wsOptions||(R.wsOptions={}),!e&&v.protocol==="wss"&&r.forEach(function(A){Object.prototype.hasOwnProperty.call(v,A)&&!Object.prototype.hasOwnProperty.call(v.wsOptions,A)&&(R.wsOptions[A]=v[A])}),R}function u(v){let R=o(v);if(R.hostname||(R.hostname=R.host),!R.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let A=new URL(document.URL);R.hostname=A.hostname,R.port||(R.port=A.port)}return R.objectMode===void 0&&(R.objectMode=!(R.binary===!0||R.binary===void 0)),R}function d(v,R,A){h("createWebSocket"),h("protocol: "+A.protocolId+" "+A.protocolVersion);let W=A.protocolId==="MQIsdp"&&A.protocolVersion===3?"mqttv3.1":"mqtt";return h("creating new Websocket for url: "+R+" and protocol: "+W),new m(R,[W],A.wsOptions)}function g(v,R){let A=R.protocolId==="MQIsdp"&&R.protocolVersion===3?"mqttv3.1":"mqtt",W=t(R,v),j=new WebSocket(W,[A]);return j.binaryType="arraybuffer",j}function _(v,R){h("streamBuilder");let A=o(R),W=t(A,v),j=d(v,W,A),C=m.createWebSocketStream(j,A.wsOptions);return C.url=W,j.on("close",()=>{C.destroy()}),C}function f(v,R){h("browserStreamBuilder");let A,j=u(R).browserBufferSize||1024*512,C=R.browserBufferTimeout||1e3,P=!R.objectMode,S=g(v,R),V=ne(R,U,z);R.objectMode||(V._writev=T),V.on("close",()=>{S.close()});let B=typeof S.addEventListener<"u";S.readyState===S.OPEN?A=V:(A=A=s(void 0,void 0,R),R.objectMode||(A._writev=T),B?S.addEventListener("open",se):S.onopen=se),A.socket=S,B?(S.addEventListener("close",ie),S.addEventListener("error",G),S.addEventListener("message",E)):(S.onclose=ie,S.onerror=G,S.onmessage=E);function ne(re,ee,H){let D=new i({objectModeMode:re.objectMode});return D._write=ee,D._flush=H,D}function se(){A.setReadable(V),A.setWritable(V),A.emit("connect")}function ie(){A.end(),A.destroy()}function G(re){A.destroy(re)}function E(re){let ee=re.data;ee instanceof ArrayBuffer?ee=c.from(ee):ee=c.from(ee,"utf8"),V.push(ee)}function T(re,ee){let H=new Array(re.length);for(let D=0;Dj&&setTimeout(U,C,re,ee,H),P&&typeof re=="string"&&(re=c.from(re,"utf8"));try{S.send(re)}catch(D){return H(D)}H()}function z(re){S.close(),re()}return A}e?k.exports=f:k.exports=_}).call(this)}).call(this,y("_process"))},{_process:85,buffer:3,debug:20,duplexify:22,"readable-stream":72,ws:81}],11:[function(y,k,x){"use strict";let{Buffer:p}=y("buffer"),c=y("readable-stream").Transform,m=y("duplexify"),h,s,i;function r(){let d=new c;return d._write=function(g,_,f){h.send({data:g.buffer,success:function(){f()},fail:function(v){f(new Error(v))}})},d._flush=function(_){h.close({success:function(){_()}})},d}function e(d){d.hostname||(d.hostname="localhost"),d.path||(d.path="/"),d.wsOptions||(d.wsOptions={})}function t(d,g){let _=d.protocol==="wxs"?"wss":"ws",f=_+"://"+d.hostname+d.path;return d.port&&d.port!==80&&d.port!==443&&(f=_+"://"+d.hostname+":"+d.port+d.path),typeof d.transformWsUrl=="function"&&(f=d.transformWsUrl(f,d,g)),f}function o(){h.onOpen(function(){i.setReadable(s),i.setWritable(s),i.emit("connect")}),h.onMessage(function(d){let g=d.data;g instanceof ArrayBuffer?g=p.from(g):g=p.from(g,"utf8"),s.push(g)}),h.onClose(function(){i.end(),i.destroy()}),h.onError(function(d){i.destroy(new Error(d.errMsg))})}function u(d,g){if(g.hostname=g.hostname||g.host,!g.hostname)throw new Error("Could not determine host. Specify host manually.");let _=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt";e(g);let f=t(g,d);h=wx.connectSocket({url:f,protocols:[_]}),s=r(),i=m.obj(),i._destroy=function(R,A){h.close({success:function(){A&&A(R)}})};let v=i.destroy;return i.destroy=(function(){i.destroy=v;let R=this;setTimeout(function(){h.close({fail:function(){R._destroy(new Error)}})},0)}).bind(i),o(),i}k.exports=u},{buffer:3,duplexify:22,"readable-stream":72}],12:[function(y,k,x){"use strict";function p(){if(!(this instanceof p))return new p;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}p.prototype.allocate=function(){let c=this.nextId++;return this.nextId===65536&&(this.nextId=1),c},p.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},p.prototype.register=function(c){return!0},p.prototype.deallocate=function(c){},p.prototype.clear=function(){},k.exports=p},{}],13:[function(y,k,x){"use strict";let p=y("xtend"),c=y("readable-stream").Readable,m={objectMode:!0},h={clean:!0};function s(i){if(!(this instanceof s))return new s(i);this.options=i||{},this.options=p(h,i),this._inflights=new Map}s.prototype.put=function(i,r){return this._inflights.set(i.messageId,i),r&&r(),this},s.prototype.createStream=function(){let i=new c(m),r=[],e=!1,t=0;return this._inflights.forEach(function(o,u){r.push(o)}),i._read=function(){!e&&tthis.max?!1:(this.aliasToTopic[m]=c,this.length=Object.keys(this.aliasToTopic).length,!0)},p.prototype.getTopicByAlias=function(c){return this.aliasToTopic[c]},p.prototype.clear=function(){this.aliasToTopic={}},k.exports=p},{}],15:[function(y,k,x){"use strict";let p=y("lru-cache"),c=y("number-allocator").NumberAllocator;function m(h){if(!(this instanceof m))return new m(h);h>0&&(this.aliasToTopic=new p({max:h}),this.topicToAlias={},this.numberAllocator=new c(1,h),this.max=h,this.length=0)}m.prototype.put=function(h,s){if(s===0||s>this.max)return!1;let i=this.aliasToTopic.get(s);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(s,h),this.topicToAlias[h]=s,this.numberAllocator.use(s),this.length=this.aliasToTopic.length,!0},m.prototype.getTopicByAlias=function(h){return this.aliasToTopic.get(h)},m.prototype.getAliasByTopic=function(h){let s=this.topicToAlias[h];return typeof s<"u"&&this.aliasToTopic.get(s),s},m.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},m.prototype.getLruAlias=function(){let h=this.numberAllocator.firstVacant();return h||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},k.exports=m},{"lru-cache":45,"number-allocator":54}],16:[function(y,k,x){"use strict";function p(m){let h=m.split("/");for(let s=0;sthis.length||s<0)return;let i=this._offset(s);return this._bufs[i[0]][i[1]]},m.prototype.slice=function(s,i){return typeof s=="number"&&s<0&&(s+=this.length),typeof i=="number"&&i<0&&(i+=this.length),this.copy(null,0,s,i)},m.prototype.copy=function(s,i,r,e){if((typeof r!="number"||r<0)&&(r=0),(typeof e!="number"||e>this.length)&&(e=this.length),r>=this.length||e<=0)return s||p.alloc(0);let t=!!s,o=this._offset(r),u=e-r,d=u,g=t&&i||0,_=o[1];if(r===0&&e===this.length){if(!t)return this._bufs.length===1?this._bufs[0]:p.concat(this._bufs,this.length);for(let f=0;fv)this._bufs[f].copy(s,g,_),g+=v;else{this._bufs[f].copy(s,g,_,_+d),g+=v;break}d-=v,_&&(_=0)}return s.length>g?s.slice(0,g):s},m.prototype.shallowSlice=function(s,i){if(s=s||0,i=typeof i!="number"?this.length:i,s<0&&(s+=this.length),i<0&&(i+=this.length),s===i)return this._new();let r=this._offset(s),e=this._offset(i),t=this._bufs.slice(r[0],e[0]+1);return e[1]===0?t.pop():t[t.length-1]=t[t.length-1].slice(0,e[1]),r[1]!==0&&(t[0]=t[0].slice(r[1])),this._new(t)},m.prototype.toString=function(s,i,r){return this.slice(i,r).toString(s)},m.prototype.consume=function(s){if(s=Math.trunc(s),Number.isNaN(s)||s<=0)return this;for(;this._bufs.length;)if(s>=this._bufs[0].length)s-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(s),this.length-=s;break}return this},m.prototype.duplicate=function(){let s=this._new();for(let i=0;ithis.length?this.length:s;let r=this._offset(s),e=r[0],t=r[1];for(;e=h.length){let d=o.indexOf(h,t);if(d!==-1)return this._reverseOffset([e,d]);t=o.length-h.length+1}else{let d=this._reverseOffset([e,t]);if(this._match(d,h))return d;t++}t=0}return-1},m.prototype._match=function(h,s){if(this.length-h{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),x.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function c(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function m(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+k.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let o=0,u=0;e[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(o++,d==="%c"&&(u=o))}),e.splice(u,0,t)}x.log=console.debug||console.log||(()=>{});function h(e){try{e?x.storage.setItem("debug",e):x.storage.removeItem("debug")}catch{}}function s(){let e;try{e=x.storage.getItem("debug")}catch{}return!e&&typeof p<"u"&&"env"in p&&(e=p.env.DEBUG),e}function i(){try{return localStorage}catch{}}k.exports=y("./common")(x);let{formatters:r}=k.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this)}).call(this,y("_process"))},{"./common":21,_process:85}],21:[function(y,k,x){function p(c){h.debug=h,h.default=h,h.coerce=o,h.disable=r,h.enable=i,h.enabled=e,h.humanize=y("ms"),h.destroy=u,Object.keys(c).forEach(d=>{h[d]=c[d]}),h.names=[],h.skips=[],h.formatters={};function m(d){let g=0;for(let _=0;_{if(V==="%%")return"%";P++;let ne=h.formatters[B];if(typeof ne=="function"){let se=A[P];V=ne.call(W,se),A.splice(P,1),P--}return V}),h.formatArgs.call(W,A),(W.log||h.log).apply(W,A)}return R.namespace=d,R.useColors=h.useColors(),R.color=h.selectColor(d),R.extend=s,R.destroy=h.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(f!==h.namespaces&&(f=h.namespaces,v=h.enabled(d)),v),set:A=>{_=A}}),typeof h.init=="function"&&h.init(R),R}function s(d,g){let _=h(this.namespace+(typeof g>"u"?":":g)+d);return _.log=this.log,_}function i(d){h.save(d),h.namespaces=d,h.names=[],h.skips=[];let g,_=(typeof d=="string"?d:"").split(/[\s,]+/),f=_.length;for(g=0;g"-"+g)].join(",");return h.enable(""),d}function e(d){if(d[d.length-1]==="*")return!0;let g,_;for(g=0,_=h.skips.length;g<_;g++)if(h.skips[g].test(d))return!1;for(g=0,_=h.names.length;g<_;g++)if(h.names[g].test(d))return!0;return!1}function t(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function o(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}k.exports=p},{ms:53}],22:[function(y,k,x){(function(p,c){(function(){var m=y("readable-stream"),h=y("end-of-stream"),s=y("inherits"),i=y("stream-shift"),r=c.from&&c.from!==Uint8Array.from?c.from([0]):new c([0]),e=function(f,v){f._corked?f.once("uncork",v):v()},t=function(f,v){f._autoDestroy&&f.destroy(v)},o=function(f,v){return function(R){R?t(f,R.message==="premature close"?null:R):v&&!f._ended&&f.end()}},u=function(f,v){if(!f||f._writableState&&f._writableState.finished)return v();if(f._writableState)return f.end(v);f.end(),v()},d=function(){},g=function(f){return new m.Readable({objectMode:!0,highWaterMark:16}).wrap(f)},_=function(f,v,R){if(!(this instanceof _))return new _(f,v,R);m.Duplex.call(this,R),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!R||R.autoDestroy!==!1,this._forwardDestroy=!R||R.destroy!==!1,this._forwardEnd=!R||R.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,f&&this.setWritable(f),v&&this.setReadable(v)};s(_,m.Duplex),_.obj=function(f,v,R){return R||(R={}),R.objectMode=!0,R.highWaterMark=16,new _(f,v,R)},_.prototype.cork=function(){++this._corked===1&&this.emit("cork")},_.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},_.prototype.setWritable=function(f){if(this._unwrite&&this._unwrite(),this.destroyed){f&&f.destroy&&f.destroy();return}if(f===null||f===!1){this.end();return}var v=this,R=h(f,{writable:!0,readable:!1},o(this,this._forwardEnd)),A=function(){var j=v._ondrain;v._ondrain=null,j&&j()},W=function(){v._writable.removeListener("drain",A),R()};this._unwrite&&p.nextTick(A),this._writable=f,this._writable.on("drain",A),this._unwrite=W,this.uncork()},_.prototype.setReadable=function(f){if(this._unread&&this._unread(),this.destroyed){f&&f.destroy&&f.destroy();return}if(f===null||f===!1){this.push(null),this.resume();return}var v=this,R=h(f,{writable:!1,readable:!0},o(this)),A=function(){v._forward()},W=function(){v.push(null)},j=function(){v._readable2.removeListener("readable",A),v._readable2.removeListener("end",W),R()};this._drained=!0,this._readable=f,this._readable2=f._readableState?f:g(f),this._readable2.on("readable",A),this._readable2.on("end",W),this._unread=j,this._forward()},_.prototype._read=function(){this._drained=!0,this._forward()},_.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var f;this._drained&&(f=i(this._readable2))!==null;)this.destroyed||(this._drained=this.push(f));this._forwarding=!1}},_.prototype.destroy=function(f,v){if(v||(v=d),this.destroyed)return v(null);this.destroyed=!0;var R=this;p.nextTick(function(){R._destroy(f),v(null)})},_.prototype._destroy=function(f){if(f){var v=this._ondrain;this._ondrain=null,v?v(f):this.emit("error",f)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},_.prototype._write=function(f,v,R){if(!this.destroyed){if(this._corked)return e(this,this._write.bind(this,f,v,R));if(f===r)return this._finish(R);if(!this._writable)return R();this._writable.write(f)===!1?this._ondrain=R:this.destroyed||R()}},_.prototype._finish=function(f){var v=this;this.emit("preend"),e(this,function(){u(v._forwardEnd&&v._writable,function(){v._writableState.prefinished===!1&&(v._writableState.prefinished=!0),v.emit("prefinish"),e(v,f)})})},_.prototype.end=function(f,v,R){return typeof f=="function"?this.end(null,null,f):typeof v=="function"?this.end(f,null,v):(this._ended=!0,f&&this.write(f),!this._writableState.ending&&!this._writableState.destroyed&&this.write(r),m.Writable.prototype.end.call(this,R))},k.exports=_}).call(this)}).call(this,y("_process"),y("buffer").Buffer)},{_process:85,buffer:3,"end-of-stream":23,inherits:24,"readable-stream":72,"stream-shift":77}],23:[function(y,k,x){(function(p){(function(){var c=y("once"),m=function(){},h=function(r){return r.setHeader&&typeof r.abort=="function"},s=function(r){return r.stdio&&Array.isArray(r.stdio)&&r.stdio.length===3},i=function(r,e,t){if(typeof e=="function")return i(r,null,e);e||(e={}),t=c(t||m);var o=r._writableState,u=r._readableState,d=e.readable||e.readable!==!1&&r.readable,g=e.writable||e.writable!==!1&&r.writable,_=!1,f=function(){r.writable||v()},v=function(){g=!1,d||t.call(r)},R=function(){d=!1,g||t.call(r)},A=function(S){t.call(r,S?new Error("exited with error code: "+S):null)},W=function(S){t.call(r,S)},j=function(){p.nextTick(C)},C=function(){if(!_){if(d&&!(u&&u.ended&&!u.destroyed))return t.call(r,new Error("premature close"));if(g&&!(o&&o.ended&&!o.destroyed))return t.call(r,new Error("premature close"))}},P=function(){r.req.on("finish",v)};return h(r)?(r.on("complete",v),r.on("abort",j),r.req?P():r.on("request",P)):g&&!o&&(r.on("end",f),r.on("close",f)),s(r)&&r.on("exit",A),r.on("end",R),r.on("finish",v),e.error!==!1&&r.on("error",W),r.on("close",j),function(){_=!0,r.removeListener("complete",v),r.removeListener("abort",j),r.removeListener("request",P),r.req&&r.req.removeListener("finish",v),r.removeListener("end",f),r.removeListener("close",f),r.removeListener("finish",v),r.removeListener("exit",A),r.removeListener("end",R),r.removeListener("error",W),r.removeListener("close",j)}};k.exports=i}).call(this)}).call(this,y("_process"))},{_process:85,once:56}],24:[function(y,k,x){typeof Object.create=="function"?k.exports=function(c,m){m&&(c.super_=m,c.prototype=Object.create(m.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:k.exports=function(c,m){if(m){c.super_=m;var h=function(){};h.prototype=m.prototype,c.prototype=new h,c.prototype.constructor=c}}},{}],25:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.ContainerIterator=x.Container=x.Base=void 0;class p{constructor(s=0){this.iteratorType=s}equals(s){return this.o===s.o}}x.ContainerIterator=p;class c{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}}x.Base=c;class m extends c{}x.Container=m},{}],26:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.HashContainerIterator=x.HashContainer=void 0;var p=y("../../ContainerBase"),c=h(y("../../../utils/checkObject")),m=y("../../../utils/throwError");function h(r){return r&&r.t?r:{default:r}}class s extends p.ContainerIterator{constructor(e,t,o){super(o),this.o=e,this.h=t,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,m.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,m.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,m.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,m.throwIteratorAccessError)(),this.o=this.o.L,this})}}x.HashContainerIterator=s;class i extends p.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:t,B:o}=e;t.B=o,o.L=t,e===this.p&&(this.p=o),e===this._&&(this._=t),this.i-=1}M(e,t,o){o===void 0&&(o=(0,c.default)(e));let u;if(o){let d=e[this.HASH_TAG];if(d!==void 0)return this.H[d].l=t,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),u={u:e,l:t,L:this._,B:this.h},this.H.push(u)}else{let d=this.g[e];if(d)return d.l=t,this.i;u={u:e,l:t,L:this._,B:this.h},this.g[e]=u}return this.i===0?(this.p=u,this.h.B=u):this._.B=u,this._=u,this.h.L=u,++this.i}I(e,t){if(t===void 0&&(t=(0,c.default)(e)),t){let o=e[this.HASH_TAG];return o===void 0?this.h:this.H[o]}else return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(t){delete t.u[e]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,t){let o;if(t===void 0&&(t=(0,c.default)(e)),t){let u=e[this.HASH_TAG];if(u===void 0)return!1;delete e[this.HASH_TAG],o=this.H[u],delete this.H[u]}else{if(o=this.g[e],o===void 0)return!1;delete this.g[e]}return this.V(o),!0}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,m.throwIteratorAccessError)(),this.V(t),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}}x.HashContainer=i},{"../../../utils/checkObject":43,"../../../utils/throwError":44,"../../ContainerBase":25}],27:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.default=void 0;var p=y("./Base"),c=h(y("../../utils/checkObject")),m=y("../../utils/throwError");function h(e){return e&&e.t?e:{default:e}}class s extends p.HashContainerIterator{constructor(t,o,u,d){super(t,o,d),this.container=u}get pointer(){this.o===this.h&&(0,m.throwIteratorAccessError)();let t=this;return new Proxy([],{get(o,u){if(u==="0")return t.o.u;if(u==="1")return t.o.l},set(o,u,d){if(u!=="1")throw new TypeError("props must be 1");return t.o.l=d,!0}})}copy(){return new s(this.o,this.h,this.container,this.iteratorType)}}class i extends p.HashContainer{constructor(t=[]){super();let o=this;t.forEach(function(u){o.setElement(u[0],u[1])})}begin(){return new s(this.p,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this._,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(t,o,u){return this.M(t,o,u)}getElementByKey(t,o){if(o===void 0&&(o=(0,c.default)(t)),o){let d=t[this.HASH_TAG];return d!==void 0?this.H[d].l:void 0}let u=this.g[t];return u?u.l:void 0}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let o=this.p;for(;t--;)o=o.B;return[o.u,o.l]}find(t,o){let u=this.I(t,o);return new s(u,this.h,this)}forEach(t){let o=0,u=this.p;for(;u!==this.h;)t([u.u,u.l],o++,this),u=u.B}[Symbol.iterator](){return(function*(){let t=this.p;for(;t!==this.h;)yield[t.u,t.l],t=t.B}).bind(this)()}}var r=i;x.default=r},{"../../utils/checkObject":43,"../../utils/throwError":44,"./Base":26}],28:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.default=void 0;var p=y("./Base"),c=y("../../utils/throwError");class m extends p.HashContainerIterator{constructor(r,e,t,o){super(r,e,o),this.container=t}get pointer(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o.u}copy(){return new m(this.o,this.h,this.container,this.iteratorType)}}class h extends p.HashContainer{constructor(r=[]){super();let e=this;r.forEach(function(t){e.insert(t)})}begin(){return new m(this.p,this.h,this)}end(){return new m(this.h,this.h,this)}rBegin(){return new m(this._,this.h,this,1)}rEnd(){return new m(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(r,e){return this.M(r,void 0,e)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e=this.p;for(;r--;)e=e.B;return e.u}find(r,e){let t=this.I(r,e);return new m(t,this.h,this)}forEach(r){let e=0,t=this.p;for(;t!==this.h;)r(t.u,e++,this),t=t.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}}var s=h;x.default=s},{"../../utils/throwError":44,"./Base":26}],29:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.default=void 0;var p=y("../ContainerBase");class c extends p.Base{constructor(s=[],i=function(e,t){return e>t?-1:e>1;for(let t=this.i-1>>1;t>=0;--t)this.k(t,e)}m(s){let i=this.C[s];for(;s>0;){let r=s-1>>1,e=this.C[r];if(this.v(e,i)<=0)break;this.C[s]=e,s=r}this.C[s]=i}k(s,i){let r=this.C[s];for(;s0&&(e=t,o=this.C[t]),this.v(o,r)>=0)break;this.C[s]=o,s=e}this.C[s]=r}clear(){this.i=0,this.C.length=0}push(s){this.C.push(s),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let s=this.C[0],i=this.C.pop();return this.i-=1,this.i&&(this.C[0]=i,this.k(0,this.i>>1)),s}top(){return this.C[0]}find(s){return this.C.indexOf(s)>=0}remove(s){let i=this.C.indexOf(s);return i<0?!1:(i===0?this.pop():i===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(i,1,this.C.pop()),this.i-=1,this.m(i),this.k(i,this.i>>1)),!0)}updateItem(s){let i=this.C.indexOf(s);return i<0?!1:(this.m(i),this.k(i,this.i>>1),!0)}toArray(){return[...this.C]}}var m=c;x.default=m},{"../ContainerBase":25}],30:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.default=void 0;var p=y("../ContainerBase");class c extends p.Base{constructor(s=[]){super(),this.j=0,this.q=[];let i=this;s.forEach(function(r){i.push(r)})}clear(){this.q=[],this.i=this.j=0}push(s){let i=this.q.length;if(this.j/i>.5&&this.j+this.i>=i&&i>4096){let r=this.i;for(let e=0;e{if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.size=="function")return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(o/this.F),1);for(let g=0;g>1)-(u>>1),this.D=this.N=this.F-o%this.F>>1;let d=this;e.forEach(function(g){d.pushBack(g)})}T(){let e=[],t=Math.max(this.P>>1,1);for(let o=0;o>1}begin(){return new h(0,this)}end(){return new h(this.i,this)}rBegin(){return new h(this.i-1,this,1)}rEnd(){return new h(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(this.i===0)return;let e=this.A[this.j][this.D];return this.i!==1&&(this.Dthis.i-1)throw new RangeError;let{curNodeBucketIndex:t,curNodePointerIndex:o}=this.O(e);return this.A[t][o]}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:o,curNodePointerIndex:u}=this.O(e);this.A[o][u]=t}insert(e,t,o=1){if(e<0||e>this.i)throw new RangeError;if(e===0)for(;o--;)this.pushFront(t);else if(e===this.i)for(;o--;)this.pushBack(t);else{let u=[];for(let d=e;dthis.i-1)throw new RangeError;if(e===0)this.popFront();else if(e===this.i-1)this.popBack();else{let t=[];for(let u=e+1;ue;)this.popBack();return this.i}sort(e){let t=[];for(let o=0;othis.i-1)throw new RangeError;let o=this.p;for(;t--;)o=o.B;return o.l}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let o=this.p;for(;t--;)o=o.B;return this.V(o),this.i}eraseElementByValue(t){let o=this.p;for(;o!==this.h;)o.l===t&&this.V(o),o=o.B;return this.i}eraseElementByIterator(t){let o=t.o;return o===this.h&&(0,m.throwIteratorAccessError)(),t=t.next(),this.V(o),t}pushBack(t){return this.G(t,this._),this.i}popBack(){if(this.i===0)return;let t=this._.l;return this.V(this._),t}pushFront(t){return this.G(t,this.h),this.i}popFront(){if(this.i===0)return;let t=this.p.l;return this.V(this.p),t}setElementByPos(t,o){if(t<0||t>this.i-1)throw new RangeError;let u=this.p;for(;t--;)u=u.B;u.l=o}insert(t,o,u=1){if(t<0||t>this.i)throw new RangeError;if(u<=0)return this.i;if(t===0)for(;u--;)this.pushFront(o);else if(t===this.i)for(;u--;)this.pushBack(o);else{let d=this.p;for(let _=1;_this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let t=0;for(let o=0;othis.i-1)throw new RangeError;this.J[e]=t}insert(e,t,o=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(o).fill(t)),this.i+=o,this.i}find(e){for(let t=0;to?1:0},e=!1){super(),this.Y=void 0,this.v=r,e?(this.re=p.TreeNodeEnableIndex,this.M=function(t,o,u){let d=this.ne(t,o,u);if(d){let g=d.tt;for(;g!==this.h;)g.rt+=1,g=g.tt;let _=this.he(d);if(_){let{parentNode:f,grandParent:v,curNode:R}=_;f.ie(),v.ie(),R.ie()}}return this.i},this.V=function(t){let o=this.fe(t);for(;o!==this.h;)o.rt-=1,o=o.tt}):(this.re=p.TreeNode,this.M=function(t,o,u){let d=this.ne(t,o,u);return d&&this.he(d),this.i},this.V=this.fe),this.h=new this.re}X(r,e){let t=this.h;for(;r;){let o=this.v(r.u,e);if(o<0)r=r.W;else if(o>0)t=r,r=r.U;else return r}return t}Z(r,e){let t=this.h;for(;r;)this.v(r.u,e)<=0?r=r.W:(t=r,r=r.U);return t}$(r,e){let t=this.h;for(;r;){let o=this.v(r.u,e);if(o<0)t=r,r=r.W;else if(o>0)r=r.U;else return r}return t}rr(r,e){let t=this.h;for(;r;)this.v(r.u,e)<0?(t=r,r=r.W):r=r.U;return t}ue(r){for(;;){let e=r.tt;if(e===this.h)return;if(r.ee===1){r.ee=0;return}if(r===e.U){let t=e.W;if(t.ee===1)t.ee=0,e.ee=1,e===this.Y?this.Y=e.te():e.te();else if(t.W&&t.W.ee===1){t.ee=e.ee,e.ee=0,t.W.ee=0,e===this.Y?this.Y=e.te():e.te();return}else t.U&&t.U.ee===1?(t.ee=1,t.U.ee=0,t.se()):(t.ee=1,r=e)}else{let t=e.U;if(t.ee===1)t.ee=0,e.ee=1,e===this.Y?this.Y=e.se():e.se();else if(t.U&&t.U.ee===1){t.ee=e.ee,e.ee=0,t.U.ee=0,e===this.Y?this.Y=e.se():e.se();return}else t.W&&t.W.ee===1?(t.ee=1,t.W.ee=0,t.te()):(t.ee=1,r=e)}}}fe(r){if(this.i===1)return this.clear(),this.h;let e=r;for(;e.U||e.W;){if(e.W)for(e=e.W;e.U;)e=e.U;else e=e.U;[r.u,e.u]=[e.u,r.u],[r.l,e.l]=[e.l,r.l],r=e}this.h.U===e?this.h.U=e.tt:this.h.W===e&&(this.h.W=e.tt),this.ue(e);let t=e.tt;return e===t.U?t.U=void 0:t.W=void 0,this.i-=1,this.Y.ee=0,t}oe(r,e){return r===void 0?!1:this.oe(r.U,e)||e(r)?!0:this.oe(r.W,e)}he(r){for(;;){let e=r.tt;if(e.ee===0)return;let t=e.tt;if(e===t.U){let o=t.W;if(o&&o.ee===1){if(o.ee=e.ee=0,t===this.Y)return;t.ee=1,r=t;continue}else if(r===e.W){if(r.ee=0,r.U&&(r.U.tt=e),r.W&&(r.W.tt=t),e.W=r.U,t.U=r.W,r.U=e,r.W=t,t===this.Y)this.Y=r,this.h.tt=r;else{let u=t.tt;u.U===t?u.U=r:u.W=r}return r.tt=t.tt,e.tt=r,t.tt=r,t.ee=1,{parentNode:e,grandParent:t,curNode:r}}else e.ee=0,t===this.Y?this.Y=t.se():t.se(),t.ee=1}else{let o=t.U;if(o&&o.ee===1){if(o.ee=e.ee=0,t===this.Y)return;t.ee=1,r=t;continue}else if(r===e.U){if(r.ee=0,r.U&&(r.U.tt=t),r.W&&(r.W.tt=e),t.W=r.U,e.U=r.W,r.U=t,r.W=e,t===this.Y)this.Y=r,this.h.tt=r;else{let u=t.tt;u.U===t?u.U=r:u.W=r}return r.tt=t.tt,e.tt=r,t.tt=r,t.ee=1,{parentNode:e,grandParent:t,curNode:r}}else e.ee=0,t===this.Y?this.Y=t.te():t.te(),t.ee=1}return}}ne(r,e,t){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,e),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let o,u=this.h.U,d=this.v(u.u,r);if(d===0){u.l=e;return}else if(d>0)u.U=new this.re(r,e),u.U.tt=u,o=u.U,this.h.U=o;else{let g=this.h.W,_=this.v(g.u,r);if(_===0){g.l=e;return}else if(_<0)g.W=new this.re(r,e),g.W.tt=g,o=g.W,this.h.W=o;else{if(t!==void 0){let f=t.o;if(f!==this.h){let v=this.v(f.u,r);if(v===0){f.l=e;return}else if(v>0){let R=f.L(),A=this.v(R.u,r);if(A===0){R.l=e;return}else A<0&&(o=new this.re(r,e),R.W===void 0?(R.W=o,o.tt=R):(f.U=o,o.tt=f))}}}if(o===void 0)for(o=this.Y;;){let f=this.v(o.u,r);if(f>0){if(o.U===void 0){o.U=new this.re(r,e),o.U.tt=o,o=o.U;break}o=o.U}else if(f<0){if(o.W===void 0){o.W=new this.re(r,e),o.W.tt=o,o=o.W;break}o=o.W}else{o.l=e;return}}}}return this.i+=1,o}I(r,e){for(;r;){let t=this.v(r.u,e);if(t<0)r=r.W;else if(t>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,e){let t=r.o;if(t===this.h&&(0,m.throwIteratorAccessError)(),this.i===1)return t.u=e,!0;if(t===this.h.U)return this.v(t.B().u,e)>0?(t.u=e,!0):!1;if(t===this.h.W)return this.v(t.L().u,e)<0?(t.u=e,!0):!1;let o=t.L().u;if(this.v(o,e)>=0)return!1;let u=t.B().u;return this.v(u,e)<=0?!1:(t.u=e,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e=0,t=this;return this.oe(this.Y,function(o){return r===e?(t.V(o),!0):(e+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let e=this.I(this.Y,r);return e===this.h?!1:(this.V(e),!0)}eraseElementByIterator(r){let e=r.o;e===this.h&&(0,m.throwIteratorAccessError)();let t=e.W===void 0;return r.iteratorType===0?t&&r.next():(!t||e.U===void 0)&&r.next(),this.V(e),r}forEach(r){let e=0;for(let t of this)r(t,e++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e,t=0;for(let o of this){if(t===r){e=o;break}t+=1}return e}getHeight(){if(this.i===0)return 0;let r=function(e){return e?Math.max(r(e.U),r(e.W))+1:0};return r(this.Y)}}var s=h;x.default=s},{"../../../utils/throwError":44,"../../ContainerBase":25,"./TreeNode":38}],40:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.default=void 0;var p=h(y("./Base")),c=h(y("./Base/TreeIterator")),m=y("../../utils/throwError");function h(e){return e&&e.t?e:{default:e}}class s extends c.default{constructor(t,o,u,d){super(t,o,d),this.container=u}get pointer(){this.o===this.h&&(0,m.throwIteratorAccessError)();let t=this;return new Proxy([],{get(o,u){if(u==="0")return t.o.u;if(u==="1")return t.o.l},set(o,u,d){if(u!=="1")throw new TypeError("props must be 1");return t.o.l=d,!0}})}copy(){return new s(this.o,this.h,this.container,this.iteratorType)}}class i extends p.default{constructor(t=[],o,u){super(o,u);let d=this;t.forEach(function(g){d.setElement(g[0],g[1])})}*K(t){t!==void 0&&(yield*Ie(this.K(t.U)),yield[t.u,t.l],yield*Ie(this.K(t.W)))}begin(){return new s(this.h.U||this.h,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this.h.W||this.h,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){if(this.i===0)return;let t=this.h.U;return[t.u,t.l]}back(){if(this.i===0)return;let t=this.h.W;return[t.u,t.l]}lowerBound(t){let o=this.X(this.Y,t);return new s(o,this.h,this)}upperBound(t){let o=this.Z(this.Y,t);return new s(o,this.h,this)}reverseLowerBound(t){let o=this.$(this.Y,t);return new s(o,this.h,this)}reverseUpperBound(t){let o=this.rr(this.Y,t);return new s(o,this.h,this)}setElement(t,o,u){return this.M(t,o,u)}find(t){let o=this.I(this.Y,t);return new s(o,this.h,this)}getElementByKey(t){return this.I(this.Y,t).l}union(t){let o=this;return t.forEach(function(u){o.setElement(u[0],u[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var r=i;x.default=r},{"../../utils/throwError":44,"./Base":39,"./Base/TreeIterator":37}],41:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.default=void 0;var p=h(y("./Base")),c=h(y("./Base/TreeIterator")),m=y("../../utils/throwError");function h(e){return e&&e.t?e:{default:e}}class s extends c.default{constructor(t,o,u,d){super(t,o,d),this.container=u}get pointer(){return this.o===this.h&&(0,m.throwIteratorAccessError)(),this.o.u}copy(){return new s(this.o,this.h,this.container,this.iteratorType)}}class i extends p.default{constructor(t=[],o,u){super(o,u);let d=this;t.forEach(function(g){d.insert(g)})}*K(t){t!==void 0&&(yield*Ie(this.K(t.U)),yield t.u,yield*Ie(this.K(t.W)))}begin(){return new s(this.h.U||this.h,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this.h.W||this.h,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(t,o){return this.M(t,void 0,o)}find(t){let o=this.I(this.Y,t);return new s(o,this.h,this)}lowerBound(t){let o=this.X(this.Y,t);return new s(o,this.h,this)}upperBound(t){let o=this.Z(this.Y,t);return new s(o,this.h,this)}reverseLowerBound(t){let o=this.$(this.Y,t);return new s(o,this.h,this)}reverseUpperBound(t){let o=this.rr(this.Y,t);return new s(o,this.h,this)}union(t){let o=this;return t.forEach(function(u){o.insert(u)}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var r=i;x.default=r},{"../../utils/throwError":44,"./Base":39,"./Base/TreeIterator":37}],42:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),Object.defineProperty(x,"Deque",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(x,"HashMap",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(x,"HashSet",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(x,"LinkList",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(x,"OrderedMap",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(x,"OrderedSet",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(x,"PriorityQueue",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(x,"Queue",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(x,"Stack",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(x,"Vector",{enumerable:!0,get:function(){return h.default}});var p=u(y("./container/OtherContainer/Stack")),c=u(y("./container/OtherContainer/Queue")),m=u(y("./container/OtherContainer/PriorityQueue")),h=u(y("./container/SequentialContainer/Vector")),s=u(y("./container/SequentialContainer/LinkList")),i=u(y("./container/SequentialContainer/Deque")),r=u(y("./container/TreeContainer/OrderedSet")),e=u(y("./container/TreeContainer/OrderedMap")),t=u(y("./container/HashContainer/HashSet")),o=u(y("./container/HashContainer/HashMap"));function u(d){return d&&d.t?d:{default:d}}},{"./container/HashContainer/HashMap":27,"./container/HashContainer/HashSet":28,"./container/OtherContainer/PriorityQueue":29,"./container/OtherContainer/Queue":30,"./container/OtherContainer/Stack":31,"./container/SequentialContainer/Deque":34,"./container/SequentialContainer/LinkList":35,"./container/SequentialContainer/Vector":36,"./container/TreeContainer/OrderedMap":40,"./container/TreeContainer/OrderedSet":41}],43:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.default=p;function p(c){let m=typeof c;return m==="object"&&c!==null||m==="function"}},{}],44:[function(y,k,x){"use strict";Object.defineProperty(x,"t",{value:!0}),x.throwIteratorAccessError=p;function p(){throw new RangeError("Iterator access denied!")}},{}],45:[function(y,k,x){"use strict";let p=y("yallist"),c=Symbol("max"),m=Symbol("length"),h=Symbol("lengthCalculator"),s=Symbol("allowStale"),i=Symbol("maxAge"),r=Symbol("dispose"),e=Symbol("noDisposeOnSet"),t=Symbol("lruList"),o=Symbol("cache"),u=Symbol("updateAgeOnGet"),d=()=>1;class g{constructor(C){if(typeof C=="number"&&(C={max:C}),C||(C={}),C.max&&(typeof C.max!="number"||C.max<0))throw new TypeError("max must be a non-negative number");let P=this[c]=C.max||1/0,S=C.length||d;if(this[h]=typeof S!="function"?d:S,this[s]=C.stale||!1,C.maxAge&&typeof C.maxAge!="number")throw new TypeError("maxAge must be a number");this[i]=C.maxAge||0,this[r]=C.dispose,this[e]=C.noDisposeOnSet||!1,this[u]=C.updateAgeOnGet||!1,this.reset()}set max(C){if(typeof C!="number"||C<0)throw new TypeError("max must be a non-negative number");this[c]=C||1/0,v(this)}get max(){return this[c]}set allowStale(C){this[s]=!!C}get allowStale(){return this[s]}set maxAge(C){if(typeof C!="number")throw new TypeError("maxAge must be a non-negative number");this[i]=C,v(this)}get maxAge(){return this[i]}set lengthCalculator(C){typeof C!="function"&&(C=d),C!==this[h]&&(this[h]=C,this[m]=0,this[t].forEach(P=>{P.length=this[h](P.value,P.key),this[m]+=P.length})),v(this)}get lengthCalculator(){return this[h]}get length(){return this[m]}get itemCount(){return this[t].length}rforEach(C,P){P=P||this;for(let S=this[t].tail;S!==null;){let V=S.prev;W(this,C,S,P),S=V}}forEach(C,P){P=P||this;for(let S=this[t].head;S!==null;){let V=S.next;W(this,C,S,P),S=V}}keys(){return this[t].toArray().map(C=>C.key)}values(){return this[t].toArray().map(C=>C.value)}reset(){this[r]&&this[t]&&this[t].length&&this[t].forEach(C=>this[r](C.key,C.value)),this[o]=new Map,this[t]=new p,this[m]=0}dump(){return this[t].map(C=>f(this,C)?!1:{k:C.key,v:C.value,e:C.now+(C.maxAge||0)}).toArray().filter(C=>C)}dumpLru(){return this[t]}set(C,P,S){if(S=S||this[i],S&&typeof S!="number")throw new TypeError("maxAge must be a number");let V=S?Date.now():0,B=this[h](P,C);if(this[o].has(C)){if(B>this[c])return R(this,this[o].get(C)),!1;let ie=this[o].get(C).value;return this[r]&&(this[e]||this[r](C,ie.value)),ie.now=V,ie.maxAge=S,ie.value=P,this[m]+=B-ie.length,ie.length=B,this.get(C),v(this),!0}let ne=new A(C,P,B,V,S);return ne.length>this[c]?(this[r]&&this[r](C,P),!1):(this[m]+=ne.length,this[t].unshift(ne),this[o].set(C,this[t].head),v(this),!0)}has(C){if(!this[o].has(C))return!1;let P=this[o].get(C).value;return!f(this,P)}get(C){return _(this,C,!0)}peek(C){return _(this,C,!1)}pop(){let C=this[t].tail;return C?(R(this,C),C.value):null}del(C){R(this,this[o].get(C))}load(C){this.reset();let P=Date.now();for(let S=C.length-1;S>=0;S--){let V=C[S],B=V.e||0;if(B===0)this.set(V.k,V.v);else{let ne=B-P;ne>0&&this.set(V.k,V.v,ne)}}}prune(){this[o].forEach((C,P)=>_(this,P,!1))}}let _=(j,C,P)=>{let S=j[o].get(C);if(S){let V=S.value;if(f(j,V)){if(R(j,S),!j[s])return}else P&&(j[u]&&(S.value.now=Date.now()),j[t].unshiftNode(S));return V.value}},f=(j,C)=>{if(!C||!C.maxAge&&!j[i])return!1;let P=Date.now()-C.now;return C.maxAge?P>C.maxAge:j[i]&&P>j[i]},v=j=>{if(j[m]>j[c])for(let C=j[t].tail;j[m]>j[c]&&C!==null;){let P=C.prev;R(j,C),C=P}},R=(j,C)=>{if(C){let P=C.value;j[r]&&j[r](P.key,P.value),j[m]-=P.length,j[o].delete(P.key),j[t].removeNode(C)}};class A{constructor(C,P,S,V,B){this.key=C,this.value=P,this.length=S,this.now=V,this.maxAge=B||0}}let W=(j,C,P,S)=>{let V=P.value;f(j,V)&&(R(j,P),j[s]||(V=void 0)),V&&C.call(S,V.value,V.key,j)};k.exports=g},{yallist:84}],46:[function(y,k,x){(function(p){(function(){let c=k.exports;c.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},c.codes={};for(let h in c.types){let s=c.types[h];c.codes[s]=h}c.CMD_SHIFT=4,c.CMD_MASK=240,c.DUP_MASK=8,c.QOS_MASK=3,c.QOS_SHIFT=1,c.RETAIN_MASK=1,c.VARBYTEINT_MASK=127,c.VARBYTEINT_FIN_MASK=128,c.VARBYTEINT_MAX=268435455,c.SESSIONPRESENT_MASK=1,c.SESSIONPRESENT_HEADER=p.from([c.SESSIONPRESENT_MASK]),c.CONNACK_HEADER=p.from([c.codes.connack<[0,1].map(i=>[0,1].map(r=>{let e=p.alloc(1);return e.writeUInt8(c.codes[h]<p.from([h])),c.EMPTY={pingreq:p.from([c.codes.pingreq<<4,0]),pingresp:p.from([c.codes.pingresp<<4,0]),disconnect:p.from([c.codes.disconnect<<4,0])}}).call(this)}).call(this,y("buffer").Buffer)},{buffer:3}],47:[function(y,k,x){(function(p){(function(){let c=y("./writeToStream"),m=y("events");function h(i,r){let e=new s;return c(i,e,r),e.concat()}class s extends m{constructor(){super(),this._array=new Array(20),this._i=0}write(r){return this._array[this._i++]=r,!0}concat(){let r=0,e=new Array(this._array.length),t=this._array,o=0,u;for(u=0;u>8,0),o.writeUInt8(t&255,1),o}function i(){for(let t=0;t<65536;t++)m[t]=s(t)}function r(t){let u=0,d=0,g=p.allocUnsafe(4);do u=t%128|0,t=t/128|0,t>0&&(u=u|128),g.writeUInt8(u,d++);while(t>0&&d<4);return t>0&&(d=0),h?g.subarray(0,d):g.slice(0,d)}function e(t){let o=p.allocUnsafe(4);return o.writeUInt32BE(t,0),o}k.exports={cache:m,generateCache:i,generateNumber:s,genBufVariableByteInt:r,generate4ByteBuffer:e}}).call(this)}).call(this,y("buffer").Buffer)},{buffer:3}],50:[function(y,k,x){class p{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}k.exports=p},{}],51:[function(y,k,x){let p=y("bl"),c=y("events"),m=y("./packet"),h=y("./constants"),s=y("debug")("mqtt-packet:parser");class i extends c{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof i?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new i().parser(e)}_resetState(){s("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new m,this.error=null,this._list=p(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),s("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,s("parse: state complete. _stateCounter is now: %d",this._stateCounter),s("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return s("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0);return this.packet.cmd=h.types[e>>h.CMD_SHIFT],this.packet.retain=(e&h.RETAIN_MASK)!==0,this.packet.qos=e>>h.QOS_SHIFT&h.QOS_MASK,this.packet.dup=(e&h.DUP_MASK)!==0,s("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),s("_parseLength %d",e.value),!!e}_parsePayload(){s("_parsePayload: payload %O",this._list);let e=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return s("_parsePayload complete result: %s",e),e}_parseConnect(){s("_parseConnect");let e,t,o,u,d={},g=this.packet,_=this._parseString();if(_===null)return this._emitError(new Error("Cannot parse protocolId"));if(_!=="MQTT"&&_!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(g.protocolId=_,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(g.protocolVersion=this._list.readUInt8(this._pos),g.protocolVersion>=128&&(g.bridgeMode=!0,g.protocolVersion=g.protocolVersion-128),g.protocolVersion!==3&&g.protocolVersion!==4&&g.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(d.username=this._list.readUInt8(this._pos)&h.USERNAME_MASK,d.password=this._list.readUInt8(this._pos)&h.PASSWORD_MASK,d.will=this._list.readUInt8(this._pos)&h.WILL_FLAG_MASK,d.will&&(g.will={},g.will.retain=(this._list.readUInt8(this._pos)&h.WILL_RETAIN_MASK)!==0,g.will.qos=(this._list.readUInt8(this._pos)&h.WILL_QOS_MASK)>>h.WILL_QOS_SHIFT),g.clean=(this._list.readUInt8(this._pos)&h.CLEAN_SESSION_MASK)!==0,this._pos++,g.keepalive=this._parseNum(),g.keepalive===-1)return this._emitError(new Error("Packet too short"));if(g.protocolVersion===5){let v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(g.properties=v)}let f=this._parseString();if(f===null)return this._emitError(new Error("Packet too short"));if(g.clientId=f,s("_parseConnect: packet.clientId: %s",g.clientId),d.will){if(g.protocolVersion===5){let v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(g.will.properties=v)}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(g.will.topic=e,s("_parseConnect: packet.will.topic: %s",g.will.topic),t=this._parseBuffer(),t===null)return this._emitError(new Error("Cannot parse will payload"));g.will.payload=t,s("_parseConnect: packet.will.paylaod: %s",g.will.payload)}if(d.username){if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse username"));g.username=u,s("_parseConnect: packet.username: %s",g.username)}if(d.password){if(o=this._parseBuffer(),o===null)return this._emitError(new Error("Cannot parse password"));g.password=o}return this.settings=g,s("_parseConnect: complete"),g}_parseConnack(){s("_parseConnack");let e=this.packet;if(this._list.length<1)return null;if(e.sessionPresent=!!(this._list.readUInt8(this._pos++)&h.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(e.returnCode===-1||e.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}s("_parseConnack: complete")}_parsePublish(){s("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),e.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),s("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){s("_parseSubscribe");let e=this.packet,t,o,u,d,g,_,f;if(e.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(e.properties=v)}for(;this._pos=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));o=this._parseByte(),u=o&h.SUBSCRIBE_OPTIONS_QOS_MASK,_=(o>>h.SUBSCRIBE_OPTIONS_NL_SHIFT&h.SUBSCRIBE_OPTIONS_NL_MASK)!==0,g=(o>>h.SUBSCRIBE_OPTIONS_RAP_SHIFT&h.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,d=o>>h.SUBSCRIBE_OPTIONS_RH_SHIFT&h.SUBSCRIBE_OPTIONS_RH_MASK,f={topic:t,qos:u},this.settings.protocolVersion===5?(f.nl=_,f.rap=g,f.rh=d):this.settings.bridgeMode&&(f.rh=0,f.rap=!0,f.nl=!0),s("_parseSubscribe: push subscription `%s` to subscription",f),e.subscriptions.push(f)}}}_parseSuback(){s("_parseSuback");let e=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos2?(e.reasonCode=this._parseByte(),s("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)):e.reasonCode=0,e.length>3)){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return!0}_parseDisconnect(){let e=this.packet;if(s("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?e.reasonCode=this._parseByte():e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return s("_parseDisconnect result: true"),!0}_parseAuth(){s("_parseAuth");let e=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));e.reasonCode=this._parseByte();let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),s("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),e.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(s("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),o=t+this._pos;if(t===-1||o>this._list.length||o>this.packet.length)return null;let u=this._list.toString("utf8",this._pos,o);return this._pos+=t,s("_parseString: result: %s",u),u}_parseStringPair(){return s("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(e===-1||t>this._list.length||t>this.packet.length)return null;let o=this._list.slice(this._pos,t);return this._pos+=e,s("_parseBuffer: result: %o",o),o}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,s("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,s("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){s("_parseVarByteNum");let t=4,o=0,u=1,d=0,g=!1,_,f=this._pos?this._pos:0;for(;o=o&&this._emitError(new Error("Invalid variable byte integer")),f&&(this._pos+=o),g=g?e?{bytes:o,value:d}:d:!1,s("_parseVarByteNum: result: %o",g),g}_parseByte(){let e;return this._pos=4)&&(b||q))w+=p.byteLength(b)+2;else{if(I<4)return M.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(q*1===0)return M.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof Q!="number"||Q<0||Q>65535||Q%1!==0)return M.emit("error",new Error("Invalid keepalive")),!1;if(w+=2,w+=1,I===5){var L=H(M,a);if(!L)return!1;w+=L.length}if(N){if(typeof N!="object")return M.emit("error",new Error("Invalid will")),!1;if(!N.topic||typeof N.topic!="string")return M.emit("error",new Error("Invalid will topic")),!1;if(w+=p.byteLength(N.topic)+2,w+=2,N.payload)if(N.payload.length>=0)typeof N.payload=="string"?w+=p.byteLength(N.payload):w+=N.payload.length;else return M.emit("error",new Error("Invalid will payload")),!1;var K={};if(I===5){if(K=H(M,N.properties),!K)return!1;w+=K.length}}let J=!1;if(l!=null)if(Z(l))J=!0,w+=p.byteLength(l)+2;else return M.emit("error",new Error("Invalid username")),!1;if(n!=null){if(!J)return M.emit("error",new Error("Username is required to use password")),!1;if(Z(n))w+=oe(n)+2;else return M.emit("error",new Error("Invalid password")),!1}M.write(c.CONNECT_HEADER),G(M,w),ee(M,O),te.bridgeMode&&(I+=128),M.write(I===131?c.VERSION131:I===132?c.VERSION132:I===4?c.VERSION4:I===5?c.VERSION5:c.VERSION3);let le=0;return le|=l!=null?c.USERNAME_MASK:0,le|=n!=null?c.PASSWORD_MASK:0,le|=N&&N.retain?c.WILL_RETAIN_MASK:0,le|=N&&N.qos?N.qos<0&&g(M,b),a?.write(),r("publish: payload: %o",Q),M.write(Q)}function j(F,M,Y){let te=Y?Y.protocolVersion:4,O=F||{},I=O.cmd||"puback",N=O.messageId,q=O.dup&&I==="pubrel"?c.DUP_MASK:0,Q=0,b=O.reasonCode,l=O.properties,n=te===5?3:2;if(I==="pubrel"&&(Q=1),typeof N!="number")return M.emit("error",new Error("Invalid messageId")),!1;let a=null;if(te===5&&typeof l=="object"){if(a=D(M,l,Y,n),!a)return!1;n+=a.length}return M.write(c.ACKS[I][Q][q][0]),G(M,n),g(M,N),te===5&&M.write(p.from([b])),a!==null&&a.write(),!0}function C(F,M,Y){r("subscribe: packet: ");let te=Y?Y.protocolVersion:4,O=F||{},I=O.dup?c.DUP_MASK:0,N=O.messageId,q=O.subscriptions,Q=O.properties,b=0;if(typeof N!="number")return M.emit("error",new Error("Invalid messageId")),!1;b+=2;let l=null;if(te===5){if(l=H(M,Q),!l)return!1;b+=l.length}if(typeof q=="object"&&q.length)for(let a=0;a2)return M.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}b+=p.byteLength(w)+2+1}else return M.emit("error",new Error("Invalid subscriptions")),!1;r("subscribe: writing to stream: %o",c.SUBSCRIBE_HEADER),M.write(c.SUBSCRIBE_HEADER[1][I?1:0][0]),G(M,b),g(M,N),l!==null&&l.write();let n=!0;for(let a of q){let w=a.topic,L=a.qos,K=+a.nl,J=+a.rap,le=a.rh,he;E(M,w),he=c.SUBSCRIBE_OPTIONS_QOS[L],te===5&&(he|=K?c.SUBSCRIBE_OPTIONS_NL:0,he|=J?c.SUBSCRIBE_OPTIONS_RAP:0,he|=le?c.SUBSCRIBE_OPTIONS_RH[le]:0),n=M.write(p.from([he]))}return n}function P(F,M,Y){let te=Y?Y.protocolVersion:4,O=F||{},I=O.messageId,N=O.granted,q=O.properties,Q=0;if(typeof I!="number")return M.emit("error",new Error("Invalid messageId")),!1;if(Q+=2,typeof N=="object"&&N.length)for(let l=0;lc.VARBYTEINT_MAX)return F.emit("error",new Error(`Invalid variable byte integer: ${M}`)),!1;let Y=ie[M];return Y||(Y=u(M),M<16384&&(ie[M]=Y)),r("writeVarByteInt: writing to stream: %o",Y),F.write(Y)}function E(F,M){let Y=p.byteLength(M);return g(F,Y),r("writeString: %s",M),F.write(M,"utf8")}function T(F,M,Y){E(F,M),E(F,Y)}function U(F,M){return r("writeNumberCached: number: %d",M),r("writeNumberCached: %o",e[M]),F.write(e[M])}function z(F,M){let Y=t(M);return r("writeNumberGenerated: %o",Y),F.write(Y)}function re(F,M){let Y=d(M);return r("write4ByteNumber: %o",Y),F.write(Y)}function ee(F,M){typeof M=="string"?E(F,M):M?(g(F,M.length),F.write(M)):g(F,0)}function H(F,M){if(typeof M!="object"||M.length!=null)return{length:1,write(){$(F,{},0)}};let Y=0;function te(I,N){let q=c.propertiesTypes[I],Q=0;switch(q){case"byte":{if(typeof N!="boolean")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Q+=2;break}case"int8":{if(typeof N!="number"||N<0||N>255)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Q+=2;break}case"binary":{if(N&&N===null)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Q+=1+p.byteLength(N)+2;break}case"int16":{if(typeof N!="number"||N<0||N>65535)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Q+=3;break}case"int32":{if(typeof N!="number"||N<0||N>4294967295)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Q+=5;break}case"var":{if(typeof N!="number"||N<0||N>268435455)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Q+=1+p.byteLength(u(N));break}case"string":{if(typeof N!="string")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Q+=3+p.byteLength(N.toString());break}case"pair":{if(typeof N!="object")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;Q+=Object.getOwnPropertyNames(N).reduce((b,l)=>{let n=N[l];return Array.isArray(n)?b+=n.reduce((a,w)=>(a+=3+p.byteLength(l.toString())+2+p.byteLength(w.toString()),a),0):b+=3+p.byteLength(l.toString())+2+p.byteLength(N[l].toString()),b},0);break}default:return F.emit("error",new Error(`Invalid property ${I}: ${N}`)),!1}return Q}if(M)for(let I in M){let N=0,q=0,Q=M[I];if(Array.isArray(Q))for(let b=0;bI;){let q=O.shift();if(q&&M[q])delete M[q],N=H(F,M);else return!1}return N}function X(F,M,Y){switch(c.propertiesTypes[M]){case"byte":{F.write(p.from([c.properties[M]])),F.write(p.from([+Y]));break}case"int8":{F.write(p.from([c.properties[M]])),F.write(p.from([Y]));break}case"binary":{F.write(p.from([c.properties[M]])),ee(F,Y);break}case"int16":{F.write(p.from([c.properties[M]])),g(F,Y);break}case"int32":{F.write(p.from([c.properties[M]])),re(F,Y);break}case"var":{F.write(p.from([c.properties[M]])),G(F,Y);break}case"string":{F.write(p.from([c.properties[M]])),E(F,Y);break}case"pair":{Object.getOwnPropertyNames(Y).forEach(O=>{let I=Y[O];Array.isArray(I)?I.forEach(N=>{F.write(p.from([c.properties[M]])),T(F,O.toString(),N.toString())}):(F.write(p.from([c.properties[M]])),T(F,O.toString(),I.toString()))});break}default:return F.emit("error",new Error(`Invalid property ${M} value: ${Y}`)),!1}}function $(F,M,Y){G(F,Y);for(let te in M)if(Object.prototype.hasOwnProperty.call(M,te)&&M[te]!==null){let O=M[te];if(Array.isArray(O))for(let I=0;I0)return r(u);if(g==="number"&&isFinite(u))return d.long?t(u):e(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var g=parseFloat(d[1]),_=(d[2]||"ms").toLowerCase();switch(_){case"years":case"year":case"yrs":case"yr":case"y":return g*i;case"weeks":case"week":case"w":return g*s;case"days":case"day":case"d":return g*h;case"hours":case"hour":case"hrs":case"hr":case"h":return g*m;case"minutes":case"minute":case"mins":case"min":case"m":return g*c;case"seconds":case"second":case"secs":case"sec":case"s":return g*p;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function e(u){var d=Math.abs(u);return d>=h?Math.round(u/h)+"d":d>=m?Math.round(u/m)+"h":d>=c?Math.round(u/c)+"m":d>=p?Math.round(u/p)+"s":u+"ms"}function t(u){var d=Math.abs(u);return d>=h?o(u,d,h,"day"):d>=m?o(u,d,m,"hour"):d>=c?o(u,d,c,"minute"):d>=p?o(u,d,p,"second"):u+" ms"}function o(u,d,g,_){var f=d>=g*1.5;return Math.round(u/g)+" "+_+(f?"s":"")}},{}],54:[function(y,k,x){let p=y("./lib/number-allocator.js");k.exports.NumberAllocator=p},{"./lib/number-allocator.js":55}],55:[function(y,k,x){"use strict";let p=y("js-sdsl").OrderedSet,c=y("debug")("number-allocator:trace"),m=y("debug")("number-allocator:error");function h(i,r){this.low=i,this.high=r}h.prototype.equals=function(i){return this.low===i.low&&this.high===i.high},h.prototype.compare=function(i){return this.lowe.compare(t)),c("Create"),this.clear()}s.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},s.prototype.alloc=function(){if(this.ss.size()===0)return c("alloc():empty"),null;let i=this.ss.begin(),r=i.pointer.low,e=i.pointer.high,t=r;return t+1<=e?this.ss.updateKeyByIterator(i,new h(r+1,e)):this.ss.eraseElementByPos(0),c("alloc():"+t),t},s.prototype.use=function(i){let r=new h(i,i),e=this.ss.lowerBound(r);if(!e.equals(this.ss.end())){let t=e.pointer.low,o=e.pointer.high;return e.pointer.equals(r)?(this.ss.eraseElementByIterator(e),c("use():"+i),!0):t>i?!1:t===i?(this.ss.updateKeyByIterator(e,new h(t+1,o)),c("use():"+i),!0):o===i?(this.ss.updateKeyByIterator(e,new h(t,o-1)),c("use():"+i),!0):(this.ss.updateKeyByIterator(e,new h(i+1,o)),this.ss.insert(new h(t,i-1)),c("use():"+i),!0)}return c("use():failed"),!1},s.prototype.free=function(i){if(ithis.max){m("free():"+i+" is out of range");return}let r=new h(i,i),e=this.ss.upperBound(r);if(e.equals(this.ss.end())){if(e.equals(this.ss.begin())){this.ss.insert(r);return}e.pre();let t=e.pointer.high;e.pointer.high+1===i?this.ss.updateKeyByIterator(e,new h(t,i)):this.ss.insert(r)}else if(e.equals(this.ss.begin()))if(i+1===e.pointer.low){let t=e.pointer.high;this.ss.updateKeyByIterator(e,new h(i,t))}else this.ss.insert(r);else{let t=e.pointer.low,o=e.pointer.high;e.pre();let u=e.pointer.low;e.pointer.high+1===i?i+1===t?(this.ss.eraseElementByIterator(e),this.ss.updateKeyByIterator(e,new h(u,o))):this.ss.updateKeyByIterator(e,new h(u,i)):i+1===t?(this.ss.eraseElementByIterator(e.next()),this.ss.insert(new h(i,o))):this.ss.insert(r)}c("free():"+i)},s.prototype.clear=function(){c("clear()"),this.ss.clear(),this.ss.insert(new h(this.min,this.max))},s.prototype.intervalCount=function(){return this.ss.size()},s.prototype.dump=function(){console.log("length:"+this.ss.size());for(let i of this.ss)console.log(i)},k.exports=s},{debug:20,"js-sdsl":42}],56:[function(y,k,x){var p=y("wrappy");k.exports=p(c),k.exports.strict=p(m),c.proto=c(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return c(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return m(this)},configurable:!0})});function c(h){var s=function(){return s.called?s.value:(s.called=!0,s.value=h.apply(this,arguments))};return s.called=!1,s}function m(h){var s=function(){if(s.called)throw new Error(s.onceError);return s.called=!0,s.value=h.apply(this,arguments)},i=h.name||"Function wrapped with `once`";return s.onceError=i+" shouldn't be called more than once",s.called=!1,s}},{wrappy:80}],57:[function(y,k,x){(function(p){(function(){"use strict";typeof p>"u"||!p.version||p.version.indexOf("v0.")===0||p.version.indexOf("v1.")===0&&p.version.indexOf("v1.8.")!==0?k.exports={nextTick:c}:k.exports=p;function c(m,h,s,i){if(typeof m!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,e,t;switch(r){case 0:case 1:return p.nextTick(m);case 2:return p.nextTick(function(){m.call(null,h)});case 3:return p.nextTick(function(){m.call(null,h,s)});case 4:return p.nextTick(function(){m.call(null,h,s,i)});default:for(e=new Array(r-1),t=0;t2?"one of ".concat(t," ").concat(e.slice(0,o-1).join(", "),", or ")+e[o-1]:o===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function s(e,t,o){return e.substr(!o||o<0?0:+o,t.length)===t}function i(e,t,o){return(o===void 0||o>e.length)&&(o=e.length),e.substring(o-t.length,o)===t}function r(e,t,o){return typeof o!="number"&&(o=0),o+t.length>e.length?!1:e.indexOf(t,o)!==-1}m("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),m("ERR_INVALID_ARG_TYPE",function(e,t,o){var u;typeof t=="string"&&s(t,"not ")?(u="must not be",t=t.replace(/^not /,"")):u="must be";var d;if(i(e," argument"))d="The ".concat(e," ").concat(u," ").concat(h(t,"type"));else{var g=r(e,".")?"property":"argument";d='The "'.concat(e,'" ').concat(g," ").concat(u," ").concat(h(t,"type"))}return d+=". Received type ".concat(typeof o),d},TypeError),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),m("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),m("ERR_STREAM_PREMATURE_CLOSE","Premature close"),m("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),m("ERR_STREAM_WRITE_AFTER_END","write after end"),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),k.exports.codes=c},{}],59:[function(y,k,x){(function(p){(function(){"use strict";var c=Object.keys||function(u){var d=[];for(var g in u)d.push(g);return d};k.exports=e;var m=y("./_stream_readable"),h=y("./_stream_writable");y("inherits")(e,m);for(var s=c(h.prototype),i=0;i0)if(typeof l!="string"&&!L.objectMode&&Object.getPrototypeOf(l)!==r.prototype&&(l=t(l)),a)L.endEmitted?B(b,new C):T(b,L,l,!0);else if(L.ended)B(b,new W);else{if(L.destroyed)return!1;L.reading=!1,L.decoder&&!n?(l=L.decoder.write(l),L.objectMode||l.length!==0?T(b,L,l,!1):$(b,L)):T(b,L,l,!1)}else a||(L.reading=!1,$(b,L))}return!L.ended&&(L.length=z?b=z:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function ee(b,l){return b<=0||l.length===0&&l.ended?0:l.objectMode?1:b!==b?l.flowing&&l.length?l.buffer.head.data.length:l.length:(b>l.highWaterMark&&(l.highWaterMark=re(b)),b<=l.length?b:l.ended?l.length:(l.needReadable=!0,0))}G.prototype.read=function(b){d("read",b),b=parseInt(b,10);var l=this._readableState,n=b;if(b!==0&&(l.emittedReadable=!1),b===0&&l.needReadable&&((l.highWaterMark!==0?l.length>=l.highWaterMark:l.length>0)||l.ended))return d("read: emitReadable",l.length,l.ended),l.length===0&&l.ended?N(this):D(this),null;if(b=ee(b,l),b===0&&l.ended)return l.length===0&&N(this),null;var a=l.needReadable;d("need readable",a),(l.length===0||l.length-b0?w=I(b,l):w=null,w===null?(l.needReadable=l.length<=l.highWaterMark,b=0):(l.length-=b,l.awaitDrain=0),l.length===0&&(l.ended||(l.needReadable=!0),n!==b&&l.ended&&N(this)),w!==null&&this.emit("data",w),w};function H(b,l){if(d("onEofChunk"),!l.ended){if(l.decoder){var n=l.decoder.end();n&&n.length&&(l.buffer.push(n),l.length+=l.objectMode?1:n.length)}l.ended=!0,l.sync?D(b):(l.needReadable=!1,l.emittedReadable||(l.emittedReadable=!0,X(b)))}}function D(b){var l=b._readableState;d("emitReadable",l.needReadable,l.emittedReadable),l.needReadable=!1,l.emittedReadable||(d("emitReadable",l.flowing),l.emittedReadable=!0,p.nextTick(X,b))}function X(b){var l=b._readableState;d("emitReadable_",l.destroyed,l.length,l.ended),!l.destroyed&&(l.length||l.ended)&&(b.emit("readable"),l.emittedReadable=!1),l.needReadable=!l.flowing&&!l.ended&&l.length<=l.highWaterMark,O(b)}function $(b,l){l.readingMore||(l.readingMore=!0,p.nextTick(oe,b,l))}function oe(b,l){for(;!l.reading&&!l.ended&&(l.length1&&Q(a.pipes,b)!==-1)&&!he&&(d("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function ce(xe){d("onerror",xe),ve(),b.removeListener("error",ce),s(b,"error")===0&&B(b,xe)}se(b,"error",ce);function we(){b.removeListener("finish",Se),ve()}b.once("close",we);function Se(){d("onfinish"),b.removeListener("close",we),ve()}b.once("finish",Se);function ve(){d("unpipe"),n.unpipe(b)}return b.emit("pipe",n),a.flowing||(d("pipe resume"),n.resume()),b};function Z(b){return function(){var n=b._readableState;d("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,n.awaitDrain===0&&s(b,"data")&&(n.flowing=!0,O(b))}}G.prototype.unpipe=function(b){var l=this._readableState,n={hasUnpiped:!1};if(l.pipesCount===0)return this;if(l.pipesCount===1)return b&&b!==l.pipes?this:(b||(b=l.pipes),l.pipes=null,l.pipesCount=0,l.flowing=!1,b&&b.emit("unpipe",this,n),this);if(!b){var a=l.pipes,w=l.pipesCount;l.pipes=null,l.pipesCount=0,l.flowing=!1;for(var L=0;L0,a.flowing!==!1&&this.resume()):b==="readable"&&!a.endEmitted&&!a.readableListening&&(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,d("on readable",a.length,a.reading),a.length?D(this):a.reading||p.nextTick(M,this)),n},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(b,l){var n=i.prototype.removeListener.call(this,b,l);return b==="readable"&&p.nextTick(F,this),n},G.prototype.removeAllListeners=function(b){var l=i.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&p.nextTick(F,this),l};function F(b){var l=b._readableState;l.readableListening=b.listenerCount("readable")>0,l.resumeScheduled&&!l.paused?l.flowing=!0:b.listenerCount("data")>0&&b.resume()}function M(b){d("readable nexttick read 0"),b.read(0)}G.prototype.resume=function(){var b=this._readableState;return b.flowing||(d("resume"),b.flowing=!b.readableListening,Y(this,b)),b.paused=!1,this};function Y(b,l){l.resumeScheduled||(l.resumeScheduled=!0,p.nextTick(te,b,l))}function te(b,l){d("resume",l.reading),l.reading||b.read(0),l.resumeScheduled=!1,b.emit("resume"),O(b),l.flowing&&!l.reading&&b.read(0)}G.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function O(b){var l=b._readableState;for(d("flow",l.flowing);l.flowing&&b.read()!==null;);}G.prototype.wrap=function(b){var l=this,n=this._readableState,a=!1;b.on("end",function(){if(d("wrapped end"),n.decoder&&!n.ended){var K=n.decoder.end();K&&K.length&&l.push(K)}l.push(null)}),b.on("data",function(K){if(d("wrapped data"),n.decoder&&(K=n.decoder.write(K)),!(n.objectMode&&K==null)&&!(!n.objectMode&&(!K||!K.length))){var J=l.push(K);J||(a=!0,b.pause())}});for(var w in b)this[w]===void 0&&typeof b[w]=="function"&&(this[w]=function(J){return function(){return b[J].apply(b,arguments)}}(w));for(var L=0;L=l.length?(l.decoder?n=l.buffer.join(""):l.buffer.length===1?n=l.buffer.first():n=l.buffer.concat(l.length),l.buffer.clear()):n=l.buffer.consume(b,l.decoder),n}function N(b){var l=b._readableState;d("endReadable",l.endEmitted),l.endEmitted||(l.ended=!0,p.nextTick(q,l,b))}function q(b,l){if(d("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,l.readable=!1,l.emit("end"),b.autoDestroy)){var n=l._writableState;(!n||n.autoDestroy&&n.finished)&&l.destroy()}}typeof Symbol=="function"&&(G.from=function(b,l){return V===void 0&&(V=y("./internal/streams/from")),V(G,b,l)});function Q(b,l){for(var n=0,a=b.length;n-1))throw new S(I);return this._writableState.defaultEncoding=I,this},Object.defineProperty(ie.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function T(O,I,N){return!O.objectMode&&O.decodeStrings!==!1&&typeof I=="string"&&(I=e.from(I,N)),I}Object.defineProperty(ie.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function U(O,I,N,q,Q,b){if(!N){var l=T(I,q,Q);q!==l&&(N=!0,Q="buffer",q=l)}var n=I.objectMode?1:q.length;I.length+=n;var a=I.length0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(f){var v={data:f,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var v=this.head,R=""+v.data;v=v.next;)R+=f+v.data;return R}},{key:"concat",value:function(f){if(this.length===0)return e.alloc(0);for(var v=e.allocUnsafe(f>>>0),R=this.head,A=0;R;)d(R.data,v,A),A+=R.data.length,R=R.next;return v}},{key:"consume",value:function(f,v){var R;return fW.length?W.length:f;if(j===W.length?A+=W:A+=W.slice(0,f),f-=j,f===0){j===W.length?(++R,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=W.slice(j));break}++R}return this.length-=R,A}},{key:"_getBuffer",value:function(f){var v=e.allocUnsafe(f),R=this.head,A=1;for(R.data.copy(v),f-=R.data.length;R=R.next;){var W=R.data,j=f>W.length?W.length:f;if(W.copy(v,v.length-f,0,j),f-=j,f===0){j===W.length?(++A,R.next?this.head=R.next:this.head=this.tail=null):(this.head=R,R.data=W.slice(j));break}++A}return this.length-=A,v}},{key:u,value:function(f,v){return o(this,c({},v,{depth:0,customInspect:!1}))}}]),g}()},{buffer:3,util:2}],66:[function(y,k,x){(function(p){(function(){"use strict";function c(e,t){var o=this,u=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return u||d?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,p.nextTick(i,this,e)):p.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(g){!t&&g?o._writableState?o._writableState.errorEmitted?p.nextTick(h,o):(o._writableState.errorEmitted=!0,p.nextTick(m,o,g)):p.nextTick(m,o,g):t?(p.nextTick(h,o),t(g)):p.nextTick(h,o)}),this)}function m(e,t){i(e,t),h(e)}function h(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(e,t){e.emit("error",t)}function r(e,t){var o=e._readableState,u=e._writableState;o&&o.autoDestroy||u&&u.autoDestroy?e.destroy(t):e.emit("error",t)}k.exports={destroy:c,undestroy:s,errorOrDestroy:r}}).call(this)}).call(this,y("_process"))},{_process:85}],67:[function(y,k,x){"use strict";var p=y("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function c(i){var r=!1;return function(){if(!r){r=!0;for(var e=arguments.length,t=new Array(e),o=0;o0;return e(W,C,P,function(S){R||(R=S),S&&A.forEach(t),!C&&(A.forEach(t),v(R))})});return _.reduce(o)}k.exports=d},{"../../../errors":58,"./end-of-stream":67}],70:[function(y,k,x){"use strict";var p=y("../../../errors").codes.ERR_INVALID_OPT_VALUE;function c(h,s,i){return h.highWaterMark!=null?h.highWaterMark:s?h[i]:null}function m(h,s,i,r){var e=c(s,r,i);if(e!=null){if(!(isFinite(e)&&Math.floor(e)===e)||e<0){var t=r?i:"highWaterMark";throw new p(t,e)}return Math.floor(e)}return h.objectMode?16:16*1024}k.exports={getHighWaterMark:m}},{"../../../errors":58}],71:[function(y,k,x){k.exports=y("events").EventEmitter},{events:4}],72:[function(y,k,x){x=k.exports=y("./lib/_stream_readable.js"),x.Stream=x,x.Readable=x,x.Writable=y("./lib/_stream_writable.js"),x.Duplex=y("./lib/_stream_duplex.js"),x.Transform=y("./lib/_stream_transform.js"),x.PassThrough=y("./lib/_stream_passthrough.js"),x.finished=y("./lib/internal/streams/end-of-stream.js"),x.pipeline=y("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":59,"./lib/_stream_passthrough.js":60,"./lib/_stream_readable.js":61,"./lib/_stream_transform.js":62,"./lib/_stream_writable.js":63,"./lib/internal/streams/end-of-stream.js":67,"./lib/internal/streams/pipeline.js":69}],73:[function(y,k,x){"use strict";function p(m,h,s){var i=this;this._callback=m,this._args=s,this._interval=setInterval(m,h,this._args),this.reschedule=function(r){r||(r=i._interval),i._interval&&clearInterval(i._interval),i._interval=setInterval(i._callback,r,i._args)},this.clear=function(){i._interval&&(clearInterval(i._interval),i._interval=void 0)},this.destroy=function(){i._interval&&clearInterval(i._interval),i._callback=void 0,i._interval=void 0,i._args=void 0}}function c(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var m;if(arguments.length>0){m=new Array(arguments.length-2);for(var h=0;h>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function r(A,W,j){var C=W.length-1;if(C=0?(P>0&&(A.lastNeed=P-1),P):--C=0?(P>0&&(A.lastNeed=P-2),P):--C=0?(P>0&&(P===2?P=0:A.lastNeed=P-3),P):0))}function e(A,W,j){if((W[0]&192)!==128)return A.lastNeed=0,"\uFFFD";if(A.lastNeed>1&&W.length>1){if((W[1]&192)!==128)return A.lastNeed=1,"\uFFFD";if(A.lastNeed>2&&W.length>2&&(W[2]&192)!==128)return A.lastNeed=2,"\uFFFD"}}function t(A){var W=this.lastTotal-this.lastNeed,j=e(this,A,W);if(j!==void 0)return j;if(this.lastNeed<=A.length)return A.copy(this.lastChar,W,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,W,0,A.length),this.lastNeed-=A.length}function o(A,W){var j=r(this,A,W);if(!this.lastNeed)return A.toString("utf8",W);this.lastTotal=j;var C=A.length-(j-this.lastNeed);return A.copy(this.lastChar,0,C),A.toString("utf8",W,C)}function u(A){var W=A&&A.length?this.write(A):"";return this.lastNeed?W+"\uFFFD":W}function d(A,W){if((A.length-W)%2===0){var j=A.toString("utf16le",W);if(j){var C=j.charCodeAt(j.length-1);if(C>=55296&&C<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],j.slice(0,-1)}return j}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",W,A.length-1)}function g(A){var W=A&&A.length?this.write(A):"";if(this.lastNeed){var j=this.lastTotal-this.lastNeed;return W+this.lastChar.toString("utf16le",0,j)}return W}function _(A,W){var j=(A.length-W)%3;return j===0?A.toString("base64",W):(this.lastNeed=3-j,this.lastTotal=3,j===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",W,A.length-j))}function f(A){var W=A&&A.length?this.write(A):"";return this.lastNeed?W+this.lastChar.toString("base64",0,3-this.lastNeed):W}function v(A){return A.toString(this.encoding)}function R(A){return A&&A.length?this.write(A):""}},{"safe-buffer":76}],79:[function(y,k,x){(function(p){(function(){k.exports=c;function c(h,s){if(m("noDeprecation"))return h;var i=!1;function r(){if(!i){if(m("throwDeprecation"))throw new Error(s);m("traceDeprecation")?console.trace(s):console.warn(s),i=!0}return h.apply(this,arguments)}return r}function m(h){try{if(!p.localStorage)return!1}catch{return!1}var s=p.localStorage[h];return s==null?!1:String(s).toLowerCase()==="true"}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],80:[function(y,k,x){k.exports=p;function p(c,m){if(c&&m)return p(c)(m);if(typeof c!="function")throw new TypeError("need wrapper function");return Object.keys(c).forEach(function(s){h[s]=c[s]}),h;function h(){for(var s=new Array(arguments.length),i=0;i0)for(var e=0,t=arguments.length;e1)e=r;else if(this.head)t=this.head.next,e=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;t!==null;o++)e=i(e,t.value,o),t=t.next;return e},p.prototype.reduceReverse=function(i,r){var e,t=this.tail;if(arguments.length>1)e=r;else if(this.tail)t=this.tail.prev,e=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;t!==null;o--)e=i(e,t.value,o),t=t.prev;return e},p.prototype.toArray=function(){for(var i=new Array(this.length),r=0,e=this.head;e!==null;r++)i[r]=e.value,e=e.next;return i},p.prototype.toArrayReverse=function(){for(var i=new Array(this.length),r=0,e=this.tail;e!==null;r++)i[r]=e.value,e=e.prev;return i},p.prototype.slice=function(i,r){r=r||this.length,r<0&&(r+=this.length),i=i||0,i<0&&(i+=this.length);var e=new p;if(rthis.length&&(r=this.length);for(var t=0,o=this.head;o!==null&&tthis.length&&(r=this.length);for(var t=this.length,o=this.tail;o!==null&&t>r;t--)o=o.prev;for(;o!==null&&t>i;t--,o=o.prev)e.push(o.value);return e},p.prototype.splice=function(i,r,...e){i>this.length&&(i=this.length-1),i<0&&(i=this.length+i);for(var t=0,o=this.head;o!==null&&t1)for(var A=1;A= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=e-t,C=Math.floor,P=String.fromCharCode,S;function V(H){throw new RangeError(W[H])}function B(H,D){for(var X=H.length,$=[];X--;)$[X]=D(H[X]);return $}function ne(H,D){var X=H.split("@"),$="";X.length>1&&($=X[0]+"@",H=X[1]),H=H.replace(A,".");var oe=H.split("."),Z=B(oe,D).join(".");return $+Z}function se(H){for(var D=[],X=0,$=H.length,oe,Z;X<$;)oe=H.charCodeAt(X++),oe>=55296&&oe<=56319&&X<$?(Z=H.charCodeAt(X++),(Z&64512)==56320?D.push(((oe&1023)<<10)+(Z&1023)+65536):(D.push(oe),X--)):D.push(oe);return D}function ie(H){return B(H,function(D){var X="";return D>65535&&(D-=65536,X+=P(D>>>10&1023|55296),D=56320|D&1023),X+=P(D),X}).join("")}function G(H){return H-48<10?H-22:H-65<26?H-65:H-97<26?H-97:e}function E(H,D){return H+22+75*(H<26)-((D!=0)<<5)}function T(H,D,X){var $=0;for(H=X?C(H/d):H>>1,H+=C(H/D);H>j*o>>1;$+=e)H=C(H/j);return C($+(j+1)*H/(H+u))}function U(H){var D=[],X=H.length,$,oe=0,Z=_,F=g,M,Y,te,O,I,N,q,Q,b;for(M=H.lastIndexOf(f),M<0&&(M=0),Y=0;Y=128&&V("not-basic"),D.push(H.charCodeAt(Y));for(te=M>0?M+1:0;te=X&&V("invalid-input"),q=G(H.charCodeAt(te++)),(q>=e||q>C((r-oe)/I))&&V("overflow"),oe+=q*I,Q=N<=F?t:N>=F+o?o:N-F,!(qC(r/b)&&V("overflow"),I*=b;$=D.length+1,F=T(oe-O,$,O==0),C(oe/$)>r-Z&&V("overflow"),Z+=C(oe/$),oe%=$,D.splice(oe++,0,Z)}return ie(D)}function z(H){var D,X,$,oe,Z,F,M,Y,te,O,I,N=[],q,Q,b,l;for(H=se(H),q=H.length,D=_,X=0,Z=g,F=0;F=D&&IC((r-X)/Q)&&V("overflow"),X+=(M-D)*Q,D=M,F=0;Fr&&V("overflow"),I==D){for(Y=X,te=e;O=te<=Z?t:te>=Z+o?o:te-Z,!(Y0&&o>t&&(o=t);for(var u=0;u=0?(_=d.substr(0,g),f=d.substr(g+1)):(_=d,f=""),v=decodeURIComponent(_),R=decodeURIComponent(f),p(r,v)?c(r[v])?r[v].push(R):r[v]=[r[v],R]:r[v]=R}return r};var c=Array.isArray||function(m){return Object.prototype.toString.call(m)==="[object Array]"}},{}],88:[function(y,k,x){"use strict";var p=function(s){switch(typeof s){case"string":return s;case"boolean":return s?"true":"false";case"number":return isFinite(s)?s:"";default:return""}};k.exports=function(s,i,r,e){return i=i||"&",r=r||"=",s===null&&(s=void 0),typeof s=="object"?m(h(s),function(t){var o=encodeURIComponent(p(t))+r;return c(s[t])?m(s[t],function(u){return o+encodeURIComponent(p(u))}).join(i):o+encodeURIComponent(p(s[t]))}).join(i):e?encodeURIComponent(p(e))+r+encodeURIComponent(p(s)):""};var c=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"};function m(s,i){if(s.map)return s.map(i);for(var r=[],e=0;e",'"',"`"," ","\r",` -`," "],e=["{","}","|","\\","^","`"].concat(r),t=["'"].concat(e),o=["%","/","?",";","#"].concat(t),u=["/","?","#"],d=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=y("querystring");function W(S,V,B){if(S&&c.isObject(S)&&S instanceof m)return S;var ne=new m;return ne.parse(S,V,B),ne}m.prototype.parse=function(S,V,B){if(!c.isString(S))throw new TypeError("Parameter 'url' must be a string, not "+typeof S);var ne=S.indexOf("?"),se=ne!==-1&&ne127?Y+="x":Y+=M[te];if(!Y.match(g)){var I=Z.slice(0,H),N=Z.slice(H+1),q=M.match(_);q&&(I.push(q[1]),N.unshift(q[2])),N.length&&(E="/"+N.join(".")+E),this.hostname=I.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),oe||(this.hostname=p.toASCII(this.hostname));var Q=this.port?":"+this.port:"",b=this.hostname||"";this.host=b+Q,this.href+=this.host,oe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),E[0]!=="/"&&(E="/"+E))}if(!f[z])for(var H=0,F=t.length;H0?B.host.split("@"):!1;Y&&(B.auth=Y.shift(),B.host=B.hostname=Y.shift())}return B.search=S.search,B.query=S.query,(!c.isNull(B.pathname)||!c.isNull(B.search))&&(B.path=(B.pathname?B.pathname:"")+(B.search?B.search:"")),B.href=B.format(),B}if(!Z.length)return B.pathname=null,B.search?B.path="/"+B.search:B.path=null,B.href=B.format(),B;for(var te=Z.slice(-1)[0],O=(B.host||S.host||Z.length>1)&&(te==="."||te==="..")||te==="",I=0,N=Z.length;N>=0;N--)te=Z[N],te==="."?Z.splice(N,1):te===".."?(Z.splice(N,1),I++):I&&(Z.splice(N,1),I--);if(!$&&!oe)for(;I--;I)Z.unshift("..");$&&Z[0]!==""&&(!Z[0]||Z[0].charAt(0)!=="/")&&Z.unshift(""),O&&Z.join("/").substr(-1)!=="/"&&Z.push("");var q=Z[0]===""||Z[0]&&Z[0].charAt(0)==="/";if(M){B.hostname=B.host=q?"":Z.length?Z.shift():"";var Y=B.host&&B.host.indexOf("@")>0?B.host.split("@"):!1;Y&&(B.auth=Y.shift(),B.host=B.hostname=Y.shift())}return $=$||B.host&&Z.length,$&&!q&&Z.unshift(""),Z.length?B.pathname=Z.join("/"):(B.pathname=null,B.path=null),(!c.isNull(B.pathname)||!c.isNull(B.search))&&(B.path=(B.pathname?B.pathname:"")+(B.search?B.search:"")),B.auth=S.auth||B.auth,B.slashes=B.slashes||S.slashes,B.href=B.format(),B},m.prototype.parseHost=function(){var S=this.host,V=s.exec(S);V&&(V=V[0],V!==":"&&(this.port=V.substr(1)),S=S.substr(0,S.length-V.length)),S&&(this.hostname=S)}},{"./util":91,punycode:86,querystring:89}],91:[function(y,k,x){"use strict";k.exports={isString:function(p){return typeof p=="string"},isObject:function(p){return typeof p=="object"&&p!==null},isNull:function(p){return p===null},isNullOrUndefined:function(p){return p==null}}},{}]},{},[17])(17)})});function Yr(ae,ue){if(ae&1&&(_e(0,"th",5),Te(1),ye()),ae&2){let pe=ue.$implicit;ge(),Re(pe.title)}}function Qr(ae,ue){if(ae&1&&(_e(0,"td",7),Te(1),ye()),ae&2){let pe=ue.$implicit,y=Ae().$implicit;ge(),Re(y[pe.key])}}function Gr(ae,ue){if(ae&1&&(_e(0,"tr"),Ee(1,Qr,2,1,"td",6),ye()),ae&2){let pe=Ae();ge(),be("ngForOf",pe.columns)}}var si=(()=>{let ue=class ue{constructor(){this.columns=[],this.data=[]}ngOnInit(){console.log(this.data)}};ue.\u0275fac=function(k){return new(k||ue)},ue.\u0275cmp=ke({type:ue,selectors:[["app-data-v-lj-table"]],inputs:{columns:"columns",data:"data"},standalone:!0,features:[Le],decls:7,vars:4,consts:[["nzBordered","","nzSize","small",3,"nzData","nzPageSize"],["dynamicTable",""],["style",` - background: rgb(8 22 48); - /* color: #bfceff !important; */ - color: #75f9fd; - text-align: center; - border: 0.5px solid #ffffff !important; - `,"nzShowSort","true",4,"ngFor","ngForOf"],[2,"background","rgb(8 22 48)"],[4,"ngFor","ngForOf"],["nzShowSort","true",2,"background","rgb(8 22 48)","/* color","#bfceff !important",`*/ - color`,"#75f9fd","text-align","center","border","0.5px solid #ffffff !important"],["style","text-align: center; color: #75f9fd; border: 0.5px solid #ffffff !important; transition: background 0.3s",4,"ngFor","ngForOf"],[2,"text-align","center","color","#75f9fd","border","0.5px solid #ffffff !important","transition","background 0.3s"]],template:function(k,x){if(k&1&&(_e(0,"nz-table",0,1)(2,"thead")(3,"tr"),Ee(4,Yr,2,1,"th",2),ye()(),_e(5,"tbody",3),Ee(6,Gr,2,1,"tr",4),ye()()),k&2){let p=Ne(1);be("nzData",x.data)("nzPageSize",5),ge(4),be("ngForOf",x.columns),ge(2),be("ngForOf",p.data)}},dependencies:[ze,qe,ht,it,ct,pt,ft,lt,Ve,et,rt,_t,at,st,nt,je,Xe,Ze,dt,yt,Ge,gt,ot,Qe,tt,Je,sr,ir,rr,nr,lr,or,ar,mt,He,We,ut,Ye,De,Ke,$e,Fe,Ue,tr],styles:[".ant-table-bordered[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], .ant-table-bordered[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-color:#fff!important}.tableColor[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-right:3px solid #2b3e71!important;border-bottom:1px solid #334474!important;transition:background .3s}.tableColor[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#bfceff!important;background-color:transparent!important;border-right:3px solid #2b3e71!important;border-bottom:1px solid #334474!important}"]});let ae=ue;return ae})();function $r(ae,ue){if(ae&1){let pe=jt();_e(0,"li",9)(1,"label",10),Wt("ngModelChange",function(k){let p=St(pe).$implicit;return xt(p.checked=k)})("ngModelChange",function(){St(pe);let k=Ae(2);return xt(k.onCheckChange())}),Te(2),ye()()}if(ae&2){let pe=ue.$implicit;ge(),be("ngModel",pe.checked),ge(),Re(pe.label)}}function Jr(ae,ue){if(ae&1&&(_e(0,"div",4),Dt(1,"a",5),_e(2,"nz-dropdown-menu",null,6)(4,"ul",7),Ee(5,$r,3,2,"li",8),ye()()()),ae&2){let pe=Ne(3),y=Ae();ge(),be("nzDropdownMenu",pe),ge(4),be("ngForOf",y.optionsList)}}var Xr=["*"],_i=(()=>{let ue=class ue{constructor(){this.showSetting=!1,this.optionsList=[],this.onCheckedItemsChange=new me,this.title=""}getCheckedItems(){return this.optionsList.filter(y=>y.checked)}onCheckChange(){let y=this.getCheckedItems();this.onCheckedItemsChange.emit(y)}};ue.\u0275fac=function(k){return new(k||ue)},ue.\u0275cmp=ke({type:ue,selectors:[["data-v-card"]],inputs:{showSetting:"showSetting",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[Le],ngContentSelectors:Xr,decls:6,vars:2,consts:[[1,"card-content"],[1,"card-content-title"],[1,"card-content-l"],["class","card-content-r",4,"ngIf"],[1,"card-content-r"],["nz-dropdown","","nz-icon","","nzType","setting","nzTrigger","click","nzTheme","outline",3,"nzDropdownMenu"],["menu","nzDropdownMenu"],["nz-menu","","nzSelectable",""],["nz-menu-item","",4,"ngFor","ngForOf"],["nz-menu-item",""],["nz-checkbox","",3,"ngModel","ngModelChange"]],template:function(k,x){k&1&&(Ht(),_e(0,"div",0)(1,"div",1)(2,"div",2),Te(3),ye(),Ee(4,Jr,6,2,"div",3),ye(),Vt(5),ye()),k&2&&(ge(3),Re(x.title),ge(),be("ngIf",x.showSetting))},dependencies:[De,qt,Fe,Ue,zt,Qe,Jt,$t,Xt,Zt,er,ze,Yt,Qt,qe,ht,it,ct,pt,ft,lt,Ve,et,rt,_t,at,st,nt,je,Kt,Xe,Ze,dt,yt,Ge,gt,ot,tt,Je,mt,He,We,ut,Ye,Ke,Gt,$e],styles:['.card-content[_ngcontent-%COMP%]{overflow:hidden;padding:1rem 1.5rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-position:top;background-size:cover;margin-bottom:.5rem}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;margin-bottom:.5rem;font-size:18px;font-weight:600;color:#74fafb}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{align-self:flex-start;flex:1}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let ae=ue;return ae})();var Ti=Tt(It(),1),fr=Tt(It(),1);var Pe=function(ae){return ae[ae.CLOSED=0]="CLOSED",ae[ae.CONNECTING=1]="CONNECTING",ae[ae.CONNECTED=2]="CONNECTED",ae}(Pe||{});var Zr=new vt("NgxMqttServiceConfig"),ei=new vt("NgxMqttClientService");function bt(ae,...ue){if(!ue.length)return ae;let pe=ue.shift();if(At(ae)&&At(pe))for(let y in pe)At(pe[y])?(ae[y]||Object.assign(ae,{[y]:{}}),bt(ae[y],pe[y])):Object.assign(ae,{[y]:pe[y]});return bt(ae,...ue)}function At(ae){return ae&&typeof ae=="object"&&!Array.isArray(ae)}var Oi=(()=>{let ue=class ue{constructor(y,k){this.options=y,this.observables={},this.state=new Mt(Pe.CLOSED),this.messages=new wt,this._clientId=this._generateClientId(),this._connectTimeout=1e4,this._reconnectPeriod=1e4,this._onConnect=new me,this._onReconnect=new me,this._onClose=new me,this._onOffline=new me,this._onError=new me,this._onEnd=new me,this._onMessage=new me,this._onSuback=new me,this._onPacketsend=new me,this._onPacketreceive=new me,this._handleOnConnect=x=>{this.options.connectOnCreate===!0&&Object.keys(this.observables).forEach(p=>{this.client.subscribe(p)}),this.state.next(Pe.CONNECTED),this._onConnect.emit(x)},this._handleOnReconnect=()=>{this.options.connectOnCreate===!0&&Object.keys(this.observables).forEach(x=>{this.client.subscribe(x)}),this.state.next(Pe.CONNECTING),this._onReconnect.emit()},this._handleOnClose=()=>{this.state.next(Pe.CLOSED),this._onClose.emit()},this._handleOnOffline=()=>{this._onOffline.emit()},this._handleOnError=x=>{this._onError.emit(x),console.error(x)},this._handleOnEnd=()=>{this._onEnd.emit()},this._handleOnMessage=(x,p,c)=>{this._onMessage.emit(c),c.cmd==="publish"&&this.messages.next(c)},this._handleOnPacketsend=x=>{this._onPacketsend.emit(x)},this._handleOnPacketreceive=x=>{this._onPacketreceive.emit(x)},y.connectOnCreate!==!1&&this.connect({},k),this.state.subscribe()}get clientId(){return this._clientId}get onConnect(){return this._onConnect}get onReconnect(){return this._onReconnect}get onClose(){return this._onClose}get onOffline(){return this._onOffline}get onError(){return this._onError}get onEnd(){return this._onEnd}get onMessage(){return this._onMessage}get onPacketsend(){return this._onPacketsend}get onPacketreceive(){return this._onPacketreceive}get onSuback(){return this._onSuback}static filterMatchesTopic(y,k){if(y[0]==="#"&&k[0]==="$")return!1;let x=(y||"").split("/").reverse(),p=(k||"").split("/").reverse(),c=()=>{let m=x.pop(),h=p.pop();switch(m){case"#":return!0;case"+":return h?c():!1;default:return m===h&&(m===void 0?!0:c())}};return c()}connect(y,k){let x=bt(this.options||{},y),p=x.protocol||"ws",c=x.hostname||"localhost";x.url?this._url=x.url:(this._url=`${p}://${c}`,this._url+=x.port?`:${x.port}`:"",this._url+=x.path?`${x.path}`:""),this.state.next(Pe.CONNECTING);let m=bt({clientId:this._clientId,reconnectPeriod:this._reconnectPeriod,connectTimeout:this._connectTimeout},x);this.client&&this.client.end(!0),k?this.client=k:this.client=(0,fr.connect)(this._url,m),this._clientId=m.clientId,this.client.on("connect",this._handleOnConnect),this.client.on("reconnect",this._handleOnReconnect),this.client.on("close",this._handleOnClose),this.client.on("offline",this._handleOnOffline),this.client.on("error",this._handleOnError),this.client.stream.on("error",this._handleOnError),this.client.on("end",this._handleOnEnd),this.client.on("message",this._handleOnMessage),this.client.on("packetsend",this._handleOnPacketsend),this.client.on("packetreceive",this._handleOnPacketreceive)}disconnect(y=!0){if(!this.client)throw new Error("mqtt client not connected");this.client.end(y)}observeRetained(y,k={qos:1}){return this._generalObserve(y,()=>Ut(1),k)}observe(y,k={qos:1}){return this._generalObserve(y,()=>Lt(),k)}_generalObserve(y,k,x){if(!this.client)throw new Error("mqtt client not connected");if(!this.observables[y]){let p=new wt;this.observables[y]=Nt(()=>{let c=new Rt;return this.client.subscribe(y,x,(m,h)=>{h&&h.forEach(s=>{s.qos===128&&(delete this.observables[s.topic],this.client.unsubscribe(s.topic),p.error(`subscription for '${s.topic}' rejected!`)),this._onSuback.emit({filter:y,granted:s.qos!==128})})}),c.add(()=>{delete this.observables[y],this.client.unsubscribe(y)}),c},c=>Bt(p,this.messages)).pipe(kt(c=>ue.filterMatchesTopic(y,c.topic)),k(),Ot())}return this.observables[y]}publish(y,k,x={}){if(!this.client)throw new Error("mqtt client not connected");return Pt.create(p=>{this.client.publish(y,k,x,c=>{c?p.error(c):(p.next(),p.complete())})})}unsafePublish(y,k,x={}){if(!this.client)throw new Error("mqtt client not connected");this.client.publish(y,k,x,p=>{if(p)throw p})}_generateClientId(){return"client-"+Math.random().toString(36).substr(2,19)}};ue.\u0275fac=function(k){return new(k||ue)(Et(Zr),Et(ei))},ue.\u0275prov=Ft({token:ue,factory:ue.\u0275fac,providedIn:"root"});let ae=ue;return ae})();export{si as a,_i as b,Oi as c}; diff --git a/dist/himp.platform.angular/browser/chunk-U3NGNWYP.js b/dist/himp.platform.angular/browser/chunk-OVXKTENR.js similarity index 72% rename from dist/himp.platform.angular/browser/chunk-U3NGNWYP.js rename to dist/himp.platform.angular/browser/chunk-OVXKTENR.js index 9dfe2af..5a5de31 100644 --- a/dist/himp.platform.angular/browser/chunk-U3NGNWYP.js +++ b/dist/himp.platform.angular/browser/chunk-OVXKTENR.js @@ -1,34 +1,34 @@ -import{a as rL,b as RV,c as LV}from"./chunk-M4HTTI2X.js";import{$a as Qc,A as Nc,Aa as KM,Ba as JM,C as Uc,Ca as Tl,Ga as Xc,Ia as qc,La as Zc,Pa as jc,Sa as Kc,Ua as Jc,V as Oc,W as bV,X as wV,Xa as $c,_ as Fc,b as ZM,ba as TV,bb as ef,ca as wl,cb as EV,db as El,e as Pc,fb as tf,gb as AV,hb as rf,jb as nf,kb as CV,la as zc,pa as Bc,ra as kc,ta as Vc,u as Dc,ua as Gc,v as Ic,wa as Hc,y as jM,ya as Wc}from"./chunk-WD6SV3WH.js";import{$ as oV,Ab as vm,Bb as co,Cb as fo,D as rV,Db as gu,Eb as Pi,Fb as Ec,Gc as yV,Ge as Ac,Ha as cV,I as iV,Ib as vV,Jb as ui,Jc as _V,Ka as Ot,Kc as xV,La as uo,Lb as gV,Le as Cc,Ma as jR,Mb as tL,Me as YM,Ne as qM,Nf as Yc,Pa as fV,Q as nV,Sb as gm,Ta as br,U as aV,Va as Rt,Wa as hV,Xa as KR,Ya as pV,a as E0,ba as ZR,cc as R0,cd as SV,db as JR,dc as bl,e as Ise,eb as $R,f as Nse,fb as QR,g as YR,gb as tr,h as Use,hb as lr,hf as Rc,i as Ose,ia as sV,ib as li,ic as L0,j as WM,jb as Sl,kb as Ml,la as xl,lb as dV,lf as Lc,m as Qk,na as si,nc as XM,o as qR,oa as lV,p as eV,pa as uV,qb as mV,ra as C0,sb as Lr,tb as Ho,tf as MV,u as A0,ub as Li,vf as ym,w as tV,xd as P0,xf as _m,yb as eL,zb as Tc}from"./chunk-VDRVUQCF.js";var $ne={};YR($ne,{AddEquation:()=>Gz,AddOperation:()=>sne,AdditiveBlending:()=>zz,AlphaFormat:()=>yne,AlwaysDepth:()=>ene,AmbientLight:()=>aC,AnimationClip:()=>No,AnimationMixer:()=>fB,AnimationObjectGroup:()=>Tz,AnimationUtils:()=>Jn,ArcCurve:()=>gC,ArrowHelper:()=>$d,Audio:()=>by,AudioAnalyser:()=>cB,AudioContext:()=>lB,AudioListener:()=>bz,AudioLoader:()=>uB,AxisHelper:()=>vC,BackSide:()=>yh,BasicDepthPacking:()=>Dne,BasicShadowMap:()=>$Ee,BinaryTextureLoader:()=>tB,BlendingMode:()=>Vie,Bone:()=>jA,BooleanKeyframeTrack:()=>cC,BoundingBoxHelper:()=>ELe,Box2:()=>PS,Box3:()=>lu,BoxBufferGeometry:()=>Ud,BoxGeometry:()=>oM,BoxHelper:()=>Iy,BufferAttribute:()=>gt,BufferGeometry:()=>Bt,BufferGeometryLoader:()=>iB,ByteType:()=>hne,Cache:()=>Sz,Camera:()=>Qn,CameraHelper:()=>mM,CanvasRenderer:()=>ILe,CanvasTexture:()=>$A,CatmullRomCurve3:()=>hB,CineonToneMapping:()=>cne,CircleBufferGeometry:()=>yy,CircleGeometry:()=>aM,ClampToEdgeWrapping:()=>Uo,Clock:()=>Lz,ClosedSplineCurve3:()=>Jne,Color:()=>Gt,ColorKeyframeTrack:()=>fC,CompressedTexture:()=>ny,CompressedTextureLoader:()=>Xne,ConeBufferGeometry:()=>nM,ConeGeometry:()=>iM,CubeCamera:()=>hC,CubeGeometry:()=>oM,CubeReflectionMapping:()=>xC,CubeRefractionMapping:()=>HA,CubeTexture:()=>_h,CubeTextureLoader:()=>rB,CubeUVReflectionMapping:()=>SC,CubeUVRefractionMapping:()=>MC,CubicBezierCurve:()=>jd,CubicBezierCurve3:()=>tLe,CubicInterpolant:()=>oC,CullFaceBack:()=>wS,CullFaceFront:()=>Iz,CullFaceFrontBack:()=>KEe,CullFaceNone:()=>zie,Curve:()=>ea,CurvePath:()=>cM,CurveUtils:()=>_M,CustomBlending:()=>Vz,CylinderBufferGeometry:()=>sc,CylinderGeometry:()=>Vd,Cylindrical:()=>Dz,DataTexture:()=>Nd,DataTextureLoader:()=>$Re,DefaultLoadingManager:()=>zo,DepthFormat:()=>Cd,DepthStencilFormat:()=>Jg,DepthTexture:()=>GS,DirectionalLight:()=>nC,DirectionalLightHelper:()=>Dy,DirectionalLightShadow:()=>iC,DiscreteInterpolant:()=>sC,DodecahedronBufferGeometry:()=>uy,DodecahedronGeometry:()=>qS,DoubleSide:()=>Ny,DstAlphaFactor:()=>Zie,DstColorFactor:()=>Kie,DynamicBufferAttribute:()=>vLe,EdgesGeometry:()=>gy,EdgesHelper:()=>ALe,EllipseCurve:()=>lc,EqualDepth:()=>rne,EquirectangularReflectionMapping:()=>Yz,EquirectangularRefractionMapping:()=>WA,Euler:()=>bh,EventDispatcher:()=>Ms,ExtrudeGeometry:()=>ws,Face3:()=>Fo,Face4:()=>aLe,FaceColors:()=>Fz,FaceNormalsHelper:()=>dM,FileLoader:()=>Ts,FlatShading:()=>Uz,Float32Attribute:()=>wLe,Float32BufferAttribute:()=>gr,Float64Attribute:()=>TLe,Float64BufferAttribute:()=>zS,FloatType:()=>jg,Fog:()=>ry,FogExp2:()=>ty,Font:()=>sB,FontLoader:()=>qne,FrontFaceDirectionCCW:()=>JEe,FrontFaceDirectionCW:()=>Bie,FrontSide:()=>Zg,Frustum:()=>DS,GammaEncoding:()=>Jz,Geometry:()=>or,GeometryIdCount:()=>$z,GeometryUtils:()=>LLe,GreaterDepth:()=>nne,GreaterEqualDepth:()=>ine,GridHelper:()=>pM,Group:()=>VS,HalfFloatType:()=>YA,HemisphereLight:()=>QA,HemisphereLightHelper:()=>Py,IcosahedronBufferGeometry:()=>ly,IcosahedronGeometry:()=>YS,ImageLoader:()=>yM,ImageUtils:()=>PLe,ImmediateRenderObject:()=>fM,InstancedBufferAttribute:()=>Ey,InstancedBufferGeometry:()=>Jd,InstancedInterleavedBuffer:()=>Ty,Int16Attribute:()=>xLe,Int16BufferAttribute:()=>OS,Int32Attribute:()=>MLe,Int32BufferAttribute:()=>FS,Int8Attribute:()=>gLe,Int8BufferAttribute:()=>IS,IntType:()=>dne,InterleavedBuffer:()=>wy,InterleavedBufferAttribute:()=>Az,Interpolant:()=>ro,InterpolateDiscrete:()=>CS,InterpolateLinear:()=>bS,InterpolateSmooth:()=>VA,JSONLoader:()=>nB,KeyframeTrack:()=>qd,LOD:()=>kS,LatheBufferGeometry:()=>dy,LatheGeometry:()=>rM,Layers:()=>qA,LensFlare:()=>xz,LessDepth:()=>tne,LessEqualDepth:()=>GA,Light:()=>Oi,LightShadow:()=>em,Line:()=>oc,Line3:()=>Rd,LineBasicMaterial:()=>Ui,LineCurve:()=>cu,LineCurve3:()=>iLe,LineDashedMaterial:()=>Yd,LinePieces:()=>sLe,LineSegments:()=>di,LineStrip:()=>oLe,LinearEncoding:()=>LS,LinearFilter:()=>to,LinearInterpolant:()=>lM,LinearMipMapLinearFilter:()=>gM,LinearMipMapNearestFilter:()=>Zz,LinearToneMapping:()=>Xz,Loader:()=>Ld,LoadingManager:()=>eB,LogLuvEncoding:()=>eAe,LoopOnce:()=>Mne,LoopPingPong:()=>wne,LoopRepeat:()=>bne,LuminanceAlphaFormat:()=>xne,LuminanceFormat:()=>_ne,MOUSE:()=>jEe,Material:()=>mr,MaterialLoader:()=>EC,Math:()=>cr,Matrix3:()=>bs,Matrix4:()=>qt,MaxEquation:()=>lz,Mesh:()=>mn,MeshBasicMaterial:()=>io,MeshDepthMaterial:()=>Sh,MeshFaceMaterial:()=>lLe,MeshLambertMaterial:()=>Xd,MeshNormalMaterial:()=>Wd,MeshPhongMaterial:()=>ml,MeshPhysicalMaterial:()=>Gd,MeshStandardMaterial:()=>uu,MeshToonMaterial:()=>Hd,MinEquation:()=>sz,MirroredRepeatWrapping:()=>Dd,MixOperation:()=>one,MorphBlendMesh:()=>Pn,MultiMaterial:()=>sM,MultiplyBlending:()=>kz,MultiplyOperation:()=>vM,NearestFilter:()=>Oo,NearestMipMapLinearFilter:()=>wC,NearestMipMapNearestFilter:()=>bC,NeverDepth:()=>Qie,NoBlending:()=>TS,NoColors:()=>yC,NoToneMapping:()=>kA,NormalBlending:()=>Uy,NotEqualDepth:()=>ane,NumberKeyframeTrack:()=>My,Object3D:()=>Et,ObjectLoader:()=>Yne,OctahedronBufferGeometry:()=>Bd,OctahedronGeometry:()=>XS,OneFactor:()=>Xie,OneMinusDstAlphaFactor:()=>jie,OneMinusDstColorFactor:()=>Jie,OneMinusSrcAlphaFactor:()=>Wz,OneMinusSrcColorFactor:()=>qie,OrthographicCamera:()=>ey,PCFShadowMap:()=>Nz,PCFSoftShadowMap:()=>kie,ParametricBufferGeometry:()=>oy,ParametricGeometry:()=>HS,Particle:()=>cLe,ParticleBasicMaterial:()=>pLe,ParticleSystem:()=>fLe,ParticleSystemMaterial:()=>dLe,Path:()=>xM,PerspectiveCamera:()=>Kn,Plane:()=>Io,PlaneBufferGeometry:()=>Od,PlaneGeometry:()=>tM,PointCloud:()=>uLe,PointCloudMaterial:()=>hLe,PointLight:()=>rC,PointLightHelper:()=>Ry,Points:()=>iy,PointsMaterial:()=>dl,PolarGridHelper:()=>mC,PolyhedronBufferGeometry:()=>no,PolyhedronGeometry:()=>ZS,PositionalAudio:()=>wz,Projector:()=>DLe,PropertyBinding:()=>Ri,PropertyMixer:()=>pC,QuadraticBezierCurve:()=>Kd,QuadraticBezierCurve3:()=>rLe,Quaternion:()=>on,QuaternionKeyframeTrack:()=>uM,QuaternionLinearInterpolant:()=>lC,REVISION:()=>Fie,RGBADepthPacking:()=>Ine,RGBAFormat:()=>su,RGBA_PVRTC_2BPPV1_Format:()=>yz,RGBA_PVRTC_4BPPV1_Format:()=>gz,RGBA_S3TC_DXT1_Format:()=>hz,RGBA_S3TC_DXT3_Format:()=>pz,RGBA_S3TC_DXT5_Format:()=>dz,RGBDEncoding:()=>Pne,RGBEEncoding:()=>Cne,RGBEFormat:()=>QEe,RGBFormat:()=>Kg,RGBM16Encoding:()=>Lne,RGBM7Encoding:()=>Rne,RGB_ETC1_Format:()=>Sne,RGB_PVRTC_2BPPV1_Format:()=>vz,RGB_PVRTC_4BPPV1_Format:()=>mz,RGB_S3TC_DXT1_Format:()=>fz,RawShaderMaterial:()=>xy,Ray:()=>Mh,Raycaster:()=>Cz,RectAreaLight:()=>Mz,RectAreaLightHelper:()=>Ly,ReinhardToneMapping:()=>lne,RepeatWrapping:()=>ic,ReverseSubtractEquation:()=>Hie,RingBufferGeometry:()=>py,RingGeometry:()=>eM,Scene:()=>Fd,SceneUtils:()=>nLe,ShaderChunk:()=>Xr,ShaderLib:()=>Qg,ShaderMaterial:()=>_a,ShadowMaterial:()=>_y,Shape:()=>Pd,ShapeBufferGeometry:()=>my,ShapeGeometry:()=>vy,ShapePath:()=>oB,ShapeUtils:()=>Ln,ShortType:()=>pne,Skeleton:()=>ZA,SkeletonHelper:()=>Cy,SkinnedMesh:()=>KA,SmoothShading:()=>Oz,Sphere:()=>$n,SphereBufferGeometry:()=>kd,SphereGeometry:()=>QS,Spherical:()=>Pz,SphericalReflectionMapping:()=>qz,Spline:()=>QRe,SplineCurve:()=>Zd,SplineCurve3:()=>eLe,SpotLight:()=>tC,SpotLightHelper:()=>Ay,SpotLightShadow:()=>eC,Sprite:()=>BS,SpriteMaterial:()=>zd,SrcAlphaFactor:()=>Hz,SrcAlphaSaturateFactor:()=>$ie,SrcColorFactor:()=>Yie,StereoCamera:()=>Zne,StringKeyframeTrack:()=>uC,SubtractEquation:()=>Gie,SubtractiveBlending:()=>Bz,TetrahedronBufferGeometry:()=>sy,TetrahedronGeometry:()=>WS,TextGeometry:()=>$S,Texture:()=>ni,TextureFilter:()=>cz,TextureLoader:()=>TC,TextureMapping:()=>fne,TextureWrapping:()=>uz,TorusBufferGeometry:()=>hy,TorusGeometry:()=>JS,TorusKnotBufferGeometry:()=>fy,TorusKnotGeometry:()=>KS,Triangle:()=>Ss,TriangleFanDrawMode:()=>Ene,TriangleStripDrawMode:()=>Tne,TrianglesDrawMode:()=>Kz,TubeBufferGeometry:()=>cy,TubeGeometry:()=>jS,UVMapping:()=>_C,Uint16Attribute:()=>SLe,Uint16BufferAttribute:()=>nc,Uint32Attribute:()=>bLe,Uint32BufferAttribute:()=>ac,Uint8Attribute:()=>yLe,Uint8BufferAttribute:()=>NS,Uint8ClampedAttribute:()=>_Le,Uint8ClampedBufferAttribute:()=>US,Uncharted2ToneMapping:()=>une,Uniform:()=>dC,UniformsLib:()=>hr,UniformsUtils:()=>eo,UnsignedByteType:()=>XA,UnsignedInt248Type:()=>AS,UnsignedIntType:()=>jz,UnsignedShort4444Type:()=>mne,UnsignedShort5551Type:()=>vne,UnsignedShort565Type:()=>gne,UnsignedShortType:()=>ES,Vector2:()=>St,Vector3:()=>oe,Vector4:()=>Qr,VectorKeyframeTrack:()=>Sy,Vertex:()=>mLe,VertexColors:()=>Qd,VertexNormalsHelper:()=>hM,VideoTexture:()=>JA,WebGLRenderTarget:()=>Oy,WebGLRenderTargetCube:()=>$g,WebGLRenderer:()=>Qz,WireframeGeometry:()=>ay,WireframeHelper:()=>CLe,WrapAroundEnding:()=>RS,XHRLoader:()=>RLe,ZeroCurvatureEnding:()=>Id,ZeroFactor:()=>Wie,ZeroSlopeEnding:()=>Ad,sRGBEncoding:()=>Ane});function Ms(){}function St(r,e){this.x=r||0,this.y=e||0}function ni(r,e,t,i,n,a,o,s,l,u){Object.defineProperty(this,"id",{value:tAe++}),this.uuid=cr.generateUUID(),this.name="",this.image=r!==void 0?r:ni.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=e!==void 0?e:ni.DEFAULT_MAPPING,this.wrapS=t!==void 0?t:Uo,this.wrapT=i!==void 0?i:Uo,this.magFilter=n!==void 0?n:to,this.minFilter=a!==void 0?a:gM,this.anisotropy=l!==void 0?l:1,this.format=o!==void 0?o:su,this.type=s!==void 0?s:XA,this.offset=new St(0,0),this.repeat=new St(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u!==void 0?u:LS,this.version=0,this.onUpdate=null}function Qr(r,e,t,i){this.x=r||0,this.y=e||0,this.z=t||0,this.w=i!==void 0?i:1}function Oy(r,e,t){this.uuid=cr.generateUUID(),this.width=r,this.height=e,this.scissor=new Qr(0,0,r,e),this.scissorTest=!1,this.viewport=new Qr(0,0,r,e),t=t||{},t.minFilter===void 0&&(t.minFilter=to),this.texture=new ni(void 0,void 0,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.depthBuffer=t.depthBuffer!==void 0?t.depthBuffer:!0,this.stencilBuffer=t.stencilBuffer!==void 0?t.stencilBuffer:!0,this.depthTexture=t.depthTexture!==void 0?t.depthTexture:null}function $g(r,e,t){Oy.call(this,r,e,t),this.activeCubeFace=0,this.activeMipMapLevel=0}function on(r,e,t,i){this._x=r||0,this._y=e||0,this._z=t||0,this._w=i!==void 0?i:1}function oe(r,e,t){this.x=r||0,this.y=e||0,this.z=t||0}function qt(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function _h(r,e,t,i,n,a,o,s,l,u){r=r!==void 0?r:[],e=e!==void 0?e:xC,ni.call(this,r,e,t,i,n,a,o,s,l,u),this.flipY=!1}function One(){this.seq=[],this.map={}}function Fy(r,e,t){var i=r[0];if(i<=0||i>0)return r;var n=e*t,a=Lie[n];if(a===void 0&&(a=new Float32Array(n),Lie[n]=a),e!==0){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function Fne(r,e){var t=Pie[e];t===void 0&&(t=new Int32Array(e),Pie[e]=t);for(var i=0;i!==e;++i)t[i]=r.allocTextureUnit();return t}function rAe(r,e){r.uniform1f(this.addr,e)}function iAe(r,e){r.uniform1i(this.addr,e)}function nAe(r,e){e.x===void 0?r.uniform2fv(this.addr,e):r.uniform2f(this.addr,e.x,e.y)}function aAe(r,e){e.x!==void 0?r.uniform3f(this.addr,e.x,e.y,e.z):e.r!==void 0?r.uniform3f(this.addr,e.r,e.g,e.b):r.uniform3fv(this.addr,e)}function oAe(r,e){e.x===void 0?r.uniform4fv(this.addr,e):r.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function sAe(r,e){r.uniformMatrix2fv(this.addr,!1,e.elements||e)}function lAe(r,e){r.uniformMatrix3fv(this.addr,!1,e.elements||e)}function uAe(r,e){r.uniformMatrix4fv(this.addr,!1,e.elements||e)}function cAe(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTexture2D(e||Nne,i)}function fAe(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTextureCube(e||Une,i)}function zne(r,e){r.uniform2iv(this.addr,e)}function Bne(r,e){r.uniform3iv(this.addr,e)}function kne(r,e){r.uniform4iv(this.addr,e)}function hAe(r){switch(r){case 5126:return rAe;case 35664:return nAe;case 35665:return aAe;case 35666:return oAe;case 35674:return sAe;case 35675:return lAe;case 35676:return uAe;case 35678:return cAe;case 35680:return fAe;case 5124:case 35670:return iAe;case 35667:case 35671:return zne;case 35668:case 35672:return Bne;case 35669:case 35673:return kne}}function pAe(r,e){r.uniform1fv(this.addr,e)}function dAe(r,e){r.uniform1iv(this.addr,e)}function mAe(r,e){r.uniform2fv(this.addr,Fy(e,this.size,2))}function vAe(r,e){r.uniform3fv(this.addr,Fy(e,this.size,3))}function gAe(r,e){r.uniform4fv(this.addr,Fy(e,this.size,4))}function yAe(r,e){r.uniformMatrix2fv(this.addr,!1,Fy(e,this.size,4))}function _Ae(r,e){r.uniformMatrix3fv(this.addr,!1,Fy(e,this.size,9))}function xAe(r,e){r.uniformMatrix4fv(this.addr,!1,Fy(e,this.size,16))}function SAe(r,e,t){var i=e.length,n=Fne(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTexture2D(e[a]||Nne,n[a])}function MAe(r,e,t){var i=e.length,n=Fne(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTextureCube(e[a]||Une,n[a])}function bAe(r){switch(r){case 5126:return pAe;case 35664:return mAe;case 35665:return vAe;case 35666:return gAe;case 35674:return yAe;case 35675:return _Ae;case 35676:return xAe;case 35678:return SAe;case 35680:return MAe;case 5124:case 35670:return dAe;case 35667:case 35671:return zne;case 35668:case 35672:return Bne;case 35669:case 35673:return kne}}function wAe(r,e,t){this.id=r,this.addr=t,this.setValue=hAe(e.type)}function TAe(r,e,t){this.id=r,this.addr=t,this.size=e.size,this.setValue=bAe(e.type)}function Vne(r){this.id=r,One.call(this)}function Die(r,e){r.seq.push(e),r.map[e.id]=e}function EAe(r,e,t){var i=r.name,n=i.length;for(az.lastIndex=0;;){var a=az.exec(i),o=az.lastIndex,s=a[1],l=a[2]==="]",u=a[3];if(l&&(s=s|0),u===void 0||u==="["&&o+2===n){Die(t,u===void 0?new wAe(s,r,e):new TAe(s,r,e));break}else{var c=t.map,f=c[s];f===void 0&&(f=new Vne(s),Die(t,f)),t=f}}}function xh(r,e,t){One.call(this),this.renderer=t;for(var i=r.getProgramParameter(e,r.ACTIVE_UNIFORMS),n=0;n!==i;++n){var a=r.getActiveUniform(e,n),o=a.name,s=r.getUniformLocation(e,o);EAe(a,s,this)}}function Gt(r,e,t){return e===void 0&&t===void 0?this.set(r):this.setRGB(r,e,t)}function Nd(r,e,t,i,n,a,o,s,l,u,c,f){ni.call(this,null,a,o,s,l,u,i,n,c,f),this.image={data:r,width:e,height:t},this.magFilter=l!==void 0?l:Oo,this.minFilter=u!==void 0?u:Oo,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function PS(r,e){this.min=r!==void 0?r:new St(1/0,1/0),this.max=e!==void 0?e:new St(-1/0,-1/0)}function ERe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c,f;function h(){var d=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),g=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,g,t.STATIC_DRAW),c=t.createTexture(),f=t.createTexture(),i.bindTexture(t.TEXTURE_2D,c),t.texImage2D(t.TEXTURE_2D,0,t.RGB,16,16,0,t.RGB,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),i.bindTexture(t.TEXTURE_2D,f),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,16,16,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),o={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join(` +import{a as RV,b as D0,c as nL,d as LV,e as $M,f as QM}from"./chunk-DNECFSH6.js";import{$a as tf,A as Oc,Aa as xm,Ba as Sm,C as zc,Ca as wl,Ga as qc,Ia as jc,La as Kc,Pa as Jc,Sa as $c,Ua as Qc,V as Fc,W as MV,X as bV,Xa as ef,_ as Bc,aa as wV,b as JM,ba as TV,bb as rf,ca as bl,cb as EV,db as Tl,e as Ic,fb as nf,gb as AV,hb as af,jb as of,kb as CV,la as kc,pa as Vc,ra as Gc,ta as Hc,u as Nc,ua as Wc,v as Uc,wa as Xc,y as SV,ya as Yc}from"./chunk-WD6SV3WH.js";import{$ as sV,Ab as Tc,Bb as oa,Cb as sa,D as iV,Db as vu,Eb as Wi,Fb as ym,Ge as Ac,Ha as qM,I as nV,Ib as vV,Jb as ui,Ka as Ot,Kb as gV,La as Ho,Lb as yV,Le as Cc,Ma as KR,Mb as rL,Me as ZM,Ne as jM,Nf as Zc,Pa as fV,Q as aV,Sb as _m,Ta as Pr,U as oV,Va as Tt,Wa as hV,Xa as JR,Ya as pV,a as XM,ba as jR,cc as iL,cd as xV,db as $R,dc as Ec,e as Use,eb as QR,f as Ose,fb as eL,g as qR,gb as Jt,h as zse,hb as nr,hf as Rc,i as Fse,ia as lV,ib as Yr,ic as L0,j as YM,jb as Sl,kb as Ml,la as aa,lb as dV,lf as Lc,m as eV,na as li,nc as _V,o as ZR,oa as uV,p as tV,pa as cV,qb as mV,ra as R0,sb as Nr,tb as Wo,tf as KM,u as C0,ub as Li,vf as Pc,w as rV,xd as P0,xf as Dc,yb as tL,zb as wc}from"./chunk-VDRVUQCF.js";var eae={};qR(eae,{AddEquation:()=>HF,AddOperation:()=>une,AdditiveBlending:()=>BF,AlphaFormat:()=>xne,AlwaysDepth:()=>rne,AmbientLight:()=>oC,AnimationClip:()=>No,AnimationMixer:()=>hB,AnimationObjectGroup:()=>EF,AnimationUtils:()=>Jn,ArcCurve:()=>yC,ArrowHelper:()=>em,Audio:()=>Ty,AudioAnalyser:()=>fB,AudioContext:()=>uB,AudioListener:()=>wF,AudioLoader:()=>cB,AxisHelper:()=>gC,BackSide:()=>xh,BasicDepthPacking:()=>Nne,BasicShadowMap:()=>eAe,BinaryTextureLoader:()=>rB,BlendingMode:()=>Hie,Bone:()=>KA,BooleanKeyframeTrack:()=>fC,BoundingBoxHelper:()=>CLe,Box2:()=>DS,Box3:()=>su,BoxBufferGeometry:()=>zd,BoxGeometry:()=>sM,BoxHelper:()=>Uy,BufferAttribute:()=>gt,BufferGeometry:()=>Bt,BufferGeometryLoader:()=>nB,ByteType:()=>dne,Cache:()=>MF,Camera:()=>Qn,CameraHelper:()=>vM,CanvasRenderer:()=>ULe,CanvasTexture:()=>QA,CatmullRomCurve3:()=>pB,CineonToneMapping:()=>hne,CircleBufferGeometry:()=>xy,CircleGeometry:()=>oM,ClampToEdgeWrapping:()=>Uo,Clock:()=>PF,ClosedSplineCurve3:()=>Qne,Color:()=>Gt,ColorKeyframeTrack:()=>hC,CompressedTexture:()=>oy,CompressedTextureLoader:()=>qne,ConeBufferGeometry:()=>aM,ConeGeometry:()=>nM,CubeCamera:()=>pC,CubeGeometry:()=>sM,CubeReflectionMapping:()=>SC,CubeRefractionMapping:()=>WA,CubeTexture:()=>Sh,CubeTextureLoader:()=>iB,CubeUVReflectionMapping:()=>MC,CubeUVRefractionMapping:()=>bC,CubicBezierCurve:()=>Jd,CubicBezierCurve3:()=>iLe,CubicInterpolant:()=>sC,CullFaceBack:()=>TS,CullFaceFront:()=>NF,CullFaceFrontBack:()=>$Ee,CullFaceNone:()=>kie,Curve:()=>ea,CurvePath:()=>fM,CurveUtils:()=>xM,CustomBlending:()=>GF,CylinderBufferGeometry:()=>oc,CylinderGeometry:()=>Hd,Cylindrical:()=>IF,DataTexture:()=>Od,DataTextureLoader:()=>eLe,DefaultLoadingManager:()=>Fo,DepthFormat:()=>Ld,DepthStencilFormat:()=>Qg,DepthTexture:()=>HS,DirectionalLight:()=>aC,DirectionalLightHelper:()=>Ny,DirectionalLightShadow:()=>nC,DiscreteInterpolant:()=>lC,DodecahedronBufferGeometry:()=>fy,DodecahedronGeometry:()=>ZS,DoubleSide:()=>Oy,DstAlphaFactor:()=>Kie,DstColorFactor:()=>$ie,DynamicBufferAttribute:()=>yLe,EdgesGeometry:()=>_y,EdgesHelper:()=>RLe,EllipseCurve:()=>sc,EqualDepth:()=>nne,EquirectangularReflectionMapping:()=>qF,EquirectangularRefractionMapping:()=>XA,Euler:()=>Th,EventDispatcher:()=>bs,ExtrudeGeometry:()=>Ts,Face3:()=>zo,Face4:()=>sLe,FaceColors:()=>FF,FaceNormalsHelper:()=>mM,FileLoader:()=>Es,FlatShading:()=>OF,Float32Attribute:()=>ELe,Float32BufferAttribute:()=>gr,Float64Attribute:()=>ALe,Float64BufferAttribute:()=>BS,FloatType:()=>Jg,Fog:()=>ny,FogExp2:()=>iy,Font:()=>lB,FontLoader:()=>jne,FrontFaceDirectionCCW:()=>QEe,FrontFaceDirectionCW:()=>Vie,FrontSide:()=>Kg,Frustum:()=>IS,GammaEncoding:()=>$F,Geometry:()=>sr,GeometryIdCount:()=>QF,GeometryUtils:()=>DLe,GreaterDepth:()=>one,GreaterEqualDepth:()=>ane,GridHelper:()=>dM,Group:()=>GS,HalfFloatType:()=>qA,HemisphereLight:()=>eC,HemisphereLightHelper:()=>Iy,IcosahedronBufferGeometry:()=>cy,IcosahedronGeometry:()=>qS,ImageLoader:()=>_M,ImageUtils:()=>ILe,ImmediateRenderObject:()=>hM,InstancedBufferAttribute:()=>Cy,InstancedBufferGeometry:()=>Qd,InstancedInterleavedBuffer:()=>Ay,Int16Attribute:()=>MLe,Int16BufferAttribute:()=>zS,Int32Attribute:()=>wLe,Int32BufferAttribute:()=>FS,Int8Attribute:()=>_Le,Int8BufferAttribute:()=>NS,IntType:()=>vne,InterleavedBuffer:()=>Ey,InterleavedBufferAttribute:()=>CF,Interpolant:()=>ao,InterpolateDiscrete:()=>RS,InterpolateLinear:()=>wS,InterpolateSmooth:()=>GA,JSONLoader:()=>aB,KeyframeTrack:()=>jd,LOD:()=>VS,LatheBufferGeometry:()=>vy,LatheGeometry:()=>iM,Layers:()=>ZA,LensFlare:()=>SF,LessDepth:()=>ine,LessEqualDepth:()=>HA,Light:()=>Ui,LightShadow:()=>rm,Line:()=>ac,Line3:()=>Pd,LineBasicMaterial:()=>Ni,LineCurve:()=>uu,LineCurve3:()=>aLe,LineDashedMaterial:()=>Zd,LinePieces:()=>uLe,LineSegments:()=>di,LineStrip:()=>lLe,LinearEncoding:()=>PS,LinearFilter:()=>no,LinearInterpolant:()=>uM,LinearMipMapLinearFilter:()=>yM,LinearMipMapNearestFilter:()=>jF,LinearToneMapping:()=>YF,Loader:()=>Dd,LoadingManager:()=>tB,LogLuvEncoding:()=>rAe,LoopOnce:()=>wne,LoopPingPong:()=>Ene,LoopRepeat:()=>Tne,LuminanceAlphaFormat:()=>Mne,LuminanceFormat:()=>Sne,MOUSE:()=>JEe,Material:()=>mr,MaterialLoader:()=>AC,Math:()=>cr,Matrix3:()=>ws,Matrix4:()=>qt,MaxEquation:()=>uF,Mesh:()=>mn,MeshBasicMaterial:()=>oo,MeshDepthMaterial:()=>bh,MeshFaceMaterial:()=>cLe,MeshLambertMaterial:()=>qd,MeshNormalMaterial:()=>Yd,MeshPhongMaterial:()=>vl,MeshPhysicalMaterial:()=>Wd,MeshStandardMaterial:()=>lu,MeshToonMaterial:()=>Xd,MinEquation:()=>lF,MirroredRepeatWrapping:()=>Nd,MixOperation:()=>lne,MorphBlendMesh:()=>Pn,MultiMaterial:()=>lM,MultiplyBlending:()=>VF,MultiplyOperation:()=>gM,NearestFilter:()=>Oo,NearestMipMapLinearFilter:()=>TC,NearestMipMapNearestFilter:()=>wC,NeverDepth:()=>tne,NoBlending:()=>ES,NoColors:()=>_C,NoToneMapping:()=>VA,NormalBlending:()=>zy,NotEqualDepth:()=>sne,NumberKeyframeTrack:()=>wy,Object3D:()=>At,ObjectLoader:()=>Zne,OctahedronBufferGeometry:()=>Vd,OctahedronGeometry:()=>YS,OneFactor:()=>qie,OneMinusDstAlphaFactor:()=>Jie,OneMinusDstColorFactor:()=>Qie,OneMinusSrcAlphaFactor:()=>XF,OneMinusSrcColorFactor:()=>jie,OrthographicCamera:()=>ry,PCFShadowMap:()=>UF,PCFSoftShadowMap:()=>Gie,ParametricBufferGeometry:()=>ly,ParametricGeometry:()=>WS,Particle:()=>hLe,ParticleBasicMaterial:()=>mLe,ParticleSystem:()=>pLe,ParticleSystemMaterial:()=>vLe,Path:()=>SM,PerspectiveCamera:()=>Kn,Plane:()=>Io,PlaneBufferGeometry:()=>Fd,PlaneGeometry:()=>rM,PointCloud:()=>fLe,PointCloudMaterial:()=>dLe,PointLight:()=>iC,PointLightHelper:()=>Py,Points:()=>ay,PointsMaterial:()=>ml,PolarGridHelper:()=>vC,PolyhedronBufferGeometry:()=>so,PolyhedronGeometry:()=>jS,PositionalAudio:()=>TF,Projector:()=>NLe,PropertyBinding:()=>Ri,PropertyMixer:()=>dC,QuadraticBezierCurve:()=>$d,QuadraticBezierCurve3:()=>nLe,Quaternion:()=>on,QuaternionKeyframeTrack:()=>cM,QuaternionLinearInterpolant:()=>uC,REVISION:()=>Bie,RGBADepthPacking:()=>Une,RGBAFormat:()=>ou,RGBA_PVRTC_2BPPV1_Format:()=>_F,RGBA_PVRTC_4BPPV1_Format:()=>yF,RGBA_S3TC_DXT1_Format:()=>pF,RGBA_S3TC_DXT3_Format:()=>dF,RGBA_S3TC_DXT5_Format:()=>mF,RGBDEncoding:()=>Ine,RGBEEncoding:()=>Lne,RGBEFormat:()=>tAe,RGBFormat:()=>$g,RGBM16Encoding:()=>Dne,RGBM7Encoding:()=>Pne,RGB_ETC1_Format:()=>bne,RGB_PVRTC_2BPPV1_Format:()=>gF,RGB_PVRTC_4BPPV1_Format:()=>vF,RGB_S3TC_DXT1_Format:()=>hF,RawShaderMaterial:()=>My,Ray:()=>wh,Raycaster:()=>RF,RectAreaLight:()=>bF,RectAreaLightHelper:()=>Dy,ReinhardToneMapping:()=>cne,RepeatWrapping:()=>rc,ReverseSubtractEquation:()=>Xie,RingBufferGeometry:()=>my,RingGeometry:()=>tM,Scene:()=>Bd,SceneUtils:()=>oLe,ShaderChunk:()=>Xr,ShaderLib:()=>ty,ShaderMaterial:()=>Ma,ShadowMaterial:()=>Sy,Shape:()=>Id,ShapeBufferGeometry:()=>gy,ShapeGeometry:()=>yy,ShapePath:()=>sB,ShapeUtils:()=>Ln,ShortType:()=>mne,Skeleton:()=>jA,SkeletonHelper:()=>Ly,SkinnedMesh:()=>JA,SmoothShading:()=>zF,Sphere:()=>$n,SphereBufferGeometry:()=>Gd,SphereGeometry:()=>eM,Spherical:()=>DF,SphericalReflectionMapping:()=>ZF,Spline:()=>tLe,SplineCurve:()=>Kd,SplineCurve3:()=>rLe,SpotLight:()=>rC,SpotLightHelper:()=>Ry,SpotLightShadow:()=>tC,Sprite:()=>kS,SpriteMaterial:()=>kd,SrcAlphaFactor:()=>WF,SrcAlphaSaturateFactor:()=>ene,SrcColorFactor:()=>Zie,StereoCamera:()=>Kne,StringKeyframeTrack:()=>cC,SubtractEquation:()=>Wie,SubtractiveBlending:()=>kF,TetrahedronBufferGeometry:()=>uy,TetrahedronGeometry:()=>XS,TextGeometry:()=>QS,Texture:()=>ai,TextureFilter:()=>fF,TextureLoader:()=>EC,TextureMapping:()=>pne,TextureWrapping:()=>cF,TorusBufferGeometry:()=>dy,TorusGeometry:()=>$S,TorusKnotBufferGeometry:()=>py,TorusKnotGeometry:()=>JS,Triangle:()=>Ms,TriangleFanDrawMode:()=>Cne,TriangleStripDrawMode:()=>Ane,TrianglesDrawMode:()=>JF,TubeBufferGeometry:()=>hy,TubeGeometry:()=>KS,UVMapping:()=>xC,Uint16Attribute:()=>bLe,Uint16BufferAttribute:()=>ic,Uint32Attribute:()=>TLe,Uint32BufferAttribute:()=>nc,Uint8Attribute:()=>xLe,Uint8BufferAttribute:()=>US,Uint8ClampedAttribute:()=>SLe,Uint8ClampedBufferAttribute:()=>OS,Uncharted2ToneMapping:()=>fne,Uniform:()=>mC,UniformsLib:()=>hr,UniformsUtils:()=>io,UnsignedByteType:()=>YA,UnsignedInt248Type:()=>CS,UnsignedIntType:()=>KF,UnsignedShort4444Type:()=>gne,UnsignedShort5551Type:()=>yne,UnsignedShort565Type:()=>_ne,UnsignedShortType:()=>AS,Vector2:()=>St,Vector3:()=>oe,Vector4:()=>ei,VectorKeyframeTrack:()=>by,Vertex:()=>gLe,VertexColors:()=>tm,VertexNormalsHelper:()=>pM,VideoTexture:()=>$A,WebGLRenderTarget:()=>Fy,WebGLRenderTargetCube:()=>ey,WebGLRenderer:()=>eB,WireframeGeometry:()=>sy,WireframeHelper:()=>LLe,WrapAroundEnding:()=>LS,XHRLoader:()=>PLe,ZeroCurvatureEnding:()=>Ud,ZeroFactor:()=>Yie,ZeroSlopeEnding:()=>Rd,sRGBEncoding:()=>Rne});function bs(){}function St(r,e){this.x=r||0,this.y=e||0}function ai(r,e,t,i,n,a,o,s,l,u){Object.defineProperty(this,"id",{value:iAe++}),this.uuid=cr.generateUUID(),this.name="",this.image=r!==void 0?r:ai.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=e!==void 0?e:ai.DEFAULT_MAPPING,this.wrapS=t!==void 0?t:Uo,this.wrapT=i!==void 0?i:Uo,this.magFilter=n!==void 0?n:no,this.minFilter=a!==void 0?a:yM,this.anisotropy=l!==void 0?l:1,this.format=o!==void 0?o:ou,this.type=s!==void 0?s:YA,this.offset=new St(0,0),this.repeat=new St(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u!==void 0?u:PS,this.version=0,this.onUpdate=null}function ei(r,e,t,i){this.x=r||0,this.y=e||0,this.z=t||0,this.w=i!==void 0?i:1}function Fy(r,e,t){this.uuid=cr.generateUUID(),this.width=r,this.height=e,this.scissor=new ei(0,0,r,e),this.scissorTest=!1,this.viewport=new ei(0,0,r,e),t=t||{},t.minFilter===void 0&&(t.minFilter=no),this.texture=new ai(void 0,void 0,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.depthBuffer=t.depthBuffer!==void 0?t.depthBuffer:!0,this.stencilBuffer=t.stencilBuffer!==void 0?t.stencilBuffer:!0,this.depthTexture=t.depthTexture!==void 0?t.depthTexture:null}function ey(r,e,t){Fy.call(this,r,e,t),this.activeCubeFace=0,this.activeMipMapLevel=0}function on(r,e,t,i){this._x=r||0,this._y=e||0,this._z=t||0,this._w=i!==void 0?i:1}function oe(r,e,t){this.x=r||0,this.y=e||0,this.z=t||0}function qt(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Sh(r,e,t,i,n,a,o,s,l,u){r=r!==void 0?r:[],e=e!==void 0?e:SC,ai.call(this,r,e,t,i,n,a,o,s,l,u),this.flipY=!1}function Fne(){this.seq=[],this.map={}}function By(r,e,t){var i=r[0];if(i<=0||i>0)return r;var n=e*t,a=Die[n];if(a===void 0&&(a=new Float32Array(n),Die[n]=a),e!==0){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function Bne(r,e){var t=Iie[e];t===void 0&&(t=new Int32Array(e),Iie[e]=t);for(var i=0;i!==e;++i)t[i]=r.allocTextureUnit();return t}function nAe(r,e){r.uniform1f(this.addr,e)}function aAe(r,e){r.uniform1i(this.addr,e)}function oAe(r,e){e.x===void 0?r.uniform2fv(this.addr,e):r.uniform2f(this.addr,e.x,e.y)}function sAe(r,e){e.x!==void 0?r.uniform3f(this.addr,e.x,e.y,e.z):e.r!==void 0?r.uniform3f(this.addr,e.r,e.g,e.b):r.uniform3fv(this.addr,e)}function lAe(r,e){e.x===void 0?r.uniform4fv(this.addr,e):r.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function uAe(r,e){r.uniformMatrix2fv(this.addr,!1,e.elements||e)}function cAe(r,e){r.uniformMatrix3fv(this.addr,!1,e.elements||e)}function fAe(r,e){r.uniformMatrix4fv(this.addr,!1,e.elements||e)}function hAe(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTexture2D(e||One,i)}function pAe(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTextureCube(e||zne,i)}function kne(r,e){r.uniform2iv(this.addr,e)}function Vne(r,e){r.uniform3iv(this.addr,e)}function Gne(r,e){r.uniform4iv(this.addr,e)}function dAe(r){switch(r){case 5126:return nAe;case 35664:return oAe;case 35665:return sAe;case 35666:return lAe;case 35674:return uAe;case 35675:return cAe;case 35676:return fAe;case 35678:return hAe;case 35680:return pAe;case 5124:case 35670:return aAe;case 35667:case 35671:return kne;case 35668:case 35672:return Vne;case 35669:case 35673:return Gne}}function mAe(r,e){r.uniform1fv(this.addr,e)}function vAe(r,e){r.uniform1iv(this.addr,e)}function gAe(r,e){r.uniform2fv(this.addr,By(e,this.size,2))}function yAe(r,e){r.uniform3fv(this.addr,By(e,this.size,3))}function _Ae(r,e){r.uniform4fv(this.addr,By(e,this.size,4))}function xAe(r,e){r.uniformMatrix2fv(this.addr,!1,By(e,this.size,4))}function SAe(r,e){r.uniformMatrix3fv(this.addr,!1,By(e,this.size,9))}function MAe(r,e){r.uniformMatrix4fv(this.addr,!1,By(e,this.size,16))}function bAe(r,e,t){var i=e.length,n=Bne(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTexture2D(e[a]||One,n[a])}function wAe(r,e,t){var i=e.length,n=Bne(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTextureCube(e[a]||zne,n[a])}function TAe(r){switch(r){case 5126:return mAe;case 35664:return gAe;case 35665:return yAe;case 35666:return _Ae;case 35674:return xAe;case 35675:return SAe;case 35676:return MAe;case 35678:return bAe;case 35680:return wAe;case 5124:case 35670:return vAe;case 35667:case 35671:return kne;case 35668:case 35672:return Vne;case 35669:case 35673:return Gne}}function EAe(r,e,t){this.id=r,this.addr=t,this.setValue=dAe(e.type)}function AAe(r,e,t){this.id=r,this.addr=t,this.size=e.size,this.setValue=TAe(e.type)}function Hne(r){this.id=r,Fne.call(this)}function Nie(r,e){r.seq.push(e),r.map[e.id]=e}function CAe(r,e,t){var i=r.name,n=i.length;for(oF.lastIndex=0;;){var a=oF.exec(i),o=oF.lastIndex,s=a[1],l=a[2]==="]",u=a[3];if(l&&(s=s|0),u===void 0||u==="["&&o+2===n){Nie(t,u===void 0?new EAe(s,r,e):new AAe(s,r,e));break}else{var c=t.map,f=c[s];f===void 0&&(f=new Hne(s),Nie(t,f)),t=f}}}function Mh(r,e,t){Fne.call(this),this.renderer=t;for(var i=r.getProgramParameter(e,r.ACTIVE_UNIFORMS),n=0;n!==i;++n){var a=r.getActiveUniform(e,n),o=a.name,s=r.getUniformLocation(e,o);CAe(a,s,this)}}function Gt(r,e,t){return e===void 0&&t===void 0?this.set(r):this.setRGB(r,e,t)}function Od(r,e,t,i,n,a,o,s,l,u,c,f){ai.call(this,null,a,o,s,l,u,i,n,c,f),this.image={data:r,width:e,height:t},this.magFilter=l!==void 0?l:Oo,this.minFilter=u!==void 0?u:Oo,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function DS(r,e){this.min=r!==void 0?r:new St(1/0,1/0),this.max=e!==void 0?e:new St(-1/0,-1/0)}function CRe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c,f;function h(){var d=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),g=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,g,t.STATIC_DRAW),c=t.createTexture(),f=t.createTexture(),i.bindTexture(t.TEXTURE_2D,c),t.texImage2D(t.TEXTURE_2D,0,t.RGB,16,16,0,t.RGB,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),i.bindTexture(t.TEXTURE_2D,f),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,16,16,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),o={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join(` `),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join(` -`)},s=p(o),l={vertex:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},u={renderType:t.getUniformLocation(s,"renderType"),map:t.getUniformLocation(s,"map"),occlusionMap:t.getUniformLocation(s,"occlusionMap"),opacity:t.getUniformLocation(s,"opacity"),color:t.getUniformLocation(s,"color"),scale:t.getUniformLocation(s,"scale"),rotation:t.getUniformLocation(s,"rotation"),screenPosition:t.getUniformLocation(s,"screenPosition")}}this.render=function(d,g,m){if(e.length!==0){var v=new oe,_=m.w/m.z,y=m.z*.5,x=m.w*.5,M=16/m.w,S=new St(M*_,M),w=new oe(1,1,0),T=new St(1,1),C=new PS;C.min.set(m.x,m.y),C.max.set(m.x+(m.z-16),m.y+(m.w-16)),s===void 0&&h(),t.useProgram(s),i.initAttributes(),i.enableAttribute(l.vertex),i.enableAttribute(l.uv),i.disableUnusedAttributes(),t.uniform1i(u.occlusionMap,0),t.uniform1i(u.map,1),t.bindBuffer(t.ARRAY_BUFFER,n),t.vertexAttribPointer(l.vertex,2,t.FLOAT,!1,2*8,0),t.vertexAttribPointer(l.uv,2,t.FLOAT,!1,2*8,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),i.disable(t.CULL_FACE),i.setDepthWrite(!1);for(var b=0,E=e.length;b.001&&D.scale>.001&&(w.x=D.x,w.y=D.y,w.z=D.z,M=D.size*D.scale/m.w,S.x=M*_,S.y=M,t.uniform3f(u.screenPosition,w.x,w.y,w.z),t.uniform2f(u.scale,S.x,S.y),t.uniform1f(u.rotation,D.rotation),t.uniform1f(u.opacity,D.opacity),t.uniform3f(u.color,D.color.r,D.color.g,D.color.b),i.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst),r.setTexture2D(D.texture,1),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0))}}}i.enable(t.CULL_FACE),i.enable(t.DEPTH_TEST),i.setDepthWrite(!0),r.resetGLState()}};function p(d){var g=t.createProgram(),m=t.createShader(t.FRAGMENT_SHADER),v=t.createShader(t.VERTEX_SHADER),_="precision "+r.getPrecision()+` float; -`;return t.shaderSource(m,_+d.fragmentShader),t.shaderSource(v,_+d.vertexShader),t.compileShader(m),t.compileShader(v),t.attachShader(g,m),t.attachShader(g,v),t.linkProgram(g),g}}function ARe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c=new oe,f=new on,h=new oe;function p(){var m=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),v=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,v,t.STATIC_DRAW),o=d(),s={position:t.getAttribLocation(o,"position"),uv:t.getAttribLocation(o,"uv")},l={uvOffset:t.getUniformLocation(o,"uvOffset"),uvScale:t.getUniformLocation(o,"uvScale"),rotation:t.getUniformLocation(o,"rotation"),scale:t.getUniformLocation(o,"scale"),color:t.getUniformLocation(o,"color"),map:t.getUniformLocation(o,"map"),opacity:t.getUniformLocation(o,"opacity"),modelViewMatrix:t.getUniformLocation(o,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(o,"projectionMatrix"),fogType:t.getUniformLocation(o,"fogType"),fogDensity:t.getUniformLocation(o,"fogDensity"),fogNear:t.getUniformLocation(o,"fogNear"),fogFar:t.getUniformLocation(o,"fogFar"),fogColor:t.getUniformLocation(o,"fogColor"),alphaTest:t.getUniformLocation(o,"alphaTest")};var _=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");_.width=8,_.height=8;var y=_.getContext("2d");y.fillStyle="white",y.fillRect(0,0,8,8),u=new ni(_),u.needsUpdate=!0}this.render=function(m,v){if(e.length!==0){o===void 0&&p(),t.useProgram(o),i.initAttributes(),i.enableAttribute(s.position),i.enableAttribute(s.uv),i.disableUnusedAttributes(),i.disable(t.CULL_FACE),i.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,n),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,2*8,0),t.vertexAttribPointer(s.uv,2,t.FLOAT,!1,2*8,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.uniformMatrix4fv(l.projectionMatrix,!1,v.projectionMatrix.elements),i.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var _=0,y=0,x=m.fog;x?(t.uniform3f(l.fogColor,x.color.r,x.color.g,x.color.b),x.isFog?(t.uniform1f(l.fogNear,x.near),t.uniform1f(l.fogFar,x.far),t.uniform1i(l.fogType,1),_=1,y=1):x.isFogExp2&&(t.uniform1f(l.fogDensity,x.density),t.uniform1i(l.fogType,2),_=2,y=2)):(t.uniform1i(l.fogType,0),_=0,y=0);for(var M=0,S=e.length;M.001&&D.scale>.001&&(w.x=D.x,w.y=D.y,w.z=D.z,M=D.size*D.scale/m.w,S.x=M*_,S.y=M,t.uniform3f(u.screenPosition,w.x,w.y,w.z),t.uniform2f(u.scale,S.x,S.y),t.uniform1f(u.rotation,D.rotation),t.uniform1f(u.opacity,D.opacity),t.uniform3f(u.color,D.color.r,D.color.g,D.color.b),i.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst),r.setTexture2D(D.texture,1),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0))}}}i.enable(t.CULL_FACE),i.enable(t.DEPTH_TEST),i.setDepthWrite(!0),r.resetGLState()}};function p(d){var g=t.createProgram(),m=t.createShader(t.FRAGMENT_SHADER),v=t.createShader(t.VERTEX_SHADER),_="precision "+r.getPrecision()+` float; +`;return t.shaderSource(m,_+d.fragmentShader),t.shaderSource(v,_+d.vertexShader),t.compileShader(m),t.compileShader(v),t.attachShader(g,m),t.attachShader(g,v),t.linkProgram(g),g}}function RRe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c=new oe,f=new on,h=new oe;function p(){var m=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),v=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,v,t.STATIC_DRAW),o=d(),s={position:t.getAttribLocation(o,"position"),uv:t.getAttribLocation(o,"uv")},l={uvOffset:t.getUniformLocation(o,"uvOffset"),uvScale:t.getUniformLocation(o,"uvScale"),rotation:t.getUniformLocation(o,"rotation"),scale:t.getUniformLocation(o,"scale"),color:t.getUniformLocation(o,"color"),map:t.getUniformLocation(o,"map"),opacity:t.getUniformLocation(o,"opacity"),modelViewMatrix:t.getUniformLocation(o,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(o,"projectionMatrix"),fogType:t.getUniformLocation(o,"fogType"),fogDensity:t.getUniformLocation(o,"fogDensity"),fogNear:t.getUniformLocation(o,"fogNear"),fogFar:t.getUniformLocation(o,"fogFar"),fogColor:t.getUniformLocation(o,"fogColor"),alphaTest:t.getUniformLocation(o,"alphaTest")};var _=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");_.width=8,_.height=8;var y=_.getContext("2d");y.fillStyle="white",y.fillRect(0,0,8,8),u=new ai(_),u.needsUpdate=!0}this.render=function(m,v){if(e.length!==0){o===void 0&&p(),t.useProgram(o),i.initAttributes(),i.enableAttribute(s.position),i.enableAttribute(s.uv),i.disableUnusedAttributes(),i.disable(t.CULL_FACE),i.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,n),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,2*8,0),t.vertexAttribPointer(s.uv,2,t.FLOAT,!1,2*8,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.uniformMatrix4fv(l.projectionMatrix,!1,v.projectionMatrix.elements),i.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var _=0,y=0,x=m.fog;x?(t.uniform3f(l.fogColor,x.color.r,x.color.g,x.color.b),x.isFog?(t.uniform1f(l.fogNear,x.near),t.uniform1f(l.fogFar,x.far),t.uniform1i(l.fogType,1),_=1,y=1):x.isFogExp2&&(t.uniform1f(l.fogDensity,x.density),t.uniform1i(l.fogType,2),_=2,y=2)):(t.uniform1i(l.fogType,0),_=0,y=0);for(var M=0,S=e.length;M 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join(` -`)),t.compileShader(v),t.compileShader(_),t.attachShader(m,v),t.attachShader(m,_),t.linkProgram(m),m}function g(m,v){return m.renderOrder!==v.renderOrder?m.renderOrder-v.renderOrder:m.z!==v.z?v.z-m.z:v.id-m.id}}function mr(){Object.defineProperty(this,"id",{value:CRe++}),this.uuid=cr.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=Uy,this.side=Zg,this.shading=Oz,this.vertexColors=yC,this.opacity=1,this.transparent=!1,this.blendSrc=Hz,this.blendDst=Wz,this.blendEquation=Gz,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=GA,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0}function _a(r){mr.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() { +`)),t.compileShader(v),t.compileShader(_),t.attachShader(m,v),t.attachShader(m,_),t.linkProgram(m),m}function g(m,v){return m.renderOrder!==v.renderOrder?m.renderOrder-v.renderOrder:m.z!==v.z?v.z-m.z:v.id-m.id}}function mr(){Object.defineProperty(this,"id",{value:LRe++}),this.uuid=cr.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=zy,this.side=Kg,this.shading=zF,this.vertexColors=_C,this.opacity=1,this.transparent=!1,this.blendSrc=WF,this.blendDst=XF,this.blendEquation=HF,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=HA,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0}function Ma(r){mr.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`,this.fragmentShader=`void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); -}`,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,r!==void 0&&(r.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(r))}function Sh(r){mr.call(this),this.type="MeshDepthMaterial",this.depthPacking=Dne,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(r)}function lu(r,e){this.min=r!==void 0?r:new oe(1/0,1/0,1/0),this.max=e!==void 0?e:new oe(-1/0,-1/0,-1/0)}function $n(r,e){this.center=r!==void 0?r:new oe,this.radius=e!==void 0?e:0}function bs(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function Io(r,e){this.normal=r!==void 0?r:new oe(1,0,0),this.constant=e!==void 0?e:0}function DS(r,e,t,i,n,a){this.planes=[r!==void 0?r:new Io,e!==void 0?e:new Io,t!==void 0?t:new Io,i!==void 0?i:new Io,n!==void 0?n:new Io,a!==void 0?a:new Io]}function Gne(r,e,t,i){var n=r.context,a=r.state,o=new DS,s=new qt,l=e.shadows,u=new St,c=new St(i.maxTextureSize,i.maxTextureSize),f=new oe,h=new oe,p=[],d=1,g=2,m=(d|g)+1,v=new Array(m),_=new Array(m),y={},x=[new oe(1,0,0),new oe(-1,0,0),new oe(0,0,1),new oe(0,0,-1),new oe(0,1,0),new oe(0,-1,0)],M=[new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,0,1),new oe(0,0,-1)],S=[new Qr,new Qr,new Qr,new Qr,new Qr,new Qr],w=new Sh;w.depthPacking=Ine,w.clipping=!0;for(var T=Qg.distanceRGBA,C=eo.clone(T.uniforms),b=0;b!==m;++b){var E=(b&d)!==0,I=(b&g)!==0,R=w.clone();R.morphTargets=E,R.skinning=I,v[b]=R;var A=new _a({defines:{USE_SHADOWMAP:""},uniforms:C,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,morphTargets:E,skinning:I,clipping:!0});_[b]=A}var D=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Nz,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(F,k){if(D.enabled!==!1&&!(D.autoUpdate===!1&&D.needsUpdate===!1)&&l.length!==0){a.buffers.color.setClear(1,1,1,1),a.disable(n.BLEND),a.setDepthTest(!0),a.setScissorTest(!1);for(var G,Y,J=0,Q=l.length;J0:J&&J.isGeometry&&(ae=J.morphTargets&&J.morphTargets.length>0));var ve=F.isSkinnedMesh&&k.skinning,ue=0;ae&&(ue|=d),ve&&(ue|=g),Q=V[ue]}if(r.localClippingEnabled&&k.clipShadows===!0&&k.clippingPlanes.length!==0){var se=Q.uuid,Ee=k.uuid,q=y[se];q===void 0&&(q={},y[se]=q);var H=q[Ee];H===void 0&&(H=Q.clone(),q[Ee]=H),Q=H}Q.visible=k.visible,Q.wireframe=k.wireframe;var We=k.side;return D.renderSingleSided&&We==Ny&&(We=Zg),D.renderReverseSided&&(We===Zg?We=yh:We===yh&&(We=Zg)),Q.side=We,Q.clipShadows=k.clipShadows,Q.clippingPlanes=k.clippingPlanes,Q.wireframeLinewidth=k.wireframeLinewidth,Q.linewidth=k.linewidth,G&&Q.uniforms.lightPos!==void 0&&Q.uniforms.lightPos.value.copy(Y),Q}function B(F,k,G){if(F.visible!==!1){var Y=(F.layers.mask&k.layers.mask)!==0;if(Y&&(F.isMesh||F.isLine||F.isPoints)&&F.castShadow&&(F.frustumCulled===!1||o.intersectsObject(F)===!0)){var J=F.material;J.visible===!0&&(F.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,F.matrixWorld),p.push(F))}for(var Q=F.children,V=0,K=Q.length;V65535?Uint32Array:Uint16Array)(l),c=new Float32Array(s*3),f=new Float32Array(s*3),h=new Float32Array(s*2),p=0,d=0,g=0,m=0,v=0;x("z","y","x",-1,-1,t,e,r,a,n,0),x("z","y","x",1,-1,t,e,-r,a,n,1),x("x","z","y",1,1,r,t,e,i,a,2),x("x","z","y",1,-1,r,t,-e,i,a,3),x("x","y","z",1,-1,r,e,t,i,n,4),x("x","y","z",-1,-1,r,e,-t,i,n,5),this.setIndex(new gt(u,1)),this.addAttribute("position",new gt(c,3)),this.addAttribute("normal",new gt(f,3)),this.addAttribute("uv",new gt(h,2));function _(M,S,w){var T=0;return T+=(M+1)*(S+1)*2,T+=(M+1)*(w+1)*2,T+=(w+1)*(S+1)*2,T}function y(M,S,w){var T=0;return T+=M*S*2,T+=M*w*2,T+=w*S*2,T*6}function x(M,S,w,T,C,b,E,I,R,A,D){for(var U=b/R,B=E/A,F=b/2,k=E/2,G=I/2,Y=R+1,J=A+1,Q=0,V=0,K=new oe,ae=0;ae0?1:-1,f[p]=K.x,f[p+1]=K.y,f[p+2]=K.z,h[d]=ue/R,h[d+1]=1-ae/A,p+=3,d+=2,Q+=1}for(ae=0;ae65535?Uint32Array:Uint16Array)(o*s*6),v=0;v0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function Io(r,e){this.normal=r!==void 0?r:new oe(1,0,0),this.constant=e!==void 0?e:0}function IS(r,e,t,i,n,a){this.planes=[r!==void 0?r:new Io,e!==void 0?e:new Io,t!==void 0?t:new Io,i!==void 0?i:new Io,n!==void 0?n:new Io,a!==void 0?a:new Io]}function Wne(r,e,t,i){var n=r.context,a=r.state,o=new IS,s=new qt,l=e.shadows,u=new St,c=new St(i.maxTextureSize,i.maxTextureSize),f=new oe,h=new oe,p=[],d=1,g=2,m=(d|g)+1,v=new Array(m),_=new Array(m),y={},x=[new oe(1,0,0),new oe(-1,0,0),new oe(0,0,1),new oe(0,0,-1),new oe(0,1,0),new oe(0,-1,0)],M=[new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,0,1),new oe(0,0,-1)],S=[new ei,new ei,new ei,new ei,new ei,new ei],w=new bh;w.depthPacking=Une,w.clipping=!0;for(var T=ty.distanceRGBA,C=io.clone(T.uniforms),b=0;b!==m;++b){var E=(b&d)!==0,I=(b&g)!==0,R=w.clone();R.morphTargets=E,R.skinning=I,v[b]=R;var A=new Ma({defines:{USE_SHADOWMAP:""},uniforms:C,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,morphTargets:E,skinning:I,clipping:!0});_[b]=A}var D=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=UF,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(z,k){if(D.enabled!==!1&&!(D.autoUpdate===!1&&D.needsUpdate===!1)&&l.length!==0){a.buffers.color.setClear(1,1,1,1),a.disable(n.BLEND),a.setDepthTest(!0),a.setScissorTest(!1);for(var G,Y,J=0,Q=l.length;J0:J&&J.isGeometry&&(ae=J.morphTargets&&J.morphTargets.length>0));var ve=z.isSkinnedMesh&&k.skinning,ue=0;ae&&(ue|=d),ve&&(ue|=g),Q=V[ue]}if(r.localClippingEnabled&&k.clipShadows===!0&&k.clippingPlanes.length!==0){var se=Q.uuid,Ee=k.uuid,q=y[se];q===void 0&&(q={},y[se]=q);var H=q[Ee];H===void 0&&(H=Q.clone(),q[Ee]=H),Q=H}Q.visible=k.visible,Q.wireframe=k.wireframe;var We=k.side;return D.renderSingleSided&&We==Oy&&(We=Kg),D.renderReverseSided&&(We===Kg?We=xh:We===xh&&(We=Kg)),Q.side=We,Q.clipShadows=k.clipShadows,Q.clippingPlanes=k.clippingPlanes,Q.wireframeLinewidth=k.wireframeLinewidth,Q.linewidth=k.linewidth,G&&Q.uniforms.lightPos!==void 0&&Q.uniforms.lightPos.value.copy(Y),Q}function B(z,k,G){if(z.visible!==!1){var Y=(z.layers.mask&k.layers.mask)!==0;if(Y&&(z.isMesh||z.isLine||z.isPoints)&&z.castShadow&&(z.frustumCulled===!1||o.intersectsObject(z)===!0)){var J=z.material;J.visible===!0&&(z.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,z.matrixWorld),p.push(z))}for(var Q=z.children,V=0,K=Q.length;V65535?Uint32Array:Uint16Array)(l),c=new Float32Array(s*3),f=new Float32Array(s*3),h=new Float32Array(s*2),p=0,d=0,g=0,m=0,v=0;x("z","y","x",-1,-1,t,e,r,a,n,0),x("z","y","x",1,-1,t,e,-r,a,n,1),x("x","z","y",1,1,r,t,e,i,a,2),x("x","z","y",1,-1,r,t,-e,i,a,3),x("x","y","z",1,-1,r,e,t,i,n,4),x("x","y","z",-1,-1,r,e,-t,i,n,5),this.setIndex(new gt(u,1)),this.addAttribute("position",new gt(c,3)),this.addAttribute("normal",new gt(f,3)),this.addAttribute("uv",new gt(h,2));function _(M,S,w){var T=0;return T+=(M+1)*(S+1)*2,T+=(M+1)*(w+1)*2,T+=(w+1)*(S+1)*2,T}function y(M,S,w){var T=0;return T+=M*S*2,T+=M*w*2,T+=w*S*2,T*6}function x(M,S,w,T,C,b,E,I,R,A,D){for(var U=b/R,B=E/A,z=b/2,k=E/2,G=I/2,Y=R+1,J=A+1,Q=0,V=0,K=new oe,ae=0;ae0?1:-1,f[p]=K.x,f[p+1]=K.y,f[p+2]=K.z,h[d]=ue/R,h[d+1]=1-ae/A,p+=3,d+=2,Q+=1}for(ae=0;ae65535?Uint32Array:Uint16Array)(o*s*6),v=0;v/g;function t(i,n){var a=Xr[n];if(a===void 0)throw new Error("Can not resolve #include <"+n+">");return _z(a)}return r.replace(e,t)}function Uie(r){var e=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function t(i,n,a,o){for(var s="",l=parseInt(n);l0?r.gammaFactor:1,d=zRe(a,i,r.extensions),g=BRe(o),m=n.createProgram(),v,_;t.isRawShaderMaterial?(v=[g,` -`].filter(MS).join(` +`)}function Uie(r,e,t){var i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),r.getShaderParameter(i,r.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),r.getShaderInfoLog(i)!==""&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===r.VERTEX_SHADER?"vertex":"fragment",r.getShaderInfoLog(i),ORe(t)),i}function Yne(r){switch(r){case PS:return["Linear","( value )"];case Rne:return["sRGB","( value )"];case Lne:return["RGBE","( value )"];case Pne:return["RGBM","( value, 7.0 )"];case Dne:return["RGBM","( value, 16.0 )"];case Ine:return["RGBD","( value, 256.0 )"];case $F:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+r)}}function sF(r,e){var t=Yne(e);return"vec4 "+r+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function FRe(r,e){var t=Yne(e);return"vec4 "+r+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function BRe(r,e){var t;switch(e){case YF:t="Linear";break;case cne:t="Reinhard";break;case fne:t="Uncharted2";break;case hne:t="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function kRe(r,e,t){r=r||{};var i=[r.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(r.fragDepth||e.logarithmicDepthBuffer)&&t.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",r.drawBuffers&&t.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(r.shaderTextureLOD||e.envMap)&&t.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return i.filter(bS).join(` +`)}function VRe(r){var e=[];for(var t in r){var i=r[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function GRe(r,e,t){for(var i={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES),a=0;a/g;function t(i,n){var a=Xr[n];if(a===void 0)throw new Error("Can not resolve #include <"+n+">");return xF(a)}return r.replace(e,t)}function zie(r){var e=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function t(i,n,a,o){for(var s="",l=parseInt(n);l0?r.gammaFactor:1,d=kRe(a,i,r.extensions),g=VRe(o),m=n.createProgram(),v,_;t.isRawShaderMaterial?(v=[g,` +`].filter(bS).join(` `),_=[d,g,` -`].filter(MS).join(` +`].filter(bS).join(` `)):(v=["precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+t.__webglShader.name,g,i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+i.maxBones,i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&r.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(MS).join(` -`),_=[d,"precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+t.__webglShader.name,g,i.alphaTest?"#define ALPHATEST "+i.alphaTest:"","#define GAMMA_FACTOR "+p,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+f:"",i.envMap?"#define "+h:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(i.numClippingPlanes-i.numClipIntersection),i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&r.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",i.envMap&&r.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",i.toneMapping!==kA?"#define TONE_MAPPING":"",i.toneMapping!==kA?Xr.tonemapping_pars_fragment:"",i.toneMapping!==kA?FRe("toneMapping",i.toneMapping):"",i.outputEncoding||i.mapEncoding||i.envMapEncoding||i.emissiveMapEncoding?Xr.encodings_pars_fragment:"",i.mapEncoding?oz("mapTexelToLinear",i.mapEncoding):"",i.envMapEncoding?oz("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMapEncoding?oz("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.outputEncoding?ORe("linearToOutputTexel",i.outputEncoding):"",i.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(MS).join(` -`)),s=_z(s,i),s=Nie(s,i),l=_z(l,i),l=Nie(l,i),t.isShaderMaterial||(s=Uie(s),l=Uie(l));var y=v+s,x=_+l,M=Iie(n,n.VERTEX_SHADER,y),S=Iie(n,n.FRAGMENT_SHADER,x);n.attachShader(m,M),n.attachShader(m,S),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):i.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);var w=n.getProgramInfoLog(m),T=n.getShaderInfoLog(M),C=n.getShaderInfoLog(S),b=!0,E=!0;n.getProgramParameter(m,n.LINK_STATUS)===!1?(b=!1,console.error("THREE.WebGLProgram: shader error: ",n.getError(),"gl.VALIDATE_STATUS",n.getProgramParameter(m,n.VALIDATE_STATUS),"gl.getProgramInfoLog",w,T,C)):w!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",w):(T===""||C==="")&&(E=!1),E&&(this.diagnostics={runnable:b,material:t,programLog:w,vertexShader:{log:T,prefix:v},fragmentShader:{log:C,prefix:_}}),n.deleteShader(M),n.deleteShader(S);var I;this.getUniforms=function(){return I===void 0&&(I=new xh(n,m,r)),I};var R;return this.getAttributes=function(){return R===void 0&&(R=kRe(n,m)),R},this.destroy=function(){n.deleteProgram(m),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=URe++,this.code=e,this.usedTimes=1,this.program=m,this.vertexShader=M,this.fragmentShader=S,this}function GRe(r,e){var t=[],i={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},n=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking"];function a(s){if(e.floatVertexTextures&&s&&s.skeleton&&s.skeleton.useVertexTexture)return 1024;var l=e.maxVertexUniforms,u=Math.floor((l-20)/4),c=u;return s!==void 0&&s&&s.isSkinnedMesh&&(c=Math.min(s.skeleton.bones.length,c),c0,shadowMapType:r.shadowMap.type,toneMapping:r.toneMapping,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,alphaTest:s.alphaTest,doubleSided:s.side===Ny,flipSided:s.side===yh,depthPacking:s.depthPacking!==void 0?s.depthPacking:!1};return v},this.getProgramCode=function(s,l){var u=[];if(l.shaderID?u.push(l.shaderID):(u.push(s.fragmentShader),u.push(s.vertexShader)),s.defines!==void 0)for(var c in s.defines)u.push(c),u.push(s.defines[c]);for(var f=0;f65535?Uint32Array:Uint16Array,C=new gt(new T(p),1);return a(C,r.ELEMENT_ARRAY_BUFFER),h.wireframe=C,C}return{getAttributeBuffer:l,getAttributeProperties:u,getWireframeAttribute:c,update:n}}function XRe(r,e,t,i,n,a,o){var s=o.memory,l=typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext;function u(R,A){if(R.width>A||R.height>A){var D=A/Math.max(R.width,R.height),U=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");U.width=Math.floor(R.width*D),U.height=Math.floor(R.height*D);var B=U.getContext("2d");return B.drawImage(R,0,0,R.width,R.height,0,0,U.width,U.height),console.warn("THREE.WebGLRenderer: image is too big ("+R.width+"x"+R.height+"). Resized to "+U.width+"x"+U.height,R),U}return R}function c(R){return cr.isPowerOfTwo(R.width)&&cr.isPowerOfTwo(R.height)}function f(R){if(R instanceof HTMLImageElement||R instanceof HTMLCanvasElement){var A=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");A.width=cr.nearestPowerOfTwo(R.width),A.height=cr.nearestPowerOfTwo(R.height);var D=A.getContext("2d");return D.drawImage(R,0,0,A.width,A.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+R.width+"x"+R.height+"). Resized to "+A.width+"x"+A.height,R),A}return R}function h(R){return R.wrapS!==Uo||R.wrapT!==Uo||R.minFilter!==Oo&&R.minFilter!==to}function p(R){return R===Oo||R===bC||R===wC?r.NEAREST:r.LINEAR}function d(R){var A=R.target;A.removeEventListener("dispose",d),m(A),s.textures--}function g(R){var A=R.target;A.removeEventListener("dispose",g),v(A),s.textures--}function m(R){var A=i.get(R);if(R.image&&A.__image__webglTextureCube)r.deleteTexture(A.__image__webglTextureCube);else{if(A.__webglInit===void 0)return;r.deleteTexture(A.__webglTexture)}i.delete(R)}function v(R){var A=i.get(R),D=i.get(R.texture);if(R){if(D.__webglTexture!==void 0&&r.deleteTexture(D.__webglTexture),R.depthTexture&&R.depthTexture.dispose(),R.isWebGLRenderTargetCube)for(var U=0;U<6;U++)r.deleteFramebuffer(A.__webglFramebuffer[U]),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[U]);else r.deleteFramebuffer(A.__webglFramebuffer),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer);i.delete(R.texture),i.delete(R)}}function _(R,A){var D=i.get(R);if(R.version>0&&D.__version!==R.version){var U=R.image;if(U===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",R);else if(U.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",R);else{S(D,R,A);return}}t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_2D,D.__webglTexture)}function y(R,A){var D=i.get(R);if(R.image.length===6)if(R.version>0&&D.__version!==R.version){D.__image__webglTextureCube||(R.addEventListener("dispose",d),D.__image__webglTextureCube=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,D.__image__webglTextureCube),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,R.flipY);for(var U=R&&R.isCompressedTexture,B=R.image[0]&&R.image[0].isDataTexture,F=[],k=0;k<6;k++)!U&&!B?F[k]=u(R.image[k],n.maxCubemapSize):F[k]=B?R.image[k].image:R.image[k];var G=F[0],Y=c(G),J=a(R.format),Q=a(R.type);M(r.TEXTURE_CUBE_MAP,R,Y);for(var k=0;k<6;k++)if(!U)B?t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,F[k].width,F[k].height,0,J,Q,F[k].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,J,Q,F[k]);else for(var V,K=F[k].mipmaps,ae=0,ve=K.length;ae-1?t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,V.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,J,Q,V.data);R.generateMipmaps&&Y&&r.generateMipmap(r.TEXTURE_CUBE_MAP),D.__version=R.version,R.onUpdate&&R.onUpdate(R)}else t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,D.__image__webglTextureCube)}function x(R,A){t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,i.get(R).__webglTexture)}function M(R,A,D){var U;if(D?(r.texParameteri(R,r.TEXTURE_WRAP_S,a(A.wrapS)),r.texParameteri(R,r.TEXTURE_WRAP_T,a(A.wrapT)),r.texParameteri(R,r.TEXTURE_MAG_FILTER,a(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,a(A.minFilter))):(r.texParameteri(R,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(R,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(A.wrapS!==Uo||A.wrapT!==Uo)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",A),r.texParameteri(R,r.TEXTURE_MAG_FILTER,p(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,p(A.minFilter)),A.minFilter!==Oo&&A.minFilter!==to&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",A)),U=e.get("EXT_texture_filter_anisotropic"),U){if(A.type===jg&&e.get("OES_texture_float_linear")===null||A.type===YA&&e.get("OES_texture_half_float_linear")===null)return;(A.anisotropy>1||i.get(A).__currentAnisotropy)&&(r.texParameterf(R,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,n.getMaxAnisotropy())),i.get(A).__currentAnisotropy=A.anisotropy)}}function S(R,A,D){R.__webglInit===void 0&&(R.__webglInit=!0,A.addEventListener("dispose",d),R.__webglTexture=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+D),t.bindTexture(r.TEXTURE_2D,R.__webglTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment);var U=u(A.image,n.maxTextureSize);h(A)&&c(U)===!1&&(U=f(U));var B=c(U),F=a(A.format),k=a(A.type);M(r.TEXTURE_2D,A,B);var G,Y=A.mipmaps;if(A.isDepthTexture){var J=r.DEPTH_COMPONENT;if(A.type===jg){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");J=r.DEPTH_COMPONENT32F}else l&&(J=r.DEPTH_COMPONENT16);A.format===Cd&&J===r.DEPTH_COMPONENT&&A.type!==ES&&A.type!==jz&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),A.type=ES,k=a(A.type)),A.format===Jg&&(J=r.DEPTH_STENCIL,A.type!==AS&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),A.type=AS,k=a(A.type))),t.texImage2D(r.TEXTURE_2D,0,J,U.width,U.height,0,F,k,null)}else if(A.isDataTexture)if(Y.length>0&&B){for(var Q=0,V=Y.length;Q-1?t.compressedTexImage2D(r.TEXTURE_2D,Q,F,G.width,G.height,0,G.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(r.TEXTURE_2D,Q,F,G.width,G.height,0,F,k,G.data);else if(Y.length>0&&B){for(var Q=0,V=Y.length;Q=1,U=null,B={},F=new Qr,k=new Qr;function G($,it,Xe){var ze=new Uint8Array(4),we=r.createTexture();r.bindTexture($,we),r.texParameteri($,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri($,r.TEXTURE_MAG_FILTER,r.NEAREST);for(var Ie=0;Ie0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=t.precision!==void 0?t.precision:"highp",s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=t.logarithmicDepthBuffer===!0&&!!e.get("EXT_frag_depth"),u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),c=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=r.getParameter(r.MAX_TEXTURE_SIZE),h=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),d=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),g=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),v=c>0,_=!!e.get("OES_texture_float"),y=v&&_;return{getMaxAnisotropy:n,getMaxPrecision:a,precision:o,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:f,maxCubemapSize:h,maxAttributes:p,maxVertexUniforms:d,maxVaryings:g,maxFragmentUniforms:m,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:y}}function jRe(r){var e={};return{get:function(t){if(e[t]!==void 0)return e[t];var i;switch(t){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=r.getExtension("WEBGL_compressed_texture_etc1");break;default:i=r.getExtension(t)}return i===null&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e[t]=i,i}}}function KRe(){var r=this,e=null,t=0,i=!1,n=!1,a=new Io,o=new bs,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(c,f,h){var p=c.length!==0||f||t!==0||i;return i=f,e=u(c,h,0),t=c.length,p},this.beginShadows=function(){n=!0,u(null)},this.endShadows=function(){n=!1,l()},this.setState=function(c,f,h,p,d,g){if(!i||c===null||c.length===0||n&&!h)n?u(null):l();else{var m=n?0:t,v=m*4,_=d.clippingState||null;s.value=_,_=u(c,p,v,g);for(var y=0;y!==v;++y)_[y]=e[y];d.clippingState=_,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=m}};function l(){s.value!==e&&(s.value=e,s.needsUpdate=t>0),r.numPlanes=t,r.numIntersection=0}function u(c,f,h,p){var d=c!==null?c.length:0,g=null;if(d!==0){if(g=s.value,p!==!0||g===null){var m=h+d*4,v=f.matrixWorldInverse;o.getNormalMatrix(v),(g===null||g.length8&&($e.length=8);for(var mi=ee.morphAttributes,at=0,wt=$e.length;at0&&Mi.renderInstances(ee,jh,WR):Mi.render(jh,WR)}};function st(P,W,ee,ge){var ce;if(ee&&ee.isInstancedBufferGeometry&&(ce=We.get("ANGLE_instanced_arrays"),ce===null)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}ge===void 0&&(ge=0),xe.initAttributes();var Oe=ee.attributes,Ge=W.getAttributes(),Re=P.defaultAttributeValues;for(var pt in Ge){var mt=Ge[pt];if(mt>=0){var $e=Oe[pt];if($e!==void 0){var at=$e.normalized,wt=$e.itemSize,je=Ne.getAttributeProperties($e),mi=je.__webglBuffer,Ut=je.type,Rr=je.bytesPerElement;if($e.isInterleavedBufferAttribute){var Wi=$e.data,Mt=Wi.stride,Mi=$e.offset;Wi&&Wi.isInstancedInterleavedBuffer?(xe.enableAttributeAndDivisor(mt,Wi.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=Wi.meshPerAttribute*Wi.count)):xe.enableAttribute(mt),q.bindBuffer(q.ARRAY_BUFFER,mi),q.vertexAttribPointer(mt,wt,Ut,at,Mt*Rr,(ge*Mt+Mi)*Rr)}else $e.isInstancedBufferAttribute?(xe.enableAttributeAndDivisor(mt,$e.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=$e.meshPerAttribute*$e.count)):xe.enableAttribute(mt),q.bindBuffer(q.ARRAY_BUFFER,mi),q.vertexAttribPointer(mt,wt,Ut,at,0,ge*wt*Rr)}else if(Re!==void 0){var sr=Re[pt];if(sr!==void 0)switch(sr.length){case 2:q.vertexAttrib2fv(mt,sr);break;case 3:q.vertexAttrib3fv(mt,sr);break;case 4:q.vertexAttrib4fv(mt,sr);break;default:q.vertexAttrib1fv(mt,sr)}}}}xe.disableUnusedAttributes()}function Je(P,W){return Math.abs(W[0])-Math.abs(P[0])}function kt(P,W){return P.object.renderOrder!==W.object.renderOrder?P.object.renderOrder-W.object.renderOrder:P.material.program&&W.material.program&&P.material.program!==W.material.program?P.material.program.id-W.material.program.id:P.material.id!==W.material.id?P.material.id-W.material.id:P.z!==W.z?P.z-W.z:P.id-W.id}function X(P,W){return P.object.renderOrder!==W.object.renderOrder?P.object.renderOrder-W.object.renderOrder:P.z!==W.z?W.z-P.z:P.id-W.id}this.render=function(P,W,ee,ge){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}S="",M=-1,w=null,P.autoUpdate===!0&&P.updateMatrixWorld(),W.parent===null&&W.updateMatrixWorld(),W.matrixWorldInverse.getInverse(W.matrixWorld),K.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),G.setFromMatrix(K),u.length=0,f=-1,p=-1,g.length=0,m.length=0,Q=this.localClippingEnabled,J=Y.init(this.clippingPlanes,Q,W),xt(P,W),c.length=f+1,h.length=p+1,v.sortObjects===!0&&(c.sort(kt),h.sort(X)),J&&Y.beginShadows(),O(u),nt.render(P,W),j(u,W),J&&Y.endShadows(),Ee.calls=0,Ee.vertices=0,Ee.faces=0,Ee.points=0,ee===void 0&&(ee=null),this.setRenderTarget(ee);var ce=P.background;if(ce===null?xe.buffers.color.setClear(I.r,I.g,I.b,R,s):ce&&ce.isColor&&(xe.buffers.color.setClear(ce.r,ce.g,ce.b,1,s),ge=!0),(this.autoClear||ge)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),ce&&ce.isCubeTexture?(le.projectionMatrix.copy(W.projectionMatrix),le.matrixWorld.extractRotation(W.matrixWorld),le.matrixWorldInverse.getInverse(le.matrixWorld),et.material.uniforms.tCube.value=ce,et.modelViewMatrix.multiplyMatrices(le.matrixWorldInverse,et.matrixWorld),Ne.update(et),v.renderBufferDirect(le,null,et.geometry,et.material,et,null)):ce&&ce.isTexture&&(me.material.map=ce,Ne.update(me),v.renderBufferDirect(ne,null,me.geometry,me.material,me,null)),P.overrideMaterial){var Oe=P.overrideMaterial;zt(c,P,W,Oe),zt(h,P,W,Oe)}else xe.setBlending(TS),zt(c,P,W),zt(h,P,W);$.render(P,W),it.render(P,W,b),ee&&Ue.updateRenderTargetMipmap(ee),xe.setDepthTest(!0),xe.setDepthWrite(!0),xe.setColorWrite(!0)};function Te(P,W,ee,ge,ce){var Oe,Ge;ee.transparent?(Oe=h,Ge=++p):(Oe=c,Ge=++f);var Re=Oe[Ge];Re!==void 0?(Re.id=P.id,Re.object=P,Re.geometry=W,Re.material=ee,Re.z=ae.z,Re.group=ce):(Re={id:P.id,object:P,geometry:W,material:ee,z:ae.z,group:ce},Oe.push(Re))}function te(P){var W=P.geometry;return W.boundingSphere===null&&W.computeBoundingSphere(),V.copy(W.boundingSphere).applyMatrix4(P.matrixWorld),Pe(V)}function Me(P){return V.center.set(0,0,0),V.radius=.7071067811865476,V.applyMatrix4(P.matrixWorld),Pe(V)}function Pe(P){if(!G.intersectsSphere(P))return!1;var W=Y.numPlanes;if(W===0)return!0;var ee=v.clippingPlanes,ge=P.center,ce=-P.radius,Oe=0;do if(ee[Oe].distanceToPoint(ge)=0&&P.numSupportedMorphTargets++}if(P.morphNormals){P.numSupportedMorphNormals=0;for(var $e=0;$e=0&&P.numSupportedMorphNormals++}var at=ge.__webglShader.uniforms;(!P.isShaderMaterial&&!P.isRawShaderMaterial||P.clipping===!0)&&(ge.numClippingPlanes=Y.numPlanes,ge.numIntersection=Y.numIntersection,at.clippingPlanes=Y.uniform),ge.fog=W,ge.lightsHash=se.hash,P.lights&&(at.ambientLightColor.value=se.ambient,at.directionalLights.value=se.directional,at.spotLights.value=se.spot,at.rectAreaLights.value=se.rectArea,at.pointLights.value=se.point,at.hemisphereLights.value=se.hemi,at.directionalShadowMap.value=se.directionalShadowMap,at.directionalShadowMatrix.value=se.directionalShadowMatrix,at.spotShadowMap.value=se.spotShadowMap,at.spotShadowMatrix.value=se.spotShadowMatrix,at.pointShadowMap.value=se.pointShadowMap,at.pointShadowMatrix.value=se.pointShadowMatrix);var wt=ge.program.getUniforms(),je=xh.seqWithValue(wt.seq,at);ge.uniformsList=je}function Zr(P){P.side===Ny?xe.disable(q.CULL_FACE):xe.enable(q.CULL_FACE),xe.setFlipSided(P.side===yh),P.transparent===!0?xe.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst,P.blendEquationAlpha,P.blendSrcAlpha,P.blendDstAlpha,P.premultipliedAlpha):xe.setBlending(TS),xe.setDepthFunc(P.depthFunc),xe.setDepthTest(P.depthTest),xe.setDepthWrite(P.depthWrite),xe.setColorWrite(P.colorWrite),xe.setPolygonOffset(P.polygonOffset,P.polygonOffsetFactor,P.polygonOffsetUnits)}function Vt(P,W,ee,ge){E=0;var ce=Le.get(ee);if(J&&(Q||P!==w)){var Oe=P===w&&ee.id===M;Y.setState(ee.clippingPlanes,ee.clipIntersection,ee.clipShadows,P,ce,Oe)}ee.needsUpdate===!1&&(ce.program===void 0||ee.fog&&ce.fog!==W||ee.lights&&ce.lightsHash!==se.hash||ce.numClippingPlanes!==void 0&&(ce.numClippingPlanes!==Y.numPlanes||ce.numIntersection!==Y.numIntersection))&&(ee.needsUpdate=!0),ee.needsUpdate&&(Mr(ee,W,ge),ee.needsUpdate=!1);var Ge=!1,Re=!1,pt=!1,mt=ce.program,$e=mt.getUniforms(),at=ce.__webglShader.uniforms;if(mt.id!==_&&(q.useProgram(mt.program),_=mt.id,Ge=!0,Re=!0,pt=!0),ee.id!==M&&(M=ee.id,Re=!0),Ge||P!==w){if($e.set(q,P,"projectionMatrix"),_e.logarithmicDepthBuffer&&$e.setValue(q,"logDepthBufFC",2/(Math.log(P.far+1)/Math.LN2)),P!==w&&(w=P,Re=!0,pt=!0),ee.isShaderMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.envMap){var wt=$e.map.cameraPosition;wt!==void 0&&wt.setValue(q,ae.setFromMatrixPosition(P.matrixWorld))}(ee.isMeshPhongMaterial||ee.isMeshLambertMaterial||ee.isMeshBasicMaterial||ee.isMeshStandardMaterial||ee.isShaderMaterial||ee.skinning)&&$e.setValue(q,"viewMatrix",P.matrixWorldInverse),$e.set(q,v,"toneMappingExposure"),$e.set(q,v,"toneMappingWhitePoint")}if(ee.skinning){$e.setOptional(q,ge,"bindMatrix"),$e.setOptional(q,ge,"bindMatrixInverse");var je=ge.skeleton;je&&(_e.floatVertexTextures&&je.useVertexTexture?($e.set(q,je,"boneTexture"),$e.set(q,je,"boneTextureWidth"),$e.set(q,je,"boneTextureHeight")):$e.setOptional(q,je,"boneMatrices"))}return Re&&(ee.lights&&T0(at,pt),W&&ee.fog&&Ds(at,W),(ee.isMeshBasicMaterial||ee.isMeshLambertMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.isMeshNormalMaterial||ee.isMeshDepthMaterial)&&Dr(at,ee),ee.isLineBasicMaterial?oi(at,ee):ee.isLineDashedMaterial?(oi(at,ee),Yh(at,ee)):ee.isPointsMaterial?M0(at,ee):ee.isMeshLambertMaterial?qh(at,ee):ee.isMeshToonMaterial?Zh(at,ee):ee.isMeshPhongMaterial?Go(at,ee):ee.isMeshPhysicalMaterial?b0(at,ee):ee.isMeshStandardMaterial?wc(at,ee):ee.isMeshDepthMaterial?ee.displacementMap&&(at.displacementMap.value=ee.displacementMap,at.displacementScale.value=ee.displacementScale,at.displacementBias.value=ee.displacementBias):ee.isMeshNormalMaterial&&w0(at,ee),at.ltcMat!==void 0&&(at.ltcMat.value=THREE.UniformsLib.LTC_MAT_TEXTURE),at.ltcMag!==void 0&&(at.ltcMag.value=THREE.UniformsLib.LTC_MAG_TEXTURE),xh.upload(q,ce.uniformsList,at,v)),$e.set(q,ge,"modelViewMatrix"),$e.set(q,ge,"normalMatrix"),$e.setValue(q,"modelMatrix",ge.matrixWorld),mt}function Dr(P,W){P.opacity.value=W.opacity,P.diffuse.value=W.color,W.emissive&&P.emissive.value.copy(W.emissive).multiplyScalar(W.emissiveIntensity),P.map.value=W.map,P.specularMap.value=W.specularMap,P.alphaMap.value=W.alphaMap,W.lightMap&&(P.lightMap.value=W.lightMap,P.lightMapIntensity.value=W.lightMapIntensity),W.aoMap&&(P.aoMap.value=W.aoMap,P.aoMapIntensity.value=W.aoMapIntensity);var ee;if(W.map?ee=W.map:W.specularMap?ee=W.specularMap:W.displacementMap?ee=W.displacementMap:W.normalMap?ee=W.normalMap:W.bumpMap?ee=W.bumpMap:W.roughnessMap?ee=W.roughnessMap:W.metalnessMap?ee=W.metalnessMap:W.alphaMap?ee=W.alphaMap:W.emissiveMap&&(ee=W.emissiveMap),ee!==void 0){ee.isWebGLRenderTarget&&(ee=ee.texture);var ge=ee.offset,ce=ee.repeat;P.offsetRepeat.value.set(ge.x,ge.y,ce.x,ce.y)}P.envMap.value=W.envMap,P.flipEnvMap.value=W.envMap&&W.envMap.isCubeTexture?-1:1,P.reflectivity.value=W.reflectivity,P.refractionRatio.value=W.refractionRatio}function oi(P,W){P.diffuse.value=W.color,P.opacity.value=W.opacity}function Yh(P,W){P.dashSize.value=W.dashSize,P.totalSize.value=W.dashSize+W.gapSize,P.scale.value=W.scale}function M0(P,W){if(P.diffuse.value=W.color,P.opacity.value=W.opacity,P.size.value=W.size*U,P.scale.value=D*.5,P.map.value=W.map,W.map!==null){var ee=W.map.offset,ge=W.map.repeat;P.offsetRepeat.value.set(ee.x,ee.y,ge.x,ge.y)}}function Ds(P,W){P.fogColor.value=W.color,W.isFog?(P.fogNear.value=W.near,P.fogFar.value=W.far):W.isFogExp2&&(P.fogDensity.value=W.density)}function qh(P,W){W.emissiveMap&&(P.emissiveMap.value=W.emissiveMap)}function Go(P,W){P.specular.value=W.specular,P.shininess.value=Math.max(W.shininess,1e-4),W.emissiveMap&&(P.emissiveMap.value=W.emissiveMap),W.bumpMap&&(P.bumpMap.value=W.bumpMap,P.bumpScale.value=W.bumpScale),W.normalMap&&(P.normalMap.value=W.normalMap,P.normalScale.value.copy(W.normalScale)),W.displacementMap&&(P.displacementMap.value=W.displacementMap,P.displacementScale.value=W.displacementScale,P.displacementBias.value=W.displacementBias)}function Zh(P,W){Go(P,W),W.gradientMap&&(P.gradientMap.value=W.gradientMap)}function wc(P,W){P.roughness.value=W.roughness,P.metalness.value=W.metalness,W.roughnessMap&&(P.roughnessMap.value=W.roughnessMap),W.metalnessMap&&(P.metalnessMap.value=W.metalnessMap),W.emissiveMap&&(P.emissiveMap.value=W.emissiveMap),W.bumpMap&&(P.bumpMap.value=W.bumpMap,P.bumpScale.value=W.bumpScale),W.normalMap&&(P.normalMap.value=W.normalMap,P.normalScale.value.copy(W.normalScale)),W.displacementMap&&(P.displacementMap.value=W.displacementMap,P.displacementScale.value=W.displacementScale,P.displacementBias.value=W.displacementBias),W.envMap&&(P.envMapIntensity.value=W.envMapIntensity)}function b0(P,W){P.clearCoat.value=W.clearCoat,P.clearCoatRoughness.value=W.clearCoatRoughness,wc(P,W)}function w0(P,W){W.bumpMap&&(P.bumpMap.value=W.bumpMap,P.bumpScale.value=W.bumpScale),W.normalMap&&(P.normalMap.value=W.normalMap,P.normalScale.value.copy(W.normalScale)),W.displacementMap&&(P.displacementMap.value=W.displacementMap,P.displacementScale.value=W.displacementScale,P.displacementBias.value=W.displacementBias)}function T0(P,W){P.ambientLightColor.needsUpdate=W,P.directionalLights.needsUpdate=W,P.pointLights.needsUpdate=W,P.spotLights.needsUpdate=W,P.rectAreaLights.needsUpdate=W,P.hemisphereLights.needsUpdate=W}function O(P){for(var W=0,ee=0,ge=P.length;ee=_e.maxTextures&&console.warn("WebGLRenderer: trying to use "+P+" texture units while this GPU supports only "+_e.maxTextures),E+=1,P}this.allocTextureUnit=re,this.setTexture2D=function(){var P=!1;return function(ee,ge){ee&&ee.isWebGLRenderTarget&&(P||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),P=!0),ee=ee.texture),Ue.setTexture2D(ee,ge)}}(),this.setTexture=function(){var P=!1;return function(ee,ge){P||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),P=!0),Ue.setTexture2D(ee,ge)}}(),this.setTextureCube=function(){var P=!1;return function(ee,ge){ee&&ee.isWebGLRenderTargetCube&&(P||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),P=!0),ee=ee.texture),ee&&ee.isCubeTexture||Array.isArray(ee.image)&&ee.image.length===6?Ue.setTextureCube(ee,ge):Ue.setTextureCubeDynamic(ee,ge)}}(),this.getCurrentRenderTarget=function(){return y},this.setRenderTarget=function(P){y=P,P&&Le.get(P).__webglFramebuffer===void 0&&Ue.setupRenderTarget(P);var W=P&&P.isWebGLRenderTargetCube,ee;if(P){var ge=Le.get(P);W?ee=ge.__webglFramebuffer[P.activeCubeFace]:ee=ge.__webglFramebuffer,T.copy(P.scissor),C=P.scissorTest,b.copy(P.viewport)}else ee=null,T.copy(B).multiplyScalar(U),C=F,b.copy(k).multiplyScalar(U);if(x!==ee&&(q.bindFramebuffer(q.FRAMEBUFFER,ee),x=ee),xe.scissor(T),xe.setScissorTest(C),xe.viewport(b),W){var ce=Le.get(P.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+P.activeCubeFace,ce.__webglTexture,P.activeMipMapLevel)}},this.readRenderTargetPixels=function(P,W,ee,ge,ce,Oe){if((P&&P.isWebGLRenderTarget)===!1){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}var Ge=Le.get(P).__webglFramebuffer;if(Ge){var Re=!1;Ge!==x&&(q.bindFramebuffer(q.FRAMEBUFFER,Ge),Re=!0);try{var pt=P.texture,mt=pt.format,$e=pt.type;if(mt!==su&&ie(mt)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if($e!==XA&&ie($e)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_TYPE)&&!($e===jg&&(We.get("OES_texture_float")||We.get("WEBGL_color_buffer_float")))&&!($e===YA&&We.get("EXT_color_buffer_half_float"))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?W>=0&&W<=P.width-ge&&ee>=0&&ee<=P.height-ce&&q.readPixels(W,ee,ge,ce,ie(mt),ie($e),Oe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{Re&&q.bindFramebuffer(q.FRAMEBUFFER,x)}}};function ie(P){var W;if(P===ic)return q.REPEAT;if(P===Uo)return q.CLAMP_TO_EDGE;if(P===Dd)return q.MIRRORED_REPEAT;if(P===Oo)return q.NEAREST;if(P===bC)return q.NEAREST_MIPMAP_NEAREST;if(P===wC)return q.NEAREST_MIPMAP_LINEAR;if(P===to)return q.LINEAR;if(P===Zz)return q.LINEAR_MIPMAP_NEAREST;if(P===gM)return q.LINEAR_MIPMAP_LINEAR;if(P===XA)return q.UNSIGNED_BYTE;if(P===mne)return q.UNSIGNED_SHORT_4_4_4_4;if(P===vne)return q.UNSIGNED_SHORT_5_5_5_1;if(P===gne)return q.UNSIGNED_SHORT_5_6_5;if(P===hne)return q.BYTE;if(P===pne)return q.SHORT;if(P===ES)return q.UNSIGNED_SHORT;if(P===dne)return q.INT;if(P===jz)return q.UNSIGNED_INT;if(P===jg)return q.FLOAT;if(P===YA&&(W=We.get("OES_texture_half_float"),W!==null))return W.HALF_FLOAT_OES;if(P===yne)return q.ALPHA;if(P===Kg)return q.RGB;if(P===su)return q.RGBA;if(P===_ne)return q.LUMINANCE;if(P===xne)return q.LUMINANCE_ALPHA;if(P===Cd)return q.DEPTH_COMPONENT;if(P===Jg)return q.DEPTH_STENCIL;if(P===Gz)return q.FUNC_ADD;if(P===Gie)return q.FUNC_SUBTRACT;if(P===Hie)return q.FUNC_REVERSE_SUBTRACT;if(P===Wie)return q.ZERO;if(P===Xie)return q.ONE;if(P===Yie)return q.SRC_COLOR;if(P===qie)return q.ONE_MINUS_SRC_COLOR;if(P===Hz)return q.SRC_ALPHA;if(P===Wz)return q.ONE_MINUS_SRC_ALPHA;if(P===Zie)return q.DST_ALPHA;if(P===jie)return q.ONE_MINUS_DST_ALPHA;if(P===Kie)return q.DST_COLOR;if(P===Jie)return q.ONE_MINUS_DST_COLOR;if(P===$ie)return q.SRC_ALPHA_SATURATE;if((P===fz||P===hz||P===pz||P===dz)&&(W=We.get("WEBGL_compressed_texture_s3tc"),W!==null)){if(P===fz)return W.COMPRESSED_RGB_S3TC_DXT1_EXT;if(P===hz)return W.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(P===pz)return W.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(P===dz)return W.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((P===mz||P===vz||P===gz||P===yz)&&(W=We.get("WEBGL_compressed_texture_pvrtc"),W!==null)){if(P===mz)return W.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(P===vz)return W.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(P===gz)return W.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(P===yz)return W.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(P===Sne&&(W=We.get("WEBGL_compressed_texture_etc1"),W!==null))return W.COMPRESSED_RGB_ETC1_WEBGL;if((P===sz||P===lz)&&(W=We.get("EXT_blend_minmax"),W!==null)){if(P===sz)return W.MIN_EXT;if(P===lz)return W.MAX_EXT}return P===AS&&(W=We.get("WEBGL_depth_texture"),W!==null)?W.UNSIGNED_INT_24_8_WEBGL:0}}function ty(r,e){this.name="",this.color=new Gt(r),this.density=e!==void 0?e:25e-5}function ry(r,e,t){this.name="",this.color=new Gt(r),this.near=e!==void 0?e:1,this.far=t!==void 0?t:1e3}function Fd(){Et.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function xz(r,e,t,i,n){Et.call(this),this.lensFlares=[],this.positionScreen=new oe,this.customUpdateCallback=void 0,r!==void 0&&this.add(r,e,t,i,n)}function zd(r){mr.call(this),this.type="SpriteMaterial",this.color=new Gt(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(r)}function BS(r){Et.call(this),this.type="Sprite",this.material=r!==void 0?r:new zd}function kS(){Et.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function ZA(r,e,t){if(this.useVertexTexture=t!==void 0?t:!0,this.identityMatrix=new qt,r=r||[],this.bones=r.slice(0),this.useVertexTexture){var i=Math.sqrt(this.bones.length*4);i=cr.nextPowerOfTwo(Math.ceil(i)),i=Math.max(i,4),this.boneTextureWidth=i,this.boneTextureHeight=i,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new Nd(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,su,jg)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(e===void 0)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var n=0,a=this.bones.length;n=r.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}c()}function ny(r,e,t,i,n,a,o,s,l,u,c,f){ni.call(this,null,a,o,s,l,u,i,n,c,f),this.image={width:e,height:t},this.mipmaps=r,this.flipY=!1,this.generateMipmaps=!1}function $A(r,e,t,i,n,a,o,s,l){ni.call(this,r,e,t,i,n,a,o,s,l),this.needsUpdate=!0}function GS(r,e,t,i,n,a,o,s,l,u){if(u=u!==void 0?u:Cd,u!==Cd&&u!==Jg)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");t===void 0&&u===Cd&&(t=ES),t===void 0&&u===Jg&&(t=AS),ni.call(this,null,i,n,a,o,s,u,t,l),this.image={width:r,height:e},this.magFilter=o!==void 0?o:Oo,this.minFilter=s!==void 0?s:Oo,this.flipY=!1,this.generateMipmaps=!1}function ay(r){Bt.call(this);var e=[0,0],t={};function i(I,R){return I-R}var n=["a","b","c"];if(r&&r.isGeometry){for(var a=r.vertices,o=r.faces,s=0,l=new Uint32Array(6*o.length),u=0,c=o.length;u65535?ac:nc)(f,1)),this.addAttribute("position",new gr(i,3)),this.addAttribute("uv",new gr(n,2)),this.computeVertexNormals()}function HS(r,e,t){or.call(this),this.type="ParametricGeometry",this.parameters={func:r,slices:e,stacks:t},this.fromBufferGeometry(new oy(r,e,t)),this.mergeVertices()}function no(r,e,t,i){Bt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:e,radius:t,detail:i},t=t||1,i=i||0;var n=[],a=[];o(i),l(t),u(),this.addAttribute("position",new gr(n,3)),this.addAttribute("normal",new gr(n.slice(),3)),this.addAttribute("uv",new gr(a,2)),this.normalizeNormals(),this.boundingSphere=new $n(new oe,t);function o(v){for(var _=new oe,y=new oe,x=new oe,M=0;M.9&&S<.1&&(_<.2&&(a[v+0]+=1),y<.2&&(a[v+2]+=1),x<.2&&(a[v+4]+=1))}}function f(v){n.push(v.x,v.y,v.z)}function h(v,_){var y=v*3;_.x=r[y+0],_.y=r[y+1],_.z=r[y+2]}function p(){for(var v=new oe,_=new oe,y=new oe,x=new oe,M=new St,S=new St,w=new St,T=0,C=0;T65535?ac:nc)(d,1)),this.addAttribute("position",new gr(f,3)),this.addAttribute("normal",new gr(h,3)),this.addAttribute("uv",new gr(p,2));function g(){for(u=0;u65535?Uint32Array:Uint16Array)(s),1),u=new gt(new Float32Array(o*3),3),c=new gt(new Float32Array(o*3),3),f=new gt(new Float32Array(o*2),2),h,p,d=0,g=0,m=new oe,v=new oe,_=new St,y=new oe,x=new oe,M=new oe,S=new oe,w=new oe;for(h=0;h<=t;++h){var T=h/t*n*Math.PI*2;for(U(T,n,a,r,y),U(T+.01,n,a,r,x),S.subVectors(x,y),w.addVectors(x,y),M.crossVectors(S,w),w.crossVectors(M,S),M.normalize(),w.normalize(),p=0;p<=i;++p){var C=p/i*Math.PI*2,b=-e*Math.cos(C),E=e*Math.sin(C);m.x=y.x+(b*w.x+E*M.x),m.y=y.y+(b*w.y+E*M.y),m.z=y.z+(b*w.z+E*M.z),u.setXYZ(d,m.x,m.y,m.z),v.subVectors(m,y).normalize(),c.setXYZ(d,v.x,v.y,v.z),_.x=h/t,_.y=p/i,f.setXY(d,_.x,_.y),d++}}for(p=1;p<=t;p++)for(h=1;h<=i;h++){var I=(i+1)*(p-1)+(h-1),R=(i+1)*p+(h-1),A=(i+1)*p+h,D=(i+1)*(p-1)+h;l.setX(g,I),g++,l.setX(g,R),g++,l.setX(g,D),g++,l.setX(g,R),g++,l.setX(g,A),g++,l.setX(g,D),g++}this.setIndex(l),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",f);function U(B,F,k,G,Y){var J=Math.cos(B),Q=Math.sin(B),V=k/F*B,K=Math.cos(V);Y.x=G*(2+K)*.5*J,Y.y=G*(2+K)*Q*.5,Y.z=G*Math.sin(V)*.5}}function KS(r,e,t,i,n,a,o){or.call(this),this.type="TorusKnotGeometry",this.parameters={radius:r,tube:e,tubularSegments:t,radialSegments:i,p:n,q:a},o!==void 0&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new fy(r,e,t,i,n,a)),this.mergeVertices()}function hy(r,e,t,i,n){Bt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},r=r||100,e=e||40,t=Math.floor(t)||8,i=Math.floor(i)||6,n=n||Math.PI*2;var a=(t+1)*(i+1),o=t*i*2*3,s=new(o>65535?Uint32Array:Uint16Array)(o),l=new Float32Array(a*3),u=new Float32Array(a*3),c=new Float32Array(a*2),f=0,h=0,p=0,d=new oe,g=new oe,m=new oe,v,_;for(v=0;v<=t;v++)for(_=0;_<=i;_++){var y=_/i*n,x=v/t*Math.PI*2;g.x=(r+e*Math.cos(x))*Math.cos(y),g.y=(r+e*Math.cos(x))*Math.sin(y),g.z=e*Math.sin(x),l[f]=g.x,l[f+1]=g.y,l[f+2]=g.z,d.x=r*Math.cos(y),d.y=r*Math.sin(y),m.subVectors(g,d).normalize(),u[f]=m.x,u[f+1]=m.y,u[f+2]=m.z,c[h]=_/i,c[h+1]=v/t,f+=3,h+=2}for(v=1;v<=t;v++)for(_=1;_<=i;_++){var M=(i+1)*v+_-1,S=(i+1)*(v-1)+_-1,w=(i+1)*(v-1)+_,T=(i+1)*v+_;s[p]=M,s[p+1]=S,s[p+2]=T,s[p+3]=S,s[p+4]=w,s[p+5]=T,p+=6}this.setIndex(new gt(s,1)),this.addAttribute("position",new gt(l,3)),this.addAttribute("normal",new gt(u,3)),this.addAttribute("uv",new gt(c,2))}function JS(r,e,t,i,n){or.call(this),this.type="TorusGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},this.fromBufferGeometry(new hy(r,e,t,i,n))}function ws(r,e){if(typeof r>"u"){r=[];return}or.call(this),this.type="ExtrudeGeometry",r=Array.isArray(r)?r:[r],this.addShapeList(r,e),this.computeFaceNormals()}function $S(r,e){e=e||{};var t=e.font;if((t&&t.isFont)===!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new or;var i=t.generateShapes(r,e.size,e.curveSegments);e.amount=e.height!==void 0?e.height:50,e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),ws.call(this,i,e),this.type="TextGeometry"}function kd(r,e,t,i,n,a,o){Bt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},r=r||50,e=Math.max(3,Math.floor(e)||8),t=Math.max(2,Math.floor(t)||6),i=i!==void 0?i:0,n=n!==void 0?n:Math.PI*2,a=a!==void 0?a:0,o=o!==void 0?o:Math.PI;for(var s=a+o,l=(e+1)*(t+1),u=new gt(new Float32Array(l*3),3),c=new gt(new Float32Array(l*3),3),f=new gt(new Float32Array(l*2),2),h=0,p=[],d=new oe,g=0;g<=t;g++){for(var m=[],v=g/t,_=0;_<=e;_++){var y=_/e,x=-r*Math.cos(i+y*n)*Math.sin(a+v*o),M=r*Math.cos(a+v*o),S=r*Math.sin(i+y*n)*Math.sin(a+v*o);d.set(x,M,S).normalize(),u.setXYZ(h,x,M,S),c.setXYZ(h,d.x,d.y,d.z),f.setXY(h,y,1-v),m.push(h),h++}p.push(m)}for(var w=[],g=0;g0)&&w.push(T,C,E),(g!==t-1||s65535?ac:nc)(w,1)),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",f),this.boundingSphere=new $n(new oe,r)}function QS(r,e,t,i,n,a,o){or.call(this),this.type="SphereGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new kd(r,e,t,i,n,a,o))}function py(r,e,t,i,n,a){Bt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:r,outerRadius:e,thetaSegments:t,phiSegments:i,thetaStart:n,thetaLength:a},r=r||20,e=e||50,n=n!==void 0?n:0,a=a!==void 0?a:Math.PI*2,t=t!==void 0?Math.max(3,t):8,i=i!==void 0?Math.max(1,i):1;var o=(t+1)*(i+1),s=t*i*2*3,l=new gt(new(s>65535?Uint32Array:Uint16Array)(s),1),u=new gt(new Float32Array(o*3),3),c=new gt(new Float32Array(o*3),3),f=new gt(new Float32Array(o*2),2),h=0,p=0,d,g=r,m=(e-r)/i,v=new oe,_=new St,y,x;for(y=0;y<=i;y++){for(x=0;x<=t;x++)d=n+x/t*a,v.x=g*Math.cos(d),v.y=g*Math.sin(d),u.setXYZ(h,v.x,v.y,v.z),c.setXYZ(h,0,0,1),_.x=(v.x/e+1)/2,_.y=(v.y/e+1)/2,f.setXY(h,_.x,_.y),h++;g+=m}for(y=0;y65535?Uint32Array:Uint16Array)(a),1),s=new gt(new Float32Array(n*3),3),l=new gt(new Float32Array(n*2),2),u=0,c=0,f,h=1/e,p=new oe,d=new St,g,m;for(g=0;g<=e;g++){var v=t+g*h*i,_=Math.sin(v),y=Math.cos(v);for(m=0;m<=r.length-1;m++)p.x=r[m].x*_,p.y=r[m].y,p.z=r[m].x*y,s.setXYZ(u,p.x,p.y,p.z),d.x=g/e,d.y=m/(r.length-1),l.setXY(u,d.x,d.y),u++}for(g=0;g65535?ac:nc)(a,1)),this.addAttribute("position",new gr(t,3)),this.addAttribute("normal",new gr(i,3)),this.addAttribute("uv",new gr(n,2));function u(c){var f,h,p,d=t.length/3,g=c.extractPoints(e),m=g.shape,v=g.holes;if(Ln.isClockWise(m)===!1)for(m=m.reverse(),f=0,h=v.length;f0&&u++,e>0&&u++);var c=M(),f=S(),h=new gt(new(f>65535?Uint32Array:Uint16Array)(f),1),p=new gt(new Float32Array(c*3),3),d=new gt(new Float32Array(c*3),3),g=new gt(new Float32Array(c*2),2),m=0,v=0,_=[],y=t/2,x=0;w(),a===!1&&(r>0&&T(!0),e>0&&T(!1)),this.setIndex(h),this.addAttribute("position",p),this.addAttribute("normal",d),this.addAttribute("uv",g);function M(){var C=(i+1)*(n+1);return a===!1&&(C+=(i+1)*u+i*u),C}function S(){var C=i*n*2*3;return a===!1&&(C+=i*u*3),C}function w(){var C,b,E=new oe,I=new oe,R=0,A=(e-r)/t;for(b=0;b<=n;b++){var D=[],U=b/n,B=U*(e-r)+r;for(C=0;C<=i;C++){var F=C/i,k=F*s+o,G=Math.sin(k),Y=Math.cos(k);I.x=B*G,I.y=-U*t+y,I.z=B*Y,p.setXYZ(m,I.x,I.y,I.z),E.set(G,A,Y).normalize(),d.setXYZ(m,E.x,E.y,E.z),g.setXY(m,F,1-U),D.push(m),m++}_.push(D)}for(C=0;Cthis.points.length-2?this.points.length-1:n+1,e[3]=n>this.points.length-3?this.points.length-1:n+2,l=this.points[e[0]],u=this.points[e[1]],c=this.points[e[2]],f=this.points[e[3]],o=a*a,s=a*o,t.x=h(l.x,u.x,c.x,f.x,a,o,s),t.y=h(l.y,u.y,c.y,f.y,a,o,s),t.z=h(l.z,u.z,c.z,f.z,a,o,s),t},this.getControlPointsArray=function(){var p,d,g=this.points.length,m=[];for(p=0;p{"use strict";Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52));Math.sign===void 0&&(Math.sign=function(r){return r<0?-1:r>0?1:+r});Function.prototype.name===void 0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});Object.assign===void 0&&function(){Object.assign=function(r){"use strict";if(r==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(r),t=1;t>4,e[a]=r[a===19?i&3|8:i]);return e.join("")}}(),clamp:function(r,e,t){return Math.max(e,Math.min(t,r))},euclideanModulo:function(r,e){return(r%e+e)%e},mapLinear:function(r,e,t,i,n){return i+(r-e)*(n-i)/(t-e)},lerp:function(r,e,t){return(1-t)*r+t*e},smoothstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))},smootherstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))},randInt:function(r,e){return r+Math.floor(Math.random()*(e-r+1))},randFloat:function(r,e){return r+Math.random()*(e-r)},randFloatSpread:function(r){return r*(.5-Math.random())},degToRad:function(r){return r*cr.DEG2RAD},radToDeg:function(r){return r*cr.RAD2DEG},isPowerOfTwo:function(r){return(r&r-1)===0&&r!==0},nearestPowerOfTwo:function(r){return Math.pow(2,Math.round(Math.log(r)/Math.LN2))},nextPowerOfTwo:function(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}};St.prototype={constructor:St,isVector2:!0,get width(){return this.x},set width(r){this.x=r},get height(){return this.y},set height(r){this.y=r},set:function(r,e){return this.x=r,this.y=e,this},setScalar:function(r){return this.x=r,this.y=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(r){return this.x=r.x,this.y=r.y,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this)},addScalar:function(r){return this.x+=r,this.y+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this)},subScalar:function(r){return this.x-=r,this.y-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this},multiply:function(r){return this.x*=r.x,this.y*=r.y,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r):(this.x=0,this.y=0),this},divide:function(r){return this.x/=r.x,this.y/=r.y,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new St,e=new St),r.set(i,i),e.set(n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(r){return this.x*r.x+this.y*r.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var r=Math.atan2(this.y,this.x);return r<0&&(r+=2*Math.PI),r},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y;return e*e+t*t},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},equals:function(r){return r.x===this.x&&r.y===this.y},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this},rotateAround:function(r,e){var t=Math.cos(e),i=Math.sin(e),n=this.x-r.x,a=this.y-r.y;return this.x=n*t-a*i+r.x,this.y=n*i+a*t+r.y,this}};tAe=0;ni.DEFAULT_IMAGE=void 0;ni.DEFAULT_MAPPING=_C;ni.prototype={constructor:ni,isTexture:!0,set needsUpdate(r){r===!0&&this.version++},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.image=r.image,this.mipmaps=r.mipmaps.slice(0),this.mapping=r.mapping,this.wrapS=r.wrapS,this.wrapT=r.wrapT,this.magFilter=r.magFilter,this.minFilter=r.minFilter,this.anisotropy=r.anisotropy,this.format=r.format,this.type=r.type,this.offset.copy(r.offset),this.repeat.copy(r.repeat),this.generateMipmaps=r.generateMipmaps,this.premultiplyAlpha=r.premultiplyAlpha,this.flipY=r.flipY,this.unpackAlignment=r.unpackAlignment,this.encoding=r.encoding,this},toJSON:function(r){if(r.textures[this.uuid]!==void 0)return r.textures[this.uuid];function e(n){var a;return n.toDataURL!==void 0?a=n:(a=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),a.width=n.width,a.height=n.height,a.getContext("2d").drawImage(n,0,0,n.width,n.height)),a.width>2048||a.height>2048?a.toDataURL("image/jpeg",.6):a.toDataURL("image/png")}var t={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(this.image!==void 0){var i=this.image;i.uuid===void 0&&(i.uuid=cr.generateUUID()),r.images[i.uuid]===void 0&&(r.images[i.uuid]={uuid:i.uuid,url:e(i)}),t.image=i.uuid}return r.textures[this.uuid]=t,t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(r){if(this.mapping===_C){if(r.multiply(this.repeat),r.add(this.offset),r.x<0||r.x>1)switch(this.wrapS){case ic:r.x=r.x-Math.floor(r.x);break;case Uo:r.x=r.x<0?0:1;break;case Dd:Math.abs(Math.floor(r.x)%2)===1?r.x=Math.ceil(r.x)-r.x:r.x=r.x-Math.floor(r.x);break}if(r.y<0||r.y>1)switch(this.wrapT){case ic:r.y=r.y-Math.floor(r.y);break;case Uo:r.y=r.y<0?0:1;break;case Dd:Math.abs(Math.floor(r.y)%2)===1?r.y=Math.ceil(r.y)-r.y:r.y=r.y-Math.floor(r.y);break}this.flipY&&(r.y=1-r.y)}}};Object.assign(ni.prototype,Ms.prototype);Qr.prototype={constructor:Qr,isVector4:!0,set:function(r,e,t,i){return this.x=r,this.y=e,this.z=t,this.w=i,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this.w=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setW:function(r){return this.w=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this.w=r.w!==void 0?r.w:1,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this.w+=r.w,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this.w+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this.w=r.w+e.w,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this.w+=r.w*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this.w-=r.w,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this.w-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this.w=r.w-e.w,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r,this.w*=r):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=this.w,a=r.elements;return this.x=a[0]*e+a[4]*t+a[8]*i+a[12]*n,this.y=a[1]*e+a[5]*t+a[9]*i+a[13]*n,this.z=a[2]*e+a[6]*t+a[10]*i+a[14]*n,this.w=a[3]*e+a[7]*t+a[11]*i+a[15]*n,this},divideScalar:function(r){return this.multiplyScalar(1/r)},setAxisAngleFromQuaternion:function(r){this.w=2*Math.acos(r.w);var e=Math.sqrt(1-r.w*r.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=r.x/e,this.y=r.y/e,this.z=r.z/e),this},setAxisAngleFromRotationMatrix:function(r){var e,t,i,n,a=.01,o=.1,s=r.elements,l=s[0],u=s[4],c=s[8],f=s[1],h=s[5],p=s[9],d=s[2],g=s[6],m=s[10];if(Math.abs(u-f)_&&v>y?vy?_0?(h=.5/Math.sqrt(f+1),this._w=.25/h,this._x=(u-s)*h,this._y=(n-l)*h,this._z=(a-i)*h):t>o&&t>c?(h=2*Math.sqrt(1+t-o-c),this._w=(u-s)/h,this._x=.25*h,this._y=(i+a)/h,this._z=(n+l)/h):o>c?(h=2*Math.sqrt(1+o-t-c),this._w=(n-l)/h,this._x=(i+a)/h,this._y=.25*h,this._z=(s+u)/h):(h=2*Math.sqrt(1+c-t-o),this._w=(a-i)/h,this._x=(n+l)/h,this._y=(s+u)/h,this._z=.25*h),this.onChangeCallback(),this},setFromUnitVectors:function(){var r,e,t=1e-6;return function(n,a){return r===void 0&&(r=new oe),e=n.dot(a)+1,eMath.abs(n.z)?r.set(-n.y,n.x,0):r.set(0,-n.z,n.y)):r.crossVectors(n,a),this._x=r.x,this._y=r.y,this._z=r.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(r){return this._x*r._x+this._y*r._y+this._z*r._z+this._w*r._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var r=this.length();return r===0?(this._x=0,this._y=0,this._z=0,this._w=1):(r=1/r,this._x=this._x*r,this._y=this._y*r,this._z=this._z*r,this._w=this._w*r),this.onChangeCallback(),this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(r,e)):this.multiplyQuaternions(this,r)},premultiply:function(r){return this.multiplyQuaternions(r,this)},multiplyQuaternions:function(r,e){var t=r._x,i=r._y,n=r._z,a=r._w,o=e._x,s=e._y,l=e._z,u=e._w;return this._x=t*u+a*o+i*l-n*s,this._y=i*u+a*s+n*o-t*l,this._z=n*u+a*l+t*s-i*o,this._w=a*u-t*o-i*s-n*l,this.onChangeCallback(),this},slerp:function(r,e){if(e===0)return this;if(e===1)return this.copy(r);var t=this._x,i=this._y,n=this._z,a=this._w,o=a*r._w+t*r._x+i*r._y+n*r._z;if(o<0?(this._w=-r._w,this._x=-r._x,this._y=-r._y,this._z=-r._z,o=-o):this.copy(r),o>=1)return this._w=a,this._x=t,this._y=i,this._z=n,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(t+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z),this;var l=Math.atan2(s,o),u=Math.sin((1-e)*l)/s,c=Math.sin(e*l)/s;return this._w=a*u+this._w*c,this._x=t*u+this._x*c,this._y=i*u+this._y*c,this._z=n*u+this._z*c,this.onChangeCallback(),this},equals:function(r){return r._x===this._x&&r._y===this._y&&r._z===this._z&&r._w===this._w},fromArray:function(r,e){return e===void 0&&(e=0),this._x=r[e],this._y=r[e+1],this._z=r[e+2],this._w=r[e+3],this.onChangeCallback(),this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this._x,r[e+1]=this._y,r[e+2]=this._z,r[e+3]=this._w,r},onChange:function(r){return this.onChangeCallback=r,this},onChangeCallback:function(){}};Object.assign(on,{slerp:function(r,e,t,i){return t.copy(r).slerp(e,i)},slerpFlat:function(r,e,t,i,n,a,o){var s=t[i+0],l=t[i+1],u=t[i+2],c=t[i+3],f=n[a+0],h=n[a+1],p=n[a+2],d=n[a+3];if(c!==d||s!==f||l!==h||u!==p){var g=1-o,m=s*f+l*h+u*p+c*d,v=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){var y=Math.sqrt(_),x=Math.atan2(y,m*v);g=Math.sin(g*x)/y,o=Math.sin(o*x)/y}var M=o*v;if(s=s*g+f*M,l=l*g+h*M,u=u*g+p*M,c=c*g+d*M,g===1-o){var S=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=S,l*=S,u*=S,c*=S}}r[e]=s,r[e+1]=l,r[e+2]=u,r[e+3]=c}});oe.prototype={constructor:oe,isVector3:!0,set:function(r,e,t){return this.x=r,this.y=e,this.z=t,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(r,e)):(this.x*=r.x,this.y*=r.y,this.z*=r.z,this)},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(r,e){return this.x=r.x*e.x,this.y=r.y*e.y,this.z=r.z*e.z,this},applyEuler:function(){var r;return function(t){return(t&&t.isEuler)===!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),r===void 0&&(r=new on),this.applyQuaternion(r.setFromEuler(t))}}(),applyAxisAngle:function(){var r;return function(t,i){return r===void 0&&(r=new on),this.applyQuaternion(r.setFromAxisAngle(t,i))}}(),applyMatrix3:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[3]*t+n[6]*i,this.y=n[1]*e+n[4]*t+n[7]*i,this.z=n[2]*e+n[5]*t+n[8]*i,this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i+n[12],this.y=n[1]*e+n[5]*t+n[9]*i+n[13],this.z=n[2]*e+n[6]*t+n[10]*i+n[14],this},applyProjection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements,a=1/(n[3]*e+n[7]*t+n[11]*i+n[15]);return this.x=(n[0]*e+n[4]*t+n[8]*i+n[12])*a,this.y=(n[1]*e+n[5]*t+n[9]*i+n[13])*a,this.z=(n[2]*e+n[6]*t+n[10]*i+n[14])*a,this},applyQuaternion:function(r){var e=this.x,t=this.y,i=this.z,n=r.x,a=r.y,o=r.z,s=r.w,l=s*e+a*i-o*t,u=s*t+o*e-n*i,c=s*i+n*t-a*e,f=-n*e-a*t-o*i;return this.x=l*s+f*-n+u*-o-c*-a,this.y=u*s+f*-a+c*-n-l*-o,this.z=c*s+f*-o+l*-a-u*-n,this},project:function(){var r;return function(t){return r===void 0&&(r=new qt),r.multiplyMatrices(t.projectionMatrix,r.getInverse(t.matrixWorld)),this.applyProjection(r)}}(),unproject:function(){var r;return function(t){return r===void 0&&(r=new qt),r.multiplyMatrices(t.matrixWorld,r.getInverse(t.projectionMatrix)),this.applyProjection(r)}}(),transformDirection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i,this.y=n[1]*e+n[5]*t+n[9]*i,this.z=n[2]*e+n[6]*t+n[10]*i,this.normalize()},divide:function(r){return this.x/=r.x,this.y/=r.y,this.z/=r.z,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this.z=Math.min(this.z,r.z),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this.z=Math.max(this.z,r.z),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this.z=Math.max(r.z,Math.min(e.z,this.z)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new oe,e=new oe),r.set(i,i,i),e.set(n,n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(r){return this.x*r.x+this.y*r.y+this.z*r.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this.z+=(r.z-this.z)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},cross:function(r,e){if(e!==void 0)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(r,e);var t=this.x,i=this.y,n=this.z;return this.x=i*r.z-n*r.y,this.y=n*r.x-t*r.z,this.z=t*r.y-i*r.x,this},crossVectors:function(r,e){var t=r.x,i=r.y,n=r.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-n*o,this.y=n*a-t*s,this.z=t*o-i*a,this},projectOnVector:function(r){var e=r.dot(this)/r.lengthSq();return this.copy(r).multiplyScalar(e)},projectOnPlane:function(){var r;return function(t){return r===void 0&&(r=new oe),r.copy(this).projectOnVector(t),this.sub(r)}}(),reflect:function(){var r;return function(t){return r===void 0&&(r=new oe),this.sub(r.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(r){var e=this.dot(r)/Math.sqrt(this.lengthSq()*r.lengthSq());return Math.acos(cr.clamp(e,-1,1))},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y,i=this.z-r.z;return e*e+t*t+i*i},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)+Math.abs(this.z-r.z)},setFromSpherical:function(r){var e=Math.sin(r.phi)*r.radius;return this.x=e*Math.sin(r.theta),this.y=Math.cos(r.phi)*r.radius,this.z=e*Math.cos(r.theta),this},setFromCylindrical:function(r){return this.x=r.radius*Math.sin(r.theta),this.y=r.y,this.z=r.radius*Math.cos(r.theta),this},setFromMatrixPosition:function(r){return this.setFromMatrixColumn(r,3)},setFromMatrixScale:function(r){var e=this.setFromMatrixColumn(r,0).length(),t=this.setFromMatrixColumn(r,1).length(),i=this.setFromMatrixColumn(r,2).length();return this.x=e,this.y=t,this.z=i,this},setFromMatrixColumn:function(r,e){if(typeof r=="number"){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var t=r;r=e,e=t}return this.fromArray(r.elements,e*4)},equals:function(r){return r.x===this.x&&r.y===this.y&&r.z===this.z},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this.z=r[e+2],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r[e+2]=this.z,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this.z=r.getZ(e),this}};qt.prototype={constructor:qt,isMatrix4:!0,set:function(r,e,t,i,n,a,o,s,l,u,c,f,h,p,d,g){var m=this.elements;return m[0]=r,m[4]=e,m[8]=t,m[12]=i,m[1]=n,m[5]=a,m[9]=o,m[13]=s,m[2]=l,m[6]=u,m[10]=c,m[14]=f,m[3]=h,m[7]=p,m[11]=d,m[15]=g,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return new qt().fromArray(this.elements)},copy:function(r){return this.elements.set(r.elements),this},copyPosition:function(r){var e=this.elements,t=r.elements;return e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(r,e,t){return r.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),t.setFromMatrixColumn(this,2),this},makeBasis:function(r,e,t){return this.set(r.x,e.x,t.x,0,r.y,e.y,t.y,0,r.z,e.z,t.z,0,0,0,0,1),this},extractRotation:function(){var r;return function(t){r===void 0&&(r=new oe);var i=this.elements,n=t.elements,a=1/r.setFromMatrixColumn(t,0).length(),o=1/r.setFromMatrixColumn(t,1).length(),s=1/r.setFromMatrixColumn(t,2).length();return i[0]=n[0]*a,i[1]=n[1]*a,i[2]=n[2]*a,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[8]=n[8]*s,i[9]=n[9]*s,i[10]=n[10]*s,this}}(),makeRotationFromEuler:function(r){(r&&r.isEuler)===!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,t=r.x,i=r.y,n=r.z,a=Math.cos(t),o=Math.sin(t),s=Math.cos(i),l=Math.sin(i),u=Math.cos(n),c=Math.sin(n);if(r.order==="XYZ"){var f=a*u,h=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=-s*c,e[8]=l,e[1]=h+p*l,e[5]=f-d*l,e[9]=-o*s,e[2]=d-f*l,e[6]=p+h*l,e[10]=a*s}else if(r.order==="YXZ"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g+_*o,e[4]=v*o-m,e[8]=a*l,e[1]=a*c,e[5]=a*u,e[9]=-o,e[2]=m*o-v,e[6]=_+g*o,e[10]=a*s}else if(r.order==="ZXY"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g-_*o,e[4]=-a*c,e[8]=v+m*o,e[1]=m+v*o,e[5]=a*u,e[9]=_-g*o,e[2]=-a*l,e[6]=o,e[10]=a*s}else if(r.order==="ZYX"){var f=a*u,h=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=p*l-h,e[8]=f*l+d,e[1]=s*c,e[5]=d*l+f,e[9]=h*l-p,e[2]=-l,e[6]=o*s,e[10]=a*s}else if(r.order==="YZX"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=S-y*c,e[8]=M*c+x,e[1]=c,e[5]=a*u,e[9]=-o*u,e[2]=-l*u,e[6]=x*c+M,e[10]=y-S*c}else if(r.order==="XZY"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=-c,e[8]=l*u,e[1]=y*c+S,e[5]=a*u,e[9]=x*c-M,e[2]=M*c-x,e[6]=o*u,e[10]=S*c+y}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(r){var e=this.elements,t=r.x,i=r.y,n=r.z,a=r.w,o=t+t,s=i+i,l=n+n,u=t*o,c=t*s,f=t*l,h=i*s,p=i*l,d=n*l,g=a*o,m=a*s,v=a*l;return e[0]=1-(h+d),e[4]=c-v,e[8]=f+m,e[1]=c+v,e[5]=1-(u+d),e[9]=p-g,e[2]=f-m,e[6]=p+g,e[10]=1-(u+h),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var r,e,t;return function(n,a,o){r===void 0&&(r=new oe,e=new oe,t=new oe);var s=this.elements;return t.subVectors(n,a).normalize(),t.lengthSq()===0&&(t.z=1),r.crossVectors(o,t).normalize(),r.lengthSq()===0&&(t.z+=1e-4,r.crossVectors(o,t).normalize()),e.crossVectors(t,r),s[0]=r.x,s[4]=e.x,s[8]=t.x,s[1]=r.y,s[5]=e.y,s[9]=t.y,s[2]=r.z,s[6]=e.z,s[10]=t.z,this}}(),multiply:function(r,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(r,e)):this.multiplyMatrices(this,r)},premultiply:function(r){return this.multiplyMatrices(r,this)},multiplyMatrices:function(r,e){var t=r.elements,i=e.elements,n=this.elements,a=t[0],o=t[4],s=t[8],l=t[12],u=t[1],c=t[5],f=t[9],h=t[13],p=t[2],d=t[6],g=t[10],m=t[14],v=t[3],_=t[7],y=t[11],x=t[15],M=i[0],S=i[4],w=i[8],T=i[12],C=i[1],b=i[5],E=i[9],I=i[13],R=i[2],A=i[6],D=i[10],U=i[14],B=i[3],F=i[7],k=i[11],G=i[15];return n[0]=a*M+o*C+s*R+l*B,n[4]=a*S+o*b+s*A+l*F,n[8]=a*w+o*E+s*D+l*k,n[12]=a*T+o*I+s*U+l*G,n[1]=u*M+c*C+f*R+h*B,n[5]=u*S+c*b+f*A+h*F,n[9]=u*w+c*E+f*D+h*k,n[13]=u*T+c*I+f*U+h*G,n[2]=p*M+d*C+g*R+m*B,n[6]=p*S+d*b+g*A+m*F,n[10]=p*w+d*E+g*D+m*k,n[14]=p*T+d*I+g*U+m*G,n[3]=v*M+_*C+y*R+x*B,n[7]=v*S+_*b+y*A+x*F,n[11]=v*w+_*E+y*D+x*k,n[15]=v*T+_*I+y*U+x*G,this},multiplyToArray:function(r,e,t){var i=this.elements;return this.multiplyMatrices(r,e),t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},multiplyScalar:function(r){var e=this.elements;return e[0]*=r,e[4]*=r,e[8]*=r,e[12]*=r,e[1]*=r,e[5]*=r,e[9]*=r,e[13]*=r,e[2]*=r,e[6]*=r,e[10]*=r,e[14]*=r,e[3]*=r,e[7]*=r,e[11]*=r,e[15]*=r,this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a0,shadowMapType:r.shadowMap.type,toneMapping:r.toneMapping,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,alphaTest:s.alphaTest,doubleSided:s.side===Oy,flipSided:s.side===xh,depthPacking:s.depthPacking!==void 0?s.depthPacking:!1};return v},this.getProgramCode=function(s,l){var u=[];if(l.shaderID?u.push(l.shaderID):(u.push(s.fragmentShader),u.push(s.vertexShader)),s.defines!==void 0)for(var c in s.defines)u.push(c),u.push(s.defines[c]);for(var f=0;f65535?Uint32Array:Uint16Array,C=new gt(new T(p),1);return a(C,r.ELEMENT_ARRAY_BUFFER),h.wireframe=C,C}return{getAttributeBuffer:l,getAttributeProperties:u,getWireframeAttribute:c,update:n}}function qRe(r,e,t,i,n,a,o){var s=o.memory,l=typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext;function u(R,A){if(R.width>A||R.height>A){var D=A/Math.max(R.width,R.height),U=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");U.width=Math.floor(R.width*D),U.height=Math.floor(R.height*D);var B=U.getContext("2d");return B.drawImage(R,0,0,R.width,R.height,0,0,U.width,U.height),console.warn("THREE.WebGLRenderer: image is too big ("+R.width+"x"+R.height+"). Resized to "+U.width+"x"+U.height,R),U}return R}function c(R){return cr.isPowerOfTwo(R.width)&&cr.isPowerOfTwo(R.height)}function f(R){if(R instanceof HTMLImageElement||R instanceof HTMLCanvasElement){var A=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");A.width=cr.nearestPowerOfTwo(R.width),A.height=cr.nearestPowerOfTwo(R.height);var D=A.getContext("2d");return D.drawImage(R,0,0,A.width,A.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+R.width+"x"+R.height+"). Resized to "+A.width+"x"+A.height,R),A}return R}function h(R){return R.wrapS!==Uo||R.wrapT!==Uo||R.minFilter!==Oo&&R.minFilter!==no}function p(R){return R===Oo||R===wC||R===TC?r.NEAREST:r.LINEAR}function d(R){var A=R.target;A.removeEventListener("dispose",d),m(A),s.textures--}function g(R){var A=R.target;A.removeEventListener("dispose",g),v(A),s.textures--}function m(R){var A=i.get(R);if(R.image&&A.__image__webglTextureCube)r.deleteTexture(A.__image__webglTextureCube);else{if(A.__webglInit===void 0)return;r.deleteTexture(A.__webglTexture)}i.delete(R)}function v(R){var A=i.get(R),D=i.get(R.texture);if(R){if(D.__webglTexture!==void 0&&r.deleteTexture(D.__webglTexture),R.depthTexture&&R.depthTexture.dispose(),R.isWebGLRenderTargetCube)for(var U=0;U<6;U++)r.deleteFramebuffer(A.__webglFramebuffer[U]),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[U]);else r.deleteFramebuffer(A.__webglFramebuffer),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer);i.delete(R.texture),i.delete(R)}}function _(R,A){var D=i.get(R);if(R.version>0&&D.__version!==R.version){var U=R.image;if(U===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",R);else if(U.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",R);else{S(D,R,A);return}}t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_2D,D.__webglTexture)}function y(R,A){var D=i.get(R);if(R.image.length===6)if(R.version>0&&D.__version!==R.version){D.__image__webglTextureCube||(R.addEventListener("dispose",d),D.__image__webglTextureCube=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,D.__image__webglTextureCube),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,R.flipY);for(var U=R&&R.isCompressedTexture,B=R.image[0]&&R.image[0].isDataTexture,z=[],k=0;k<6;k++)!U&&!B?z[k]=u(R.image[k],n.maxCubemapSize):z[k]=B?R.image[k].image:R.image[k];var G=z[0],Y=c(G),J=a(R.format),Q=a(R.type);M(r.TEXTURE_CUBE_MAP,R,Y);for(var k=0;k<6;k++)if(!U)B?t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,z[k].width,z[k].height,0,J,Q,z[k].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,J,Q,z[k]);else for(var V,K=z[k].mipmaps,ae=0,ve=K.length;ae-1?t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,V.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,J,Q,V.data);R.generateMipmaps&&Y&&r.generateMipmap(r.TEXTURE_CUBE_MAP),D.__version=R.version,R.onUpdate&&R.onUpdate(R)}else t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,D.__image__webglTextureCube)}function x(R,A){t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,i.get(R).__webglTexture)}function M(R,A,D){var U;if(D?(r.texParameteri(R,r.TEXTURE_WRAP_S,a(A.wrapS)),r.texParameteri(R,r.TEXTURE_WRAP_T,a(A.wrapT)),r.texParameteri(R,r.TEXTURE_MAG_FILTER,a(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,a(A.minFilter))):(r.texParameteri(R,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(R,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(A.wrapS!==Uo||A.wrapT!==Uo)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",A),r.texParameteri(R,r.TEXTURE_MAG_FILTER,p(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,p(A.minFilter)),A.minFilter!==Oo&&A.minFilter!==no&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",A)),U=e.get("EXT_texture_filter_anisotropic"),U){if(A.type===Jg&&e.get("OES_texture_float_linear")===null||A.type===qA&&e.get("OES_texture_half_float_linear")===null)return;(A.anisotropy>1||i.get(A).__currentAnisotropy)&&(r.texParameterf(R,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,n.getMaxAnisotropy())),i.get(A).__currentAnisotropy=A.anisotropy)}}function S(R,A,D){R.__webglInit===void 0&&(R.__webglInit=!0,A.addEventListener("dispose",d),R.__webglTexture=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+D),t.bindTexture(r.TEXTURE_2D,R.__webglTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment);var U=u(A.image,n.maxTextureSize);h(A)&&c(U)===!1&&(U=f(U));var B=c(U),z=a(A.format),k=a(A.type);M(r.TEXTURE_2D,A,B);var G,Y=A.mipmaps;if(A.isDepthTexture){var J=r.DEPTH_COMPONENT;if(A.type===Jg){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");J=r.DEPTH_COMPONENT32F}else l&&(J=r.DEPTH_COMPONENT16);A.format===Ld&&J===r.DEPTH_COMPONENT&&A.type!==AS&&A.type!==KF&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),A.type=AS,k=a(A.type)),A.format===Qg&&(J=r.DEPTH_STENCIL,A.type!==CS&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),A.type=CS,k=a(A.type))),t.texImage2D(r.TEXTURE_2D,0,J,U.width,U.height,0,z,k,null)}else if(A.isDataTexture)if(Y.length>0&&B){for(var Q=0,V=Y.length;Q-1?t.compressedTexImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,G.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,z,k,G.data);else if(Y.length>0&&B){for(var Q=0,V=Y.length;Q=1,U=null,B={},z=new ei,k=new ei;function G($,it,Xe){var Fe=new Uint8Array(4),we=r.createTexture();r.bindTexture($,we),r.texParameteri($,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri($,r.TEXTURE_MAG_FILTER,r.NEAREST);for(var Ie=0;Ie0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=t.precision!==void 0?t.precision:"highp",s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=t.logarithmicDepthBuffer===!0&&!!e.get("EXT_frag_depth"),u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),c=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=r.getParameter(r.MAX_TEXTURE_SIZE),h=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),d=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),g=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),v=c>0,_=!!e.get("OES_texture_float"),y=v&&_;return{getMaxAnisotropy:n,getMaxPrecision:a,precision:o,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:f,maxCubemapSize:h,maxAttributes:p,maxVertexUniforms:d,maxVaryings:g,maxFragmentUniforms:m,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:y}}function JRe(r){var e={};return{get:function(t){if(e[t]!==void 0)return e[t];var i;switch(t){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=r.getExtension("WEBGL_compressed_texture_etc1");break;default:i=r.getExtension(t)}return i===null&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e[t]=i,i}}}function $Re(){var r=this,e=null,t=0,i=!1,n=!1,a=new Io,o=new ws,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(c,f,h){var p=c.length!==0||f||t!==0||i;return i=f,e=u(c,h,0),t=c.length,p},this.beginShadows=function(){n=!0,u(null)},this.endShadows=function(){n=!1,l()},this.setState=function(c,f,h,p,d,g){if(!i||c===null||c.length===0||n&&!h)n?u(null):l();else{var m=n?0:t,v=m*4,_=d.clippingState||null;s.value=_,_=u(c,p,v,g);for(var y=0;y!==v;++y)_[y]=e[y];d.clippingState=_,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=m}};function l(){s.value!==e&&(s.value=e,s.needsUpdate=t>0),r.numPlanes=t,r.numIntersection=0}function u(c,f,h,p){var d=c!==null?c.length:0,g=null;if(d!==0){if(g=s.value,p!==!0||g===null){var m=h+d*4,v=f.matrixWorldInverse;o.getNormalMatrix(v),(g===null||g.length8&&($e.length=8);for(var mi=ee.morphAttributes,at=0,wt=$e.length;at0&&Mi.renderInstances(ee,Jh,XR):Mi.render(Jh,XR)}};function st(P,W,ee,ge){var ce;if(ee&&ee.isInstancedBufferGeometry&&(ce=We.get("ANGLE_instanced_arrays"),ce===null)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}ge===void 0&&(ge=0),xe.initAttributes();var Oe=ee.attributes,Ge=W.getAttributes(),Re=P.defaultAttributeValues;for(var pt in Ge){var mt=Ge[pt];if(mt>=0){var $e=Oe[pt];if($e!==void 0){var at=$e.normalized,wt=$e.itemSize,je=Ne.getAttributeProperties($e),mi=je.__webglBuffer,Ut=je.type,Cr=je.bytesPerElement;if($e.isInterleavedBufferAttribute){var Hi=$e.data,Mt=Hi.stride,Mi=$e.offset;Hi&&Hi.isInstancedInterleavedBuffer?(xe.enableAttributeAndDivisor(mt,Hi.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=Hi.meshPerAttribute*Hi.count)):xe.enableAttribute(mt),q.bindBuffer(q.ARRAY_BUFFER,mi),q.vertexAttribPointer(mt,wt,Ut,at,Mt*Cr,(ge*Mt+Mi)*Cr)}else $e.isInstancedBufferAttribute?(xe.enableAttributeAndDivisor(mt,$e.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=$e.meshPerAttribute*$e.count)):xe.enableAttribute(mt),q.bindBuffer(q.ARRAY_BUFFER,mi),q.vertexAttribPointer(mt,wt,Ut,at,0,ge*wt*Cr)}else if(Re!==void 0){var lr=Re[pt];if(lr!==void 0)switch(lr.length){case 2:q.vertexAttrib2fv(mt,lr);break;case 3:q.vertexAttrib3fv(mt,lr);break;case 4:q.vertexAttrib4fv(mt,lr);break;default:q.vertexAttrib1fv(mt,lr)}}}}xe.disableUnusedAttributes()}function Je(P,W){return Math.abs(W[0])-Math.abs(P[0])}function kt(P,W){return P.object.renderOrder!==W.object.renderOrder?P.object.renderOrder-W.object.renderOrder:P.material.program&&W.material.program&&P.material.program!==W.material.program?P.material.program.id-W.material.program.id:P.material.id!==W.material.id?P.material.id-W.material.id:P.z!==W.z?P.z-W.z:P.id-W.id}function X(P,W){return P.object.renderOrder!==W.object.renderOrder?P.object.renderOrder-W.object.renderOrder:P.z!==W.z?W.z-P.z:P.id-W.id}this.render=function(P,W,ee,ge){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}S="",M=-1,w=null,P.autoUpdate===!0&&P.updateMatrixWorld(),W.parent===null&&W.updateMatrixWorld(),W.matrixWorldInverse.getInverse(W.matrixWorld),K.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),G.setFromMatrix(K),u.length=0,f=-1,p=-1,g.length=0,m.length=0,Q=this.localClippingEnabled,J=Y.init(this.clippingPlanes,Q,W),xt(P,W),c.length=f+1,h.length=p+1,v.sortObjects===!0&&(c.sort(kt),h.sort(X)),J&&Y.beginShadows(),O(u),nt.render(P,W),j(u,W),J&&Y.endShadows(),Ee.calls=0,Ee.vertices=0,Ee.faces=0,Ee.points=0,ee===void 0&&(ee=null),this.setRenderTarget(ee);var ce=P.background;if(ce===null?xe.buffers.color.setClear(I.r,I.g,I.b,R,s):ce&&ce.isColor&&(xe.buffers.color.setClear(ce.r,ce.g,ce.b,1,s),ge=!0),(this.autoClear||ge)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),ce&&ce.isCubeTexture?(le.projectionMatrix.copy(W.projectionMatrix),le.matrixWorld.extractRotation(W.matrixWorld),le.matrixWorldInverse.getInverse(le.matrixWorld),et.material.uniforms.tCube.value=ce,et.modelViewMatrix.multiplyMatrices(le.matrixWorldInverse,et.matrixWorld),Ne.update(et),v.renderBufferDirect(le,null,et.geometry,et.material,et,null)):ce&&ce.isTexture&&(me.material.map=ce,Ne.update(me),v.renderBufferDirect(ne,null,me.geometry,me.material,me,null)),P.overrideMaterial){var Oe=P.overrideMaterial;Ft(c,P,W,Oe),Ft(h,P,W,Oe)}else xe.setBlending(ES),Ft(c,P,W),Ft(h,P,W);$.render(P,W),it.render(P,W,b),ee&&Ue.updateRenderTargetMipmap(ee),xe.setDepthTest(!0),xe.setDepthWrite(!0),xe.setColorWrite(!0)};function Te(P,W,ee,ge,ce){var Oe,Ge;ee.transparent?(Oe=h,Ge=++p):(Oe=c,Ge=++f);var Re=Oe[Ge];Re!==void 0?(Re.id=P.id,Re.object=P,Re.geometry=W,Re.material=ee,Re.z=ae.z,Re.group=ce):(Re={id:P.id,object:P,geometry:W,material:ee,z:ae.z,group:ce},Oe.push(Re))}function te(P){var W=P.geometry;return W.boundingSphere===null&&W.computeBoundingSphere(),V.copy(W.boundingSphere).applyMatrix4(P.matrixWorld),Pe(V)}function Me(P){return V.center.set(0,0,0),V.radius=.7071067811865476,V.applyMatrix4(P.matrixWorld),Pe(V)}function Pe(P){if(!G.intersectsSphere(P))return!1;var W=Y.numPlanes;if(W===0)return!0;var ee=v.clippingPlanes,ge=P.center,ce=-P.radius,Oe=0;do if(ee[Oe].distanceToPoint(ge)=0&&P.numSupportedMorphTargets++}if(P.morphNormals){P.numSupportedMorphNormals=0;for(var $e=0;$e=0&&P.numSupportedMorphNormals++}var at=ge.__webglShader.uniforms;(!P.isShaderMaterial&&!P.isRawShaderMaterial||P.clipping===!0)&&(ge.numClippingPlanes=Y.numPlanes,ge.numIntersection=Y.numIntersection,at.clippingPlanes=Y.uniform),ge.fog=W,ge.lightsHash=se.hash,P.lights&&(at.ambientLightColor.value=se.ambient,at.directionalLights.value=se.directional,at.spotLights.value=se.spot,at.rectAreaLights.value=se.rectArea,at.pointLights.value=se.point,at.hemisphereLights.value=se.hemi,at.directionalShadowMap.value=se.directionalShadowMap,at.directionalShadowMatrix.value=se.directionalShadowMatrix,at.spotShadowMap.value=se.spotShadowMap,at.spotShadowMatrix.value=se.spotShadowMatrix,at.pointShadowMap.value=se.pointShadowMap,at.pointShadowMatrix.value=se.pointShadowMatrix);var wt=ge.program.getUniforms(),je=Mh.seqWithValue(wt.seq,at);ge.uniformsList=je}function jr(P){P.side===Oy?xe.disable(q.CULL_FACE):xe.enable(q.CULL_FACE),xe.setFlipSided(P.side===xh),P.transparent===!0?xe.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst,P.blendEquationAlpha,P.blendSrcAlpha,P.blendDstAlpha,P.premultipliedAlpha):xe.setBlending(ES),xe.setDepthFunc(P.depthFunc),xe.setDepthTest(P.depthTest),xe.setDepthWrite(P.depthWrite),xe.setColorWrite(P.colorWrite),xe.setPolygonOffset(P.polygonOffset,P.polygonOffsetFactor,P.polygonOffsetUnits)}function Vt(P,W,ee,ge){E=0;var ce=Le.get(ee);if(J&&(Q||P!==w)){var Oe=P===w&&ee.id===M;Y.setState(ee.clippingPlanes,ee.clipIntersection,ee.clipShadows,P,ce,Oe)}ee.needsUpdate===!1&&(ce.program===void 0||ee.fog&&ce.fog!==W||ee.lights&&ce.lightsHash!==se.hash||ce.numClippingPlanes!==void 0&&(ce.numClippingPlanes!==Y.numPlanes||ce.numIntersection!==Y.numIntersection))&&(ee.needsUpdate=!0),ee.needsUpdate&&(Mr(ee,W,ge),ee.needsUpdate=!1);var Ge=!1,Re=!1,pt=!1,mt=ce.program,$e=mt.getUniforms(),at=ce.__webglShader.uniforms;if(mt.id!==_&&(q.useProgram(mt.program),_=mt.id,Ge=!0,Re=!0,pt=!0),ee.id!==M&&(M=ee.id,Re=!0),Ge||P!==w){if($e.set(q,P,"projectionMatrix"),_e.logarithmicDepthBuffer&&$e.setValue(q,"logDepthBufFC",2/(Math.log(P.far+1)/Math.LN2)),P!==w&&(w=P,Re=!0,pt=!0),ee.isShaderMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.envMap){var wt=$e.map.cameraPosition;wt!==void 0&&wt.setValue(q,ae.setFromMatrixPosition(P.matrixWorld))}(ee.isMeshPhongMaterial||ee.isMeshLambertMaterial||ee.isMeshBasicMaterial||ee.isMeshStandardMaterial||ee.isShaderMaterial||ee.skinning)&&$e.setValue(q,"viewMatrix",P.matrixWorldInverse),$e.set(q,v,"toneMappingExposure"),$e.set(q,v,"toneMappingWhitePoint")}if(ee.skinning){$e.setOptional(q,ge,"bindMatrix"),$e.setOptional(q,ge,"bindMatrixInverse");var je=ge.skeleton;je&&(_e.floatVertexTextures&&je.useVertexTexture?($e.set(q,je,"boneTexture"),$e.set(q,je,"boneTextureWidth"),$e.set(q,je,"boneTextureHeight")):$e.setOptional(q,je,"boneMatrices"))}return Re&&(ee.lights&&A0(at,pt),W&&ee.fog&&Is(at,W),(ee.isMeshBasicMaterial||ee.isMeshLambertMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.isMeshNormalMaterial||ee.isMeshDepthMaterial)&&Lr(at,ee),ee.isLineBasicMaterial?si(at,ee):ee.isLineDashedMaterial?(si(at,ee),Zh(at,ee)):ee.isPointsMaterial?w0(at,ee):ee.isMeshLambertMaterial?jh(at,ee):ee.isMeshToonMaterial?Kh(at,ee):ee.isMeshPhongMaterial?Go(at,ee):ee.isMeshPhysicalMaterial?T0(at,ee):ee.isMeshStandardMaterial?bc(at,ee):ee.isMeshDepthMaterial?ee.displacementMap&&(at.displacementMap.value=ee.displacementMap,at.displacementScale.value=ee.displacementScale,at.displacementBias.value=ee.displacementBias):ee.isMeshNormalMaterial&&E0(at,ee),at.ltcMat!==void 0&&(at.ltcMat.value=THREE.UniformsLib.LTC_MAT_TEXTURE),at.ltcMag!==void 0&&(at.ltcMag.value=THREE.UniformsLib.LTC_MAG_TEXTURE),Mh.upload(q,ce.uniformsList,at,v)),$e.set(q,ge,"modelViewMatrix"),$e.set(q,ge,"normalMatrix"),$e.setValue(q,"modelMatrix",ge.matrixWorld),mt}function Lr(P,W){P.opacity.value=W.opacity,P.diffuse.value=W.color,W.emissive&&P.emissive.value.copy(W.emissive).multiplyScalar(W.emissiveIntensity),P.map.value=W.map,P.specularMap.value=W.specularMap,P.alphaMap.value=W.alphaMap,W.lightMap&&(P.lightMap.value=W.lightMap,P.lightMapIntensity.value=W.lightMapIntensity),W.aoMap&&(P.aoMap.value=W.aoMap,P.aoMapIntensity.value=W.aoMapIntensity);var ee;if(W.map?ee=W.map:W.specularMap?ee=W.specularMap:W.displacementMap?ee=W.displacementMap:W.normalMap?ee=W.normalMap:W.bumpMap?ee=W.bumpMap:W.roughnessMap?ee=W.roughnessMap:W.metalnessMap?ee=W.metalnessMap:W.alphaMap?ee=W.alphaMap:W.emissiveMap&&(ee=W.emissiveMap),ee!==void 0){ee.isWebGLRenderTarget&&(ee=ee.texture);var ge=ee.offset,ce=ee.repeat;P.offsetRepeat.value.set(ge.x,ge.y,ce.x,ce.y)}P.envMap.value=W.envMap,P.flipEnvMap.value=W.envMap&&W.envMap.isCubeTexture?-1:1,P.reflectivity.value=W.reflectivity,P.refractionRatio.value=W.refractionRatio}function si(P,W){P.diffuse.value=W.color,P.opacity.value=W.opacity}function Zh(P,W){P.dashSize.value=W.dashSize,P.totalSize.value=W.dashSize+W.gapSize,P.scale.value=W.scale}function w0(P,W){if(P.diffuse.value=W.color,P.opacity.value=W.opacity,P.size.value=W.size*U,P.scale.value=D*.5,P.map.value=W.map,W.map!==null){var ee=W.map.offset,ge=W.map.repeat;P.offsetRepeat.value.set(ee.x,ee.y,ge.x,ge.y)}}function Is(P,W){P.fogColor.value=W.color,W.isFog?(P.fogNear.value=W.near,P.fogFar.value=W.far):W.isFogExp2&&(P.fogDensity.value=W.density)}function jh(P,W){W.emissiveMap&&(P.emissiveMap.value=W.emissiveMap)}function Go(P,W){P.specular.value=W.specular,P.shininess.value=Math.max(W.shininess,1e-4),W.emissiveMap&&(P.emissiveMap.value=W.emissiveMap),W.bumpMap&&(P.bumpMap.value=W.bumpMap,P.bumpScale.value=W.bumpScale),W.normalMap&&(P.normalMap.value=W.normalMap,P.normalScale.value.copy(W.normalScale)),W.displacementMap&&(P.displacementMap.value=W.displacementMap,P.displacementScale.value=W.displacementScale,P.displacementBias.value=W.displacementBias)}function Kh(P,W){Go(P,W),W.gradientMap&&(P.gradientMap.value=W.gradientMap)}function bc(P,W){P.roughness.value=W.roughness,P.metalness.value=W.metalness,W.roughnessMap&&(P.roughnessMap.value=W.roughnessMap),W.metalnessMap&&(P.metalnessMap.value=W.metalnessMap),W.emissiveMap&&(P.emissiveMap.value=W.emissiveMap),W.bumpMap&&(P.bumpMap.value=W.bumpMap,P.bumpScale.value=W.bumpScale),W.normalMap&&(P.normalMap.value=W.normalMap,P.normalScale.value.copy(W.normalScale)),W.displacementMap&&(P.displacementMap.value=W.displacementMap,P.displacementScale.value=W.displacementScale,P.displacementBias.value=W.displacementBias),W.envMap&&(P.envMapIntensity.value=W.envMapIntensity)}function T0(P,W){P.clearCoat.value=W.clearCoat,P.clearCoatRoughness.value=W.clearCoatRoughness,bc(P,W)}function E0(P,W){W.bumpMap&&(P.bumpMap.value=W.bumpMap,P.bumpScale.value=W.bumpScale),W.normalMap&&(P.normalMap.value=W.normalMap,P.normalScale.value.copy(W.normalScale)),W.displacementMap&&(P.displacementMap.value=W.displacementMap,P.displacementScale.value=W.displacementScale,P.displacementBias.value=W.displacementBias)}function A0(P,W){P.ambientLightColor.needsUpdate=W,P.directionalLights.needsUpdate=W,P.pointLights.needsUpdate=W,P.spotLights.needsUpdate=W,P.rectAreaLights.needsUpdate=W,P.hemisphereLights.needsUpdate=W}function O(P){for(var W=0,ee=0,ge=P.length;ee=_e.maxTextures&&console.warn("WebGLRenderer: trying to use "+P+" texture units while this GPU supports only "+_e.maxTextures),E+=1,P}this.allocTextureUnit=re,this.setTexture2D=function(){var P=!1;return function(ee,ge){ee&&ee.isWebGLRenderTarget&&(P||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),P=!0),ee=ee.texture),Ue.setTexture2D(ee,ge)}}(),this.setTexture=function(){var P=!1;return function(ee,ge){P||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),P=!0),Ue.setTexture2D(ee,ge)}}(),this.setTextureCube=function(){var P=!1;return function(ee,ge){ee&&ee.isWebGLRenderTargetCube&&(P||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),P=!0),ee=ee.texture),ee&&ee.isCubeTexture||Array.isArray(ee.image)&&ee.image.length===6?Ue.setTextureCube(ee,ge):Ue.setTextureCubeDynamic(ee,ge)}}(),this.getCurrentRenderTarget=function(){return y},this.setRenderTarget=function(P){y=P,P&&Le.get(P).__webglFramebuffer===void 0&&Ue.setupRenderTarget(P);var W=P&&P.isWebGLRenderTargetCube,ee;if(P){var ge=Le.get(P);W?ee=ge.__webglFramebuffer[P.activeCubeFace]:ee=ge.__webglFramebuffer,T.copy(P.scissor),C=P.scissorTest,b.copy(P.viewport)}else ee=null,T.copy(B).multiplyScalar(U),C=z,b.copy(k).multiplyScalar(U);if(x!==ee&&(q.bindFramebuffer(q.FRAMEBUFFER,ee),x=ee),xe.scissor(T),xe.setScissorTest(C),xe.viewport(b),W){var ce=Le.get(P.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+P.activeCubeFace,ce.__webglTexture,P.activeMipMapLevel)}},this.readRenderTargetPixels=function(P,W,ee,ge,ce,Oe){if((P&&P.isWebGLRenderTarget)===!1){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}var Ge=Le.get(P).__webglFramebuffer;if(Ge){var Re=!1;Ge!==x&&(q.bindFramebuffer(q.FRAMEBUFFER,Ge),Re=!0);try{var pt=P.texture,mt=pt.format,$e=pt.type;if(mt!==ou&&ie(mt)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if($e!==YA&&ie($e)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_TYPE)&&!($e===Jg&&(We.get("OES_texture_float")||We.get("WEBGL_color_buffer_float")))&&!($e===qA&&We.get("EXT_color_buffer_half_float"))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?W>=0&&W<=P.width-ge&&ee>=0&&ee<=P.height-ce&&q.readPixels(W,ee,ge,ce,ie(mt),ie($e),Oe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{Re&&q.bindFramebuffer(q.FRAMEBUFFER,x)}}};function ie(P){var W;if(P===rc)return q.REPEAT;if(P===Uo)return q.CLAMP_TO_EDGE;if(P===Nd)return q.MIRRORED_REPEAT;if(P===Oo)return q.NEAREST;if(P===wC)return q.NEAREST_MIPMAP_NEAREST;if(P===TC)return q.NEAREST_MIPMAP_LINEAR;if(P===no)return q.LINEAR;if(P===jF)return q.LINEAR_MIPMAP_NEAREST;if(P===yM)return q.LINEAR_MIPMAP_LINEAR;if(P===YA)return q.UNSIGNED_BYTE;if(P===gne)return q.UNSIGNED_SHORT_4_4_4_4;if(P===yne)return q.UNSIGNED_SHORT_5_5_5_1;if(P===_ne)return q.UNSIGNED_SHORT_5_6_5;if(P===dne)return q.BYTE;if(P===mne)return q.SHORT;if(P===AS)return q.UNSIGNED_SHORT;if(P===vne)return q.INT;if(P===KF)return q.UNSIGNED_INT;if(P===Jg)return q.FLOAT;if(P===qA&&(W=We.get("OES_texture_half_float"),W!==null))return W.HALF_FLOAT_OES;if(P===xne)return q.ALPHA;if(P===$g)return q.RGB;if(P===ou)return q.RGBA;if(P===Sne)return q.LUMINANCE;if(P===Mne)return q.LUMINANCE_ALPHA;if(P===Ld)return q.DEPTH_COMPONENT;if(P===Qg)return q.DEPTH_STENCIL;if(P===HF)return q.FUNC_ADD;if(P===Wie)return q.FUNC_SUBTRACT;if(P===Xie)return q.FUNC_REVERSE_SUBTRACT;if(P===Yie)return q.ZERO;if(P===qie)return q.ONE;if(P===Zie)return q.SRC_COLOR;if(P===jie)return q.ONE_MINUS_SRC_COLOR;if(P===WF)return q.SRC_ALPHA;if(P===XF)return q.ONE_MINUS_SRC_ALPHA;if(P===Kie)return q.DST_ALPHA;if(P===Jie)return q.ONE_MINUS_DST_ALPHA;if(P===$ie)return q.DST_COLOR;if(P===Qie)return q.ONE_MINUS_DST_COLOR;if(P===ene)return q.SRC_ALPHA_SATURATE;if((P===hF||P===pF||P===dF||P===mF)&&(W=We.get("WEBGL_compressed_texture_s3tc"),W!==null)){if(P===hF)return W.COMPRESSED_RGB_S3TC_DXT1_EXT;if(P===pF)return W.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(P===dF)return W.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(P===mF)return W.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((P===vF||P===gF||P===yF||P===_F)&&(W=We.get("WEBGL_compressed_texture_pvrtc"),W!==null)){if(P===vF)return W.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(P===gF)return W.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(P===yF)return W.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(P===_F)return W.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(P===bne&&(W=We.get("WEBGL_compressed_texture_etc1"),W!==null))return W.COMPRESSED_RGB_ETC1_WEBGL;if((P===lF||P===uF)&&(W=We.get("EXT_blend_minmax"),W!==null)){if(P===lF)return W.MIN_EXT;if(P===uF)return W.MAX_EXT}return P===CS&&(W=We.get("WEBGL_depth_texture"),W!==null)?W.UNSIGNED_INT_24_8_WEBGL:0}}function iy(r,e){this.name="",this.color=new Gt(r),this.density=e!==void 0?e:25e-5}function ny(r,e,t){this.name="",this.color=new Gt(r),this.near=e!==void 0?e:1,this.far=t!==void 0?t:1e3}function Bd(){At.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function SF(r,e,t,i,n){At.call(this),this.lensFlares=[],this.positionScreen=new oe,this.customUpdateCallback=void 0,r!==void 0&&this.add(r,e,t,i,n)}function kd(r){mr.call(this),this.type="SpriteMaterial",this.color=new Gt(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(r)}function kS(r){At.call(this),this.type="Sprite",this.material=r!==void 0?r:new kd}function VS(){At.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function jA(r,e,t){if(this.useVertexTexture=t!==void 0?t:!0,this.identityMatrix=new qt,r=r||[],this.bones=r.slice(0),this.useVertexTexture){var i=Math.sqrt(this.bones.length*4);i=cr.nextPowerOfTwo(Math.ceil(i)),i=Math.max(i,4),this.boneTextureWidth=i,this.boneTextureHeight=i,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new Od(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,ou,Jg)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(e===void 0)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var n=0,a=this.bones.length;n=r.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}c()}function oy(r,e,t,i,n,a,o,s,l,u,c,f){ai.call(this,null,a,o,s,l,u,i,n,c,f),this.image={width:e,height:t},this.mipmaps=r,this.flipY=!1,this.generateMipmaps=!1}function QA(r,e,t,i,n,a,o,s,l){ai.call(this,r,e,t,i,n,a,o,s,l),this.needsUpdate=!0}function HS(r,e,t,i,n,a,o,s,l,u){if(u=u!==void 0?u:Ld,u!==Ld&&u!==Qg)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");t===void 0&&u===Ld&&(t=AS),t===void 0&&u===Qg&&(t=CS),ai.call(this,null,i,n,a,o,s,u,t,l),this.image={width:r,height:e},this.magFilter=o!==void 0?o:Oo,this.minFilter=s!==void 0?s:Oo,this.flipY=!1,this.generateMipmaps=!1}function sy(r){Bt.call(this);var e=[0,0],t={};function i(I,R){return I-R}var n=["a","b","c"];if(r&&r.isGeometry){for(var a=r.vertices,o=r.faces,s=0,l=new Uint32Array(6*o.length),u=0,c=o.length;u65535?nc:ic)(f,1)),this.addAttribute("position",new gr(i,3)),this.addAttribute("uv",new gr(n,2)),this.computeVertexNormals()}function WS(r,e,t){sr.call(this),this.type="ParametricGeometry",this.parameters={func:r,slices:e,stacks:t},this.fromBufferGeometry(new ly(r,e,t)),this.mergeVertices()}function so(r,e,t,i){Bt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:e,radius:t,detail:i},t=t||1,i=i||0;var n=[],a=[];o(i),l(t),u(),this.addAttribute("position",new gr(n,3)),this.addAttribute("normal",new gr(n.slice(),3)),this.addAttribute("uv",new gr(a,2)),this.normalizeNormals(),this.boundingSphere=new $n(new oe,t);function o(v){for(var _=new oe,y=new oe,x=new oe,M=0;M.9&&S<.1&&(_<.2&&(a[v+0]+=1),y<.2&&(a[v+2]+=1),x<.2&&(a[v+4]+=1))}}function f(v){n.push(v.x,v.y,v.z)}function h(v,_){var y=v*3;_.x=r[y+0],_.y=r[y+1],_.z=r[y+2]}function p(){for(var v=new oe,_=new oe,y=new oe,x=new oe,M=new St,S=new St,w=new St,T=0,C=0;T65535?nc:ic)(d,1)),this.addAttribute("position",new gr(f,3)),this.addAttribute("normal",new gr(h,3)),this.addAttribute("uv",new gr(p,2));function g(){for(u=0;u65535?Uint32Array:Uint16Array)(s),1),u=new gt(new Float32Array(o*3),3),c=new gt(new Float32Array(o*3),3),f=new gt(new Float32Array(o*2),2),h,p,d=0,g=0,m=new oe,v=new oe,_=new St,y=new oe,x=new oe,M=new oe,S=new oe,w=new oe;for(h=0;h<=t;++h){var T=h/t*n*Math.PI*2;for(U(T,n,a,r,y),U(T+.01,n,a,r,x),S.subVectors(x,y),w.addVectors(x,y),M.crossVectors(S,w),w.crossVectors(M,S),M.normalize(),w.normalize(),p=0;p<=i;++p){var C=p/i*Math.PI*2,b=-e*Math.cos(C),E=e*Math.sin(C);m.x=y.x+(b*w.x+E*M.x),m.y=y.y+(b*w.y+E*M.y),m.z=y.z+(b*w.z+E*M.z),u.setXYZ(d,m.x,m.y,m.z),v.subVectors(m,y).normalize(),c.setXYZ(d,v.x,v.y,v.z),_.x=h/t,_.y=p/i,f.setXY(d,_.x,_.y),d++}}for(p=1;p<=t;p++)for(h=1;h<=i;h++){var I=(i+1)*(p-1)+(h-1),R=(i+1)*p+(h-1),A=(i+1)*p+h,D=(i+1)*(p-1)+h;l.setX(g,I),g++,l.setX(g,R),g++,l.setX(g,D),g++,l.setX(g,R),g++,l.setX(g,A),g++,l.setX(g,D),g++}this.setIndex(l),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",f);function U(B,z,k,G,Y){var J=Math.cos(B),Q=Math.sin(B),V=k/z*B,K=Math.cos(V);Y.x=G*(2+K)*.5*J,Y.y=G*(2+K)*Q*.5,Y.z=G*Math.sin(V)*.5}}function JS(r,e,t,i,n,a,o){sr.call(this),this.type="TorusKnotGeometry",this.parameters={radius:r,tube:e,tubularSegments:t,radialSegments:i,p:n,q:a},o!==void 0&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new py(r,e,t,i,n,a)),this.mergeVertices()}function dy(r,e,t,i,n){Bt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},r=r||100,e=e||40,t=Math.floor(t)||8,i=Math.floor(i)||6,n=n||Math.PI*2;var a=(t+1)*(i+1),o=t*i*2*3,s=new(o>65535?Uint32Array:Uint16Array)(o),l=new Float32Array(a*3),u=new Float32Array(a*3),c=new Float32Array(a*2),f=0,h=0,p=0,d=new oe,g=new oe,m=new oe,v,_;for(v=0;v<=t;v++)for(_=0;_<=i;_++){var y=_/i*n,x=v/t*Math.PI*2;g.x=(r+e*Math.cos(x))*Math.cos(y),g.y=(r+e*Math.cos(x))*Math.sin(y),g.z=e*Math.sin(x),l[f]=g.x,l[f+1]=g.y,l[f+2]=g.z,d.x=r*Math.cos(y),d.y=r*Math.sin(y),m.subVectors(g,d).normalize(),u[f]=m.x,u[f+1]=m.y,u[f+2]=m.z,c[h]=_/i,c[h+1]=v/t,f+=3,h+=2}for(v=1;v<=t;v++)for(_=1;_<=i;_++){var M=(i+1)*v+_-1,S=(i+1)*(v-1)+_-1,w=(i+1)*(v-1)+_,T=(i+1)*v+_;s[p]=M,s[p+1]=S,s[p+2]=T,s[p+3]=S,s[p+4]=w,s[p+5]=T,p+=6}this.setIndex(new gt(s,1)),this.addAttribute("position",new gt(l,3)),this.addAttribute("normal",new gt(u,3)),this.addAttribute("uv",new gt(c,2))}function $S(r,e,t,i,n){sr.call(this),this.type="TorusGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},this.fromBufferGeometry(new dy(r,e,t,i,n))}function Ts(r,e){if(typeof r>"u"){r=[];return}sr.call(this),this.type="ExtrudeGeometry",r=Array.isArray(r)?r:[r],this.addShapeList(r,e),this.computeFaceNormals()}function QS(r,e){e=e||{};var t=e.font;if((t&&t.isFont)===!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new sr;var i=t.generateShapes(r,e.size,e.curveSegments);e.amount=e.height!==void 0?e.height:50,e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),Ts.call(this,i,e),this.type="TextGeometry"}function Gd(r,e,t,i,n,a,o){Bt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},r=r||50,e=Math.max(3,Math.floor(e)||8),t=Math.max(2,Math.floor(t)||6),i=i!==void 0?i:0,n=n!==void 0?n:Math.PI*2,a=a!==void 0?a:0,o=o!==void 0?o:Math.PI;for(var s=a+o,l=(e+1)*(t+1),u=new gt(new Float32Array(l*3),3),c=new gt(new Float32Array(l*3),3),f=new gt(new Float32Array(l*2),2),h=0,p=[],d=new oe,g=0;g<=t;g++){for(var m=[],v=g/t,_=0;_<=e;_++){var y=_/e,x=-r*Math.cos(i+y*n)*Math.sin(a+v*o),M=r*Math.cos(a+v*o),S=r*Math.sin(i+y*n)*Math.sin(a+v*o);d.set(x,M,S).normalize(),u.setXYZ(h,x,M,S),c.setXYZ(h,d.x,d.y,d.z),f.setXY(h,y,1-v),m.push(h),h++}p.push(m)}for(var w=[],g=0;g0)&&w.push(T,C,E),(g!==t-1||s65535?nc:ic)(w,1)),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",f),this.boundingSphere=new $n(new oe,r)}function eM(r,e,t,i,n,a,o){sr.call(this),this.type="SphereGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Gd(r,e,t,i,n,a,o))}function my(r,e,t,i,n,a){Bt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:r,outerRadius:e,thetaSegments:t,phiSegments:i,thetaStart:n,thetaLength:a},r=r||20,e=e||50,n=n!==void 0?n:0,a=a!==void 0?a:Math.PI*2,t=t!==void 0?Math.max(3,t):8,i=i!==void 0?Math.max(1,i):1;var o=(t+1)*(i+1),s=t*i*2*3,l=new gt(new(s>65535?Uint32Array:Uint16Array)(s),1),u=new gt(new Float32Array(o*3),3),c=new gt(new Float32Array(o*3),3),f=new gt(new Float32Array(o*2),2),h=0,p=0,d,g=r,m=(e-r)/i,v=new oe,_=new St,y,x;for(y=0;y<=i;y++){for(x=0;x<=t;x++)d=n+x/t*a,v.x=g*Math.cos(d),v.y=g*Math.sin(d),u.setXYZ(h,v.x,v.y,v.z),c.setXYZ(h,0,0,1),_.x=(v.x/e+1)/2,_.y=(v.y/e+1)/2,f.setXY(h,_.x,_.y),h++;g+=m}for(y=0;y65535?Uint32Array:Uint16Array)(a),1),s=new gt(new Float32Array(n*3),3),l=new gt(new Float32Array(n*2),2),u=0,c=0,f,h=1/e,p=new oe,d=new St,g,m;for(g=0;g<=e;g++){var v=t+g*h*i,_=Math.sin(v),y=Math.cos(v);for(m=0;m<=r.length-1;m++)p.x=r[m].x*_,p.y=r[m].y,p.z=r[m].x*y,s.setXYZ(u,p.x,p.y,p.z),d.x=g/e,d.y=m/(r.length-1),l.setXY(u,d.x,d.y),u++}for(g=0;g65535?nc:ic)(a,1)),this.addAttribute("position",new gr(t,3)),this.addAttribute("normal",new gr(i,3)),this.addAttribute("uv",new gr(n,2));function u(c){var f,h,p,d=t.length/3,g=c.extractPoints(e),m=g.shape,v=g.holes;if(Ln.isClockWise(m)===!1)for(m=m.reverse(),f=0,h=v.length;f0&&u++,e>0&&u++);var c=M(),f=S(),h=new gt(new(f>65535?Uint32Array:Uint16Array)(f),1),p=new gt(new Float32Array(c*3),3),d=new gt(new Float32Array(c*3),3),g=new gt(new Float32Array(c*2),2),m=0,v=0,_=[],y=t/2,x=0;w(),a===!1&&(r>0&&T(!0),e>0&&T(!1)),this.setIndex(h),this.addAttribute("position",p),this.addAttribute("normal",d),this.addAttribute("uv",g);function M(){var C=(i+1)*(n+1);return a===!1&&(C+=(i+1)*u+i*u),C}function S(){var C=i*n*2*3;return a===!1&&(C+=i*u*3),C}function w(){var C,b,E=new oe,I=new oe,R=0,A=(e-r)/t;for(b=0;b<=n;b++){var D=[],U=b/n,B=U*(e-r)+r;for(C=0;C<=i;C++){var z=C/i,k=z*s+o,G=Math.sin(k),Y=Math.cos(k);I.x=B*G,I.y=-U*t+y,I.z=B*Y,p.setXYZ(m,I.x,I.y,I.z),E.set(G,A,Y).normalize(),d.setXYZ(m,E.x,E.y,E.z),g.setXY(m,z,1-U),D.push(m),m++}_.push(D)}for(C=0;Cthis.points.length-2?this.points.length-1:n+1,e[3]=n>this.points.length-3?this.points.length-1:n+2,l=this.points[e[0]],u=this.points[e[1]],c=this.points[e[2]],f=this.points[e[3]],o=a*a,s=a*o,t.x=h(l.x,u.x,c.x,f.x,a,o,s),t.y=h(l.y,u.y,c.y,f.y,a,o,s),t.z=h(l.z,u.z,c.z,f.z,a,o,s),t},this.getControlPointsArray=function(){var p,d,g=this.points.length,m=[];for(p=0;p{"use strict";Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52));Math.sign===void 0&&(Math.sign=function(r){return r<0?-1:r>0?1:+r});Function.prototype.name===void 0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});Object.assign===void 0&&function(){Object.assign=function(r){"use strict";if(r==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(r),t=1;t>4,e[a]=r[a===19?i&3|8:i]);return e.join("")}}(),clamp:function(r,e,t){return Math.max(e,Math.min(t,r))},euclideanModulo:function(r,e){return(r%e+e)%e},mapLinear:function(r,e,t,i,n){return i+(r-e)*(n-i)/(t-e)},lerp:function(r,e,t){return(1-t)*r+t*e},smoothstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))},smootherstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))},randInt:function(r,e){return r+Math.floor(Math.random()*(e-r+1))},randFloat:function(r,e){return r+Math.random()*(e-r)},randFloatSpread:function(r){return r*(.5-Math.random())},degToRad:function(r){return r*cr.DEG2RAD},radToDeg:function(r){return r*cr.RAD2DEG},isPowerOfTwo:function(r){return(r&r-1)===0&&r!==0},nearestPowerOfTwo:function(r){return Math.pow(2,Math.round(Math.log(r)/Math.LN2))},nextPowerOfTwo:function(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}};St.prototype={constructor:St,isVector2:!0,get width(){return this.x},set width(r){this.x=r},get height(){return this.y},set height(r){this.y=r},set:function(r,e){return this.x=r,this.y=e,this},setScalar:function(r){return this.x=r,this.y=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(r){return this.x=r.x,this.y=r.y,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this)},addScalar:function(r){return this.x+=r,this.y+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this)},subScalar:function(r){return this.x-=r,this.y-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this},multiply:function(r){return this.x*=r.x,this.y*=r.y,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r):(this.x=0,this.y=0),this},divide:function(r){return this.x/=r.x,this.y/=r.y,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new St,e=new St),r.set(i,i),e.set(n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(r){return this.x*r.x+this.y*r.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var r=Math.atan2(this.y,this.x);return r<0&&(r+=2*Math.PI),r},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y;return e*e+t*t},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},equals:function(r){return r.x===this.x&&r.y===this.y},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this},rotateAround:function(r,e){var t=Math.cos(e),i=Math.sin(e),n=this.x-r.x,a=this.y-r.y;return this.x=n*t-a*i+r.x,this.y=n*i+a*t+r.y,this}};iAe=0;ai.DEFAULT_IMAGE=void 0;ai.DEFAULT_MAPPING=xC;ai.prototype={constructor:ai,isTexture:!0,set needsUpdate(r){r===!0&&this.version++},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.image=r.image,this.mipmaps=r.mipmaps.slice(0),this.mapping=r.mapping,this.wrapS=r.wrapS,this.wrapT=r.wrapT,this.magFilter=r.magFilter,this.minFilter=r.minFilter,this.anisotropy=r.anisotropy,this.format=r.format,this.type=r.type,this.offset.copy(r.offset),this.repeat.copy(r.repeat),this.generateMipmaps=r.generateMipmaps,this.premultiplyAlpha=r.premultiplyAlpha,this.flipY=r.flipY,this.unpackAlignment=r.unpackAlignment,this.encoding=r.encoding,this},toJSON:function(r){if(r.textures[this.uuid]!==void 0)return r.textures[this.uuid];function e(n){var a;return n.toDataURL!==void 0?a=n:(a=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),a.width=n.width,a.height=n.height,a.getContext("2d").drawImage(n,0,0,n.width,n.height)),a.width>2048||a.height>2048?a.toDataURL("image/jpeg",.6):a.toDataURL("image/png")}var t={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(this.image!==void 0){var i=this.image;i.uuid===void 0&&(i.uuid=cr.generateUUID()),r.images[i.uuid]===void 0&&(r.images[i.uuid]={uuid:i.uuid,url:e(i)}),t.image=i.uuid}return r.textures[this.uuid]=t,t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(r){if(this.mapping===xC){if(r.multiply(this.repeat),r.add(this.offset),r.x<0||r.x>1)switch(this.wrapS){case rc:r.x=r.x-Math.floor(r.x);break;case Uo:r.x=r.x<0?0:1;break;case Nd:Math.abs(Math.floor(r.x)%2)===1?r.x=Math.ceil(r.x)-r.x:r.x=r.x-Math.floor(r.x);break}if(r.y<0||r.y>1)switch(this.wrapT){case rc:r.y=r.y-Math.floor(r.y);break;case Uo:r.y=r.y<0?0:1;break;case Nd:Math.abs(Math.floor(r.y)%2)===1?r.y=Math.ceil(r.y)-r.y:r.y=r.y-Math.floor(r.y);break}this.flipY&&(r.y=1-r.y)}}};Object.assign(ai.prototype,bs.prototype);ei.prototype={constructor:ei,isVector4:!0,set:function(r,e,t,i){return this.x=r,this.y=e,this.z=t,this.w=i,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this.w=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setW:function(r){return this.w=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this.w=r.w!==void 0?r.w:1,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this.w+=r.w,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this.w+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this.w=r.w+e.w,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this.w+=r.w*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this.w-=r.w,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this.w-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this.w=r.w-e.w,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r,this.w*=r):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=this.w,a=r.elements;return this.x=a[0]*e+a[4]*t+a[8]*i+a[12]*n,this.y=a[1]*e+a[5]*t+a[9]*i+a[13]*n,this.z=a[2]*e+a[6]*t+a[10]*i+a[14]*n,this.w=a[3]*e+a[7]*t+a[11]*i+a[15]*n,this},divideScalar:function(r){return this.multiplyScalar(1/r)},setAxisAngleFromQuaternion:function(r){this.w=2*Math.acos(r.w);var e=Math.sqrt(1-r.w*r.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=r.x/e,this.y=r.y/e,this.z=r.z/e),this},setAxisAngleFromRotationMatrix:function(r){var e,t,i,n,a=.01,o=.1,s=r.elements,l=s[0],u=s[4],c=s[8],f=s[1],h=s[5],p=s[9],d=s[2],g=s[6],m=s[10];if(Math.abs(u-f)_&&v>y?vy?_0?(h=.5/Math.sqrt(f+1),this._w=.25/h,this._x=(u-s)*h,this._y=(n-l)*h,this._z=(a-i)*h):t>o&&t>c?(h=2*Math.sqrt(1+t-o-c),this._w=(u-s)/h,this._x=.25*h,this._y=(i+a)/h,this._z=(n+l)/h):o>c?(h=2*Math.sqrt(1+o-t-c),this._w=(n-l)/h,this._x=(i+a)/h,this._y=.25*h,this._z=(s+u)/h):(h=2*Math.sqrt(1+c-t-o),this._w=(a-i)/h,this._x=(n+l)/h,this._y=(s+u)/h,this._z=.25*h),this.onChangeCallback(),this},setFromUnitVectors:function(){var r,e,t=1e-6;return function(n,a){return r===void 0&&(r=new oe),e=n.dot(a)+1,eMath.abs(n.z)?r.set(-n.y,n.x,0):r.set(0,-n.z,n.y)):r.crossVectors(n,a),this._x=r.x,this._y=r.y,this._z=r.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(r){return this._x*r._x+this._y*r._y+this._z*r._z+this._w*r._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var r=this.length();return r===0?(this._x=0,this._y=0,this._z=0,this._w=1):(r=1/r,this._x=this._x*r,this._y=this._y*r,this._z=this._z*r,this._w=this._w*r),this.onChangeCallback(),this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(r,e)):this.multiplyQuaternions(this,r)},premultiply:function(r){return this.multiplyQuaternions(r,this)},multiplyQuaternions:function(r,e){var t=r._x,i=r._y,n=r._z,a=r._w,o=e._x,s=e._y,l=e._z,u=e._w;return this._x=t*u+a*o+i*l-n*s,this._y=i*u+a*s+n*o-t*l,this._z=n*u+a*l+t*s-i*o,this._w=a*u-t*o-i*s-n*l,this.onChangeCallback(),this},slerp:function(r,e){if(e===0)return this;if(e===1)return this.copy(r);var t=this._x,i=this._y,n=this._z,a=this._w,o=a*r._w+t*r._x+i*r._y+n*r._z;if(o<0?(this._w=-r._w,this._x=-r._x,this._y=-r._y,this._z=-r._z,o=-o):this.copy(r),o>=1)return this._w=a,this._x=t,this._y=i,this._z=n,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(t+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z),this;var l=Math.atan2(s,o),u=Math.sin((1-e)*l)/s,c=Math.sin(e*l)/s;return this._w=a*u+this._w*c,this._x=t*u+this._x*c,this._y=i*u+this._y*c,this._z=n*u+this._z*c,this.onChangeCallback(),this},equals:function(r){return r._x===this._x&&r._y===this._y&&r._z===this._z&&r._w===this._w},fromArray:function(r,e){return e===void 0&&(e=0),this._x=r[e],this._y=r[e+1],this._z=r[e+2],this._w=r[e+3],this.onChangeCallback(),this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this._x,r[e+1]=this._y,r[e+2]=this._z,r[e+3]=this._w,r},onChange:function(r){return this.onChangeCallback=r,this},onChangeCallback:function(){}};Object.assign(on,{slerp:function(r,e,t,i){return t.copy(r).slerp(e,i)},slerpFlat:function(r,e,t,i,n,a,o){var s=t[i+0],l=t[i+1],u=t[i+2],c=t[i+3],f=n[a+0],h=n[a+1],p=n[a+2],d=n[a+3];if(c!==d||s!==f||l!==h||u!==p){var g=1-o,m=s*f+l*h+u*p+c*d,v=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){var y=Math.sqrt(_),x=Math.atan2(y,m*v);g=Math.sin(g*x)/y,o=Math.sin(o*x)/y}var M=o*v;if(s=s*g+f*M,l=l*g+h*M,u=u*g+p*M,c=c*g+d*M,g===1-o){var S=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=S,l*=S,u*=S,c*=S}}r[e]=s,r[e+1]=l,r[e+2]=u,r[e+3]=c}});oe.prototype={constructor:oe,isVector3:!0,set:function(r,e,t){return this.x=r,this.y=e,this.z=t,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(r,e)):(this.x*=r.x,this.y*=r.y,this.z*=r.z,this)},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(r,e){return this.x=r.x*e.x,this.y=r.y*e.y,this.z=r.z*e.z,this},applyEuler:function(){var r;return function(t){return(t&&t.isEuler)===!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),r===void 0&&(r=new on),this.applyQuaternion(r.setFromEuler(t))}}(),applyAxisAngle:function(){var r;return function(t,i){return r===void 0&&(r=new on),this.applyQuaternion(r.setFromAxisAngle(t,i))}}(),applyMatrix3:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[3]*t+n[6]*i,this.y=n[1]*e+n[4]*t+n[7]*i,this.z=n[2]*e+n[5]*t+n[8]*i,this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i+n[12],this.y=n[1]*e+n[5]*t+n[9]*i+n[13],this.z=n[2]*e+n[6]*t+n[10]*i+n[14],this},applyProjection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements,a=1/(n[3]*e+n[7]*t+n[11]*i+n[15]);return this.x=(n[0]*e+n[4]*t+n[8]*i+n[12])*a,this.y=(n[1]*e+n[5]*t+n[9]*i+n[13])*a,this.z=(n[2]*e+n[6]*t+n[10]*i+n[14])*a,this},applyQuaternion:function(r){var e=this.x,t=this.y,i=this.z,n=r.x,a=r.y,o=r.z,s=r.w,l=s*e+a*i-o*t,u=s*t+o*e-n*i,c=s*i+n*t-a*e,f=-n*e-a*t-o*i;return this.x=l*s+f*-n+u*-o-c*-a,this.y=u*s+f*-a+c*-n-l*-o,this.z=c*s+f*-o+l*-a-u*-n,this},project:function(){var r;return function(t){return r===void 0&&(r=new qt),r.multiplyMatrices(t.projectionMatrix,r.getInverse(t.matrixWorld)),this.applyProjection(r)}}(),unproject:function(){var r;return function(t){return r===void 0&&(r=new qt),r.multiplyMatrices(t.matrixWorld,r.getInverse(t.projectionMatrix)),this.applyProjection(r)}}(),transformDirection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i,this.y=n[1]*e+n[5]*t+n[9]*i,this.z=n[2]*e+n[6]*t+n[10]*i,this.normalize()},divide:function(r){return this.x/=r.x,this.y/=r.y,this.z/=r.z,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this.z=Math.min(this.z,r.z),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this.z=Math.max(this.z,r.z),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this.z=Math.max(r.z,Math.min(e.z,this.z)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new oe,e=new oe),r.set(i,i,i),e.set(n,n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(r){return this.x*r.x+this.y*r.y+this.z*r.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this.z+=(r.z-this.z)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},cross:function(r,e){if(e!==void 0)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(r,e);var t=this.x,i=this.y,n=this.z;return this.x=i*r.z-n*r.y,this.y=n*r.x-t*r.z,this.z=t*r.y-i*r.x,this},crossVectors:function(r,e){var t=r.x,i=r.y,n=r.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-n*o,this.y=n*a-t*s,this.z=t*o-i*a,this},projectOnVector:function(r){var e=r.dot(this)/r.lengthSq();return this.copy(r).multiplyScalar(e)},projectOnPlane:function(){var r;return function(t){return r===void 0&&(r=new oe),r.copy(this).projectOnVector(t),this.sub(r)}}(),reflect:function(){var r;return function(t){return r===void 0&&(r=new oe),this.sub(r.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(r){var e=this.dot(r)/Math.sqrt(this.lengthSq()*r.lengthSq());return Math.acos(cr.clamp(e,-1,1))},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y,i=this.z-r.z;return e*e+t*t+i*i},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)+Math.abs(this.z-r.z)},setFromSpherical:function(r){var e=Math.sin(r.phi)*r.radius;return this.x=e*Math.sin(r.theta),this.y=Math.cos(r.phi)*r.radius,this.z=e*Math.cos(r.theta),this},setFromCylindrical:function(r){return this.x=r.radius*Math.sin(r.theta),this.y=r.y,this.z=r.radius*Math.cos(r.theta),this},setFromMatrixPosition:function(r){return this.setFromMatrixColumn(r,3)},setFromMatrixScale:function(r){var e=this.setFromMatrixColumn(r,0).length(),t=this.setFromMatrixColumn(r,1).length(),i=this.setFromMatrixColumn(r,2).length();return this.x=e,this.y=t,this.z=i,this},setFromMatrixColumn:function(r,e){if(typeof r=="number"){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var t=r;r=e,e=t}return this.fromArray(r.elements,e*4)},equals:function(r){return r.x===this.x&&r.y===this.y&&r.z===this.z},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this.z=r[e+2],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r[e+2]=this.z,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this.z=r.getZ(e),this}};qt.prototype={constructor:qt,isMatrix4:!0,set:function(r,e,t,i,n,a,o,s,l,u,c,f,h,p,d,g){var m=this.elements;return m[0]=r,m[4]=e,m[8]=t,m[12]=i,m[1]=n,m[5]=a,m[9]=o,m[13]=s,m[2]=l,m[6]=u,m[10]=c,m[14]=f,m[3]=h,m[7]=p,m[11]=d,m[15]=g,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return new qt().fromArray(this.elements)},copy:function(r){return this.elements.set(r.elements),this},copyPosition:function(r){var e=this.elements,t=r.elements;return e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(r,e,t){return r.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),t.setFromMatrixColumn(this,2),this},makeBasis:function(r,e,t){return this.set(r.x,e.x,t.x,0,r.y,e.y,t.y,0,r.z,e.z,t.z,0,0,0,0,1),this},extractRotation:function(){var r;return function(t){r===void 0&&(r=new oe);var i=this.elements,n=t.elements,a=1/r.setFromMatrixColumn(t,0).length(),o=1/r.setFromMatrixColumn(t,1).length(),s=1/r.setFromMatrixColumn(t,2).length();return i[0]=n[0]*a,i[1]=n[1]*a,i[2]=n[2]*a,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[8]=n[8]*s,i[9]=n[9]*s,i[10]=n[10]*s,this}}(),makeRotationFromEuler:function(r){(r&&r.isEuler)===!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,t=r.x,i=r.y,n=r.z,a=Math.cos(t),o=Math.sin(t),s=Math.cos(i),l=Math.sin(i),u=Math.cos(n),c=Math.sin(n);if(r.order==="XYZ"){var f=a*u,h=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=-s*c,e[8]=l,e[1]=h+p*l,e[5]=f-d*l,e[9]=-o*s,e[2]=d-f*l,e[6]=p+h*l,e[10]=a*s}else if(r.order==="YXZ"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g+_*o,e[4]=v*o-m,e[8]=a*l,e[1]=a*c,e[5]=a*u,e[9]=-o,e[2]=m*o-v,e[6]=_+g*o,e[10]=a*s}else if(r.order==="ZXY"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g-_*o,e[4]=-a*c,e[8]=v+m*o,e[1]=m+v*o,e[5]=a*u,e[9]=_-g*o,e[2]=-a*l,e[6]=o,e[10]=a*s}else if(r.order==="ZYX"){var f=a*u,h=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=p*l-h,e[8]=f*l+d,e[1]=s*c,e[5]=d*l+f,e[9]=h*l-p,e[2]=-l,e[6]=o*s,e[10]=a*s}else if(r.order==="YZX"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=S-y*c,e[8]=M*c+x,e[1]=c,e[5]=a*u,e[9]=-o*u,e[2]=-l*u,e[6]=x*c+M,e[10]=y-S*c}else if(r.order==="XZY"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=-c,e[8]=l*u,e[1]=y*c+S,e[5]=a*u,e[9]=x*c-M,e[2]=M*c-x,e[6]=o*u,e[10]=S*c+y}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(r){var e=this.elements,t=r.x,i=r.y,n=r.z,a=r.w,o=t+t,s=i+i,l=n+n,u=t*o,c=t*s,f=t*l,h=i*s,p=i*l,d=n*l,g=a*o,m=a*s,v=a*l;return e[0]=1-(h+d),e[4]=c-v,e[8]=f+m,e[1]=c+v,e[5]=1-(u+d),e[9]=p-g,e[2]=f-m,e[6]=p+g,e[10]=1-(u+h),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var r,e,t;return function(n,a,o){r===void 0&&(r=new oe,e=new oe,t=new oe);var s=this.elements;return t.subVectors(n,a).normalize(),t.lengthSq()===0&&(t.z=1),r.crossVectors(o,t).normalize(),r.lengthSq()===0&&(t.z+=1e-4,r.crossVectors(o,t).normalize()),e.crossVectors(t,r),s[0]=r.x,s[4]=e.x,s[8]=t.x,s[1]=r.y,s[5]=e.y,s[9]=t.y,s[2]=r.z,s[6]=e.z,s[10]=t.z,this}}(),multiply:function(r,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(r,e)):this.multiplyMatrices(this,r)},premultiply:function(r){return this.multiplyMatrices(r,this)},multiplyMatrices:function(r,e){var t=r.elements,i=e.elements,n=this.elements,a=t[0],o=t[4],s=t[8],l=t[12],u=t[1],c=t[5],f=t[9],h=t[13],p=t[2],d=t[6],g=t[10],m=t[14],v=t[3],_=t[7],y=t[11],x=t[15],M=i[0],S=i[4],w=i[8],T=i[12],C=i[1],b=i[5],E=i[9],I=i[13],R=i[2],A=i[6],D=i[10],U=i[14],B=i[3],z=i[7],k=i[11],G=i[15];return n[0]=a*M+o*C+s*R+l*B,n[4]=a*S+o*b+s*A+l*z,n[8]=a*w+o*E+s*D+l*k,n[12]=a*T+o*I+s*U+l*G,n[1]=u*M+c*C+f*R+h*B,n[5]=u*S+c*b+f*A+h*z,n[9]=u*w+c*E+f*D+h*k,n[13]=u*T+c*I+f*U+h*G,n[2]=p*M+d*C+g*R+m*B,n[6]=p*S+d*b+g*A+m*z,n[10]=p*w+d*E+g*D+m*k,n[14]=p*T+d*I+g*U+m*G,n[3]=v*M+_*C+y*R+x*B,n[7]=v*S+_*b+y*A+x*z,n[11]=v*w+_*E+y*D+x*k,n[15]=v*T+_*I+y*U+x*G,this},multiplyToArray:function(r,e,t){var i=this.elements;return this.multiplyMatrices(r,e),t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},multiplyScalar:function(r){var e=this.elements;return e[0]*=r,e[4]*=r,e[8]*=r,e[12]*=r,e[1]*=r,e[5]*=r,e[9]*=r,e[13]*=r,e[2]*=r,e[6]*=r,e[10]*=r,e[14]*=r,e[3]*=r,e[7]*=r,e[11]*=r,e[15]*=r,this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a 0.0 ) { #if defined ( PHYSICALLY_CORRECT_LIGHTS ) float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); @@ -283,7 +283,7 @@ float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { float BlinnExponentToGGXRoughness( const in float blinnExponent ) { return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); } -`,UAe=`#ifdef USE_BUMPMAP +`,zAe=`#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { @@ -305,7 +305,7 @@ float BlinnExponentToGGXRoughness( const in float blinnExponent ) { return normalize( abs( fDet ) * surf_norm - vGrad ); } #endif -`,OAe=`#if NUM_CLIPPING_PLANES > 0 +`,FAe=`#if NUM_CLIPPING_PLANES > 0 for ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) { vec4 plane = clippingPlanes[ i ]; if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard; @@ -321,28 +321,28 @@ float BlinnExponentToGGXRoughness( const in float blinnExponent ) { #endif #endif -`,FAe=`#if NUM_CLIPPING_PLANES > 0 +`,BAe=`#if NUM_CLIPPING_PLANES > 0 #if ! defined( PHYSICAL ) && ! defined( PHONG ) varying vec3 vViewPosition; #endif uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif -`,zAe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) +`,kAe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) varying vec3 vViewPosition; #endif -`,BAe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) +`,VAe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) vViewPosition = - mvPosition.xyz; #endif -`,kAe=`#ifdef USE_COLOR +`,GAe=`#ifdef USE_COLOR diffuseColor.rgb *= vColor; -#endif`,VAe=`#ifdef USE_COLOR +#endif`,HAe=`#ifdef USE_COLOR varying vec3 vColor; #endif -`,GAe=`#ifdef USE_COLOR +`,WAe=`#ifdef USE_COLOR varying vec3 vColor; -#endif`,HAe=`#ifdef USE_COLOR +#endif`,XAe=`#ifdef USE_COLOR vColor.xyz = color.xyz; -#endif`,WAe=`#define PI 3.14159265359 +#endif`,YAe=`#define PI 3.14159265359 #define PI2 6.28318530718 #define PI_HALF 1.5707963267949 #define RECIPROCAL_PI 0.31830988618 @@ -399,7 +399,7 @@ mat3 transpose( const in mat3 v ) { tmp[2] = vec3(v[0].z, v[1].z, v[2].z); return tmp; } -`,XAe=`#ifdef ENVMAP_TYPE_CUBE_UV +`,qAe=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_textureSize (1024.0) int getFaceFromDirection(vec3 direction) { vec3 absDirection = abs(direction); @@ -503,28 +503,28 @@ vec4 textureCubeUV(vec3 reflectedDirection, float roughness ) { return vec4(result.rgb, 1.0); } #endif -`,YAe=`#ifdef FLIP_SIDED +`,ZAe=`#ifdef FLIP_SIDED objectNormal = -objectNormal; #endif vec3 transformedNormal = normalMatrix * objectNormal; -`,qAe=`#ifdef USE_DISPLACEMENTMAP +`,jAe=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif -`,ZAe=`#ifdef USE_DISPLACEMENTMAP +`,KAe=`#ifdef USE_DISPLACEMENTMAP transformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias ); #endif -`,jAe=`#ifdef USE_EMISSIVEMAP +`,JAe=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; totalEmissiveRadiance *= emissiveColor.rgb; #endif -`,KAe=`#ifdef USE_EMISSIVEMAP +`,$Ae=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif -`,JAe=` gl_FragColor = linearToOutputTexel( gl_FragColor ); -`,$Ae=` +`,QAe=` gl_FragColor = linearToOutputTexel( gl_FragColor ); +`,eCe=` vec4 LinearToLinear( in vec4 value ) { return value; } @@ -587,7 +587,7 @@ vec4 LogLuvToLinear( in vec4 value ) { vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM; return vec4( max(vRGB, 0.0), 1.0 ); } -`,QAe=`#ifdef USE_ENVMAP +`,tCe=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition ); vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -621,7 +621,7 @@ vec4 LogLuvToLinear( in vec4 value ) { outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif -`,eCe=`#if defined( USE_ENVMAP ) || defined( PHYSICAL ) +`,rCe=`#if defined( USE_ENVMAP ) || defined( PHYSICAL ) uniform float reflectivity; uniform float envMapIntensity; #endif @@ -641,7 +641,7 @@ vec4 LogLuvToLinear( in vec4 value ) { varying vec3 vReflect; #endif #endif -`,tCe=`#ifdef USE_ENVMAP +`,iCe=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) varying vec3 vWorldPosition; #else @@ -649,7 +649,7 @@ vec4 LogLuvToLinear( in vec4 value ) { uniform float refractionRatio; #endif #endif -`,rCe=`#ifdef USE_ENVMAP +`,nCe=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) vWorldPosition = worldPosition.xyz; #else @@ -662,7 +662,7 @@ vec4 LogLuvToLinear( in vec4 value ) { #endif #endif #endif -`,iCe=`#ifdef USE_FOG +`,aCe=`#ifdef USE_FOG #ifdef USE_LOGDEPTHBUF_EXT float depth = gl_FragDepthEXT / gl_FragCoord.w; #else @@ -675,7 +675,7 @@ vec4 LogLuvToLinear( in vec4 value ) { #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif -`,nCe=`#ifdef USE_FOG +`,oCe=`#ifdef USE_FOG uniform vec3 fogColor; #ifdef FOG_EXP2 uniform float fogDensity; @@ -683,7 +683,7 @@ vec4 LogLuvToLinear( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,aCe=`#ifdef TOON +#endif`,sCe=`#ifdef TOON uniform sampler2D gradientMap; vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); @@ -695,13 +695,13 @@ vec4 LogLuvToLinear( in vec4 value ) { #endif } #endif -`,oCe=`#ifdef USE_LIGHTMAP +`,lCe=`#ifdef USE_LIGHTMAP reflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; #endif -`,sCe=`#ifdef USE_LIGHTMAP +`,uCe=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,lCe=`vec3 diffuse = vec3( 1.0 ); +#endif`,cCe=`vec3 diffuse = vec3( 1.0 ); GeometricContext geometry; geometry.position = mvPosition.xyz; geometry.normal = normalize( transformedNormal ); @@ -762,7 +762,7 @@ vec3 directLightColor_Diffuse; #endif } #endif -`,uCe=`uniform vec3 ambientLightColor; +`,fCe=`uniform vec3 ambientLightColor; vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; #ifndef PHYSICALLY_CORRECT_LIGHTS @@ -930,12 +930,12 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { return envMapColor.rgb * envMapIntensity; } #endif -`,cCe=`BlinnPhongMaterial material; +`,hCe=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength; -`,fCe=`varying vec3 vViewPosition; +`,pCe=`varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif @@ -983,7 +983,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in Geometric #define RE_Direct_RectArea RE_Direct_RectArea_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong #define Material_LightProbeLOD( material ) (0) -`,hCe=`PhysicalMaterial material; +`,dCe=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 ); #ifdef STANDARD @@ -992,7 +992,7 @@ material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 ); material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor ); material.clearCoat = saturate( clearCoat ); material.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 ); #endif -`,pCe=`struct PhysicalMaterial { +`,mCe=`struct PhysicalMaterial { vec3 diffuseColor; float specularRoughness; vec3 specularColor; @@ -1066,7 +1066,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCo float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); } -`,dCe=` +`,vCe=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; @@ -1141,20 +1141,20 @@ IncidentLight directLight; RE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight ); #endif -`,mCe=`#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT) +`,gCe=`#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT) gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5; -#endif`,vCe=`#ifdef USE_LOGDEPTHBUF +#endif`,yCe=`#ifdef USE_LOGDEPTHBUF uniform float logDepthBufFC; #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; #endif #endif -`,gCe=`#ifdef USE_LOGDEPTHBUF +`,_Ce=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; #endif uniform float logDepthBufFC; -#endif`,yCe=`#ifdef USE_LOGDEPTHBUF +#endif`,xCe=`#ifdef USE_LOGDEPTHBUF gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC; #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; @@ -1162,42 +1162,42 @@ IncidentLight directLight; gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w; #endif #endif -`,_Ce=`#ifdef USE_MAP +`,SCe=`#ifdef USE_MAP vec4 texelColor = texture2D( map, vUv ); texelColor = mapTexelToLinear( texelColor ); diffuseColor *= texelColor; #endif -`,xCe=`#ifdef USE_MAP +`,MCe=`#ifdef USE_MAP uniform sampler2D map; #endif -`,SCe=`#ifdef USE_MAP +`,bCe=`#ifdef USE_MAP vec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy ); diffuseColor *= mapTexelToLinear( mapTexel ); #endif -`,MCe=`#ifdef USE_MAP +`,wCe=`#ifdef USE_MAP uniform vec4 offsetRepeat; uniform sampler2D map; #endif -`,bCe=`float metalnessFactor = metalness; +`,TCe=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.r; #endif -`,wCe=`#ifdef USE_METALNESSMAP +`,ECe=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,TCe=`#ifdef USE_MORPHNORMALS +#endif`,ACe=`#ifdef USE_MORPHNORMALS objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ]; objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ]; objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ]; objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ]; #endif -`,ECe=`#ifdef USE_MORPHTARGETS +`,CCe=`#ifdef USE_MORPHTARGETS #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif -#endif`,ACe=`#ifdef USE_MORPHTARGETS +#endif`,RCe=`#ifdef USE_MORPHTARGETS transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ]; transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ]; transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ]; @@ -1209,12 +1209,12 @@ IncidentLight directLight; transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ]; #endif #endif -`,CCe=`#ifdef DOUBLE_SIDED +`,LCe=`#ifdef DOUBLE_SIDED float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 ); #else float flipNormal = 1.0; #endif -`,RCe=`#ifdef FLAT_SHADED +`,PCe=`#ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); vec3 normal = normalize( cross( fdx, fdy ) ); @@ -1226,7 +1226,7 @@ IncidentLight directLight; #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() ); #endif -`,LCe=`#ifdef USE_NORMALMAP +`,DCe=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) { @@ -1243,7 +1243,7 @@ IncidentLight directLight; return normalize( tsn * mapN ); } #endif -`,PCe=`vec3 packNormalToRGB( const in vec3 normal ) { +`,ICe=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1272,23 +1272,23 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); } -`,DCe=`#ifdef PREMULTIPLIED_ALPHA +`,NCe=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif -`,ICe=`#ifdef USE_SKINNING +`,UCe=`#ifdef USE_SKINNING vec4 mvPosition = modelViewMatrix * skinned; #else vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 ); #endif gl_Position = projectionMatrix * mvPosition; -`,NCe=`float roughnessFactor = roughness; +`,OCe=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.r; #endif -`,UCe=`#ifdef USE_ROUGHNESSMAP +`,zCe=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,OCe=`#ifdef USE_SHADOWMAP +#endif`,FCe=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHTS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ]; @@ -1412,7 +1412,7 @@ gl_Position = projectionMatrix * mvPosition; #endif } #endif -`,FCe=`#ifdef USE_SHADOWMAP +`,BCe=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHTS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ]; @@ -1428,7 +1428,7 @@ gl_Position = projectionMatrix * mvPosition; #if NUM_RECT_AREA_LIGHTS > 0 #endif #endif -`,zCe=`#ifdef USE_SHADOWMAP +`,kCe=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHTS > 0 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition; @@ -1447,7 +1447,7 @@ gl_Position = projectionMatrix * mvPosition; #if NUM_RECT_AREA_LIGHTS > 0 #endif #endif -`,BCe=`float getShadowMask() { +`,VCe=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHTS > 0 @@ -1476,12 +1476,12 @@ gl_Position = projectionMatrix * mvPosition; #endif return shadow; } -`,kCe=`#ifdef USE_SKINNING +`,GCe=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,VCe=`#ifdef USE_SKINNING +#endif`,HCe=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; #ifdef BONE_TEXTURE @@ -1510,7 +1510,7 @@ gl_Position = projectionMatrix * mvPosition; } #endif #endif -`,GCe=`#ifdef USE_SKINNING +`,WCe=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -1519,7 +1519,7 @@ gl_Position = projectionMatrix * mvPosition; skinned += boneMatW * skinVertex * skinWeight.w; skinned = bindMatrixInverse * skinned; #endif -`,HCe=`#ifdef USE_SKINNING +`,XCe=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -1528,18 +1528,18 @@ gl_Position = projectionMatrix * mvPosition; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #endif -`,WCe=`float specularStrength; +`,YCe=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,XCe=`#ifdef USE_SPECULARMAP +#endif`,qCe=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,YCe=`#if defined( TONE_MAPPING ) +#endif`,ZCe=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif -`,qCe=`#define saturate(a) clamp( a, 0.0, 1.0 ) +`,jCe=`#define saturate(a) clamp( a, 0.0, 1.0 ) uniform float toneMappingExposure; uniform float toneMappingWhitePoint; vec3 LinearToneMapping( vec3 color ) { @@ -1559,29 +1559,29 @@ vec3 OptimizedCineonToneMapping( vec3 color ) { color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } -`,ZCe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) +`,KCe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) varying vec2 vUv; -#endif`,jCe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) +#endif`,JCe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) varying vec2 vUv; uniform vec4 offsetRepeat; #endif -`,KCe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) +`,$Ce=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) vUv = uv * offsetRepeat.zw + offsetRepeat.xy; -#endif`,JCe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,QCe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; -#endif`,$Ce=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,eRe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; -#endif`,QCe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,tRe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = uv2; -#endif`,eRe=`#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP ) +#endif`,rRe=`#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP ) #ifdef USE_SKINNING vec4 worldPosition = modelMatrix * skinned; #else vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 ); #endif #endif -`,tRe=`uniform samplerCube tCube; +`,iRe=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldPosition; @@ -1590,14 +1590,14 @@ void main() { gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) ); gl_FragColor.a *= opacity; } -`,rRe=`varying vec3 vWorldPosition; +`,nRe=`varying vec3 vWorldPosition; #include void main() { vWorldPosition = transformDirection( position, modelMatrix ); #include #include } -`,iRe=`#if DEPTH_PACKING == 3200 +`,aRe=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -1623,7 +1623,7 @@ void main() { gl_FragColor = packDepthToRGBA( gl_FragCoord.z ); #endif } -`,nRe=`#include +`,oRe=`#include #include #include #include @@ -1641,7 +1641,7 @@ void main() { #include #include } -`,aRe=`uniform vec3 lightPos; +`,sRe=`uniform vec3 lightPos; varying vec4 vWorldPosition; #include #include @@ -1650,7 +1650,7 @@ void main () { #include gl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 ); } -`,oRe=`varying vec4 vWorldPosition; +`,lRe=`varying vec4 vWorldPosition; #include #include #include @@ -1665,7 +1665,7 @@ void main() { #include vWorldPosition = worldPosition; } -`,sRe=`uniform sampler2D tEquirect; +`,uRe=`uniform sampler2D tEquirect; uniform float tFlip; varying vec3 vWorldPosition; #include @@ -1676,14 +1676,14 @@ void main() { sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5; gl_FragColor = texture2D( tEquirect, sampleUV ); } -`,lRe=`varying vec3 vWorldPosition; +`,cRe=`varying vec3 vWorldPosition; #include void main() { vWorldPosition = transformDirection( position, modelMatrix ); #include #include } -`,uRe=`uniform vec3 diffuse; +`,fRe=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -1709,7 +1709,7 @@ void main() { #include #include } -`,cRe=`uniform float scale; +`,hRe=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -1724,7 +1724,7 @@ void main() { #include #include } -`,fRe=`uniform vec3 diffuse; +`,pRe=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -1768,7 +1768,7 @@ void main() { #include #include } -`,hRe=`#include +`,dRe=`#include #include #include #include @@ -1797,7 +1797,7 @@ void main() { #include #include } -`,pRe=`uniform vec3 diffuse; +`,mRe=`uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; varying vec3 vLightFront; @@ -1854,7 +1854,7 @@ void main() { #include #include } -`,dRe=`#define LAMBERT +`,vRe=`#define LAMBERT varying vec3 vLightFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; @@ -1891,7 +1891,7 @@ void main() { #include #include } -`,mRe=`#define PHONG +`,gRe=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -1944,7 +1944,7 @@ void main() { #include #include } -`,vRe=`#define PHONG +`,yRe=`#define PHONG varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -1984,7 +1984,7 @@ void main() { #include #include } -`,gRe=`#define PHYSICAL +`,_Re=`#define PHYSICAL uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; @@ -2047,7 +2047,7 @@ void main() { #include #include } -`,yRe=`#define PHYSICAL +`,xRe=`#define PHYSICAL varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2086,7 +2086,7 @@ void main() { #include #include } -`,_Re=`#define NORMAL +`,SRe=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) varying vec3 vViewPosition; @@ -2107,7 +2107,7 @@ void main() { #include #include } -`,xRe=`#define NORMAL +`,MRe=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) varying vec3 vViewPosition; #endif @@ -2139,7 +2139,7 @@ void main() { vViewPosition = - mvPosition.xyz; #endif } -`,SRe=`uniform vec3 diffuse; +`,bRe=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -2164,7 +2164,7 @@ void main() { #include #include } -`,MRe=`uniform float size; +`,wRe=`uniform float size; uniform float scale; #include #include @@ -2185,7 +2185,7 @@ void main() { #include #include } -`,bRe=`uniform float opacity; +`,TRe=`uniform float opacity; #include #include #include @@ -2195,60 +2195,60 @@ void main() { void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) ); } -`,wRe=`#include +`,ERe=`#include void main() { #include #include #include #include } -`,Xr={alphamap_fragment:AAe,alphamap_pars_fragment:CAe,alphatest_fragment:RAe,aomap_fragment:LAe,aomap_pars_fragment:PAe,begin_vertex:DAe,beginnormal_vertex:IAe,bsdfs:NAe,bumpmap_pars_fragment:UAe,clipping_planes_fragment:OAe,clipping_planes_pars_fragment:FAe,clipping_planes_pars_vertex:zAe,clipping_planes_vertex:BAe,color_fragment:kAe,color_pars_fragment:VAe,color_pars_vertex:GAe,color_vertex:HAe,common:WAe,cube_uv_reflection_fragment:XAe,defaultnormal_vertex:YAe,displacementmap_pars_vertex:qAe,displacementmap_vertex:ZAe,emissivemap_fragment:jAe,emissivemap_pars_fragment:KAe,encodings_fragment:JAe,encodings_pars_fragment:$Ae,envmap_fragment:QAe,envmap_pars_fragment:eCe,envmap_pars_vertex:tCe,envmap_vertex:rCe,fog_fragment:iCe,fog_pars_fragment:nCe,gradientmap_pars_fragment:aCe,lightmap_fragment:oCe,lightmap_pars_fragment:sCe,lights_lambert_vertex:lCe,lights_pars:uCe,lights_phong_fragment:cCe,lights_phong_pars_fragment:fCe,lights_physical_fragment:hCe,lights_physical_pars_fragment:pCe,lights_template:dCe,logdepthbuf_fragment:mCe,logdepthbuf_pars_fragment:vCe,logdepthbuf_pars_vertex:gCe,logdepthbuf_vertex:yCe,map_fragment:_Ce,map_pars_fragment:xCe,map_particle_fragment:SCe,map_particle_pars_fragment:MCe,metalnessmap_fragment:bCe,metalnessmap_pars_fragment:wCe,morphnormal_vertex:TCe,morphtarget_pars_vertex:ECe,morphtarget_vertex:ACe,normal_flip:CCe,normal_fragment:RCe,normalmap_pars_fragment:LCe,packing:PCe,premultiplied_alpha_fragment:DCe,project_vertex:ICe,roughnessmap_fragment:NCe,roughnessmap_pars_fragment:UCe,shadowmap_pars_fragment:OCe,shadowmap_pars_vertex:FCe,shadowmap_vertex:zCe,shadowmask_pars_fragment:BCe,skinbase_vertex:kCe,skinning_pars_vertex:VCe,skinning_vertex:GCe,skinnormal_vertex:HCe,specularmap_fragment:WCe,specularmap_pars_fragment:XCe,tonemapping_fragment:YCe,tonemapping_pars_fragment:qCe,uv_pars_fragment:ZCe,uv_pars_vertex:jCe,uv_vertex:KCe,uv2_pars_fragment:JCe,uv2_pars_vertex:$Ce,uv2_vertex:QCe,worldpos_vertex:eRe,cube_frag:tRe,cube_vert:rRe,depth_frag:iRe,depth_vert:nRe,distanceRGBA_frag:aRe,distanceRGBA_vert:oRe,equirect_frag:sRe,equirect_vert:lRe,linedashed_frag:uRe,linedashed_vert:cRe,meshbasic_frag:fRe,meshbasic_vert:hRe,meshlambert_frag:pRe,meshlambert_vert:dRe,meshphong_frag:mRe,meshphong_vert:vRe,meshphysical_frag:gRe,meshphysical_vert:yRe,normal_frag:_Re,normal_vert:xRe,points_frag:SRe,points_vert:MRe,shadow_frag:bRe,shadow_vert:wRe};Gt.prototype={constructor:Gt,isColor:!0,r:1,g:1,b:1,set:function(r){return r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r),this},setScalar:function(r){return this.r=r,this.g=r,this.b=r,this},setHex:function(r){return r=Math.floor(r),this.r=(r>>16&255)/255,this.g=(r>>8&255)/255,this.b=(r&255)/255,this},setRGB:function(r,e,t){return this.r=r,this.g=e,this.b=t,this},setHSL:function(){function r(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*6*(2/3-i):e}return function(t,i,n){if(t=cr.euclideanModulo(t,1),i=cr.clamp(i,0,1),n=cr.clamp(n,0,1),i===0)this.r=this.g=this.b=n;else{var a=n<=.5?n*(1+i):n+i-n*i,o=2*n-a;this.r=r(o,a,t+1/3),this.g=r(o,a,t),this.b=r(o,a,t-1/3)}return this}}(),setStyle:function(r){function e(f){f!==void 0&&parseFloat(f)<1&&console.warn("THREE.Color: Alpha component of "+r+" will be ignored.")}var t;if(t=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(r)){var i,n=t[1],a=t[2];switch(n){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(o,s,l)}break}}else if(t=/^\#([A-Fa-f0-9]+)$/.exec(r)){var u=t[1],c=u.length;if(c===3)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(c===6)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}if(r&&r.length>0){var u=TRe[r];u!==void 0?this.setHex(u):console.warn("THREE.Color: Unknown color "+r)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(r){return this.r=r.r,this.g=r.g,this.b=r.b,this},copyGammaToLinear:function(r,e){return e===void 0&&(e=2),this.r=Math.pow(r.r,e),this.g=Math.pow(r.g,e),this.b=Math.pow(r.b,e),this},copyLinearToGamma:function(r,e){e===void 0&&(e=2);var t=e>0?1/e:1;return this.r=Math.pow(r.r,t),this.g=Math.pow(r.g,t),this.b=Math.pow(r.b,t),this},convertGammaToLinear:function(){var r=this.r,e=this.g,t=this.b;return this.r=r*r,this.g=e*e,this.b=t*t,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(r){var e=r||{h:0,s:0,l:0},t=this.r,i=this.g,n=this.b,a=Math.max(t,i,n),o=Math.min(t,i,n),s,l,u=(o+a)/2;if(o===a)s=0,l=0;else{var c=a-o;switch(l=u<=.5?c/(a+o):c/(2-a-o),a){case t:s=(i-n)/c+(ithis.max.x||r.ythis.max.y)},containsBox:function(r){return this.min.x<=r.min.x&&r.max.x<=this.max.x&&this.min.y<=r.min.y&&r.max.y<=this.max.y},getParameter:function(r,e){var t=e||new St;return t.set((r.x-this.min.x)/(this.max.x-this.min.x),(r.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(r){return!(r.max.xthis.max.x||r.max.ythis.max.y)},clampPoint:function(r,e){var t=e||new St;return t.copy(r).clamp(this.min,this.max)},distanceToPoint:function(){var r=new St;return function(t){var i=r.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(r){return this.min.max(r.min),this.max.min(r.max),this},union:function(r){return this.min.min(r.min),this.max.max(r.max),this},translate:function(r){return this.min.add(r),this.max.add(r),this},equals:function(r){return r.min.equals(this.min)&&r.max.equals(this.max)}};CRe=0;mr.prototype={constructor:mr,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(r){r===!0&&this.update(),this._needsUpdate=r},setValues:function(r){if(r!==void 0)for(var e in r){var t=r[e];if(t===void 0){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}var i=this[e];if(i===void 0){console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.");continue}i&&i.isColor?i.set(t):i&&i.isVector3&&t&&t.isVector3?i.copy(t):e==="overdraw"?this[e]=Number(t):this[e]=t}},toJSON:function(r){var e=r===void 0;e&&(r={textures:{},images:{}});var t={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),this.roughness!==void 0&&(t.roughness=this.roughness),this.metalness!==void 0&&(t.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),this.shininess!==void 0&&(t.shininess=this.shininess),this.clearCoat!==void 0&&(t.clearCoat=this.clearCoat),this.clearCoatRoughness!==void 0&&(t.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(r).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(r).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(r).uuid),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(r).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(r).uuid,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(r).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(r).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(r).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(r).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(r).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(r).uuid,t.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(r).uuid),this.size!==void 0&&(t.size=this.size),this.sizeAttenuation!==void 0&&(t.sizeAttenuation=this.sizeAttenuation),this.blending!==Uy&&(t.blending=this.blending),this.shading!==Oz&&(t.shading=this.shading),this.side!==Zg&&(t.side=this.side),this.vertexColors!==yC&&(t.vertexColors=this.vertexColors),this.opacity<1&&(t.opacity=this.opacity),this.transparent===!0&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,this.alphaTest>0&&(t.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(t.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(t.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(t.wireframeLinejoin=this.wireframeLinejoin),t.skinning=this.skinning,t.morphTargets=this.morphTargets;function i(o){var s=[];for(var l in o){var u=o[l];delete u.metadata,s.push(u)}return s}if(e){var n=i(r.textures),a=i(r.images);n.length>0&&(t.textures=n),a.length>0&&(t.images=a)}return t},clone:function(){return new this.constructor().copy(this)},copy:function(r){this.name=r.name,this.fog=r.fog,this.lights=r.lights,this.blending=r.blending,this.side=r.side,this.shading=r.shading,this.vertexColors=r.vertexColors,this.opacity=r.opacity,this.transparent=r.transparent,this.blendSrc=r.blendSrc,this.blendDst=r.blendDst,this.blendEquation=r.blendEquation,this.blendSrcAlpha=r.blendSrcAlpha,this.blendDstAlpha=r.blendDstAlpha,this.blendEquationAlpha=r.blendEquationAlpha,this.depthFunc=r.depthFunc,this.depthTest=r.depthTest,this.depthWrite=r.depthWrite,this.colorWrite=r.colorWrite,this.precision=r.precision,this.polygonOffset=r.polygonOffset,this.polygonOffsetFactor=r.polygonOffsetFactor,this.polygonOffsetUnits=r.polygonOffsetUnits,this.alphaTest=r.alphaTest,this.premultipliedAlpha=r.premultipliedAlpha,this.overdraw=r.overdraw,this.visible=r.visible,this.clipShadows=r.clipShadows,this.clipIntersection=r.clipIntersection;var e=r.clippingPlanes,t=null;if(e!==null){var i=e.length;t=new Array(i);for(var n=0;n!==i;++n)t[n]=e[n].clone()}return this.clippingPlanes=t,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};Object.assign(mr.prototype,Ms.prototype);_a.prototype=Object.create(mr.prototype);_a.prototype.constructor=_a;_a.prototype.isShaderMaterial=!0;_a.prototype.copy=function(r){return mr.prototype.copy.call(this,r),this.fragmentShader=r.fragmentShader,this.vertexShader=r.vertexShader,this.uniforms=eo.clone(r.uniforms),this.defines=r.defines,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.lights=r.lights,this.clipping=r.clipping,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.morphNormals=r.morphNormals,this.extensions=r.extensions,this};_a.prototype.toJSON=function(r){var e=mr.prototype.toJSON.call(this,r);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e};Sh.prototype=Object.create(mr.prototype);Sh.prototype.constructor=Sh;Sh.prototype.isMeshDepthMaterial=!0;Sh.prototype.copy=function(r){return mr.prototype.copy.call(this,r),this.depthPacking=r.depthPacking,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.map=r.map,this.alphaMap=r.alphaMap,this.displacementMap=r.displacementMap,this.displacementScale=r.displacementScale,this.displacementBias=r.displacementBias,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this};lu.prototype={constructor:lu,isBox3:!0,set:function(r,e){return this.min.copy(r),this.max.copy(e),this},setFromArray:function(r){for(var e=1/0,t=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=0,l=r.length;sn&&(n=u),c>a&&(a=c),f>o&&(o=f)}this.min.set(e,t,i),this.max.set(n,a,o)},setFromBufferAttribute:function(r){for(var e=1/0,t=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=0,l=r.count;sn&&(n=u),c>a&&(a=c),f>o&&(o=f)}this.min.set(e,t,i),this.max.set(n,a,o)},setFromPoints:function(r){this.makeEmpty();for(var e=0,t=r.length;ethis.max.x||r.ythis.max.y||r.zthis.max.z)},containsBox:function(r){return this.min.x<=r.min.x&&r.max.x<=this.max.x&&this.min.y<=r.min.y&&r.max.y<=this.max.y&&this.min.z<=r.min.z&&r.max.z<=this.max.z},getParameter:function(r,e){var t=e||new oe;return t.set((r.x-this.min.x)/(this.max.x-this.min.x),(r.y-this.min.y)/(this.max.y-this.min.y),(r.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(r){return!(r.max.xthis.max.x||r.max.ythis.max.y||r.max.zthis.max.z)},intersectsSphere:function(){var r;return function(t){return r===void 0&&(r=new oe),this.clampPoint(t.center,r),r.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(r){var e,t;return r.normal.x>0?(e=r.normal.x*this.min.x,t=r.normal.x*this.max.x):(e=r.normal.x*this.max.x,t=r.normal.x*this.min.x),r.normal.y>0?(e+=r.normal.y*this.min.y,t+=r.normal.y*this.max.y):(e+=r.normal.y*this.max.y,t+=r.normal.y*this.min.y),r.normal.z>0?(e+=r.normal.z*this.min.z,t+=r.normal.z*this.max.z):(e+=r.normal.z*this.max.z,t+=r.normal.z*this.min.z),e<=r.constant&&t>=r.constant},clampPoint:function(r,e){var t=e||new oe;return t.copy(r).clamp(this.min,this.max)},distanceToPoint:function(){var r=new oe;return function(t){var i=r.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var r=new oe;return function(t){var i=t||new $n;return this.getCenter(i.center),i.radius=this.getSize(r).length()*.5,i}}(),intersect:function(r){return this.min.max(r.min),this.max.min(r.max),this.isEmpty()&&this.makeEmpty(),this},union:function(r){return this.min.min(r.min),this.max.max(r.max),this},applyMatrix4:function(){var r=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe];return function(t){return this.isEmpty()?this:(r[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),r[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),r[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),r[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),r[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),r[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),r[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),r[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(r),this)}}(),translate:function(r){return this.min.add(r),this.max.add(r),this},equals:function(r){return r.min.equals(this.min)&&r.max.equals(this.max)}};$n.prototype={constructor:$n,set:function(r,e){return this.center.copy(r),this.radius=e,this},setFromPoints:function(){var r=new lu;return function(t,i){var n=this.center;i!==void 0?n.copy(i):r.setFromPoints(t).getCenter(n);for(var a=0,o=0,s=t.length;othis.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(r){var e=r||new lu;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(r){return this.center.applyMatrix4(r),this.radius=this.radius*r.getMaxScaleOnAxis(),this},translate:function(r){return this.center.add(r),this},equals:function(r){return r.center.equals(this.center)&&r.radius===this.radius}};bs.prototype={constructor:bs,isMatrix3:!0,set:function(r,e,t,i,n,a,o,s,l){var u=this.elements;return u[0]=r,u[1]=i,u[2]=o,u[3]=e,u[4]=n,u[5]=s,u[6]=t,u[7]=a,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return new this.constructor().fromArray(this.elements)},copy:function(r){var e=r.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},setFromMatrix4:function(r){var e=r.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a1))return n.copy(a).multiplyScalar(s).add(t.start)}}(),intersectsLine:function(r){var e=this.distanceToPoint(r.start),t=this.distanceToPoint(r.end);return e<0&&t>0||t<0&&e>0},intersectsBox:function(r){return r.intersectsPlane(this)},intersectsSphere:function(r){return r.intersectsPlane(this)},coplanarPoint:function(r){var e=r||new oe;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var r=new oe,e=new bs;return function(i,n){var a=this.coplanarPoint(r).applyMatrix4(i),o=n||e.getNormalMatrix(i),s=this.normal.applyMatrix3(o).normalize();return this.constant=-a.dot(s),this}}(),translate:function(r){return this.constant=this.constant-r.dot(this.normal),this},equals:function(r){return r.normal.equals(this.normal)&&r.constant===this.constant}};DS.prototype={constructor:DS,set:function(r,e,t,i,n,a){var o=this.planes;return o[0].copy(r),o[1].copy(e),o[2].copy(t),o[3].copy(i),o[4].copy(n),o[5].copy(a),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){for(var e=this.planes,t=0;t<6;t++)e[t].copy(r.planes[t]);return this},setFromMatrix:function(r){var e=this.planes,t=r.elements,i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],h=t[9],p=t[10],d=t[11],g=t[12],m=t[13],v=t[14],_=t[15];return e[0].setComponents(o-i,c-s,d-f,_-g).normalize(),e[1].setComponents(o+i,c+s,d+f,_+g).normalize(),e[2].setComponents(o+n,c+l,d+h,_+m).normalize(),e[3].setComponents(o-n,c-l,d-h,_-m).normalize(),e[4].setComponents(o-a,c-u,d-p,_-v).normalize(),e[5].setComponents(o+a,c+u,d+p,_+v).normalize(),this},intersectsObject:function(){var r=new $n;return function(t){var i=t.geometry;return i.boundingSphere===null&&i.computeBoundingSphere(),r.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSprite:function(){var r=new $n;return function(t){return r.center.set(0,0,0),r.radius=.7071067811865476,r.applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSphere:function(r){for(var e=this.planes,t=r.center,i=-r.radius,n=0;n<6;n++){var a=e[n].distanceToPoint(t);if(a0?i.min.x:i.max.x,e.x=o.normal.x>0?i.max.x:i.min.x,r.y=o.normal.y>0?i.min.y:i.max.y,e.y=o.normal.y>0?i.max.y:i.min.y,r.z=o.normal.z>0?i.min.z:i.max.z,e.z=o.normal.z>0?i.max.z:i.min.z;var s=o.distanceToPoint(r),l=o.distanceToPoint(e);if(s<0&&l<0)return!1}return!0}}(),containsPoint:function(r){for(var e=this.planes,t=0;t<6;t++)if(e[t].distanceToPoint(r)<0)return!1;return!0}};Mh.prototype={constructor:Mh,set:function(r,e){return this.origin.copy(r),this.direction.copy(e),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.origin.copy(r.origin),this.direction.copy(r.direction),this},at:function(r,e){var t=e||new oe;return t.copy(this.direction).multiplyScalar(r).add(this.origin)},lookAt:function(r){return this.direction.copy(r).sub(this.origin).normalize(),this},recast:function(){var r=new oe;return function(t){return this.origin.copy(this.at(t,r)),this}}(),closestPointToPoint:function(r,e){var t=e||new oe;t.subVectors(r,this.origin);var i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(r){return Math.sqrt(this.distanceSqToPoint(r))},distanceSqToPoint:function(){var r=new oe;return function(t){var i=r.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(r.copy(this.direction).multiplyScalar(i).add(this.origin),r.distanceToSquared(t))}}(),distanceSqToSegment:function(){var r=new oe,e=new oe,t=new oe;return function(n,a,o,s){r.copy(n).add(a).multiplyScalar(.5),e.copy(a).sub(n).normalize(),t.copy(this.origin).sub(r);var l=n.distanceTo(a)*.5,u=-this.direction.dot(e),c=t.dot(this.direction),f=-t.dot(e),h=t.lengthSq(),p=Math.abs(1-u*u),d,g,m,v;if(p>0)if(d=u*f-c,g=u*c-f,v=l*p,d>=0)if(g>=-v)if(g<=v){var _=1/p;d*=_,g*=_,m=d*(d+u*g+2*c)+g*(u*d+g+2*f)+h}else g=l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*f)+h;else g=-l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*f)+h;else g<=-v?(d=Math.max(0,-(-u*l+c)),g=d>0?-l:Math.min(Math.max(-l,-f),l),m=-d*d+g*(g+2*f)+h):g<=v?(d=0,g=Math.min(Math.max(-l,-f),l),m=g*(g+2*f)+h):(d=Math.max(0,-(u*l+c)),g=d>0?l:Math.min(Math.max(-l,-f),l),m=-d*d+g*(g+2*f)+h);else g=u>0?-l:l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*f)+h;return o&&o.copy(this.direction).multiplyScalar(d).add(this.origin),s&&s.copy(e).multiplyScalar(g).add(r),m}}(),intersectSphere:function(){var r=new oe;return function(t,i){r.subVectors(t.center,this.origin);var n=r.dot(this.direction),a=r.dot(r)-n*n,o=t.radius*t.radius;if(a>o)return null;var s=Math.sqrt(o-a),l=n-s,u=n+s;return l<0&&u<0?null:l<0?this.at(u,i):this.at(l,i)}}(),intersectsSphere:function(r){return this.distanceToPoint(r.center)<=r.radius},distanceToPlane:function(r){var e=r.normal.dot(this.direction);if(e===0)return r.distanceToPoint(this.origin)===0?0:null;var t=-(this.origin.dot(r.normal)+r.constant)/e;return t>=0?t:null},intersectPlane:function(r,e){var t=this.distanceToPlane(r);return t===null?null:this.at(t,e)},intersectsPlane:function(r){var e=r.distanceToPoint(this.origin);if(e===0)return!0;var t=r.normal.dot(this.direction);return t*e<0},intersectBox:function(r,e){var t,i,n,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,f=this.origin;return l>=0?(t=(r.min.x-f.x)*l,i=(r.max.x-f.x)*l):(t=(r.max.x-f.x)*l,i=(r.min.x-f.x)*l),u>=0?(n=(r.min.y-f.y)*u,a=(r.max.y-f.y)*u):(n=(r.max.y-f.y)*u,a=(r.min.y-f.y)*u),t>a||n>i||((n>t||t!==t)&&(t=n),(a=0?(o=(r.min.z-f.z)*c,s=(r.max.z-f.z)*c):(o=(r.max.z-f.z)*c,s=(r.min.z-f.z)*c),t>s||o>i)||((o>t||t!==t)&&(t=o),(s=0?t:i,e)},intersectsBox:function(){var r=new oe;return function(t){return this.intersectBox(t,r)!==null}}(),intersectTriangle:function(){var r=new oe,e=new oe,t=new oe,i=new oe;return function(a,o,s,l,u){e.subVectors(o,a),t.subVectors(s,a),i.crossVectors(e,t);var c=this.direction.dot(i),f;if(c>0){if(l)return null;f=1}else if(c<0)f=-1,c=-c;else return null;r.subVectors(this.origin,a);var h=f*this.direction.dot(t.crossVectors(r,t));if(h<0)return null;var p=f*this.direction.dot(e.cross(r));if(p<0||h+p>c)return null;var d=-f*r.dot(i);return d<0?null:this.at(d/c,u)}}(),applyMatrix4:function(r){return this.direction.add(this.origin).applyMatrix4(r),this.origin.applyMatrix4(r),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(r){return r.origin.equals(this.origin)&&r.direction.equals(this.direction)}};bh.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];bh.DefaultOrder="XYZ";bh.prototype={constructor:bh,isEuler:!0,get x(){return this._x},set x(r){this._x=r,this.onChangeCallback()},get y(){return this._y},set y(r){this._y=r,this.onChangeCallback()},get z(){return this._z},set z(r){this._z=r,this.onChangeCallback()},get order(){return this._order},set order(r){this._order=r,this.onChangeCallback()},set:function(r,e,t,i){return this._x=r,this._y=e,this._z=t,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(r){return this._x=r._x,this._y=r._y,this._z=r._z,this._order=r._order,this.onChangeCallback(),this},setFromRotationMatrix:function(r,e,t){var i=cr.clamp,n=r.elements,a=n[0],o=n[4],s=n[8],l=n[1],u=n[5],c=n[9],f=n[2],h=n[6],p=n[10];return e=e||this._order,e==="XYZ"?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(h,u),this._z=0)):e==="YXZ"?(this._x=Math.asin(-i(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-f,a),this._z=0)):e==="ZXY"?(this._x=Math.asin(i(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(-f,p),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a))):e==="ZYX"?(this._y=Math.asin(-i(f,-1,1)),Math.abs(f)<.99999?(this._x=Math.atan2(h,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u))):e==="YZX"?(this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-f,a)):(this._x=0,this._y=Math.atan2(s,p))):e==="XZY"?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(h,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,t!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var r;return function(t,i,n){return r===void 0&&(r=new qt),r.makeRotationFromQuaternion(t),this.setFromRotationMatrix(r,i,n)}}(),setFromVector3:function(r,e){return this.set(r.x,r.y,r.z,e||this._order)},reorder:function(){var r=new on;return function(t){return r.setFromEuler(this),this.setFromQuaternion(r,t)}}(),equals:function(r){return r._x===this._x&&r._y===this._y&&r._z===this._z&&r._order===this._order},fromArray:function(r){return this._x=r[0],this._y=r[1],this._z=r[2],r[3]!==void 0&&(this._order=r[3]),this.onChangeCallback(),this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this._x,r[e+1]=this._y,r[e+2]=this._z,r[e+3]=this._order,r},toVector3:function(r){return r?r.set(this._x,this._y,this._z):new oe(this._x,this._y,this._z)},onChange:function(r){return this.onChangeCallback=r,this},onChangeCallback:function(){}};qA.prototype={constructor:qA,set:function(r){this.mask=1<1){for(var e=0;e1)for(var e=0;e0){i.children=[];for(var n=0;n0&&(t.geometries=a),o.length>0&&(t.materials=o),s.length>0&&(t.textures=s),l.length>0&&(t.images=l)}return t.object=i,t;function u(c){var f=[];for(var h in c){var p=c[h];delete p.metadata,f.push(p)}return f}},clone:function(r){return new this.constructor().copy(this,r)},copy:function(r,e){if(e===void 0&&(e=!0),this.name=r.name,this.up.copy(r.up),this.position.copy(r.position),this.quaternion.copy(r.quaternion),this.scale.copy(r.scale),this.matrix.copy(r.matrix),this.matrixWorld.copy(r.matrixWorld),this.matrixAutoUpdate=r.matrixAutoUpdate,this.matrixWorldNeedsUpdate=r.matrixWorldNeedsUpdate,this.layers.mask=r.layers.mask,this.visible=r.visible,this.castShadow=r.castShadow,this.receiveShadow=r.receiveShadow,this.frustumCulled=r.frustumCulled,this.renderOrder=r.renderOrder,this.userData=JSON.parse(JSON.stringify(r.userData)),e===!0)for(var t=0;t0?o.multiplyScalar(1/Math.sqrt(s)):o.set(0,0,0)}}();Ss.barycoordFromPoint=function(){var r=new oe,e=new oe,t=new oe;return function(n,a,o,s,l){r.subVectors(s,a),e.subVectors(o,a),t.subVectors(n,a);var u=r.dot(r),c=r.dot(e),f=r.dot(t),h=e.dot(e),p=e.dot(t),d=u*h-c*c,g=l||new oe;if(d===0)return g.set(-2,-1,-1);var m=1/d,v=(h*f-c*p)*m,_=(u*p-c*f)*m;return g.set(1-v-_,_,v)}}();Ss.containsPoint=function(){var r=new oe;return function(t,i,n,a){var o=Ss.barycoordFromPoint(t,i,n,a,r);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}();Ss.prototype={constructor:Ss,set:function(r,e,t){return this.a.copy(r),this.b.copy(e),this.c.copy(t),this},setFromPointsAndIndices:function(r,e,t,i){return this.a.copy(r[e]),this.b.copy(r[t]),this.c.copy(r[i]),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.a.copy(r.a),this.b.copy(r.b),this.c.copy(r.c),this},area:function(){var r=new oe,e=new oe;return function(){return r.subVectors(this.c,this.b),e.subVectors(this.a,this.b),r.cross(e).length()*.5}}(),midpoint:function(r){var e=r||new oe;return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(r){return Ss.normal(this.a,this.b,this.c,r)},plane:function(r){var e=r||new Io;return e.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(r,e){return Ss.barycoordFromPoint(r,this.a,this.b,this.c,e)},containsPoint:function(r){return Ss.containsPoint(r,this.a,this.b,this.c)},closestPointToPoint:function(){var r,e,t,i;return function(a,o){r===void 0&&(r=new Io,e=[new Rd,new Rd,new Rd],t=new oe,i=new oe);var s=o||new oe,l=1/0;if(r.setFromCoplanarPoints(this.a,this.b,this.c),r.projectPoint(a,t),this.containsPoint(t)===!0)s.copy(t);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var u=0;u0,a=i[1]&&i[1].length>0,o=r.morphTargets,s=o.length,l;if(s>0){l=[];for(var u=0;u0){h=[];for(var u=0;u0)for(var h=0;h0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var r,e,t;for(this.computeFaceNormals(),r=0,e=this.faces.length;r0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var r,e,t,i,n;for(t=0,i=this.faces.length;t0&&(r+=e[t].distanceTo(e[t-1])),this.lineDistances[t]=r},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new lu),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new $n),this.boundingSphere.setFromPoints(this.vertices)},merge:function(r,e,t){if((r&&r.isGeometry)===!1){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",r);return}var i,n=this.vertices.length,a=this.vertices,o=r.vertices,s=this.faces,l=r.faces,u=this.faceVertexUvs[0],c=r.faceVertexUvs[0],f=this.colors,h=r.colors;t===void 0&&(t=0),e!==void 0&&(i=new bs().getNormalMatrix(e));for(var p=0,d=o.length;p=0;s--){var m=p[s];for(this.faces.splice(m,1),f=0,h=this.faceVertexUvs.length;f0,_=p.vertexNormals.length>0,y=p.color.r!==1||p.color.g!==1||p.color.b!==1,x=p.vertexColors.length>0,M=0;if(M=C(M,0,0),M=C(M,1,d),M=C(M,2,g),M=C(M,3,m),M=C(M,4,v),M=C(M,5,_),M=C(M,6,y),M=C(M,7,x),o.push(M),o.push(p.a,p.b,p.c),o.push(p.materialIndex),m){var S=this.faceVertexUvs[0][n];o.push(I(S[0]),I(S[1]),I(S[2]))}if(v&&o.push(b(p.normal)),_){var w=p.vertexNormals;o.push(b(w[0]),b(w[1]),b(w[2]))}if(y&&o.push(E(p.color)),x){var T=p.vertexColors;o.push(E(T[0]),E(T[1]),E(T[2]))}}function C(R,A,D){return D?R|1<0&&(r.data.colors=u),f.length>0&&(r.data.uvs=[f]),r.data.faces=o,r},clone:function(){return new or().copy(this)},copy:function(r){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]],this.colors=[];for(var e=r.vertices,t=0,i=e.length;t0){var t=new Float32Array(r.normals.length*3);this.addAttribute("normal",new gt(t,3).copyVector3sArray(r.normals))}if(r.colors.length>0){var i=new Float32Array(r.colors.length*3);this.addAttribute("color",new gt(i,3).copyColorsArray(r.colors))}if(r.uvs.length>0){var n=new Float32Array(r.uvs.length*2);this.addAttribute("uv",new gt(n,2).copyVector2sArray(r.uvs))}if(r.uvs2.length>0){var a=new Float32Array(r.uvs2.length*2);this.addAttribute("uv2",new gt(a,2).copyVector2sArray(r.uvs2))}if(r.indices.length>0){var o=r.vertices.length>65535?Uint32Array:Uint16Array,s=new o(r.indices.length*3);this.setIndex(new gt(s,1).copyIndicesArray(r.indices))}this.groups=r.groups;for(var l in r.morphTargets){for(var u=[],c=r.morphTargets[l],f=0,h=c.length;f0){var g=new gr(r.skinIndices.length*4,4);this.addAttribute("skinIndex",g.copyVector4sArray(r.skinIndices))}if(r.skinWeights.length>0){var m=new gr(r.skinWeights.length*4,4);this.addAttribute("skinWeight",m.copyVector4sArray(r.skinWeights))}return r.boundingSphere!==null&&(this.boundingSphere=r.boundingSphere.clone()),r.boundingBox!==null&&(this.boundingBox=r.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new lu);var r=this.attributes.position;r!==void 0?this.boundingBox.setFromBufferAttribute(r):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var r=new lu,e=new oe;return function(){this.boundingSphere===null&&(this.boundingSphere=new $n);var i=this.attributes.position;if(i){var n=this.boundingSphere.center;r.setFromBufferAttribute(i),r.getCenter(n);for(var a=0,o=0,s=i.count;o0&&(r.data.groups=JSON.parse(JSON.stringify(s)));var l=this.boundingSphere;return l!==null&&(r.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),r},clone:function(){return new Bt().copy(this)},copy:function(r){var e=r.index;e!==null&&this.setIndex(e.clone());var t=r.attributes;for(var i in t){var n=t[i];this.addAttribute(i,n.clone())}for(var a=r.groups,o=0,s=a.length;o0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=r.length;ey.far?null:{distance:E,point:d.clone(),object:_}}function v(_,y,x,M,S,w,T,C){i.fromArray(M,w*3),n.fromArray(M,T*3),a.fromArray(M,C*3);var b=m(_,y,x,i,n,a,p);return b&&(S&&(u.fromArray(S,w*2),c.fromArray(S,T*2),f.fromArray(S,C*2),b.uv=g(p,i,n,a,u,c,f)),b.face=new Fo(w,T,C,Ss.normal(i,n,a)),b.faceIndex=w),b}return function(y,x){var M=this.geometry,S=this.material,w=this.matrixWorld;if(S!==void 0&&(M.boundingSphere===null&&M.computeBoundingSphere(),t.copy(M.boundingSphere),t.applyMatrix4(w),y.ray.intersectsSphere(t)!==!1&&(r.getInverse(w),e.copy(y.ray).applyMatrix4(r),!(M.boundingBox!==null&&e.intersectsBox(M.boundingBox)===!1)))){var T,C;if(M.isBufferGeometry){var b,E,I,R=M.index,A=M.attributes,D=A.position.array;if(A.uv!==void 0&&(T=A.uv.array),R!==null)for(var U=R.array,B=0,F=U.length;B0&&(T=ae);for(var ve=0,ue=K.length;vea||i.push({distance:Math.sqrt(n),point:this.position,face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}});kS.prototype=Object.assign(Object.create(Et.prototype),{constructor:kS,copy:function(r){Et.prototype.copy.call(this,r,!1);for(var e=r.levels,t=0,i=e.length;t1){r.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var a=r.distanceTo(e);n[0].object.visible=!0;for(var o=1,s=n.length;o=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;os)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);Tn.far||a.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else for(var y=0,x=v.length/3-1;ys)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);Tn.far||a.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}else if(l.isGeometry)for(var C=l.vertices,b=C.length,y=0;ys)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);Tn.far||a.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});di.prototype=Object.assign(Object.create(oc.prototype),{constructor:di,isLineSegments:!0});dl.prototype=Object.create(mr.prototype);dl.prototype.constructor=dl;dl.prototype.isPointsMaterial=!0;dl.prototype.copy=function(r){return mr.prototype.copy.call(this,r),this.color.copy(r.color),this.map=r.map,this.size=r.size,this.sizeAttenuation=r.sizeAttenuation,this};iy.prototype=Object.assign(Object.create(Et.prototype),{constructor:iy,isPoints:!0,raycast:function(){var r=new qt,e=new Mh,t=new $n;return function(n,a){var o=this,s=this.geometry,l=this.matrixWorld,u=n.params.Points.threshold;if(s.boundingSphere===null&&s.computeBoundingSphere(),t.copy(s.boundingSphere),t.applyMatrix4(l),n.ray.intersectsSphere(t)===!1)return;r.getInverse(l),e.copy(n.ray).applyMatrix4(r);var c=u/((this.scale.x+this.scale.y+this.scale.z)/3),f=c*c,h=new oe;function p(w,T){var C=e.distanceSqToPoint(w);if(Cn.far)return;a.push({distance:E,distanceToRay:Math.sqrt(C),point:b.clone(),index:T,face:null,object:o})}}if(s.isBufferGeometry){var d=s.index,g=s.attributes,m=g.position.array;if(d!==null)for(var v=d.array,_=0,y=v.length;_=-Number.EPSILON&&R>=-Number.EPSILON&&I>=-Number.EPSILON))return!1;return!0}return function(t,i){var n=t.length;if(n<3)return null;var a=[],o=[],s=[],l,u,c;if(Ln.area(t)>0)for(u=0;u2;){if(h--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?s:a;if(l=u,f<=l&&(l=0),u=l+1,f<=u&&(u=0),c=u+1,f<=c&&(c=0),r(t,l,u,c,f,o)){var p,d,g,m,v;for(p=o[l],d=o[u],g=o[c],a.push([t[p],t[d],t[g]]),s.push([o[l],o[u],o[c]]),m=u,v=u+1;v2&&y[x-1].equals(y[0])&&y.pop()}t(r),e.forEach(t);function i(y,x,M){return y.x!==x.x?y.xNumber.EPSILON){var U;if(A>0){if(D<0||D>A)return[];if(U=E*I-b*R,U<0||U>A)return[]}else{if(D>0||D0||Uve?[]:J===ve?w?[]:[G]:Q<=ve?[G,Y]:[G,K]}}function a(y,x,M,S){var w=x.x-y.x,T=x.y-y.y,C=M.x-y.x,b=M.y-y.y,E=S.x-y.x,I=S.y-y.y,R=w*b-T*C,A=w*I-T*E;if(Math.abs(R)>Number.EPSILON){var D=E*b-I*C;return R>0?A>=0&&D>=0:A>=0||D>=0}else return A>0}function o(y,x){var M=y.concat(),S;function w(ve,ue){var se=M.length-1,Ee=ve-1;Ee<0&&(Ee=se);var q=ve+1;q>se&&(q=0);var H=a(M[ve],M[Ee],M[q],S[ue]);if(!H)return!1;var We=S.length-1,_e=ue-1;_e<0&&(_e=We);var xe=ue+1;return xe>We&&(xe=0),H=a(S[ue],S[_e],S[xe],M[ve]),!!H}function T(ve,ue){var se,Ee,q;for(se=0;se0)return!0;return!1}var C=[];function b(ve,ue){var se,Ee,q,H,We;for(se=0;se0)return!0;return!1}for(var E,I,R,A,D,U,B=[],F,k,G,Y,J=0,Q=x.length;J0;){if(K--,K<0){console.log("Infinite Loop! Holes left:"+C.length+", Probably Hole outside Shape!");break}for(I=V;I=0)break;B[U]=!0}if(E>=0)break}}return M}for(var s,l,u,c,f,h,p={},d=r.concat(),g=0,m=e.length;gNumber.EPSILON){var Se=Math.sqrt(et),Ae=Math.sqrt(me*me+he*he),nt=Ne.x-le/Se,$=Ne.y+ne/Se,it=Ve.x-he/Ae,Xe=Ve.y+me/Ae,ze=((it-nt)*he-(Xe-$)*me)/(ne*he-le*me);ct=nt+ne*ze-Ue.x,z=$+le*ze-Ue.y;var we=ct*ct+z*z;if(we<=2)return new St(ct,z);L=Math.sqrt(we/2)}else{var Ie=!1;ne>Number.EPSILON?me>Number.EPSILON&&(Ie=!0):ne<-Number.EPSILON?me<-Number.EPSILON&&(Ie=!0):Math.sign(le)===Math.sign(he)&&(Ie=!0),Ie?(ct=-le,z=ne,L=Math.sqrt(et)):(ct=ne,z=le,L=Math.sqrt(et/2))}return new St(ct/L,z/L)}for(var J=[],Q=0,V=E.length,K=V-1,ae=Q+1;Q=0;R--){for(D=R/a,U=i*Math.cos(D*Math.PI/2),A=n*Math.sin(D*Math.PI/2),Q=0,V=E.length;Q=0;){Ve=Q,ct=Q-1,ct<0&&(ct=Ue.length-1);var z=0,L=l+a*2;for(z=0;z0||r.search(/^data\:image\/jpeg/)===0;n.format=s?Kg:su,n.image=o,n.needsUpdate=!0,e!==void 0&&e(n)},t,i),n},setCrossOrigin:function(r){return this.crossOrigin=r,this},setWithCredentials:function(r){return this.withCredentials=r,this},setPath:function(r){return this.path=r,this}});Oi.prototype=Object.assign(Object.create(Et.prototype),{constructor:Oi,isLight:!0,copy:function(r){return Et.prototype.copy.call(this,r),this.color.copy(r.color),this.intensity=r.intensity,this},toJSON:function(r){var e=Et.prototype.toJSON.call(this,r);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}});QA.prototype=Object.assign(Object.create(Oi.prototype),{constructor:QA,isHemisphereLight:!0,copy:function(r){return Oi.prototype.copy.call(this,r),this.groundColor.copy(r.groundColor),this}});Object.assign(em.prototype,{copy:function(r){return this.camera=r.camera.clone(),this.bias=r.bias,this.radius=r.radius,this.mapSize.copy(r.mapSize),this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var r={};return this.bias!==0&&(r.bias=this.bias),this.radius!==1&&(r.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(r.mapSize=this.mapSize.toArray()),r.camera=this.camera.toJSON(!1).object,delete r.camera.matrix,r}});eC.prototype=Object.assign(Object.create(em.prototype),{constructor:eC,isSpotLightShadow:!0,update:function(r){var e=cr.RAD2DEG*2*r.angle,t=this.mapSize.width/this.mapSize.height,i=r.distance||500,n=this.camera;(e!==n.fov||t!==n.aspect||i!==n.far)&&(n.fov=e,n.aspect=t,n.far=i,n.updateProjectionMatrix())}});tC.prototype=Object.assign(Object.create(Oi.prototype),{constructor:tC,isSpotLight:!0,copy:function(r){return Oi.prototype.copy.call(this,r),this.distance=r.distance,this.angle=r.angle,this.penumbra=r.penumbra,this.decay=r.decay,this.target=r.target.clone(),this.shadow=r.shadow.clone(),this}});rC.prototype=Object.assign(Object.create(Oi.prototype),{constructor:rC,isPointLight:!0,copy:function(r){return Oi.prototype.copy.call(this,r),this.distance=r.distance,this.decay=r.decay,this.shadow=r.shadow.clone(),this}});iC.prototype=Object.assign(Object.create(em.prototype),{constructor:iC});nC.prototype=Object.assign(Object.create(Oi.prototype),{constructor:nC,isDirectionalLight:!0,copy:function(r){return Oi.prototype.copy.call(this,r),this.target=r.target.clone(),this.shadow=r.shadow.clone(),this}});aC.prototype=Object.assign(Object.create(Oi.prototype),{constructor:aC,isAmbientLight:!0});Jn={arraySlice:function(r,e,t){return Jn.isTypedArray(r)?new r.constructor(r.subarray(e,t)):r.slice(e,t)},convertArray:function(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)},isTypedArray:function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},getKeyframeOrder:function(r){function e(a,o){return r[a]-r[o]}for(var t=r.length,i=new Array(t),n=0;n!==t;++n)i[n]=n;return i.sort(e),i},sortedArray:function(r,e,t){for(var i=r.length,n=new r.constructor(i),a=0,o=0;o!==i;++a)for(var s=t[a]*e,l=0;l!==e;++l)n[o++]=r[s+l];return n},flattenJSON:function(r,e,t,i){for(var n=1,a=r[0];a!==void 0&&a[i]===void 0;)a=r[n++];if(a!==void 0){var o=a[i];if(o!==void 0)if(Array.isArray(o))do o=a[i],o!==void 0&&(e.push(a.time),t.push.apply(t,o)),a=r[n++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[i],o!==void 0&&(e.push(a.time),o.toArray(t,t.length)),a=r[n++];while(a!==void 0);else do o=a[i],o!==void 0&&(e.push(a.time),t.push(o)),a=r[n++];while(a!==void 0)}}};ro.prototype={constructor:ro,evaluate:function(r){var e=this.parameterPositions,t=this._cachedIndex,i=e[t],n=e[t-1];e:{t:{var a;r:{i:if(!(r=n)){var s=e[1];r=n)break t}a=t,t=0;break r}break e}for(;t>>1;re;)--a;if(++a,n!==0||a!==i){n>=a&&(a=Math.max(a,1),n=a-1);var o=this.getValueSize();this.times=Jn.arraySlice(t,n,a),this.values=Jn.arraySlice(this.values,n*o,a*o)}return this},validate:function(){var r=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("invalid value size in track",this),r=!1);var t=this.times,i=this.values,n=t.length;n===0&&(console.error("track is empty",this),r=!1);for(var a=null,o=0;o!==n;o++){var s=t[o];if(typeof s=="number"&&isNaN(s)){console.error("time is not a valid number",this,o,s),r=!1;break}if(a!==null&&a>s){console.error("out of order keys",this,o,s,a),r=!1;break}a=s}if(i!==void 0&&Jn.isTypedArray(i))for(var o=0,l=i.length;o!==l;++o){var u=i[o];if(isNaN(u)){console.error("value is not a valid number",this,o,u),r=!1;break}}return r},optimize:function(){for(var r=this.times,e=this.values,t=this.getValueSize(),i=this.getInterpolation()===VA,n=1,a=r.length-1,o=1;o0){r[n]=r[a];for(var g=a*t,m=n*t,p=0;p!==t;++p)e[m+p]=e[g+p];++n}return n!==r.length&&(this.times=Jn.arraySlice(r,0,n),this.values=Jn.arraySlice(e,0,n*t)),this}};Sy.prototype=Object.assign(Object.create(uc),{constructor:Sy,ValueTypeName:"vector"});lC.prototype=Object.assign(Object.create(ro.prototype),{constructor:lC,interpolate_:function(r,e,t,i){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=r*o,l=(t-e)/(i-e),u=s+o;s!==u;s+=4)on.slerpFlat(n,0,a,s-o,a,s,l);return n}});uM.prototype=Object.assign(Object.create(uc),{constructor:uM,ValueTypeName:"quaternion",DefaultInterpolation:bS,InterpolantFactoryMethodLinear:function(r){return new lC(this.times,this.values,this.getValueSize(),r)},InterpolantFactoryMethodSmooth:void 0});My.prototype=Object.assign(Object.create(uc),{constructor:My,ValueTypeName:"number"});uC.prototype=Object.assign(Object.create(uc),{constructor:uC,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:CS,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});cC.prototype=Object.assign(Object.create(uc),{constructor:cC,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:CS,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});fC.prototype=Object.assign(Object.create(uc),{constructor:fC,ValueTypeName:"color"});qd.prototype=uc;uc.constructor=qd;Object.assign(qd,{parse:function(r){if(r.type===void 0)throw new Error("track type undefined, can not parse");var e=qd._getTrackTypeForValueTypeName(r.type);if(r.times===void 0){var t=[],i=[];Jn.flattenJSON(r.keys,t,i,"value"),r.times=t,r.values=i}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)},toJSON:function(r){var e=r.constructor,t;if(e.toJSON!==void 0)t=e.toJSON(r);else{t={name:r.name,times:Jn.convertArray(r.times,Array),values:Jn.convertArray(r.values,Array)};var i=r.getInterpolation();i!==r.DefaultInterpolation&&(t.interpolation=i)}return t.type=r.ValueTypeName,t},_getTrackTypeForValueTypeName:function(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return My;case"vector":case"vector2":case"vector3":case"vector4":return Sy;case"color":return fC;case"quaternion":return uM;case"bool":case"boolean":return cC;case"string":return uC}throw new Error("Unsupported typeName: "+r)}});No.prototype={constructor:No,resetDuration:function(){for(var r=this.tracks,e=0,t=0,i=r.length;t!==i;++t){var n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}this.duration=e},trim:function(){for(var r=0;r1){var u=l[1],c=i[u];c||(i[u]=c=[]),c.push(s)}}var f=[];for(var u in i)f.push(No.CreateFromMorphTargetSequence(u,i[u],e,t));return f},parseAnimation:function(r,e){if(!r)return console.error(" no animation in JSONLoader data"),null;for(var t=function(y,x,M,S,w){if(M.length!==0){var T=[],C=[];Jn.flattenJSON(M,T,C,S),T.length!==0&&w.push(new y(x,T,C))}},i=[],n=r.name||"default",a=r.length||-1,o=r.fps||30,s=r.hierarchy||[],l=0;l1?r.skinWeights[c+1]:0,d=u>2?r.skinWeights[c+2]:0,g=u>3?r.skinWeights[c+3]:0;t.skinWeights.push(new Qr(h,p,d,g))}if(r.skinIndices)for(var c=0,f=r.skinIndices.length;c1?r.skinIndices[c+1]:0,_=u>2?r.skinIndices[c+2]:0,y=u>3?r.skinIndices[c+3]:0;t.skinIndices.push(new Qr(m,v,_,y))}t.bones=r.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}function o(u){if(r.morphTargets!==void 0)for(var c=0,f=r.morphTargets.length;c0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var v=t.faces,_=r.morphColors[0].colors,c=0,f=v.length;c0&&(t.animations=u)}if(r.materials===void 0||r.materials.length===0)return{geometry:t};var l=Ld.prototype.initMaterials(r.materials,e,this.crossOrigin);return{geometry:t,materials:l}}});Object.assign(Yne.prototype,{load:function(r,e,t,i){this.texturePath===""&&(this.texturePath=r.substring(0,r.lastIndexOf("/")+1));var n=this,a=new Ts(n.manager);a.load(r,function(o){var s=null;try{s=JSON.parse(o)}catch(u){console.error("THREE:ObjectLoader: Can't parse "+r+".",u.message);return}var l=s.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+r+". Use THREE.JSONLoader instead.");return}n.parse(s,e)},t,i)},setTexturePath:function(r){this.texturePath=r},setCrossOrigin:function(r){this.crossOrigin=r},parse:function(r,e){var t=this.parseGeometries(r.geometries),i=this.parseImages(r.images,function(){e!==void 0&&e(o)}),n=this.parseTextures(r.textures,i),a=this.parseMaterials(r.materials,n),o=this.parseObject(r.object,t,a);return r.animations&&(o.animations=this.parseAnimations(r.animations)),(r.images===void 0||r.images.length===0)&&e!==void 0&&e(o),o},parseGeometries:function(r){var e={};if(r!==void 0)for(var t=new nB,i=new iB,n=0,a=r.length;n0){var a=new eB(e),o=new yM(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,l=r.length;s0?a=new KA(l,u):a=new mn(l,u);break;case"LOD":a=new kS;break;case"Line":a=new oc(o(t.geometry),s(t.material),t.mode);break;case"LineSegments":a=new di(o(t.geometry),s(t.material));break;case"PointCloud":case"Points":a=new iy(o(t.geometry),s(t.material));break;case"Sprite":a=new BS(s(t.material));break;case"Group":a=new VS;break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh type. Instantiates Object3D instead.");default:a=new Et}if(a.uuid=t.uuid,t.name!==void 0&&(a.name=t.name),t.matrix!==void 0?(r.fromArray(t.matrix),r.decompose(a.position,a.quaternion,a.scale)):(t.position!==void 0&&a.position.fromArray(t.position),t.rotation!==void 0&&a.rotation.fromArray(t.rotation),t.quaternion!==void 0&&a.quaternion.fromArray(t.quaternion),t.scale!==void 0&&a.scale.fromArray(t.scale)),t.castShadow!==void 0&&(a.castShadow=t.castShadow),t.receiveShadow!==void 0&&(a.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==void 0&&(a.shadow.bias=t.shadow.bias),t.shadow.radius!==void 0&&(a.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(a.visible=t.visible),t.userData!==void 0&&(a.userData=t.userData),t.children!==void 0)for(var c in t.children)a.add(this.parseObject(t.children[c],i,n));if(t.type==="LOD")for(var f=t.levels,h=0;h0)s=i-1;else{s=i;break}if(i=s,t[i]===a){var p=i/(n-1);return p}var u=t[i],c=t[i+1],f=c-u,h=(a-u)/f,p=(i+h)/(n-1);return p},getTangent:function(r){var e=1e-4,t=r-e,i=r+e;t<0&&(t=0),i>1&&(i=1);var n=this.getPoint(t),a=this.getPoint(i),o=a.clone().sub(n);return o.normalize()},getTangentAt:function(r){var e=this.getUtoTmapping(r);return this.getTangent(e)},computeFrenetFrames:function(r,e){var t=new oe,i=[],n=[],a=[],o=new oe,s=new qt,l,u,c;for(l=0;l<=r;l++)u=l/r,i[l]=this.getTangentAt(u),i[l].normalize();n[0]=new oe,a[0]=new oe;var f=Number.MAX_VALUE,h=Math.abs(i[0].x),p=Math.abs(i[0].y),d=Math.abs(i[0].z);for(h<=f&&(f=h,t.set(1,0,0)),p<=f&&(f=p,t.set(0,1,0)),d<=f&&t.set(0,0,1),o.crossVectors(i[0],t).normalize(),n[0].crossVectors(i[0],o),a[0].crossVectors(i[0],n[0]),l=1;l<=r;l++)n[l]=n[l-1].clone(),a[l]=a[l-1].clone(),o.crossVectors(i[l-1],i[l]),o.length()>Number.EPSILON&&(o.normalize(),c=Math.acos(cr.clamp(i[l-1].dot(i[l]),-1,1)),n[l].applyMatrix4(s.makeRotationAxis(o,c))),a[l].crossVectors(i[l],n[l]);if(e===!0)for(c=Math.acos(cr.clamp(n[0].dot(n[r]),-1,1)),c/=r,i[0].dot(o.crossVectors(n[0],n[r]))>0&&(c=-c),l=1;l<=r;l++)n[l].applyMatrix4(s.makeRotationAxis(i[l],c*l)),a[l].crossVectors(i[l],n[l]);return{tangents:i,normals:n,binormals:a}}};ea.create=function(r,e){return r.prototype=Object.create(ea.prototype),r.prototype.constructor=r,r.prototype.getPoint=e,r};cu.prototype=Object.create(ea.prototype);cu.prototype.constructor=cu;cu.prototype.isLineCurve=!0;cu.prototype.getPoint=function(r){if(r===1)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(r).add(this.v1),e};cu.prototype.getPointAt=function(r){return this.getPoint(r)};cu.prototype.getTangent=function(r){var e=this.v2.clone().sub(this.v1);return e.normalize()};cM.prototype=Object.assign(Object.create(ea.prototype),{constructor:cM,add:function(r){this.curves.push(r)},closePath:function(){var r=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);r.equals(e)||this.curves.push(new cu(e,r))},getPoint:function(r){for(var e=r*this.getLength(),t=this.getCurveLengths(),i=0;i=e){var n=t[i]-e,a=this.curves[i],o=a.getLength(),s=o===0?0:1-n/o;return a.getPointAt(s)}i++}return null},getLength:function(){var r=this.getCurveLengths();return r[r.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var r=[],e=0,t=0,i=this.curves.length;t1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},createPointsGeometry:function(r){var e=this.getPoints(r);return this.createGeometry(e)},createSpacedPointsGeometry:function(r){var e=this.getSpacedPoints(r);return this.createGeometry(e)},createGeometry:function(r){for(var e=new or,t=0,i=r.length;te;)t-=e;te.length-2?e.length-1:i+1],l=e[i>e.length-3?e.length-1:i+2],u=_M.interpolate;return new St(u(a.x,o.x,s.x,l.x,n),u(a.y,o.y,s.y,l.y,n))};jd.prototype=Object.create(ea.prototype);jd.prototype.constructor=jd;jd.prototype.getPoint=function(r){var e=Ln.b3;return new St(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y))};jd.prototype.getTangent=function(r){var e=_M.tangentCubicBezier;return new St(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()};Kd.prototype=Object.create(ea.prototype);Kd.prototype.constructor=Kd;Kd.prototype.getPoint=function(r){var e=Ln.b2;return new St(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y))};Kd.prototype.getTangent=function(r){var e=_M.tangentQuadraticBezier;return new St(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y)).normalize()};aB=Object.assign(Object.create(cM.prototype),{fromPoints:function(r){this.moveTo(r[0].x,r[0].y);for(var e=1,t=r.length;e0){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var c=l.getPoint(1);this.currentPoint.copy(c)}});Pd.prototype=Object.assign(Object.create(aB),{constructor:Pd,getPointsHoles:function(r){for(var e=[],t=0,i=this.holes.length;tNumber.EPSILON){if(V<0&&(Y=U[G],Q=-Q,J=U[k],V=-V),D.yJ.y)continue;if(D.y===Y.y){if(D.x===Y.x)return!0}else{var K=V*(D.x-Y.x)-Q*(D.y-Y.y);if(K===0)return!0;if(K<0)continue;F=!F}}else{if(D.y!==Y.y)continue;if(J.x<=D.x&&D.x<=Y.x||Y.x<=D.x&&D.x<=J.x)return!0}}return F}var n=Ln.isClockWise,a=this.subPaths;if(a.length===0)return[];if(e===!0)return t(a);var o,s,l,u=[];if(a.length===1)return s=a[0],l=new Pd,l.curves=s.curves,u.push(l),u;var c=!n(a[0].getPoints());c=r?!c:c;var f=[],h=[],p=[],d=0,g;h[d]=void 0,p[d]=[];for(var m=0,v=a.length;m1){for(var _=!1,y=[],x=0,M=h.length;x0&&(_||(p=f))}for(var E,m=0,I=h.length;m0){this.source.connect(this.filters[0]);for(var r=1,e=this.filters.length;r0){this.source.disconnect(this.filters[0]);for(var r=1,e=this.filters.length;r=.5)for(var a=0;a!==n;++a)r[e+a]=r[t+a]},_slerp:function(r,e,t,i,n){on.slerpFlat(r,e,r,e,r,t,i)},_lerp:function(r,e,t,i,n){for(var a=1-i,o=0;o!==n;++o){var s=e+o;r[s]=r[s]*a+r[t+o]*i}}};Ri.prototype={constructor:Ri,getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var r=this.node,e=this.parsedPath,t=e.objectName,i=e.propertyName,n=e.propertyIndex;if(r||(r=Ri.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=r),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!r){console.error(" trying to update node for track: "+this.path+" but it wasn't found.");return}if(t){var a=e.objectIndex;switch(t){case"materials":if(!r.material){console.error(" can not bind to material as node does not have a material",this);return}if(!r.material.materials){console.error(" can not bind to material.materials as node.material does not have a materials array",this);return}r=r.material.materials;break;case"bones":if(!r.skeleton){console.error(" can not bind to bones as node does not have a skeleton",this);return}r=r.skeleton.bones;for(var o=0;o=t){var f=t++,h=e[f];i[h.uuid]=c,e[c]=h,i[u]=f,e[f]=l;for(var p=0,d=a;p!==d;++p){var g=n[p],m=g[f],v=g[c];g[c]=m,g[f]=v}}}this.nCachedObjects_=t},uncache:function(r){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,a=this._bindings,o=a.length,s=0,l=arguments.length;s!==l;++s){var u=arguments[s],c=u.uuid,f=n[c];if(f!==void 0)if(delete n[c],f0)for(var l=this._interpolants,u=this._propertyBindings,c=0,f=l.length;c!==f;++c)l[c].evaluate(o),u[c].accumulate(i,s)},_updateWeight:function(r){var e=0;if(this.enabled){e=this.weight;var t=this._weightInterpolant;if(t!==null){var i=t.evaluate(r)[0];e*=i,r>t.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(r){var e=0;if(!this.paused){e=this.timeScale;var t=this._timeScaleInterpolant;if(t!==null){var i=t.evaluate(r)[0];e*=i,r>t.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(r){var e=this.time+r;if(r===0)return e;var t=this._clip.duration,i=this.loop,n=this._loopCount;if(i===Mne){n===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(e>=t)e=t;else if(e<0)e=0;else break e;this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:r<0?-1:1})}}else{var a=i===wne;if(n===-1&&(r>=0?(n=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),e>=t||e<0){var o=Math.floor(e/t);e-=t*o,n+=Math.abs(o);var s=this.repetitions-n;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=r>0?t:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:r>0?1:-1});else{if(s===0){var l=r<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&(n&1)===1)return this.time=e,t-e}return this.time=e,e},_setEndings:function(r,e,t){var i=this._interpolantSettings;t?(i.endingStart=Ad,i.endingEnd=Ad):(r?i.endingStart=this.zeroSlopeAtStart?Ad:Id:i.endingStart=RS,e?i.endingEnd=this.zeroSlopeAtEnd?Ad:Id:i.endingEnd=RS)},_scheduleFading:function(r,e,t){var i=this._mixer,n=i.time,a=this._weightInterpolant;a===null&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=n,s[0]=e,o[1]=n+r,s[1]=t,this}};Object.assign(fB.prototype,Ms.prototype,{clipAction:function(r,e){var t=e||this._root,i=t.uuid,n=typeof r=="string"?No.findByName(t,r):r,a=n!==null?n.uuid:r,o=this._actionsByClip[a],s=null;if(o!==void 0){var l=o.actionByRoot[i];if(l!==void 0)return l;s=o.knownActions[0],n===null&&(n=s._clip)}if(n===null)return null;var u=new Ez(this,n,e);return this._bindAction(u,s),this._addInactiveAction(u,a,i),u},existingAction:function(r,e){var t=e||this._root,i=t.uuid,n=typeof r=="string"?No.findByName(t,r):r,a=n?n.uuid:r,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[i]||null},stopAllAction:function(){var r=this._actions,e=this._nActiveActions,t=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==e;++n)r[n].reset();for(var n=0;n!==i;++n)t[n].useCount=0;return this},update:function(r){r*=this.timeScale;for(var e=this._actions,t=this._nActiveActions,i=this.time+=r,n=Math.sign(r),a=this._accuIndex^=1,o=0;o!==t;++o){var s=e[o];s.enabled&&s._update(i,r,n,a)}for(var l=this._bindings,u=this._nActiveBindings,o=0;o!==u;++o)l[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(r){var e=this._actions,t=r.uuid,i=this._actionsByClip,n=i[t];if(n!==void 0){for(var a=n.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var u=l._cacheIndex,c=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=u,e[u]=c,e.pop(),this._removeInactiveBindingsForAction(l)}delete i[t]}},uncacheRoot:function(r){var e=r.uuid,t=this._actionsByClip;for(var i in t){var n=t[i].actionByRoot,a=n[e];a!==void 0&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[e];if(s!==void 0)for(var l in s){var u=s[l];u.restoreOriginalState(),this._removeInactiveBinding(u)}},uncacheAction:function(r,e){var t=this.existingAction(r,e);t!==null&&(this._deactivateAction(t),this._removeInactiveAction(t))}});Object.assign(fB.prototype,{_bindAction:function(r,e){var t=r._localRoot||this._root,i=r._clip.tracks,n=i.length,a=r._propertyBindings,o=r._interpolants,s=t.uuid,l=this._bindingsByRootAndName,u=l[s];u===void 0&&(u={},l[s]=u);for(var c=0;c!==n;++c){var f=i[c],h=f.name,p=u[h];if(p!==void 0)a[c]=p;else{if(p=a[c],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,s,h));continue}var d=e&&e._propertyBindings[c].binding.parsedPath;p=new pC(Ri.create(t,h,d),f.ValueTypeName,f.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,s,h),a[c]=p}o[c].resultBuffer=p.buffer}},_activateAction:function(r){if(!this._isActiveAction(r)){if(r._cacheIndex===null){var e=(r._localRoot||this._root).uuid,t=r._clip.uuid,i=this._actionsByClip[t];this._bindAction(r,i&&i.knownActions[0]),this._addInactiveAction(r,t,e)}for(var n=r._propertyBindings,a=0,o=n.length;a!==o;++a){var s=n[a];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(r)}},_deactivateAction:function(r){if(this._isActiveAction(r)){for(var e=r._propertyBindings,t=0,i=e.length;t!==i;++t){var n=e[t];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(r)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var r=this;this.stats={actions:{get total(){return r._actions.length},get inUse(){return r._nActiveActions}},bindings:{get total(){return r._bindings.length},get inUse(){return r._nActiveBindings}},controlInterpolants:{get total(){return r._controlInterpolants.length},get inUse(){return r._nActiveControlInterpolants}}}},_isActiveAction:function(r){var e=r._cacheIndex;return e!==null&&e1){var u=l[1];i[u]||(i[u]={start:1/0,end:-1/0});var c=i[u];ac.end&&(c.end=a),t||(t=u)}}for(var u in i){var c=i[u];this.createAnimation(u,c.start,c.end,r)}this.firstAnimation=t};Pn.prototype.setAnimationDirectionForward=function(r){var e=this.animationsMap[r];e&&(e.direction=1,e.directionBackwards=!1)};Pn.prototype.setAnimationDirectionBackward=function(r){var e=this.animationsMap[r];e&&(e.direction=-1,e.directionBackwards=!0)};Pn.prototype.setAnimationFPS=function(r,e){var t=this.animationsMap[r];t&&(t.fps=e,t.duration=(t.end-t.start)/t.fps)};Pn.prototype.setAnimationDuration=function(r,e){var t=this.animationsMap[r];t&&(t.duration=e,t.fps=(t.end-t.start)/t.duration)};Pn.prototype.setAnimationWeight=function(r,e){var t=this.animationsMap[r];t&&(t.weight=e)};Pn.prototype.setAnimationTime=function(r,e){var t=this.animationsMap[r];t&&(t.time=e)};Pn.prototype.getAnimationTime=function(r){var e=0,t=this.animationsMap[r];return t&&(e=t.time),e};Pn.prototype.getAnimationDuration=function(r){var e=-1,t=this.animationsMap[r];return t&&(e=t.duration),e};Pn.prototype.playAnimation=function(r){var e=this.animationsMap[r];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+r+"] undefined in .playAnimation()")};Pn.prototype.stopAnimation=function(r){var e=this.animationsMap[r];e&&(e.active=!1)};Pn.prototype.update=function(r){for(var e=0,t=this.animationsList.length;ei.duration||i.time<0)&&(i.direction*=-1,i.time>i.duration&&(i.time=i.duration,i.directionBackwards=!0),i.time<0&&(i.time=0,i.directionBackwards=!1)):(i.time=i.time%i.duration,i.time<0&&(i.time+=i.duration));var a=i.start+cr.clamp(Math.floor(i.time/n),0,i.length-1),o=i.weight;a!==i.currentFrame&&(this.morphTargetInfluences[i.lastFrame]=0,this.morphTargetInfluences[i.currentFrame]=1*o,this.morphTargetInfluences[a]=0,i.lastFrame=i.currentFrame,i.currentFrame=a);var s=i.time%n/n;i.directionBackwards&&(s=1-s),i.currentFrame!==i.lastFrame?(this.morphTargetInfluences[i.currentFrame]=s*o,this.morphTargetInfluences[i.lastFrame]=(1-s)*o):this.morphTargetInfluences[i.currentFrame]=o}}};fM.prototype=Object.create(Et.prototype);fM.prototype.constructor=fM;fM.prototype.isImmediateRenderObject=!0;hM.prototype=Object.create(di.prototype);hM.prototype.constructor=hM;hM.prototype.update=function(){var r=new oe,e=new oe,t=new bs;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),t.getNormalMatrix(this.object.matrixWorld);var a=this.object.matrixWorld,o=this.geometry.attributes.position,s=this.object.geometry;if(s&&s.isGeometry)for(var l=s.vertices,u=s.faces,c=0,f=0,h=u.length;f.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(r.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(r,e))}}();$d.prototype.setLength=function(r,e,t){e===void 0&&(e=.2*r),t===void 0&&(t=.2*e),this.line.scale.set(1,Math.max(0,r-e),1),this.line.updateMatrix(),this.cone.scale.set(t,e,t),this.cone.position.y=r,this.cone.updateMatrix()};$d.prototype.setColor=function(r){this.line.material.color.copy(r),this.cone.material.color.copy(r)};vC.prototype=Object.create(di.prototype);vC.prototype.constructor=vC;hB=function(){var r=new oe,e=new n,t=new n,i=new n;function n(){}return n.prototype.init=function(a,o,s,l){this.c0=a,this.c1=s,this.c2=-3*a+3*o-2*s-l,this.c3=2*a-2*o+s+l},n.prototype.initNonuniformCatmullRom=function(a,o,s,l,u,c,f){var h=(o-a)/u-(s-a)/(u+c)+(s-o)/c,p=(s-o)/c-(l-o)/(c+f)+(l-s)/f;h*=c,p*=c,this.init(o,s,h,p)},n.prototype.initCatmullRom=function(a,o,s,l,u){this.init(o,s,u*(s-a),u*(l-o))},n.prototype.calc=function(a){var o=a*a,s=o*a;return this.c0+this.c1*a+this.c2*o+this.c3*s},ea.create(function(a){this.points=a||[],this.closed=!1},function(a){var o=this.points,s,l,u,c;c=o.length,c<2&&console.log("duh, you need at least 2 points"),s=(c-(this.closed?0:1))*a,l=Math.floor(s),u=s-l,this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/o.length)+1)*o.length:u===0&&l===c-1&&(l=c-2,u=1);var f,h,p,d;if(this.closed||l>0?f=o[(l-1)%c]:(r.subVectors(o[0],o[1]).add(o[0]),f=r),h=o[l%c],p=o[(l+1)%c],this.closed||l+2e.length-2?e.length-1:i+1],l=e[i>e.length-3?e.length-1:i+2],u=_M.interpolate;return new oe(u(a.x,o.x,s.x,l.x,n),u(a.y,o.y,s.y,l.y,n),u(a.z,o.z,s.z,l.z,n))}),tLe=ea.create(function(r,e,t,i){this.v0=r,this.v1=e,this.v2=t,this.v3=i},function(r){var e=Ln.b3;return new oe(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(r,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),rLe=ea.create(function(r,e,t){this.v0=r,this.v1=e,this.v2=t},function(r){var e=Ln.b2;return new oe(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y),e(r,this.v0.z,this.v1.z,this.v2.z))}),iLe=ea.create(function(r,e){this.v1=r,this.v2=e},function(r){if(r===1)return this.v2.clone();var e=new oe;return e.subVectors(this.v2,this.v1),e.multiplyScalar(r),e.add(this.v1),e});gC.prototype=Object.create(lc.prototype);gC.prototype.constructor=gC;nLe={createMultiMaterialObject:function(r,e){for(var t=new VS,i=0,n=e.length;i{"use strict";var NLe=AC&&AC.__extends||function(r,e){for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);function i(){this.constructor=r}r.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)},Fr=(Qne(),Ose($ne)),xi={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},eae={type:"change"},pB={type:"start"},dB={type:"end"},tae=1e-6,ULe=function(r){NLe(e,r);function e(t,i,n){var a=r.call(this)||this;return a.object=t,a.domElement=i!==void 0?i:document,a.window=n!==void 0?n:window,a.enabled=!0,a.target=new Fr.Vector3,a.minDistance=0,a.maxDistance=1/0,a.minZoom=0,a.maxZoom=1/0,a.minPolarAngle=0,a.maxPolarAngle=Math.PI,a.minAzimuthAngle=-1/0,a.maxAzimuthAngle=1/0,a.enableDamping=!1,a.dampingFactor=.25,a.enableZoom=!0,a.zoomSpeed=1,a.enableRotate=!0,a.rotateSpeed=1,a.enablePan=!0,a.keyPanSpeed=7,a.autoRotate=!1,a.autoRotateSpeed=2,a.enableKeys=!0,a.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},a.mouseButtons={ORBIT:Fr.MOUSE.LEFT,ZOOM:Fr.MOUSE.MIDDLE,PAN:Fr.MOUSE.RIGHT},a.target0=a.target.clone(),a.position0=a.object.position.clone(),a.zoom0=a.object.zoom,a.updateOffset=new Fr.Vector3,a.updateQuat=new Fr.Quaternion().setFromUnitVectors(t.up,new Fr.Vector3(0,1,0)),a.updateQuatInverse=a.updateQuat.clone().inverse(),a.updateLastPosition=new Fr.Vector3,a.updateLastQuaternion=new Fr.Quaternion,a.state=xi.NONE,a.scale=1,a.spherical=new Fr.Spherical,a.sphericalDelta=new Fr.Spherical,a.panOffset=new Fr.Vector3,a.zoomChanged=!1,a.rotateStart=new Fr.Vector2,a.rotateEnd=new Fr.Vector2,a.rotateDelta=new Fr.Vector2,a.panStart=new Fr.Vector2,a.panEnd=new Fr.Vector2,a.panDelta=new Fr.Vector2,a.dollyStart=new Fr.Vector2,a.dollyEnd=new Fr.Vector2,a.dollyDelta=new Fr.Vector2,a.panLeftV=new Fr.Vector3,a.panUpV=new Fr.Vector3,a.panInternalOffset=new Fr.Vector3,a.onMouseDown=function(o){if(a.enabled!==!1){if(o.preventDefault(),o.button===a.mouseButtons.ORBIT){if(a.enableRotate===!1)return;a.rotateStart.set(o.clientX,o.clientY),a.state=xi.ROTATE}else if(o.button===a.mouseButtons.ZOOM){if(a.enableZoom===!1)return;a.dollyStart.set(o.clientX,o.clientY),a.state=xi.DOLLY}else if(o.button===a.mouseButtons.PAN){if(a.enablePan===!1)return;a.panStart.set(o.clientX,o.clientY),a.state=xi.PAN}a.state!==xi.NONE&&(document.addEventListener("mousemove",a.onMouseMove,!1),document.addEventListener("mouseup",a.onMouseUp,!1),a.dispatchEvent(pB))}},a.onMouseMove=function(o){if(a.enabled!==!1){if(o.preventDefault(),a.state===xi.ROTATE){if(a.enableRotate===!1)return;a.rotateEnd.set(o.clientX,o.clientY),a.rotateDelta.subVectors(a.rotateEnd,a.rotateStart);var s=a.domElement===document?a.domElement.body:a.domElement;a.rotateLeft(2*Math.PI*a.rotateDelta.x/s.clientWidth*a.rotateSpeed),a.rotateUp(2*Math.PI*a.rotateDelta.y/s.clientHeight*a.rotateSpeed),a.rotateStart.copy(a.rotateEnd),a.update()}else if(a.state===xi.DOLLY){if(a.enableZoom===!1)return;a.dollyEnd.set(o.clientX,o.clientY),a.dollyDelta.subVectors(a.dollyEnd,a.dollyStart),a.dollyDelta.y>0?a.dollyIn(a.getZoomScale()):a.dollyDelta.y<0&&a.dollyOut(a.getZoomScale()),a.dollyStart.copy(a.dollyEnd),a.update()}else if(a.state===xi.PAN){if(a.enablePan===!1)return;a.panEnd.set(o.clientX,o.clientY),a.panDelta.subVectors(a.panEnd,a.panStart),a.pan(a.panDelta.x,a.panDelta.y),a.panStart.copy(a.panEnd),a.update()}}},a.onMouseUp=function(o){a.enabled!==!1&&(document.removeEventListener("mousemove",a.onMouseMove,!1),document.removeEventListener("mouseup",a.onMouseUp,!1),a.dispatchEvent(dB),a.state=xi.NONE)},a.onMouseWheel=function(o){a.enabled===!1||a.enableZoom===!1||a.state!==xi.NONE&&a.state!==xi.ROTATE||(o.preventDefault(),o.stopPropagation(),o.deltaY<0?a.dollyOut(a.getZoomScale()):o.deltaY>0&&a.dollyIn(a.getZoomScale()),a.update(),a.dispatchEvent(pB),a.dispatchEvent(dB))},a.onKeyDown=function(o){if(!(a.enabled===!1||a.enableKeys===!1||a.enablePan===!1))switch(o.keyCode){case a.keys.UP:a.pan(0,a.keyPanSpeed),a.update();break;case a.keys.BOTTOM:a.pan(0,-a.keyPanSpeed),a.update();break;case a.keys.LEFT:a.pan(a.keyPanSpeed,0),a.update();break;case a.keys.RIGHT:a.pan(-a.keyPanSpeed,0),a.update();break}},a.onTouchStart=function(o){if(a.enabled!==!1){switch(o.touches.length){case 1:{if(a.enableRotate===!1)return;a.rotateStart.set(o.touches[0].pageX,o.touches[0].pageY),a.state=xi.TOUCH_ROTATE}break;case 2:{if(a.enableZoom===!1)return;var s=o.touches[0].pageX-o.touches[1].pageX,l=o.touches[0].pageY-o.touches[1].pageY,u=Math.sqrt(s*s+l*l);a.dollyStart.set(0,u),a.state=xi.TOUCH_DOLLY}break;case 3:{if(a.enablePan===!1)return;a.panStart.set(o.touches[0].pageX,o.touches[0].pageY),a.state=xi.TOUCH_PAN}break;default:a.state=xi.NONE}a.state!==xi.NONE&&a.dispatchEvent(pB)}},a.onTouchMove=function(o){if(a.enabled!==!1)switch(o.preventDefault(),o.stopPropagation(),o.touches.length){case 1:{if(a.enableRotate===!1||a.state!==xi.TOUCH_ROTATE)return;a.rotateEnd.set(o.touches[0].pageX,o.touches[0].pageY),a.rotateDelta.subVectors(a.rotateEnd,a.rotateStart);var s=a.domElement===document?a.domElement.body:a.domElement;a.rotateLeft(2*Math.PI*a.rotateDelta.x/s.clientWidth*a.rotateSpeed),a.rotateUp(2*Math.PI*a.rotateDelta.y/s.clientHeight*a.rotateSpeed),a.rotateStart.copy(a.rotateEnd),a.update()}break;case 2:{if(a.enableZoom===!1||a.state!==xi.TOUCH_DOLLY)return;var l=o.touches[0].pageX-o.touches[1].pageX,u=o.touches[0].pageY-o.touches[1].pageY,c=Math.sqrt(l*l+u*u);a.dollyEnd.set(0,c),a.dollyDelta.subVectors(a.dollyEnd,a.dollyStart),a.dollyDelta.y>0?a.dollyOut(a.getZoomScale()):a.dollyDelta.y<0&&a.dollyIn(a.getZoomScale()),a.dollyStart.copy(a.dollyEnd),a.update()}break;case 3:{if(a.enablePan===!1||a.state!==xi.TOUCH_PAN)return;a.panEnd.set(o.touches[0].pageX,o.touches[0].pageY),a.panDelta.subVectors(a.panEnd,a.panStart),a.pan(a.panDelta.x,a.panDelta.y),a.panStart.copy(a.panEnd),a.update()}break;default:a.state=xi.NONE}},a.onTouchEnd=function(o){a.enabled!==!1&&(a.dispatchEvent(dB),a.state=xi.NONE)},a.onContextMenu=function(o){o.preventDefault()},a.domElement.addEventListener("contextmenu",a.onContextMenu,!1),a.domElement.addEventListener("mousedown",a.onMouseDown,!1),a.domElement.addEventListener("wheel",a.onMouseWheel,!1),a.domElement.addEventListener("touchstart",a.onTouchStart,!1),a.domElement.addEventListener("touchend",a.onTouchEnd,!1),a.domElement.addEventListener("touchmove",a.onTouchMove,!1),a.window.addEventListener("keydown",a.onKeyDown,!1),a.update(),a}return e.prototype.update=function(){var t=this.object.position;return this.updateOffset.copy(t).sub(this.target),this.updateOffset.applyQuaternion(this.updateQuat),this.spherical.setFromVector3(this.updateOffset),this.autoRotate&&this.state===xi.NONE&&this.rotateLeft(this.getAutoRotationAngle()),this.spherical.theta+=this.sphericalDelta.theta,this.spherical.phi+=this.sphericalDelta.phi,this.spherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.spherical.theta)),this.spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.spherical.phi)),this.spherical.makeSafe(),this.spherical.radius*=this.scale,this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),this.target.add(this.panOffset),this.updateOffset.setFromSpherical(this.spherical),this.updateOffset.applyQuaternion(this.updateQuatInverse),t.copy(this.target).add(this.updateOffset),this.object.lookAt(this.target),this.enableDamping===!0?(this.sphericalDelta.theta*=1-this.dampingFactor,this.sphericalDelta.phi*=1-this.dampingFactor):this.sphericalDelta.set(0,0,0),this.scale=1,this.panOffset.set(0,0,0),this.zoomChanged||this.updateLastPosition.distanceToSquared(this.object.position)>tae||8*(1-this.updateLastQuaternion.dot(this.object.quaternion))>tae?(this.dispatchEvent(eae),this.updateLastPosition.copy(this.object.position),this.updateLastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0):!1},e.prototype.panLeft=function(t,i){this.panLeftV.setFromMatrixColumn(i,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)},e.prototype.panUp=function(t,i){this.panUpV.setFromMatrixColumn(i,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)},e.prototype.pan=function(t,i){var n=this.domElement===document?this.domElement.body:this.domElement;if(this.object instanceof Fr.PerspectiveCamera){var a=this.object.position;this.panInternalOffset.copy(a).sub(this.target);var o=this.panInternalOffset.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*o/n.clientHeight,this.object.matrix),this.panUp(2*i*o/n.clientHeight,this.object.matrix)}else this.object instanceof Fr.OrthographicCamera?(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this.panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)},e.prototype.dollyIn=function(t){this.object instanceof Fr.PerspectiveCamera?this.scale/=t:this.object instanceof Fr.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*t)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)},e.prototype.dollyOut=function(t){this.object instanceof Fr.PerspectiveCamera?this.scale*=t:this.object instanceof Fr.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/t)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)},e.prototype.getAutoRotationAngle=function(){return 2*Math.PI/60/60*this.autoRotateSpeed},e.prototype.getZoomScale=function(){return Math.pow(.95,this.zoomSpeed)},e.prototype.rotateLeft=function(t){this.sphericalDelta.theta-=t},e.prototype.rotateUp=function(t){this.sphericalDelta.phi-=t},e.prototype.getPolarAngle=function(){return this.spherical.phi},e.prototype.getAzimuthalAngle=function(){return this.spherical.theta},e.prototype.dispose=function(){this.domElement.removeEventListener("contextmenu",this.onContextMenu,!1),this.domElement.removeEventListener("mousedown",this.onMouseDown,!1),this.domElement.removeEventListener("wheel",this.onMouseWheel,!1),this.domElement.removeEventListener("touchstart",this.onTouchStart,!1),this.domElement.removeEventListener("touchend",this.onTouchEnd,!1),this.domElement.removeEventListener("touchmove",this.onTouchMove,!1),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.window.removeEventListener("keydown",this.onKeyDown,!1)},e.prototype.reset=function(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(eae),this.update(),this.state=xi.NONE},Object.defineProperty(e.prototype,"center",{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noZoom",{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(t){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!t},enumerable:!0,configurable:!0}),e}(Fr.EventDispatcher);AC.OrbitControls=ULe});var iL=function(r,e){return iL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},iL(r,e)};function Z(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");iL(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Fse=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),zse=function(){function r(){this.browser=new Fse,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r}(),Jh=new zse;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Jh.wxa=!0,Jh.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Jh.worker=!0:typeof navigator>"u"||navigator.userAgent.indexOf("Node.js")===0?(Jh.node=!0,Jh.svgSupported=!0):Bse(navigator.userAgent,Jh);function Bse(r,e){var t=e.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(t.firefox=!0,t.version=i[1]),n&&(t.ie=!0,t.version=n[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in s||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}var Ft=Jh;var $M=12,nL="sans-serif",ho=$M+"px "+nL,kse=20,Vse=100,Gse="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Hse(r){var e={};if(typeof JSON>"u")return e;for(var t=0;t=0)s=o*t.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),r.appendChild(o),t.push(o)}return t}function ale(r,e,t){for(var i=t?"invTrans":"trans",n=e[i],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=r[u].getBoundingClientRect(),f=2*u,h=c.left,p=c.top;o.push(h,p),l=l&&a&&h===a[f]&&p===a[f+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&n?n:(e.srcCoords=o,e[i]=t?cL(s,o):cL(o,s))}function hL(r){return r.nodeName.toUpperCase()==="CANVAS"}var ole=/([&<>"'])/g,sle={"&":"&","<":"<",">":">",'"':""","'":"'"};function yn(r){return r==null?"":(r+"").replace(ole,function(e,t){return sle[t]})}var lle=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,pL=[],ule=Ft.browser.firefox&&+Ft.browser.version.split(".")[0]<39;function sb(r,e,t,i){return t=t||{},i?XV(r,e,t):ule&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):XV(r,e,t),t}function XV(r,e,t){if(Ft.domSupported&&r.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(hL(r)){var a=r.getBoundingClientRect();t.zrX=i-a.left,t.zrY=n-a.top;return}else if(ob(pL,r,i,n)){t.zrX=pL[0],t.zrY=pL[1];return}}t.zrX=t.zrY=0}function lb(r){return r||window.event}function Ta(r,e,t){if(e=lb(e),e.zrX!=null)return e;var i=e.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&sb(r,o,e,t)}else{sb(r,e,e,t);var a=cle(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&lle.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function cle(r){var e=r.wheelDelta;if(e)return e;var t=r.deltaX,i=r.deltaY;if(t==null||i==null)return e;var n=Math.abs(i!==0?i:t),a=i>0?-1:i<0?1:t>0?-1:1;return 3*n*a}function U0(r,e,t,i){r.addEventListener(e,t,i)}function YV(r,e,t,i){r.removeEventListener(e,t,i)}var Ea=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function dL(r){return r.which===2||r.which===3}var ZV=function(){function r(){this._track=[]}return r.prototype.recognize=function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(e,t,i){var n=e.touches;if(n){for(var a={points:[],touches:[],target:t,event:e},o=0,s=n.length;o1&&i&&i.length>1){var a=qV(i)/qV(n);!isFinite(a)&&(a=1),e.pinchScale=a;var o=fle(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:r[0].target,event:e}}}}};function wi(){return[1,0,0,1,0,0]}function uf(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function O0(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r}function Aa(r,e,t){var i=e[0]*t[0]+e[2]*t[1],n=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function _n(r,e,t){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4]+t[0],r[5]=e[5]+t[1],r}function Ca(r,e,t,i){i===void 0&&(i=[0,0]);var n=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],c=Math.sin(t),f=Math.cos(t);return r[0]=n*f+s*c,r[1]=-n*c+s*f,r[2]=a*f+l*c,r[3]=-a*c+f*l,r[4]=f*(o-i[0])+c*(u-i[1])+i[0],r[5]=f*(u-i[1])-c*(o-i[0])+i[1],r}function Cm(r,e,t){var i=t[0],n=t[1];return r[0]=e[0]*i,r[1]=e[1]*n,r[2]=e[2]*i,r[3]=e[3]*n,r[4]=e[4]*i,r[5]=e[5]*n,r}function Yo(r,e){var t=e[0],i=e[2],n=e[4],a=e[1],o=e[3],s=e[5],l=t*o-a*i;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-i*l,r[3]=t*l,r[4]=(i*s-o*n)*l,r[5]=(a*n-t*s)*l,r):null}function jV(r){var e=wi();return O0(e,r),e}var hle=function(){function r(e,t){this.x=e||0,this.y=t||0}return r.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(e,t){return this.x=e,this.y=t,this},r.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},r.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},r.prototype.scale=function(e){this.x*=e,this.y*=e},r.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},r.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},r.prototype.dot=function(e){return this.x*e.x+this.y*e.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},r.prototype.distance=function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},r.prototype.distanceSquare=function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(e){if(e){var t=this.x,i=this.y;return this.x=e[0]*t+e[2]*i+e[4],this.y=e[1]*t+e[3]*i+e[5],this}},r.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},r.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},r.set=function(e,t,i){e.x=t,e.y=i},r.copy=function(e,t){e.x=t.x,e.y=t.y},r.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},r.lenSquare=function(e){return e.x*e.x+e.y*e.y},r.dot=function(e,t){return e.x*t.x+e.y*t.y},r.add=function(e,t,i){e.x=t.x+i.x,e.y=t.y+i.y},r.sub=function(e,t,i){e.x=t.x-i.x,e.y=t.y-i.y},r.scale=function(e,t,i){e.x=t.x*i,e.y=t.y*i},r.scaleAndAdd=function(e,t,i,n){e.x=t.x+i.x*n,e.y=t.y+i.y*n},r.lerp=function(e,t,i,n){var a=1-n;e.x=a*t.x+n*i.x,e.y=a*t.y+n*i.y},r}(),Nt=hle;var ub=Math.min,cb=Math.max,tp=new Nt,rp=new Nt,ip=new Nt,np=new Nt,F0=new Nt,z0=new Nt,ple=function(){function r(e,t,i,n){i<0&&(e=e+i,i=-i),n<0&&(t=t+n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}return r.prototype.union=function(e){var t=ub(e.x,this.x),i=ub(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=cb(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=cb(e.y+e.height,this.y+this.height)-i:this.height=e.height,this.x=t,this.y=i},r.prototype.applyTransform=function(e){r.applyTransform(this,this,e)},r.prototype.calculateTransform=function(e){var t=this,i=e.width/t.width,n=e.height/t.height,a=wi();return _n(a,a,[-t.x,-t.y]),Cm(a,a,[i,n]),_n(a,a,[e.x,e.y]),a},r.prototype.intersect=function(e,t){if(!e)return!1;e instanceof r||(e=r.create(e));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,c=e.y,f=e.y+e.height,h=!(ad&&(d=y,gd&&(d=x,v<_?Nt.set(z0,0,-v):Nt.set(z0,0,_)):y=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(e){r.copy(this,e)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(e){return new r(e.x,e.y,e.width,e.height)},r.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},r.applyTransform=function(e,t,i){if(!i){e!==t&&r.copy(e,t);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];e.x=t.x*n+o,e.y=t.y*a+s,e.width=t.width*n,e.height=t.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}tp.x=ip.x=t.x,tp.y=np.y=t.y,rp.x=np.x=t.x+t.width,rp.y=ip.y=t.y+t.height,tp.transform(i),np.transform(i),rp.transform(i),ip.transform(i),e.x=ub(tp.x,rp.x,ip.x,np.x),e.y=ub(tp.y,rp.y,ip.y,np.y);var l=cb(tp.x,rp.x,ip.x,np.x),u=cb(tp.y,rp.y,ip.y,np.y);e.width=l-e.x,e.height=u-e.y},r}(),lt=ple;var JV="silent";function dle(r,e,t){return{type:r,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:mle}}function mle(){Ea(this.event)}var vle=function(r){Xt(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Di),B0=function(){function r(e,t){this.x=e,this.y=t}return r}(),gle=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],vL=new lt(0,0,0,0),$V=function(r){Xt(e,r);function e(t,i,n,a,o){var s=r.call(this)||this;return s._hovered=new B0(0,0),s.storage=t,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new vle,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new GV(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(N(gle,function(i){t.on&&t.on(i,this[i],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var i=t.zrX,n=t.zrY,a=QV(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new B0(i,n):this.findHover(i,n),u=l.target,c=this.proxy;c.setCursor&&c.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var i=t.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new B0(0,0)},e.prototype.dispatch=function(t,i){var n=this[t];n&&n.call(this,i)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var i=this.proxy;i.setCursor&&i.setCursor(t)},e.prototype.dispatchToElement=function(t,i,n){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var o="on"+i,s=dle(i,t,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},e.prototype.findHover=function(t,i,n){var a=this.storage.getDisplayList(),o=new B0(t,i);if(KV(a,o,t,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,c=new lt(t-u,i-u,l,l),f=a.length-1;f>=0;f--){var h=a[f];h!==n&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(vL.copy(h.getBoundingRect()),h.transform&&vL.applyTransform(h.transform),vL.intersect(c)&&s.push(h))}if(s.length)for(var p=4,d=Math.PI/12,g=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,r,e)}});function yle(r,e,t){if(r[r.rectHover?"rectContain":"contain"](e,t)){for(var i=r,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(e,t))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s||i.parent}return n?JV:!0}return!1}function KV(r,e,t,i,n){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==n&&!o.ignore&&(s=yle(o,t,i))&&(!e.topTarget&&(e.topTarget=o),s!==JV)){e.target=o;break}}}function QV(r,e,t){var i=r.painter;return e<0||e>i.getWidth()||t<0||t>i.getHeight()}var eG=$V;var iG=32,k0=7;function _le(r){for(var e=0;r>=iG;)e|=r&1,r>>=1;return r+e}function tG(r,e,t,i){var n=e+1;if(n===t)return 1;if(i(r[n++],r[e])<0){for(;n=0;)n++;return n-e}function xle(r,e,t){for(t--;e>>1,n(a,r[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function gL(r,e,t,i,n,a){var o=0,s=0,l=1;if(a(r,e[t+n])>0){for(s=i-n;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o>>1);a(r,e[t+c])>0?o=c+1:l=c}return l}function yL(r,e,t,i,n,a){var o=0,s=0,l=1;if(a(r,e[t+n])<0){for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o>>1);a(r,e[t+c])<0?l=c:o=c+1}return l}function Sle(r,e){var t=k0,i,n,a=0,o=[];i=[],n=[];function s(p,d){i[a]=p,n[a]=d,a+=1}function l(){for(;a>1;){var p=a-2;if(p>=1&&n[p-1]<=n[p]+n[p+1]||p>=2&&n[p-2]<=n[p]+n[p-1])n[p-1]n[p+1])break;c(p)}}function u(){for(;a>1;){var p=a-2;p>0&&n[p-1]=k0||w>=k0);if(T)break;M<0&&(M=0),M+=2}if(t=M,t<1&&(t=1),d===1){for(v=0;v=0;v--)r[S+v]=r[M+v];r[x]=o[y];return}for(var w=t;;){var T=0,C=0,b=!1;do if(e(o[y],r[_])<0){if(r[x--]=r[_--],T++,C=0,--d===0){b=!0;break}}else if(r[x--]=o[y--],C++,T=0,--m===1){b=!0;break}while((T|C)=0;v--)r[S+v]=r[M+v];if(d===0){b=!0;break}}if(r[x--]=o[y--],--m===1){b=!0;break}if(C=m-gL(r[_],o,0,m,m-1,e),C!==0){for(x-=C,y-=C,m-=C,S=x+1,M=y+1,v=0;v=k0||C>=k0);if(b)break;w<0&&(w=0),w+=2}if(t=w,t<1&&(t=1),m===1){for(x-=d,_-=d,S=x+1,M=_+1,v=d-1;v>=0;v--)r[S+v]=r[M+v];r[x]=o[y]}else{if(m===0)throw new Error;for(M=x-(m-1),v=0;vs&&(l=s),rG(r,t,t+l,t+a,e),a=l}o.pushRun(t,a),o.mergeRuns(),n-=a,t+=a}while(n!==0);o.forceMergeRuns()}}var zi=1,op=2,cf=4;var nG=!1;function _L(){nG||(nG=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function aG(r,e){return r.zlevel===e.zlevel?r.z===e.z?r.z2-e.z2:r.z-e.z:r.zlevel-e.zlevel}var Mle=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=aG}return r.prototype.traverse=function(e,t){for(var i=0;i0&&(c.__clipPaths=[]),isNaN(c.z)&&(_L(),c.z=0),isNaN(c.z2)&&(_L(),c.z2=0),isNaN(c.zlevel)&&(_L(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,t,i);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,t,i);var p=e.getTextContent();p&&this._updateAndAddDisplayable(p,t,i)}},r.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},r.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,i=e.length;t=0&&this._roots.splice(n,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),oG=Mle;var sG;sG=Ft.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var V0=sG;var fb={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)))},elasticOut:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*r)*Math.sin((r-e)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),(r*=2)<1?-.5*(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)):t*Math.pow(2,-10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var e=1.70158;return r*r*((e+1)*r-e)},backOut:function(r){var e=1.70158;return--r*r*((e+1)*r+e)+1},backInOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)},bounceIn:function(r){return 1-fb.bounceOut(1-r)},bounceOut:function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},bounceInOut:function(r){return r<.5?fb.bounceIn(r*2)*.5:fb.bounceOut(r*2-1)*.5+.5}},hb=fb;var pb=Math.pow,hf=Math.sqrt,mb=1e-8,uG=1e-4,lG=hf(3),db=1/3,Cl=Al(),qo=Al(),Rm=Al();function ff(r){return r>-mb&&rmb||r<-mb}function hi(r,e,t,i,n){var a=1-n;return a*a*(a*r+3*n*e)+n*n*(n*i+3*a*t)}function xL(r,e,t,i,n){var a=1-n;return 3*(((e-r)*a+2*(t-e)*n)*a+(i-t)*n*n)}function sp(r,e,t,i,n,a){var o=i+3*(e-t)-r,s=3*(t-e*2+r),l=3*(e-r),u=r-n,c=s*s-3*o*l,f=s*l-9*o*u,h=l*l-3*s*u,p=0;if(ff(c)&&ff(f))if(ff(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[p++]=d)}else{var g=f*f-4*c*h;if(ff(g)){var m=f/c,d=-s/o+m,v=-m/2;d>=0&&d<=1&&(a[p++]=d),v>=0&&v<=1&&(a[p++]=v)}else if(g>0){var _=hf(g),y=c*s+1.5*o*(-f+_),x=c*s+1.5*o*(-f-_);y<0?y=-pb(-y,db):y=pb(y,db),x<0?x=-pb(-x,db):x=pb(x,db);var d=(-s-(y+x))/(3*o);d>=0&&d<=1&&(a[p++]=d)}else{var M=(2*c*s-3*o*f)/(2*hf(c*c*c)),S=Math.acos(M)/3,w=hf(c),T=Math.cos(S),d=(-s-2*w*T)/(3*o),v=(-s+w*(T+lG*Math.sin(S)))/(3*o),C=(-s+w*(T-lG*Math.sin(S)))/(3*o);d>=0&&d<=1&&(a[p++]=d),v>=0&&v<=1&&(a[p++]=v),C>=0&&C<=1&&(a[p++]=C)}}return p}function vb(r,e,t,i,n){var a=6*t-12*e+6*r,o=9*e+3*i-3*r-9*t,s=3*e-3*r,l=0;if(ff(o)){if(cG(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var c=a*a-4*o*s;if(ff(c))n[0]=-a/(2*o);else if(c>0){var f=hf(c),u=(-a+f)/(2*o),h=(-a-f)/(2*o);u>=0&&u<=1&&(n[l++]=u),h>=0&&h<=1&&(n[l++]=h)}}return l}function Zo(r,e,t,i,n,a){var o=(e-r)*n+r,s=(t-e)*n+e,l=(i-t)*n+t,u=(s-o)*n+o,c=(l-s)*n+s,f=(c-u)*n+u;a[0]=r,a[1]=o,a[2]=u,a[3]=f,a[4]=f,a[5]=c,a[6]=l,a[7]=i}function gb(r,e,t,i,n,a,o,s,l,u,c){var f,h=.005,p=1/0,d,g,m,v;Cl[0]=l,Cl[1]=u;for(var _=0;_<1;_+=.05)qo[0]=hi(r,t,n,o,_),qo[1]=hi(e,i,a,s,_),m=yu(Cl,qo),m=0&&m=0&&u<=1&&(n[l++]=u)}}else{var c=o*o-4*a*s;if(ff(c)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(c>0){var f=hf(c),u=(-o+f)/(2*a),h=(-o-f)/(2*a);u>=0&&u<=1&&(n[l++]=u),h>=0&&h<=1&&(n[l++]=h)}}return l}function yb(r,e,t){var i=r+t-2*e;return i===0?.5:(r-e)/i}function pf(r,e,t,i,n){var a=(e-r)*i+r,o=(t-e)*i+e,s=(o-a)*i+a;n[0]=r,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=t}function _b(r,e,t,i,n,a,o,s,l){var u,c=.005,f=1/0;Cl[0]=o,Cl[1]=s;for(var h=0;h<1;h+=.05){qo[0]=vi(r,t,n,h),qo[1]=vi(e,i,a,h);var p=yu(Cl,qo);p=0&&p=1?1:sp(0,i,a,1,l,s)&&hi(0,n,o,1,s[0])}}}var wle=function(){function r(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Ir,this.ondestroy=e.ondestroy||Ir,this.onrestart=e.onrestart||Ir,e.easing&&this.setEasing(e.easing)}return r.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var i=this._life,n=e-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(e){this.easing=e,this.easingFunc=He(e)?e:hb[e]||Lm(e)},r}(),dG=wle;var mG=function(){function r(e){this.value=e}return r}();var Tle=function(){function r(){this._len=0}return r.prototype.insert=function(e){var t=new mG(e);return this.insertEntry(t),t},r.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},r.prototype.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}();var Ele=function(){function r(e){this._list=new Tle,this._maxSize=10,this._map={},this._maxSize=e}return r.prototype.put=function(e,t){var i=this._list,n=this._map,a=null;if(n[e]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new mG(t),s.key=e,i.insertEntry(s),n[e]=s}return a},r.prototype.get=function(e){var t=this._map[e],i=this._list;if(t!=null)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),_u=Ele;var vG={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ns(r){return r=Math.round(r),r<0?0:r>255?255:r}function Ale(r){return r=Math.round(r),r<0?0:r>360?360:r}function W0(r){return r<0?0:r>1?1:r}function SL(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?Ns(parseFloat(e)/100*255):Ns(parseInt(e,10))}function lp(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?W0(parseFloat(e)/100):W0(parseFloat(e))}function ML(r,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?r+(e-r)*t*6:t*2<1?e:t*3<2?r+(e-r)*(2/3-t)*6:r}function df(r,e,t){return r+(e-r)*t}function jo(r,e,t,i,n){return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r}function bL(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}var yG=new _u(20),xb=null;function Pm(r,e){xb&&bL(xb,e),xb=yG.put(r,xb||e.slice())}function cn(r,e){if(r){e=e||[];var t=yG.get(r);if(t)return bL(e,t);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in vG)return bL(e,vG[i]),Pm(r,e),e;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){jo(e,0,0,0,1);return}return jo(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),Pm(r,e),e}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){jo(e,0,0,0,1);return}return jo(e,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),Pm(r,e),e}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?jo(e,+u[0],+u[1],+u[2],1):jo(e,0,0,0,1);c=lp(u.pop());case"rgb":if(u.length>=3)return jo(e,SL(u[0]),SL(u[1]),SL(u[2]),u.length===3?c:lp(u[3])),Pm(r,e),e;jo(e,0,0,0,1);return;case"hsla":if(u.length!==4){jo(e,0,0,0,1);return}return u[3]=lp(u[3]),wL(u,e),Pm(r,e),e;case"hsl":if(u.length!==3){jo(e,0,0,0,1);return}return wL(u,e),Pm(r,e),e;default:return}}jo(e,0,0,0,1)}}function wL(r,e){var t=(parseFloat(r[0])%360+360)%360/360,i=lp(r[1]),n=lp(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],jo(e,Ns(ML(o,a,t+1/3)*255),Ns(ML(o,a,t)*255),Ns(ML(o,a,t-1/3)*255),1),r.length===4&&(e[3]=r[3]),e}function Cle(r){if(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(e,t,i),a=Math.max(e,t,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var c=((a-e)/6+o/2)/o,f=((a-t)/6+o/2)/o,h=((a-i)/6+o/2)/o;e===a?l=h-f:t===a?l=1/3+c-h:i===a&&(l=2/3+f-c),l<0&&(l+=1),l>1&&(l-=1)}var p=[l*360,u,s];return r[3]!=null&&p.push(r[3]),p}}function Sb(r,e){var t=cn(r);if(t){for(var i=0;i<3;i++)e<0?t[i]=t[i]*(1-e)|0:t[i]=(255-t[i])*e+t[i]|0,t[i]>255?t[i]=255:t[i]<0&&(t[i]=0);return Ko(t,t.length===4?"rgba":"rgb")}}function Mb(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){t=t||[];var i=r*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=e[n],s=e[a],l=i-n;return t[0]=Ns(df(o[0],s[0],l)),t[1]=Ns(df(o[1],s[1],l)),t[2]=Ns(df(o[2],s[2],l)),t[3]=W0(df(o[3],s[3],l)),t}}function _G(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){var i=r*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=cn(e[n]),s=cn(e[a]),l=i-n,u=Ko([Ns(df(o[0],s[0],l)),Ns(df(o[1],s[1],l)),Ns(df(o[2],s[2],l)),W0(df(o[3],s[3],l))],"rgba");return t?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function up(r,e,t,i){var n=cn(r);if(r)return n=Cle(n),e!=null&&(n[0]=Ale(e)),t!=null&&(n[1]=lp(t)),i!=null&&(n[2]=lp(i)),Ko(wL(n),"rgba")}function cp(r,e){var t=cn(r);if(t&&e!=null)return t[3]=W0(e),Ko(t,"rgba")}function Ko(r,e){if(!(!r||!r.length)){var t=r[0]+","+r[1]+","+r[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+r[3]),e+"("+t+")"}}function Dm(r,e){var t=cn(r);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var gG=new _u(100);function X0(r){if(Ce(r)){var e=gG.get(r);return e||(e=Sb(r,-.1),gG.put(r,e)),e}else if(of(r)){var t=fe({},r);return t.colorStops=de(r.colorStops,function(i){return{offset:i.offset,color:Sb(i.color,-.1)}}),t}return r}var wb=Math.round;function mf(r){var e;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var t=cn(r);t&&(r="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:r,opacity:e??1}}var xG=1e-4;function Rl(r){return r-xG}function bb(r){return wb(r*1e3)/1e3}function Tb(r){return wb(r*1e4)/1e4}function SG(r){return"matrix("+bb(r[0])+","+bb(r[1])+","+bb(r[2])+","+bb(r[3])+","+Tb(r[4])+","+Tb(r[5])+")"}var MG={left:"start",right:"end",center:"middle",middle:"middle"};function bG(r,e,t){return t==="top"?r+=e/2:t==="bottom"&&(r-=e/2),r}function wG(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function TG(r){var e=r.style,t=r.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function EL(r){return r&&!!r.image}function Rle(r){return r&&!!r.svgElement}function Y0(r){return EL(r)||Rle(r)}function Eb(r){return r.type==="linear"}function Ab(r){return r.type==="radial"}function Cb(r){return r&&(r.type==="linear"||r.type==="radial")}function q0(r){return"url(#"+r+")"}function Rb(r){var e=r.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function Lb(r){var e=r.x||0,t=r.y||0,i=(r.rotation||0)*bm,n=ft(r.scaleX,1),a=ft(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+wb(o*bm)+"deg, "+wb(s*bm)+"deg)"),l.join(" ")}var EG=function(){return Ft.hasGlobalWindow&&He(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}();var CL=Array.prototype.slice;function xu(r,e,t){return(e-r)*t+r}function AL(r,e,t,i){for(var n=e.length,a=0;ai?e:r,a=Math.min(t,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)i.length=o;else for(var l=a;l=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(e,t,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=CG,l=t;if(ci(t)){var u=Ile(t);s=u,(u===1&&!At(t[0])||u===2&&!At(t[0][0]))&&(o=!0)}else if(At(t)&&!sf(t))s=Db;else if(Ce(t))if(!isNaN(+t))s=Db;else{var c=cn(t);c&&(l=c,s=j0)}else if(of(t)){var f=fe({},l);f.colorStops=de(t.colorStops,function(p){return{offset:p.offset,color:cn(p.color)}}),Eb(t)?s=RL:Ab(t)&&(s=LL),l=f}a===0?this.valType=s:(s!==this.valType||s===CG)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:l,rawValue:t,percent:0};return i&&(h.easing=i,h.easingFunc=He(i)?i:hb[i]||Lm(i)),n.push(h),h},r.prototype.prepare=function(e,t){var i=this.keyframes;this._needsSort&&i.sort(function(g,m){return g.time-m.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=Ib(n),u=RG(n),c=0;c=0&&!(o[c].percent<=t);c--);c=h(c,s-2)}else{for(c=f;ct);c++);c=h(c-1,s-2)}d=o[c+1],p=o[c]}if(p&&d){this._lastFr=c,this._lastFrP=t;var m=d.percent-p.percent,v=m===0?1:h((t-p.percent)/m,1);d.easingFunc&&(v=d.easingFunc(v));var _=i?this._additiveValue:u?Z0:e[l];if((Ib(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)e[l]=v<1?p.rawValue:d.rawValue;else if(Ib(a))a===Ub?AL(_,p[n],d[n],v):Lle(_,p[n],d[n],v);else if(RG(a)){var y=p[n],x=d[n],M=a===RL;e[l]={type:M?"linear":"radial",x:xu(y.x,x.x,v),y:xu(y.y,x.y,v),colorStops:de(y.colorStops,function(w,T){var C=x.colorStops[T];return{offset:xu(w.offset,C.offset,v),color:Nb(AL([],w.color,C.color,v))}}),global:x.global},M?(e[l].x2=xu(y.x2,x.x2,v),e[l].y2=xu(y.y2,x.y2,v)):e[l].r=xu(y.r,x.r,v)}else if(u)AL(_,p[n],d[n],v),i||(e[l]=Nb(_));else{var S=xu(p[n],d[n],v);i?this._additiveValue=S:e[l]=S}i&&this._addToTarget(e)}}},r.prototype._addToTarget=function(e){var t=this.valType,i=this.propName,n=this._additiveValue;t===Db?e[i]=e[i]+n:t===j0?(cn(e[i],Z0),Pb(Z0,Z0,n,1),e[i]=Nb(Z0)):t===Ub?Pb(e[i],e[i],n,1):t===LG&&AG(e[i],e[i],n,1)},r}(),Ule=function(){function r(e,t,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&n){$h("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(e){this._target=e},r.prototype.when=function(e,t,i){return this.whenWithKeys(e,t,bt(t),i)},r.prototype.whenWithKeys=function(e,t,i,n){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,fp(u),n),this._trackKeys.push(s)}l.addKeyframe(e,fp(t[s]),n)}return this._maxTime=Math.max(this._maxTime,e),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,i=0;i0)){this._started=1;for(var t=this,i=[],n=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,e[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}(),K0=Ule;function hp(){return new Date().getTime()}var Ole=function(r){Xt(e,r);function e(t){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,t=t||{},i.stage=t.stage||{},i}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var i=t.getClip();i&&this.addClip(i)},e.prototype.removeClip=function(t){if(t.animation){var i=t.prev,n=t.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var i=t.getClip();i&&this.removeClip(i),t.animation=null},e.prototype.update=function(t){for(var i=hp()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function i(){t._running&&(V0(i),!t._paused&&t.update())}V0(i)},e.prototype.start=function(){this._running||(this._time=hp(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=hp(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=hp()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var i=t.next;t.prev=t.next=t.animation=null,t=i}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,i){i=i||{},this.start();var n=new K0(t,i.loop);return this.addAnimator(n),n},e}(Di),PG=Ole;var Fle=300,PL=Ft.domSupported,DL=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=de(r,function(n){var a=n.replace("mouse","pointer");return t.hasOwnProperty(a)?a:n});return{mouse:r,touch:e,pointer:i}}(),DG={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},IG=!1;function UL(r){var e=r.pointerType;return e==="pen"||e==="touch"}function zle(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function IL(r){r&&(r.zrByTouch=!0)}function Ble(r,e){return Ta(r.dom,new kle(r,e),!0)}function UG(r,e){for(var t=e,i=!1;t&&t.nodeType!==9&&!(i=t.domBelongToZr||t!==e&&t===r.painterRoot);)t=t.parentNode;return i}var kle=function(){function r(e,t){this.stopPropagation=Ir,this.stopImmediatePropagation=Ir,this.preventDefault=Ir,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return r}(),Us={mousedown:function(r){r=Ta(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=Ta(this.dom,r);var e=this.__mayPointerCapture;e&&(r.zrX!==e[0]||r.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=Ta(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=Ta(this.dom,r);var e=r.toElement||r.relatedTarget;UG(this,e)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){IG=!0,r=Ta(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){IG||(r=Ta(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=Ta(this.dom,r),IL(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),Us.mousemove.call(this,r),Us.mousedown.call(this,r)},touchmove:function(r){r=Ta(this.dom,r),IL(r),this.handler.processGesture(r,"change"),Us.mousemove.call(this,r)},touchend:function(r){r=Ta(this.dom,r),IL(r),this.handler.processGesture(r,"end"),Us.mouseup.call(this,r),+new Date-+this.__lastTouchMomentkG||r<-kG}var mp=[],Im=[],FL=wi(),zL=Math.abs,Wle=function(){function r(){}return r.prototype.getLocalTransform=function(e){return r.getLocalTransform(this,e)},r.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},r.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},r.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},r.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},r.prototype.needLocalTransform=function(){return dp(this.rotation)||dp(this.x)||dp(this.y)||dp(this.scaleX-1)||dp(this.scaleY-1)||dp(this.skewX)||dp(this.skewY)},r.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),i=this.transform;if(!(t||e)){i&&(BG(i),this.invTransform=null);return}i=i||wi(),t?this.getLocalTransform(i):BG(i),e&&(t?Aa(i,e,i):O0(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(mp);var i=mp[0]<0?-1:1,n=mp[1]<0?-1:1,a=((mp[0]-i)*t+i)/mp[0]||0,o=((mp[1]-n)*t+n)/mp[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||wi(),Yo(this.invTransform,e)},r.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},r.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=Math.atan2(e[1],e[0]),a=Math.PI/2+n-Math.atan2(e[3],e[2]);i=Math.sqrt(i)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||wi(),Aa(Im,e.invTransform,t),t=Im);var i=this.originX,n=this.originY;(i||n)&&(FL[4]=i,FL[5]=n,Aa(Im,t,FL),Im[4]-=i,Im[5]-=n,t=Im),this.setLocalTransform(t)}},r.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},r.prototype.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&fi(i,i,n),i},r.prototype.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&fi(i,i,n),i},r.prototype.getLineScale=function(){var e=this.transform;return e&&zL(e[0]-1)>1e-10&&zL(e[3]-1)>1e-10?Math.sqrt(zL(e[0]*e[3]-e[2]*e[1])):1},r.prototype.copyTransform=function(e){BL(this,e)},r.getLocalTransform=function(e,t){t=t||[];var i=e.originX||0,n=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,c=e.x,f=e.y,h=e.skewX?Math.tan(e.skewX):0,p=e.skewY?Math.tan(-e.skewY):0;if(i||n||s||l){var d=i+s,g=n+l;t[4]=-d*a-h*g*o,t[5]=-g*o-p*d*a}else t[4]=t[5]=0;return t[0]=a,t[3]=o,t[1]=p*a,t[2]=h*o,u&&Ca(t,t,u),t[4]+=i+c,t[5]+=n+f,t},r.initDefaultProps=function(){var e=r.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),r}(),go=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function BL(r,e){for(var t=0;t=0?parseFloat(r)/100*e:parseFloat(r):r}function gp(r,e,t){var i=e.position||"inside",n=e.distance!=null?e.distance:5,a=t.height,o=t.width,s=a/2,l=t.x,u=t.y,c="left",f="top";if(i instanceof Array)l+=xn(i[0],t.width),u+=xn(i[1],t.height),c=null,f=null;else switch(i){case"left":l-=n,u+=s,c="right",f="middle";break;case"right":l+=n+o,u+=s,f="middle";break;case"top":l+=o/2,u-=n,c="center",f="bottom";break;case"bottom":l+=o/2,u+=a+n,c="center";break;case"inside":l+=o/2,u+=s,c="center",f="middle";break;case"insideLeft":l+=n,u+=s,f="middle";break;case"insideRight":l+=o-n,u+=s,c="right",f="middle";break;case"insideTop":l+=o/2,u+=n,c="center";break;case"insideBottom":l+=o/2,u+=a-n,c="center",f="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,c="right";break;case"insideBottomLeft":l+=n,u+=a-n,f="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,c="right",f="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=c,r.verticalAlign=f,r}var kL="__zr_normal__",VL=go.concat(["ignore"]),Xle=gn(go,function(r,e){return r[e]=!0,r},{ignore:!1}),Om={},Yle=new lt(0,0,0,0),WL=function(){function r(e){this.id=tb(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return r.prototype._init=function(e){this.attr(e)},r.prototype.drift=function(e,t,i){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=t,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=t.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(t),i.position!=null){var c=Yle;i.layoutRect?c.copy(i.layoutRect):c.copy(this.getBoundingRect()),n||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Om,i,c):gp(Om,i,c),a.x=Om.x,a.y=Om.y,o=Om.align,s=Om.verticalAlign;var f=i.origin;if(f&&i.rotation!=null){var h=void 0,p=void 0;f==="center"?(h=c.width*.5,p=c.height*.5):(h=xn(f[0],c.width),p=xn(f[1],c.height)),u=!0,a.originX=-a.x+h+(n?0:c.x),a.originY=-a.y+p+(n?0:c.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],u||(a.originX=-d[0],a.originY=-d[1]));var g=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,_=void 0,y=void 0;g&&this.canBeInsideText()?(v=i.insideFill,_=i.insideStroke,(v==null||v==="auto")&&(v=this.getInsideTextFill()),(_==null||_==="auto")&&(_=this.getInsideTextStroke(v),y=!0)):(v=i.outsideFill,_=i.outsideStroke,(v==null||v==="auto")&&(v=this.getOutsideFill()),(_==null||_==="auto")&&(_=this.getOutsideStroke(v),y=!0)),v=v||"#000",(v!==m.fill||_!==m.stroke||y!==m.autoStroke||o!==m.align||s!==m.verticalAlign)&&(l=!0,m.fill=v,m.stroke=_,m.autoStroke=y,m.align=o,m.verticalAlign=s,t.setDefaultTextStyle(m)),t.__dirty|=zi,l&&t.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(e){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Q0:$0},r.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),i=typeof t=="string"&&cn(t);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,Ko(i,"rgba")},r.prototype.traverse=function(e,t){},r.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},fe(this.extra,t)):this[e]=t},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(qe(e))for(var i=e,n=bt(i),a=0;a0},r.prototype.getState=function(e){return this.states[e]},r.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},r.prototype.clearStates=function(e){this.useState(kL,!1,e)},r.prototype.useState=function(e,t,i,n){var a=e===kL,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(dt(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){$h("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||n);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!i&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(e,t,i,c),h&&h.useState(e,t,i,c),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~zi),u}}},r.prototype.useStates=function(e,t,i){if(!e.length)this.clearStates();else{var n=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l0,d);var g=this._textContent,m=this._textGuide;g&&g.useStates(e,t,h),m&&m.useStates(e,t,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~zi)}},r.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},r.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var i=this.currentStates.slice();i.splice(t,1),this.useStates(i)}},r.prototype.replaceState=function(e,t,i){var n=this.currentStates.slice(),a=dt(n,e),o=dt(n,t)>=0;a>=0?o?n.splice(a,1):n[a]=t:i&&!o&&n.push(t),this.useStates(n)},r.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},r.prototype._mergeStates=function(e){for(var t={},i,n=0;n=0&&a.splice(o,1)}),this.animators.push(e),i&&i.animation.addAnimator(e),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(e){this.markRedraw()},r.prototype.stopAnimation=function(e,t){for(var i=this.animators,n=i.length,a=[],o=0;o0&&t.during&&a[0].during(function(d,g){t.during(g)});for(var h=0;h0||n.force&&!o.length){var T=void 0,C=void 0,b=void 0;if(s){C={},h&&(T={});for(var x=0;x=0&&(n.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,i){var n=dt(this._children,t);return n>=0&&this.replaceAt(i,n),this},e.prototype.replaceAt=function(t,i){var n=this._children,a=n[i];if(t&&t!==this&&t.parent!==this&&t!==a){n[i]=t,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var i=this.__zr;i&&i!==t.__zr&&t.addSelfToZr(i),i&&i.refresh()},e.prototype.remove=function(t){var i=this.__zr,n=this._children,a=dt(n,t);return a<0?this:(n.splice(a,1),t.parent=null,i&&t.removeSelfFromZr(i),i&&i.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,i=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},r.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},r.prototype.on=function(e,t,i){return this._disposed||this.handler.on(e,t,i),this},r.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},r.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},r.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(r<=n)return o;if(r>=a)return s}else{if(r>=n)return o;if(r<=a)return s}else{if(r===n)return o;if(r===a)return s}return(r-n)/l*u+o}function Fe(r,e){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return Ce(r)?tue(r).match(/%$/)?parseFloat(r)/100*e:parseFloat(r):r==null?NaN:+r}function Ar(r,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),KG),r=(+r).toFixed(e),t?r:+r}function Ti(r){return r.sort(function(e,t){return e-t}),r}function Sn(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(r*e)/e===r)return t}return qL(r)}function qL(r){var e=r.toString().toLowerCase(),t=e.indexOf("e"),i=t>0?+e.slice(t+1):0,n=t>0?t:e.length,a=e.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function Fm(r,e){var t=Math.log,i=Math.LN10,n=Math.floor(t(r[1]-r[0])/i),a=Math.round(t(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function JG(r,e,t){if(!r[e])return 0;var i=ZL(r,t);return i[e]||0}function ZL(r,e){var t=gn(r,function(p,d){return p+(isNaN(d)?0:d)},0);if(t===0)return[];for(var i=Math.pow(10,e),n=de(r,function(p){return(isNaN(p)?0:p)/t*i*100}),a=i*100,o=de(n,function(p){return Math.floor(p)}),s=gn(o,function(p,d){return p+d},0),l=de(n,function(p,d){return p-o[d]});su&&(u=l[f],c=f);++o[c],l[c]=0,++s}return de(o,function(p){return p/i})}function $G(r,e){var t=Math.max(Sn(r),Sn(e)),i=r+e;return t>KG?i:Ar(i,t)}var e_=9007199254740991;function t_(r){var e=Math.PI*2;return(r%e+e)%e}function Su(r){return r>-jG&&r=10&&e++,e}function Bm(r,e){var t=zm(r),i=Math.pow(10,t),n=r/i,a;return e?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,r=a*i,t>=-20?+r.toFixed(t<0?-t:0):r}function km(r,e){var t=(r.length-1)*e+1,i=Math.floor(t),n=+r[i-1],a=t-i;return a?n+a*(r[i]-n):n}function r_(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,t=1,i=0;i=0||a&&dt(a,l)<0)){var u=i.getShallow(l,e);u!=null&&(o[r[s][0]]=u)}}return o}}var xue=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Sue=Na(xue),vH=function(){function r(){}return r.prototype.getAreaStyle=function(e,t){return Sue(this,e,t)},r}();var QL=new _u(50);function yH(r){if(typeof r=="string"){var e=QL.get(r);return e&&e.image}else return r}function o_(r,e,t,i,n){if(r)if(typeof r=="string"){if(e&&e.__zrImageSrc===r||!t)return e;var a=QL.get(r),o={hostEl:t,cb:i,cbPayload:n};return a?(e=a.image,!Wm(e)&&a.pending.push(o)):(e=zn.loadImage(r,gH,gH),e.__zrImageSrc=r,QL.put(r,e.__cachedImgObj={image:e,pending:[o]})),e}else return r;else return e}function gH(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e>16&255)/255,this.g=(r>>8&255)/255,this.b=(r&255)/255,this},setRGB:function(r,e,t){return this.r=r,this.g=e,this.b=t,this},setHSL:function(){function r(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*6*(2/3-i):e}return function(t,i,n){if(t=cr.euclideanModulo(t,1),i=cr.clamp(i,0,1),n=cr.clamp(n,0,1),i===0)this.r=this.g=this.b=n;else{var a=n<=.5?n*(1+i):n+i-n*i,o=2*n-a;this.r=r(o,a,t+1/3),this.g=r(o,a,t),this.b=r(o,a,t-1/3)}return this}}(),setStyle:function(r){function e(f){f!==void 0&&parseFloat(f)<1&&console.warn("THREE.Color: Alpha component of "+r+" will be ignored.")}var t;if(t=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(r)){var i,n=t[1],a=t[2];switch(n){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(o,s,l)}break}}else if(t=/^\#([A-Fa-f0-9]+)$/.exec(r)){var u=t[1],c=u.length;if(c===3)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(c===6)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}if(r&&r.length>0){var u=ARe[r];u!==void 0?this.setHex(u):console.warn("THREE.Color: Unknown color "+r)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(r){return this.r=r.r,this.g=r.g,this.b=r.b,this},copyGammaToLinear:function(r,e){return e===void 0&&(e=2),this.r=Math.pow(r.r,e),this.g=Math.pow(r.g,e),this.b=Math.pow(r.b,e),this},copyLinearToGamma:function(r,e){e===void 0&&(e=2);var t=e>0?1/e:1;return this.r=Math.pow(r.r,t),this.g=Math.pow(r.g,t),this.b=Math.pow(r.b,t),this},convertGammaToLinear:function(){var r=this.r,e=this.g,t=this.b;return this.r=r*r,this.g=e*e,this.b=t*t,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(r){var e=r||{h:0,s:0,l:0},t=this.r,i=this.g,n=this.b,a=Math.max(t,i,n),o=Math.min(t,i,n),s,l,u=(o+a)/2;if(o===a)s=0,l=0;else{var c=a-o;switch(l=u<=.5?c/(a+o):c/(2-a-o),a){case t:s=(i-n)/c+(ithis.max.x||r.ythis.max.y)},containsBox:function(r){return this.min.x<=r.min.x&&r.max.x<=this.max.x&&this.min.y<=r.min.y&&r.max.y<=this.max.y},getParameter:function(r,e){var t=e||new St;return t.set((r.x-this.min.x)/(this.max.x-this.min.x),(r.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(r){return!(r.max.xthis.max.x||r.max.ythis.max.y)},clampPoint:function(r,e){var t=e||new St;return t.copy(r).clamp(this.min,this.max)},distanceToPoint:function(){var r=new St;return function(t){var i=r.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(r){return this.min.max(r.min),this.max.min(r.max),this},union:function(r){return this.min.min(r.min),this.max.max(r.max),this},translate:function(r){return this.min.add(r),this.max.add(r),this},equals:function(r){return r.min.equals(this.min)&&r.max.equals(this.max)}};LRe=0;mr.prototype={constructor:mr,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(r){r===!0&&this.update(),this._needsUpdate=r},setValues:function(r){if(r!==void 0)for(var e in r){var t=r[e];if(t===void 0){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}var i=this[e];if(i===void 0){console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.");continue}i&&i.isColor?i.set(t):i&&i.isVector3&&t&&t.isVector3?i.copy(t):e==="overdraw"?this[e]=Number(t):this[e]=t}},toJSON:function(r){var e=r===void 0;e&&(r={textures:{},images:{}});var t={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),this.roughness!==void 0&&(t.roughness=this.roughness),this.metalness!==void 0&&(t.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),this.shininess!==void 0&&(t.shininess=this.shininess),this.clearCoat!==void 0&&(t.clearCoat=this.clearCoat),this.clearCoatRoughness!==void 0&&(t.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(r).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(r).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(r).uuid),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(r).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(r).uuid,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(r).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(r).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(r).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(r).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(r).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(r).uuid,t.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(r).uuid),this.size!==void 0&&(t.size=this.size),this.sizeAttenuation!==void 0&&(t.sizeAttenuation=this.sizeAttenuation),this.blending!==zy&&(t.blending=this.blending),this.shading!==zF&&(t.shading=this.shading),this.side!==Kg&&(t.side=this.side),this.vertexColors!==_C&&(t.vertexColors=this.vertexColors),this.opacity<1&&(t.opacity=this.opacity),this.transparent===!0&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,this.alphaTest>0&&(t.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(t.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(t.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(t.wireframeLinejoin=this.wireframeLinejoin),t.skinning=this.skinning,t.morphTargets=this.morphTargets;function i(o){var s=[];for(var l in o){var u=o[l];delete u.metadata,s.push(u)}return s}if(e){var n=i(r.textures),a=i(r.images);n.length>0&&(t.textures=n),a.length>0&&(t.images=a)}return t},clone:function(){return new this.constructor().copy(this)},copy:function(r){this.name=r.name,this.fog=r.fog,this.lights=r.lights,this.blending=r.blending,this.side=r.side,this.shading=r.shading,this.vertexColors=r.vertexColors,this.opacity=r.opacity,this.transparent=r.transparent,this.blendSrc=r.blendSrc,this.blendDst=r.blendDst,this.blendEquation=r.blendEquation,this.blendSrcAlpha=r.blendSrcAlpha,this.blendDstAlpha=r.blendDstAlpha,this.blendEquationAlpha=r.blendEquationAlpha,this.depthFunc=r.depthFunc,this.depthTest=r.depthTest,this.depthWrite=r.depthWrite,this.colorWrite=r.colorWrite,this.precision=r.precision,this.polygonOffset=r.polygonOffset,this.polygonOffsetFactor=r.polygonOffsetFactor,this.polygonOffsetUnits=r.polygonOffsetUnits,this.alphaTest=r.alphaTest,this.premultipliedAlpha=r.premultipliedAlpha,this.overdraw=r.overdraw,this.visible=r.visible,this.clipShadows=r.clipShadows,this.clipIntersection=r.clipIntersection;var e=r.clippingPlanes,t=null;if(e!==null){var i=e.length;t=new Array(i);for(var n=0;n!==i;++n)t[n]=e[n].clone()}return this.clippingPlanes=t,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};Object.assign(mr.prototype,bs.prototype);Ma.prototype=Object.create(mr.prototype);Ma.prototype.constructor=Ma;Ma.prototype.isShaderMaterial=!0;Ma.prototype.copy=function(r){return mr.prototype.copy.call(this,r),this.fragmentShader=r.fragmentShader,this.vertexShader=r.vertexShader,this.uniforms=io.clone(r.uniforms),this.defines=r.defines,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.lights=r.lights,this.clipping=r.clipping,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.morphNormals=r.morphNormals,this.extensions=r.extensions,this};Ma.prototype.toJSON=function(r){var e=mr.prototype.toJSON.call(this,r);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e};bh.prototype=Object.create(mr.prototype);bh.prototype.constructor=bh;bh.prototype.isMeshDepthMaterial=!0;bh.prototype.copy=function(r){return mr.prototype.copy.call(this,r),this.depthPacking=r.depthPacking,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.map=r.map,this.alphaMap=r.alphaMap,this.displacementMap=r.displacementMap,this.displacementScale=r.displacementScale,this.displacementBias=r.displacementBias,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this};su.prototype={constructor:su,isBox3:!0,set:function(r,e){return this.min.copy(r),this.max.copy(e),this},setFromArray:function(r){for(var e=1/0,t=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=0,l=r.length;sn&&(n=u),c>a&&(a=c),f>o&&(o=f)}this.min.set(e,t,i),this.max.set(n,a,o)},setFromBufferAttribute:function(r){for(var e=1/0,t=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=0,l=r.count;sn&&(n=u),c>a&&(a=c),f>o&&(o=f)}this.min.set(e,t,i),this.max.set(n,a,o)},setFromPoints:function(r){this.makeEmpty();for(var e=0,t=r.length;ethis.max.x||r.ythis.max.y||r.zthis.max.z)},containsBox:function(r){return this.min.x<=r.min.x&&r.max.x<=this.max.x&&this.min.y<=r.min.y&&r.max.y<=this.max.y&&this.min.z<=r.min.z&&r.max.z<=this.max.z},getParameter:function(r,e){var t=e||new oe;return t.set((r.x-this.min.x)/(this.max.x-this.min.x),(r.y-this.min.y)/(this.max.y-this.min.y),(r.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(r){return!(r.max.xthis.max.x||r.max.ythis.max.y||r.max.zthis.max.z)},intersectsSphere:function(){var r;return function(t){return r===void 0&&(r=new oe),this.clampPoint(t.center,r),r.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(r){var e,t;return r.normal.x>0?(e=r.normal.x*this.min.x,t=r.normal.x*this.max.x):(e=r.normal.x*this.max.x,t=r.normal.x*this.min.x),r.normal.y>0?(e+=r.normal.y*this.min.y,t+=r.normal.y*this.max.y):(e+=r.normal.y*this.max.y,t+=r.normal.y*this.min.y),r.normal.z>0?(e+=r.normal.z*this.min.z,t+=r.normal.z*this.max.z):(e+=r.normal.z*this.max.z,t+=r.normal.z*this.min.z),e<=r.constant&&t>=r.constant},clampPoint:function(r,e){var t=e||new oe;return t.copy(r).clamp(this.min,this.max)},distanceToPoint:function(){var r=new oe;return function(t){var i=r.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var r=new oe;return function(t){var i=t||new $n;return this.getCenter(i.center),i.radius=this.getSize(r).length()*.5,i}}(),intersect:function(r){return this.min.max(r.min),this.max.min(r.max),this.isEmpty()&&this.makeEmpty(),this},union:function(r){return this.min.min(r.min),this.max.max(r.max),this},applyMatrix4:function(){var r=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe];return function(t){return this.isEmpty()?this:(r[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),r[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),r[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),r[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),r[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),r[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),r[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),r[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(r),this)}}(),translate:function(r){return this.min.add(r),this.max.add(r),this},equals:function(r){return r.min.equals(this.min)&&r.max.equals(this.max)}};$n.prototype={constructor:$n,set:function(r,e){return this.center.copy(r),this.radius=e,this},setFromPoints:function(){var r=new su;return function(t,i){var n=this.center;i!==void 0?n.copy(i):r.setFromPoints(t).getCenter(n);for(var a=0,o=0,s=t.length;othis.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(r){var e=r||new su;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(r){return this.center.applyMatrix4(r),this.radius=this.radius*r.getMaxScaleOnAxis(),this},translate:function(r){return this.center.add(r),this},equals:function(r){return r.center.equals(this.center)&&r.radius===this.radius}};ws.prototype={constructor:ws,isMatrix3:!0,set:function(r,e,t,i,n,a,o,s,l){var u=this.elements;return u[0]=r,u[1]=i,u[2]=o,u[3]=e,u[4]=n,u[5]=s,u[6]=t,u[7]=a,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return new this.constructor().fromArray(this.elements)},copy:function(r){var e=r.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},setFromMatrix4:function(r){var e=r.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a1))return n.copy(a).multiplyScalar(s).add(t.start)}}(),intersectsLine:function(r){var e=this.distanceToPoint(r.start),t=this.distanceToPoint(r.end);return e<0&&t>0||t<0&&e>0},intersectsBox:function(r){return r.intersectsPlane(this)},intersectsSphere:function(r){return r.intersectsPlane(this)},coplanarPoint:function(r){var e=r||new oe;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var r=new oe,e=new ws;return function(i,n){var a=this.coplanarPoint(r).applyMatrix4(i),o=n||e.getNormalMatrix(i),s=this.normal.applyMatrix3(o).normalize();return this.constant=-a.dot(s),this}}(),translate:function(r){return this.constant=this.constant-r.dot(this.normal),this},equals:function(r){return r.normal.equals(this.normal)&&r.constant===this.constant}};IS.prototype={constructor:IS,set:function(r,e,t,i,n,a){var o=this.planes;return o[0].copy(r),o[1].copy(e),o[2].copy(t),o[3].copy(i),o[4].copy(n),o[5].copy(a),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){for(var e=this.planes,t=0;t<6;t++)e[t].copy(r.planes[t]);return this},setFromMatrix:function(r){var e=this.planes,t=r.elements,i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],f=t[8],h=t[9],p=t[10],d=t[11],g=t[12],m=t[13],v=t[14],_=t[15];return e[0].setComponents(o-i,c-s,d-f,_-g).normalize(),e[1].setComponents(o+i,c+s,d+f,_+g).normalize(),e[2].setComponents(o+n,c+l,d+h,_+m).normalize(),e[3].setComponents(o-n,c-l,d-h,_-m).normalize(),e[4].setComponents(o-a,c-u,d-p,_-v).normalize(),e[5].setComponents(o+a,c+u,d+p,_+v).normalize(),this},intersectsObject:function(){var r=new $n;return function(t){var i=t.geometry;return i.boundingSphere===null&&i.computeBoundingSphere(),r.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSprite:function(){var r=new $n;return function(t){return r.center.set(0,0,0),r.radius=.7071067811865476,r.applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSphere:function(r){for(var e=this.planes,t=r.center,i=-r.radius,n=0;n<6;n++){var a=e[n].distanceToPoint(t);if(a0?i.min.x:i.max.x,e.x=o.normal.x>0?i.max.x:i.min.x,r.y=o.normal.y>0?i.min.y:i.max.y,e.y=o.normal.y>0?i.max.y:i.min.y,r.z=o.normal.z>0?i.min.z:i.max.z,e.z=o.normal.z>0?i.max.z:i.min.z;var s=o.distanceToPoint(r),l=o.distanceToPoint(e);if(s<0&&l<0)return!1}return!0}}(),containsPoint:function(r){for(var e=this.planes,t=0;t<6;t++)if(e[t].distanceToPoint(r)<0)return!1;return!0}};wh.prototype={constructor:wh,set:function(r,e){return this.origin.copy(r),this.direction.copy(e),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.origin.copy(r.origin),this.direction.copy(r.direction),this},at:function(r,e){var t=e||new oe;return t.copy(this.direction).multiplyScalar(r).add(this.origin)},lookAt:function(r){return this.direction.copy(r).sub(this.origin).normalize(),this},recast:function(){var r=new oe;return function(t){return this.origin.copy(this.at(t,r)),this}}(),closestPointToPoint:function(r,e){var t=e||new oe;t.subVectors(r,this.origin);var i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(r){return Math.sqrt(this.distanceSqToPoint(r))},distanceSqToPoint:function(){var r=new oe;return function(t){var i=r.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(r.copy(this.direction).multiplyScalar(i).add(this.origin),r.distanceToSquared(t))}}(),distanceSqToSegment:function(){var r=new oe,e=new oe,t=new oe;return function(n,a,o,s){r.copy(n).add(a).multiplyScalar(.5),e.copy(a).sub(n).normalize(),t.copy(this.origin).sub(r);var l=n.distanceTo(a)*.5,u=-this.direction.dot(e),c=t.dot(this.direction),f=-t.dot(e),h=t.lengthSq(),p=Math.abs(1-u*u),d,g,m,v;if(p>0)if(d=u*f-c,g=u*c-f,v=l*p,d>=0)if(g>=-v)if(g<=v){var _=1/p;d*=_,g*=_,m=d*(d+u*g+2*c)+g*(u*d+g+2*f)+h}else g=l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*f)+h;else g=-l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*f)+h;else g<=-v?(d=Math.max(0,-(-u*l+c)),g=d>0?-l:Math.min(Math.max(-l,-f),l),m=-d*d+g*(g+2*f)+h):g<=v?(d=0,g=Math.min(Math.max(-l,-f),l),m=g*(g+2*f)+h):(d=Math.max(0,-(u*l+c)),g=d>0?l:Math.min(Math.max(-l,-f),l),m=-d*d+g*(g+2*f)+h);else g=u>0?-l:l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*f)+h;return o&&o.copy(this.direction).multiplyScalar(d).add(this.origin),s&&s.copy(e).multiplyScalar(g).add(r),m}}(),intersectSphere:function(){var r=new oe;return function(t,i){r.subVectors(t.center,this.origin);var n=r.dot(this.direction),a=r.dot(r)-n*n,o=t.radius*t.radius;if(a>o)return null;var s=Math.sqrt(o-a),l=n-s,u=n+s;return l<0&&u<0?null:l<0?this.at(u,i):this.at(l,i)}}(),intersectsSphere:function(r){return this.distanceToPoint(r.center)<=r.radius},distanceToPlane:function(r){var e=r.normal.dot(this.direction);if(e===0)return r.distanceToPoint(this.origin)===0?0:null;var t=-(this.origin.dot(r.normal)+r.constant)/e;return t>=0?t:null},intersectPlane:function(r,e){var t=this.distanceToPlane(r);return t===null?null:this.at(t,e)},intersectsPlane:function(r){var e=r.distanceToPoint(this.origin);if(e===0)return!0;var t=r.normal.dot(this.direction);return t*e<0},intersectBox:function(r,e){var t,i,n,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,f=this.origin;return l>=0?(t=(r.min.x-f.x)*l,i=(r.max.x-f.x)*l):(t=(r.max.x-f.x)*l,i=(r.min.x-f.x)*l),u>=0?(n=(r.min.y-f.y)*u,a=(r.max.y-f.y)*u):(n=(r.max.y-f.y)*u,a=(r.min.y-f.y)*u),t>a||n>i||((n>t||t!==t)&&(t=n),(a=0?(o=(r.min.z-f.z)*c,s=(r.max.z-f.z)*c):(o=(r.max.z-f.z)*c,s=(r.min.z-f.z)*c),t>s||o>i)||((o>t||t!==t)&&(t=o),(s=0?t:i,e)},intersectsBox:function(){var r=new oe;return function(t){return this.intersectBox(t,r)!==null}}(),intersectTriangle:function(){var r=new oe,e=new oe,t=new oe,i=new oe;return function(a,o,s,l,u){e.subVectors(o,a),t.subVectors(s,a),i.crossVectors(e,t);var c=this.direction.dot(i),f;if(c>0){if(l)return null;f=1}else if(c<0)f=-1,c=-c;else return null;r.subVectors(this.origin,a);var h=f*this.direction.dot(t.crossVectors(r,t));if(h<0)return null;var p=f*this.direction.dot(e.cross(r));if(p<0||h+p>c)return null;var d=-f*r.dot(i);return d<0?null:this.at(d/c,u)}}(),applyMatrix4:function(r){return this.direction.add(this.origin).applyMatrix4(r),this.origin.applyMatrix4(r),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(r){return r.origin.equals(this.origin)&&r.direction.equals(this.direction)}};Th.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];Th.DefaultOrder="XYZ";Th.prototype={constructor:Th,isEuler:!0,get x(){return this._x},set x(r){this._x=r,this.onChangeCallback()},get y(){return this._y},set y(r){this._y=r,this.onChangeCallback()},get z(){return this._z},set z(r){this._z=r,this.onChangeCallback()},get order(){return this._order},set order(r){this._order=r,this.onChangeCallback()},set:function(r,e,t,i){return this._x=r,this._y=e,this._z=t,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(r){return this._x=r._x,this._y=r._y,this._z=r._z,this._order=r._order,this.onChangeCallback(),this},setFromRotationMatrix:function(r,e,t){var i=cr.clamp,n=r.elements,a=n[0],o=n[4],s=n[8],l=n[1],u=n[5],c=n[9],f=n[2],h=n[6],p=n[10];return e=e||this._order,e==="XYZ"?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(h,u),this._z=0)):e==="YXZ"?(this._x=Math.asin(-i(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-f,a),this._z=0)):e==="ZXY"?(this._x=Math.asin(i(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(-f,p),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a))):e==="ZYX"?(this._y=Math.asin(-i(f,-1,1)),Math.abs(f)<.99999?(this._x=Math.atan2(h,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u))):e==="YZX"?(this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-f,a)):(this._x=0,this._y=Math.atan2(s,p))):e==="XZY"?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(h,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,t!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var r;return function(t,i,n){return r===void 0&&(r=new qt),r.makeRotationFromQuaternion(t),this.setFromRotationMatrix(r,i,n)}}(),setFromVector3:function(r,e){return this.set(r.x,r.y,r.z,e||this._order)},reorder:function(){var r=new on;return function(t){return r.setFromEuler(this),this.setFromQuaternion(r,t)}}(),equals:function(r){return r._x===this._x&&r._y===this._y&&r._z===this._z&&r._order===this._order},fromArray:function(r){return this._x=r[0],this._y=r[1],this._z=r[2],r[3]!==void 0&&(this._order=r[3]),this.onChangeCallback(),this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this._x,r[e+1]=this._y,r[e+2]=this._z,r[e+3]=this._order,r},toVector3:function(r){return r?r.set(this._x,this._y,this._z):new oe(this._x,this._y,this._z)},onChange:function(r){return this.onChangeCallback=r,this},onChangeCallback:function(){}};ZA.prototype={constructor:ZA,set:function(r){this.mask=1<1){for(var e=0;e1)for(var e=0;e0){i.children=[];for(var n=0;n0&&(t.geometries=a),o.length>0&&(t.materials=o),s.length>0&&(t.textures=s),l.length>0&&(t.images=l)}return t.object=i,t;function u(c){var f=[];for(var h in c){var p=c[h];delete p.metadata,f.push(p)}return f}},clone:function(r){return new this.constructor().copy(this,r)},copy:function(r,e){if(e===void 0&&(e=!0),this.name=r.name,this.up.copy(r.up),this.position.copy(r.position),this.quaternion.copy(r.quaternion),this.scale.copy(r.scale),this.matrix.copy(r.matrix),this.matrixWorld.copy(r.matrixWorld),this.matrixAutoUpdate=r.matrixAutoUpdate,this.matrixWorldNeedsUpdate=r.matrixWorldNeedsUpdate,this.layers.mask=r.layers.mask,this.visible=r.visible,this.castShadow=r.castShadow,this.receiveShadow=r.receiveShadow,this.frustumCulled=r.frustumCulled,this.renderOrder=r.renderOrder,this.userData=JSON.parse(JSON.stringify(r.userData)),e===!0)for(var t=0;t0?o.multiplyScalar(1/Math.sqrt(s)):o.set(0,0,0)}}();Ms.barycoordFromPoint=function(){var r=new oe,e=new oe,t=new oe;return function(n,a,o,s,l){r.subVectors(s,a),e.subVectors(o,a),t.subVectors(n,a);var u=r.dot(r),c=r.dot(e),f=r.dot(t),h=e.dot(e),p=e.dot(t),d=u*h-c*c,g=l||new oe;if(d===0)return g.set(-2,-1,-1);var m=1/d,v=(h*f-c*p)*m,_=(u*p-c*f)*m;return g.set(1-v-_,_,v)}}();Ms.containsPoint=function(){var r=new oe;return function(t,i,n,a){var o=Ms.barycoordFromPoint(t,i,n,a,r);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}();Ms.prototype={constructor:Ms,set:function(r,e,t){return this.a.copy(r),this.b.copy(e),this.c.copy(t),this},setFromPointsAndIndices:function(r,e,t,i){return this.a.copy(r[e]),this.b.copy(r[t]),this.c.copy(r[i]),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.a.copy(r.a),this.b.copy(r.b),this.c.copy(r.c),this},area:function(){var r=new oe,e=new oe;return function(){return r.subVectors(this.c,this.b),e.subVectors(this.a,this.b),r.cross(e).length()*.5}}(),midpoint:function(r){var e=r||new oe;return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(r){return Ms.normal(this.a,this.b,this.c,r)},plane:function(r){var e=r||new Io;return e.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(r,e){return Ms.barycoordFromPoint(r,this.a,this.b,this.c,e)},containsPoint:function(r){return Ms.containsPoint(r,this.a,this.b,this.c)},closestPointToPoint:function(){var r,e,t,i;return function(a,o){r===void 0&&(r=new Io,e=[new Pd,new Pd,new Pd],t=new oe,i=new oe);var s=o||new oe,l=1/0;if(r.setFromCoplanarPoints(this.a,this.b,this.c),r.projectPoint(a,t),this.containsPoint(t)===!0)s.copy(t);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var u=0;u0,a=i[1]&&i[1].length>0,o=r.morphTargets,s=o.length,l;if(s>0){l=[];for(var u=0;u0){h=[];for(var u=0;u0)for(var h=0;h0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var r,e,t;for(this.computeFaceNormals(),r=0,e=this.faces.length;r0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var r,e,t,i,n;for(t=0,i=this.faces.length;t0&&(r+=e[t].distanceTo(e[t-1])),this.lineDistances[t]=r},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new su),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new $n),this.boundingSphere.setFromPoints(this.vertices)},merge:function(r,e,t){if((r&&r.isGeometry)===!1){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",r);return}var i,n=this.vertices.length,a=this.vertices,o=r.vertices,s=this.faces,l=r.faces,u=this.faceVertexUvs[0],c=r.faceVertexUvs[0],f=this.colors,h=r.colors;t===void 0&&(t=0),e!==void 0&&(i=new ws().getNormalMatrix(e));for(var p=0,d=o.length;p=0;s--){var m=p[s];for(this.faces.splice(m,1),f=0,h=this.faceVertexUvs.length;f0,_=p.vertexNormals.length>0,y=p.color.r!==1||p.color.g!==1||p.color.b!==1,x=p.vertexColors.length>0,M=0;if(M=C(M,0,0),M=C(M,1,d),M=C(M,2,g),M=C(M,3,m),M=C(M,4,v),M=C(M,5,_),M=C(M,6,y),M=C(M,7,x),o.push(M),o.push(p.a,p.b,p.c),o.push(p.materialIndex),m){var S=this.faceVertexUvs[0][n];o.push(I(S[0]),I(S[1]),I(S[2]))}if(v&&o.push(b(p.normal)),_){var w=p.vertexNormals;o.push(b(w[0]),b(w[1]),b(w[2]))}if(y&&o.push(E(p.color)),x){var T=p.vertexColors;o.push(E(T[0]),E(T[1]),E(T[2]))}}function C(R,A,D){return D?R|1<0&&(r.data.colors=u),f.length>0&&(r.data.uvs=[f]),r.data.faces=o,r},clone:function(){return new sr().copy(this)},copy:function(r){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]],this.colors=[];for(var e=r.vertices,t=0,i=e.length;t0){var t=new Float32Array(r.normals.length*3);this.addAttribute("normal",new gt(t,3).copyVector3sArray(r.normals))}if(r.colors.length>0){var i=new Float32Array(r.colors.length*3);this.addAttribute("color",new gt(i,3).copyColorsArray(r.colors))}if(r.uvs.length>0){var n=new Float32Array(r.uvs.length*2);this.addAttribute("uv",new gt(n,2).copyVector2sArray(r.uvs))}if(r.uvs2.length>0){var a=new Float32Array(r.uvs2.length*2);this.addAttribute("uv2",new gt(a,2).copyVector2sArray(r.uvs2))}if(r.indices.length>0){var o=r.vertices.length>65535?Uint32Array:Uint16Array,s=new o(r.indices.length*3);this.setIndex(new gt(s,1).copyIndicesArray(r.indices))}this.groups=r.groups;for(var l in r.morphTargets){for(var u=[],c=r.morphTargets[l],f=0,h=c.length;f0){var g=new gr(r.skinIndices.length*4,4);this.addAttribute("skinIndex",g.copyVector4sArray(r.skinIndices))}if(r.skinWeights.length>0){var m=new gr(r.skinWeights.length*4,4);this.addAttribute("skinWeight",m.copyVector4sArray(r.skinWeights))}return r.boundingSphere!==null&&(this.boundingSphere=r.boundingSphere.clone()),r.boundingBox!==null&&(this.boundingBox=r.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new su);var r=this.attributes.position;r!==void 0?this.boundingBox.setFromBufferAttribute(r):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var r=new su,e=new oe;return function(){this.boundingSphere===null&&(this.boundingSphere=new $n);var i=this.attributes.position;if(i){var n=this.boundingSphere.center;r.setFromBufferAttribute(i),r.getCenter(n);for(var a=0,o=0,s=i.count;o0&&(r.data.groups=JSON.parse(JSON.stringify(s)));var l=this.boundingSphere;return l!==null&&(r.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),r},clone:function(){return new Bt().copy(this)},copy:function(r){var e=r.index;e!==null&&this.setIndex(e.clone());var t=r.attributes;for(var i in t){var n=t[i];this.addAttribute(i,n.clone())}for(var a=r.groups,o=0,s=a.length;o0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=r.length;ey.far?null:{distance:E,point:d.clone(),object:_}}function v(_,y,x,M,S,w,T,C){i.fromArray(M,w*3),n.fromArray(M,T*3),a.fromArray(M,C*3);var b=m(_,y,x,i,n,a,p);return b&&(S&&(u.fromArray(S,w*2),c.fromArray(S,T*2),f.fromArray(S,C*2),b.uv=g(p,i,n,a,u,c,f)),b.face=new zo(w,T,C,Ms.normal(i,n,a)),b.faceIndex=w),b}return function(y,x){var M=this.geometry,S=this.material,w=this.matrixWorld;if(S!==void 0&&(M.boundingSphere===null&&M.computeBoundingSphere(),t.copy(M.boundingSphere),t.applyMatrix4(w),y.ray.intersectsSphere(t)!==!1&&(r.getInverse(w),e.copy(y.ray).applyMatrix4(r),!(M.boundingBox!==null&&e.intersectsBox(M.boundingBox)===!1)))){var T,C;if(M.isBufferGeometry){var b,E,I,R=M.index,A=M.attributes,D=A.position.array;if(A.uv!==void 0&&(T=A.uv.array),R!==null)for(var U=R.array,B=0,z=U.length;B0&&(T=ae);for(var ve=0,ue=K.length;vea||i.push({distance:Math.sqrt(n),point:this.position,face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}});VS.prototype=Object.assign(Object.create(At.prototype),{constructor:VS,copy:function(r){At.prototype.copy.call(this,r,!1);for(var e=r.levels,t=0,i=e.length;t1){r.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var a=r.distanceTo(e);n[0].object.visible=!0;for(var o=1,s=n.length;o=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;os)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);Tn.far||a.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else for(var y=0,x=v.length/3-1;ys)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);Tn.far||a.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}else if(l.isGeometry)for(var C=l.vertices,b=C.length,y=0;ys)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);Tn.far||a.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});di.prototype=Object.assign(Object.create(ac.prototype),{constructor:di,isLineSegments:!0});ml.prototype=Object.create(mr.prototype);ml.prototype.constructor=ml;ml.prototype.isPointsMaterial=!0;ml.prototype.copy=function(r){return mr.prototype.copy.call(this,r),this.color.copy(r.color),this.map=r.map,this.size=r.size,this.sizeAttenuation=r.sizeAttenuation,this};ay.prototype=Object.assign(Object.create(At.prototype),{constructor:ay,isPoints:!0,raycast:function(){var r=new qt,e=new wh,t=new $n;return function(n,a){var o=this,s=this.geometry,l=this.matrixWorld,u=n.params.Points.threshold;if(s.boundingSphere===null&&s.computeBoundingSphere(),t.copy(s.boundingSphere),t.applyMatrix4(l),n.ray.intersectsSphere(t)===!1)return;r.getInverse(l),e.copy(n.ray).applyMatrix4(r);var c=u/((this.scale.x+this.scale.y+this.scale.z)/3),f=c*c,h=new oe;function p(w,T){var C=e.distanceSqToPoint(w);if(Cn.far)return;a.push({distance:E,distanceToRay:Math.sqrt(C),point:b.clone(),index:T,face:null,object:o})}}if(s.isBufferGeometry){var d=s.index,g=s.attributes,m=g.position.array;if(d!==null)for(var v=d.array,_=0,y=v.length;_=-Number.EPSILON&&R>=-Number.EPSILON&&I>=-Number.EPSILON))return!1;return!0}return function(t,i){var n=t.length;if(n<3)return null;var a=[],o=[],s=[],l,u,c;if(Ln.area(t)>0)for(u=0;u2;){if(h--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?s:a;if(l=u,f<=l&&(l=0),u=l+1,f<=u&&(u=0),c=u+1,f<=c&&(c=0),r(t,l,u,c,f,o)){var p,d,g,m,v;for(p=o[l],d=o[u],g=o[c],a.push([t[p],t[d],t[g]]),s.push([o[l],o[u],o[c]]),m=u,v=u+1;v2&&y[x-1].equals(y[0])&&y.pop()}t(r),e.forEach(t);function i(y,x,M){return y.x!==x.x?y.xNumber.EPSILON){var U;if(A>0){if(D<0||D>A)return[];if(U=E*I-b*R,U<0||U>A)return[]}else{if(D>0||D0||Uve?[]:J===ve?w?[]:[G]:Q<=ve?[G,Y]:[G,K]}}function a(y,x,M,S){var w=x.x-y.x,T=x.y-y.y,C=M.x-y.x,b=M.y-y.y,E=S.x-y.x,I=S.y-y.y,R=w*b-T*C,A=w*I-T*E;if(Math.abs(R)>Number.EPSILON){var D=E*b-I*C;return R>0?A>=0&&D>=0:A>=0||D>=0}else return A>0}function o(y,x){var M=y.concat(),S;function w(ve,ue){var se=M.length-1,Ee=ve-1;Ee<0&&(Ee=se);var q=ve+1;q>se&&(q=0);var H=a(M[ve],M[Ee],M[q],S[ue]);if(!H)return!1;var We=S.length-1,_e=ue-1;_e<0&&(_e=We);var xe=ue+1;return xe>We&&(xe=0),H=a(S[ue],S[_e],S[xe],M[ve]),!!H}function T(ve,ue){var se,Ee,q;for(se=0;se0)return!0;return!1}var C=[];function b(ve,ue){var se,Ee,q,H,We;for(se=0;se0)return!0;return!1}for(var E,I,R,A,D,U,B=[],z,k,G,Y,J=0,Q=x.length;J0;){if(K--,K<0){console.log("Infinite Loop! Holes left:"+C.length+", Probably Hole outside Shape!");break}for(I=V;I=0)break;B[U]=!0}if(E>=0)break}}return M}for(var s,l,u,c,f,h,p={},d=r.concat(),g=0,m=e.length;gNumber.EPSILON){var Se=Math.sqrt(et),Ae=Math.sqrt(me*me+he*he),nt=Ne.x-le/Se,$=Ne.y+ne/Se,it=Ve.x-he/Ae,Xe=Ve.y+me/Ae,Fe=((it-nt)*he-(Xe-$)*me)/(ne*he-le*me);ct=nt+ne*Fe-Ue.x,F=$+le*Fe-Ue.y;var we=ct*ct+F*F;if(we<=2)return new St(ct,F);L=Math.sqrt(we/2)}else{var Ie=!1;ne>Number.EPSILON?me>Number.EPSILON&&(Ie=!0):ne<-Number.EPSILON?me<-Number.EPSILON&&(Ie=!0):Math.sign(le)===Math.sign(he)&&(Ie=!0),Ie?(ct=-le,F=ne,L=Math.sqrt(et)):(ct=ne,F=le,L=Math.sqrt(et/2))}return new St(ct/L,F/L)}for(var J=[],Q=0,V=E.length,K=V-1,ae=Q+1;Q=0;R--){for(D=R/a,U=i*Math.cos(D*Math.PI/2),A=n*Math.sin(D*Math.PI/2),Q=0,V=E.length;Q=0;){Ve=Q,ct=Q-1,ct<0&&(ct=Ue.length-1);var F=0,L=l+a*2;for(F=0;F0||r.search(/^data\:image\/jpeg/)===0;n.format=s?$g:ou,n.image=o,n.needsUpdate=!0,e!==void 0&&e(n)},t,i),n},setCrossOrigin:function(r){return this.crossOrigin=r,this},setWithCredentials:function(r){return this.withCredentials=r,this},setPath:function(r){return this.path=r,this}});Ui.prototype=Object.assign(Object.create(At.prototype),{constructor:Ui,isLight:!0,copy:function(r){return At.prototype.copy.call(this,r),this.color.copy(r.color),this.intensity=r.intensity,this},toJSON:function(r){var e=At.prototype.toJSON.call(this,r);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}});eC.prototype=Object.assign(Object.create(Ui.prototype),{constructor:eC,isHemisphereLight:!0,copy:function(r){return Ui.prototype.copy.call(this,r),this.groundColor.copy(r.groundColor),this}});Object.assign(rm.prototype,{copy:function(r){return this.camera=r.camera.clone(),this.bias=r.bias,this.radius=r.radius,this.mapSize.copy(r.mapSize),this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var r={};return this.bias!==0&&(r.bias=this.bias),this.radius!==1&&(r.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(r.mapSize=this.mapSize.toArray()),r.camera=this.camera.toJSON(!1).object,delete r.camera.matrix,r}});tC.prototype=Object.assign(Object.create(rm.prototype),{constructor:tC,isSpotLightShadow:!0,update:function(r){var e=cr.RAD2DEG*2*r.angle,t=this.mapSize.width/this.mapSize.height,i=r.distance||500,n=this.camera;(e!==n.fov||t!==n.aspect||i!==n.far)&&(n.fov=e,n.aspect=t,n.far=i,n.updateProjectionMatrix())}});rC.prototype=Object.assign(Object.create(Ui.prototype),{constructor:rC,isSpotLight:!0,copy:function(r){return Ui.prototype.copy.call(this,r),this.distance=r.distance,this.angle=r.angle,this.penumbra=r.penumbra,this.decay=r.decay,this.target=r.target.clone(),this.shadow=r.shadow.clone(),this}});iC.prototype=Object.assign(Object.create(Ui.prototype),{constructor:iC,isPointLight:!0,copy:function(r){return Ui.prototype.copy.call(this,r),this.distance=r.distance,this.decay=r.decay,this.shadow=r.shadow.clone(),this}});nC.prototype=Object.assign(Object.create(rm.prototype),{constructor:nC});aC.prototype=Object.assign(Object.create(Ui.prototype),{constructor:aC,isDirectionalLight:!0,copy:function(r){return Ui.prototype.copy.call(this,r),this.target=r.target.clone(),this.shadow=r.shadow.clone(),this}});oC.prototype=Object.assign(Object.create(Ui.prototype),{constructor:oC,isAmbientLight:!0});Jn={arraySlice:function(r,e,t){return Jn.isTypedArray(r)?new r.constructor(r.subarray(e,t)):r.slice(e,t)},convertArray:function(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)},isTypedArray:function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},getKeyframeOrder:function(r){function e(a,o){return r[a]-r[o]}for(var t=r.length,i=new Array(t),n=0;n!==t;++n)i[n]=n;return i.sort(e),i},sortedArray:function(r,e,t){for(var i=r.length,n=new r.constructor(i),a=0,o=0;o!==i;++a)for(var s=t[a]*e,l=0;l!==e;++l)n[o++]=r[s+l];return n},flattenJSON:function(r,e,t,i){for(var n=1,a=r[0];a!==void 0&&a[i]===void 0;)a=r[n++];if(a!==void 0){var o=a[i];if(o!==void 0)if(Array.isArray(o))do o=a[i],o!==void 0&&(e.push(a.time),t.push.apply(t,o)),a=r[n++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[i],o!==void 0&&(e.push(a.time),o.toArray(t,t.length)),a=r[n++];while(a!==void 0);else do o=a[i],o!==void 0&&(e.push(a.time),t.push(o)),a=r[n++];while(a!==void 0)}}};ao.prototype={constructor:ao,evaluate:function(r){var e=this.parameterPositions,t=this._cachedIndex,i=e[t],n=e[t-1];e:{t:{var a;r:{i:if(!(r=n)){var s=e[1];r=n)break t}a=t,t=0;break r}break e}for(;t>>1;re;)--a;if(++a,n!==0||a!==i){n>=a&&(a=Math.max(a,1),n=a-1);var o=this.getValueSize();this.times=Jn.arraySlice(t,n,a),this.values=Jn.arraySlice(this.values,n*o,a*o)}return this},validate:function(){var r=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("invalid value size in track",this),r=!1);var t=this.times,i=this.values,n=t.length;n===0&&(console.error("track is empty",this),r=!1);for(var a=null,o=0;o!==n;o++){var s=t[o];if(typeof s=="number"&&isNaN(s)){console.error("time is not a valid number",this,o,s),r=!1;break}if(a!==null&&a>s){console.error("out of order keys",this,o,s,a),r=!1;break}a=s}if(i!==void 0&&Jn.isTypedArray(i))for(var o=0,l=i.length;o!==l;++o){var u=i[o];if(isNaN(u)){console.error("value is not a valid number",this,o,u),r=!1;break}}return r},optimize:function(){for(var r=this.times,e=this.values,t=this.getValueSize(),i=this.getInterpolation()===GA,n=1,a=r.length-1,o=1;o0){r[n]=r[a];for(var g=a*t,m=n*t,p=0;p!==t;++p)e[m+p]=e[g+p];++n}return n!==r.length&&(this.times=Jn.arraySlice(r,0,n),this.values=Jn.arraySlice(e,0,n*t)),this}};by.prototype=Object.assign(Object.create(lc),{constructor:by,ValueTypeName:"vector"});uC.prototype=Object.assign(Object.create(ao.prototype),{constructor:uC,interpolate_:function(r,e,t,i){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=r*o,l=(t-e)/(i-e),u=s+o;s!==u;s+=4)on.slerpFlat(n,0,a,s-o,a,s,l);return n}});cM.prototype=Object.assign(Object.create(lc),{constructor:cM,ValueTypeName:"quaternion",DefaultInterpolation:wS,InterpolantFactoryMethodLinear:function(r){return new uC(this.times,this.values,this.getValueSize(),r)},InterpolantFactoryMethodSmooth:void 0});wy.prototype=Object.assign(Object.create(lc),{constructor:wy,ValueTypeName:"number"});cC.prototype=Object.assign(Object.create(lc),{constructor:cC,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:RS,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});fC.prototype=Object.assign(Object.create(lc),{constructor:fC,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:RS,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});hC.prototype=Object.assign(Object.create(lc),{constructor:hC,ValueTypeName:"color"});jd.prototype=lc;lc.constructor=jd;Object.assign(jd,{parse:function(r){if(r.type===void 0)throw new Error("track type undefined, can not parse");var e=jd._getTrackTypeForValueTypeName(r.type);if(r.times===void 0){var t=[],i=[];Jn.flattenJSON(r.keys,t,i,"value"),r.times=t,r.values=i}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)},toJSON:function(r){var e=r.constructor,t;if(e.toJSON!==void 0)t=e.toJSON(r);else{t={name:r.name,times:Jn.convertArray(r.times,Array),values:Jn.convertArray(r.values,Array)};var i=r.getInterpolation();i!==r.DefaultInterpolation&&(t.interpolation=i)}return t.type=r.ValueTypeName,t},_getTrackTypeForValueTypeName:function(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return wy;case"vector":case"vector2":case"vector3":case"vector4":return by;case"color":return hC;case"quaternion":return cM;case"bool":case"boolean":return fC;case"string":return cC}throw new Error("Unsupported typeName: "+r)}});No.prototype={constructor:No,resetDuration:function(){for(var r=this.tracks,e=0,t=0,i=r.length;t!==i;++t){var n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}this.duration=e},trim:function(){for(var r=0;r1){var u=l[1],c=i[u];c||(i[u]=c=[]),c.push(s)}}var f=[];for(var u in i)f.push(No.CreateFromMorphTargetSequence(u,i[u],e,t));return f},parseAnimation:function(r,e){if(!r)return console.error(" no animation in JSONLoader data"),null;for(var t=function(y,x,M,S,w){if(M.length!==0){var T=[],C=[];Jn.flattenJSON(M,T,C,S),T.length!==0&&w.push(new y(x,T,C))}},i=[],n=r.name||"default",a=r.length||-1,o=r.fps||30,s=r.hierarchy||[],l=0;l1?r.skinWeights[c+1]:0,d=u>2?r.skinWeights[c+2]:0,g=u>3?r.skinWeights[c+3]:0;t.skinWeights.push(new ei(h,p,d,g))}if(r.skinIndices)for(var c=0,f=r.skinIndices.length;c1?r.skinIndices[c+1]:0,_=u>2?r.skinIndices[c+2]:0,y=u>3?r.skinIndices[c+3]:0;t.skinIndices.push(new ei(m,v,_,y))}t.bones=r.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}function o(u){if(r.morphTargets!==void 0)for(var c=0,f=r.morphTargets.length;c0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var v=t.faces,_=r.morphColors[0].colors,c=0,f=v.length;c0&&(t.animations=u)}if(r.materials===void 0||r.materials.length===0)return{geometry:t};var l=Dd.prototype.initMaterials(r.materials,e,this.crossOrigin);return{geometry:t,materials:l}}});Object.assign(Zne.prototype,{load:function(r,e,t,i){this.texturePath===""&&(this.texturePath=r.substring(0,r.lastIndexOf("/")+1));var n=this,a=new Es(n.manager);a.load(r,function(o){var s=null;try{s=JSON.parse(o)}catch(u){console.error("THREE:ObjectLoader: Can't parse "+r+".",u.message);return}var l=s.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+r+". Use THREE.JSONLoader instead.");return}n.parse(s,e)},t,i)},setTexturePath:function(r){this.texturePath=r},setCrossOrigin:function(r){this.crossOrigin=r},parse:function(r,e){var t=this.parseGeometries(r.geometries),i=this.parseImages(r.images,function(){e!==void 0&&e(o)}),n=this.parseTextures(r.textures,i),a=this.parseMaterials(r.materials,n),o=this.parseObject(r.object,t,a);return r.animations&&(o.animations=this.parseAnimations(r.animations)),(r.images===void 0||r.images.length===0)&&e!==void 0&&e(o),o},parseGeometries:function(r){var e={};if(r!==void 0)for(var t=new aB,i=new nB,n=0,a=r.length;n0){var a=new tB(e),o=new _M(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,l=r.length;s0?a=new JA(l,u):a=new mn(l,u);break;case"LOD":a=new VS;break;case"Line":a=new ac(o(t.geometry),s(t.material),t.mode);break;case"LineSegments":a=new di(o(t.geometry),s(t.material));break;case"PointCloud":case"Points":a=new ay(o(t.geometry),s(t.material));break;case"Sprite":a=new kS(s(t.material));break;case"Group":a=new GS;break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh type. Instantiates Object3D instead.");default:a=new At}if(a.uuid=t.uuid,t.name!==void 0&&(a.name=t.name),t.matrix!==void 0?(r.fromArray(t.matrix),r.decompose(a.position,a.quaternion,a.scale)):(t.position!==void 0&&a.position.fromArray(t.position),t.rotation!==void 0&&a.rotation.fromArray(t.rotation),t.quaternion!==void 0&&a.quaternion.fromArray(t.quaternion),t.scale!==void 0&&a.scale.fromArray(t.scale)),t.castShadow!==void 0&&(a.castShadow=t.castShadow),t.receiveShadow!==void 0&&(a.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==void 0&&(a.shadow.bias=t.shadow.bias),t.shadow.radius!==void 0&&(a.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(a.visible=t.visible),t.userData!==void 0&&(a.userData=t.userData),t.children!==void 0)for(var c in t.children)a.add(this.parseObject(t.children[c],i,n));if(t.type==="LOD")for(var f=t.levels,h=0;h0)s=i-1;else{s=i;break}if(i=s,t[i]===a){var p=i/(n-1);return p}var u=t[i],c=t[i+1],f=c-u,h=(a-u)/f,p=(i+h)/(n-1);return p},getTangent:function(r){var e=1e-4,t=r-e,i=r+e;t<0&&(t=0),i>1&&(i=1);var n=this.getPoint(t),a=this.getPoint(i),o=a.clone().sub(n);return o.normalize()},getTangentAt:function(r){var e=this.getUtoTmapping(r);return this.getTangent(e)},computeFrenetFrames:function(r,e){var t=new oe,i=[],n=[],a=[],o=new oe,s=new qt,l,u,c;for(l=0;l<=r;l++)u=l/r,i[l]=this.getTangentAt(u),i[l].normalize();n[0]=new oe,a[0]=new oe;var f=Number.MAX_VALUE,h=Math.abs(i[0].x),p=Math.abs(i[0].y),d=Math.abs(i[0].z);for(h<=f&&(f=h,t.set(1,0,0)),p<=f&&(f=p,t.set(0,1,0)),d<=f&&t.set(0,0,1),o.crossVectors(i[0],t).normalize(),n[0].crossVectors(i[0],o),a[0].crossVectors(i[0],n[0]),l=1;l<=r;l++)n[l]=n[l-1].clone(),a[l]=a[l-1].clone(),o.crossVectors(i[l-1],i[l]),o.length()>Number.EPSILON&&(o.normalize(),c=Math.acos(cr.clamp(i[l-1].dot(i[l]),-1,1)),n[l].applyMatrix4(s.makeRotationAxis(o,c))),a[l].crossVectors(i[l],n[l]);if(e===!0)for(c=Math.acos(cr.clamp(n[0].dot(n[r]),-1,1)),c/=r,i[0].dot(o.crossVectors(n[0],n[r]))>0&&(c=-c),l=1;l<=r;l++)n[l].applyMatrix4(s.makeRotationAxis(i[l],c*l)),a[l].crossVectors(i[l],n[l]);return{tangents:i,normals:n,binormals:a}}};ea.create=function(r,e){return r.prototype=Object.create(ea.prototype),r.prototype.constructor=r,r.prototype.getPoint=e,r};uu.prototype=Object.create(ea.prototype);uu.prototype.constructor=uu;uu.prototype.isLineCurve=!0;uu.prototype.getPoint=function(r){if(r===1)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(r).add(this.v1),e};uu.prototype.getPointAt=function(r){return this.getPoint(r)};uu.prototype.getTangent=function(r){var e=this.v2.clone().sub(this.v1);return e.normalize()};fM.prototype=Object.assign(Object.create(ea.prototype),{constructor:fM,add:function(r){this.curves.push(r)},closePath:function(){var r=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);r.equals(e)||this.curves.push(new uu(e,r))},getPoint:function(r){for(var e=r*this.getLength(),t=this.getCurveLengths(),i=0;i=e){var n=t[i]-e,a=this.curves[i],o=a.getLength(),s=o===0?0:1-n/o;return a.getPointAt(s)}i++}return null},getLength:function(){var r=this.getCurveLengths();return r[r.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var r=[],e=0,t=0,i=this.curves.length;t1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},createPointsGeometry:function(r){var e=this.getPoints(r);return this.createGeometry(e)},createSpacedPointsGeometry:function(r){var e=this.getSpacedPoints(r);return this.createGeometry(e)},createGeometry:function(r){for(var e=new sr,t=0,i=r.length;te;)t-=e;te.length-2?e.length-1:i+1],l=e[i>e.length-3?e.length-1:i+2],u=xM.interpolate;return new St(u(a.x,o.x,s.x,l.x,n),u(a.y,o.y,s.y,l.y,n))};Jd.prototype=Object.create(ea.prototype);Jd.prototype.constructor=Jd;Jd.prototype.getPoint=function(r){var e=Ln.b3;return new St(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y))};Jd.prototype.getTangent=function(r){var e=xM.tangentCubicBezier;return new St(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()};$d.prototype=Object.create(ea.prototype);$d.prototype.constructor=$d;$d.prototype.getPoint=function(r){var e=Ln.b2;return new St(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y))};$d.prototype.getTangent=function(r){var e=xM.tangentQuadraticBezier;return new St(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y)).normalize()};oB=Object.assign(Object.create(fM.prototype),{fromPoints:function(r){this.moveTo(r[0].x,r[0].y);for(var e=1,t=r.length;e0){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var c=l.getPoint(1);this.currentPoint.copy(c)}});Id.prototype=Object.assign(Object.create(oB),{constructor:Id,getPointsHoles:function(r){for(var e=[],t=0,i=this.holes.length;tNumber.EPSILON){if(V<0&&(Y=U[G],Q=-Q,J=U[k],V=-V),D.yJ.y)continue;if(D.y===Y.y){if(D.x===Y.x)return!0}else{var K=V*(D.x-Y.x)-Q*(D.y-Y.y);if(K===0)return!0;if(K<0)continue;z=!z}}else{if(D.y!==Y.y)continue;if(J.x<=D.x&&D.x<=Y.x||Y.x<=D.x&&D.x<=J.x)return!0}}return z}var n=Ln.isClockWise,a=this.subPaths;if(a.length===0)return[];if(e===!0)return t(a);var o,s,l,u=[];if(a.length===1)return s=a[0],l=new Id,l.curves=s.curves,u.push(l),u;var c=!n(a[0].getPoints());c=r?!c:c;var f=[],h=[],p=[],d=0,g;h[d]=void 0,p[d]=[];for(var m=0,v=a.length;m1){for(var _=!1,y=[],x=0,M=h.length;x0&&(_||(p=f))}for(var E,m=0,I=h.length;m0){this.source.connect(this.filters[0]);for(var r=1,e=this.filters.length;r0){this.source.disconnect(this.filters[0]);for(var r=1,e=this.filters.length;r=.5)for(var a=0;a!==n;++a)r[e+a]=r[t+a]},_slerp:function(r,e,t,i,n){on.slerpFlat(r,e,r,e,r,t,i)},_lerp:function(r,e,t,i,n){for(var a=1-i,o=0;o!==n;++o){var s=e+o;r[s]=r[s]*a+r[t+o]*i}}};Ri.prototype={constructor:Ri,getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var r=this.node,e=this.parsedPath,t=e.objectName,i=e.propertyName,n=e.propertyIndex;if(r||(r=Ri.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=r),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!r){console.error(" trying to update node for track: "+this.path+" but it wasn't found.");return}if(t){var a=e.objectIndex;switch(t){case"materials":if(!r.material){console.error(" can not bind to material as node does not have a material",this);return}if(!r.material.materials){console.error(" can not bind to material.materials as node.material does not have a materials array",this);return}r=r.material.materials;break;case"bones":if(!r.skeleton){console.error(" can not bind to bones as node does not have a skeleton",this);return}r=r.skeleton.bones;for(var o=0;o=t){var f=t++,h=e[f];i[h.uuid]=c,e[c]=h,i[u]=f,e[f]=l;for(var p=0,d=a;p!==d;++p){var g=n[p],m=g[f],v=g[c];g[c]=m,g[f]=v}}}this.nCachedObjects_=t},uncache:function(r){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,a=this._bindings,o=a.length,s=0,l=arguments.length;s!==l;++s){var u=arguments[s],c=u.uuid,f=n[c];if(f!==void 0)if(delete n[c],f0)for(var l=this._interpolants,u=this._propertyBindings,c=0,f=l.length;c!==f;++c)l[c].evaluate(o),u[c].accumulate(i,s)},_updateWeight:function(r){var e=0;if(this.enabled){e=this.weight;var t=this._weightInterpolant;if(t!==null){var i=t.evaluate(r)[0];e*=i,r>t.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(r){var e=0;if(!this.paused){e=this.timeScale;var t=this._timeScaleInterpolant;if(t!==null){var i=t.evaluate(r)[0];e*=i,r>t.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(r){var e=this.time+r;if(r===0)return e;var t=this._clip.duration,i=this.loop,n=this._loopCount;if(i===wne){n===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(e>=t)e=t;else if(e<0)e=0;else break e;this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:r<0?-1:1})}}else{var a=i===Ene;if(n===-1&&(r>=0?(n=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),e>=t||e<0){var o=Math.floor(e/t);e-=t*o,n+=Math.abs(o);var s=this.repetitions-n;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=r>0?t:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:r>0?1:-1});else{if(s===0){var l=r<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&(n&1)===1)return this.time=e,t-e}return this.time=e,e},_setEndings:function(r,e,t){var i=this._interpolantSettings;t?(i.endingStart=Rd,i.endingEnd=Rd):(r?i.endingStart=this.zeroSlopeAtStart?Rd:Ud:i.endingStart=LS,e?i.endingEnd=this.zeroSlopeAtEnd?Rd:Ud:i.endingEnd=LS)},_scheduleFading:function(r,e,t){var i=this._mixer,n=i.time,a=this._weightInterpolant;a===null&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=n,s[0]=e,o[1]=n+r,s[1]=t,this}};Object.assign(hB.prototype,bs.prototype,{clipAction:function(r,e){var t=e||this._root,i=t.uuid,n=typeof r=="string"?No.findByName(t,r):r,a=n!==null?n.uuid:r,o=this._actionsByClip[a],s=null;if(o!==void 0){var l=o.actionByRoot[i];if(l!==void 0)return l;s=o.knownActions[0],n===null&&(n=s._clip)}if(n===null)return null;var u=new AF(this,n,e);return this._bindAction(u,s),this._addInactiveAction(u,a,i),u},existingAction:function(r,e){var t=e||this._root,i=t.uuid,n=typeof r=="string"?No.findByName(t,r):r,a=n?n.uuid:r,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[i]||null},stopAllAction:function(){var r=this._actions,e=this._nActiveActions,t=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==e;++n)r[n].reset();for(var n=0;n!==i;++n)t[n].useCount=0;return this},update:function(r){r*=this.timeScale;for(var e=this._actions,t=this._nActiveActions,i=this.time+=r,n=Math.sign(r),a=this._accuIndex^=1,o=0;o!==t;++o){var s=e[o];s.enabled&&s._update(i,r,n,a)}for(var l=this._bindings,u=this._nActiveBindings,o=0;o!==u;++o)l[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(r){var e=this._actions,t=r.uuid,i=this._actionsByClip,n=i[t];if(n!==void 0){for(var a=n.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var u=l._cacheIndex,c=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=u,e[u]=c,e.pop(),this._removeInactiveBindingsForAction(l)}delete i[t]}},uncacheRoot:function(r){var e=r.uuid,t=this._actionsByClip;for(var i in t){var n=t[i].actionByRoot,a=n[e];a!==void 0&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[e];if(s!==void 0)for(var l in s){var u=s[l];u.restoreOriginalState(),this._removeInactiveBinding(u)}},uncacheAction:function(r,e){var t=this.existingAction(r,e);t!==null&&(this._deactivateAction(t),this._removeInactiveAction(t))}});Object.assign(hB.prototype,{_bindAction:function(r,e){var t=r._localRoot||this._root,i=r._clip.tracks,n=i.length,a=r._propertyBindings,o=r._interpolants,s=t.uuid,l=this._bindingsByRootAndName,u=l[s];u===void 0&&(u={},l[s]=u);for(var c=0;c!==n;++c){var f=i[c],h=f.name,p=u[h];if(p!==void 0)a[c]=p;else{if(p=a[c],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,s,h));continue}var d=e&&e._propertyBindings[c].binding.parsedPath;p=new dC(Ri.create(t,h,d),f.ValueTypeName,f.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,s,h),a[c]=p}o[c].resultBuffer=p.buffer}},_activateAction:function(r){if(!this._isActiveAction(r)){if(r._cacheIndex===null){var e=(r._localRoot||this._root).uuid,t=r._clip.uuid,i=this._actionsByClip[t];this._bindAction(r,i&&i.knownActions[0]),this._addInactiveAction(r,t,e)}for(var n=r._propertyBindings,a=0,o=n.length;a!==o;++a){var s=n[a];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(r)}},_deactivateAction:function(r){if(this._isActiveAction(r)){for(var e=r._propertyBindings,t=0,i=e.length;t!==i;++t){var n=e[t];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(r)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var r=this;this.stats={actions:{get total(){return r._actions.length},get inUse(){return r._nActiveActions}},bindings:{get total(){return r._bindings.length},get inUse(){return r._nActiveBindings}},controlInterpolants:{get total(){return r._controlInterpolants.length},get inUse(){return r._nActiveControlInterpolants}}}},_isActiveAction:function(r){var e=r._cacheIndex;return e!==null&&e1){var u=l[1];i[u]||(i[u]={start:1/0,end:-1/0});var c=i[u];ac.end&&(c.end=a),t||(t=u)}}for(var u in i){var c=i[u];this.createAnimation(u,c.start,c.end,r)}this.firstAnimation=t};Pn.prototype.setAnimationDirectionForward=function(r){var e=this.animationsMap[r];e&&(e.direction=1,e.directionBackwards=!1)};Pn.prototype.setAnimationDirectionBackward=function(r){var e=this.animationsMap[r];e&&(e.direction=-1,e.directionBackwards=!0)};Pn.prototype.setAnimationFPS=function(r,e){var t=this.animationsMap[r];t&&(t.fps=e,t.duration=(t.end-t.start)/t.fps)};Pn.prototype.setAnimationDuration=function(r,e){var t=this.animationsMap[r];t&&(t.duration=e,t.fps=(t.end-t.start)/t.duration)};Pn.prototype.setAnimationWeight=function(r,e){var t=this.animationsMap[r];t&&(t.weight=e)};Pn.prototype.setAnimationTime=function(r,e){var t=this.animationsMap[r];t&&(t.time=e)};Pn.prototype.getAnimationTime=function(r){var e=0,t=this.animationsMap[r];return t&&(e=t.time),e};Pn.prototype.getAnimationDuration=function(r){var e=-1,t=this.animationsMap[r];return t&&(e=t.duration),e};Pn.prototype.playAnimation=function(r){var e=this.animationsMap[r];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+r+"] undefined in .playAnimation()")};Pn.prototype.stopAnimation=function(r){var e=this.animationsMap[r];e&&(e.active=!1)};Pn.prototype.update=function(r){for(var e=0,t=this.animationsList.length;ei.duration||i.time<0)&&(i.direction*=-1,i.time>i.duration&&(i.time=i.duration,i.directionBackwards=!0),i.time<0&&(i.time=0,i.directionBackwards=!1)):(i.time=i.time%i.duration,i.time<0&&(i.time+=i.duration));var a=i.start+cr.clamp(Math.floor(i.time/n),0,i.length-1),o=i.weight;a!==i.currentFrame&&(this.morphTargetInfluences[i.lastFrame]=0,this.morphTargetInfluences[i.currentFrame]=1*o,this.morphTargetInfluences[a]=0,i.lastFrame=i.currentFrame,i.currentFrame=a);var s=i.time%n/n;i.directionBackwards&&(s=1-s),i.currentFrame!==i.lastFrame?(this.morphTargetInfluences[i.currentFrame]=s*o,this.morphTargetInfluences[i.lastFrame]=(1-s)*o):this.morphTargetInfluences[i.currentFrame]=o}}};hM.prototype=Object.create(At.prototype);hM.prototype.constructor=hM;hM.prototype.isImmediateRenderObject=!0;pM.prototype=Object.create(di.prototype);pM.prototype.constructor=pM;pM.prototype.update=function(){var r=new oe,e=new oe,t=new ws;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),t.getNormalMatrix(this.object.matrixWorld);var a=this.object.matrixWorld,o=this.geometry.attributes.position,s=this.object.geometry;if(s&&s.isGeometry)for(var l=s.vertices,u=s.faces,c=0,f=0,h=u.length;f.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(r.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(r,e))}}();em.prototype.setLength=function(r,e,t){e===void 0&&(e=.2*r),t===void 0&&(t=.2*e),this.line.scale.set(1,Math.max(0,r-e),1),this.line.updateMatrix(),this.cone.scale.set(t,e,t),this.cone.position.y=r,this.cone.updateMatrix()};em.prototype.setColor=function(r){this.line.material.color.copy(r),this.cone.material.color.copy(r)};gC.prototype=Object.create(di.prototype);gC.prototype.constructor=gC;pB=function(){var r=new oe,e=new n,t=new n,i=new n;function n(){}return n.prototype.init=function(a,o,s,l){this.c0=a,this.c1=s,this.c2=-3*a+3*o-2*s-l,this.c3=2*a-2*o+s+l},n.prototype.initNonuniformCatmullRom=function(a,o,s,l,u,c,f){var h=(o-a)/u-(s-a)/(u+c)+(s-o)/c,p=(s-o)/c-(l-o)/(c+f)+(l-s)/f;h*=c,p*=c,this.init(o,s,h,p)},n.prototype.initCatmullRom=function(a,o,s,l,u){this.init(o,s,u*(s-a),u*(l-o))},n.prototype.calc=function(a){var o=a*a,s=o*a;return this.c0+this.c1*a+this.c2*o+this.c3*s},ea.create(function(a){this.points=a||[],this.closed=!1},function(a){var o=this.points,s,l,u,c;c=o.length,c<2&&console.log("duh, you need at least 2 points"),s=(c-(this.closed?0:1))*a,l=Math.floor(s),u=s-l,this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/o.length)+1)*o.length:u===0&&l===c-1&&(l=c-2,u=1);var f,h,p,d;if(this.closed||l>0?f=o[(l-1)%c]:(r.subVectors(o[0],o[1]).add(o[0]),f=r),h=o[l%c],p=o[(l+1)%c],this.closed||l+2e.length-2?e.length-1:i+1],l=e[i>e.length-3?e.length-1:i+2],u=xM.interpolate;return new oe(u(a.x,o.x,s.x,l.x,n),u(a.y,o.y,s.y,l.y,n),u(a.z,o.z,s.z,l.z,n))}),iLe=ea.create(function(r,e,t,i){this.v0=r,this.v1=e,this.v2=t,this.v3=i},function(r){var e=Ln.b3;return new oe(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(r,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),nLe=ea.create(function(r,e,t){this.v0=r,this.v1=e,this.v2=t},function(r){var e=Ln.b2;return new oe(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y),e(r,this.v0.z,this.v1.z,this.v2.z))}),aLe=ea.create(function(r,e){this.v1=r,this.v2=e},function(r){if(r===1)return this.v2.clone();var e=new oe;return e.subVectors(this.v2,this.v1),e.multiplyScalar(r),e.add(this.v1),e});yC.prototype=Object.create(sc.prototype);yC.prototype.constructor=yC;oLe={createMultiMaterialObject:function(r,e){for(var t=new GS,i=0,n=e.length;i{"use strict";var OLe=CC&&CC.__extends||function(r,e){for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);function i(){this.constructor=r}r.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)},zr=(tae(),Fse(eae)),xi={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},rae={type:"change"},dB={type:"start"},mB={type:"end"},iae=1e-6,zLe=function(r){OLe(e,r);function e(t,i,n){var a=r.call(this)||this;return a.object=t,a.domElement=i!==void 0?i:document,a.window=n!==void 0?n:window,a.enabled=!0,a.target=new zr.Vector3,a.minDistance=0,a.maxDistance=1/0,a.minZoom=0,a.maxZoom=1/0,a.minPolarAngle=0,a.maxPolarAngle=Math.PI,a.minAzimuthAngle=-1/0,a.maxAzimuthAngle=1/0,a.enableDamping=!1,a.dampingFactor=.25,a.enableZoom=!0,a.zoomSpeed=1,a.enableRotate=!0,a.rotateSpeed=1,a.enablePan=!0,a.keyPanSpeed=7,a.autoRotate=!1,a.autoRotateSpeed=2,a.enableKeys=!0,a.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},a.mouseButtons={ORBIT:zr.MOUSE.LEFT,ZOOM:zr.MOUSE.MIDDLE,PAN:zr.MOUSE.RIGHT},a.target0=a.target.clone(),a.position0=a.object.position.clone(),a.zoom0=a.object.zoom,a.updateOffset=new zr.Vector3,a.updateQuat=new zr.Quaternion().setFromUnitVectors(t.up,new zr.Vector3(0,1,0)),a.updateQuatInverse=a.updateQuat.clone().inverse(),a.updateLastPosition=new zr.Vector3,a.updateLastQuaternion=new zr.Quaternion,a.state=xi.NONE,a.scale=1,a.spherical=new zr.Spherical,a.sphericalDelta=new zr.Spherical,a.panOffset=new zr.Vector3,a.zoomChanged=!1,a.rotateStart=new zr.Vector2,a.rotateEnd=new zr.Vector2,a.rotateDelta=new zr.Vector2,a.panStart=new zr.Vector2,a.panEnd=new zr.Vector2,a.panDelta=new zr.Vector2,a.dollyStart=new zr.Vector2,a.dollyEnd=new zr.Vector2,a.dollyDelta=new zr.Vector2,a.panLeftV=new zr.Vector3,a.panUpV=new zr.Vector3,a.panInternalOffset=new zr.Vector3,a.onMouseDown=function(o){if(a.enabled!==!1){if(o.preventDefault(),o.button===a.mouseButtons.ORBIT){if(a.enableRotate===!1)return;a.rotateStart.set(o.clientX,o.clientY),a.state=xi.ROTATE}else if(o.button===a.mouseButtons.ZOOM){if(a.enableZoom===!1)return;a.dollyStart.set(o.clientX,o.clientY),a.state=xi.DOLLY}else if(o.button===a.mouseButtons.PAN){if(a.enablePan===!1)return;a.panStart.set(o.clientX,o.clientY),a.state=xi.PAN}a.state!==xi.NONE&&(document.addEventListener("mousemove",a.onMouseMove,!1),document.addEventListener("mouseup",a.onMouseUp,!1),a.dispatchEvent(dB))}},a.onMouseMove=function(o){if(a.enabled!==!1){if(o.preventDefault(),a.state===xi.ROTATE){if(a.enableRotate===!1)return;a.rotateEnd.set(o.clientX,o.clientY),a.rotateDelta.subVectors(a.rotateEnd,a.rotateStart);var s=a.domElement===document?a.domElement.body:a.domElement;a.rotateLeft(2*Math.PI*a.rotateDelta.x/s.clientWidth*a.rotateSpeed),a.rotateUp(2*Math.PI*a.rotateDelta.y/s.clientHeight*a.rotateSpeed),a.rotateStart.copy(a.rotateEnd),a.update()}else if(a.state===xi.DOLLY){if(a.enableZoom===!1)return;a.dollyEnd.set(o.clientX,o.clientY),a.dollyDelta.subVectors(a.dollyEnd,a.dollyStart),a.dollyDelta.y>0?a.dollyIn(a.getZoomScale()):a.dollyDelta.y<0&&a.dollyOut(a.getZoomScale()),a.dollyStart.copy(a.dollyEnd),a.update()}else if(a.state===xi.PAN){if(a.enablePan===!1)return;a.panEnd.set(o.clientX,o.clientY),a.panDelta.subVectors(a.panEnd,a.panStart),a.pan(a.panDelta.x,a.panDelta.y),a.panStart.copy(a.panEnd),a.update()}}},a.onMouseUp=function(o){a.enabled!==!1&&(document.removeEventListener("mousemove",a.onMouseMove,!1),document.removeEventListener("mouseup",a.onMouseUp,!1),a.dispatchEvent(mB),a.state=xi.NONE)},a.onMouseWheel=function(o){a.enabled===!1||a.enableZoom===!1||a.state!==xi.NONE&&a.state!==xi.ROTATE||(o.preventDefault(),o.stopPropagation(),o.deltaY<0?a.dollyOut(a.getZoomScale()):o.deltaY>0&&a.dollyIn(a.getZoomScale()),a.update(),a.dispatchEvent(dB),a.dispatchEvent(mB))},a.onKeyDown=function(o){if(!(a.enabled===!1||a.enableKeys===!1||a.enablePan===!1))switch(o.keyCode){case a.keys.UP:a.pan(0,a.keyPanSpeed),a.update();break;case a.keys.BOTTOM:a.pan(0,-a.keyPanSpeed),a.update();break;case a.keys.LEFT:a.pan(a.keyPanSpeed,0),a.update();break;case a.keys.RIGHT:a.pan(-a.keyPanSpeed,0),a.update();break}},a.onTouchStart=function(o){if(a.enabled!==!1){switch(o.touches.length){case 1:{if(a.enableRotate===!1)return;a.rotateStart.set(o.touches[0].pageX,o.touches[0].pageY),a.state=xi.TOUCH_ROTATE}break;case 2:{if(a.enableZoom===!1)return;var s=o.touches[0].pageX-o.touches[1].pageX,l=o.touches[0].pageY-o.touches[1].pageY,u=Math.sqrt(s*s+l*l);a.dollyStart.set(0,u),a.state=xi.TOUCH_DOLLY}break;case 3:{if(a.enablePan===!1)return;a.panStart.set(o.touches[0].pageX,o.touches[0].pageY),a.state=xi.TOUCH_PAN}break;default:a.state=xi.NONE}a.state!==xi.NONE&&a.dispatchEvent(dB)}},a.onTouchMove=function(o){if(a.enabled!==!1)switch(o.preventDefault(),o.stopPropagation(),o.touches.length){case 1:{if(a.enableRotate===!1||a.state!==xi.TOUCH_ROTATE)return;a.rotateEnd.set(o.touches[0].pageX,o.touches[0].pageY),a.rotateDelta.subVectors(a.rotateEnd,a.rotateStart);var s=a.domElement===document?a.domElement.body:a.domElement;a.rotateLeft(2*Math.PI*a.rotateDelta.x/s.clientWidth*a.rotateSpeed),a.rotateUp(2*Math.PI*a.rotateDelta.y/s.clientHeight*a.rotateSpeed),a.rotateStart.copy(a.rotateEnd),a.update()}break;case 2:{if(a.enableZoom===!1||a.state!==xi.TOUCH_DOLLY)return;var l=o.touches[0].pageX-o.touches[1].pageX,u=o.touches[0].pageY-o.touches[1].pageY,c=Math.sqrt(l*l+u*u);a.dollyEnd.set(0,c),a.dollyDelta.subVectors(a.dollyEnd,a.dollyStart),a.dollyDelta.y>0?a.dollyOut(a.getZoomScale()):a.dollyDelta.y<0&&a.dollyIn(a.getZoomScale()),a.dollyStart.copy(a.dollyEnd),a.update()}break;case 3:{if(a.enablePan===!1||a.state!==xi.TOUCH_PAN)return;a.panEnd.set(o.touches[0].pageX,o.touches[0].pageY),a.panDelta.subVectors(a.panEnd,a.panStart),a.pan(a.panDelta.x,a.panDelta.y),a.panStart.copy(a.panEnd),a.update()}break;default:a.state=xi.NONE}},a.onTouchEnd=function(o){a.enabled!==!1&&(a.dispatchEvent(mB),a.state=xi.NONE)},a.onContextMenu=function(o){o.preventDefault()},a.domElement.addEventListener("contextmenu",a.onContextMenu,!1),a.domElement.addEventListener("mousedown",a.onMouseDown,!1),a.domElement.addEventListener("wheel",a.onMouseWheel,!1),a.domElement.addEventListener("touchstart",a.onTouchStart,!1),a.domElement.addEventListener("touchend",a.onTouchEnd,!1),a.domElement.addEventListener("touchmove",a.onTouchMove,!1),a.window.addEventListener("keydown",a.onKeyDown,!1),a.update(),a}return e.prototype.update=function(){var t=this.object.position;return this.updateOffset.copy(t).sub(this.target),this.updateOffset.applyQuaternion(this.updateQuat),this.spherical.setFromVector3(this.updateOffset),this.autoRotate&&this.state===xi.NONE&&this.rotateLeft(this.getAutoRotationAngle()),this.spherical.theta+=this.sphericalDelta.theta,this.spherical.phi+=this.sphericalDelta.phi,this.spherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.spherical.theta)),this.spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.spherical.phi)),this.spherical.makeSafe(),this.spherical.radius*=this.scale,this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),this.target.add(this.panOffset),this.updateOffset.setFromSpherical(this.spherical),this.updateOffset.applyQuaternion(this.updateQuatInverse),t.copy(this.target).add(this.updateOffset),this.object.lookAt(this.target),this.enableDamping===!0?(this.sphericalDelta.theta*=1-this.dampingFactor,this.sphericalDelta.phi*=1-this.dampingFactor):this.sphericalDelta.set(0,0,0),this.scale=1,this.panOffset.set(0,0,0),this.zoomChanged||this.updateLastPosition.distanceToSquared(this.object.position)>iae||8*(1-this.updateLastQuaternion.dot(this.object.quaternion))>iae?(this.dispatchEvent(rae),this.updateLastPosition.copy(this.object.position),this.updateLastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0):!1},e.prototype.panLeft=function(t,i){this.panLeftV.setFromMatrixColumn(i,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)},e.prototype.panUp=function(t,i){this.panUpV.setFromMatrixColumn(i,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)},e.prototype.pan=function(t,i){var n=this.domElement===document?this.domElement.body:this.domElement;if(this.object instanceof zr.PerspectiveCamera){var a=this.object.position;this.panInternalOffset.copy(a).sub(this.target);var o=this.panInternalOffset.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*o/n.clientHeight,this.object.matrix),this.panUp(2*i*o/n.clientHeight,this.object.matrix)}else this.object instanceof zr.OrthographicCamera?(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this.panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)},e.prototype.dollyIn=function(t){this.object instanceof zr.PerspectiveCamera?this.scale/=t:this.object instanceof zr.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*t)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)},e.prototype.dollyOut=function(t){this.object instanceof zr.PerspectiveCamera?this.scale*=t:this.object instanceof zr.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/t)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)},e.prototype.getAutoRotationAngle=function(){return 2*Math.PI/60/60*this.autoRotateSpeed},e.prototype.getZoomScale=function(){return Math.pow(.95,this.zoomSpeed)},e.prototype.rotateLeft=function(t){this.sphericalDelta.theta-=t},e.prototype.rotateUp=function(t){this.sphericalDelta.phi-=t},e.prototype.getPolarAngle=function(){return this.spherical.phi},e.prototype.getAzimuthalAngle=function(){return this.spherical.theta},e.prototype.dispose=function(){this.domElement.removeEventListener("contextmenu",this.onContextMenu,!1),this.domElement.removeEventListener("mousedown",this.onMouseDown,!1),this.domElement.removeEventListener("wheel",this.onMouseWheel,!1),this.domElement.removeEventListener("touchstart",this.onTouchStart,!1),this.domElement.removeEventListener("touchend",this.onTouchEnd,!1),this.domElement.removeEventListener("touchmove",this.onTouchMove,!1),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.window.removeEventListener("keydown",this.onKeyDown,!1)},e.prototype.reset=function(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(rae),this.update(),this.state=xi.NONE},Object.defineProperty(e.prototype,"center",{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noZoom",{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(t){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!t},enumerable:!0,configurable:!0}),e}(zr.EventDispatcher);CC.OrbitControls=zLe});var aL=function(r,e){return aL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},aL(r,e)};function Z(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");aL(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Bse=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),kse=function(){function r(){this.browser=new Bse,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r}(),Qh=new kse;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Qh.wxa=!0,Qh.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Qh.worker=!0:typeof navigator>"u"||navigator.userAgent.indexOf("Node.js")===0?(Qh.node=!0,Qh.svgSupported=!0):Vse(navigator.userAgent,Qh);function Vse(r,e){var t=e.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(t.firefox=!0,t.version=i[1]),n&&(t.ie=!0,t.version=n[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in s||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}var zt=Qh;var eb=12,oL="sans-serif",ho=eb+"px "+oL,Gse=20,Hse=100,Wse="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Xse(r){var e={};if(typeof JSON>"u")return e;for(var t=0;t=0)s=o*t.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),r.appendChild(o),t.push(o)}return t}function sle(r,e,t){for(var i=t?"invTrans":"trans",n=e[i],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=r[u].getBoundingClientRect(),f=2*u,h=c.left,p=c.top;o.push(h,p),l=l&&a&&h===a[f]&&p===a[f+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&n?n:(e.srcCoords=o,e[i]=t?hL(s,o):hL(o,s))}function dL(r){return r.nodeName.toUpperCase()==="CANVAS"}var lle=/([&<>"'])/g,ule={"&":"&","<":"<",">":">",'"':""","'":"'"};function yn(r){return r==null?"":(r+"").replace(lle,function(e,t){return ule[t]})}var cle=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,mL=[],fle=zt.browser.firefox&&+zt.browser.version.split(".")[0]<39;function ub(r,e,t,i){return t=t||{},i?XV(r,e,t):fle&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):XV(r,e,t),t}function XV(r,e,t){if(zt.domSupported&&r.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(dL(r)){var a=r.getBoundingClientRect();t.zrX=i-a.left,t.zrY=n-a.top;return}else if(lb(mL,r,i,n)){t.zrX=mL[0],t.zrY=mL[1];return}}t.zrX=t.zrY=0}function cb(r){return r||window.event}function Ca(r,e,t){if(e=cb(e),e.zrX!=null)return e;var i=e.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&ub(r,o,e,t)}else{ub(r,e,e,t);var a=hle(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&cle.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function hle(r){var e=r.wheelDelta;if(e)return e;var t=r.deltaX,i=r.deltaY;if(t==null||i==null)return e;var n=Math.abs(i!==0?i:t),a=i>0?-1:i<0?1:t>0?-1:1;return 3*n*a}function O0(r,e,t,i){r.addEventListener(e,t,i)}function YV(r,e,t,i){r.removeEventListener(e,t,i)}var Ra=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function vL(r){return r.which===2||r.which===3}var ZV=function(){function r(){this._track=[]}return r.prototype.recognize=function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(e,t,i){var n=e.touches;if(n){for(var a={points:[],touches:[],target:t,event:e},o=0,s=n.length;o1&&i&&i.length>1){var a=qV(i)/qV(n);!isFinite(a)&&(a=1),e.pinchScale=a;var o=ple(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:r[0].target,event:e}}}}};function wi(){return[1,0,0,1,0,0]}function ff(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function z0(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r}function La(r,e,t){var i=e[0]*t[0]+e[2]*t[1],n=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function _n(r,e,t){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4]+t[0],r[5]=e[5]+t[1],r}function Pa(r,e,t,i){i===void 0&&(i=[0,0]);var n=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],c=Math.sin(t),f=Math.cos(t);return r[0]=n*f+s*c,r[1]=-n*c+s*f,r[2]=a*f+l*c,r[3]=-a*c+f*l,r[4]=f*(o-i[0])+c*(u-i[1])+i[0],r[5]=f*(u-i[1])-c*(o-i[0])+i[1],r}function Lm(r,e,t){var i=t[0],n=t[1];return r[0]=e[0]*i,r[1]=e[1]*n,r[2]=e[2]*i,r[3]=e[3]*n,r[4]=e[4]*i,r[5]=e[5]*n,r}function qo(r,e){var t=e[0],i=e[2],n=e[4],a=e[1],o=e[3],s=e[5],l=t*o-a*i;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-i*l,r[3]=t*l,r[4]=(i*s-o*n)*l,r[5]=(a*n-t*s)*l,r):null}function jV(r){var e=wi();return z0(e,r),e}var dle=function(){function r(e,t){this.x=e||0,this.y=t||0}return r.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(e,t){return this.x=e,this.y=t,this},r.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},r.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},r.prototype.scale=function(e){this.x*=e,this.y*=e},r.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},r.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},r.prototype.dot=function(e){return this.x*e.x+this.y*e.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},r.prototype.distance=function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},r.prototype.distanceSquare=function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(e){if(e){var t=this.x,i=this.y;return this.x=e[0]*t+e[2]*i+e[4],this.y=e[1]*t+e[3]*i+e[5],this}},r.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},r.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},r.set=function(e,t,i){e.x=t,e.y=i},r.copy=function(e,t){e.x=t.x,e.y=t.y},r.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},r.lenSquare=function(e){return e.x*e.x+e.y*e.y},r.dot=function(e,t){return e.x*t.x+e.y*t.y},r.add=function(e,t,i){e.x=t.x+i.x,e.y=t.y+i.y},r.sub=function(e,t,i){e.x=t.x-i.x,e.y=t.y-i.y},r.scale=function(e,t,i){e.x=t.x*i,e.y=t.y*i},r.scaleAndAdd=function(e,t,i,n){e.x=t.x+i.x*n,e.y=t.y+i.y*n},r.lerp=function(e,t,i,n){var a=1-n;e.x=a*t.x+n*i.x,e.y=a*t.y+n*i.y},r}(),Nt=dle;var fb=Math.min,hb=Math.max,ip=new Nt,np=new Nt,ap=new Nt,op=new Nt,F0=new Nt,B0=new Nt,mle=function(){function r(e,t,i,n){i<0&&(e=e+i,i=-i),n<0&&(t=t+n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}return r.prototype.union=function(e){var t=fb(e.x,this.x),i=fb(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=hb(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=hb(e.y+e.height,this.y+this.height)-i:this.height=e.height,this.x=t,this.y=i},r.prototype.applyTransform=function(e){r.applyTransform(this,this,e)},r.prototype.calculateTransform=function(e){var t=this,i=e.width/t.width,n=e.height/t.height,a=wi();return _n(a,a,[-t.x,-t.y]),Lm(a,a,[i,n]),_n(a,a,[e.x,e.y]),a},r.prototype.intersect=function(e,t){if(!e)return!1;e instanceof r||(e=r.create(e));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,c=e.y,f=e.y+e.height,h=!(ad&&(d=y,gd&&(d=x,v<_?Nt.set(B0,0,-v):Nt.set(B0,0,_)):y=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(e){r.copy(this,e)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(e){return new r(e.x,e.y,e.width,e.height)},r.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},r.applyTransform=function(e,t,i){if(!i){e!==t&&r.copy(e,t);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];e.x=t.x*n+o,e.y=t.y*a+s,e.width=t.width*n,e.height=t.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}ip.x=ap.x=t.x,ip.y=op.y=t.y,np.x=op.x=t.x+t.width,np.y=ap.y=t.y+t.height,ip.transform(i),op.transform(i),np.transform(i),ap.transform(i),e.x=fb(ip.x,np.x,ap.x,op.x),e.y=fb(ip.y,np.y,ap.y,op.y);var l=hb(ip.x,np.x,ap.x,op.x),u=hb(ip.y,np.y,ap.y,op.y);e.width=l-e.x,e.height=u-e.y},r}(),lt=mle;var JV="silent";function vle(r,e,t){return{type:r,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:gle}}function gle(){Ra(this.event)}var yle=function(r){Xt(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Pi),k0=function(){function r(e,t){this.x=e,this.y=t}return r}(),_le=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],yL=new lt(0,0,0,0),$V=function(r){Xt(e,r);function e(t,i,n,a,o){var s=r.call(this)||this;return s._hovered=new k0(0,0),s.storage=t,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new yle,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new GV(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(N(_le,function(i){t.on&&t.on(i,this[i],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var i=t.zrX,n=t.zrY,a=QV(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new k0(i,n):this.findHover(i,n),u=l.target,c=this.proxy;c.setCursor&&c.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var i=t.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new k0(0,0)},e.prototype.dispatch=function(t,i){var n=this[t];n&&n.call(this,i)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var i=this.proxy;i.setCursor&&i.setCursor(t)},e.prototype.dispatchToElement=function(t,i,n){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var o="on"+i,s=vle(i,t,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},e.prototype.findHover=function(t,i,n){var a=this.storage.getDisplayList(),o=new k0(t,i);if(KV(a,o,t,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,c=new lt(t-u,i-u,l,l),f=a.length-1;f>=0;f--){var h=a[f];h!==n&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(yL.copy(h.getBoundingRect()),h.transform&&yL.applyTransform(h.transform),yL.intersect(c)&&s.push(h))}if(s.length)for(var p=4,d=Math.PI/12,g=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,r,e)}});function xle(r,e,t){if(r[r.rectHover?"rectContain":"contain"](e,t)){for(var i=r,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(e,t))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s||i.parent}return n?JV:!0}return!1}function KV(r,e,t,i,n){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==n&&!o.ignore&&(s=xle(o,t,i))&&(!e.topTarget&&(e.topTarget=o),s!==JV)){e.target=o;break}}}function QV(r,e,t){var i=r.painter;return e<0||e>i.getWidth()||t<0||t>i.getHeight()}var eG=$V;var iG=32,V0=7;function Sle(r){for(var e=0;r>=iG;)e|=r&1,r>>=1;return r+e}function tG(r,e,t,i){var n=e+1;if(n===t)return 1;if(i(r[n++],r[e])<0){for(;n=0;)n++;return n-e}function Mle(r,e,t){for(t--;e>>1,n(a,r[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function _L(r,e,t,i,n,a){var o=0,s=0,l=1;if(a(r,e[t+n])>0){for(s=i-n;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o>>1);a(r,e[t+c])>0?o=c+1:l=c}return l}function xL(r,e,t,i,n,a){var o=0,s=0,l=1;if(a(r,e[t+n])<0){for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o>>1);a(r,e[t+c])<0?l=c:o=c+1}return l}function ble(r,e){var t=V0,i,n,a=0,o=[];i=[],n=[];function s(p,d){i[a]=p,n[a]=d,a+=1}function l(){for(;a>1;){var p=a-2;if(p>=1&&n[p-1]<=n[p]+n[p+1]||p>=2&&n[p-2]<=n[p]+n[p-1])n[p-1]n[p+1])break;c(p)}}function u(){for(;a>1;){var p=a-2;p>0&&n[p-1]=V0||w>=V0);if(T)break;M<0&&(M=0),M+=2}if(t=M,t<1&&(t=1),d===1){for(v=0;v=0;v--)r[S+v]=r[M+v];r[x]=o[y];return}for(var w=t;;){var T=0,C=0,b=!1;do if(e(o[y],r[_])<0){if(r[x--]=r[_--],T++,C=0,--d===0){b=!0;break}}else if(r[x--]=o[y--],C++,T=0,--m===1){b=!0;break}while((T|C)=0;v--)r[S+v]=r[M+v];if(d===0){b=!0;break}}if(r[x--]=o[y--],--m===1){b=!0;break}if(C=m-_L(r[_],o,0,m,m-1,e),C!==0){for(x-=C,y-=C,m-=C,S=x+1,M=y+1,v=0;v=V0||C>=V0);if(b)break;w<0&&(w=0),w+=2}if(t=w,t<1&&(t=1),m===1){for(x-=d,_-=d,S=x+1,M=_+1,v=d-1;v>=0;v--)r[S+v]=r[M+v];r[x]=o[y]}else{if(m===0)throw new Error;for(M=x-(m-1),v=0;vs&&(l=s),rG(r,t,t+l,t+a,e),a=l}o.pushRun(t,a),o.mergeRuns(),n-=a,t+=a}while(n!==0);o.forceMergeRuns()}}var zi=1,lp=2,hf=4;var nG=!1;function SL(){nG||(nG=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function aG(r,e){return r.zlevel===e.zlevel?r.z===e.z?r.z2-e.z2:r.z-e.z:r.zlevel-e.zlevel}var wle=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=aG}return r.prototype.traverse=function(e,t){for(var i=0;i0&&(c.__clipPaths=[]),isNaN(c.z)&&(SL(),c.z=0),isNaN(c.z2)&&(SL(),c.z2=0),isNaN(c.zlevel)&&(SL(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,t,i);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,t,i);var p=e.getTextContent();p&&this._updateAndAddDisplayable(p,t,i)}},r.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},r.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,i=e.length;t=0&&this._roots.splice(n,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),oG=wle;var sG;sG=zt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var G0=sG;var pb={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)))},elasticOut:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*r)*Math.sin((r-e)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),(r*=2)<1?-.5*(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)):t*Math.pow(2,-10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var e=1.70158;return r*r*((e+1)*r-e)},backOut:function(r){var e=1.70158;return--r*r*((e+1)*r+e)+1},backInOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)},bounceIn:function(r){return 1-pb.bounceOut(1-r)},bounceOut:function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},bounceInOut:function(r){return r<.5?pb.bounceIn(r*2)*.5:pb.bounceOut(r*2-1)*.5+.5}},db=pb;var mb=Math.pow,df=Math.sqrt,gb=1e-8,uG=1e-4,lG=df(3),vb=1/3,Al=El(),Zo=El(),Pm=El();function pf(r){return r>-gb&&rgb||r<-gb}function hi(r,e,t,i,n){var a=1-n;return a*a*(a*r+3*n*e)+n*n*(n*i+3*a*t)}function ML(r,e,t,i,n){var a=1-n;return 3*(((e-r)*a+2*(t-e)*n)*a+(i-t)*n*n)}function up(r,e,t,i,n,a){var o=i+3*(e-t)-r,s=3*(t-e*2+r),l=3*(e-r),u=r-n,c=s*s-3*o*l,f=s*l-9*o*u,h=l*l-3*s*u,p=0;if(pf(c)&&pf(f))if(pf(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[p++]=d)}else{var g=f*f-4*c*h;if(pf(g)){var m=f/c,d=-s/o+m,v=-m/2;d>=0&&d<=1&&(a[p++]=d),v>=0&&v<=1&&(a[p++]=v)}else if(g>0){var _=df(g),y=c*s+1.5*o*(-f+_),x=c*s+1.5*o*(-f-_);y<0?y=-mb(-y,vb):y=mb(y,vb),x<0?x=-mb(-x,vb):x=mb(x,vb);var d=(-s-(y+x))/(3*o);d>=0&&d<=1&&(a[p++]=d)}else{var M=(2*c*s-3*o*f)/(2*df(c*c*c)),S=Math.acos(M)/3,w=df(c),T=Math.cos(S),d=(-s-2*w*T)/(3*o),v=(-s+w*(T+lG*Math.sin(S)))/(3*o),C=(-s+w*(T-lG*Math.sin(S)))/(3*o);d>=0&&d<=1&&(a[p++]=d),v>=0&&v<=1&&(a[p++]=v),C>=0&&C<=1&&(a[p++]=C)}}return p}function yb(r,e,t,i,n){var a=6*t-12*e+6*r,o=9*e+3*i-3*r-9*t,s=3*e-3*r,l=0;if(pf(o)){if(cG(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var c=a*a-4*o*s;if(pf(c))n[0]=-a/(2*o);else if(c>0){var f=df(c),u=(-a+f)/(2*o),h=(-a-f)/(2*o);u>=0&&u<=1&&(n[l++]=u),h>=0&&h<=1&&(n[l++]=h)}}return l}function jo(r,e,t,i,n,a){var o=(e-r)*n+r,s=(t-e)*n+e,l=(i-t)*n+t,u=(s-o)*n+o,c=(l-s)*n+s,f=(c-u)*n+u;a[0]=r,a[1]=o,a[2]=u,a[3]=f,a[4]=f,a[5]=c,a[6]=l,a[7]=i}function _b(r,e,t,i,n,a,o,s,l,u,c){var f,h=.005,p=1/0,d,g,m,v;Al[0]=l,Al[1]=u;for(var _=0;_<1;_+=.05)Zo[0]=hi(r,t,n,o,_),Zo[1]=hi(e,i,a,s,_),m=gu(Al,Zo),m=0&&m=0&&u<=1&&(n[l++]=u)}}else{var c=o*o-4*a*s;if(pf(c)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(c>0){var f=df(c),u=(-o+f)/(2*a),h=(-o-f)/(2*a);u>=0&&u<=1&&(n[l++]=u),h>=0&&h<=1&&(n[l++]=h)}}return l}function xb(r,e,t){var i=r+t-2*e;return i===0?.5:(r-e)/i}function mf(r,e,t,i,n){var a=(e-r)*i+r,o=(t-e)*i+e,s=(o-a)*i+a;n[0]=r,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=t}function Sb(r,e,t,i,n,a,o,s,l){var u,c=.005,f=1/0;Al[0]=o,Al[1]=s;for(var h=0;h<1;h+=.05){Zo[0]=vi(r,t,n,h),Zo[1]=vi(e,i,a,h);var p=gu(Al,Zo);p=0&&p=1?1:up(0,i,a,1,l,s)&&hi(0,n,o,1,s[0])}}}var Ele=function(){function r(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Dr,this.ondestroy=e.ondestroy||Dr,this.onrestart=e.onrestart||Dr,e.easing&&this.setEasing(e.easing)}return r.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var i=this._life,n=e-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(e){this.easing=e,this.easingFunc=He(e)?e:db[e]||Dm(e)},r}(),dG=Ele;var mG=function(){function r(e){this.value=e}return r}();var Ale=function(){function r(){this._len=0}return r.prototype.insert=function(e){var t=new mG(e);return this.insertEntry(t),t},r.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},r.prototype.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}();var Cle=function(){function r(e){this._list=new Ale,this._maxSize=10,this._map={},this._maxSize=e}return r.prototype.put=function(e,t){var i=this._list,n=this._map,a=null;if(n[e]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new mG(t),s.key=e,i.insertEntry(s),n[e]=s}return a},r.prototype.get=function(e){var t=this._map[e],i=this._list;if(t!=null)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),yu=Cle;var vG={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Us(r){return r=Math.round(r),r<0?0:r>255?255:r}function Rle(r){return r=Math.round(r),r<0?0:r>360?360:r}function X0(r){return r<0?0:r>1?1:r}function bL(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?Us(parseFloat(e)/100*255):Us(parseInt(e,10))}function cp(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?X0(parseFloat(e)/100):X0(parseFloat(e))}function wL(r,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?r+(e-r)*t*6:t*2<1?e:t*3<2?r+(e-r)*(2/3-t)*6:r}function vf(r,e,t){return r+(e-r)*t}function Ko(r,e,t,i,n){return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r}function TL(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}var yG=new yu(20),Mb=null;function Im(r,e){Mb&&TL(Mb,e),Mb=yG.put(r,Mb||e.slice())}function cn(r,e){if(r){e=e||[];var t=yG.get(r);if(t)return TL(e,t);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in vG)return TL(e,vG[i]),Im(r,e),e;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){Ko(e,0,0,0,1);return}return Ko(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),Im(r,e),e}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){Ko(e,0,0,0,1);return}return Ko(e,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),Im(r,e),e}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Ko(e,+u[0],+u[1],+u[2],1):Ko(e,0,0,0,1);c=cp(u.pop());case"rgb":if(u.length>=3)return Ko(e,bL(u[0]),bL(u[1]),bL(u[2]),u.length===3?c:cp(u[3])),Im(r,e),e;Ko(e,0,0,0,1);return;case"hsla":if(u.length!==4){Ko(e,0,0,0,1);return}return u[3]=cp(u[3]),EL(u,e),Im(r,e),e;case"hsl":if(u.length!==3){Ko(e,0,0,0,1);return}return EL(u,e),Im(r,e),e;default:return}}Ko(e,0,0,0,1)}}function EL(r,e){var t=(parseFloat(r[0])%360+360)%360/360,i=cp(r[1]),n=cp(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],Ko(e,Us(wL(o,a,t+1/3)*255),Us(wL(o,a,t)*255),Us(wL(o,a,t-1/3)*255),1),r.length===4&&(e[3]=r[3]),e}function Lle(r){if(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(e,t,i),a=Math.max(e,t,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var c=((a-e)/6+o/2)/o,f=((a-t)/6+o/2)/o,h=((a-i)/6+o/2)/o;e===a?l=h-f:t===a?l=1/3+c-h:i===a&&(l=2/3+f-c),l<0&&(l+=1),l>1&&(l-=1)}var p=[l*360,u,s];return r[3]!=null&&p.push(r[3]),p}}function bb(r,e){var t=cn(r);if(t){for(var i=0;i<3;i++)e<0?t[i]=t[i]*(1-e)|0:t[i]=(255-t[i])*e+t[i]|0,t[i]>255?t[i]=255:t[i]<0&&(t[i]=0);return Jo(t,t.length===4?"rgba":"rgb")}}function wb(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){t=t||[];var i=r*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=e[n],s=e[a],l=i-n;return t[0]=Us(vf(o[0],s[0],l)),t[1]=Us(vf(o[1],s[1],l)),t[2]=Us(vf(o[2],s[2],l)),t[3]=X0(vf(o[3],s[3],l)),t}}function _G(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){var i=r*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=cn(e[n]),s=cn(e[a]),l=i-n,u=Jo([Us(vf(o[0],s[0],l)),Us(vf(o[1],s[1],l)),Us(vf(o[2],s[2],l)),X0(vf(o[3],s[3],l))],"rgba");return t?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function fp(r,e,t,i){var n=cn(r);if(r)return n=Lle(n),e!=null&&(n[0]=Rle(e)),t!=null&&(n[1]=cp(t)),i!=null&&(n[2]=cp(i)),Jo(EL(n),"rgba")}function hp(r,e){var t=cn(r);if(t&&e!=null)return t[3]=X0(e),Jo(t,"rgba")}function Jo(r,e){if(!(!r||!r.length)){var t=r[0]+","+r[1]+","+r[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+r[3]),e+"("+t+")"}}function Nm(r,e){var t=cn(r);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var gG=new yu(100);function Y0(r){if(Ce(r)){var e=gG.get(r);return e||(e=bb(r,-.1),gG.put(r,e)),e}else if(lf(r)){var t=fe({},r);return t.colorStops=de(r.colorStops,function(i){return{offset:i.offset,color:bb(i.color,-.1)}}),t}return r}var Eb=Math.round;function gf(r){var e;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var t=cn(r);t&&(r="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:r,opacity:e??1}}var xG=1e-4;function Cl(r){return r-xG}function Tb(r){return Eb(r*1e3)/1e3}function Ab(r){return Eb(r*1e4)/1e4}function SG(r){return"matrix("+Tb(r[0])+","+Tb(r[1])+","+Tb(r[2])+","+Tb(r[3])+","+Ab(r[4])+","+Ab(r[5])+")"}var MG={left:"start",right:"end",center:"middle",middle:"middle"};function bG(r,e,t){return t==="top"?r+=e/2:t==="bottom"&&(r-=e/2),r}function wG(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function TG(r){var e=r.style,t=r.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function CL(r){return r&&!!r.image}function Ple(r){return r&&!!r.svgElement}function q0(r){return CL(r)||Ple(r)}function Cb(r){return r.type==="linear"}function Rb(r){return r.type==="radial"}function Lb(r){return r&&(r.type==="linear"||r.type==="radial")}function Z0(r){return"url(#"+r+")"}function Pb(r){var e=r.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function Db(r){var e=r.x||0,t=r.y||0,i=(r.rotation||0)*Tm,n=ft(r.scaleX,1),a=ft(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+Eb(o*Tm)+"deg, "+Eb(s*Tm)+"deg)"),l.join(" ")}var EG=function(){return zt.hasGlobalWindow&&He(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}();var LL=Array.prototype.slice;function _u(r,e,t){return(e-r)*t+r}function RL(r,e,t,i){for(var n=e.length,a=0;ai?e:r,a=Math.min(t,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)i.length=o;else for(var l=a;l=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(e,t,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=CG,l=t;if(ci(t)){var u=Ule(t);s=u,(u===1&&!Ct(t[0])||u===2&&!Ct(t[0][0]))&&(o=!0)}else if(Ct(t)&&!uf(t))s=Nb;else if(Ce(t))if(!isNaN(+t))s=Nb;else{var c=cn(t);c&&(l=c,s=K0)}else if(lf(t)){var f=fe({},l);f.colorStops=de(t.colorStops,function(p){return{offset:p.offset,color:cn(p.color)}}),Cb(t)?s=PL:Rb(t)&&(s=DL),l=f}a===0?this.valType=s:(s!==this.valType||s===CG)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:l,rawValue:t,percent:0};return i&&(h.easing=i,h.easingFunc=He(i)?i:db[i]||Dm(i)),n.push(h),h},r.prototype.prepare=function(e,t){var i=this.keyframes;this._needsSort&&i.sort(function(g,m){return g.time-m.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=Ub(n),u=RG(n),c=0;c=0&&!(o[c].percent<=t);c--);c=h(c,s-2)}else{for(c=f;ct);c++);c=h(c-1,s-2)}d=o[c+1],p=o[c]}if(p&&d){this._lastFr=c,this._lastFrP=t;var m=d.percent-p.percent,v=m===0?1:h((t-p.percent)/m,1);d.easingFunc&&(v=d.easingFunc(v));var _=i?this._additiveValue:u?j0:e[l];if((Ub(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)e[l]=v<1?p.rawValue:d.rawValue;else if(Ub(a))a===zb?RL(_,p[n],d[n],v):Dle(_,p[n],d[n],v);else if(RG(a)){var y=p[n],x=d[n],M=a===PL;e[l]={type:M?"linear":"radial",x:_u(y.x,x.x,v),y:_u(y.y,x.y,v),colorStops:de(y.colorStops,function(w,T){var C=x.colorStops[T];return{offset:_u(w.offset,C.offset,v),color:Ob(RL([],w.color,C.color,v))}}),global:x.global},M?(e[l].x2=_u(y.x2,x.x2,v),e[l].y2=_u(y.y2,x.y2,v)):e[l].r=_u(y.r,x.r,v)}else if(u)RL(_,p[n],d[n],v),i||(e[l]=Ob(_));else{var S=_u(p[n],d[n],v);i?this._additiveValue=S:e[l]=S}i&&this._addToTarget(e)}}},r.prototype._addToTarget=function(e){var t=this.valType,i=this.propName,n=this._additiveValue;t===Nb?e[i]=e[i]+n:t===K0?(cn(e[i],j0),Ib(j0,j0,n,1),e[i]=Ob(j0)):t===zb?Ib(e[i],e[i],n,1):t===LG&&AG(e[i],e[i],n,1)},r}(),zle=function(){function r(e,t,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&n){ep("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(e){this._target=e},r.prototype.when=function(e,t,i){return this.whenWithKeys(e,t,bt(t),i)},r.prototype.whenWithKeys=function(e,t,i,n){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,pp(u),n),this._trackKeys.push(s)}l.addKeyframe(e,pp(t[s]),n)}return this._maxTime=Math.max(this._maxTime,e),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,i=0;i0)){this._started=1;for(var t=this,i=[],n=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,e[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}(),J0=zle;function dp(){return new Date().getTime()}var Fle=function(r){Xt(e,r);function e(t){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,t=t||{},i.stage=t.stage||{},i}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var i=t.getClip();i&&this.addClip(i)},e.prototype.removeClip=function(t){if(t.animation){var i=t.prev,n=t.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var i=t.getClip();i&&this.removeClip(i),t.animation=null},e.prototype.update=function(t){for(var i=dp()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function i(){t._running&&(G0(i),!t._paused&&t.update())}G0(i)},e.prototype.start=function(){this._running||(this._time=dp(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=dp(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=dp()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var i=t.next;t.prev=t.next=t.animation=null,t=i}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,i){i=i||{},this.start();var n=new J0(t,i.loop);return this.addAnimator(n),n},e}(Pi),PG=Fle;var Ble=300,IL=zt.domSupported,NL=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=de(r,function(n){var a=n.replace("mouse","pointer");return t.hasOwnProperty(a)?a:n});return{mouse:r,touch:e,pointer:i}}(),DG={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},IG=!1;function zL(r){var e=r.pointerType;return e==="pen"||e==="touch"}function kle(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function UL(r){r&&(r.zrByTouch=!0)}function Vle(r,e){return Ca(r.dom,new Gle(r,e),!0)}function UG(r,e){for(var t=e,i=!1;t&&t.nodeType!==9&&!(i=t.domBelongToZr||t!==e&&t===r.painterRoot);)t=t.parentNode;return i}var Gle=function(){function r(e,t){this.stopPropagation=Dr,this.stopImmediatePropagation=Dr,this.preventDefault=Dr,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return r}(),Os={mousedown:function(r){r=Ca(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=Ca(this.dom,r);var e=this.__mayPointerCapture;e&&(r.zrX!==e[0]||r.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=Ca(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=Ca(this.dom,r);var e=r.toElement||r.relatedTarget;UG(this,e)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){IG=!0,r=Ca(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){IG||(r=Ca(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=Ca(this.dom,r),UL(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),Os.mousemove.call(this,r),Os.mousedown.call(this,r)},touchmove:function(r){r=Ca(this.dom,r),UL(r),this.handler.processGesture(r,"change"),Os.mousemove.call(this,r)},touchend:function(r){r=Ca(this.dom,r),UL(r),this.handler.processGesture(r,"end"),Os.mouseup.call(this,r),+new Date-+this.__lastTouchMomentkG||r<-kG}var gp=[],Um=[],BL=wi(),kL=Math.abs,Yle=function(){function r(){}return r.prototype.getLocalTransform=function(e){return r.getLocalTransform(this,e)},r.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},r.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},r.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},r.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},r.prototype.needLocalTransform=function(){return vp(this.rotation)||vp(this.x)||vp(this.y)||vp(this.scaleX-1)||vp(this.scaleY-1)||vp(this.skewX)||vp(this.skewY)},r.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),i=this.transform;if(!(t||e)){i&&(BG(i),this.invTransform=null);return}i=i||wi(),t?this.getLocalTransform(i):BG(i),e&&(t?La(i,e,i):z0(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(gp);var i=gp[0]<0?-1:1,n=gp[1]<0?-1:1,a=((gp[0]-i)*t+i)/gp[0]||0,o=((gp[1]-n)*t+n)/gp[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||wi(),qo(this.invTransform,e)},r.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},r.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=Math.atan2(e[1],e[0]),a=Math.PI/2+n-Math.atan2(e[3],e[2]);i=Math.sqrt(i)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||wi(),La(Um,e.invTransform,t),t=Um);var i=this.originX,n=this.originY;(i||n)&&(BL[4]=i,BL[5]=n,La(Um,t,BL),Um[4]-=i,Um[5]-=n,t=Um),this.setLocalTransform(t)}},r.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},r.prototype.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&fi(i,i,n),i},r.prototype.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&fi(i,i,n),i},r.prototype.getLineScale=function(){var e=this.transform;return e&&kL(e[0]-1)>1e-10&&kL(e[3]-1)>1e-10?Math.sqrt(kL(e[0]*e[3]-e[2]*e[1])):1},r.prototype.copyTransform=function(e){VL(this,e)},r.getLocalTransform=function(e,t){t=t||[];var i=e.originX||0,n=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,c=e.x,f=e.y,h=e.skewX?Math.tan(e.skewX):0,p=e.skewY?Math.tan(-e.skewY):0;if(i||n||s||l){var d=i+s,g=n+l;t[4]=-d*a-h*g*o,t[5]=-g*o-p*d*a}else t[4]=t[5]=0;return t[0]=a,t[3]=o,t[1]=p*a,t[2]=h*o,u&&Pa(t,t,u),t[4]+=i+c,t[5]+=n+f,t},r.initDefaultProps=function(){var e=r.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),r}(),go=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function VL(r,e){for(var t=0;t=0?parseFloat(r)/100*e:parseFloat(r):r}function _p(r,e,t){var i=e.position||"inside",n=e.distance!=null?e.distance:5,a=t.height,o=t.width,s=a/2,l=t.x,u=t.y,c="left",f="top";if(i instanceof Array)l+=xn(i[0],t.width),u+=xn(i[1],t.height),c=null,f=null;else switch(i){case"left":l-=n,u+=s,c="right",f="middle";break;case"right":l+=n+o,u+=s,f="middle";break;case"top":l+=o/2,u-=n,c="center",f="bottom";break;case"bottom":l+=o/2,u+=a+n,c="center";break;case"inside":l+=o/2,u+=s,c="center",f="middle";break;case"insideLeft":l+=n,u+=s,f="middle";break;case"insideRight":l+=o-n,u+=s,c="right",f="middle";break;case"insideTop":l+=o/2,u+=n,c="center";break;case"insideBottom":l+=o/2,u+=a-n,c="center",f="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,c="right";break;case"insideBottomLeft":l+=n,u+=a-n,f="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,c="right",f="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=c,r.verticalAlign=f,r}var GL="__zr_normal__",HL=go.concat(["ignore"]),qle=gn(go,function(r,e){return r[e]=!0,r},{ignore:!1}),Fm={},Zle=new lt(0,0,0,0),YL=function(){function r(e){this.id=ib(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return r.prototype._init=function(e){this.attr(e)},r.prototype.drift=function(e,t,i){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=t,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=t.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(t),i.position!=null){var c=Zle;i.layoutRect?c.copy(i.layoutRect):c.copy(this.getBoundingRect()),n||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Fm,i,c):_p(Fm,i,c),a.x=Fm.x,a.y=Fm.y,o=Fm.align,s=Fm.verticalAlign;var f=i.origin;if(f&&i.rotation!=null){var h=void 0,p=void 0;f==="center"?(h=c.width*.5,p=c.height*.5):(h=xn(f[0],c.width),p=xn(f[1],c.height)),u=!0,a.originX=-a.x+h+(n?0:c.x),a.originY=-a.y+p+(n?0:c.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],u||(a.originX=-d[0],a.originY=-d[1]));var g=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,_=void 0,y=void 0;g&&this.canBeInsideText()?(v=i.insideFill,_=i.insideStroke,(v==null||v==="auto")&&(v=this.getInsideTextFill()),(_==null||_==="auto")&&(_=this.getInsideTextStroke(v),y=!0)):(v=i.outsideFill,_=i.outsideStroke,(v==null||v==="auto")&&(v=this.getOutsideFill()),(_==null||_==="auto")&&(_=this.getOutsideStroke(v),y=!0)),v=v||"#000",(v!==m.fill||_!==m.stroke||y!==m.autoStroke||o!==m.align||s!==m.verticalAlign)&&(l=!0,m.fill=v,m.stroke=_,m.autoStroke=y,m.align=o,m.verticalAlign=s,t.setDefaultTextStyle(m)),t.__dirty|=zi,l&&t.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(e){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?e_:Q0},r.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),i=typeof t=="string"&&cn(t);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,Jo(i,"rgba")},r.prototype.traverse=function(e,t){},r.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},fe(this.extra,t)):this[e]=t},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(qe(e))for(var i=e,n=bt(i),a=0;a0},r.prototype.getState=function(e){return this.states[e]},r.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},r.prototype.clearStates=function(e){this.useState(GL,!1,e)},r.prototype.useState=function(e,t,i,n){var a=e===GL,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(dt(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){ep("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||n);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!i&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(e,t,i,c),h&&h.useState(e,t,i,c),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~zi),u}}},r.prototype.useStates=function(e,t,i){if(!e.length)this.clearStates();else{var n=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l0,d);var g=this._textContent,m=this._textGuide;g&&g.useStates(e,t,h),m&&m.useStates(e,t,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~zi)}},r.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},r.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var i=this.currentStates.slice();i.splice(t,1),this.useStates(i)}},r.prototype.replaceState=function(e,t,i){var n=this.currentStates.slice(),a=dt(n,e),o=dt(n,t)>=0;a>=0?o?n.splice(a,1):n[a]=t:i&&!o&&n.push(t),this.useStates(n)},r.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},r.prototype._mergeStates=function(e){for(var t={},i,n=0;n=0&&a.splice(o,1)}),this.animators.push(e),i&&i.animation.addAnimator(e),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(e){this.markRedraw()},r.prototype.stopAnimation=function(e,t){for(var i=this.animators,n=i.length,a=[],o=0;o0&&t.during&&a[0].during(function(d,g){t.during(g)});for(var h=0;h0||n.force&&!o.length){var T=void 0,C=void 0,b=void 0;if(s){C={},h&&(T={});for(var x=0;x=0&&(n.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,i){var n=dt(this._children,t);return n>=0&&this.replaceAt(i,n),this},e.prototype.replaceAt=function(t,i){var n=this._children,a=n[i];if(t&&t!==this&&t.parent!==this&&t!==a){n[i]=t,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var i=this.__zr;i&&i!==t.__zr&&t.addSelfToZr(i),i&&i.refresh()},e.prototype.remove=function(t){var i=this.__zr,n=this._children,a=dt(n,t);return a<0?this:(n.splice(a,1),t.parent=null,i&&t.removeSelfFromZr(i),i&&i.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,i=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},r.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},r.prototype.on=function(e,t,i){return this._disposed||this.handler.on(e,t,i),this},r.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},r.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},r.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(r<=n)return o;if(r>=a)return s}else{if(r>=n)return o;if(r<=a)return s}else{if(r===n)return o;if(r===a)return s}return(r-n)/l*u+o}function ze(r,e){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return Ce(r)?iue(r).match(/%$/)?parseFloat(r)/100*e:parseFloat(r):r==null?NaN:+r}function Er(r,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),KG),r=(+r).toFixed(e),t?r:+r}function Ti(r){return r.sort(function(e,t){return e-t}),r}function Sn(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(r*e)/e===r)return t}return jL(r)}function jL(r){var e=r.toString().toLowerCase(),t=e.indexOf("e"),i=t>0?+e.slice(t+1):0,n=t>0?t:e.length,a=e.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function Bm(r,e){var t=Math.log,i=Math.LN10,n=Math.floor(t(r[1]-r[0])/i),a=Math.round(t(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function JG(r,e,t){if(!r[e])return 0;var i=KL(r,t);return i[e]||0}function KL(r,e){var t=gn(r,function(p,d){return p+(isNaN(d)?0:d)},0);if(t===0)return[];for(var i=Math.pow(10,e),n=de(r,function(p){return(isNaN(p)?0:p)/t*i*100}),a=i*100,o=de(n,function(p){return Math.floor(p)}),s=gn(o,function(p,d){return p+d},0),l=de(n,function(p,d){return p-o[d]});su&&(u=l[f],c=f);++o[c],l[c]=0,++s}return de(o,function(p){return p/i})}function $G(r,e){var t=Math.max(Sn(r),Sn(e)),i=r+e;return t>KG?i:Er(i,t)}var t_=9007199254740991;function r_(r){var e=Math.PI*2;return(r%e+e)%e}function xu(r){return r>-jG&&r=10&&e++,e}function Vm(r,e){var t=km(r),i=Math.pow(10,t),n=r/i,a;return e?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,r=a*i,t>=-20?+r.toFixed(t<0?-t:0):r}function Gm(r,e){var t=(r.length-1)*e+1,i=Math.floor(t),n=+r[i-1],a=t-i;return a?n+a*(r[i]-n):n}function i_(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,t=1,i=0;i=0||a&&dt(a,l)<0)){var u=i.getShallow(l,e);u!=null&&(o[r[s][0]]=u)}}return o}}var Mue=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],bue=za(Mue),vH=function(){function r(){}return r.prototype.getAreaStyle=function(e,t){return bue(this,e,t)},r}();var tP=new yu(50);function yH(r){if(typeof r=="string"){var e=tP.get(r);return e&&e.image}else return r}function s_(r,e,t,i,n){if(r)if(typeof r=="string"){if(e&&e.__zrImageSrc===r||!t)return e;var a=tP.get(r),o={hostEl:t,cb:i,cbPayload:n};return a?(e=a.image,!Ym(e)&&a.pending.push(o)):(e=Fn.loadImage(r,gH,gH),e.__zrImageSrc=r,tP.put(r,e.__cachedImgObj={image:e,pending:[o]})),e}else return r;else return e}function gH(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=o;l++)s-=o;var u=La(t,e);return u>s&&(t="",u=0),s=r-u,n.ellipsis=t,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=r,n}function SH(r,e){var t=e.containerWidth,i=e.font,n=e.contentWidth;if(!t)return"";var a=La(r,i);if(a<=t)return r;for(var o=0;;o++){if(a<=n||o>=e.maxIterations){r+=e.ellipsis;break}var s=o===0?wue(r,n,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(r.length*n/a):0;r=r.substr(0,s),a=La(r,i)}return r===""&&(r=e.placeholder),r}function wue(r,e,t,i){for(var n=0,a=0,o=r.length;ap&&u){var d=Math.floor(p/s);f=f.slice(0,d)}if(r&&a&&c!=null)for(var g=xH(c,n,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),m=0;ms&&tP(t,r.substring(s,u),e,o),tP(t,l[2],e,o,l[1]),s=eP.lastIndex}sn){M>0?(_.tokens=_.tokens.slice(0,M),m(_,x,y),t.lines=t.lines.slice(0,v+1)):t.lines=t.lines.slice(0,v);break e}var I=w.width,R=I==null||I==="auto";if(typeof I=="string"&&I.charAt(I.length-1)==="%")S.percentWidth=I,c.push(S),S.contentWidth=La(S.text,b);else{if(R){var A=w.backgroundColor,D=A&&A.image;D&&(D=yH(D),Wm(D)&&(S.width=Math.max(S.width,D.width*E/D.height)))}var U=d&&i!=null?i-x:null;U!=null&&U0&&d+i.accumWidth>i.width&&(c=e.split(` +`)}function xH(r,e,t,i){i=i||{};var n=fe({},i);n.font=e,t=ft(t,"..."),n.maxIterations=ft(i.maxIterations,2);var a=n.minChar=ft(i.minChar,0);n.cnCharWidth=Ia("\u56FD",e);var o=n.ascCharWidth=Ia("a",e);n.placeholder=ft(i.placeholder,"");for(var s=r=Math.max(0,r-1),l=0;l=o;l++)s-=o;var u=Ia(t,e);return u>s&&(t="",u=0),s=r-u,n.ellipsis=t,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=r,n}function SH(r,e){var t=e.containerWidth,i=e.font,n=e.contentWidth;if(!t)return"";var a=Ia(r,i);if(a<=t)return r;for(var o=0;;o++){if(a<=n||o>=e.maxIterations){r+=e.ellipsis;break}var s=o===0?Eue(r,n,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(r.length*n/a):0;r=r.substr(0,s),a=Ia(r,i)}return r===""&&(r=e.placeholder),r}function Eue(r,e,t,i){for(var n=0,a=0,o=r.length;ap&&u){var d=Math.floor(p/s);f=f.slice(0,d)}if(r&&a&&c!=null)for(var g=xH(c,n,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),m=0;ms&&iP(t,r.substring(s,u),e,o),iP(t,l[2],e,o,l[1]),s=rP.lastIndex}sn){M>0?(_.tokens=_.tokens.slice(0,M),m(_,x,y),t.lines=t.lines.slice(0,v+1)):t.lines=t.lines.slice(0,v);break e}var I=w.width,R=I==null||I==="auto";if(typeof I=="string"&&I.charAt(I.length-1)==="%")S.percentWidth=I,c.push(S),S.contentWidth=Ia(S.text,b);else{if(R){var A=w.backgroundColor,D=A&&A.image;D&&(D=yH(D),Ym(D)&&(S.width=Math.max(S.width,D.width*E/D.height)))}var U=d&&i!=null?i-x:null;U!=null&&U0&&d+i.accumWidth>i.width&&(c=e.split(` `),u=!0),i.accumWidth=d}else{var g=wH(e,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,f=g.linesWidths,c=g.lines}}else c=e.split(` -`);for(var m=0;m=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var Cue=gn(",&?/;] ".split(""),function(r,e){return r[e]=!0,r},{});function Rue(r){return Aue(r)?!!Cue[r]:!0}function wH(r,e,t,i,n){for(var a=[],o=[],s="",l="",u=0,c=0,f=0;ft:n+c+p>t){c?(s||l)&&(d?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=h,u+=p,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=h,c=p)):d?(a.push(l),o.push(u),l=h,u=p):(a.push(h),o.push(p));continue}c+=p,d?(l+=h,u+=p):(l&&(s+=l,l="",u=0),s+=h)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=n),{accumWidth:c,lines:a,linesWidths:o}}var nP="__zr_style_"+Math.round(Math.random()*10),Pl={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},xp={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Pl[nP]=!0;var TH=["z","z2","invisible"],Lue=["invisible"],Pue=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype._init=function(t){for(var i=bt(t),n=0;n1e-4){s[0]=r-t,s[1]=e-i,l[0]=r+t,l[1]=e+i;return}if(Xb[0]=oP(n)*t+r,Xb[1]=aP(n)*i+e,Yb[0]=oP(a)*t+r,Yb[1]=aP(a)*i+e,u(s,Xb,Yb),c(l,Xb,Yb),n=n%Sp,n<0&&(n=n+Sp),a=a%Sp,a<0&&(a=a+Sp),n>a&&!o?a+=Sp:nn&&(qb[0]=oP(p)*t+r,qb[1]=aP(p)*i+e,u(s,qb,s),c(l,qb,l))}var Vr={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},bp=[],wp=[],Dl=[],_f=[],Il=[],Nl=[],lP=Math.min,uP=Math.max,Tp=Math.cos,Ep=Math.sin,Mu=Math.abs,hP=Math.PI,xf=hP*2,cP=typeof Float32Array<"u",s_=[];function fP(r){var e=Math.round(r/hP*1e8)/1e8;return e%2*hP}function l_(r,e){var t=fP(r[0]);t<0&&(t+=xf);var i=t-r[0],n=r[1];n+=i,!e&&n-t>=xf?n=t+xf:e&&t-n>=xf?n=t-xf:!e&&t>n?n=t+(xf-fP(t-n)):e&&t0&&(this._ux=Mu(i/pp/e)||0,this._uy=Mu(i/pp/t)||0)},r.prototype.setDPR=function(e){this.dpr=e},r.prototype.setContext=function(e){this._ctx=e},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Vr.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},r.prototype.lineTo=function(e,t){var i=Mu(e-this._xi),n=Mu(t-this._yi),a=i>this._ux||n>this._uy;if(this.addData(Vr.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(e,t,i,n,a,o){return this._drawPendingPt(),this.addData(Vr.C,e,t,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(e,t,i,n,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(e,t,i,n){return this._drawPendingPt(),this.addData(Vr.Q,e,t,i,n),this._ctx&&this._ctx.quadraticCurveTo(e,t,i,n),this._xi=i,this._yi=n,this},r.prototype.arc=function(e,t,i,n,a,o){this._drawPendingPt(),s_[0]=n,s_[1]=a,l_(s_,o),n=s_[0],a=s_[1];var s=a-n;return this.addData(Vr.A,e,t,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(e,t,i,n,a,o),this._xi=Tp(a)*i+e,this._yi=Ep(a)*i+t,this},r.prototype.arcTo=function(e,t,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,i,n,a),this},r.prototype.rect=function(e,t,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,i,n),this.addData(Vr.R,e,t,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(Vr.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&e.closePath(),this._xi=t,this._yi=i,this},r.prototype.fill=function(e){e&&e.fill(),this.toStatic()},r.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&cP&&(this.data=new Float32Array(t));for(var i=0;ic.length&&(this._expandData(),c=this.data);for(var f=0;f0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},r.prototype.getBoundingRect=function(){Dl[0]=Dl[1]=Il[0]=Il[1]=Number.MAX_VALUE,_f[0]=_f[1]=Nl[0]=Nl[1]=-Number.MAX_VALUE;var e=this.data,t=0,i=0,n=0,a=0,o;for(o=0;oi||Mu(y)>n||h===t-1)&&(g=Math.sqrt(_*_+y*y),a=m,o=v);break}case Vr.C:{var x=e[h++],M=e[h++],m=e[h++],v=e[h++],S=e[h++],w=e[h++];g=fG(a,o,x,M,m,v,S,w,10),a=S,o=w;break}case Vr.Q:{var x=e[h++],M=e[h++],m=e[h++],v=e[h++];g=pG(a,o,x,M,m,v,10),a=m,o=v;break}case Vr.A:var T=e[h++],C=e[h++],b=e[h++],E=e[h++],I=e[h++],R=e[h++],A=R+I;h+=1,d&&(s=Tp(I)*b+T,l=Ep(I)*E+C),g=uP(b,E)*lP(xf,Math.abs(R)),a=Tp(A)*b+T,o=Ep(A)*E+C;break;case Vr.R:{s=a=e[h++],l=o=e[h++];var D=e[h++],U=e[h++];g=D*2+U*2;break}case Vr.Z:{var _=s-a,y=l-o;g=Math.sqrt(_*_+y*y),a=s,o=l;break}}g>=0&&(u[f++]=g,c+=g)}return this._pathLen=c,c},r.prototype.rebuildPath=function(e,t){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,c,f,h,p=t<1,d,g,m=0,v=0,_,y=0,x,M;if(!(p&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,g=this._pathLen,_=t*g,!_)))e:for(var S=0;S0&&(e.lineTo(x,M),y=0),w){case Vr.M:s=u=i[S++],l=c=i[S++],e.moveTo(u,c);break;case Vr.L:{f=i[S++],h=i[S++];var C=Mu(f-u),b=Mu(h-c);if(C>n||b>a){if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;e.lineTo(u*(1-I)+f*I,c*(1-I)+h*I);break e}m+=E}e.lineTo(f,h),u=f,c=h,y=0}else{var R=C*C+b*b;R>y&&(x=f,M=h,y=R)}break}case Vr.C:{var A=i[S++],D=i[S++],U=i[S++],B=i[S++],F=i[S++],k=i[S++];if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;Zo(u,A,U,F,I,bp),Zo(c,D,B,k,I,wp),e.bezierCurveTo(bp[1],wp[1],bp[2],wp[2],bp[3],wp[3]);break e}m+=E}e.bezierCurveTo(A,D,U,B,F,k),u=F,c=k;break}case Vr.Q:{var A=i[S++],D=i[S++],U=i[S++],B=i[S++];if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;pf(u,A,U,I,bp),pf(c,D,B,I,wp),e.quadraticCurveTo(bp[1],wp[1],bp[2],wp[2]);break e}m+=E}e.quadraticCurveTo(A,D,U,B),u=U,c=B;break}case Vr.A:var G=i[S++],Y=i[S++],J=i[S++],Q=i[S++],V=i[S++],K=i[S++],ae=i[S++],ve=!i[S++],ue=J>Q?J:Q,se=Mu(J-Q)>.001,Ee=V+K,q=!1;if(p){var E=d[v++];m+E>_&&(Ee=V+K*(_-m)/E,q=!0),m+=E}if(se&&e.ellipse?e.ellipse(G,Y,J,Q,ae,V,Ee,ve):e.arc(G,Y,ue,V,Ee,ve),q)break e;T&&(s=Tp(V)*J+G,l=Ep(V)*Q+Y),u=Tp(Ee)*J+G,c=Ep(Ee)*Q+Y;break;case Vr.R:s=u=i[S],l=c=i[S+1],f=i[S++],h=i[S++];var H=i[S++],We=i[S++];if(p){var E=d[v++];if(m+E>_){var _e=_-m;e.moveTo(f,h),e.lineTo(f+lP(_e,H),h),_e-=H,_e>0&&e.lineTo(f+H,h+lP(_e,We)),_e-=We,_e>0&&e.lineTo(f+uP(H-_e,0),h+We),_e-=H,_e>0&&e.lineTo(f,h+uP(We-_e,0));break e}m+=E}e.rect(f,h,H,We);break;case Vr.Z:if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;e.lineTo(u*(1-I)+s*I,c*(1-I)+l*I);break e}m+=E}e.closePath(),u=s,c=l}}},r.prototype.clone=function(){var e=new r,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},r.CMD=Vr,r.initDefaultProps=function(){var e=r.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),r}(),Ki=Iue;function Ul(r,e,t,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=r;if(o>e+s&&o>i+s||or+s&&a>t+s||ae+f&&c>i+f&&c>a+f&&c>s+f||cr+f&&u>t+f&&u>n+f&&u>o+f||ue+u&&l>i+u&&l>a+u||lr+u&&s>t+u&&s>n+u||st||c+un&&(n+=u_);var h=Math.atan2(l,s);return h<0&&(h+=u_),h>=i&&h<=n||h+u_>=i&&h+u_<=n}function $o(r,e,t,i,n,a){if(a>e&&a>i||an?s:0}var Sf=Ki.CMD,Ap=Math.PI*2,Oue=1e-4;function Fue(r,e){return Math.abs(r-e)e&&u>i&&u>a&&u>s||u1&&zue(),p=hi(e,i,a,s,Qo[0]),h>1&&(d=hi(e,i,a,s,Qo[1]))),h===2?me&&s>i&&s>a||s=0&&u<=1){for(var c=0,f=vi(e,i,a,u),h=0;ht||s<-t)return 0;var l=Math.sqrt(t*t-s*s);aa[0]=-l,aa[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=Ap-1e-4){i=0,n=Ap;var c=a?1:-1;return o>=aa[0]+r&&o<=aa[1]+r?c:0}if(i>n){var f=i;i=n,n=f}i<0&&(i+=Ap,n+=Ap);for(var h=0,p=0;p<2;p++){var d=aa[p];if(d+r>o){var g=Math.atan2(s,d),c=a?1:-1;g<0&&(g=Ap+g),(g>=i&&g<=n||g+Ap>=i&&g+Ap<=n)&&(g>Math.PI/2&&g1&&(t||(s+=$o(l,u,c,f,i,n))),m&&(l=a[d],u=a[d+1],c=l,f=u),g){case Sf.M:c=a[d++],f=a[d++],l=c,u=f;break;case Sf.L:if(t){if(Ul(l,u,a[d],a[d+1],e,i,n))return!0}else s+=$o(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Sf.C:if(t){if(IH(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=Bue(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Sf.Q:if(t){if(Zb(l,u,a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=kue(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Sf.A:var v=a[d++],_=a[d++],y=a[d++],x=a[d++],M=a[d++],S=a[d++];d+=1;var w=!!(1-a[d++]);h=Math.cos(M)*y+v,p=Math.sin(M)*x+_,m?(c=h,f=p):s+=$o(l,u,h,p,i,n);var T=(i-v)*x/y+v;if(t){if(OH(v,_,x,M,M+S,w,e,T,n))return!0}else s+=Vue(v,_,x,M,M+S,w,T,n);l=Math.cos(M+S)*y+v,u=Math.sin(M+S)*x+_;break;case Sf.R:c=l=a[d++],f=u=a[d++];var C=a[d++],b=a[d++];if(h=c+C,p=f+b,t){if(Ul(c,f,h,f,e,i,n)||Ul(h,f,h,p,e,i,n)||Ul(h,p,c,p,e,i,n)||Ul(c,p,c,f,e,i,n))return!0}else s+=$o(h,f,h,p,i,n),s+=$o(c,p,c,f,i,n);break;case Sf.Z:if(t){if(Ul(l,u,c,f,e,i,n))return!0}else s+=$o(l,u,c,f,i,n);l=c,u=f;break}}return!t&&!Fue(u,f)&&(s+=$o(l,u,c,f,i,n)||0),s!==0}function zH(r,e,t){return FH(r,0,!1,e,t)}function BH(r,e,t,i){return FH(r,e,!0,t,i)}var Xm=Ye({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Pl),Hue={style:Ye({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},xp.style)},pP=go.concat(["invisible","culling","z","z2","zlevel","parent"]),Wue=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.update=function(){var t=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new e;n.buildPath===e.prototype.buildPath&&(n.buildPath=function(l){t.buildPath(l,t.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?$0:i>.2?zG:Q0}else if(t)return Q0}return $0},e.prototype.getInsideTextStroke=function(t){var i=this.style.fill;if(Ce(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Dm(t,0)0))},e.prototype.hasFill=function(){var t=this.style,i=t.fill;return i!=null&&i!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,i=this.style,n=!t;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&cf)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){s.copy(t);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect(),o=this.style;if(t=n[0],i=n[1],a.contain(t,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),BH(s,l/u,t,i)))return!0}if(this.hasFill())return zH(s,t,i)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=cf,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,i){t==="shape"?this.setShape(i):r.prototype.attrKV.call(this,t,i)},e.prototype.setShape=function(t,i){var n=this.shape;return n||(n=this.shape={}),typeof t=="string"?n[t]=i:fe(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&cf)},e.prototype.createStyle=function(t){return lf(Xm,t)},e.prototype._innerSaveToNormal=function(t){r.prototype._innerSaveToNormal.call(this,t);var i=this._normalState;t.shape&&!i.shape&&(i.shape=fe({},this.shape))},e.prototype._applyStateObj=function(t,i,n,a,o,s){r.prototype._applyStateObj.call(this,t,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=fe({},n.shape),fe(u,i.shape)):(u=fe({},a?this.shape:n.shape),fe(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=fe({},this.shape);for(var c={},f=bt(u),h=0;h0},e.prototype.hasFill=function(){var t=this.style,i=t.fill;return i!=null&&i!=="none"},e.prototype.createStyle=function(t){return lf(Xue,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var i=t.text;i!=null?i+="":i="";var n=Ll(i,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var a=t.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(gi);kH.prototype.type="tspan";var bu=kH;var Yue=Ye({x:0,y:0},Pl),que={style:Ye({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},xp.style)};function Zue(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var VH=function(r){Xt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return lf(Yue,t)},e.prototype._getSize=function(t){var i=this.style,n=i[t];if(n!=null)return n;var a=Zue(i.image)?i.image:this.__image;if(!a)return 0;var o=t==="width"?"height":"width",s=i[o];return s==null?a[t]:a[t]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return que},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new lt(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(gi);VH.prototype.type="image";var Ur=VH;function GH(r,e){var t=e.x,i=e.y,n=e.width,a=e.height,o=e.r,s,l,u,c;n<0&&(t=t+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=c=o:o instanceof Array?o.length===1?s=l=u=c=o[0]:o.length===2?(s=u=o[0],l=c=o[1]):o.length===3?(s=o[0],l=c=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],c=o[3]):s=l=u=c=0;var f;s+l>n&&(f=s+l,s*=n/f,l*=n/f),u+c>n&&(f=u+c,u*=n/f,c*=n/f),l+u>a&&(f=l+u,l*=a/f,u*=a/f),s+c>a&&(f=s+c,s*=a/f,c*=a/f),r.moveTo(t+s,i),r.lineTo(t+n-l,i),l!==0&&r.arc(t+n-l,i+l,l,-Math.PI/2,0),r.lineTo(t+n,i+a-u),u!==0&&r.arc(t+n-u,i+a-u,u,0,Math.PI/2),r.lineTo(t+c,i+a),c!==0&&r.arc(t+c,i+a-c,c,Math.PI/2,Math.PI),r.lineTo(t,i+s),s!==0&&r.arc(t+s,i+s,s,Math.PI,Math.PI*1.5)}var Ym=Math.round;function jb(r,e,t){if(e){var i=e.x1,n=e.x2,a=e.y1,o=e.y2;r.x1=i,r.x2=n,r.y1=a,r.y2=o;var s=t&&t.lineWidth;return s&&(Ym(i*2)===Ym(n*2)&&(r.x1=r.x2=Mf(i,s,!0)),Ym(a*2)===Ym(o*2)&&(r.y1=r.y2=Mf(a,s,!0))),r}}function Kb(r,e,t){if(e){var i=e.x,n=e.y,a=e.width,o=e.height;r.x=i,r.y=n,r.width=a,r.height=o;var s=t&&t.lineWidth;return s&&(r.x=Mf(i,s,!0),r.y=Mf(n,s,!0),r.width=Math.max(Mf(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(Mf(n+o,s,!1)-r.y,o===0?0:1)),r}}function Mf(r,e,t){if(!e)return r;var i=Ym(r*2);return(i+Ym(e))%2===0?i/2:(i+(t?1:-1))/2}var Jue=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}();var $ue={},HH=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Jue},e.prototype.buildPath=function(t,i){var n,a,o,s;if(this.subPixelOptimize){var l=Kb($ue,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?GH(t,i):t.rect(n,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(ut);HH.prototype.type="rect";var Tt=HH;var WH={fill:"#000"},XH=2,Que={style:Ye({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},xp.style)},QH=function(r){Xt(e,r);function e(t){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=WH,i.attr(t),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,I=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),R=o.calculatedLineHeight,A=0;A=0&&(A=S[R],A.align==="right");)this._placeToken(A,t,T,v,I,"right",y),C-=A.width,I-=A.width,R--;for(E+=(a-(E-m)-(_-I)-C)/2;b<=R;)A=S[b],this._placeToken(A,t,T,v,E+A.width/2,"center",y),E+=A.width,b++;v+=T}},e.prototype._placeToken=function(t,i,n,a,o,s,l){var u=i.rich[t.styleName]||{};u.text=t.text;var c=t.verticalAlign,f=a+n/2;c==="top"?f=a+t.height/2:c==="bottom"&&(f=a+n-t.height/2);var h=!t.isLineHolder&&dP(u);h&&this._renderBackground(u,i,s==="right"?o-t.width:s==="center"?o-t.width/2:o,f-t.height/2,t.width,t.height);var p=!!u.backgroundColor,d=t.textPadding;d&&(o=JH(o,s,d),f-=t.height/2-d[0]-t.innerHeight/2);var g=this._getOrCreateChild(bu),m=g.createStyle();g.useStyle(m);var v=this._defaultStyle,_=!1,y=0,x=KH("fill"in u?u.fill:"fill"in i?i.fill:(_=!0,v.fill)),M=jH("stroke"in u?u.stroke:"stroke"in i?i.stroke:!p&&!l&&(!v.autoStroke||_)?(y=XH,v.stroke):null),S=u.textShadowBlur>0||i.textShadowBlur>0;m.text=t.text,m.x=o,m.y=f,S&&(m.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,m.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",m.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,m.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),m.textAlign=s,m.textBaseline="middle",m.font=t.font||ho,m.opacity=Xi(u.opacity,i.opacity,1),qH(m,u),M&&(m.lineWidth=Xi(u.lineWidth,i.lineWidth,y),m.lineDash=ft(u.lineDash,i.lineDash),m.lineDashOffset=i.lineDashOffset||0,m.stroke=M),x&&(m.fill=x);var w=t.contentWidth,T=t.contentHeight;g.setBoundingRect(new lt(Nm(m.x,w,m.textAlign),vp(m.y,T,m.textBaseline),w,T))},e.prototype._renderBackground=function(t,i,n,a,o,s){var l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,f=l&&l.image,h=l&&!f,p=t.borderRadius,d=this,g,m;if(h||t.lineHeight||u&&c){g=this._getOrCreateChild(Tt),g.useStyle(g.createStyle()),g.style.fill=null;var v=g.shape;v.x=n,v.y=a,v.width=o,v.height=s,v.r=p,g.dirtyShape()}if(h){var _=g.style;_.fill=l||null,_.fillOpacity=ft(t.fillOpacity,1)}else if(f){m=this._getOrCreateChild(Ur),m.onload=function(){d.dirtyStyle()};var y=m.style;y.image=l.image,y.x=n,y.y=a,y.width=o,y.height=s}if(u&&c){var _=g.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=ft(t.strokeOpacity,1),_.lineDash=t.borderDash,_.lineDashOffset=t.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var x=(g||m).style;x.shadowBlur=t.shadowBlur||0,x.shadowColor=t.shadowColor||"transparent",x.shadowOffsetX=t.shadowOffsetX||0,x.shadowOffsetY=t.shadowOffsetY||0,x.opacity=Xi(t.opacity,i.opacity,1)},e.makeFont=function(t){var i="";return vP(t)&&(i=[t.fontStyle,t.fontWeight,mP(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),i&&Yi(i)||t.textFont||t.font},e}(gi),ece={left:!0,right:1,center:1},tce={top:1,bottom:1,middle:1},YH=["fontStyle","fontWeight","fontSize","fontFamily"];function mP(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?$M+"px":r+"px"}function qH(r,e){for(var t=0;t=0,a=!1;if(r instanceof ut){var o=o4(r),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(qm(s)||qm(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=fe({},i),u=fe({},u),u.fill=s):!qm(u.fill)&&qm(s)?(a=!0,i=fe({},i),u=fe({},u),u.fill=X0(s)):!qm(u.stroke)&&qm(l)&&(a||(i=fe({},i),u=fe({},u)),u.stroke=X0(l)),i.style=u}}if(i&&i.z2==null){a||(i=fe({},i));var c=r.z2EmphasisLift;i.z2=r.z2+(c??wu)}return i}function lce(r,e,t){if(t&&t.z2==null){t=fe({},t);var i=r.z2SelectLift;t.z2=r.z2+(i??ice)}return t}function uce(r,e,t){var i=dt(r.currentStates,e)>=0,n=r.style.opacity,a=i?null:oce(r,["opacity"],e,{opacity:1});t=t||{};var o=t.style||{};return o.opacity==null&&(t=fe({},t),o=fe({opacity:i?n:a.opacity*.1},o),t.style=o),t}function gP(r,e){var t=this.states[r];if(this.style){if(r==="emphasis")return sce(this,r,e,t);if(r==="blur")return uce(this,r,t);if(r==="select")return lce(this,r,t)}return t}function Fs(r){r.stateProxy=gP;var e=r.getTextContent(),t=r.getTextGuideLine();e&&(e.stateProxy=gP),t&&(t.stateProxy=gP)}function i4(r,e){!c4(r,e)&&!r.__highByOuter&&Tu(r,s4)}function n4(r,e){!c4(r,e)&&!r.__highByOuter&&Tu(r,l4)}function Bn(r,e){r.__highByOuter|=1<<(e||0),Tu(r,s4)}function kn(r,e){!(r.__highByOuter&=~(1<<(e||0)))&&Tu(r,l4)}function Qb(r){Tu(r,SP)}function d_(r){Tu(r,u4)}function MP(r){Tu(r,nce)}function bP(r){Tu(r,ace)}function c4(r,e){return r.__highDownSilentOnTouch&&e.zrByTouch}function wP(r){var e=r.getModel(),t=[],i=[];e.eachComponent(function(n,a){var o=_P(a),s=n==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){u4(u)}),s&&t.push(a)),o.isBlured=!1}),N(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(t,!1,e)})}function yP(r,e,t,i){var n=i.getModel();t=t||"coordinateSystem";function a(u,c){for(var f=0;f0){var l={dataIndex:s,seriesIndex:t.seriesIndex};o!=null&&(l.dataType=o),e.push(l)}})}),e}function Ol(r,e,t){Eu(r,!0),Tu(r,Fs),tw(r,e,t)}function cce(r){Eu(r,!1)}function nr(r,e,t,i){i?cce(r):Ol(r,e,t)}function tw(r,e,t){var i=rt(r);e!=null?(i.focus=e,i.blurScope=t):i.focus&&(i.focus=null)}var a4=["emphasis","blur","select"],fce={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Gr(r,e,t,i){t=t||"itemStyle";for(var n=0;n__,BezierCurve:()=>Dp,BoundingRect:()=>lt,Circle:()=>oa,CompoundPath:()=>Qm,Ellipse:()=>v_,Group:()=>Ze,Image:()=>Ur,IncrementalDisplayable:()=>G4,Line:()=>Kr,LinearGradient:()=>zl,OrientedBoundingRect:()=>ev,Path:()=>ut,Point:()=>Nt,Polygon:()=>ei,Polyline:()=>$r,RadialGradient:()=>cw,Rect:()=>Tt,Ring:()=>Pp,Sector:()=>yi,Text:()=>Lt,applyTransform:()=>wn,clipPointsByRect:()=>UP,clipRectByRect:()=>Wce,createIcon:()=>Pu,extendPath:()=>Vce,extendShape:()=>Bce,getShapeClass:()=>x_,getTransform:()=>ks,groupTransition:()=>Lu,initProps:()=>ar,isElementRemoved:()=>Au,lineLineIntersect:()=>K4,linePolygonIntersect:()=>rv,makeImage:()=>NP,makePath:()=>tv,mergePath:()=>Gn,registerShape:()=>Bs,removeElement:()=>es,removeElementWithFadeOut:()=>Cu,resizePath:()=>j4,setTooltipConfig:()=>Vs,subPixelOptimize:()=>S_,subPixelOptimizeLine:()=>Ru,subPixelOptimizeRect:()=>Gce,transformDirection:()=>Up,traverseElements:()=>sa,updateProps:()=>Dt});var Km=Ki.CMD,hce=[[],[],[]],_4=Math.sqrt,pce=Math.atan2;function iw(r,e){if(e){var t=r.data,i=r.len(),n,a,o,s,l,u,c=Km.M,f=Km.C,h=Km.L,p=Km.R,d=Km.A,g=Km.Q;for(o=0,s=0;o1&&(o*=AP(d),s*=AP(d));var g=(n===a?-1:1)*AP((o*o*(s*s)-o*o*(p*p)-s*s*(h*h))/(o*o*(p*p)+s*s*(h*h)))||0,m=g*o*p/s,v=g*-s*h/o,_=(r+t)/2+aw(f)*m-nw(f)*v,y=(e+i)/2+nw(f)*m+aw(f)*v,x=S4([1,0],[(h-m)/o,(p-v)/s]),M=[(h-m)/o,(p-v)/s],S=[(-1*h-m)/o,(-1*p-v)/s],w=S4(M,S);if(CP(M,S)<=-1&&(w=m_),CP(M,S)>=1&&(w=0),w<0){var T=Math.round(w/m_*1e6)/1e6;w=m_*2+T%2*m_}c.addData(u,_,y,o,s,x,w,f,a)}var dce=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,mce=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function vce(r){var e=new Ki;if(!r)return e;var t=0,i=0,n=t,a=i,o,s=Ki.CMD,l=r.match(dce);if(!l)return e;for(var u=0;uA*A+D*D&&(T=b,C=E),{cx:T,cy:C,x0:-c,y0:-f,x1:T*(n/M-1),y1:C*(n/M-1)}}function Mce(r){var e;if(pe(r)){var t=r.length;if(!t)return r;t===1?e=[r[0],r[0],0,0]:t===2?e=[r[0],r[0],r[1],r[1]]:t===3?e=r.concat(r[2]):e=r}else e=[r,r,r,r];return e}function D4(r,e){var t,i=g_(e.r,0),n=g_(e.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var c=e.cx,f=e.cy,h=!!e.clockwise,p=L4(u-l),d=p>RP&&p%RP;if(d>zs&&(p=d),!(i>zs))r.moveTo(c,f);else if(p>RP-zs)r.moveTo(c+i*$m(l),f+i*Lp(l)),r.arc(c,f,i,l,u,!h),n>zs&&(r.moveTo(c+n*$m(u),f+n*Lp(u)),r.arc(c,f,n,u,l,h));else{var g=void 0,m=void 0,v=void 0,_=void 0,y=void 0,x=void 0,M=void 0,S=void 0,w=void 0,T=void 0,C=void 0,b=void 0,E=void 0,I=void 0,R=void 0,A=void 0,D=i*$m(l),U=i*Lp(l),B=n*$m(u),F=n*Lp(u),k=p>zs;if(k){var G=e.cornerRadius;G&&(t=Mce(G),g=t[0],m=t[1],v=t[2],_=t[3]);var Y=L4(i-n)/2;if(y=Fl(Y,v),x=Fl(Y,_),M=Fl(Y,g),S=Fl(Y,m),C=w=g_(y,x),b=T=g_(M,S),(w>zs||T>zs)&&(E=i*$m(u),I=i*Lp(u),R=n*$m(l),A=n*Lp(l),pzs){var se=Fl(v,C),Ee=Fl(_,C),q=sw(R,A,D,U,i,se,h),H=sw(E,I,B,F,i,Ee,h);r.moveTo(c+q.cx+q.x0,f+q.cy+q.y0),C0&&r.arc(c+q.cx,f+q.cy,se,Vn(q.y0,q.x0),Vn(q.y1,q.x1),!h),r.arc(c,f,i,Vn(q.cy+q.y1,q.cx+q.x1),Vn(H.cy+H.y1,H.cx+H.x1),!h),Ee>0&&r.arc(c+H.cx,f+H.cy,Ee,Vn(H.y1,H.x1),Vn(H.y0,H.x0),!h))}else r.moveTo(c+D,f+U),r.arc(c,f,i,l,u,!h);if(!(n>zs)||!k)r.lineTo(c+B,f+F);else if(b>zs){var se=Fl(g,b),Ee=Fl(m,b),q=sw(B,F,E,I,n,-Ee,h),H=sw(D,U,R,A,n,-se,h);r.lineTo(c+q.cx+q.x0,f+q.cy+q.y0),b0&&r.arc(c+q.cx,f+q.cy,Ee,Vn(q.y0,q.x0),Vn(q.y1,q.x1),!h),r.arc(c,f,n,Vn(q.cy+q.y1,q.cx+q.x1),Vn(H.cy+H.y1,H.cx+H.x1),h),se>0&&r.arc(c+H.cx,f+H.cy,se,Vn(H.y1,H.x1),Vn(H.y0,H.x0),!h))}else r.lineTo(c+B,f+F),r.arc(c,f,n,u,l,h)}r.closePath()}}}var wce=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}();var I4=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new wce},e.prototype.buildPath=function(t,i){D4(t,i)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(ut);I4.prototype.type="sector";var yi=I4;var Tce=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}();var N4=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Tce},e.prototype.buildPath=function(t,i){var n=i.cx,a=i.cy,o=Math.PI*2;t.moveTo(n+i.r,a),t.arc(n,a,i.r,0,o,!1),t.moveTo(n+i.r0,a),t.arc(n,a,i.r0,0,o,!0)},e}(ut);N4.prototype.type="ring";var Pp=N4;function LP(r,e,t,i){var n=[],a=[],o=[],s=[],l,u,c,f;if(i){c=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,p=r.length;h=2){if(i){var a=LP(n,i,t,e.smoothConstraint);r.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(t?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=n[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{r.moveTo(n[0][0],n[0][1]);for(var s=1,f=n.length;sNp[1]){if(s=!1,a)return s;var c=Math.abs(Np[0]-Ip[1]),f=Math.abs(Ip[0]-Np[1]);Math.min(c,f)>n.len()&&(c0){var f=c.duration,h=c.delay,p=c.easing,d={duration:f,delay:h||0,easing:p,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?e.animateFrom(t,d):e.animateTo(t,d)}else e.stopAnimation(),!s&&e.attr(t),o&&o(1),a&&a()}function Dt(r,e,t,i,n,a){PP("update",r,e,t,i,n,a)}function ar(r,e,t,i,n,a){PP("enter",r,e,t,i,n,a)}function Au(r){if(!r.__zr)return!0;for(var e=0;eMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Y4(r){return!r.isGroup}function Hce(r){return r.shape!=null}function Lu(r,e,t){if(!r||!e)return;function i(o){var s={};return o.traverse(function(l){Y4(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return Hce(o)&&(s.shape=fe({},o.shape)),s}var a=i(r);e.traverse(function(o){if(Y4(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Dt(o,l,t,rt(o).dataIndex)}}})}function UP(r,e){return de(r,function(t){var i=t[0];i=pw(i,e.x),i=dw(i,e.x+e.width);var n=t[1];return n=pw(n,e.y),n=dw(n,e.y+e.height),[i,n]})}function Wce(r,e){var t=pw(r.x,e.x),i=dw(r.x+r.width,e.x+e.width),n=pw(r.y,e.y),a=dw(r.y+r.height,e.y+e.height);if(i>=t&&a>=n)return{x:t,y:n,width:i-t,height:a-n}}function Pu(r,e,t){var i=fe({rectHover:!0},e),n=i.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(n.image=r.slice(8),Ye(n,t),new Ur(i)):tv(r.replace("path://",""),i,t,"center")}function rv(r,e,t,i,n){for(var a=0,o=n[n.length-1];a1)return!1;var m=DP(p,d,c,f)/h;return!(m<0||m>1)}function DP(r,e,t,i){return r*i-t*e}function Xce(r){return r<=1e-6&&r>=-1e-6}function Vs(r){var e=r.itemTooltipOption,t=r.componentModel,i=r.itemName,n=Ce(e)?{formatter:e}:e,a=t.mainType,o=t.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&N(bt(l),function(c){tt(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=rt(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:Ye({content:i,formatterParams:s},n)}}function q4(r,e){var t;r.isGroup&&(t=e(r)),t||r.traverse(e)}function sa(r,e){if(r)if(pe(r))for(var t=0;t=0&&s.push(l)}),s}}function Hn(r,e){return _t(_t({},r,!0),e,!0)}var s5={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}};var l5={time:{month:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],dayOfWeekAbbr:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53CD\u9009"}},toolbox:{brush:{title:{rect:"\u77E9\u5F62\u9009\u62E9",polygon:"\u5708\u9009",lineX:"\u6A2A\u5411\u9009\u62E9",lineY:"\u7EB5\u5411\u9009\u62E9",keep:"\u4FDD\u6301\u9009\u62E9",clear:"\u6E05\u9664\u9009\u62E9"}},dataView:{title:"\u6570\u636E\u89C6\u56FE",lang:["\u6570\u636E\u89C6\u56FE","\u5173\u95ED","\u5237\u65B0"]},dataZoom:{title:{zoom:"\u533A\u57DF\u7F29\u653E",back:"\u533A\u57DF\u7F29\u653E\u8FD8\u539F"}},magicType:{title:{line:"\u5207\u6362\u4E3A\u6298\u7EBF\u56FE",bar:"\u5207\u6362\u4E3A\u67F1\u72B6\u56FE",stack:"\u5207\u6362\u4E3A\u5806\u53E0",tiled:"\u5207\u6362\u4E3A\u5E73\u94FA"}},restore:{title:"\u8FD8\u539F"},saveAsImage:{title:"\u4FDD\u5B58\u4E3A\u56FE\u7247",lang:["\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247"]}},series:{typeNames:{pie:"\u997C\u56FE",bar:"\u67F1\u72B6\u56FE",line:"\u6298\u7EBF\u56FE",scatter:"\u6563\u70B9\u56FE",effectScatter:"\u6D9F\u6F2A\u6563\u70B9\u56FE",radar:"\u96F7\u8FBE\u56FE",tree:"\u6811\u56FE",treemap:"\u77E9\u5F62\u6811\u56FE",boxplot:"\u7BB1\u578B\u56FE",candlestick:"K\u7EBF\u56FE",k:"K\u7EBF\u56FE",heatmap:"\u70ED\u529B\u56FE",map:"\u5730\u56FE",parallel:"\u5E73\u884C\u5750\u6807\u56FE",lines:"\u7EBF\u56FE",graph:"\u5173\u7CFB\u56FE",sankey:"\u6851\u57FA\u56FE",funnel:"\u6F0F\u6597\u56FE",gauge:"\u4EEA\u8868\u76D8\u56FE",pictorialBar:"\u8C61\u5F62\u67F1\u56FE",themeRiver:"\u4E3B\u9898\u6CB3\u6D41\u56FE",sunburst:"\u65ED\u65E5\u56FE",custom:"\u81EA\u5B9A\u4E49\u56FE\u8868",chart:"\u56FE\u8868"}},aria:{general:{withTitle:"\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002",withoutTitle:"\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C"},series:{single:{prefix:"",withName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002",withoutName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002"},multiple:{prefix:"\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002",withName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C",withoutName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C",separator:{middle:"\uFF1B",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636E\u662F\u2014\u2014",partialData:"\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014",withName:"{name}\u7684\u6570\u636E\u662F{value}",withoutName:"{value}",separator:{middle:"\uFF0C",end:""}}}};var _w="ZH",GP="EN",nv=GP,yw={},HP={},xw=Ft.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||nv).toUpperCase();return r.indexOf(_w)>-1?_w:nv}():nv;function u5(r,e){r=r.toUpperCase(),HP[r]=new Zt(e),yw[r]=e}function c5(r){if(Ce(r)){var e=yw[r.toUpperCase()]||{};return r===_w||r===GP?Qe(e):_t(Qe(e),Qe(yw[nv]),!1)}else return _t(Qe(r),Qe(yw[nv]),!1)}function b_(r){return HP[r]}function f5(){return HP[nv]}u5(GP,s5);u5(_w,l5);var Mw=1e3,bw=Mw*60,ov=bw*60,_o=ov*24,XP=_o*365,w_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Sw="{yyyy}-{MM}-{dd}",YP={year:"{yyyy}",month:"{yyyy}-{MM}",day:Sw,hour:Sw+" "+w_.hour,minute:Sw+" "+w_.minute,second:Sw+" "+w_.second,millisecond:w_.none},WP=["year","month","day","hour","minute","second","millisecond"],qP=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Iu(r,e){return r+="","0000".substr(0,e-r.length)+r}function zp(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function h5(r){return r===zp(r)}function p5(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Bp(r,e,t,i){var n=Mn(r),a=n[ww(t)](),o=n[Fp(t)]()+1,s=Math.floor((o-1)/3)+1,l=n[T_(t)](),u=n["get"+(t?"UTC":"")+"Day"](),c=n[av(t)](),f=(c-1)%12+1,h=n[E_(t)](),p=n[A_(t)](),d=n[C_(t)](),g=i instanceof Zt?i:b_(i||xw)||f5(),m=g.getModel("time"),v=m.get("month"),_=m.get("monthAbbr"),y=m.get("dayOfWeek"),x=m.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Iu(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,_[o-1]).replace(/{MM}/g,Iu(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Iu(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Iu(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Iu(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,Iu(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,Iu(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Iu(d,3)).replace(/{S}/g,d+"")}function d5(r,e,t,i,n){var a=null;if(Ce(t))a=t;else if(He(t))a=t(r.value,e,{level:r.level});else{var o=fe({},w_);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(pe(a)){var f=r.level==null?0:r.level>=0?r.level:a.length+r.level;f=Math.min(f,a.length-1),a=a[f]}}return Bp(new Date(r.value),a,n,i)}function m5(r,e){var t=Mn(r),i=t[Fp(e)]()+1,n=t[T_(e)](),a=t[av(e)](),o=t[E_(e)](),s=t[A_(e)](),l=t[C_(e)](),u=l===0,c=u&&s===0,f=c&&o===0,h=f&&a===0,p=h&&n===1,d=p&&i===1;return d?"year":p?"month":h?"day":f?"hour":c?"minute":u?"second":"millisecond"}function ZP(r,e,t){var i=At(r)?Mn(r):r;switch(e=e||m5(r,t),e){case"year":return i[ww(t)]();case"half-year":return i[Fp(t)]()>=6?1:0;case"quarter":return Math.floor((i[Fp(t)]()+1)/4);case"month":return i[Fp(t)]();case"day":return i[T_(t)]();case"half-day":return i[av(t)]()/24;case"hour":return i[av(t)]();case"minute":return i[E_(t)]();case"second":return i[A_(t)]();case"millisecond":return i[C_(t)]()}}function ww(r){return r?"getUTCFullYear":"getFullYear"}function Fp(r){return r?"getUTCMonth":"getMonth"}function T_(r){return r?"getUTCDate":"getDate"}function av(r){return r?"getUTCHours":"getHours"}function E_(r){return r?"getUTCMinutes":"getMinutes"}function A_(r){return r?"getUTCSeconds":"getSeconds"}function C_(r){return r?"getUTCMilliseconds":"getMilliseconds"}function v5(r){return r?"setUTCFullYear":"setFullYear"}function jP(r){return r?"setUTCMonth":"setMonth"}function KP(r){return r?"setUTCDate":"setDate"}function JP(r){return r?"setUTCHours":"setHours"}function $P(r){return r?"setUTCMinutes":"setMinutes"}function QP(r){return r?"setUTCSeconds":"setSeconds"}function eD(r){return r?"setUTCMilliseconds":"setMilliseconds"}function rD(r){if(!yp(r))return Ce(r)?r:"-";var e=(r+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Tw(r,e){return r=(r||"").toLowerCase().replace(/-(.)/g,function(t,i){return i.toUpperCase()}),e&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var Gs=Mm;function Ew(r,e,t){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(c){return c&&Yi(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var o=e==="time",s=r instanceof Date;if(o||s){var l=o?Mn(r):r;if(isNaN(+l)){if(s)return"-"}else return Bp(l,i,t)}if(e==="ordinal")return I0(r)?n(r):At(r)&&a(r)?r+"":"-";var u=Pa(r);return a(u)?rD(u):I0(r)?n(r):typeof r=="boolean"?r+"":"-"}var g5=["a","b","c","d","e","f","g"],tD=function(r,e){return"{"+r+(e??"")+"}"};function Aw(r,e,t){pe(e)||(e=[e]);var i=e.length;if(!i)return"";for(var n=e[0].$vars||[],a=0;a':'';var o=t.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function Hs(r,e){return e=e||"transparent",Ce(r)?r:qe(r)&&r.colorStops&&(r.colorStops[0]||{}).color||e}function kp(r,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=r}else window.open(r,e)}var Cw=N,iD=["left","right","top","bottom","width","height"],Vp=[["width","left","right"],["height","top","bottom"]];function nD(r,e,t,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;e.eachChild(function(l,u){var c=l.getBoundingRect(),f=e.childAt(u+1),h=f&&f.getBoundingRect(),p,d;if(r==="horizontal"){var g=c.width+(h?-h.x+c.x:0);p=a+g,p>i||l.newline?(a=0,p=g,o+=s+t,s=c.height):s=Math.max(s,c.height)}else{var m=c.height+(h?-h.y+c.y:0);d=o+m,d>n||l.newline?(a+=s+t,o=0,d=m,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=p+t:o=d+t)})}var Ws=nD,_Ve=ot(nD,"vertical"),xVe=ot(nD,"horizontal");function x5(r,e,t){var i=e.width,n=e.height,a=Fe(r.left,i),o=Fe(r.top,n),s=Fe(r.right,i),l=Fe(r.bottom,n);return(isNaN(a)||isNaN(parseFloat(r.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(r.right)))&&(s=i),(isNaN(o)||isNaN(parseFloat(r.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(r.bottom)))&&(l=n),t=Gs(t||0),{width:Math.max(s-a-t[1]-t[3],0),height:Math.max(l-o-t[0]-t[2],0)}}function xr(r,e,t){t=Gs(t||0);var i=e.width,n=e.height,a=Fe(r.left,i),o=Fe(r.top,n),s=Fe(r.right,i),l=Fe(r.bottom,n),u=Fe(r.width,i),c=Fe(r.height,n),f=t[2]+t[0],h=t[1]+t[3],p=r.aspect;switch(isNaN(u)&&(u=i-s-h-a),isNaN(c)&&(c=n-l-f-o),p!=null&&(isNaN(u)&&isNaN(c)&&(p>i/n?u=i*.8:c=n*.8),isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),isNaN(a)&&(a=i-s-u-h),isNaN(o)&&(o=n-l-c-f),r.left||r.right){case"center":a=i/2-u/2-t[3];break;case"right":a=i-u-h;break}switch(r.top||r.bottom){case"middle":case"center":o=n/2-c/2-t[0];break;case"bottom":o=n-c-f;break}a=a||0,o=o||0,isNaN(u)&&(u=i-h-a-(s||0)),isNaN(c)&&(c=n-f-o-(l||0));var d=new lt(a+t[3],o+t[0],u,c);return d.margin=t,d}function Ef(r,e,t,i,n,a){var o=!n||!n.hv||n.hv[0],s=!n||!n.hv||n.hv[1],l=n&&n.boundingMode||"all";if(a=a||r,a.x=r.x,a.y=r.y,!o&&!s)return!1;var u;if(l==="raw")u=r.type==="group"?new lt(0,0,+e.width||0,+e.height||0):r.getBoundingRect();else if(u=r.getBoundingRect(),r.needLocalTransform()){var c=r.getLocalTransform();u=u.clone(),u.applyTransform(c)}var f=xr(Ye({width:u.width,height:u.height},e),t,i),h=o?f.x-u.x:0,p=s?f.y-u.y:0;return l==="raw"?(a.x=h,a.y=p):(a.x+=h,a.y+=p),a===r&&r.markRedraw(),!0}function S5(r,e){return r[Vp[e][0]]!=null||r[Vp[e][1]]!=null&&r[Vp[e][2]]!=null}function Af(r){var e=r.layoutMode||r.constructor.layoutMode;return qe(e)?e:e?{type:e}:null}function za(r,e,t){var i=t&&t.ignoreSize;!pe(i)&&(i=[i,i]);var n=o(Vp[0],0),a=o(Vp[1],1);u(Vp[0],r,n),u(Vp[1],r,a);function o(c,f){var h={},p=0,d={},g=0,m=2;if(Cw(c,function(y){d[y]=r[y]}),Cw(c,function(y){s(e,y)&&(h[y]=d[y]=e[y]),l(h,y)&&p++,l(d,y)&&g++}),i[f])return l(e,c[1])?d[c[2]]=null:l(e,c[2])&&(d[c[1]]=null),d;if(g===m||!p)return d;if(p>=m)return h;for(var v=0;v=0;l--)s=_t(s,n[l],!0);i.defaultOption=s}return i.defaultOption},e.prototype.getReferringComponents=function(t,i){var n=t+"Index",a=t+"Id";return gf(this.ecModel,t,{index:this.get(n,!0),id:this.get(a,!0)},i)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(Zt);Wb(sv,Zt);yf(sv);a5(sv);o5(sv,tfe);function tfe(r){var e=[];return N(sv.getClassesByMainType(r),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=de(e,function(t){return Ia(t).main}),r!=="dataset"&&dt(e,"dataset")<=0&&e.unshift("dataset"),e}var Pt=sv;var M5="";typeof navigator<"u"&&(M5=navigator.platform||"");var lv="rgba(0, 0, 0, 0.2)",b5={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:lv,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:lv,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:lv,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:lv,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:lv,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:lv,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:M5.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var Rw=ke(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),fn="original",Ei="arrayRows",En="objectRows",xo="keyedColumns",So="typedArray",oD="unknown",Ba="column",Nu="row";var Ji={Must:1,Might:2,Not:3},w5=vt();function T5(r){w5(r).datasetMap=ke()}function Lw(r,e,t){var i={},n=Pw(e);if(!n||!r)return i;var a=[],o=[],s=e.ecModel,l=w5(s).datasetMap,u=n.uid+"_"+t.seriesLayoutBy,c,f;r=r.slice(),N(r,function(g,m){var v=qe(g)?g:r[m]={name:g};v.type==="ordinal"&&c==null&&(c=m,f=d(v)),i[v.name]=[]});var h=l.get(u)||l.set(u,{categoryWayDim:f,valueWayDim:0});N(r,function(g,m){var v=g.name,_=d(g);if(c==null){var y=h.valueWayDim;p(i[v],y,_),p(o,y,_),h.valueWayDim+=_}else if(c===m)p(i[v],0,_),p(a,0,_);else{var y=h.categoryWayDim;p(i[v],y,_),p(o,y,_),h.categoryWayDim+=_}});function p(g,m,v){for(var _=0;_e)return r[i];return r[t-1]}function P5(r,e,t,i,n,a,o){a=a||r;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var c=o==null||!i?t:ife(i,o);if(c=c||t,!(!c||!c.length)){var f=c[l];return n&&(u[n]=f),s.paletteIdx=(l+1)%c.length,f}}function nfe(r,e){e(r).paletteIdx=0,e(r).paletteNameMap={}}var Iw,D_,D5,I5="\0_ec_inner",afe=1;var F5=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Zt(a),this._locale=new Zt(o),this._optionManager=s},e.prototype.setOption=function(t,i,n){var a=O5(i);this._optionManager.setOption(t,n,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,i){return this._resetOption(t,O5(i))},e.prototype._resetOption=function(t,i){var n=!1,a=this._optionManager;if(!t||t==="recreate"){var o=a.mountOption(t==="recreate");!this.option||t==="recreate"?D5(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&N(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=ke(),u=i&&i.replaceMergeMainTypeMap;T5(this),N(t,function(f,h){f!=null&&(Pt.hasClass(h)?h&&(s.push(h),l.set(h,!0)):n[h]=n[h]==null?Qe(f):_t(n[h],f,!0))}),u&&u.each(function(f,h){Pt.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Pt.topologicalTravel(s,Pt.getAllClassMainTypes(),c,this);function c(f){var h=R5(this,f,Jt(t[f])),p=a.get(f),d=p?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",g=Gb(p,h,d);lH(g,f,Pt),n[f]=null,a.set(f,null),o.set(f,0);var m=[],v=[],_=0,y,x;N(g,function(M,S){var w=M.existing,T=M.newOption;if(!T)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var C=f==="series",b=Pt.getClass(f,M.keyInfo.subType,!C);if(!b){if(0)var E,I;return}if(f==="tooltip"){if(y)return;y=!0}if(w&&w.constructor===b)w.name=M.keyInfo.name,w.mergeOption(T,this),w.optionUpdated(T,!1);else{var R=fe({componentIndex:S},M.keyInfo);w=new b(T,this,this,R),fe(w,R),M.brandNew&&(w.__requireNewView=!0),w.init(T,this,this),w.optionUpdated(null,!0)}}w?(m.push(w.option),v.push(w),_++):(m.push(void 0),v.push(void 0))},this),n[f]=m,a.set(f,v),o.set(f,_),f==="series"&&Iw(this)}this._seriesIndices||Iw(this)},e.prototype.getOption=function(){var t=Qe(this.option);return N(t,function(i,n){if(Pt.hasClass(n)){for(var a=Jt(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Vm(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,t[n]=a}}),delete t[I5],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,i){var n=this._componentsMap.get(t);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o=e:t==="max"?r<=e:r===e}function vfe(r,e){return r.join(",")===e.join(",")}var z5=hfe;var Xs=N,N_=qe,B5=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function uD(r){var e=r&&r.itemStyle;if(e)for(var t=0,i=B5.length;t=0;m--){var v=r[m];if(s||(d=v.data.rawIndexOf(v.stackedByDimension,p)),d>=0){var _=v.data.getByRawIndex(v.stackResultDimension,d);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&h>=0&&_>0||l==="samesign"&&h<=0&&_<0){h=$G(h,_),g=_;break}}}return i[0]=h,i[1]=g,i})})}var Fw=function(){function r(e){this.data=e.data||(e.sourceFormat===xo?{}:[]),this.sourceFormat=e.sourceFormat||oD,this.seriesLayoutBy=e.seriesLayoutBy||Ba,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var i=0;ig&&(g=y)}p[0]=d,p[1]=g}},n=function(){return this._data?this._data.length/this._dimSize:0};Z5=(e={},e[Ei+"_"+Ba]={pure:!0,appendData:a},e[Ei+"_"+Nu]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[En]={pure:!0,appendData:a},e[xo]={pure:!0,appendData:function(o){var s=this._data;N(o,function(l,u){for(var c=s[u]||(s[u]=[]),f=0;f<(l||[]).length;f++)c.push(l[f])})}},e[fn]={appendData:a},e[So]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(g=o.interpolatedValue[m])}return g!=null?g+"":""})}},r.prototype.getRawValue=function(e,t){return Fu(this.getData(t),e)},r.prototype.formatTooltip=function(e,t,i){},r}();function _D(r){var e,t;return qe(r)?r.type&&(t=r):e=r,{text:e,frag:t}}function Cf(r){return new Lfe(r)}var Lfe=function(){function r(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return r.prototype.perform=function(e){var t=this._upstream,i=e&&e.skip;if(this._dirty&&t){var n=this.context;n.data=n.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(_){return!(_>=1)&&(_=1),_}var f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(i)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(t?this._dueEnd=t._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,d=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!i&&(f||p1&&i>0?s:o}};return a;function o(){return e=r?null:le},gte:function(r,e){return r>=e}},Dfe=function(){function r(e,t){if(!At(t)){var i="";ur(i)}this._opFn=Q5[e],this._rvalFloat=Pa(t)}return r.prototype.evaluate=function(e){return At(e)?this._opFn(e,this._rvalFloat):this._opFn(Pa(e),this._rvalFloat)},r}(),Vw=function(){function r(e,t){var i=e==="desc";this._resultLT=i?1:-1,t==null&&(t=i?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return r.prototype.evaluate=function(e,t){var i=At(e)?e:Pa(e),n=At(t)?t:Pa(t),a=isNaN(i),o=isNaN(n);if(a&&(i=this._incomparable),o&&(n=this._incomparable),a&&o){var s=Ce(e),l=Ce(t);s&&(i=l?e:0),l&&(n=s?t:0)}return in?-this._resultLT:0},r}();var Ife=function(){function r(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Pa(t)}return r.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var i=typeof e;i!==this._rvalTypeof&&(i==="number"||this._rvalTypeof==="number")&&(t=Pa(e)===this._rvalFloat)}return this._isEQ?t:!t},r}();function eW(r,e){return r==="eq"||r==="ne"?new Ife(r==="eq",e):tt(Q5,r)?new Dfe(r,e):null}var Nfe=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(e){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(e){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(e,t){},r.prototype.retrieveValueFromItem=function(e,t){},r.prototype.convertValue=function(e,t){return ns(e,t)},r}();function Ufe(r,e){var t=new Nfe,i=r.data,n=t.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==Ba&&ur(o);var s=[],l={},u=r.dimensionsDefine;if(u)N(u,function(g,m){var v=g.name,_={index:m,name:v,displayName:g.displayName};if(s.push(_),v!=null){var y="";tt(l,v)&&ur(y),l[v]=_}});else for(var c=0;c65535?Vfe:Gfe}function pv(){return[1/0,-1/0]}function Hfe(r){var e=r.constructor;return e===Array?r.slice():new e(r)}function aW(r,e,t,i,n){var a=oW[t||"float"];if(n){var o=r[e],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;um[1]&&(m[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(e,t,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=de(o,function(_){return _.property}),c=0;cv[1]&&(v[1]=m)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=t,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(i!=null&&ie)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(e,t,i){var n=this._chunks,a=n[e],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,c=0,f=this.count();c=0&&l<0)&&(s=d,l=p,u=0),p===l&&(o[u++]=c))}return o.length=u,o},r.prototype.getIndices=function(){var e,t=this._indices;if(t){var i=t.constructor,n=this._count;if(i===Array){e=new i(n);for(var a=0;a=f&&_<=h||isNaN(_))&&(l[u++]=g),g++}d=!0}else if(a===2){for(var m=p[n[0]],y=p[n[1]],x=e[n[1]][0],M=e[n[1]][1],v=0;v=f&&_<=h||isNaN(_))&&(S>=x&&S<=M||isNaN(S))&&(l[u++]=g),g++}d=!0}}if(!d)if(a===1)for(var v=0;v=f&&_<=h||isNaN(_))&&(l[u++]=w)}else for(var v=0;ve[b][1])&&(T=!1)}T&&(l[u++]=t.getRawIndex(v))}return uv[1]&&(v[1]=m)}}}},r.prototype.lttbDownSample=function(e,t){var i=this.clone([e],!0),n=i._chunks,a=n[e],o=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),c,f,h,p=new(F_(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));p[s++]=u;for(var d=1;dc&&(c=f,h=x)}E>0&&Ec-d&&(l=c-d,s.length=l);for(var g=0;gf[1]&&(f[1]=v),h[p++]=_}return a._count=p,a._indices=h,a._updateGetRawIdx(),a},r.prototype.each=function(e,t){if(this._count)for(var i=e.length,n=this._chunks,a=0,o=this.count();al&&(l=f)}return o=[s,l],this._extent[e]=o,o},r.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var i=[],n=this._chunks,a=0;a=0?this._indices[e]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function e(t,i,n,a){return ns(t[a],this._dimensions[a])}SD={arrayRows:e,objectRows:function(t,i,n,a){return ns(t[i],this._dimensions[a])},keyedColumns:e,original:function(t,i,n,a){var o=t&&(t.value==null?t:t.value);return ns(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(t,i,n,a){return t[a]}}}(),r}(),z_=Wfe;var Ww=function(){function r(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),i=!!t.length,n,a;if(Hw(e)){var o=e,s=void 0,l=void 0,u=void 0;if(i){var c=t[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=bi(s)?So:fn,a=[];var f=this._getSourceMetaRawOption()||{},h=u&&u.metaRawOption||{},p=ft(f.seriesLayoutBy,h.seriesLayoutBy)||null,d=ft(f.sourceHeader,h.sourceHeader),g=ft(f.dimensions,h.dimensions),m=p!==h.seriesLayoutBy||!!d!=!!h.sourceHeader||g;n=m?[O_(s,{seriesLayoutBy:p,sourceHeader:d,dimensions:g},l)]:[]}else{var v=e;if(i){var _=this._applyTransform(t);n=_.sourceList,a=_.upstreamSignList}else{var y=v.get("source",!0);n=[O_(y,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},r.prototype._applyTransform=function(e){var t=this._sourceHost,i=t.get("transform",!0),n=t.get("fromTransformResult",!0);if(n!=null){var a="";e.length!==1&&sW(a)}var o,s=[],l=[];return N(e,function(u){u.prepareSource();var c=u.getSource(n||0),f="";n!=null&&!c&&sW(f),s.push(c),l.push(u._getVersionSign())}),i?o=iW(i,s,{datasetIndex:t.componentIndex}):n!=null&&(o=[q5(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var Lue=gn(",&?/;] ".split(""),function(r,e){return r[e]=!0,r},{});function Pue(r){return Rue(r)?!!Lue[r]:!0}function wH(r,e,t,i,n){for(var a=[],o=[],s="",l="",u=0,c=0,f=0;ft:n+c+p>t){c?(s||l)&&(d?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=h,u+=p,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=h,c=p)):d?(a.push(l),o.push(u),l=h,u=p):(a.push(h),o.push(p));continue}c+=p,d?(l+=h,u+=p):(l&&(s+=l,l="",u=0),s+=h)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=n),{accumWidth:c,lines:a,linesWidths:o}}var oP="__zr_style_"+Math.round(Math.random()*10),Ll={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Mp={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Ll[oP]=!0;var TH=["z","z2","invisible"],Due=["invisible"],Iue=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype._init=function(t){for(var i=bt(t),n=0;n1e-4){s[0]=r-t,s[1]=e-i,l[0]=r+t,l[1]=e+i;return}if(qb[0]=lP(n)*t+r,qb[1]=sP(n)*i+e,Zb[0]=lP(a)*t+r,Zb[1]=sP(a)*i+e,u(s,qb,Zb),c(l,qb,Zb),n=n%bp,n<0&&(n=n+bp),a=a%bp,a<0&&(a=a+bp),n>a&&!o?a+=bp:nn&&(jb[0]=lP(p)*t+r,jb[1]=sP(p)*i+e,u(s,jb,s),c(l,jb,l))}var Vr={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Tp=[],Ep=[],Pl=[],Sf=[],Dl=[],Il=[],cP=Math.min,fP=Math.max,Ap=Math.cos,Cp=Math.sin,Su=Math.abs,dP=Math.PI,Mf=dP*2,hP=typeof Float32Array<"u",l_=[];function pP(r){var e=Math.round(r/dP*1e8)/1e8;return e%2*dP}function u_(r,e){var t=pP(r[0]);t<0&&(t+=Mf);var i=t-r[0],n=r[1];n+=i,!e&&n-t>=Mf?n=t+Mf:e&&t-n>=Mf?n=t-Mf:!e&&t>n?n=t+(Mf-pP(t-n)):e&&t0&&(this._ux=Su(i/mp/e)||0,this._uy=Su(i/mp/t)||0)},r.prototype.setDPR=function(e){this.dpr=e},r.prototype.setContext=function(e){this._ctx=e},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Vr.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},r.prototype.lineTo=function(e,t){var i=Su(e-this._xi),n=Su(t-this._yi),a=i>this._ux||n>this._uy;if(this.addData(Vr.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(e,t,i,n,a,o){return this._drawPendingPt(),this.addData(Vr.C,e,t,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(e,t,i,n,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(e,t,i,n){return this._drawPendingPt(),this.addData(Vr.Q,e,t,i,n),this._ctx&&this._ctx.quadraticCurveTo(e,t,i,n),this._xi=i,this._yi=n,this},r.prototype.arc=function(e,t,i,n,a,o){this._drawPendingPt(),l_[0]=n,l_[1]=a,u_(l_,o),n=l_[0],a=l_[1];var s=a-n;return this.addData(Vr.A,e,t,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(e,t,i,n,a,o),this._xi=Ap(a)*i+e,this._yi=Cp(a)*i+t,this},r.prototype.arcTo=function(e,t,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,i,n,a),this},r.prototype.rect=function(e,t,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,i,n),this.addData(Vr.R,e,t,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(Vr.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&e.closePath(),this._xi=t,this._yi=i,this},r.prototype.fill=function(e){e&&e.fill(),this.toStatic()},r.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&hP&&(this.data=new Float32Array(t));for(var i=0;ic.length&&(this._expandData(),c=this.data);for(var f=0;f0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},r.prototype.getBoundingRect=function(){Pl[0]=Pl[1]=Dl[0]=Dl[1]=Number.MAX_VALUE,Sf[0]=Sf[1]=Il[0]=Il[1]=-Number.MAX_VALUE;var e=this.data,t=0,i=0,n=0,a=0,o;for(o=0;oi||Su(y)>n||h===t-1)&&(g=Math.sqrt(_*_+y*y),a=m,o=v);break}case Vr.C:{var x=e[h++],M=e[h++],m=e[h++],v=e[h++],S=e[h++],w=e[h++];g=fG(a,o,x,M,m,v,S,w,10),a=S,o=w;break}case Vr.Q:{var x=e[h++],M=e[h++],m=e[h++],v=e[h++];g=pG(a,o,x,M,m,v,10),a=m,o=v;break}case Vr.A:var T=e[h++],C=e[h++],b=e[h++],E=e[h++],I=e[h++],R=e[h++],A=R+I;h+=1,d&&(s=Ap(I)*b+T,l=Cp(I)*E+C),g=fP(b,E)*cP(Mf,Math.abs(R)),a=Ap(A)*b+T,o=Cp(A)*E+C;break;case Vr.R:{s=a=e[h++],l=o=e[h++];var D=e[h++],U=e[h++];g=D*2+U*2;break}case Vr.Z:{var _=s-a,y=l-o;g=Math.sqrt(_*_+y*y),a=s,o=l;break}}g>=0&&(u[f++]=g,c+=g)}return this._pathLen=c,c},r.prototype.rebuildPath=function(e,t){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,c,f,h,p=t<1,d,g,m=0,v=0,_,y=0,x,M;if(!(p&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,g=this._pathLen,_=t*g,!_)))e:for(var S=0;S0&&(e.lineTo(x,M),y=0),w){case Vr.M:s=u=i[S++],l=c=i[S++],e.moveTo(u,c);break;case Vr.L:{f=i[S++],h=i[S++];var C=Su(f-u),b=Su(h-c);if(C>n||b>a){if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;e.lineTo(u*(1-I)+f*I,c*(1-I)+h*I);break e}m+=E}e.lineTo(f,h),u=f,c=h,y=0}else{var R=C*C+b*b;R>y&&(x=f,M=h,y=R)}break}case Vr.C:{var A=i[S++],D=i[S++],U=i[S++],B=i[S++],z=i[S++],k=i[S++];if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;jo(u,A,U,z,I,Tp),jo(c,D,B,k,I,Ep),e.bezierCurveTo(Tp[1],Ep[1],Tp[2],Ep[2],Tp[3],Ep[3]);break e}m+=E}e.bezierCurveTo(A,D,U,B,z,k),u=z,c=k;break}case Vr.Q:{var A=i[S++],D=i[S++],U=i[S++],B=i[S++];if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;mf(u,A,U,I,Tp),mf(c,D,B,I,Ep),e.quadraticCurveTo(Tp[1],Ep[1],Tp[2],Ep[2]);break e}m+=E}e.quadraticCurveTo(A,D,U,B),u=U,c=B;break}case Vr.A:var G=i[S++],Y=i[S++],J=i[S++],Q=i[S++],V=i[S++],K=i[S++],ae=i[S++],ve=!i[S++],ue=J>Q?J:Q,se=Su(J-Q)>.001,Ee=V+K,q=!1;if(p){var E=d[v++];m+E>_&&(Ee=V+K*(_-m)/E,q=!0),m+=E}if(se&&e.ellipse?e.ellipse(G,Y,J,Q,ae,V,Ee,ve):e.arc(G,Y,ue,V,Ee,ve),q)break e;T&&(s=Ap(V)*J+G,l=Cp(V)*Q+Y),u=Ap(Ee)*J+G,c=Cp(Ee)*Q+Y;break;case Vr.R:s=u=i[S],l=c=i[S+1],f=i[S++],h=i[S++];var H=i[S++],We=i[S++];if(p){var E=d[v++];if(m+E>_){var _e=_-m;e.moveTo(f,h),e.lineTo(f+cP(_e,H),h),_e-=H,_e>0&&e.lineTo(f+H,h+cP(_e,We)),_e-=We,_e>0&&e.lineTo(f+fP(H-_e,0),h+We),_e-=H,_e>0&&e.lineTo(f,h+fP(We-_e,0));break e}m+=E}e.rect(f,h,H,We);break;case Vr.Z:if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;e.lineTo(u*(1-I)+s*I,c*(1-I)+l*I);break e}m+=E}e.closePath(),u=s,c=l}}},r.prototype.clone=function(){var e=new r,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},r.CMD=Vr,r.initDefaultProps=function(){var e=r.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),r}(),Ki=Uue;function Nl(r,e,t,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=r;if(o>e+s&&o>i+s||or+s&&a>t+s||ae+f&&c>i+f&&c>a+f&&c>s+f||cr+f&&u>t+f&&u>n+f&&u>o+f||ue+u&&l>i+u&&l>a+u||lr+u&&s>t+u&&s>n+u||st||c+un&&(n+=c_);var h=Math.atan2(l,s);return h<0&&(h+=c_),h>=i&&h<=n||h+c_>=i&&h+c_<=n}function Qo(r,e,t,i,n,a){if(a>e&&a>i||an?s:0}var bf=Ki.CMD,Rp=Math.PI*2,Fue=1e-4;function Bue(r,e){return Math.abs(r-e)e&&u>i&&u>a&&u>s||u1&&kue(),p=hi(e,i,a,s,es[0]),h>1&&(d=hi(e,i,a,s,es[1]))),h===2?me&&s>i&&s>a||s=0&&u<=1){for(var c=0,f=vi(e,i,a,u),h=0;ht||s<-t)return 0;var l=Math.sqrt(t*t-s*s);la[0]=-l,la[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=Rp-1e-4){i=0,n=Rp;var c=a?1:-1;return o>=la[0]+r&&o<=la[1]+r?c:0}if(i>n){var f=i;i=n,n=f}i<0&&(i+=Rp,n+=Rp);for(var h=0,p=0;p<2;p++){var d=la[p];if(d+r>o){var g=Math.atan2(s,d),c=a?1:-1;g<0&&(g=Rp+g),(g>=i&&g<=n||g+Rp>=i&&g+Rp<=n)&&(g>Math.PI/2&&g1&&(t||(s+=Qo(l,u,c,f,i,n))),m&&(l=a[d],u=a[d+1],c=l,f=u),g){case bf.M:c=a[d++],f=a[d++],l=c,u=f;break;case bf.L:if(t){if(Nl(l,u,a[d],a[d+1],e,i,n))return!0}else s+=Qo(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case bf.C:if(t){if(IH(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=Vue(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case bf.Q:if(t){if(Kb(l,u,a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=Gue(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case bf.A:var v=a[d++],_=a[d++],y=a[d++],x=a[d++],M=a[d++],S=a[d++];d+=1;var w=!!(1-a[d++]);h=Math.cos(M)*y+v,p=Math.sin(M)*x+_,m?(c=h,f=p):s+=Qo(l,u,h,p,i,n);var T=(i-v)*x/y+v;if(t){if(OH(v,_,x,M,M+S,w,e,T,n))return!0}else s+=Hue(v,_,x,M,M+S,w,T,n);l=Math.cos(M+S)*y+v,u=Math.sin(M+S)*x+_;break;case bf.R:c=l=a[d++],f=u=a[d++];var C=a[d++],b=a[d++];if(h=c+C,p=f+b,t){if(Nl(c,f,h,f,e,i,n)||Nl(h,f,h,p,e,i,n)||Nl(h,p,c,p,e,i,n)||Nl(c,p,c,f,e,i,n))return!0}else s+=Qo(h,f,h,p,i,n),s+=Qo(c,p,c,f,i,n);break;case bf.Z:if(t){if(Nl(l,u,c,f,e,i,n))return!0}else s+=Qo(l,u,c,f,i,n);l=c,u=f;break}}return!t&&!Bue(u,f)&&(s+=Qo(l,u,c,f,i,n)||0),s!==0}function FH(r,e,t){return zH(r,0,!1,e,t)}function BH(r,e,t,i){return zH(r,e,!0,t,i)}var qm=Ye({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Ll),Xue={style:Ye({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Mp.style)},mP=go.concat(["invisible","culling","z","z2","zlevel","parent"]),Yue=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.update=function(){var t=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new e;n.buildPath===e.prototype.buildPath&&(n.buildPath=function(l){t.buildPath(l,t.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?Q0:i>.2?FG:e_}else if(t)return e_}return Q0},e.prototype.getInsideTextStroke=function(t){var i=this.style.fill;if(Ce(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Nm(t,0)<$0;if(a===o)return i}},e.prototype.buildPath=function(t,i,n){},e.prototype.pathUpdated=function(){this.__dirty&=~hf},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Ki(!1)},e.prototype.hasStroke=function(){var t=this.style,i=t.stroke;return!(i==null||i==="none"||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style,i=t.fill;return i!=null&&i!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,i=this.style,n=!t;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&hf)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){s.copy(t);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect(),o=this.style;if(t=n[0],i=n[1],a.contain(t,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),BH(s,l/u,t,i)))return!0}if(this.hasFill())return FH(s,t,i)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=hf,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,i){t==="shape"?this.setShape(i):r.prototype.attrKV.call(this,t,i)},e.prototype.setShape=function(t,i){var n=this.shape;return n||(n=this.shape={}),typeof t=="string"?n[t]=i:fe(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&hf)},e.prototype.createStyle=function(t){return cf(qm,t)},e.prototype._innerSaveToNormal=function(t){r.prototype._innerSaveToNormal.call(this,t);var i=this._normalState;t.shape&&!i.shape&&(i.shape=fe({},this.shape))},e.prototype._applyStateObj=function(t,i,n,a,o,s){r.prototype._applyStateObj.call(this,t,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=fe({},n.shape),fe(u,i.shape)):(u=fe({},a?this.shape:n.shape),fe(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=fe({},this.shape);for(var c={},f=bt(u),h=0;h0},e.prototype.hasFill=function(){var t=this.style,i=t.fill;return i!=null&&i!=="none"},e.prototype.createStyle=function(t){return cf(que,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var i=t.text;i!=null?i+="":i="";var n=Rl(i,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var a=t.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(gi);kH.prototype.type="tspan";var Mu=kH;var Zue=Ye({x:0,y:0},Ll),jue={style:Ye({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Mp.style)};function Kue(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var VH=function(r){Xt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return cf(Zue,t)},e.prototype._getSize=function(t){var i=this.style,n=i[t];if(n!=null)return n;var a=Kue(i.image)?i.image:this.__image;if(!a)return 0;var o=t==="width"?"height":"width",s=i[o];return s==null?a[t]:a[t]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return jue},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new lt(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(gi);VH.prototype.type="image";var Ur=VH;function GH(r,e){var t=e.x,i=e.y,n=e.width,a=e.height,o=e.r,s,l,u,c;n<0&&(t=t+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=c=o:o instanceof Array?o.length===1?s=l=u=c=o[0]:o.length===2?(s=u=o[0],l=c=o[1]):o.length===3?(s=o[0],l=c=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],c=o[3]):s=l=u=c=0;var f;s+l>n&&(f=s+l,s*=n/f,l*=n/f),u+c>n&&(f=u+c,u*=n/f,c*=n/f),l+u>a&&(f=l+u,l*=a/f,u*=a/f),s+c>a&&(f=s+c,s*=a/f,c*=a/f),r.moveTo(t+s,i),r.lineTo(t+n-l,i),l!==0&&r.arc(t+n-l,i+l,l,-Math.PI/2,0),r.lineTo(t+n,i+a-u),u!==0&&r.arc(t+n-u,i+a-u,u,0,Math.PI/2),r.lineTo(t+c,i+a),c!==0&&r.arc(t+c,i+a-c,c,Math.PI/2,Math.PI),r.lineTo(t,i+s),s!==0&&r.arc(t+s,i+s,s,Math.PI,Math.PI*1.5)}var Zm=Math.round;function Jb(r,e,t){if(e){var i=e.x1,n=e.x2,a=e.y1,o=e.y2;r.x1=i,r.x2=n,r.y1=a,r.y2=o;var s=t&&t.lineWidth;return s&&(Zm(i*2)===Zm(n*2)&&(r.x1=r.x2=wf(i,s,!0)),Zm(a*2)===Zm(o*2)&&(r.y1=r.y2=wf(a,s,!0))),r}}function $b(r,e,t){if(e){var i=e.x,n=e.y,a=e.width,o=e.height;r.x=i,r.y=n,r.width=a,r.height=o;var s=t&&t.lineWidth;return s&&(r.x=wf(i,s,!0),r.y=wf(n,s,!0),r.width=Math.max(wf(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(wf(n+o,s,!1)-r.y,o===0?0:1)),r}}function wf(r,e,t){if(!e)return r;var i=Zm(r*2);return(i+Zm(e))%2===0?i/2:(i+(t?1:-1))/2}var Que=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}();var ece={},HH=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Que},e.prototype.buildPath=function(t,i){var n,a,o,s;if(this.subPixelOptimize){var l=$b(ece,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?GH(t,i):t.rect(n,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(ut);HH.prototype.type="rect";var Et=HH;var WH={fill:"#000"},XH=2,tce={style:Ye({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Mp.style)},QH=function(r){Xt(e,r);function e(t){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=WH,i.attr(t),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,I=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),R=o.calculatedLineHeight,A=0;A=0&&(A=S[R],A.align==="right");)this._placeToken(A,t,T,v,I,"right",y),C-=A.width,I-=A.width,R--;for(E+=(a-(E-m)-(_-I)-C)/2;b<=R;)A=S[b],this._placeToken(A,t,T,v,E+A.width/2,"center",y),E+=A.width,b++;v+=T}},e.prototype._placeToken=function(t,i,n,a,o,s,l){var u=i.rich[t.styleName]||{};u.text=t.text;var c=t.verticalAlign,f=a+n/2;c==="top"?f=a+t.height/2:c==="bottom"&&(f=a+n-t.height/2);var h=!t.isLineHolder&&vP(u);h&&this._renderBackground(u,i,s==="right"?o-t.width:s==="center"?o-t.width/2:o,f-t.height/2,t.width,t.height);var p=!!u.backgroundColor,d=t.textPadding;d&&(o=JH(o,s,d),f-=t.height/2-d[0]-t.innerHeight/2);var g=this._getOrCreateChild(Mu),m=g.createStyle();g.useStyle(m);var v=this._defaultStyle,_=!1,y=0,x=KH("fill"in u?u.fill:"fill"in i?i.fill:(_=!0,v.fill)),M=jH("stroke"in u?u.stroke:"stroke"in i?i.stroke:!p&&!l&&(!v.autoStroke||_)?(y=XH,v.stroke):null),S=u.textShadowBlur>0||i.textShadowBlur>0;m.text=t.text,m.x=o,m.y=f,S&&(m.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,m.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",m.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,m.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),m.textAlign=s,m.textBaseline="middle",m.font=t.font||ho,m.opacity=Xi(u.opacity,i.opacity,1),qH(m,u),M&&(m.lineWidth=Xi(u.lineWidth,i.lineWidth,y),m.lineDash=ft(u.lineDash,i.lineDash),m.lineDashOffset=i.lineDashOffset||0,m.stroke=M),x&&(m.fill=x);var w=t.contentWidth,T=t.contentHeight;g.setBoundingRect(new lt(Om(m.x,w,m.textAlign),yp(m.y,T,m.textBaseline),w,T))},e.prototype._renderBackground=function(t,i,n,a,o,s){var l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,f=l&&l.image,h=l&&!f,p=t.borderRadius,d=this,g,m;if(h||t.lineHeight||u&&c){g=this._getOrCreateChild(Et),g.useStyle(g.createStyle()),g.style.fill=null;var v=g.shape;v.x=n,v.y=a,v.width=o,v.height=s,v.r=p,g.dirtyShape()}if(h){var _=g.style;_.fill=l||null,_.fillOpacity=ft(t.fillOpacity,1)}else if(f){m=this._getOrCreateChild(Ur),m.onload=function(){d.dirtyStyle()};var y=m.style;y.image=l.image,y.x=n,y.y=a,y.width=o,y.height=s}if(u&&c){var _=g.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=ft(t.strokeOpacity,1),_.lineDash=t.borderDash,_.lineDashOffset=t.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var x=(g||m).style;x.shadowBlur=t.shadowBlur||0,x.shadowColor=t.shadowColor||"transparent",x.shadowOffsetX=t.shadowOffsetX||0,x.shadowOffsetY=t.shadowOffsetY||0,x.opacity=Xi(t.opacity,i.opacity,1)},e.makeFont=function(t){var i="";return yP(t)&&(i=[t.fontStyle,t.fontWeight,gP(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),i&&Yi(i)||t.textFont||t.font},e}(gi),rce={left:!0,right:1,center:1},ice={top:1,bottom:1,middle:1},YH=["fontStyle","fontWeight","fontSize","fontFamily"];function gP(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?eb+"px":r+"px"}function qH(r,e){for(var t=0;t=0,a=!1;if(r instanceof ut){var o=o4(r),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(jm(s)||jm(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=fe({},i),u=fe({},u),u.fill=s):!jm(u.fill)&&jm(s)?(a=!0,i=fe({},i),u=fe({},u),u.fill=Y0(s)):!jm(u.stroke)&&jm(l)&&(a||(i=fe({},i),u=fe({},u)),u.stroke=Y0(l)),i.style=u}}if(i&&i.z2==null){a||(i=fe({},i));var c=r.z2EmphasisLift;i.z2=r.z2+(c??bu)}return i}function cce(r,e,t){if(t&&t.z2==null){t=fe({},t);var i=r.z2SelectLift;t.z2=r.z2+(i??ace)}return t}function fce(r,e,t){var i=dt(r.currentStates,e)>=0,n=r.style.opacity,a=i?null:lce(r,["opacity"],e,{opacity:1});t=t||{};var o=t.style||{};return o.opacity==null&&(t=fe({},t),o=fe({opacity:i?n:a.opacity*.1},o),t.style=o),t}function _P(r,e){var t=this.states[r];if(this.style){if(r==="emphasis")return uce(this,r,e,t);if(r==="blur")return fce(this,r,t);if(r==="select")return cce(this,r,t)}return t}function Fs(r){r.stateProxy=_P;var e=r.getTextContent(),t=r.getTextGuideLine();e&&(e.stateProxy=_P),t&&(t.stateProxy=_P)}function i4(r,e){!c4(r,e)&&!r.__highByOuter&&wu(r,s4)}function n4(r,e){!c4(r,e)&&!r.__highByOuter&&wu(r,l4)}function Bn(r,e){r.__highByOuter|=1<<(e||0),wu(r,s4)}function kn(r,e){!(r.__highByOuter&=~(1<<(e||0)))&&wu(r,l4)}function tw(r){wu(r,bP)}function m_(r){wu(r,u4)}function wP(r){wu(r,oce)}function TP(r){wu(r,sce)}function c4(r,e){return r.__highDownSilentOnTouch&&e.zrByTouch}function EP(r){var e=r.getModel(),t=[],i=[];e.eachComponent(function(n,a){var o=SP(a),s=n==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){u4(u)}),s&&t.push(a)),o.isBlured=!1}),N(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(t,!1,e)})}function xP(r,e,t,i){var n=i.getModel();t=t||"coordinateSystem";function a(u,c){for(var f=0;f0){var l={dataIndex:s,seriesIndex:t.seriesIndex};o!=null&&(l.dataType=o),e.push(l)}})}),e}function Ul(r,e,t){Tu(r,!0),wu(r,Fs),iw(r,e,t)}function hce(r){Tu(r,!1)}function ar(r,e,t,i){i?hce(r):Ul(r,e,t)}function iw(r,e,t){var i=rt(r);e!=null?(i.focus=e,i.blurScope=t):i.focus&&(i.focus=null)}var a4=["emphasis","blur","select"],pce={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Gr(r,e,t,i){t=t||"itemStyle";for(var n=0;nx_,BezierCurve:()=>Np,BoundingRect:()=>lt,Circle:()=>ua,CompoundPath:()=>tv,Ellipse:()=>g_,Group:()=>Ze,Image:()=>Ur,IncrementalDisplayable:()=>G4,Line:()=>Jr,LinearGradient:()=>zl,OrientedBoundingRect:()=>rv,Path:()=>ut,Point:()=>Nt,Polygon:()=>ti,Polyline:()=>Qr,RadialGradient:()=>hw,Rect:()=>Et,Ring:()=>Ip,Sector:()=>yi,Text:()=>Lt,applyTransform:()=>wn,clipPointsByRect:()=>zP,clipRectByRect:()=>Yce,createIcon:()=>Lu,extendPath:()=>Hce,extendShape:()=>Vce,getShapeClass:()=>S_,getTransform:()=>Vs,groupTransition:()=>Ru,initProps:()=>or,isElementRemoved:()=>Eu,lineLineIntersect:()=>K4,linePolygonIntersect:()=>nv,makeImage:()=>OP,makePath:()=>iv,mergePath:()=>Gn,registerShape:()=>ks,removeElement:()=>ts,removeElementWithFadeOut:()=>Au,resizePath:()=>j4,setTooltipConfig:()=>Gs,subPixelOptimize:()=>M_,subPixelOptimizeLine:()=>Cu,subPixelOptimizeRect:()=>Wce,transformDirection:()=>zp,traverseElements:()=>ca,updateProps:()=>Dt});var $m=Ki.CMD,dce=[[],[],[]],_4=Math.sqrt,mce=Math.atan2;function aw(r,e){if(e){var t=r.data,i=r.len(),n,a,o,s,l,u,c=$m.M,f=$m.C,h=$m.L,p=$m.R,d=$m.A,g=$m.Q;for(o=0,s=0;o1&&(o*=RP(d),s*=RP(d));var g=(n===a?-1:1)*RP((o*o*(s*s)-o*o*(p*p)-s*s*(h*h))/(o*o*(p*p)+s*s*(h*h)))||0,m=g*o*p/s,v=g*-s*h/o,_=(r+t)/2+sw(f)*m-ow(f)*v,y=(e+i)/2+ow(f)*m+sw(f)*v,x=S4([1,0],[(h-m)/o,(p-v)/s]),M=[(h-m)/o,(p-v)/s],S=[(-1*h-m)/o,(-1*p-v)/s],w=S4(M,S);if(LP(M,S)<=-1&&(w=v_),LP(M,S)>=1&&(w=0),w<0){var T=Math.round(w/v_*1e6)/1e6;w=v_*2+T%2*v_}c.addData(u,_,y,o,s,x,w,f,a)}var vce=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,gce=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function yce(r){var e=new Ki;if(!r)return e;var t=0,i=0,n=t,a=i,o,s=Ki.CMD,l=r.match(vce);if(!l)return e;for(var u=0;uA*A+D*D&&(T=b,C=E),{cx:T,cy:C,x0:-c,y0:-f,x1:T*(n/M-1),y1:C*(n/M-1)}}function wce(r){var e;if(pe(r)){var t=r.length;if(!t)return r;t===1?e=[r[0],r[0],0,0]:t===2?e=[r[0],r[0],r[1],r[1]]:t===3?e=r.concat(r[2]):e=r}else e=[r,r,r,r];return e}function D4(r,e){var t,i=y_(e.r,0),n=y_(e.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var c=e.cx,f=e.cy,h=!!e.clockwise,p=L4(u-l),d=p>PP&&p%PP;if(d>Bs&&(p=d),!(i>Bs))r.moveTo(c,f);else if(p>PP-Bs)r.moveTo(c+i*ev(l),f+i*Dp(l)),r.arc(c,f,i,l,u,!h),n>Bs&&(r.moveTo(c+n*ev(u),f+n*Dp(u)),r.arc(c,f,n,u,l,h));else{var g=void 0,m=void 0,v=void 0,_=void 0,y=void 0,x=void 0,M=void 0,S=void 0,w=void 0,T=void 0,C=void 0,b=void 0,E=void 0,I=void 0,R=void 0,A=void 0,D=i*ev(l),U=i*Dp(l),B=n*ev(u),z=n*Dp(u),k=p>Bs;if(k){var G=e.cornerRadius;G&&(t=wce(G),g=t[0],m=t[1],v=t[2],_=t[3]);var Y=L4(i-n)/2;if(y=Ol(Y,v),x=Ol(Y,_),M=Ol(Y,g),S=Ol(Y,m),C=w=y_(y,x),b=T=y_(M,S),(w>Bs||T>Bs)&&(E=i*ev(u),I=i*Dp(u),R=n*ev(l),A=n*Dp(l),pBs){var se=Ol(v,C),Ee=Ol(_,C),q=uw(R,A,D,U,i,se,h),H=uw(E,I,B,z,i,Ee,h);r.moveTo(c+q.cx+q.x0,f+q.cy+q.y0),C0&&r.arc(c+q.cx,f+q.cy,se,Vn(q.y0,q.x0),Vn(q.y1,q.x1),!h),r.arc(c,f,i,Vn(q.cy+q.y1,q.cx+q.x1),Vn(H.cy+H.y1,H.cx+H.x1),!h),Ee>0&&r.arc(c+H.cx,f+H.cy,Ee,Vn(H.y1,H.x1),Vn(H.y0,H.x0),!h))}else r.moveTo(c+D,f+U),r.arc(c,f,i,l,u,!h);if(!(n>Bs)||!k)r.lineTo(c+B,f+z);else if(b>Bs){var se=Ol(g,b),Ee=Ol(m,b),q=uw(B,z,E,I,n,-Ee,h),H=uw(D,U,R,A,n,-se,h);r.lineTo(c+q.cx+q.x0,f+q.cy+q.y0),b0&&r.arc(c+q.cx,f+q.cy,Ee,Vn(q.y0,q.x0),Vn(q.y1,q.x1),!h),r.arc(c,f,n,Vn(q.cy+q.y1,q.cx+q.x1),Vn(H.cy+H.y1,H.cx+H.x1),h),se>0&&r.arc(c+H.cx,f+H.cy,se,Vn(H.y1,H.x1),Vn(H.y0,H.x0),!h))}else r.lineTo(c+B,f+z),r.arc(c,f,n,u,l,h)}r.closePath()}}}var Ece=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}();var I4=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Ece},e.prototype.buildPath=function(t,i){D4(t,i)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(ut);I4.prototype.type="sector";var yi=I4;var Ace=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}();var N4=function(r){Xt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Ace},e.prototype.buildPath=function(t,i){var n=i.cx,a=i.cy,o=Math.PI*2;t.moveTo(n+i.r,a),t.arc(n,a,i.r,0,o,!1),t.moveTo(n+i.r0,a),t.arc(n,a,i.r0,0,o,!0)},e}(ut);N4.prototype.type="ring";var Ip=N4;function DP(r,e,t,i){var n=[],a=[],o=[],s=[],l,u,c,f;if(i){c=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,p=r.length;h=2){if(i){var a=DP(n,i,t,e.smoothConstraint);r.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(t?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=n[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{r.moveTo(n[0][0],n[0][1]);for(var s=1,f=n.length;sOp[1]){if(s=!1,a)return s;var c=Math.abs(Op[0]-Up[1]),f=Math.abs(Up[0]-Op[1]);Math.min(c,f)>n.len()&&(c0){var f=c.duration,h=c.delay,p=c.easing,d={duration:f,delay:h||0,easing:p,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?e.animateFrom(t,d):e.animateTo(t,d)}else e.stopAnimation(),!s&&e.attr(t),o&&o(1),a&&a()}function Dt(r,e,t,i,n,a){IP("update",r,e,t,i,n,a)}function or(r,e,t,i,n,a){IP("enter",r,e,t,i,n,a)}function Eu(r){if(!r.__zr)return!0;for(var e=0;eMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Y4(r){return!r.isGroup}function Xce(r){return r.shape!=null}function Ru(r,e,t){if(!r||!e)return;function i(o){var s={};return o.traverse(function(l){Y4(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return Xce(o)&&(s.shape=fe({},o.shape)),s}var a=i(r);e.traverse(function(o){if(Y4(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Dt(o,l,t,rt(o).dataIndex)}}})}function zP(r,e){return de(r,function(t){var i=t[0];i=mw(i,e.x),i=vw(i,e.x+e.width);var n=t[1];return n=mw(n,e.y),n=vw(n,e.y+e.height),[i,n]})}function Yce(r,e){var t=mw(r.x,e.x),i=vw(r.x+r.width,e.x+e.width),n=mw(r.y,e.y),a=vw(r.y+r.height,e.y+e.height);if(i>=t&&a>=n)return{x:t,y:n,width:i-t,height:a-n}}function Lu(r,e,t){var i=fe({rectHover:!0},e),n=i.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(n.image=r.slice(8),Ye(n,t),new Ur(i)):iv(r.replace("path://",""),i,t,"center")}function nv(r,e,t,i,n){for(var a=0,o=n[n.length-1];a1)return!1;var m=NP(p,d,c,f)/h;return!(m<0||m>1)}function NP(r,e,t,i){return r*i-t*e}function qce(r){return r<=1e-6&&r>=-1e-6}function Gs(r){var e=r.itemTooltipOption,t=r.componentModel,i=r.itemName,n=Ce(e)?{formatter:e}:e,a=t.mainType,o=t.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&N(bt(l),function(c){tt(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=rt(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:Ye({content:i,formatterParams:s},n)}}function q4(r,e){var t;r.isGroup&&(t=e(r)),t||r.traverse(e)}function ca(r,e){if(r)if(pe(r))for(var t=0;t=0&&s.push(l)}),s}}function Hn(r,e){return _t(_t({},r,!0),e,!0)}var s5={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}};var l5={time:{month:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],dayOfWeekAbbr:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53CD\u9009"}},toolbox:{brush:{title:{rect:"\u77E9\u5F62\u9009\u62E9",polygon:"\u5708\u9009",lineX:"\u6A2A\u5411\u9009\u62E9",lineY:"\u7EB5\u5411\u9009\u62E9",keep:"\u4FDD\u6301\u9009\u62E9",clear:"\u6E05\u9664\u9009\u62E9"}},dataView:{title:"\u6570\u636E\u89C6\u56FE",lang:["\u6570\u636E\u89C6\u56FE","\u5173\u95ED","\u5237\u65B0"]},dataZoom:{title:{zoom:"\u533A\u57DF\u7F29\u653E",back:"\u533A\u57DF\u7F29\u653E\u8FD8\u539F"}},magicType:{title:{line:"\u5207\u6362\u4E3A\u6298\u7EBF\u56FE",bar:"\u5207\u6362\u4E3A\u67F1\u72B6\u56FE",stack:"\u5207\u6362\u4E3A\u5806\u53E0",tiled:"\u5207\u6362\u4E3A\u5E73\u94FA"}},restore:{title:"\u8FD8\u539F"},saveAsImage:{title:"\u4FDD\u5B58\u4E3A\u56FE\u7247",lang:["\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247"]}},series:{typeNames:{pie:"\u997C\u56FE",bar:"\u67F1\u72B6\u56FE",line:"\u6298\u7EBF\u56FE",scatter:"\u6563\u70B9\u56FE",effectScatter:"\u6D9F\u6F2A\u6563\u70B9\u56FE",radar:"\u96F7\u8FBE\u56FE",tree:"\u6811\u56FE",treemap:"\u77E9\u5F62\u6811\u56FE",boxplot:"\u7BB1\u578B\u56FE",candlestick:"K\u7EBF\u56FE",k:"K\u7EBF\u56FE",heatmap:"\u70ED\u529B\u56FE",map:"\u5730\u56FE",parallel:"\u5E73\u884C\u5750\u6807\u56FE",lines:"\u7EBF\u56FE",graph:"\u5173\u7CFB\u56FE",sankey:"\u6851\u57FA\u56FE",funnel:"\u6F0F\u6597\u56FE",gauge:"\u4EEA\u8868\u76D8\u56FE",pictorialBar:"\u8C61\u5F62\u67F1\u56FE",themeRiver:"\u4E3B\u9898\u6CB3\u6D41\u56FE",sunburst:"\u65ED\u65E5\u56FE",custom:"\u81EA\u5B9A\u4E49\u56FE\u8868",chart:"\u56FE\u8868"}},aria:{general:{withTitle:"\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002",withoutTitle:"\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C"},series:{single:{prefix:"",withName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002",withoutName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002"},multiple:{prefix:"\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002",withName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C",withoutName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C",separator:{middle:"\uFF1B",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636E\u662F\u2014\u2014",partialData:"\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014",withName:"{name}\u7684\u6570\u636E\u662F{value}",withoutName:"{value}",separator:{middle:"\uFF0C",end:""}}}};var Sw="ZH",WP="EN",ov=WP,xw={},XP={},Mw=zt.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ov).toUpperCase();return r.indexOf(Sw)>-1?Sw:ov}():ov;function u5(r,e){r=r.toUpperCase(),XP[r]=new Zt(e),xw[r]=e}function c5(r){if(Ce(r)){var e=xw[r.toUpperCase()]||{};return r===Sw||r===WP?Qe(e):_t(Qe(e),Qe(xw[ov]),!1)}else return _t(Qe(r),Qe(xw[ov]),!1)}function w_(r){return XP[r]}function f5(){return XP[ov]}u5(WP,s5);u5(Sw,l5);var ww=1e3,Tw=ww*60,lv=Tw*60,_o=lv*24,qP=_o*365,T_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},bw="{yyyy}-{MM}-{dd}",ZP={year:"{yyyy}",month:"{yyyy}-{MM}",day:bw,hour:bw+" "+T_.hour,minute:bw+" "+T_.minute,second:bw+" "+T_.second,millisecond:T_.none},YP=["year","month","day","hour","minute","second","millisecond"],jP=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Du(r,e){return r+="","0000".substr(0,e-r.length)+r}function kp(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function h5(r){return r===kp(r)}function p5(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Vp(r,e,t,i){var n=Mn(r),a=n[Ew(t)](),o=n[Bp(t)]()+1,s=Math.floor((o-1)/3)+1,l=n[E_(t)](),u=n["get"+(t?"UTC":"")+"Day"](),c=n[sv(t)](),f=(c-1)%12+1,h=n[A_(t)](),p=n[C_(t)](),d=n[R_(t)](),g=i instanceof Zt?i:w_(i||Mw)||f5(),m=g.getModel("time"),v=m.get("month"),_=m.get("monthAbbr"),y=m.get("dayOfWeek"),x=m.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Du(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,_[o-1]).replace(/{MM}/g,Du(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Du(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Du(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Du(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,Du(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,Du(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Du(d,3)).replace(/{S}/g,d+"")}function d5(r,e,t,i,n){var a=null;if(Ce(t))a=t;else if(He(t))a=t(r.value,e,{level:r.level});else{var o=fe({},T_);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(pe(a)){var f=r.level==null?0:r.level>=0?r.level:a.length+r.level;f=Math.min(f,a.length-1),a=a[f]}}return Vp(new Date(r.value),a,n,i)}function m5(r,e){var t=Mn(r),i=t[Bp(e)]()+1,n=t[E_(e)](),a=t[sv(e)](),o=t[A_(e)](),s=t[C_(e)](),l=t[R_(e)](),u=l===0,c=u&&s===0,f=c&&o===0,h=f&&a===0,p=h&&n===1,d=p&&i===1;return d?"year":p?"month":h?"day":f?"hour":c?"minute":u?"second":"millisecond"}function KP(r,e,t){var i=Ct(r)?Mn(r):r;switch(e=e||m5(r,t),e){case"year":return i[Ew(t)]();case"half-year":return i[Bp(t)]()>=6?1:0;case"quarter":return Math.floor((i[Bp(t)]()+1)/4);case"month":return i[Bp(t)]();case"day":return i[E_(t)]();case"half-day":return i[sv(t)]()/24;case"hour":return i[sv(t)]();case"minute":return i[A_(t)]();case"second":return i[C_(t)]();case"millisecond":return i[R_(t)]()}}function Ew(r){return r?"getUTCFullYear":"getFullYear"}function Bp(r){return r?"getUTCMonth":"getMonth"}function E_(r){return r?"getUTCDate":"getDate"}function sv(r){return r?"getUTCHours":"getHours"}function A_(r){return r?"getUTCMinutes":"getMinutes"}function C_(r){return r?"getUTCSeconds":"getSeconds"}function R_(r){return r?"getUTCMilliseconds":"getMilliseconds"}function v5(r){return r?"setUTCFullYear":"setFullYear"}function JP(r){return r?"setUTCMonth":"setMonth"}function $P(r){return r?"setUTCDate":"setDate"}function QP(r){return r?"setUTCHours":"setHours"}function eD(r){return r?"setUTCMinutes":"setMinutes"}function tD(r){return r?"setUTCSeconds":"setSeconds"}function rD(r){return r?"setUTCMilliseconds":"setMilliseconds"}function nD(r){if(!xp(r))return Ce(r)?r:"-";var e=(r+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Aw(r,e){return r=(r||"").toLowerCase().replace(/-(.)/g,function(t,i){return i.toUpperCase()}),e&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var Hs=wm;function Cw(r,e,t){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(c){return c&&Yi(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var o=e==="time",s=r instanceof Date;if(o||s){var l=o?Mn(r):r;if(isNaN(+l)){if(s)return"-"}else return Vp(l,i,t)}if(e==="ordinal")return N0(r)?n(r):Ct(r)&&a(r)?r+"":"-";var u=Na(r);return a(u)?nD(u):N0(r)?n(r):typeof r=="boolean"?r+"":"-"}var g5=["a","b","c","d","e","f","g"],iD=function(r,e){return"{"+r+(e??"")+"}"};function Rw(r,e,t){pe(e)||(e=[e]);var i=e.length;if(!i)return"";for(var n=e[0].$vars||[],a=0;a':'';var o=t.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function Ws(r,e){return e=e||"transparent",Ce(r)?r:qe(r)&&r.colorStops&&(r.colorStops[0]||{}).color||e}function Gp(r,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=r}else window.open(r,e)}var Lw=N,aD=["left","right","top","bottom","width","height"],Hp=[["width","left","right"],["height","top","bottom"]];function oD(r,e,t,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;e.eachChild(function(l,u){var c=l.getBoundingRect(),f=e.childAt(u+1),h=f&&f.getBoundingRect(),p,d;if(r==="horizontal"){var g=c.width+(h?-h.x+c.x:0);p=a+g,p>i||l.newline?(a=0,p=g,o+=s+t,s=c.height):s=Math.max(s,c.height)}else{var m=c.height+(h?-h.y+c.y:0);d=o+m,d>n||l.newline?(a+=s+t,o=0,d=m,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=p+t:o=d+t)})}var Xs=oD,SVe=ot(oD,"vertical"),MVe=ot(oD,"horizontal");function x5(r,e,t){var i=e.width,n=e.height,a=ze(r.left,i),o=ze(r.top,n),s=ze(r.right,i),l=ze(r.bottom,n);return(isNaN(a)||isNaN(parseFloat(r.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(r.right)))&&(s=i),(isNaN(o)||isNaN(parseFloat(r.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(r.bottom)))&&(l=n),t=Hs(t||0),{width:Math.max(s-a-t[1]-t[3],0),height:Math.max(l-o-t[0]-t[2],0)}}function xr(r,e,t){t=Hs(t||0);var i=e.width,n=e.height,a=ze(r.left,i),o=ze(r.top,n),s=ze(r.right,i),l=ze(r.bottom,n),u=ze(r.width,i),c=ze(r.height,n),f=t[2]+t[0],h=t[1]+t[3],p=r.aspect;switch(isNaN(u)&&(u=i-s-h-a),isNaN(c)&&(c=n-l-f-o),p!=null&&(isNaN(u)&&isNaN(c)&&(p>i/n?u=i*.8:c=n*.8),isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),isNaN(a)&&(a=i-s-u-h),isNaN(o)&&(o=n-l-c-f),r.left||r.right){case"center":a=i/2-u/2-t[3];break;case"right":a=i-u-h;break}switch(r.top||r.bottom){case"middle":case"center":o=n/2-c/2-t[0];break;case"bottom":o=n-c-f;break}a=a||0,o=o||0,isNaN(u)&&(u=i-h-a-(s||0)),isNaN(c)&&(c=n-f-o-(l||0));var d=new lt(a+t[3],o+t[0],u,c);return d.margin=t,d}function Cf(r,e,t,i,n,a){var o=!n||!n.hv||n.hv[0],s=!n||!n.hv||n.hv[1],l=n&&n.boundingMode||"all";if(a=a||r,a.x=r.x,a.y=r.y,!o&&!s)return!1;var u;if(l==="raw")u=r.type==="group"?new lt(0,0,+e.width||0,+e.height||0):r.getBoundingRect();else if(u=r.getBoundingRect(),r.needLocalTransform()){var c=r.getLocalTransform();u=u.clone(),u.applyTransform(c)}var f=xr(Ye({width:u.width,height:u.height},e),t,i),h=o?f.x-u.x:0,p=s?f.y-u.y:0;return l==="raw"?(a.x=h,a.y=p):(a.x+=h,a.y+=p),a===r&&r.markRedraw(),!0}function S5(r,e){return r[Hp[e][0]]!=null||r[Hp[e][1]]!=null&&r[Hp[e][2]]!=null}function Rf(r){var e=r.layoutMode||r.constructor.layoutMode;return qe(e)?e:e?{type:e}:null}function Va(r,e,t){var i=t&&t.ignoreSize;!pe(i)&&(i=[i,i]);var n=o(Hp[0],0),a=o(Hp[1],1);u(Hp[0],r,n),u(Hp[1],r,a);function o(c,f){var h={},p=0,d={},g=0,m=2;if(Lw(c,function(y){d[y]=r[y]}),Lw(c,function(y){s(e,y)&&(h[y]=d[y]=e[y]),l(h,y)&&p++,l(d,y)&&g++}),i[f])return l(e,c[1])?d[c[2]]=null:l(e,c[2])&&(d[c[1]]=null),d;if(g===m||!p)return d;if(p>=m)return h;for(var v=0;v=0;l--)s=_t(s,n[l],!0);i.defaultOption=s}return i.defaultOption},e.prototype.getReferringComponents=function(t,i){var n=t+"Index",a=t+"Id";return _f(this.ecModel,t,{index:this.get(n,!0),id:this.get(a,!0)},i)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(Zt);Yb(uv,Zt);xf(uv);a5(uv);o5(uv,ife);function ife(r){var e=[];return N(uv.getClassesByMainType(r),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=de(e,function(t){return Oa(t).main}),r!=="dataset"&&dt(e,"dataset")<=0&&e.unshift("dataset"),e}var Pt=uv;var M5="";typeof navigator<"u"&&(M5=navigator.platform||"");var cv="rgba(0, 0, 0, 0.2)",b5={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:cv,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:cv,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:cv,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:cv,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:cv,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:cv,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:M5.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var Pw=ke(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),fn="original",Ei="arrayRows",En="objectRows",xo="keyedColumns",So="typedArray",lD="unknown",Ga="column",Iu="row";var Ji={Must:1,Might:2,Not:3},w5=vt();function T5(r){w5(r).datasetMap=ke()}function Dw(r,e,t){var i={},n=Iw(e);if(!n||!r)return i;var a=[],o=[],s=e.ecModel,l=w5(s).datasetMap,u=n.uid+"_"+t.seriesLayoutBy,c,f;r=r.slice(),N(r,function(g,m){var v=qe(g)?g:r[m]={name:g};v.type==="ordinal"&&c==null&&(c=m,f=d(v)),i[v.name]=[]});var h=l.get(u)||l.set(u,{categoryWayDim:f,valueWayDim:0});N(r,function(g,m){var v=g.name,_=d(g);if(c==null){var y=h.valueWayDim;p(i[v],y,_),p(o,y,_),h.valueWayDim+=_}else if(c===m)p(i[v],0,_),p(a,0,_);else{var y=h.categoryWayDim;p(i[v],y,_),p(o,y,_),h.categoryWayDim+=_}});function p(g,m,v){for(var _=0;_e)return r[i];return r[t-1]}function P5(r,e,t,i,n,a,o){a=a||r;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var c=o==null||!i?t:afe(i,o);if(c=c||t,!(!c||!c.length)){var f=c[l];return n&&(u[n]=f),s.paletteIdx=(l+1)%c.length,f}}function ofe(r,e){e(r).paletteIdx=0,e(r).paletteNameMap={}}var Uw,I_,D5,I5="\0_ec_inner",sfe=1;var z5=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Zt(a),this._locale=new Zt(o),this._optionManager=s},e.prototype.setOption=function(t,i,n){var a=O5(i);this._optionManager.setOption(t,n,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,i){return this._resetOption(t,O5(i))},e.prototype._resetOption=function(t,i){var n=!1,a=this._optionManager;if(!t||t==="recreate"){var o=a.mountOption(t==="recreate");!this.option||t==="recreate"?D5(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&N(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=ke(),u=i&&i.replaceMergeMainTypeMap;T5(this),N(t,function(f,h){f!=null&&(Pt.hasClass(h)?h&&(s.push(h),l.set(h,!0)):n[h]=n[h]==null?Qe(f):_t(n[h],f,!0))}),u&&u.each(function(f,h){Pt.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Pt.topologicalTravel(s,Pt.getAllClassMainTypes(),c,this);function c(f){var h=R5(this,f,$t(t[f])),p=a.get(f),d=p?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",g=Wb(p,h,d);lH(g,f,Pt),n[f]=null,a.set(f,null),o.set(f,0);var m=[],v=[],_=0,y,x;N(g,function(M,S){var w=M.existing,T=M.newOption;if(!T)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var C=f==="series",b=Pt.getClass(f,M.keyInfo.subType,!C);if(!b){if(0)var E,I;return}if(f==="tooltip"){if(y)return;y=!0}if(w&&w.constructor===b)w.name=M.keyInfo.name,w.mergeOption(T,this),w.optionUpdated(T,!1);else{var R=fe({componentIndex:S},M.keyInfo);w=new b(T,this,this,R),fe(w,R),M.brandNew&&(w.__requireNewView=!0),w.init(T,this,this),w.optionUpdated(null,!0)}}w?(m.push(w.option),v.push(w),_++):(m.push(void 0),v.push(void 0))},this),n[f]=m,a.set(f,v),o.set(f,_),f==="series"&&Uw(this)}this._seriesIndices||Uw(this)},e.prototype.getOption=function(){var t=Qe(this.option);return N(t,function(i,n){if(Pt.hasClass(n)){for(var a=$t(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Hm(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,t[n]=a}}),delete t[I5],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,i){var n=this._componentsMap.get(t);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o=e:t==="max"?r<=e:r===e}function yfe(r,e){return r.join(",")===e.join(",")}var F5=dfe;var Ys=N,U_=qe,B5=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function fD(r){var e=r&&r.itemStyle;if(e)for(var t=0,i=B5.length;t=0;m--){var v=r[m];if(s||(d=v.data.rawIndexOf(v.stackedByDimension,p)),d>=0){var _=v.data.getByRawIndex(v.stackResultDimension,d);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&h>=0&&_>0||l==="samesign"&&h<=0&&_<0){h=$G(h,_),g=_;break}}}return i[0]=h,i[1]=g,i})})}var Bw=function(){function r(e){this.data=e.data||(e.sourceFormat===xo?{}:[]),this.sourceFormat=e.sourceFormat||lD,this.seriesLayoutBy=e.seriesLayoutBy||Ga,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var i=0;ig&&(g=y)}p[0]=d,p[1]=g}},n=function(){return this._data?this._data.length/this._dimSize:0};Z5=(e={},e[Ei+"_"+Ga]={pure:!0,appendData:a},e[Ei+"_"+Iu]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[En]={pure:!0,appendData:a},e[xo]={pure:!0,appendData:function(o){var s=this._data;N(o,function(l,u){for(var c=s[u]||(s[u]=[]),f=0;f<(l||[]).length;f++)c.push(l[f])})}},e[fn]={appendData:a},e[So]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(g=o.interpolatedValue[m])}return g!=null?g+"":""})}},r.prototype.getRawValue=function(e,t){return Ou(this.getData(t),e)},r.prototype.formatTooltip=function(e,t,i){},r}();function SD(r){var e,t;return qe(r)?r.type&&(t=r):e=r,{text:e,frag:t}}function Lf(r){return new Dfe(r)}var Dfe=function(){function r(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return r.prototype.perform=function(e){var t=this._upstream,i=e&&e.skip;if(this._dirty&&t){var n=this.context;n.data=n.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(_){return!(_>=1)&&(_=1),_}var f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(i)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(t?this._dueEnd=t._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,d=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!i&&(f||p1&&i>0?s:o}};return a;function o(){return e=r?null:le},gte:function(r,e){return r>=e}},Nfe=function(){function r(e,t){if(!Ct(t)){var i="";ur(i)}this._opFn=Q5[e],this._rvalFloat=Na(t)}return r.prototype.evaluate=function(e){return Ct(e)?this._opFn(e,this._rvalFloat):this._opFn(Na(e),this._rvalFloat)},r}(),Hw=function(){function r(e,t){var i=e==="desc";this._resultLT=i?1:-1,t==null&&(t=i?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return r.prototype.evaluate=function(e,t){var i=Ct(e)?e:Na(e),n=Ct(t)?t:Na(t),a=isNaN(i),o=isNaN(n);if(a&&(i=this._incomparable),o&&(n=this._incomparable),a&&o){var s=Ce(e),l=Ce(t);s&&(i=l?e:0),l&&(n=s?t:0)}return in?-this._resultLT:0},r}();var Ufe=function(){function r(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Na(t)}return r.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var i=typeof e;i!==this._rvalTypeof&&(i==="number"||this._rvalTypeof==="number")&&(t=Na(e)===this._rvalFloat)}return this._isEQ?t:!t},r}();function eW(r,e){return r==="eq"||r==="ne"?new Ufe(r==="eq",e):tt(Q5,r)?new Nfe(r,e):null}var Ofe=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(e){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(e){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(e,t){},r.prototype.retrieveValueFromItem=function(e,t){},r.prototype.convertValue=function(e,t){return as(e,t)},r}();function zfe(r,e){var t=new Ofe,i=r.data,n=t.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==Ga&&ur(o);var s=[],l={},u=r.dimensionsDefine;if(u)N(u,function(g,m){var v=g.name,_={index:m,name:v,displayName:g.displayName};if(s.push(_),v!=null){var y="";tt(l,v)&&ur(y),l[v]=_}});else for(var c=0;c65535?Hfe:Wfe}function mv(){return[1/0,-1/0]}function Xfe(r){var e=r.constructor;return e===Array?r.slice():new e(r)}function aW(r,e,t,i,n){var a=oW[t||"float"];if(n){var o=r[e],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;um[1]&&(m[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(e,t,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=de(o,function(_){return _.property}),c=0;cv[1]&&(v[1]=m)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=t,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(i!=null&&ie)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(e,t,i){var n=this._chunks,a=n[e],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,c=0,f=this.count();c=0&&l<0)&&(s=d,l=p,u=0),p===l&&(o[u++]=c))}return o.length=u,o},r.prototype.getIndices=function(){var e,t=this._indices;if(t){var i=t.constructor,n=this._count;if(i===Array){e=new i(n);for(var a=0;a=f&&_<=h||isNaN(_))&&(l[u++]=g),g++}d=!0}else if(a===2){for(var m=p[n[0]],y=p[n[1]],x=e[n[1]][0],M=e[n[1]][1],v=0;v=f&&_<=h||isNaN(_))&&(S>=x&&S<=M||isNaN(S))&&(l[u++]=g),g++}d=!0}}if(!d)if(a===1)for(var v=0;v=f&&_<=h||isNaN(_))&&(l[u++]=w)}else for(var v=0;ve[b][1])&&(T=!1)}T&&(l[u++]=t.getRawIndex(v))}return uv[1]&&(v[1]=m)}}}},r.prototype.lttbDownSample=function(e,t){var i=this.clone([e],!0),n=i._chunks,a=n[e],o=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),c,f,h,p=new(F_(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));p[s++]=u;for(var d=1;dc&&(c=f,h=x)}E>0&&Ec-d&&(l=c-d,s.length=l);for(var g=0;gf[1]&&(f[1]=v),h[p++]=_}return a._count=p,a._indices=h,a._updateGetRawIdx(),a},r.prototype.each=function(e,t){if(this._count)for(var i=e.length,n=this._chunks,a=0,o=this.count();al&&(l=f)}return o=[s,l],this._extent[e]=o,o},r.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var i=[],n=this._chunks,a=0;a=0?this._indices[e]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function e(t,i,n,a){return as(t[a],this._dimensions[a])}bD={arrayRows:e,objectRows:function(t,i,n,a){return as(t[i],this._dimensions[a])},keyedColumns:e,original:function(t,i,n,a){var o=t&&(t.value==null?t:t.value);return as(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(t,i,n,a){return t[a]}}}(),r}(),B_=Yfe;var Yw=function(){function r(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),i=!!t.length,n,a;if(Xw(e)){var o=e,s=void 0,l=void 0,u=void 0;if(i){var c=t[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=bi(s)?So:fn,a=[];var f=this._getSourceMetaRawOption()||{},h=u&&u.metaRawOption||{},p=ft(f.seriesLayoutBy,h.seriesLayoutBy)||null,d=ft(f.sourceHeader,h.sourceHeader),g=ft(f.dimensions,h.dimensions),m=p!==h.seriesLayoutBy||!!d!=!!h.sourceHeader||g;n=m?[z_(s,{seriesLayoutBy:p,sourceHeader:d,dimensions:g},l)]:[]}else{var v=e;if(i){var _=this._applyTransform(t);n=_.sourceList,a=_.upstreamSignList}else{var y=v.get("source",!0);n=[z_(y,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},r.prototype._applyTransform=function(e){var t=this._sourceHost,i=t.get("transform",!0),n=t.get("fromTransformResult",!0);if(n!=null){var a="";e.length!==1&&sW(a)}var o,s=[],l=[];return N(e,function(u){u.prepareSource();var c=u.getSource(n||0),f="";n!=null&&!c&&sW(f),s.push(c),l.push(u._getVersionSign())}),i?o=iW(i,s,{datasetIndex:t.componentIndex}):n!=null&&(o=[q5(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||t>0&&!r.noHeader;return N(r.blocks,function(n){var a=fW(n);a>=e&&(e=a+ +(i&&(!a||wD(n)&&!n.noHeader)))}),e}return 0}function qfe(r,e,t,i){var n=e.noHeader,a=jfe(fW(e)),o=[],s=e.blocks||[];kr(!s||pe(s)),s=s||[];var l=r.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(tt(u,l)){var c=new Vw(u[l],null);s.sort(function(d,g){return c.evaluate(d.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}N(s,function(d,g){var m=e.valueFormatter,v=cW(d)(m?fe(fe({},r),{valueFormatter:m}):r,d,g>0?a.html:0,i);v!=null&&o.push(v)});var f=r.renderMode==="richText"?o.join(a.richText):TD(o.join(""),n?t:a.html);if(n)return f;var h=Ew(e.header,"ordinal",r.useUTC),p=uW(i,r.renderMode).nameStyle;return r.renderMode==="richText"?hW(r,h,p)+a.richText+f:TD('
'+yn(h)+"
"+f,t)}function Zfe(r,e,t,i){var n=r.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=r.useUTC,c=e.valueFormatter||r.valueFormatter||function(x){return x=pe(x)?x:[x],de(x,function(M,S){return Ew(M,pe(p)?p[S]:p,u)})};if(!(a&&o)){var f=s?"":r.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",n),h=a?"":Ew(l,"ordinal",u),p=e.valueType,d=o?[]:c(e.value,e.dataIndex),g=!s||!a,m=!s&&a,v=uW(i,n),_=v.nameStyle,y=v.valueStyle;return n==="richText"?(s?"":f)+(a?"":hW(r,h,_))+(o?"":$fe(r,d,g,m,y)):TD((s?"":f)+(a?"":Kfe(h,!s,_))+(o?"":Jfe(d,g,m,y)),t)}}function ED(r,e,t,i,n,a){if(r){var o=cW(r),s={useUTC:n,renderMode:t,orderMode:i,markupStyleCreator:e,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function jfe(r){return{html:Xfe[r],richText:Yfe[r]}}function TD(r,e){var t='
',i="margin: "+e+"px 0 0";return'
'+r+t+"
"}function Kfe(r,e,t){var i=e?"margin-left:2px":"";return''+yn(r)+""}function Jfe(r,e,t,i){var n=t?"10px":"20px",a=e?"float:right;margin-left:"+n:"";return r=pe(r)?r:[r],''+de(r,function(o){return yn(o)}).join("  ")+""}function hW(r,e,t){return r.markupStyleCreator.wrapRichTextStyle(e,t)}function $fe(r,e,t,i,n){var a=[n],o=i?10:20;return t&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(pe(e)?e.join(" "):e,a)}function Xw(r,e){var t=r.getData().getItemVisual(e,"style"),i=t[r.visualDrawType];return Hs(i)}function Yw(r,e){var t=r.get("padding");return t??(e==="richText"?[8,10]:10)}var qw=function(){function r(){this.richTextStyles={},this._nextStyleNameId=Vb()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(e,t,i){var n=i==="richText"?this._generateStyleName():null,a=_5({color:t,type:e,renderMode:i,markerId:n});return Ce(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(e,t){var i={};pe(t)?N(t,function(a){return fe(i,a)}):fe(i,t);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+e+"}"},r}();function Zw(r){var e=r.series,t=r.dataIndex,i=r.multipleSeries,n=e.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(t),l=pe(s),u=Xw(e,t),c,f,h,p;if(o>1||l&&!o){var d=Qfe(s,e,t,a,u);c=d.inlineValues,f=d.inlineValueTypes,h=d.blocks,p=d.inlineValues[0]}else if(o){var g=n.getDimensionInfo(a[0]);p=c=Fu(n,t,a[0]),f=g.type}else p=c=l?s[0]:s;var m=Gm(e),v=m&&e.name||"",_=n.getName(t),y=i?v:_;return Or("section",{header:v,noHeader:i||!m,sortParam:p,blocks:[Or("nameValue",{markerType:"item",markerColor:u,name:y,noName:!Yi(y),value:c,valueType:f,dataIndex:t})].concat(h||[])})}function Qfe(r,e,t,i,n){var a=e.getData(),o=gn(r,function(f,h,p){var d=a.getDimensionInfo(p);return f=f||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];i.length?N(i,function(f){c(Fu(a,t,f),f)}):N(r,c);function c(f,h){var p=a.getDimensionInfo(h);!p||p.otherDims.tooltip===!1||(o?u.push(Or("nameValue",{markerType:"subItem",markerColor:n,name:p.displayName,value:f,valueType:p.type})):(s.push(f),l.push(p.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Rf=vt();function jw(r,e){return r.getName(e)||r.getId(e)}var B_="__universalTransitionEnabled",Kw=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Cf({count:the,reset:rhe}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n);var a=Rf(this).sourceManager=new Ww(this);a.prepareSource();var o=this.getInitialData(t,n);dW(o,this),this.dataTask.context.data=o,Rf(this).dataBeforeProcessed=o,pW(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(t,i){var n=Af(this),a=n?rs(t):{},o=this.subType;Pt.hasClass(o)&&(o+="Series"),_t(t,i.getTheme().get(this.subType)),_t(t,this.getDefaultOption()),yo(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&za(t,a,n)},e.prototype.mergeOption=function(t,i){t=_t(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Af(this);n&&za(this.option,t,n);var a=Rf(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(t,i);dW(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Rf(this).dataBeforeProcessed=o,pW(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){if(t&&!bi(t))for(var i=["show"],n=0;nthis.getShallow("animationThreshold")&&(i=!1),!!i},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,i,n){var a=this.ecModel,o=L_.prototype.getColorFromPalette.call(this,t,i,n);return o||(o=a.getColorFromPalette(t,i,n)),o},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,i){this._innerSelect(this.getData(i),t)},e.prototype.unselect=function(t,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&n.push(o)}return n},e.prototype.isSelected=function(t,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[jw(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[B_])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){qe(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(t,i)}},e.registerClass=function(t){return Pt.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Pt);wr(Kw,hv);wr(Kw,L_);Wb(Kw,Pt);function pW(r){var e=r.name;Gm(r)||(r.name=ehe(r)||e)}function ehe(r){var e=r.getRawData(),t=e.mapDimensionsAll("seriesName"),i=[];return N(t,function(n){var a=e.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function the(r){return r.model.getRawData().count()}function rhe(r){var e=r.model;return e.setData(e.getRawData().cloneShallow()),ihe}function ihe(r,e){e.outputData&&r.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function dW(r,e){N(ep(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(t){r.wrapMethod(t,ot(nhe,e))})}function nhe(r,e){var t=AD(r);return t&&t.setOutputEnd((e||this).count()),e}function AD(r){var e=(r.ecModel||{}).scheduler,t=e&&e.getPipeline(r.uid);if(t){var i=t.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(r.uid))}return i}}var jt=Kw;var CD=function(){function r(){this.group=new Ze,this.uid=ts("viewComponent")}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,i,n){},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,i,n){},r.prototype.updateLayout=function(e,t,i,n){},r.prototype.updateVisual=function(e,t,i,n){},r.prototype.toggleBlurSeries=function(e,t,i){},r.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},r}();Hm(CD);yf(CD);var Qt=CD;function Mo(){var r=vt();return function(e){var t=r(e),i=e.pipelineContext,n=!!t.large,a=!!t.progressiveRender,o=t.large=!!(i&&i.large),s=t.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var gW=vt(),ahe=Mo(),RD=function(){function r(){this.group=new Ze,this.uid=ts("viewChart"),this.renderTask=Cf({plan:ohe,reset:she}),this.renderTask.context={view:this}}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,i,n){},r.prototype.highlight=function(e,t,i,n){var a=e.getData(n&&n.dataType);a&&vW(a,n,"emphasis")},r.prototype.downplay=function(e,t,i,n){var a=e.getData(n&&n.dataType);a&&vW(a,n,"normal")},r.prototype.remove=function(e,t){this.group.removeAll()},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.updateLayout=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.updateVisual=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.eachRendered=function(e){sa(this.group,e)},r.markUpdateMethod=function(e,t){gW(e).updateMethod=t},r.protoInitialize=function(){var e=r.prototype;e.type="chart"}(),r}();function mW(r,e,t){r&&Tf(r)&&(e==="emphasis"?Bn:kn)(r,t)}function vW(r,e,t){var i=Jo(r,e),n=e&&e.highlightKey!=null?g4(e.highlightKey):null;i!=null?N(Jt(i),function(a){mW(r.getItemGraphicEl(a),t,n)}):r.eachItemGraphicEl(function(a){mW(a,t,n)})}Hm(RD,["dispose"]);yf(RD);function ohe(r){return ahe(r.model)}function she(r){var e=r.model,t=r.ecModel,i=r.api,n=r.payload,a=e.pipelineContext.progressiveRender,o=r.view,s=n&&gW(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,t,i,n),lhe[l]}var lhe={incrementalPrepareRender:{progress:function(r,e){e.view.incrementalRender(r,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(r,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Yt=RD;var Jw="\0__throttleOriginMethod",yW="\0__throttleRate",_W="\0__throttleType";function k_(r,e,t){var i,n=0,a=0,o=null,s,l,u,c;e=e||0;function f(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var h=function(){for(var p=[],d=0;d=0?f():o=setTimeout(f,-s),n=i};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(p){c=p},h}function as(r,e,t,i){var n=r[e];if(n){var a=n[Jw]||n,o=n[_W],s=n[yW];if(s!==t||o!==i){if(t==null||!i)return r[e]=a;n=r[e]=k_(a,t,i==="debounce"),n[Jw]=a,n[_W]=i,n[yW]=t}return n}}function zu(r,e){var t=r[e];t&&t[Jw]&&(t.clear&&t.clear(),r[e]=t[Jw])}var xW=vt(),SW={itemStyle:Na(kP,!0),lineStyle:Na(BP,!0)},uhe={lineStyle:"stroke",itemStyle:"fill"};function MW(r,e){var t=r.visualStyleMapper||SW[e];return t||(console.warn("Unknown style type '"+e+"'."),SW.itemStyle)}function bW(r,e){var t=r.visualDrawType||uhe[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var wW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=r.getModel(i),a=MW(r,i),o=a(n),s=n.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=bW(r,i),u=o[l],c=He(u)?u:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||f){var h=r.getColorFromPalette(r.name,null,e.getSeriesCount());o[l]||(o[l]=h,t.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||He(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||He(o.stroke)?h:o.stroke}if(t.setVisual("style",o),t.setVisual("drawType",l),!e.isSeriesFiltered(r)&&c)return t.setVisual("colorFromPalette",!1),{dataEach:function(p,d){var g=r.getDataParams(d),m=fe({},o);m[l]=c(g),p.setItemVisual(d,"style",m)}}}},V_=new Zt,TW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){if(!(r.ignoreStyleOnData||e.isSeriesFiltered(r))){var t=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=MW(r,i),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){V_.option=l[i];var u=n(V_),c=o.ensureUniqueItemVisual(s,"style");fe(c,u),V_.option.decal&&(o.setItemVisual(s,"decal",V_.option.decal),V_.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},EW={performRawSeries:!0,overallReset:function(r){var e=ke();r.eachSeries(function(t){var i=t.getColorBy();if(!t.isColorBySeries()){var n=t.type+"-"+i,a=e.get(n);a||(a={},e.set(n,a)),xW(t).scope=a}}),r.eachSeries(function(t){if(!(t.isColorBySeries()||r.isSeriesFiltered(t))){var i=t.getRawData(),n={},a=t.getData(),o=xW(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=bW(t,s);a.each(function(u){var c=a.getRawIndex(u);n[c]=u}),i.each(function(u){var c=n[u],f=a.getItemVisual(c,"colorFromPalette");if(f){var h=a.ensureUniqueItemVisual(c,"style"),p=i.getName(u)||u+"",d=i.count();h[l]=t.getColorFromPalette(p,o,d)}})}})}};var Qw=Math.PI;function LD(r,e){e=e||{},Ye(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var t=new Ze,i=new Tt({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(i);var n=new Lt({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Tt({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var o;return e.showSpinner&&(o=new __({shape:{startAngle:-Qw/2,endAngle:-Qw/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Qw*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Qw*3/2}).delay(300).start("circularInOut"),t.add(o)),t.resize=function(){var s=n.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(r.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),c=r.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},t.resize(),t}var che=function(){function r(e,t,i,n){this._stageTaskMap=ke(),this.ecInstance=e,this.api=t,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return r.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},r.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,a=!t&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},r.prototype.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),n=e.getData(),a=n.count(),o=i.progressiveEnabled&&t.incrementalPrepareRender&&a>=i.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(e){var t=this,i=t._pipelineMap=ke();e.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),t._pipe(n,n.dataTask)})},r.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),i=this.api;N(this._allHandlers,function(n){var a=e.get(n.uid)||e.set(n.uid,{}),o="";kr(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,t,i),n.overallReset&&this._createOverallStageTask(n,a,t,i)},this)},r.prototype.prepareView=function(e,t,i,n){var a=e.renderTask,o=a.context;o.model=t,o.ecModel=i,o.api=n,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},r.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},r.prototype.performVisualTasks=function(e,t,i){this._performStageTasks(this._visualHandlers,e,t,i)},r.prototype._performStageTasks=function(e,t,i,n){n=n||{};var a=!1,o=this;N(e,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),f=c.seriesTaskMap,h=c.overallTask;if(h){var p,d=h.agentStubMap;d.each(function(m){s(n,m)&&(m.dirty(),p=!0)}),p&&h.dirty(),o.updatePayload(h,i);var g=o.getPerformArgs(h,n.block);d.each(function(m){m.perform(g)}),h.perform(g)&&(a=!0)}else f&&f.each(function(m,v){s(n,m)&&m.dirty();var _=o.getPerformArgs(m,n.block);_.skip=!l.performRawSeries&&t.isSeriesFiltered(m.context.model),o.updatePayload(m,i),m.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(i){t=i.dataTask.perform()||t}),this.unfinished=t||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},r.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},r.prototype._createSeriesStageTask=function(e,t,i,n){var a=this,o=t.seriesTaskMap,s=t.seriesTaskMap=ke(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?i.eachRawSeries(c):l?i.eachRawSeriesByType(l,c):u&&u(i,n).each(c);function c(f){var h=f.uid,p=s.set(h,o&&o.get(h)||Cf({plan:mhe,reset:vhe,count:yhe}));p.context={model:f,ecModel:i,api:n,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(f,p)}},r.prototype._createOverallStageTask=function(e,t,i,n){var a=this,o=t.overallTask=t.overallTask||Cf({reset:fhe});o.context={ecModel:i,api:n,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=ke(),u=e.seriesType,c=e.getTargetSeries,f=!0,h=!1,p="";kr(!e.createOnAllSeries,p),u?i.eachRawSeriesByType(u,d):c?c(i,n).each(d):(f=!1,N(i.getSeries(),d));function d(g){var m=g.uid,v=l.set(m,s&&s.get(m)||(h=!0,Cf({reset:hhe,onDirty:dhe})));v.context={model:g,overallProgress:f},v.agent=o,v.__block=f,a._pipe(g,v)}h&&o.dirty()},r.prototype._pipe=function(e,t){var i=e.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=t),n.tail&&n.tail.pipe(t),n.tail=t,t.__idxInPipeline=n.count++,t.__pipeline=n},r.wrapStageHandler=function(e,t){return He(e)&&(e={overallReset:e,seriesType:_he(e)}),e.uid=ts("stageHandler"),t&&(e.visualType=t),e},r}();function fhe(r){r.overallReset(r.ecModel,r.api,r.payload)}function hhe(r){return r.overallProgress&&phe}function phe(){this.agent.dirty(),this.getDownstream().dirty()}function dhe(){this.agent&&this.agent.dirty()}function mhe(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function vhe(r){r.useClearVisual&&r.data.clearAllVisual();var e=r.resetDefines=Jt(r.reset(r.model,r.ecModel,r.api,r.payload));return e.length>1?de(e,function(t,i){return AW(i)}):ghe}var ghe=AW(0);function AW(r){return function(e,t){var i=t.data,n=t.resetDefines[r];if(n&&n.dataEach)for(var a=e.start;a0&&p===u.length-h.length){var d=u.slice(0,p);d!=="data"&&(t.mainType=d,t[h.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(i[u]=l,c=!0),c||(n[u]=l)})}return{cptQuery:t,dataQuery:i,otherQuery:n}},r.prototype.filter=function(e,t){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,n,a));function c(f,h,p,d){return f[p]==null||h[d||p]===f[p]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}();var DD=["symbol","symbolSize","symbolRotate","symbolOffset"],FW=DD.concat(["symbolKeepAspect"]),zW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData();if(r.legendIcon&&t.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o=0&&Xp(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function X_(r,e,t){for(var i=e.type==="radial"?Dhe(r,e,t):Phe(r,e,t),n=e.colorStops,a=0;a0)?null:r==="dashed"?[4*e,2*e]:r==="dotted"?[e]:At(r)?[r]:pe(r)?r:null}function Y_(r){var e=r.style,t=e.lineDash&&e.lineWidth>0&&Ihe(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(t){var n=e.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(t=de(t,function(a){return a/n}),i/=n)}return[t,i]}var Nhe=new Ki(!0);function n1(r){var e=r.stroke;return!(e==null||e==="none"||!(r.lineWidth>0))}function WW(r){return typeof r=="string"&&r!=="none"}function a1(r){var e=r.fill;return e!=null&&e!=="none"}function XW(r,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.fillOpacity*e.opacity,r.fill(),r.globalAlpha=t}else r.fill()}function YW(r,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.strokeOpacity*e.opacity,r.stroke(),r.globalAlpha=t}else r.stroke()}function o1(r,e,t){var i=o_(e.image,e.__image,t);if(Wm(i)){var n=r.createPattern(i,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*bm),a.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(a)}return n}}function Uhe(r,e,t,i){var n,a=n1(t),o=a1(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var c=e.path||Nhe,f=e.__dirty;if(!i){var h=t.fill,p=t.stroke,d=o&&!!h.colorStops,g=a&&!!p.colorStops,m=o&&!!h.image,v=a&&!!p.image,_=void 0,y=void 0,x=void 0,M=void 0,S=void 0;(d||g)&&(S=e.getBoundingRect()),d&&(_=f?X_(r,h,S):e.__canvasFillGradient,e.__canvasFillGradient=_),g&&(y=f?X_(r,p,S):e.__canvasStrokeGradient,e.__canvasStrokeGradient=y),m&&(x=f||!e.__canvasFillPattern?o1(r,h,e):e.__canvasFillPattern,e.__canvasFillPattern=x),v&&(M=f||!e.__canvasStrokePattern?o1(r,p,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),d?r.fillStyle=_:m&&(x?r.fillStyle=x:o=!1),g?r.strokeStyle=y:v&&(M?r.strokeStyle=M:a=!1)}var w=e.getGlobalScale();c.setScale(w[0],w[1],e.segmentIgnoreThreshold);var T,C;r.setLineDash&&t.lineDash&&(n=Y_(e),T=n[0],C=n[1]);var b=!0;(u||f&cf)&&(c.setDPR(r.dpr),l?c.setContext(null):(c.setContext(r),b=!1),c.reset(),e.buildPath(c,e.shape,i),c.toStatic(),e.pathUpdated()),b&&c.rebuildPath(r,l?s:1),T&&(r.setLineDash(T),r.lineDashOffset=C),i||(t.strokeFirst?(a&&YW(r,t),o&&XW(r,t)):(o&&XW(r,t),a&&YW(r,t))),T&&r.setLineDash([])}function Ohe(r,e,t){var i=e.__image=o_(t.image,e.__image,e,e.onload);if(!(!i||!Wm(i))){var n=t.x||0,a=t.y||0,o=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),t.sWidth&&t.sHeight){var u=t.sx||0,c=t.sy||0;r.drawImage(i,u,c,t.sWidth,t.sHeight,n,a,o,s)}else if(t.sx&&t.sy){var u=t.sx,c=t.sy,f=o-u,h=s-c;r.drawImage(i,u,c,f,h,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function Fhe(r,e,t){var i,n=t.text;if(n!=null&&(n+=""),n){r.font=t.font||ho,r.textAlign=t.textAlign,r.textBaseline=t.textBaseline;var a=void 0,o=void 0;r.setLineDash&&t.lineDash&&(i=Y_(e),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),t.strokeFirst?(n1(t)&&r.strokeText(n,t.x,t.y),a1(t)&&r.fillText(n,t.x,t.y)):(a1(t)&&r.fillText(n,t.x,t.y),n1(t)&&r.strokeText(n,t.x,t.y)),a&&r.setLineDash([])}}var qW=["shadowBlur","shadowOffsetX","shadowOffsetY"],ZW=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function e6(r,e,t,i,n){var a=!1;if(!i&&(t=t||{},e===t))return!1;if(i||e.opacity!==t.opacity){ka(r,n),a=!0;var o=Math.max(Math.min(e.opacity,1),0);r.globalAlpha=isNaN(o)?Pl.opacity:o}(i||e.blend!==t.blend)&&(a||(ka(r,n),a=!0),r.globalCompositeOperation=e.blend||Pl.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,i,n){if(!this[Xn]){if(this._disposed){this.id;return}var a,o,s;if(qe(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[Xn]=!0,!this._model||i){var l=new z5(this._api),u=this._theme,c=this._model=new Nw;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:o},WD);var f={seriesTransition:s,optionChanged:!0};if(n)this[Va]={silent:a,updateParams:f},this[Xn]=!1,this.getZr().wakeUp();else{try{mv(this),Df.update.call(this,null,f)}catch(h){throw this[Va]=null,this[Xn]=!1,h}this._ssr||this._zr.flush(),this[Va]=null,this[Xn]=!1,Z_.call(this,a),j_.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Ft.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var i=this._zr.painter;return i.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(Ft.svgSupported){var t=this._zr,i=t.storage.getDisplayList();return N(i,function(n){n.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var i=t.excludeComponents,n=this._model,a=[],o=this;N(i,function(l){n.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return N(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var i=t.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(g6[n]){var l=s,u=s,c=-s,f=-s,h=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();N(J_,function(y,x){if(y.group===n){var M=i?y.getZr().painter.getSvgDom().innerHTML:y.renderToCanvas(Qe(t)),S=y.getDom().getBoundingClientRect();l=a(S.left,l),u=a(S.top,u),c=o(S.right,c),f=o(S.bottom,f),h.push({dom:M,left:S.left,top:S.top})}}),l*=p,u*=p,c*=p,f*=p;var d=c-l,g=f-u,m=zn.createCanvas(),v=YL(m,{renderer:i?"svg":"canvas"});if(v.resize({width:d,height:g}),i){var _="";return N(h,function(y){var x=y.left-l,M=y.top-u;_+=''+y.dom+""}),v.painter.getSvgRoot().innerHTML=_,t.connectedBackgroundColor&&v.painter.setBackgroundColor(t.connectedBackgroundColor),v.refreshImmediately(),v.painter.toDataURL()}else return t.connectedBackgroundColor&&v.add(new Tt({shape:{x:0,y:0,width:d,height:g},style:{fill:t.connectedBackgroundColor}})),N(h,function(y){var x=new Ur({style:{x:y.left*p-l,y:y.top*p-u,image:y.dom}});v.add(x)}),v.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,i){return BD(this,"convertToPixel",t,i)},e.prototype.convertFromPixel=function(t,i){return BD(this,"convertFromPixel",t,i)},e.prototype.containPixel=function(t,i){if(this._disposed){this.id;return}var n=this._model,a,o=vf(n,t);return N(o,function(s,l){l.indexOf("Models")>=0&&N(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(i);else if(l==="seriesModels"){var f=this._chartsMap[u.__viewId];f&&f.containPoint&&(a=a||f.containPoint(i,u))}},this)},this),!!a},e.prototype.getVisual=function(t,i){var n=this._model,a=vf(n,t,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?H_(s,l,i):kl(s,i)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;N(ape,function(i){var n=function(a){var o=t.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&Ys(s,function(d){var g=rt(d);if(g&&g.dataIndex!=null){var m=g.dataModel||o.getSeriesByIndex(g.seriesIndex);return l=m&&m.getDataParams(g.dataIndex,g.dataType,s)||{},!0}else if(g.eventData)return l=fe({},g.eventData),!0},!0),l){var c=l.componentType,f=l.componentIndex;(c==="markLine"||c==="markPoint"||c==="markArea")&&(c="series",f=l.seriesIndex);var h=c&&f!=null&&o.getComponent(c,f),p=h&&t[h.mainType==="series"?"_chartsMap":"_componentsMap"][h.__viewId];l.event=a,l.type=i,t._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:h,view:p},t.trigger(i,l)}};n.zrEventfulCallAtLast=!0,t._zr.on(i,n,t)}),N(K_,function(i,n){t._messageCenter.on(n,function(a){this.trigger(n,a)},t)}),N(["selectchanged"],function(i){t._messageCenter.on(i,function(n){this.trigger(i,n)},t)}),kW(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var t=this.getDom();t&&JL(this.getDom(),ZD,"");var i=this,n=i._api,a=i._model;N(i._componentsViews,function(o){o.dispose(a,n)}),N(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete J_[i.id]},e.prototype.resize=function(t){if(!this[Xn]){if(this._disposed){this.id;return}this._zr.resize(t);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=t&&t.silent;this[Va]&&(a==null&&(a=this[Va].silent),n=!0,this[Va]=null),this[Xn]=!0;try{n&&mv(this),Df.update.call(this,{type:"resize",animation:fe({duration:0},t&&t.animation)})}catch(o){throw this[Xn]=!1,o}this[Xn]=!1,Z_.call(this,a),j_.call(this,a)}}},e.prototype.showLoading=function(t,i){if(this._disposed){this.id;return}if(qe(t)&&(i=t,t=""),t=t||"default",this.hideLoading(),!!XD[t]){var n=XD[t](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var i=fe({},t);return i.type=K_[t.type],i},e.prototype.dispatchAction=function(t,i){if(this._disposed){this.id;return}if(qe(i)||(i={silent:!!i}),!!c1[t.type]&&this._model){if(this[Xn]){this._pendingActions.push(t);return}var n=i.silent;VD.call(this,t,n);var a=i.flush;a?this._zr.flush():a!==!1&&Ft.browser.weChat&&this._throttledZrFlush(),Z_.call(this,n),j_.call(this,n)}},e.prototype.updateLabelLayout=function(){os.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var i=t.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){mv=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),zD(f,!0),zD(f,!1),h.plan()},zD=function(f,h){for(var p=f._model,d=f._scheduler,g=h?f._componentsViews:f._chartsViews,m=h?f._componentsMap:f._chartsMap,v=f._zr,_=f._api,y=0;yh.get("hoverLayerThreshold")&&!Ft.node&&!Ft.worker&&h.eachSeries(function(m){if(!m.preventUsingHoverLayer){var v=f._chartsMap[m.__viewId];v.__alive&&v.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function o(f,h){var p=f.get("blendMode")||null;h.eachRendered(function(d){d.isGroup||(d.style.blend=p)})}function s(f,h){if(!f.preventAutoZ){var p=f.get("z")||0,d=f.get("zlevel")||0;h.eachRendered(function(g){return l(g,p,d,-1/0),!0})}}function l(f,h,p,d){var g=f.getTextContent(),m=f.getTextGuideLine(),v=f.isGroup;if(v)for(var _=f.childrenRef(),y=0;y<_.length;y++)d=Math.max(l(_[y],h,p,d),d);else f.z=h,f.zlevel=p,d=Math.max(f.z2,d);if(g&&(g.z=h,g.zlevel=p,isFinite(d)&&(g.z2=d+2)),m){var x=f.textGuideLineConfig;m.z=h,m.zlevel=p,isFinite(d)&&(m.z2=d+(x&&x.showAbove?1:-1))}return d}function u(f,h){h.eachRendered(function(p){if(!Au(p)){var d=p.getTextContent(),g=p.getTextGuideLine();p.stateTransition&&(p.stateTransition=null),d&&d.stateTransition&&(d.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),p.hasState()?(p.prevStates=p.currentStates,p.clearStates()):p.prevStates&&(p.prevStates=null)}})}function c(f,h){var p=f.getModel("stateAnimation"),d=f.isAnimationEnabled(),g=p.get("duration"),m=g>0?{duration:g,delay:p.get("delay"),easing:p.get("easing")}:null;h.eachRendered(function(v){if(v.states&&v.states.emphasis){if(Au(v))return;if(v instanceof ut&&y4(v),v.__dirty){var _=v.prevStates;_&&v.useStates(_)}if(d){v.stateTransition=m;var y=v.getTextContent(),x=v.getTextGuideLine();y&&(y.stateTransition=m),x&&(x.stateTransition=m)}v.__dirty&&n(v)}})}m6=function(f){return new(function(h){Z(p,h);function p(){return h!==null&&h.apply(this,arguments)||this}return p.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},p.prototype.getComponentByElement=function(d){for(;d;){var g=d.__ecComponentInfo;if(g!=null)return f._model.getComponent(g.mainType,g.index);d=d.parent}},p.prototype.enterEmphasis=function(d,g){Bn(d,g),ss(f)},p.prototype.leaveEmphasis=function(d,g){kn(d,g),ss(f)},p.prototype.enterBlur=function(d){Qb(d),ss(f)},p.prototype.leaveBlur=function(d){d_(d),ss(f)},p.prototype.enterSelect=function(d){MP(d),ss(f)},p.prototype.leaveSelect=function(d){bP(d),ss(f)},p.prototype.getModel=function(){return f.getModel()},p.prototype.getViewOfComponentModel=function(d){return f.getViewOfComponentModel(d)},p.prototype.getViewOfSeriesModel=function(d){return f.getViewOfSeriesModel(d)},p}(Uw))(f)},C6=function(f){function h(p,d){for(var g=0;g=0)){y6.push(t);var a=PD.wrapStageHandler(t,n);a.__prio=e,a.__raw=t,r.push(a)}}function QD(r,e){XD[r]=e}function O6(r,e,t){var i=u6("registerMap");i&&i(r,e,t)}var F6=rW;If(YD,wW);If(h1,TW);If(h1,EW);If(YD,zW);If(h1,BW);If(S6,UD);KD(Ow);JD(Zhe,hD);QD("default",LD);ua({type:wf,event:wf,update:wf},Ir);ua({type:h_,event:h_,update:h_},Ir);ua({type:Zm,event:Zm,update:Zm},Ir);ua({type:p_,event:p_,update:p_},Ir);ua({type:jm,event:jm,update:jm},Ir);P6("light",PW);P6("dark",UW);var z6=[],lpe={registerPreprocessor:KD,registerProcessor:JD,registerPostInit:D6,registerPostUpdate:I6,registerUpdateLifecycle:p1,registerAction:ua,registerCoordinateSystem:N6,registerLayout:U6,registerVisual:If,registerTransform:F6,registerLoading:QD,registerMap:O6,registerImpl:l6,PRIORITY:M6,ComponentModel:Pt,ComponentView:Qt,SeriesModel:jt,ChartView:Yt,registerComponentModel:function(r){Pt.registerClass(r)},registerComponentView:function(r){Qt.registerClass(r)},registerSeriesModel:function(r){jt.registerClass(r)},registerChartView:function(r){Yt.registerClass(r)},registerSubTypeDefaulter:function(r,e){Pt.registerSubTypeDefaulter(r,e)},registerPainter:function(r,e){YG(r,e)}};function It(r){if(pe(r)){N(r,function(e){It(e)});return}dt(z6,r)>=0||(z6.push(r),He(r)&&(r={install:r}),r.install(lpe))}function $_(r){return r==null?0:r.length||1}function B6(r){return r}var upe=function(){function r(e,t,i,n,a,o){this._old=e,this._new=t,this._oldKeyGetter=i||B6,this._newKeyGetter=n||B6,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(e){return this._add=e,this},r.prototype.update=function(e){return this._update=e,this},r.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},r.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},r.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},r.prototype.remove=function(e){return this._remove=e,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var e=this._old,t=this._new,i={},n=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,n,"_oldKeyGetter"),this._initIndexMap(t,i,a,"_newKeyGetter");for(var o=0;o1){var c=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(c,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},r.prototype._executeMultiple=function(){var e=this._old,t=this._new,i={},n={},a=[],o=[];this._initIndexMap(e,i,a,"_oldKeyGetter"),this._initIndexMap(t,n,o,"_newKeyGetter");for(var s=0;s1&&h===1)this._updateManyToOne&&this._updateManyToOne(c,u),n[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(c,u),n[l]=null;else if(f===1&&h===1)this._update&&this._update(c,u),n[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,u),n[l]=null;else if(f>1)for(var p=0;p1)for(var s=0;s30}var Q_=qe,Nf=de,mpe=typeof Int32Array>"u"?Array:Int32Array,vpe="e\0\0",V6=-1,gpe=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],ype=["_approximateExtent"],G6,v1,ex,tx,a2,g1,o2,_pe=function(){function r(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i,n=!1;m1(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(n=!0,i=e),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c=t)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===fn;if(l&&!n.pure)for(var u=[],c=e;c0},r.prototype.ensureUniqueItemVisual=function(e,t){var i=this._itemVisuals,n=i[e];n||(n=i[e]={});var a=n[t];return a==null&&(a=this.getVisual(t),pe(a)?a=a.slice():Q_(a)&&(a=fe({},a)),n[t]=a),a},r.prototype.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{};this._itemVisuals[e]=n,Q_(t)?fe(n,t):n[t]=i},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(e,t){Q_(e)?fe(this._layout,e):this._layout[e]=t},r.prototype.getLayout=function(e){return this._layout[e]},r.prototype.getItemLayout=function(e){return this._itemLayouts[e]},r.prototype.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?fe(this._itemLayouts[e]||{},t):t},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(e,t){var i=this.hostModel&&this.hostModel.seriesIndex;c_(i,this.dataType,e,t),this._graphicEls[e]=t},r.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},r.prototype.eachItemGraphicEl=function(e,t){N(this._graphicEls,function(i,n){i&&e&&e.call(t,i,n)})},r.prototype.cloneShallow=function(e){return e||(e=new r(this._schema?this._schema:Nf(this.dimensions,this._getDimInfo,this),this.hostModel)),a2(e,this),e._store=this._store,e},r.prototype.wrapMethod=function(e,t){var i=this[e];He(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var n=i.apply(this,arguments);return t.apply(this,[n].concat(rb(arguments)))})},r.internalField=function(){G6=function(e){var t=e._invertedIndicesMap;N(t,function(i,n){var a=e._dimInfos[n],o=a.ordinalMeta,s=e._store;if(o){i=t[n]=new mpe(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),n[t]=l}}}(),r}(),ti=_pe;function js(r,e){cv(r)||(r=fv(r)),e=e||{};var t=e.coordDimensions||[],i=e.dimensionsDefine||r.dimensionsDefine||[],n=ke(),a=[],o=Spe(r,t,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&n2(o),l=i===r.dimensionsDefine,u=l?i2(r):r2(i),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(r,o));for(var f=ke(c),h=new MD(o),p=0;p0&&(i.name=n+(a-1)),a++,e.set(n,a)}}function Spe(r,e,t,i){var n=Math.max(r.dimensionsDetectedCount||1,e.length,t.length,i||0);return N(e,function(a){var o;qe(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function Mpe(r,e,t){if(t||e.hasKey(r)){for(var i=0;e.hasKey(r+i);)i++;r+=i}return e.set(r,!0),r}var bpe=function(){function r(e){this.coordSysDims=[],this.axisMap=ke(),this.categoryAxisMap=ke(),this.coordSysName=e}return r}();function H6(r){var e=r.get("coordinateSystem"),t=new bpe(e),i=wpe[e];if(i)return i(r,t,t.axisMap,t.categoryAxisMap),t}var wpe={cartesian2d:function(r,e,t,i){var n=r.getReferringComponents("xAxis",Cr).models[0],a=r.getReferringComponents("yAxis",Cr).models[0];e.coordSysDims=["x","y"],t.set("x",n),t.set("y",a),gv(n)&&(i.set("x",n),e.firstCategoryDimIndex=0),gv(a)&&(i.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(r,e,t,i){var n=r.getReferringComponents("singleAxis",Cr).models[0];e.coordSysDims=["single"],t.set("single",n),gv(n)&&(i.set("single",n),e.firstCategoryDimIndex=0)},polar:function(r,e,t,i){var n=r.getReferringComponents("polar",Cr).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",o),gv(a)&&(i.set("radius",a),e.firstCategoryDimIndex=0),gv(o)&&(i.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(r,e,t,i){e.coordSysDims=["lng","lat"]},parallel:function(r,e,t,i){var n=r.ecModel,a=n.getComponent("parallel",r.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();N(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),c=o[l];t.set(c,u),gv(u)&&(i.set(c,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function gv(r){return r.get("type")==="category"}function W6(r,e,t){t=t||{};var i=t.byIndex,n=t.stackedCoordDimension,a,o,s;Tpe(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(r&&r.get("stack")),u,c,f,h;if(N(a,function(_,y){Ce(_)&&(a[y]=_={name:_}),l&&!_.isExtraCoord&&(!i&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!n||n===_.coordDim)&&(c=_))}),c&&!i&&!u&&(i=!0),c){f="__\0ecstackresult_"+r.id,h="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var p=c.coordDim,d=c.type,g=0;N(a,function(_){_.coordDim===p&&g++});var m={name:f,coordDim:p,coordDimIndex:g,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},v={name:h,coordDim:h,coordDimIndex:g+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(m.storeDimIndex=s.ensureCalculationDimension(h,d),v.storeDimIndex=s.ensureCalculationDimension(f,d)),o.appendCalculationDimension(m),o.appendCalculationDimension(v)):(a.push(m),a.push(v))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:h,stackResultDimension:f}}function Tpe(r){return!m1(r.schema)}function wo(r,e){return!!e&&e===r.getCalculationInfo("stackedDimension")}function y1(r,e){return wo(r,e)?r.getCalculationInfo("stackResultDimension"):e}function Epe(r,e){var t=r.get("coordinateSystem"),i=Uu.get(t),n;return e&&e.coordSysDims&&(n=de(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=Yp(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function Ape(r,e,t){var i,n;return t&&N(r,function(a,o){var s=a.coordDim,l=t.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(r[i].otherDims.itemName=0),i}function Cpe(r,e,t){t=t||{};var i=e.getSourceManager(),n,a=!1;r?(a=!0,n=fv(r)):(n=i.getSource(),a=n.sourceFormat===fn);var o=H6(e),s=Epe(e,o),l=t.useEncodeDefaulter,u=He(l)?l:l?ot(Lw,s,e):null,c={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=js(n,c),h=Ape(f.dimensions,t.createInvertedIndices,o),p=a?null:i.getSharedDataStore(f),d=W6(e,{schema:f,store:p}),g=new ti(f,e);g.setCalculationInfo(d);var m=h!=null&&Rpe(n)?function(v,_,y,x){return x===h?y:this.defaultDimValueGetter(v,_,y,x)}:null;return g.hasItemOption=!1,g.initData(a?n:p,null,m),g}function Rpe(r){if(r.sourceFormat===fn){var e=Lpe(r.data||[]);return!pe(Os(e))}}function Lpe(r){for(var e=0;et[1]&&(t[1]=e[1])},r.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},r.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(e){this._isBlank=e},r}();yf(X6);var Ga=X6;var Ppe=0,Dpe=function(){function r(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++Ppe}return r.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&de(i,Ipe);return new r({categories:n,needCollect:!n,deduplication:t.dedplication!==!1})},r.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},r.prototype.parseAndCollect=function(e){var t,i=this._needCollect;if(!Ce(e)&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=this._getOrCreateMap();return t=n.get(e),t==null&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t},r.prototype._getOrCreateMap=function(){return this._map||(this._map=ke(this.categories))},r}();function Ipe(r){return qe(r)&&r.value!=null?r.value:r+""}var rx=Dpe;function ix(r){return r.type==="interval"||r.type==="log"}function q6(r,e,t,i){var n={},a=r[1]-r[0],o=n.interval=Bm(a/e,!0);t!=null&&oi&&(o=n.interval=i);var s=n.intervalPrecision=s2(o),l=n.niceTickExtent=[Ar(Math.ceil(r[0]/o)*o,s),Ar(Math.floor(r[1]/o)*o,s)];return Npe(l,r),n}function _1(r){var e=Math.pow(10,zm(r)),t=r/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,Ar(t*e)}function s2(r){return Sn(r)+2}function Y6(r,e,t){r[e]=Math.max(Math.min(r[e],t[1]),t[0])}function Npe(r,e){!isFinite(r[0])&&(r[0]=e[0]),!isFinite(r[1])&&(r[1]=e[1]),Y6(r,0,e),Y6(r,1,e),r[0]>r[1]&&(r[0]=r[1])}function Uf(r,e){return r>=e[0]&&r<=e[1]}function Of(r,e){return e[1]===e[0]?.5:(r-e[0])/(e[1]-e[0])}function Ff(r,e){return r*(e[1]-e[0])+e[0]}var Z6=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new rx({})),pe(n)&&(n=new rx({categories:de(n,function(a){return qe(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return e.prototype.parse=function(t){return t==null?NaN:Ce(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),Uf(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),Of(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(Ff(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],i=this._extent,n=i[0];n<=i[1];)t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Ga);Ga.registerClass(Z6);var nx=Z6;var qp=Ar,j6=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return Uf(t,this._extent)},e.prototype.normalize=function(t){return Of(t,this._extent)},e.prototype.scale=function(t){return Ff(t,this._extent)},e.prototype.setExtent=function(t,i){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(i)||(n[1]=parseFloat(i))},e.prototype.unionExtent=function(t){var i=this._extent;t[0]i[1]&&(i[1]=t[1]),this.setExtent(i[0],i[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=s2(t)},e.prototype.getTicks=function(t){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]l)return[];var c=s.length?s[s.length-1].value:a[1];return n[1]>c&&(t?s.push({value:qp(c+i,o)}):s.push({value:n[1]})),s},e.prototype.getMinorTicks=function(t){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;oa[0]&&p0&&(a=a===null?s:Math.min(a,s))}t[i]=a}}return t}function h2(r){var e=Ope(r),t=[];return N(r,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],c=Math.abs(o[1]-o[0]),f=a.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=u?c/h*u:c}else{var p=i.getData();s=Math.abs(o[1]-o[0])/p.count()}var d=Fe(i.get("barWidth"),s),g=Fe(i.get("barMaxWidth"),s),m=Fe(i.get("barMinWidth")||(t8(i)?.5:1),s),v=i.get("barGap"),_=i.get("barCategoryGap");t.push({bandWidth:s,barWidth:d,barMaxWidth:g,barMinWidth:m,barGap:v,barCategoryGap:_,axisKey:c2(a),stackId:u2(i)})}),$6(t)}function $6(r){var e={};N(r,function(i,n){var a=i.axisKey,o=i.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=i.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var f=i.barMaxWidth;f&&(l[u].maxWidth=f);var h=i.barMinWidth;h&&(l[u].minWidth=h);var p=i.barGap;p!=null&&(s.gap=p);var d=i.barCategoryGap;d!=null&&(s.categoryGap=d)});var t={};return N(e,function(i,n){t[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=bt(a).length;s=Math.max(35-l*4,15)+"%"}var u=Fe(s,o),c=Fe(i.gap,1),f=i.remainedWidth,h=i.autoWidthCount,p=(f-u)/(h+(h-1)*c);p=Math.max(p,0),N(a,function(v){var _=v.maxWidth,y=v.minWidth;if(v.width){var x=v.width;_&&(x=Math.min(x,_)),y&&(x=Math.max(x,y)),v.width=x,f-=x+c*x,h--}else{var x=p;_&&_x&&(x=y),x!==p&&(v.width=x,f-=x+c*x,h--)}}),p=(f-u)/(h+(h-1)*c),p=Math.max(p,0);var d=0,g;N(a,function(v,_){v.width||(v.width=p),g=v,d+=v.width*(1+c)}),g&&(d-=g.width*c);var m=-d/2;N(a,function(v,_){t[n][_]=t[n][_]||{bandWidth:o,offset:m,width:v.width},m+=v.width*(1+c)})}),t}function Q6(r,e,t){if(r&&e){var i=r[c2(e)];return i!=null&&t!=null?i[u2(t)]:i}}function S1(r,e){var t=f2(r,e),i=h2(t);N(t,function(n){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=u2(n),u=i[c2(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function M1(r){return{seriesType:r,plan:Mo(),reset:function(e){if(e8(e)){var t=e.getData(),i=e.coordinateSystem,n=i.getBaseAxis(),a=i.getOtherAxis(n),o=t.getDimensionIndex(t.mapDimension(a.dim)),s=t.getDimensionIndex(t.mapDimension(n.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),c=t.getCalculationInfo("stackResultDimension"),f=wo(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),p=Fpe(n,a),d=t8(e),g=e.get("barMinHeight")||0,m=c&&t.getDimensionIndex(c),v=t.getLayout("size"),_=t.getLayout("offset");return{progress:function(y,x){for(var M=y.count,S=d&&ca(M*3),w=d&&l&&ca(M*3),T=d&&ca(M),C=i.master.getRect(),b=h?C.width:C.height,E,I=x.getStore(),R=0;(E=y.next())!=null;){var A=I.get(f?m:o,E),D=I.get(s,E),U=p,B=void 0;f&&(B=+A-I.get(o,E));var F=void 0,k=void 0,G=void 0,Y=void 0;if(h){var J=i.dataToPoint([A,D]);if(f){var Q=i.dataToPoint([B,D]);U=Q[0]}F=U,k=J[1]+_,G=J[0]-U,Y=v,Math.abs(G)>>1;r[n][1]n&&(this._approxInterval=n);var s=b1.length,l=Math.min(zpe(b1,this._approxInterval,0,s),s-1);this._interval=b1[l][1],this._minLevelUnit=b1[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return At(t)?t:+Mn(t)},e.prototype.contain=function(t){return Uf(this.parse(t),this._extent)},e.prototype.normalize=function(t){return Of(this.parse(t),this._extent)},e.prototype.scale=function(t){return Ff(t,this._extent)},e.type="time",e}(Ha),b1=[["second",Mw],["minute",bw],["hour",ov],["quarter-day",ov*6],["half-day",ov*12],["day",_o*1.2],["half-week",_o*3.5],["week",_o*7],["month",_o*31],["quarter",_o*95],["half-year",XP/2],["year",XP]];function Bpe(r,e,t,i){var n=Mn(e),a=Mn(t),o=function(d){return ZP(n,d,i)===ZP(a,d,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},f=function(){return c()&&o("minute")},h=function(){return f()&&o("second")},p=function(){return h()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return f();case"second":return h();case"millisecond":return p()}}function kpe(r,e){return r/=_o,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function Vpe(r){var e=30*_o;return r/=e,r>6?6:r>3?3:r>2?2:1}function Gpe(r){return r/=ov,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function r8(r,e){return r/=e?bw:Mw,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function Hpe(r){return Bm(r,!0)}function Wpe(r,e,t){var i=new Date(r);switch(zp(e)){case"year":case"month":i[jP(t)](0);case"day":i[KP(t)](1);case"hour":i[JP(t)](0);case"minute":i[$P(t)](0);case"second":i[QP(t)](0),i[eD(t)](0)}return i.getTime()}function Xpe(r,e,t,i){var n=1e4,a=qP,o=0;function s(b,E,I,R,A,D,U){for(var B=new Date(E),F=E,k=B[R]();F1&&D===0&&I.unshift({value:I[0].value-F})}}for(var D=0;D=i[0]&&_<=i[1]&&f++)}var y=(i[1]-i[0])/e;if(f>y*1.5&&h>y/1.5||(u.push(m),f>y||r===a[p]))break}c=[]}}}for(var x=Wt(de(u,function(b){return Wt(b,function(E){return E.value>=i[0]&&E.value<=i[1]&&!E.notAdd})}),function(b){return b.length>0}),M=[],S=x.length-1,p=0;p0;)a*=10;var s=[Ar(Zpe(i[0]/a)*a),Ar(qpe(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){ax.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=Ks(t)/Ks(this.base),Uf(t,this._extent)},e.prototype.normalize=function(t){return t=Ks(t)/Ks(this.base),Of(t,this._extent)},e.prototype.scale=function(t){return t=Ff(t,this._extent),T1(this.base,t)},e.type="log",e}(Ga),a8=p2.prototype;a8.getMinorTicks=ax.getMinorTicks;a8.getLabel=ax.getLabel;function E1(r,e){return Ype(r,Sn(e))}Ga.registerClass(p2);var o8=p2;var jpe=function(){function r(e,t,i){this._prepareParams(e,t,i)}return r.prototype._prepareParams=function(e,t,i){i[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var h=this._determinedMin,p=this._determinedMax;return h!=null&&(s=h,u=!0),p!=null&&(l=p,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:f}},r.prototype.modifyDataMinMax=function(e,t){this[Jpe[e]]=t},r.prototype.setDeterminedMinMax=function(e,t){var i=Kpe[e];this[i]=t},r.prototype.freeze=function(){this.frozen=!0},r}();var Kpe={min:"_determinedMin",max:"_determinedMax"},Jpe={min:"_dataMin",max:"_dataMax"};function C1(r,e,t){var i=r.rawExtentInfo;return i||(i=new jpe(r,e,t),r.rawExtentInfo=i,i)}function A1(r,e){return e==null?null:sf(e)?NaN:r.parse(e)}function d2(r,e){var t=r.type,i=C1(r,e,r.getExtent()).calculate();r.setBlank(i.isBlank);var n=i.min,a=i.max,o=e.ecModel;if(o&&t==="time"){var s=f2("bar",o),l=!1;if(N(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var u=h2(s),c=$pe(n,a,e,u);n=c.min,a=c.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function $pe(r,e,t,i){var n=t.axis.getExtent(),a=n[1]-n[0],o=Q6(i,t.axis);if(o===void 0)return{min:r,max:e};var s=1/0;N(o,function(p){s=Math.min(p.offset,s)});var l=-1/0;N(o,function(p){l=Math.max(p.offset+p.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=e-r,f=1-(s+l)/a,h=c/f-c;return e+=h*(l/u),r-=h*(s/u),{min:r,max:e}}function Vl(r,e){var t=e,i=d2(r,t),n=i.extent,a=t.get("splitNumber");r instanceof o8&&(r.base=t.get("logBase"));var o=r.type,s=t.get("interval"),l=o==="interval"||o==="time";r.setExtent(n[0],n[1]),r.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function zf(r,e){if(e=e||r.get("type"),e)switch(e){case"category":return new nx({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new w1({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(Ga.getClass(e)||Ha)}}function s8(r){var e=r.scale.getExtent(),t=e[0],i=e[1];return!(t>0&&i>0||t<0&&i<0)}function yv(r){var e=r.getLabelModel().get("formatter"),t=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(i){return function(n,a){return r.scale.getFormattedLabel(n,a,i)}}(e):Ce(e)?function(i){return function(n){var a=r.scale.getLabel(n),o=i.replace("{value}",a??"");return o}}(e):He(e)?function(i){return function(n,a){return t!=null&&(a=n.value-t),i(ox(r,n),a,n.level!=null?{level:n.level}:null)}}(e):function(i){return r.scale.getLabel(i)}}function ox(r,e){return r.type==="category"?r.scale.getLabel(e):e.value}function l8(r){var e=r.model,t=r.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var i,n,a=t.getExtent();t instanceof nx?n=t.count():(i=t.getTicks(),n=i.length);var o=r.getLabelModel(),s=yv(r),l,u=1;n>40&&(u=Math.ceil(n/40));for(var c=0;cr[1]&&(r[1]=n[1])})}var Gl=function(){function r(){}return r.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},r.prototype.getCoordSysModel=function(){},r}();var ede=1e-8;function c8(r,e){return Math.abs(r-e)n&&(i=o,n=l)}if(i)return rde(i.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var i=this._rect;if(i&&!t)return i;var n=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return N(o,function(s){s.type==="polygon"?h8(s.exterior,n,a,t):N(s.points,function(l){h8(l,n,a,t)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(a[0])&&isFinite(a[1])||(n[0]=n[1]=a[0]=a[1]=0),i=new lt(n[0],n[1],a[0]-n[0],a[1]-n[1]),t||(this._rect=i),i},e.prototype.contain=function(t){var i=this.getBoundingRect(),n=this.geometries;if(!i.contain(t[0],t[1]))return!1;e:for(var a=0,o=n.length;a>1^-(s&1),l=l>>1^-(l&1),s+=n,l+=a,n=s,a=l,i.push([s/t,l/t])}return i}function _2(r,e){return r=ide(r),de(Wt(r.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var i=t.properties,n=t.geometry,a=[];switch(n.type){case"Polygon":var o=n.coordinates;a.push(new v2(o[0],o.slice(1)));break;case"MultiPolygon":N(n.coordinates,function(l){l[0]&&a.push(new v2(l[0],l.slice(1)))});break;case"LineString":a.push(new g2([n.coordinates]));break;case"MultiLineString":a.push(new g2(n.coordinates))}var s=new D1(i[e||"name"],a,i.cp);return s.properties=i,s})}var xv={};YR(xv,{MAX_SAFE_INTEGER:()=>e_,asc:()=>Ti,getPercentWithPrecision:()=>JG,getPixelPrecision:()=>Fm,getPrecision:()=>Sn,getPrecisionSafe:()=>qL,isNumeric:()=>yp,isRadianAroundZero:()=>Su,linearMap:()=>rr,nice:()=>Bm,numericToNumber:()=>Pa,parseDate:()=>Mn,quantile:()=>km,quantity:()=>kb,quantityExponent:()=>zm,reformIntervals:()=>r_,remRadian:()=>t_,round:()=>Ar});var sx=vt();function v8(r){return r.type==="category"?nde(r):ode(r)}function g8(r,e){return r.type==="category"?ade(r,e):{ticks:de(r.scale.getTicks(),function(t){return t.value})}}function nde(r){var e=r.getLabelModel(),t=y8(r,e);return!e.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function y8(r,e){var t=_8(r,"labels"),i=R1(e),n=x8(t,i);if(n)return n;var a,o;return He(i)?a=w8(r,i):(o=i==="auto"?sde(r):i,a=b8(r,o)),S8(t,i,{labels:a,labelCategoryInterval:o})}function ade(r,e){var t=_8(r,"ticks"),i=R1(e),n=x8(t,i);if(n)return n;var a,o;if((!e.get("show")||r.scale.isBlank())&&(a=[]),He(i))a=w8(r,i,!0);else if(i==="auto"){var s=y8(r,r.getLabelModel());o=s.labelCategoryInterval,a=de(s.labels,function(l){return l.tickValue})}else o=i,a=b8(r,o,!0);return S8(t,i,{ticks:a,tickCategoryInterval:o})}function ode(r){var e=r.scale.getTicks(),t=yv(r);return{labels:de(e,function(i,n){return{level:i.level,formattedLabel:t(i,n),rawLabel:r.scale.getLabel(i),tickValue:i.value}})}}function _8(r,e){return sx(r)[e]||(sx(r)[e]=[])}function x8(r,e){for(var t=0;t40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),c=Math.abs(u*Math.cos(i)),f=Math.abs(u*Math.sin(i)),h=0,p=0;l<=a[1];l+=s){var d=0,g=0,m=Ll(t({value:l}),e.font,"center","top");d=m.width*1.3,g=m.height*1.3,h=Math.max(h,d,7),p=Math.max(p,g,7)}var v=h/c,_=p/f;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var y=Math.max(0,Math.floor(Math.min(v,_))),x=sx(r.model),M=r.getExtent(),S=x.lastAutoInterval,w=x.lastTickCount;return S!=null&&w!=null&&Math.abs(S-y)<=1&&Math.abs(w-o)<=1&&S>y&&x.axisExtent0===M[0]&&x.axisExtent1===M[1]?y=S:(x.lastTickCount=o,x.lastAutoInterval=y,x.axisExtent0=M[0],x.axisExtent1=M[1]),y}function lde(r){var e=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function b8(r,e,t){var i=yv(r),n=r.scale,a=n.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],c=n.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var f=L1(r),h=o.get("showMinLabel")||f,p=o.get("showMaxLabel")||f;h&&u!==a[0]&&g(a[0]);for(var d=u;d<=a[1];d+=l)g(d);p&&d-l!==a[1]&&g(a[1]);function g(m){var v={value:m};s.push(t?m:{formattedLabel:i(v),rawLabel:n.getLabel(v),tickValue:m})}return s}function w8(r,e,t){var i=r.scale,n=yv(r),a=[];return N(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;e(o.value,s)&&a.push(t?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var T8=[0,1],ude=function(){function r(e,t,i){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=i||[0,0]}return r.prototype.contain=function(e){var t=this._extent,i=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return e>=i&&e<=n},r.prototype.containData=function(e){return this.scale.contain(e)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(e){return Fm(e||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(e,t){var i=this._extent;i[0]=e,i[1]=t},r.prototype.dataToCoord=function(e,t){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&n.type==="ordinal"&&(i=i.slice(),E8(i,n.count())),rr(e,T8,i,t)},r.prototype.coordToData=function(e,t){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),E8(i,n.count()));var a=rr(e,i,T8,t);return this.scale.scale(a)},r.prototype.pointToData=function(e,t){},r.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),i=g8(this,t),n=i.ticks,a=de(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=t.get("alignWithLabel");return cde(this,a,o,e.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var i=this.scale.getMinorTicks(t),n=de(i,function(a){return de(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},r.prototype.getViewLabels=function(){return v8(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},r.prototype.calculateCategoryInterval=function(){return M8(this)},r}();function E8(r,e){var t=r[1]-r[0],i=e,n=t/i/2;r[0]+=n,r[1]-=n}function cde(r,e,t,i){var n=e.length;if(!r.onBand||t||!n)return;var a=r.getExtent(),o,s;if(n===1)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[n-1].tickValue-e[0].tickValue,u=(e[n-1].coord-e[0].coord)/l;N(e,function(p){p.coord-=u/2});var c=r.scale.getExtent();s=1+c[1]-e[n-1].tickValue,o={coord:e[n-1].coord+u*s},e.push(o)}var f=a[0]>a[1];h(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift()),i&&h(a[0],e[0].coord)&&e.unshift({coord:a[0]}),h(a[1],o.coord)&&(i?o.coord=a[1]:e.pop()),i&&h(o.coord,a[1])&&e.push({coord:a[1]});function h(p,d){return p=Ar(p),d=Ar(d),f?p>d:pn&&(n+=lx);var p=Math.atan2(s,o);if(p<0&&(p+=lx),p>=i&&p<=n||p+lx>=i&&p+lx<=n)return l[0]=c,l[1]=f,u-t;var d=t*Math.cos(i)+r,g=t*Math.sin(i)+e,m=t*Math.cos(n)+r,v=t*Math.sin(n)+e,_=(d-o)*(d-o)+(g-s)*(g-s),y=(m-o)*(m-o)+(v-s)*(v-s);return _0){e=e/180*Math.PI,$s.fromArray(r[0]),qr.fromArray(r[1]),Ai.fromArray(r[2]),Nt.sub(Wl,$s,qr),Nt.sub(Hl,Ai,qr);var t=Wl.len(),i=Hl.len();if(!(t<.001||i<.001)){Wl.scale(1/t),Hl.scale(1/i);var n=Wl.dot(Hl),a=Math.cos(e);if(a1&&Nt.copy(fa,Ai),fa.toArray(r[1])}}}}function C8(r,e,t){if(t<=180&&t>0){t=t/180*Math.PI,$s.fromArray(r[0]),qr.fromArray(r[1]),Ai.fromArray(r[2]),Nt.sub(Wl,qr,$s),Nt.sub(Hl,Ai,qr);var i=Wl.len(),n=Hl.len();if(!(i<.001||n<.001)){Wl.scale(1/i),Hl.scale(1/n);var a=Wl.dot(e),o=Math.cos(t);if(a=l)Nt.copy(fa,Ai);else{fa.scaleAndAdd(Hl,s/Math.tan(Math.PI/2-c));var f=Ai.x!==qr.x?(fa.x-qr.x)/(Ai.x-qr.x):(fa.y-qr.y)/(Ai.y-qr.y);if(isNaN(f))return;f<0?Nt.copy(fa,qr):f>1&&Nt.copy(fa,Ai)}fa.toArray(r[1])}}}}function x2(r,e,t,i){var n=t==="normal",a=n?r:r.ensureState(t);a.ignore=e;var o=i.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();n?r.useStyle(s):a.style=s}function vde(r,e){var t=e.smooth,i=e.points;if(i)if(r.moveTo(i[0][0],i[0][1]),t>0&&i.length>=3){var n=Xo(i[0],i[1]),a=Xo(i[1],i[2]);if(!n||!a){r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*t,s=Tm([],i[1],i[0],o/n),l=Tm([],i[1],i[2],o/a),u=Tm([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c0&&a&&S(-f/o,0,o);var m=r[0],v=r[o-1],_,y;x(),_<0&&w(-_,.8),y<0&&w(y,.8),x(),M(_,y,1),M(y,_,-1),x(),_<0&&T(-_),y<0&&T(y);function x(){_=m.rect[e]-i,y=n-v.rect[e]-v.rect[t]}function M(C,b,E){if(C<0){var I=Math.min(b,-C);if(I>0){S(I*E,0,o);var R=I+C;R<0&&w(-R*E,1)}else w(-C*E,1)}}function S(C,b,E){C!==0&&(u=!0);for(var I=b;I0)for(var R=0;R0;R--){var B=E[R-1]*U;S(-B,R,o)}}}function T(C){var b=C<0?-1:1;C=Math.abs(C);for(var E=Math.ceil(C/(o-1)),I=0;I0?S(E,0,I+1):S(-E,o-I-1,o),C-=E,C<=0)return}return u}function L8(r,e,t,i){return R8(r,"x","width",e,t,i)}function O1(r,e,t,i){return R8(r,"y","height",e,t,i)}function F1(r){var e=[];r.sort(function(g,m){return m.priority-g.priority});var t=new lt(0,0,0,0);function i(g){if(!g.ignore){var m=g.ensureState("emphasis");m.ignore==null&&(m.ignore=!1)}g.ignore=!0}for(var n=0;n=0&&i.attr(a.oldLayoutSelect),dt(h,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),Dt(i,u,t,l)}else if(i.attr(u),!Du(i).valueAnimation){var f=ft(i.style.opacity,1);i.style.opacity=0,ar(i,{style:{opacity:f}},t,l)}if(a.oldLayout=u,i.states.select){var p=a.oldLayoutSelect={};z1(p,u,B1),z1(p,i.states.select,B1)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};z1(d,u,B1),z1(d,i.states.emphasis,B1)}gw(i,l,c,t,t)}if(n&&!n.ignore&&!n.invisible){var a=_de(n),o=a.oldLayout,g={points:n.shape.points};o?(n.attr({shape:o}),Dt(n,{shape:g},t)):(n.setShape(g),n.style.strokePercent=0,ar(n,{style:{strokePercent:1}},t)),a.oldLayout=g}},r}(),D8=xde;var w2=vt();function T2(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,i){var n=w2(t).labelManager;n||(n=w2(t).labelManager=new D8),n.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(e,t,i){var n=w2(t).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),n.updateLayoutConfig(t),n.layout(t),n.processLabelsOverall()})}var E2=Math.sin,A2=Math.cos,I8=Math.PI,jp=Math.PI*2,Sde=180/I8,Mde=function(){function r(){}return r.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},r.prototype.moveTo=function(e,t){this._add("M",e,t)},r.prototype.lineTo=function(e,t){this._add("L",e,t)},r.prototype.bezierCurveTo=function(e,t,i,n,a,o){this._add("C",e,t,i,n,a,o)},r.prototype.quadraticCurveTo=function(e,t,i,n){this._add("Q",e,t,i,n)},r.prototype.arc=function(e,t,i,n,a,o){this.ellipse(e,t,i,i,0,n,a,o)},r.prototype.ellipse=function(e,t,i,n,a,o,s,l){var u=s-o,c=!l,f=Math.abs(u),h=Rl(f-jp)||(c?u>=jp:-u>=jp),p=u>0?u%jp:u%jp+jp,d=!1;h?d=!0:Rl(f)?d=!1:d=p>=I8==!!c;var g=e+i*A2(o),m=t+n*E2(o);this._start&&this._add("M",g,m);var v=Math.round(a*Sde);if(h){var _=1/this._p,y=(c?1:-1)*(jp-_);this._add("A",i,n,v,1,+c,e+i*A2(o+y),t+n*E2(o+y)),_>.01&&this._add("A",i,n,v,0,+c,g,m)}else{var x=e+i*A2(s),M=t+n*E2(s);this._add("A",i,n,v,+d,+c,x,M)}},r.prototype.rect=function(e,t,i,n){this._add("M",e,t),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(e,t,i,n,a,o,s,l,u){for(var c=[],f=this._p,h=1;h"}function Cde(r){return""}function cx(r,e){e=e||{};var t=e.newline?` -`:"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return Ade(o,s)+(o!=="style"?yn(l):l||"")+(a?""+t+de(a,function(u){return i(u)}).join(t)+t:"")+Cde(o)}return i(r)}function F8(r,e,t){t=t||{};var i=t.newline?` -`:"",n=" {"+i,a=i+"}",o=de(bt(r),function(l){return l+n+de(bt(r[l]),function(u){return u+":"+r[l][u]+";"}).join(i)+a}).join(i),s=de(bt(e),function(l){return"@keyframes "+l+n+de(bt(e[l]),function(u){return u+n+de(bt(e[l][u]),function(c){var f=e[l][u][c];return c==="d"&&(f='path("'+f+'")'),c+":"+f+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":[""].join(i)}function fx(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function D2(r,e,t,i){return Ci("svg","root",{width:r,height:e,xmlns:N8,"xmlns:xlink":L2,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+e:!1},t)}var Rde=0;function G1(){return Rde++}var z8={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Kp="transform-origin";function Lde(r,e,t){var i=fe({},r.shape);fe(i,e),r.buildPath(t,i);var n=new k1;return n.reset(Rb(r)),t.rebuildPath(n,1),n.generateStr(),n.getStr()}function Pde(r,e){var t=e.originX,i=e.originY;(t||i)&&(r[Kp]=t+"px "+i+"px")}var Dde={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function k8(r,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=r,t}function Ide(r,e,t){var i=r.shape.paths,n={},a,o;if(N(i,function(l){var u=fx(t.zrId);u.animation=!0,hx(l,{},u,!0);var c=u.cssAnims,f=u.cssNodes,h=bt(c),p=h.length;if(p){o=h[p-1];var d=c[o];for(var g in d){var m=d[g];n[g]=n[g]||{d:""},n[g].d+=m.d||""}for(var v in f){var _=f[v].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){e.d=!1;var s=k8(n,t);return a.replace(o,s)}}function B8(r){return Ce(r)?z8[r]?"cubic-bezier("+z8[r]+")":Lm(r)?r:"":""}function hx(r,e,t,i){var n=r.animators,a=n.length,o=[];if(r instanceof Qm){var s=Ide(r,e,t);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var ve=k8(w,t);return ve+" "+_[0]+" both"}}for(var m in l){var s=g(l[m]);s&&o.push(s)}if(o.length){var v=t.zrId+"-cls-"+G1();t.cssNodes["."+v]={animation:o.join(",")},e.class=v}}function G8(r,e,t){if(!r.ignore)if(r.isSilent()){var i={"pointer-events":"none"};V8(i,e,t,!0)}else{var n=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=n.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=X0(l))}var u=n.lineWidth;if(u){var c=!n.strokeNoScale&&r.transform?r.transform[0]:1;u=u/c}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),V8(i,e,t,!0)}}function V8(r,e,t,i){var n=JSON.stringify(r),a=t.cssStyleCache[n];a||(a=t.zrId+"-cls-"+G1(),t.cssStyleCache[n]=a,t.cssNodes["."+a+(i?":hover":"")]=r),e.class=e.class?e.class+" "+a:a}var px=Math.round;function Y8(r){return r&&Ce(r.src)}function q8(r){return r&&He(r.toDataURL)}function I2(r,e,t,i){R2(function(n,a){var o=n==="fill"||n==="stroke";o&&Cb(a)?F2(e,r,n,i):o&&Y0(a)?z2(t,r,n,i):o&&a==="none"?r[n]="transparent":r[n]=a},e,t,!1),kde(t,r,i)}function N2(r,e){var t=qG(e);t&&(t.each(function(i,n){i!=null&&(r[(P2+n).toLowerCase()]=i+"")}),e.isSilent()&&(r[P2+"silent"]="true"))}function H8(r){return Rl(r[0]-1)&&Rl(r[1])&&Rl(r[2])&&Rl(r[3]-1)}function Nde(r){return Rl(r[4])&&Rl(r[5])}function U2(r,e,t){if(e&&!(Nde(e)&&H8(e))){var i=t?10:1e4;r.transform=H8(e)?"translate("+px(e[4]*i)/i+" "+px(e[5]*i)/i+")":SG(e)}}function W8(r,e,t){for(var i=r.points,n=[],a=0;a"u"){var m="Image width/height must been given explictly in svg-ssr renderer.";kr(h,m),kr(p,m)}else if(h==null||p==null){var v=function(b,E){if(b){var I=b.elm,R=h||E.width,A=p||E.height;b.tag==="pattern"&&(u?(A=1,R/=a.width):c&&(R=1,A/=a.height)),b.attrs.width=R,b.attrs.height=A,I&&(I.setAttribute("width",R),I.setAttribute("height",A))}},_=o_(d,null,r,function(b){l||v(S,b),v(f,b)});_&&_.width&&_.height&&(h=h||_.width,p=p||_.height)}f=Ci("image","img",{href:d,width:h,height:p}),o.width=h,o.height=p}else n.svgElement&&(f=Qe(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(f){var y,x;l?y=x=1:u?(x=1,y=o.width/a.width):c?(y=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",y!=null&&!isNaN(y)&&(o.width=y),x!=null&&!isNaN(x)&&(o.height=x);var M=Lb(n);M&&(o.patternTransform=M);var S=Ci("pattern","",o,[f]),w=cx(S),T=i.patternCache,C=T[w];C||(C=i.zrId+"-p"+i.patternIdx++,T[w]=C,o.id=C,S=i.defs[C]=Ci("pattern",C,o,[f])),e[t]=q0(C)}}function j8(r,e,t){var i=t.clipPathCache,n=t.defs,a=i[r.id];if(!a){a=t.zrId+"-c"+t.clipPathIdx++;var o={id:a};i[r.id]=a,n[a]=Ci("clipPath",a,o,[Z8(r,t)])}e["clip-path"]=q0(a)}function B2(r){return document.createTextNode(r)}function Bf(r,e,t){r.insertBefore(e,t)}function k2(r,e){r.removeChild(e)}function V2(r,e){r.appendChild(e)}function G2(r){return r.parentNode}function H2(r){return r.nextSibling}function H1(r,e){r.textContent=e}var K8=58,Gde=120,Hde=Ci("","");function W2(r){return r===void 0}function Xl(r){return r!==void 0}function Wde(r,e,t){for(var i={},n=e;n<=t;++n){var a=r[n].key;a!==void 0&&(i[a]=n)}return i}function dx(r,e){var t=r.key===e.key,i=r.tag===e.tag;return i&&t}function mx(r){var e,t=r.children,i=r.tag;if(Xl(i)){var n=r.elm=V1(i);if(X1(Hde,r),pe(t))for(e=0;ea?(d=t[l+1]==null?null:t[l+1].elm,J8(r,d,t,n,l)):W1(r,e,i,a))}function bv(r,e){var t=e.elm=r.elm,i=r.children,n=e.children;r!==e&&(X1(r,e),W2(e.text)?Xl(i)&&Xl(n)?i!==n&&Xde(t,i,n):Xl(n)?(Xl(r.text)&&H1(t,""),J8(t,null,n,0,n.length-1)):Xl(i)?W1(t,i,0,i.length-1):Xl(r.text)&&H1(t,""):r.text!==e.text&&(Xl(i)&&W1(t,i,0,i.length-1),H1(t,e.text)))}function X2(r,e){if(dx(r,e))bv(r,e);else{var t=r.elm,i=G2(t);mx(e),i!==null&&(Bf(i,e.elm,H2(t)),W1(i,[r],0,0))}return e}var Yde=0,qde=function(){function r(e,t,i){if(this.type="svg",this.refreshHover=$8("refreshHover"),this.configLayer=$8("configLayer"),this.storage=t,this._opts=i=fe({},i),this.root=e,this._id="zr"+Yde++,this._oldVNode=D2(i.width,i.height),e&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=V1("svg");X1(null,this._oldVNode),n.appendChild(a),e.appendChild(n)}this.resize(i.width,i.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",X2(this._oldVNode,e),this._oldVNode=e}},r.prototype.renderOneToVNode=function(e){return O2(e,fx(this._id))},r.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=fx(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis;var o=[],s=this._bgVNode=Zde(i,n,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=Ci("g","main",{},[]);this._paintList(t,a,l?l.children:o),l&&o.push(l);var u=de(bt(a.defs),function(h){return a.defs[h]});if(u.length&&o.push(Ci("defs","defs",{},u)),e.animation){var c=F8(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=Ci("style","stl",{},[],c);o.push(f)}}return D2(i,n,o,e.useViewBox)},r.prototype.renderToString=function(e){return e=e||{},cx(this.renderToVNode({animation:ft(e.cssAnimation,!0),emphasis:ft(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:ft(e.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(e,t,i){for(var n=e.length,a=[],o=0,s,l,u=0,c=0;c=0&&!(h&&l&&h[g]===l[g]);g--);for(var m=d-1;m>g;m--)o--,s=a[o-1];for(var v=g+1;v=s)}}for(var f=this.__startIndex;f15)break}}A.prevElClipPaths&&v.restore()};if(_)if(_.length===0)T=m.__endIndex;else for(var b=p.dpr,E=0;E<_.length;++E){var I=_[E];v.save(),v.beginPath(),v.rect(I.x*b,I.y*b,I.width*b,I.height*b),v.clip(),C(I),v.restore()}else v.save(),C(),v.restore();m.__drawIndex=T,m.__drawIndex0&&e>n[0]){for(l=0;le);l++);s=i[n[l]]}if(n.splice(l+1,0,e),i[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(t.dom,u.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}},r.prototype.eachLayer=function(e,t){for(var i=this._zlevelList,n=0;n0?q1:0),this._needsManuallyCompositing),c.__builtin__||$h("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,t(l),a=c),n.__dirty&zi&&!n.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(e){e.clear()},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e,N(this._layers,function(t){t.setUnpainted()})},r.prototype.configLayer=function(e,t){if(t){var i=this._layerConfig;i[e]?_t(i[e],t,!0):i[e]=t;for(var n=0;n-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(jt),iX=eme;function Qs(r,e){var t=r.mapDimensionsAll("defaultedLabel"),i=t.length;if(i===1){var n=Fu(r,e,t[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o=0&&i.push(e[a])}return i.join(" ")}var tme=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this)||this;return o.updateData(t,i,n,a),o}return e.prototype._createSymbol=function(t,i,n,a,o){this.removeAll();var s=Sr(t,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=rme,this._symbolType=t,this.add(s)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Bn(this.childAt(0))},e.prototype.downplay=function(){kn(this.childAt(0))},e.prototype.setZ=function(t,i){var n=this.childAt(0);n.zlevel=t,n.z=i},e.prototype.setDraggable=function(t,i){var n=this.childAt(0);n.draggable=t,n.cursor=!i&&t?"move":n.cursor},e.prototype.updateData=function(t,i,n,a){this.silent=!1;var o=t.getItemVisual(i,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,i),u=o!==this._symbolType,c=a&&a.disableAnimation;if(u){var f=t.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,t,i,l,f)}else{var h=this.childAt(0);h.silent=!1;var p={scaleX:l[0]/2,scaleY:l[1]/2};c?h.attr(p):Dt(h,p,s,i),Ii(h)}if(this._updateCommon(t,i,l,n,a),u){var h=this.childAt(0);if(!c){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,ar(h,p,s,i)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,i,n,a,o){var s=this.childAt(0),l=t.hostModel,u,c,f,h,p,d,g,m,v;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,f=a.selectItemStyle,h=a.focus,p=a.blurScope,g=a.labelStatesModels,m=a.hoverScale,v=a.cursorStyle,d=a.emphasisDisabled),!a||t.hasItemOption){var _=a&&a.itemModel?a.itemModel:t.getItemModel(i),y=_.getModel("emphasis");u=y.getModel("itemStyle").getItemStyle(),f=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),h=y.get("focus"),p=y.get("blurScope"),d=y.get("disabled"),g=Tr(_),m=y.getShallow("scale"),v=_.getShallow("cursor")}var x=t.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var M=bo(t.getItemVisual(i,"symbolOffset"),n);M&&(s.x=M[0],s.y=M[1]),v&&s.attr("cursor",v);var S=t.getItemVisual(i,"style"),w=S.fill;if(s instanceof Ur){var T=s.style;s.useStyle(fe({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},S))}else s.__isEmptyBrush?s.useStyle(fe({},S)):s.useStyle(S),s.style.decal=null,s.setColor(w,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=t.getItemVisual(i,"liftZ"),b=this._z2;C!=null?b==null&&(this._z2=s.z2,s.z2+=C):b!=null&&(s.z2=b,this._z2=null);var E=o&&o.useNameLabel;Nr(s,g,{labelFetcher:l,labelDataIndex:i,defaultText:I,inheritColor:w,defaultOpacity:S.opacity});function I(D){return E?t.getName(D):Qs(t,D)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var R=s.ensureState("emphasis");R.style=u,s.ensureState("select").style=f,s.ensureState("blur").style=c;var A=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;R.scaleX=this._sizeX*A,R.scaleY=this._sizeY*A,this.setSymbolScale(1),nr(this,h,p,d)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,i,n){var a=this.childAt(0),o=rt(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&es(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();es(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:t,removeOpt:s})},e.getSymbolSize=function(t,i){return qs(t.getItemVisual(i,"symbolSize"))},e}(Ze);function rme(r,e){this.parent.drift(r,e)}var ku=tme;function Z2(r,e,t,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(t))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&r.getItemVisual(t,"symbol")!=="none"}function nX(r){return r!=null&&!qe(r)&&(r={isIgnore:r}),r||{}}function aX(r){var e=r.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:Tr(e),cursorStyle:e.get("cursor")}}var ime=function(){function r(e){this.group=new Ze,this._SymbolCtor=e||ku}return r.prototype.updateData=function(e,t){this._progressiveEls=null,t=nX(t);var i=this.group,n=e.hostModel,a=this._data,o=this._SymbolCtor,s=t.disableAnimation,l=aX(e),u={disableAnimation:s},c=t.getSymbolPoint||function(f){return e.getItemLayout(f)};a||i.removeAll(),e.diff(a).add(function(f){var h=c(f);if(Z2(e,h,f,t)){var p=new o(e,f,l,u);p.setPosition(h),e.setItemGraphicEl(f,p),i.add(p)}}).update(function(f,h){var p=a.getItemGraphicEl(h),d=c(f);if(!Z2(e,d,f,t)){i.remove(p);return}var g=e.getItemVisual(f,"symbol")||"circle",m=p&&p.getSymbolType&&p.getSymbolType();if(!p||m&&m!==g)i.remove(p),p=new o(e,f,l,u),p.setPosition(d);else{p.updateData(e,f,l,u);var v={x:d[0],y:d[1]};s?p.attr(v):Dt(p,v,n)}i.add(p),e.setItemGraphicEl(f,p)}).remove(function(f){var h=a.getItemGraphicEl(f);h&&h.fadeOut(function(){i.remove(h)},n)}).execute(),this._getSymbolPoint=c,this._data=e},r.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(i,n){var a=e._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=aX(e),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t,i){this._progressiveEls=[],i=nX(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a0?t=i[0]:i[1]<0&&(t=i[1]),t}function K1(r,e,t,i){var n=NaN;r.stacked&&(n=t.get(t.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=t.get(r.baseDim,i),o[1-a]=n,e.dataToPoint(o)}function ame(r,e){var t=[];return e.diff(r).add(function(i){t.push({cmd:"+",idx:i})}).update(function(i,n){t.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){t.push({cmd:"-",idx:i})}).execute(),t}function j2(r,e,t,i,n,a,o,s){for(var l=ame(r,e),u=[],c=[],f=[],h=[],p=[],d=[],g=[],m=j1(n,e,o),v=r.getLayout("points")||[],_=e.getLayout("points")||[],y=0;y=n||g<0)break;if($p(v,_)){if(l){g+=a;continue}break}if(g===t)r[a>0?"moveTo":"lineTo"](v,_),f=v,h=_;else{var y=v-u,x=_-c;if(y*y+x*x<.5){g+=a;continue}if(o>0){for(var M=g+a,S=e[M*2],w=e[M*2+1];S===v&&w===_&&m=i||$p(S,w))p=v,d=_;else{b=S-u,E=w-c;var A=v-u,D=S-v,U=_-c,B=w-_,F=void 0,k=void 0;if(s==="x"){F=Math.abs(A),k=Math.abs(D);var G=b>0?1:-1;p=v-G*F*o,d=_,I=v+G*k*o,R=_}else if(s==="y"){F=Math.abs(U),k=Math.abs(B);var Y=E>0?1:-1;p=v,d=_-Y*F*o,I=v,R=_+Y*k*o}else F=Math.sqrt(A*A+U*U),k=Math.sqrt(D*D+B*B),C=k/(k+F),p=v-b*o*(1-C),d=_-E*o*(1-C),I=v+b*o*C,R=_+E*o*C,I=kf(I,Vf(S,v)),R=kf(R,Vf(w,_)),I=Vf(I,kf(S,v)),R=Vf(R,kf(w,_)),b=I-v,E=R-_,p=v-b*F/k,d=_-E*F/k,p=kf(p,Vf(u,v)),d=kf(d,Vf(c,_)),p=Vf(p,kf(u,v)),d=Vf(d,kf(c,_)),b=v-p,E=_-d,I=v+b*k/F,R=_+E*k/F}r.bezierCurveTo(f,h,p,d,v,_),f=I,h=R}else r.lineTo(v,_)}u=v,c=_,g+=a}return m}var oX=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),sX=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="ec-polyline",i}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new oX},e.prototype.buildPath=function(t,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&$p(n[o*2-2],n[o*2-1]);o--);for(;a=0){var x=u?(d-l)*y+l:(p-s)*y+s;return u?[t,x]:[x,t]}s=p,l=d;break;case o.C:p=a[f++],d=a[f++],g=a[f++],m=a[f++],v=a[f++],_=a[f++];var M=u?sp(s,p,g,v,t,c):sp(l,d,m,_,t,c);if(M>0)for(var S=0;S=0){var x=u?hi(l,d,m,_,w):hi(s,p,g,v,w);return u?[t,x]:[x,t]}}s=v,l=_;break}}},e}(ut);var ome=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(oX),J1=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="ec-polygon",i}return e.prototype.getDefaultShape=function(){return new ome},e.prototype.buildPath=function(t,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&$p(n[s*2-2],n[s*2-1]);s--);for(;oe){a?t.push(o(a,l,e)):n&&t.push(o(n,l,0),o(n,l,e));break}else n&&(t.push(o(n,l,0)),n=null),t.push(l),a=l}return t}function ume(r,e,t){var i=r.getVisual("visualMeta");if(!(!i||!i.length||!r.count())&&e.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=r.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=e.getAxis(n),u=de(a.stops,function(y){return{coord:l.toGlobalCoord(l.dataToCoord(y.value)),color:y.color}}),c=u.length,f=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),f.reverse());var h=lme(u,n==="x"?t.getWidth():t.getHeight()),p=h.length;if(!p&&c)return u[0].coord<0?f[1]?f[1]:u[c-1].color:f[0]?f[0]:u[0].color;var d=10,g=h[0].coord-d,m=h[p-1].coord+d,v=m-g;if(v<.001)return"transparent";N(h,function(y){y.offset=(y.coord-g)/v}),h.push({offset:p?h[p-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:p?h[0].offset:.5,color:f[0]||"transparent"});var _=new zl(0,0,0,0,h,!0);return _[n]=g,_[n+"2"]=m,_}}}function cme(r,e,t){var i=r.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=t.getAxesByScale("ordinal")[0];if(a&&!(n&&fme(a,e))){var o=e.mapDimension(a.dim),s={};return N(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function fme(r,e){var t=r.getExtent(),i=Math.abs(t[1]-t[0])/r.scale.count();isNaN(i)&&(i=0);for(var n=e.count(),a=Math.max(1,Math.round(n/5)),o=0;oi)return!1;return!0}function hme(r,e){return isNaN(r)||isNaN(e)}function pme(r){for(var e=r.length/2;e>0&&hme(r[e*2-2],r[e*2-1]);e--);return e-1}function hX(r,e){return[r[e*2],r[e*2+1]]}function dme(r,e,t){for(var i=r.length/2,n=t==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function pX(r){if(r.get(["endLabel","show"]))return!0;for(var e=0;e0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var G=g.getState("emphasis").style;G.lineWidth=+g.style.lineWidth+1}rt(g).seriesIndex=t.seriesIndex,nr(g,B,F,k);var Y=fX(t.get("smooth")),J=t.get("smoothMonotone");if(g.setShape({smooth:Y,smoothMonotone:J,connectNulls:T}),m){var Q=l.getCalculationInfo("stackedOnSeries"),V=0;m.useStyle(Ye(c.getAreaStyle(),{fill:R,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),Q&&(V=fX(Q.get("smooth"))),m.setShape({smooth:Y,stackedOnSmooth:V,smoothMonotone:J,connectNulls:T}),Gr(m,t,"areaStyle"),rt(m).seriesIndex=t.seriesIndex,nr(m,B,F,k)}var K=function(ae){a._changePolyState(ae)};l.eachItemGraphicEl(function(ae){ae&&(ae.onHoverStateChange=K)}),this._polyline.onHoverStateChange=K,this._data=l,this._coordSys=o,this._stackedOnPoints=S,this._points=f,this._step=E,this._valueOrigin=x,t.get("triggerLineEvent")&&(this.packEventData(t,g),m&&this.packEventData(t,m))},e.prototype.packEventData=function(t,i){rt(i).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,i,n,a){var o=t.getData(),s=Jo(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],f=l[s*2+1];if(isNaN(c)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,f))return;var h=t.get("zlevel")||0,p=t.get("z")||0;u=new ku(o,s),u.x=c,u.y=f,u.setZ(h,p);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=h,d.z=p,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Yt.prototype.highlight.call(this,t,i,n,a)},e.prototype.downplay=function(t,i,n,a){var o=t.getData(),s=Jo(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Yt.prototype.downplay.call(this,t,i,n,a)},e.prototype._changePolyState=function(t){var i=this._polygon;Rp(this._polyline,t),i&&Rp(i,t)},e.prototype._newPolyline=function(t){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new sX({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},e.prototype._newPolygon=function(t,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new J1({shape:{points:t,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=t.hostModel,c=u.get("animationDuration");He(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=He(f)?f(null):f;t.eachItemGraphicEl(function(p,d){var g=p;if(g){var m=[p.x,p.y],v=void 0,_=void 0,y=void 0;if(n)if(o){var x=n,M=i.pointToCoord(m);a?(v=x.startAngle,_=x.endAngle,y=-M[1]/180*Math.PI):(v=x.r0,_=x.r,y=M[0])}else{var S=n;a?(v=S.x,_=S.x+S.width,y=p.x):(v=S.y+S.height,_=S.y,y=p.y)}var w=_===v?0:(y-v)/(_-v);l&&(w=1-w);var T=He(f)?f(d):c*w+h,C=g.getSymbolPath(),b=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,i,n){var a=t.getModel("endLabel");if(pX(t)){var o=t.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new Lt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=pme(l);c>=0&&(Nr(s,Tr(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:c,defaultText:function(f,h,p){return p!=null?Z1(o,p):Qs(o,f)},enableTextSetter:!0},mme(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,i,n,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var f=n.getLayout("points"),h=n.hostModel,p=h.get("connectNulls"),d=s.get("precision"),g=s.get("distance")||0,m=l.getBaseAxis(),v=m.isHorizontal(),_=m.inverse,y=i.shape,x=_?v?y.x:y.y+y.height:v?y.x+y.width:y.y,M=(v?g:0)*(_?-1:1),S=(v?0:-g)*(_?-1:1),w=v?"x":"y",T=dme(f,x,w),C=T.range,b=C[1]-C[0],E=void 0;if(b>=1){if(b>1&&!p){var I=hX(f,C[0]);u.attr({x:I[0]+M,y:I[1]+S}),o&&(E=h.getRawValue(C[0]))}else{var I=c.getPointOn(x,w);I&&u.attr({x:I[0]+M,y:I[1]+S});var R=h.getRawValue(C[0]),A=h.getRawValue(C[1]);o&&(E=Hb(n,d,R,A,T.t))}a.lastFrameIndex=C[0]}else{var D=t===1||a.lastFrameIndex>0?C[0]:0,I=hX(f,D);o&&(E=h.getRawValue(D)),u.attr({x:I[0]+M,y:I[1]+S})}if(o){var U=Du(u);typeof U.setLabelText=="function"&&U.setLabelText(E)}}},e.prototype._doUpdateAnimation=function(t,i,n,a,o,s,l){var u=this._polyline,c=this._polygon,f=t.hostModel,h=j2(this._data,t,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin,s),p=h.current,d=h.stackedOnCurrent,g=h.next,m=h.stackedOnNext;if(o&&(p=Gf(h.current,n,o,l),d=Gf(h.stackedOnCurrent,n,o,l),g=Gf(h.next,n,o,l),m=Gf(h.stackedOnNext,n,o,l)),cX(p,g)>3e3||c&&cX(d,m)>3e3){u.stopAnimation(),u.setShape({points:g}),c&&(c.stopAnimation(),c.setShape({points:g,stackedOnPoints:m}));return}u.shape.__points=h.current,u.shape.points=p;var v={shape:{points:g}};h.current!==p&&(v.shape.__points=h.next),u.stopAnimation(),Dt(u,v,f),c&&(c.setShape({points:p,stackedOnPoints:d}),c.stopAnimation(),Dt(c,{shape:{stackedOnPoints:m}},f),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],y=h.status,x=0;xe&&(e=r[t]);return isFinite(e)?e:NaN},min:function(r){for(var e=1/0,t=0;te&&(e=a,t=n)}return isFinite(t)?t:NaN},nearest:function(r){return r[0]}},yme=function(r){return Math.round(r.length/2)};function vx(r){return{seriesType:r,reset:function(e,t,i){var n=e.getData(),a=e.get("sampling"),o=e.coordinateSystem,s=n.count();if(s>10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),f=i.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(f||1),p=Math.round(s/h);if(isFinite(p)&&p>1){a==="lttb"&&e.setData(n.lttbDownSample(n.mapDimension(u.dim),1/p));var d=void 0;Ce(a)?d=gme[a]:He(a)&&(d=a),d&&e.setData(n.downSample(n.mapDimension(u.dim),1/p,d,yme))}}}}}function eI(r){r.registerChartView(dX),r.registerSeriesModel(iX),r.registerLayout(el("line",!0)),r.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),i=e.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",i)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,vx("line"))}var mX=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){return hn(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,i,n){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(t),s=a.dataToPoint(o);if(n)N(a.getAxes(),function(h,p){if(h.type==="category"&&i!=null){var d=h.getTicksCoords(),g=h.getTickModel().get("alignWithLabel"),m=o[p],v=i[p]==="x1"||i[p]==="y1";if(v&&!g&&(m+=1),d.length<2)return;if(d.length===2){s[p]=h.toGlobalCoord(h.getExtent()[v?1:0]);return}for(var _=void 0,y=void 0,x=1,M=0;Mm){y=(S+_)/2;break}M===1&&(x=w-d[0].tickValue)}y==null&&(_?_&&(y=d[d.length-1].coord):y=d[0].coord),s[p]=h.toGlobalCoord(y)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),f=a.getBaseAxis().isHorizontal()?0:1;s[f]+=u+c/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(jt);jt.registerClass(mX);var wv=mX;var _me=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return hn(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),i=this.get("largeThreshold");return i>t&&(t=i),t},e.prototype.brushSelector=function(t,i,n){return n.rect(i.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Hn(wv.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(wv),vX=_me;var xme=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),Sme=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="sausage",i}return e.prototype.getDefaultShape=function(){return new xme},e.prototype.buildPath=function(t,i){var n=i.cx,a=i.cy,o=Math.max(i.r0||0,0),s=Math.max(i.r,0),l=(s-o)*.5,u=o+l,c=i.startAngle,f=i.endAngle,h=i.clockwise,p=Math.PI*2,d=h?f-cMath.PI/2&&cs)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(t,i){for(var n=i.scale,a=n.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],n.getOrdinalMeta().categories.length-1);o<=s;++o)if(t.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,i,n,a){if(this._isOrderChangedWithinSameData(t,i,n)){var o=this._dataSort(t,n,i);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,i,n){var a=i.baseAxis,o=this._dataSort(t,a,function(s){return t.get(t.mapDimension(i.otherAxis.dim),s)});n.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(t,i){this._clear(this._model),this._removeOnRenderedListener(i)},e.prototype.dispose=function(t,i){this._removeOnRenderedListener(i)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var i=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(a){Cu(a,t,rt(a).dataIndex)})):i.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(Yt),_X={cartesian2d:function(r,e){var t=e.width<0?-1:1,i=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var n=r.x+r.width,a=r.y+r.height,o=tI(e.x,r.x),s=rI(e.x+e.width,n),l=tI(e.y,r.y),u=rI(e.y+e.height,a),c=sn?s:o,e.y=f&&l>a?u:l,e.width=c?0:s-o,e.height=f?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),c||f},polar:function(r,e){var t=e.r0<=e.r?1:-1;if(t<0){var i=e.r;e.r=e.r0,e.r0=i}var n=rI(e.r,r.r),a=tI(e.r0,r.r0);e.r=n,e.r0=a;var o=n-a<0;if(t<0){var i=e.r;e.r=e.r0,e.r0=i}return o}},xX={cartesian2d:function(r,e,t,i,n,a,o,s,l){var u=new Tt({shape:fe({},i),z2:1});if(u.__dataIndex=t,u.name="item",a){var c=u.shape,f=n?"height":"width";c[f]=0}return u},polar:function(r,e,t,i,n,a,o,s,l){var u=!n&&l?Tv:yi,c=new u({shape:i,z2:1});c.name="item";var f=CX(n);if(c.calculateTextPosition=gX(f,{isRoundCap:u===Tv}),a){var h=c.shape,p=n?"r":"endAngle",d={};h[p]=n?i.r0:i.startAngle,d[p]=i[p],(s?Dt:ar)(c,{shape:d},a)}return c}};function wme(r,e){var t=r.get("realtimeSort",!0),i=e.getBaseAxis();if(t&&i.type==="category"&&e.type==="cartesian2d")return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}function SX(r,e,t,i,n,a,o,s){var l,u;a?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?Dt:ar)(t,{shape:l},e,n,null);var c=e?r.baseAxis.model:null;(o?Dt:ar)(t,{shape:u},c,n)}function MX(r,e){for(var t=0;t0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*n/2,y:i.y+o*n/2,width:i.width-a*n,height:i.height-o*n}},polar:function(r,e,t){var i=r.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function Ame(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function CX(r){return function(e){var t=e?"Arc":"Angle";return function(i){switch(i){case"start":case"insideStart":case"end":case"insideEnd":return i+t;default:return i}}}(r)}function wX(r,e,t,i,n,a,o,s){var l=e.getItemVisual(t,"style");if(s){if(!a.get("roundCap")){var c=r.shape,f=Zl(i.getModel("itemStyle"),c,!0);fe(c,f),r.setShape(c)}}else{var u=i.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var h=i.getShallow("cursor");h&&r.attr("cursor",h);var p=s?o?n.r>=n.r0?"endArc":"startArc":n.endAngle>=n.startAngle?"endAngle":"startAngle":o?n.height>=0?"bottom":"top":n.width>=0?"right":"left",d=Tr(i);Nr(r,d,{labelFetcher:a,labelDataIndex:t,defaultText:Qs(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var g=r.getTextContent();if(s&&g){var m=i.get(["label","position"]);r.textConfig.inside=m==="middle"?!0:null,yX(r,m==="outside"?p:m,CX(o),i.get(["label","rotate"]))}vw(g,d,a.getRawValue(t),function(_){return Z1(e,_)});var v=i.getModel(["emphasis"]);nr(r,v.get("focus"),v.get("blurScope"),v.get("disabled")),Gr(r,i),Ame(n)&&(r.style.fill="none",r.style.stroke="none",N(r.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function Cme(r,e){var t=r.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var i=r.get(["itemStyle","borderWidth"])||0,n=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(i,n,a)}var Rme=function(){function r(){}return r}(),TX=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="largeBar",i}return e.prototype.getDefaultShape=function(){return new Rme},e.prototype.buildPath=function(t,i){for(var n=i.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c=0?t:null},30,!1);function Lme(r,e,t){for(var i=r.baseDimIdx,n=1-i,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,c=0,f=a.length/3;c=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return o[c]}return-1}function RX(r,e,t){if(ls(t,"cartesian2d")){var i=e,n=t.getArea();return{x:r?i.x:n.x,y:r?n.y:i.y,width:r?i.width:n.width,height:r?n.height:i.height}}else{var n=t.getArea(),a=e;return{cx:n.cx,cy:n.cy,r0:r?n.r0:a.r0,r:r?n.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function Pme(r,e,t){var i=r.type==="polar"?yi:Tt;return new i({shape:RX(e,t,r),silent:!0,z2:0})}var LX=bme;function iI(r){r.registerChartView(LX),r.registerSeriesModel(vX),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ot(S1,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,M1("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,vx("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},function(n){e.sortInfo&&n.axis.setCategorySortInfo(e.sortInfo)})})}var PX=Math.PI*2,tT=Math.PI/180;function DX(r,e){return xr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function nI(r,e){var t=DX(r,e),i=r.get("center"),n=r.get("radius");pe(n)||(n=[0,n]);var a=Fe(t.width,e.getWidth()),o=Fe(t.height,e.getHeight()),s=Math.min(a,o),l=Fe(n[0],s/2),u=Fe(n[1],s/2),c,f,h=r.coordinateSystem;if(h){var p=h.dataToPoint(i);c=p[0]||0,f=p[1]||0}else pe(i)||(i=[i,i]),c=Fe(i[0],a)+t.x,f=Fe(i[1],o)+t.y;return{cx:c,cy:f,r0:l,r:u}}function aI(r,e,t){e.eachSeriesByType(r,function(i){var n=i.getData(),a=n.mapDimension("value"),o=DX(i,t),s=nI(i,t),l=s.cx,u=s.cy,c=s.r,f=s.r0,h=-i.get("startAngle")*tT,p=i.get("endAngle"),d=i.get("padAngle")*tT;p=p==="auto"?h-PX:-p*tT;var g=i.get("minAngle")*tT,m=g+d,v=0;n.each(a,function(U){!isNaN(U)&&v++});var _=n.getSum(a),y=Math.PI/(_||v)*2,x=i.get("clockwise"),M=i.get("roseType"),S=i.get("stillShowZeroSum"),w=n.getDataExtent(a);w[0]=0;var T=x?1:-1,C=[h,p],b=T*d/2;l_(C,!x),h=C[0],p=C[1];var E=Math.abs(p-h),I=E,R=0,A=h;if(n.setLayout({viewRect:o,r:c}),n.each(a,function(U,B){var F;if(isNaN(U)){n.setItemLayout(B,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:l,cy:u,r0:f,r:M?NaN:c});return}M!=="area"?F=_===0&&S?y:U*y:F=E/v,FF?(G=A+T*F/2,Y=G):(G=A+b,Y=k-b),n.setItemLayout(B,{angle:F,startAngle:G,endAngle:Y,clockwise:x,cx:l,cy:u,r0:f,r:M?rr(U,w,[f,c]):c}),A=k}),It?v:m,M=Math.abs(y.label.y-t);if(M>=x.maxY){var S=y.label.x-e-y.len2*n,w=i+y.len,T=Math.abs(S)r.unconstrainedWidth?null:p:null;i.setStyle("width",d)}var g=i.getBoundingRect();a.width=g.width;var m=(i.style.margin||0)+2.1;a.height=g.height+m,a.y-=(a.height-f)/2}}}function oI(r){return r.position==="center"}function sI(r){var e=r.getData(),t=[],i,n,a=!1,o=(r.get("minShowLabelAngle")||0)*Dme,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function p(S){S.ignore=!0}function d(S){if(!S.ignore)return!0;for(var w in S.states)if(S.states[w].ignore===!1)return!0;return!1}e.each(function(S){var w=e.getItemGraphicEl(S),T=w.shape,C=w.getTextContent(),b=w.getTextGuideLine(),E=e.getItemModel(S),I=E.getModel("label"),R=I.get("position")||E.get(["emphasis","label","position"]),A=I.get("distanceToLabelLine"),D=I.get("alignTo"),U=Fe(I.get("edgeDistance"),u),B=I.get("bleedMargin"),F=E.getModel("labelLine"),k=F.get("length");k=Fe(k,u);var G=F.get("length2");if(G=Fe(G,u),Math.abs(T.endAngle-T.startAngle)0?"right":"left":J>0?"left":"right"}var xe=Math.PI,Le=0,Ue=I.get("rotate");if(At(Ue))Le=Ue*(xe/180);else if(R==="center")Le=0;else if(Ue==="radial"||Ue===!0){var Ne=J<0?-Y+xe:-Y;Le=Ne}else if(Ue==="tangential"&&R!=="outside"&&R!=="outer"){var Ve=Math.atan2(J,Q);Ve<0&&(Ve=xe*2+Ve);var ct=Q>0;ct&&(Ve=xe+Ve),Le=Ve-xe}if(a=!!Le,C.x=V,C.y=K,C.rotation=Le,C.setStyle({verticalAlign:"middle"}),ue){C.setStyle({align:ve});var ne=C.states.select;ne&&(ne.x+=C.x,ne.y+=C.y)}else{var z=C.getBoundingRect().clone();z.applyTransform(C.getComputedTransform());var L=(C.style.margin||0)+2.1;z.y-=L/2,z.height+=L,t.push({label:C,labelLine:b,position:R,len:k,len2:G,minTurnAngle:F.get("minTurnAngle"),maxSurfaceAngle:F.get("maxSurfaceAngle"),surfaceNormal:new Nt(J,Q),linePoints:ae,textAlign:ve,labelDistance:A,labelAlignTo:D,edgeDistance:U,bleedMargin:B,rect:z,unconstrainedWidth:z.width,labelStyleWidth:C.style.width})}w.setTextConfig({inside:ue})}}),!a&&r.get("avoidLabelOverlap")&&Ime(t,i,n,l,u,h,c,f);for(var g=0;g0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f=a.r0}},e.type="pie",e}(Yt),UX=Ume;function To(r,e,t){e=pe(e)&&{coordDimensions:e}||fe({encodeDefine:r.getEncode()},e);var i=r.getSource(),n=js(i,e).dimensions,a=new ti(n,r);return a.initData(i,t),a}var Ome=function(){function r(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return r.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},r.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},r.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},r.prototype.getItemVisual=function(e,t){var i=this._getDataWithEncodedVisual();return i.getItemVisual(e,t)},r}(),jl=Ome;var Fme=vt(),zme=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new jl(Be(this.getData,this),Be(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return To(this,{coordDimensions:["value"],encodeDefaulter:ot(uv,this)})},e.prototype.getDataParams=function(t){var i=this.getData(),n=Fme(i),a=n.seats;if(!a){var o=[];i.each(i.mapDimension("value"),function(l){o.push(l)}),a=n.seats=ZL(o,i.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,t);return s.percent=a[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){yo(t,"labelLine",["show"]);var i=t.labelLine,n=t.emphasis.labelLine;i.show=i.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(jt),OX=zme;function lI(r){return{seriesType:r,reset:function(e,t){var i=e.getData();i.filterSelf(function(n){var a=i.mapDimension("value"),o=i.get(a,n);return!(At(o)&&!isNaN(o)&&o<0)})}}}function uI(r){r.registerChartView(UX),r.registerSeriesModel(OX),r1("pie",r.registerAction),r.registerLayout(ot(aI,"pie")),r.registerProcessor(tl("pie")),r.registerProcessor(lI("pie"))}var Bme=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,i){return hn(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(t,i,n){return n.point(i.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(jt),FX=Bme;var zX=4,kme=function(){function r(){}return r}(),Vme=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i._off=0,i.hoverDataIdx=-1,i}return e.prototype.getDefaultShape=function(){return new kme},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,i){var n=i.points,a=i.size,o=this.symbolProxy,s=o.shape,l=t.getContext?t.getContext():t,u=l&&a[0]=0;u--){var c=u*2,f=a[c]-s/2,h=a[c+1]-l/2;if(t>=f&&i>=h&&t<=f+s&&i<=h+l)return u}return-1},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect();if(t=n[0],i=n[1],a.contain(t,i)){var o=this.hoverDataIdx=this.findDataIndex(t,i);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var i=this.shape,n=i.points,a=i.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,f=-1/0,h=0;h=0&&(u.dataIndex=f+(e.startIndex||0))})},r.prototype.remove=function(){this._clear()},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),BX=Gme;var Hme=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,i,n){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,i,n){this._symbolDraw.incrementalUpdate(t,i.getData(),{clipShape:this._getClipShape(i)}),this._finished=t.end===i.getData().count()},e.prototype.updateTransform=function(t,i,n){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=el("").reset(t,i,n);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var i=t.coordinateSystem;return i&&i.getArea&&i.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,i){var n=this._symbolDraw,a=i.pipelineContext,o=a.large;return(!n||o!==this._isLargeDraw)&&(n&&n.remove(),n=this._symbolDraw=o?new BX:new Yl,this._isLargeDraw=o,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,i){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Yt),kX=Hme;var Wme=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Pt),VX=Wme;var rT=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Cr).models[0]},e.type="cartesian2dAxis",e}(Pt);wr(rT,Gl);var GX={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},Xme=_t({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},GX),cI=_t({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},GX),Yme=_t({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},cI),qme=Ye({logBase:10},cI),iT={category:Xme,value:cI,time:Yme,log:qme};var HX={value:1,category:1,time:1,log:1};function rl(r,e,t,i){N(HX,function(n,a){var o=_t(_t({},iT[a],!0),i,!0),s=function(l){Z(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=e+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,f){var h=Af(this),p=h?rs(c):{},d=f.getTheme();_t(c,d.get(a+"Axis")),_t(c,this.getDefaultOption()),c.type=WX(c),h&&za(c,p,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=rx.createByAxisModel(this))},u.prototype.getCategories=function(c){var f=this.option;if(f.type==="category")return c?f.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(t);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(e+"Axis",WX)}function WX(r){return r.type||(r.data?"category":"value")}var Zme=function(){function r(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return r.prototype.getAxis=function(e){return this._axes[e]},r.prototype.getAxes=function(){return de(this._dimList,function(e){return this._axes[e]},this)},r.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Wt(this.getAxes(),function(t){return t.scale.type===e})},r.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},r}(),XX=Zme;var nT=["x","y"];function YX(r){return r.type==="interval"||r.type==="time"}var jme=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=nT,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!YX(t)||!YX(i))){var n=t.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,f=(s[1]-o[1])/u,h=o[0]-n[0]*c,p=o[1]-a[0]*f,d=this._transform=[c,0,0,f,h,p];this._invTransform=Yo([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,i){var n=this.dataToPoint(t),a=this.dataToPoint(i),o=this.getArea(),s=new lt(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},e.prototype.dataToPoint=function(t,i,n){n=n||[];var a=t[0],o=t[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return fi(n,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},e.prototype.clampData=function(t,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(t[0]),u=a.parse(t[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},e.prototype.pointToData=function(t,i){var n=[];if(this._invTransform)return fi(n,t,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(t[0]),i),n[1]=o.coordToData(o.toLocalCoord(t[1]),i),n},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-t,o=Math.min(n[0],n[1])-t,s=Math.max(i[0],i[1])-a+t,l=Math.max(n[0],n[1])-o+t;return new lt(a,o,s,l)},e}(XX),qX=jme;var Kme=function(r){Z(e,r);function e(t,i,n,a,o){var s=r.call(this,t,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),t&&i[0]>i[1]&&i.reverse(),i},e.prototype.pointToData=function(t,i){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),i)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(pn),ZX=Kme;function gx(r,e,t){t=t||{};var i=r.coordinateSystem,n=e.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,c=i.getRect(),f=[c.x,c.x+c.width,c.y,c.y+c.height],h={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,d=u==="x"?[f[2]-p,f[3]+p]:[f[0]-p,f[1]+p];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));d[h.onZero]=Math.max(Math.min(g,d[1]),d[0])}a.position=[u==="y"?d[h[l]]:f[0],u==="x"?d[h[l]]:f[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var m={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=m[s],a.labelOffset=o?d[h[s]]-d[h.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),Br(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var v=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-v:v,a.z2=1,a}function fI(r){return r.get("coordinateSystem")==="cartesian2d"}function hI(r){var e={xAxisModel:null,yAxisModel:null};return N(e,function(t,i){var n=i.replace(/Model$/,""),a=r.getReferringComponents(n,Cr).models[0];e[i]=a}),e}var pI=Math.log;function aT(r,e,t){var i=Ha.prototype,n=i.getTicks.call(t),a=i.getTicks.call(t,!0),o=n.length-1,s=i.getInterval.call(t),l=d2(r,e),u=l.extent,c=l.fixMin,f=l.fixMax;if(r.type==="log"){var h=pI(r.base);u=[pI(u[0])/h,pI(u[1])/h]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:c,fixMax:f});var p=i.getExtent.call(r);c&&(u[0]=p[0]),f&&(u[1]=p[1]);var d=i.getInterval.call(r),g=u[0],m=u[1];if(c&&f)d=(m-g)/o;else if(c)for(m=u[0]+d*o;mu[0]&&isFinite(g)&&isFinite(u[0]);)d=_1(d),g=u[1]-d*o;else{var v=r.getTicks().length-1;v>o&&(d=_1(d));var _=d*o;m=Math.ceil(u[1]/d)*d,g=Ar(m-_),g<0&&u[0]>=0?(g=0,m=Ar(_)):m>0&&u[1]<=0&&(m=0,g=-Ar(_))}var y=(n[0].value-a[0].value)/s,x=(n[o].value-a[o].value)/s;if(i.setExtent.call(r,g+d*y,m+d*x),i.setInterval.call(r,d),(y||x)&&i.setNiceExtent.call(r,g+d,m-d),0)var M}var Jme=function(){function r(e,t,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=nT,this._initCartesian(e,t,i),this.model=e}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model);function n(o){var s,l=bt(o),u=l.length;if(u){for(var c=[],f=u-1;f>=0;f--){var h=+l[f],p=o[h],d=p.model,g=p.scale;ix(g)&&d.get("alignTicks")&&d.get("interval")==null?c.push(p):(Vl(g,d),ix(g)&&(s=p))}c.length&&(s||(s=c.pop(),Vl(s.scale,s.model)),N(c,function(m){aT(m.scale,m.model,s.scale)}))}}n(i.x),n(i.y);var a={};N(i.x,function(o){KX(i,"y",o,a)}),N(i.y,function(o){KX(i,"x",o,a)}),this.resize(this.model,t)},r.prototype.resize=function(e,t,i){var n=e.getBoxLayoutParams(),a=!i&&e.get("containLabel"),o=xr(n,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(N(s,function(u){if(!u.model.get(["axisLabel","inside"])){var c=l8(u);if(c){var f=u.isHorizontal()?"height":"width",h=u.model.get(["axisLabel","margin"]);o[f]-=c[f]+h,u.position==="top"?o.y+=c.height+h:u.position==="left"&&(o.x+=c.width+h)}}}),l()),N(this._coordsList,function(u){u.calcAffineTransform()});function l(){N(s,function(u){var c=u.isHorizontal(),f=c?[0,o.width]:[0,o.height],h=u.inverse?1:0;u.setExtent(f[h],f[1-h]),$me(u,c?o.x:o.y)})}},r.prototype.getAxis=function(e,t){var i=this._axesMap[e];if(i!=null)return i[t||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var i="x"+e+"y"+t;return this._coordsMap[i]}qe(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,a=this._coordsList;n0?"top":"bottom",a="center"):Su(n-Hf)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},r.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},r}(),QX={axisLine:function(r,e,t,i){var n=e.get(["axisLine","show"]);if(n==="auto"&&r.handleAutoShown&&(n=r.handleAutoShown("axisLine")),!!n){var a=e.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(fi(s,s,o),fi(l,l,o));var c=fe({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),f=new Kr({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});Ru(f.shape,f.style.lineWidth),f.anid="line",t.add(f);var h=e.get(["axisLine","symbol"]);if(h!=null){var p=e.get(["axisLine","symbolSize"]);Ce(h)&&(h=[h,h]),(Ce(p)||At(p))&&(p=[p,p]);var d=bo(e.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];N([{rotate:r.rotation+Math.PI/2,offset:d[0],r:0},{rotate:r.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(v,_){if(h[_]!=="none"&&h[_]!=null){var y=Sr(h[_],-g/2,-m/2,g,m,c.stroke,!0),x=v.r+v.offset,M=u?l:s;y.attr({rotation:v.rotate,x:M[0]+x*Math.cos(r.rotation),y:M[1]-x*Math.sin(r.rotation),silent:!0,z2:11}),t.add(y)}})}}},axisTickLabel:function(r,e,t,i){var n=tve(t,i,e,r),a=ive(t,i,e,r);if(eve(e,a,n),rve(t,i,e,r.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=U1(de(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));F1(o)}},axisName:function(r,e,t,i){var n=Br(r.axisName,e.get("name"));if(n){var a=e.get("nameLocation"),o=r.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),c=u[0]>u[1]?-1:1,f=[a==="start"?u[0]-c*l:a==="end"?u[1]+c*l:(u[0]+u[1])/2,t9(a)?r.labelOffset+o*l:0],h,p=e.get("nameRotate");p!=null&&(p=p*Hf/180);var d;t9(a)?h=Qp.innerTextLayout(r.rotation,p??r.rotation,o):(h=Qme(r.rotation,a,p||0,u),d=r.axisNameAvailableWidth,d!=null&&(d=Math.abs(d/Math.sin(h.rotation)),!isFinite(d)&&(d=null)));var g=s.getFont(),m=e.get("nameTruncate",!0)||{},v=m.ellipsis,_=Br(r.nameTruncateMaxWidth,m.maxWidth,d),y=new Lt({x:f[0],y:f[1],rotation:h.rotation,silent:Qp.isLabelSilent(e),style:fr(s,{text:n,font:g,overflow:"truncate",width:_,ellipsis:v,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||h.textAlign,verticalAlign:s.get("verticalAlign")||h.textVerticalAlign}),z2:1});if(Vs({el:y,componentModel:e,itemName:n}),y.__fullText=n,y.anid="name",e.get("triggerEvent")){var x=Qp.makeAxisEventDataBase(e);x.targetType="axisName",x.name=n,rt(y).eventData=x}i.add(y),y.updateTransform(),t.add(y),y.decomposeTransform()}}};function Qme(r,e,t,i){var n=t_(t-r),a,o,s=i[0]>i[1],l=e==="start"&&!s||e!=="start"&&s;return Su(n-Hf/2)?(o=l?"bottom":"top",a="center"):Su(n-Hf*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",nHf/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function eve(r,e,t){if(!L1(r.axis)){var i=r.get(["axisLabel","showMinLabel"]),n=r.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=t[0],c=t[1],f=t[t.length-1],h=t[t.length-2];i===!1?(us(a),us(u)):e9(a,o)&&(i?(us(o),us(c)):(us(a),us(u))),n===!1?(us(s),us(f)):e9(l,s)&&(n?(us(l),us(h)):(us(s),us(f)))}}function us(r){r&&(r.ignore=!0)}function e9(r,e){var t=r&&r.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(!(!t||!i)){var n=uf([]);return Ca(n,n,-r.rotation),t.applyTransform(Aa([],n,r.getLocalTransform())),i.applyTransform(Aa([],n,e.getLocalTransform())),t.intersect(i)}}function t9(r){return r==="middle"||r==="center"}function r9(r,e,t,i,n){for(var a=[],o=[],s=[],l=0;l=0||r===e}function n9(r){var e=oT(r);if(e){var t=e.axisPointerModel,i=e.axis.scale,n=t.option,a=t.get("status"),o=t.get("value");o!=null&&(o=i.parse(o));var s=vI(t);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0&&!d.min?d.min=0:d.min!=null&&d.min<0&&!d.max&&(d.max=0);var g=l;d.color!=null&&(g=Ye({color:d.color},l));var m=_t(Qe(d),{boundaryGap:t,splitNumber:i,scale:n,axisLine:a,axisTick:o,axisLabel:s,name:d.text,showName:u,nameLocation:"end",nameGap:f,nameTextStyle:g,triggerEvent:h},!1);if(Ce(c)){var v=m.name;m.name=c.replace("{value}",v??"")}else He(c)&&(m.name=c(m.name,m));var _=new Zt(m,null,this.ecModel);return wr(_,Gl.prototype),_.mainType="radar",_.componentIndex=this.componentIndex,_},this);this._indicatorModels=p},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:_t({lineStyle:{color:"#bbb"}},yx.axisLine),axisLabel:cT(yx.axisLabel,!1),axisTick:cT(yx.axisTick,!1),splitLine:cT(yx.splitLine,!0),splitArea:cT(yx.splitArea,!0),indicator:[]},e}(Pt),d9=mve;var vve=["axisLine","axisTickLabel","axisName"],gve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var i=t.coordinateSystem,n=i.getIndicatorAxes(),a=de(n,function(o){var s=o.model.get("showName")?o.name:"",l=new Cn(o.model,{axisName:s,position:[i.cx,i.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});N(a,function(o){N(vve,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var i=t.coordinateSystem,n=i.getIndicatorAxes();if(!n.length)return;var a=t.get("shape"),o=t.getModel("splitLine"),s=t.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),f=s.get("show"),h=l.get("color"),p=u.get("color"),d=pe(h)?h:[h],g=pe(p)?p:[p],m=[],v=[];function _(D,U,B){var F=B%U.length;return D[F]=D[F]||[],F}if(a==="circle")for(var y=n[0].getTicksCoords(),x=i.cx,M=i.cy,S=0;S3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;EI(this,"zoom","zoomOnMouseWheel",t,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(n){var f=Math.abs(a),h=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);EI(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!wI(this._zr,"globalPan")){var i=t.pinchScale>1?1.1:1/1.1;EI(this,"zoom",null,t,{scale:i,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(Di);function EI(r,e,t,i,n){r.pointerChecker&&r.pointerChecker(i,n.originX,n.originY)&&(Ea(i.event),b9(r,e,t,i,n))}function b9(r,e,t,i,n){n.isAvailableBehavior=Be(fT,null,t,i),r.trigger(e,n)}function fT(r,e,t){var i=t[r];return!r||i&&(!Ce(i)||e.event[i+"Key"])}var Kl=xve;function Av(r,e,t){var i=r.target;i.x+=e,i.y+=t,i.dirty()}function Cv(r,e,t,i){var n=r.target,a=r.zoomLimit,o=r.zoom=r.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/r.zoom;r.zoom=o,n.x-=(t-n.x)*(u-1),n.y-=(i-n.y)*(u-1),n.scaleX*=u,n.scaleY*=u,n.dirty()}var Sve={axisPointer:1,tooltip:1,brush:1};function Wf(r,e,t){var i=e.getComponentByElement(r.topTarget),n=i&&i.coordinateSystem;return i&&i!==t&&!Sve.hasOwnProperty(i.mainType)&&n&&n.model!==t}function hT(r){if(Ce(r)){var e=new DOMParser;r=e.parseFromString(r,"text/xml")}var t=r;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var CI,pT={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},w9=bt(pT),dT={"alignment-baseline":"textBaseline","stop-color":"stopColor"},T9=bt(dT),Mve=function(){function r(){this._defs={},this._root=null}return r.prototype.parse=function(e,t){t=t||{};var i=hT(e);this._defsUsePending=[];var n=new Ze;this._root=n;var a=[],o=i.getAttribute("viewBox")||"",s=parseFloat(i.getAttribute("width")||t.width),l=parseFloat(i.getAttribute("height")||t.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),Eo(i,n,null,!0,!1);for(var u=i.firstChild;u;)this._parseNode(u,n,a,null,!1,!1),u=u.nextSibling;Tve(this._defs,this._defsUsePending),this._defsUsePending=[];var c,f;if(o){var h=mT(o);h.length>=4&&(c={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(c&&s!=null&&l!=null&&(f=LI(c,{x:0,y:0,width:s,height:l}),!t.ignoreViewBox)){var p=n;n=new Ze,n.add(p),p.scaleX=p.scaleY=f.scale,p.x=f.x,p.y=f.y}return!t.ignoreRootClip&&s!=null&&l!=null&&n.setClipPath(new Tt({shape:{x:0,y:0,width:s,height:l}})),{root:n,width:s,height:l,viewBoxRect:c,viewBoxTransform:f,named:a}},r.prototype._parseNode=function(e,t,i,n,a,o){var s=e.nodeName.toLowerCase(),l,u=n;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=t;else{if(!a){var c=CI[s];if(c&&tt(CI,s)){l=c.call(this,e,t);var f=e.getAttribute("name");if(f){var h={name:f,namedFrom:null,svgNodeTagLower:s,el:l};i.push(h),s==="g"&&(u=h)}else n&&i.push({name:n.name,namedFrom:n,svgNodeTagLower:s,el:l});t.add(l)}}var p=E9[s];if(p&&tt(E9,s)){var d=p.call(this,e),g=e.getAttribute("id");g&&(this._defs[g]=d)}}if(l&&l.isGroup)for(var m=e.firstChild;m;)m.nodeType===1?this._parseNode(m,l,i,u,a,o):m.nodeType===3&&o&&this._parseText(m,l),m=m.nextSibling},r.prototype._parseText=function(e,t){var i=new bu({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});cs(t,i),Eo(e,i,this._defsUsePending,!1,!1),bve(i,t);var n=i.style,a=n.fontSize;a&&a<9&&(n.fontSize=9,i.scaleX*=a/9,i.scaleY*=a/9);var o=(n.fontSize||n.fontFamily)&&[n.fontStyle,n.fontWeight,(n.fontSize||12)+"px",n.fontFamily||"sans-serif"].join(" ");n.font=o;var s=i.getBoundingRect();return this._textX+=s.width,t.add(i),i},r.internalField=function(){CI={g:function(e,t){var i=new Ze;return cs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i},rect:function(e,t){var i=new Tt;return cs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),i.silent=!0,i},circle:function(e,t){var i=new oa;return cs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),i.silent=!0,i},line:function(e,t){var i=new Kr;return cs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),i.silent=!0,i},ellipse:function(e,t){var i=new v_;return cs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),i.silent=!0,i},polygon:function(e,t){var i=e.getAttribute("points"),n;i&&(n=R9(i));var a=new ei({shape:{points:n||[]},silent:!0});return cs(t,a),Eo(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var i=e.getAttribute("points"),n;i&&(n=R9(i));var a=new $r({shape:{points:n||[]},silent:!0});return cs(t,a),Eo(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var i=new Ur;return cs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),i.silent=!0,i},text:function(e,t){var i=e.getAttribute("x")||"0",n=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(i)+parseFloat(a),this._textY=parseFloat(n)+parseFloat(o);var s=new Ze;return cs(t,s),Eo(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,t){var i=e.getAttribute("x"),n=e.getAttribute("y");i!=null&&(this._textX=parseFloat(i)),n!=null&&(this._textY=parseFloat(n));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new Ze;return cs(t,s),Eo(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,t){var i=e.getAttribute("d")||"",n=ow(i);return cs(t,n),Eo(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}}(),r}(),E9={lineargradient:function(r){var e=parseInt(r.getAttribute("x1")||"0",10),t=parseInt(r.getAttribute("y1")||"0",10),i=parseInt(r.getAttribute("x2")||"10",10),n=parseInt(r.getAttribute("y2")||"0",10),a=new zl(e,t,i,n);return A9(r,a),C9(r,a),a},radialgradient:function(r){var e=parseInt(r.getAttribute("cx")||"0",10),t=parseInt(r.getAttribute("cy")||"0",10),i=parseInt(r.getAttribute("r")||"0",10),n=new cw(e,t,i);return A9(r,n),C9(r,n),n}};function A9(r,e){var t=r.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function C9(r,e){for(var t=r.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var i=t.getAttribute("offset"),n=void 0;i&&i.indexOf("%")>0?n=parseInt(i,10)/100:i?n=parseFloat(i):n=0;var a={};D9(t,a,a);var o=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:n,color:o})}t=t.nextSibling}}function cs(r,e){r&&r.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),Ye(e.__inheritedStyle,r.__inheritedStyle))}function R9(r){for(var e=mT(r),t=[],i=0;i0;a-=2){var o=i[a],s=i[a-1],l=mT(o);switch(n=n||wi(),s){case"translate":_n(n,n,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Cm(n,n,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Ca(n,n,-parseFloat(l[0])*RI,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*RI);Aa(n,[1,0,u,1,0,0],n);break;case"skewY":var c=Math.tan(parseFloat(l[0])*RI);Aa(n,[1,c,0,1,0,0],n);break;case"matrix":n[0]=parseFloat(l[0]),n[1]=parseFloat(l[1]),n[2]=parseFloat(l[2]),n[3]=parseFloat(l[3]),n[4]=parseFloat(l[4]),n[5]=parseFloat(l[5]);break}}e.setLocalTransform(n)}}var P9=/([^\s:;]+)\s*:\s*([^:;]+)/g;function D9(r,e,t){var i=r.getAttribute("style");if(i){P9.lastIndex=0;for(var n;(n=P9.exec(i))!=null;){var a=n[1],o=tt(pT,a)?pT[a]:null;o&&(e[o]=n[2]);var s=tt(dT,a)?dT[a]:null;s&&(t[s]=n[2])}}}function Rve(r,e,t){for(var i=0;i0,m={api:i,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:g,isGeo:o,transformInfoRaw:h};l.resourceType==="geoJSON"?this._buildGeoJSON(m):l.resourceType==="geoSVG"&&this._buildSVG(m),this._updateController(e,t,i),this._updateMapSelectHandler(e,u,i,n)},r.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=ke(),i=ke(),n=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function c(p,d){return d&&(p=d(p)),p&&[p[0]*a.scaleX+a.x,p[1]*a.scaleY+a.y]}function f(p){for(var d=[],g=!u&&l&&l.project,m=0;m=0)&&(h=n);var p=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Nr(e,Tr(i),{labelFetcher:h,labelDataIndex:f,defaultText:t},p);var d=e.getTextContent();if(d&&(W9(d).ignore=d.ignore,e.textConfig&&o)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function k9(r,e,t,i,n,a){r.data?r.data.setItemGraphicEl(a,e):rt(e).eventData={componentType:"geo",componentIndex:n.componentIndex,geoIndex:n.componentIndex,name:t,region:i&&i.option||{}}}function V9(r,e,t,i,n){r.data||Vs({el:e,componentModel:n,itemName:t,itemTooltipOption:i.get("tooltip")})}function G9(r,e,t,i,n){e.highDownSilentOnTouch=!!n.get("selectedMode");var a=i.getModel("emphasis"),o=a.get("focus");return nr(e,o,a.get("blurScope"),a.get("disabled")),r.isGeo&&v4(e,n,t),o}function H9(r,e,t){var i=[],n;function a(){n=[]}function o(){n.length&&(i.push(n),n=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&n.push([l,u])},sphere:function(){}});return!t&&s.polygonStart(),N(r,function(l){s.lineStart();for(var u=0;u-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(jt),Y9=Hve;function Wve(r,e){var t={};return N(r,function(i){i.each(i.mapDimension("value"),function(n,a){var o="ec-"+i.getName(a);t[o]=t[o]||[],isNaN(n)||t[o].push(n)})}),r[0].map(r[0].mapDimension("value"),function(i,n){for(var a="ec-"+r[0].getName(n),o=0,s=1/0,l=-1/0,u=t[a].length,c=0;c1?(x.width=y,x.height=y/m):(x.height=y,x.width=y*m),x.y=_[1]-x.height/2,x.x=_[0]-x.width/2;else{var M=r.getBoxLayoutParams();M.aspect=m,x=xr(M,{width:d,height:g})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(r.get("center"),e),this.setZoom(r.get("zoom"))}function qve(r,e){N(e.get("geoCoord"),function(t,i){r.addGeoCoord(i,t)})}var Zve=function(){function r(){this.dimensions=zI}return r.prototype.create=function(e,t){var i=[];function n(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}e.eachComponent("geo",function(o,s){var l=o.get("map"),u=new BI(l+s,l,fe({nameMap:o.get("nameMap")},n(o)));u.zoomLimit=o.get("scaleLimit"),i.push(u),o.coordinateSystem=u,u.model=o,u.resize=J9,u.resize(o,t)}),e.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=i[l]}});var a={};return e.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),N(a,function(o,s){var l=de(o,function(c){return c.get("nameMap")}),u=new BI(s,s,fe({nameMap:Sm(l)},n(o[0])));u.zoomLimit=Br.apply(null,de(o,function(c){return c.get("scaleLimit")})),i.push(u),u.resize=J9,u.resize(o[0],t),N(o,function(c){c.coordinateSystem=u,qve(u,c)})}),i},r.prototype.getFilledRegions=function(e,t,i,n){for(var a=(e||[]).slice(),o=ke(),s=0;s=0;o--){var s=n[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},t.push(s)}}function r7(r,e){var t=r.isExpand?r.children:[],i=r.parentNode.children,n=r.hierNode.i?i[r.hierNode.i-1]:null;if(t.length){Qve(r);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;n?(r.hierNode.prelim=n.hierNode.prelim+e(r,n),r.hierNode.modifier=r.hierNode.prelim-a):r.hierNode.prelim=a}else n&&(r.hierNode.prelim=n.hierNode.prelim+e(r,n));r.parentNode.hierNode.defaultAncestor=ege(r,n,r.parentNode.hierNode.defaultAncestor||i[0],e)}function i7(r){var e=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:e},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function HI(r){return arguments.length?r:ige}function rd(r,e){return r-=Math.PI/2,{x:e*Math.cos(r),y:e*Math.sin(r)}}function n7(r,e){return xr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Qve(r){for(var e=r.children,t=e.length,i=0,n=0;--t>=0;){var a=e[t];a.hierNode.prelim+=i,a.hierNode.modifier+=i,n+=a.hierNode.change,i+=a.hierNode.shift+n}}function ege(r,e,t,i){if(e){for(var n=r,a=r,o=a.parentNode.children[0],s=e,l=n.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,f=s.hierNode.modifier;s=VI(s),a=GI(a),s&&a;){n=VI(n),o=GI(o),n.hierNode.ancestor=r;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+i(s,a);h>0&&(rge(tge(s,r,t),r,h),u+=h,l+=h),f+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=n.hierNode.modifier,c+=o.hierNode.modifier}s&&!VI(n)&&(n.hierNode.thread=s,n.hierNode.modifier+=f-l),a&&!GI(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,t=r)}return t}function VI(r){var e=r.children;return e.length&&r.isExpand?e[e.length-1]:r.hierNode.thread}function GI(r){var e=r.children;return e.length&&r.isExpand?e[0]:r.hierNode.thread}function tge(r,e,t){return r.hierNode.ancestor.parentNode===e.parentNode?r.hierNode.ancestor:t}function rge(r,e,t){var i=t/(e.hierNode.i-r.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,r.hierNode.change+=i}function ige(r,e){return r.parentNode===e.parentNode?1:2}var nge=function(){function r(){this.parentPoint=[],this.childPoints=[]}return r}(),age=function(r){Z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new nge},e.prototype.buildPath=function(t,i){var n=i.childPoints,a=n.length,o=i.parentPoint,s=n[0],l=n[a-1];if(a===1){t.moveTo(o[0],o[1]),t.lineTo(s[0],s[1]);return}var u=i.orient,c=u==="TB"||u==="BT"?0:1,f=1-c,h=Fe(i.forkPosition,1),p=[];p[c]=o[c],p[f]=o[f]+(l[f]-o[f])*h,t.moveTo(o[0],o[1]),t.lineTo(p[0],p[1]),t.moveTo(s[0],s[1]),p[c]=s[c],t.lineTo(p[0],p[1]),p[c]=l[c],t.lineTo(p[0],p[1]),t.lineTo(l[0],l[1]);for(var d=1;d_.x,M||(x=x-Math.PI));var w=M?"left":"right",T=s.getModel("label"),C=T.get("rotate"),b=C*(Math.PI/180),E=m.getTextContent();E&&(m.setTextConfig({position:T.get("position")||w,rotation:C==null?-x:b,origin:"center"}),E.setStyle("verticalAlign","middle"))}var I=s.get(["emphasis","focus"]),R=I==="relative"?ep(o.getAncestorsIndices(),o.getDescendantIndices()):I==="ancestor"?o.getAncestorsIndices():I==="descendant"?o.getDescendantIndices():null;R&&(rt(t).focus=R),sge(n,o,c,t,d,p,g,i),t.__edge&&(t.onHoverStateChange=function(A){if(A!=="blur"){var D=o.parentNode&&r.getItemGraphicEl(o.parentNode.dataIndex);D&&D.hoverState===Cp||Rp(t.__edge,A)}})}function sge(r,e,t,i,n,a,o,s){var l=e.getModel(),u=r.get("edgeShape"),c=r.get("layout"),f=r.getOrient(),h=r.get(["lineStyle","curveness"]),p=r.get("edgeForkPosition"),d=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(g||(g=i.__edge=new Dp({shape:WI(c,f,h,n,n)})),Dt(g,{shape:WI(c,f,h,a,o)},r));else if(u==="polyline"&&c==="orthogonal"&&e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var m=e.children,v=[],_=0;_t&&(t=n.height)}this.height=t+1},r.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,i=t.data.getItemModel(this.dataIndex);return i.getModel(e)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},r.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var i=t.getData().tree.root,n=r.targetNode;if(Ce(n)&&(n=i.getNodeById(n)),n&&i.contains(n))return{node:n};var a=r.targetNodeId;if(a!=null&&(n=i.getNodeById(a)))return{node:n}}}function YI(r){for(var e=[];r;)r=r.parentNode,r&&e.push(r);return e.reverse()}function Pv(r,e){var t=YI(r);return dt(t,e)>=0}function Yf(r,e){for(var t=[];r;){var i=r.dataIndex;t.push({name:r.name,dataIndex:i,value:e.getRawValue(i)}),r=r.parentNode}return t.reverse(),t}var yge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var i={name:t.name,children:t.data},n=t.leaves||{},a=new Zt(n,this,this.ecModel),o=Lv.createTree(i,this,s);function s(f){f.wrapMethod("getItemModel",function(h,p){var d=o.getNodeByDataIndex(p);return d&&d.children.length&&d.isExpand||(h.parentModel=a),h})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var u=t.expandAndCollapse,c=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var h=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=h&&h.collapsed!=null?!h.collapsed:f.depth<=c}),o.data},e.prototype.getOrient=function(){var t=this.get("orient");return t==="horizontal"?t="LR":t==="vertical"&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,i,n){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(t),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return Or("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treeAncestors=Yf(n,this),i.collapsed=!n.isExpand,i},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(jt),h7=yge;function p7(r,e,t){for(var i=[r],n=[],a;a=i.pop();)if(n.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)t.push(n[a])}}function ZI(r,e){r.eachSeriesByType("tree",function(t){_ge(t,e)})}function _ge(r,e){var t=n7(r,e);r.layoutInfo=t;var i=r.get("layout"),n=0,a=0,o=null;i==="radial"?(n=2*Math.PI,a=Math.min(t.height,t.width)/2,o=HI(function(y,x){return(y.parentNode===x.parentNode?1:2)/y.depth})):(n=t.width,a=t.height,o=HI());var s=r.getData().tree.root,l=s.children[0];if(l){t7(s),p7(l,r7,o),s.hierNode.modifier=-l.hierNode.prelim,Dv(l,i7);var u=l,c=l,f=l;Dv(l,function(y){var x=y.getLayout().x;xc.getLayout().x&&(c=y),y.depth>f.depth&&(f=y)});var h=u===c?1:o(u,c)/2,p=h-u.getLayout().x,d=0,g=0,m=0,v=0;if(i==="radial")d=n/(c.getLayout().x+h+p),g=a/(f.depth-1||1),Dv(l,function(y){m=(y.getLayout().x+p)*d,v=(y.depth-1)*g;var x=rd(m,v);y.setLayout({x:x.x,y:x.y,rawX:m,rawY:v},!0)});else{var _=r.getOrient();_==="RL"||_==="LR"?(g=a/(c.getLayout().x+h+p),d=n/(f.depth-1||1),Dv(l,function(y){v=(y.getLayout().x+p)*g,m=_==="LR"?(y.depth-1)*d:n-(y.depth-1)*d,y.setLayout({x:m,y:v},!0)})):(_==="TB"||_==="BT")&&(d=n/(c.getLayout().x+h+p),g=a/(f.depth-1||1),Dv(l,function(y){m=(y.getLayout().x+p)*d,v=_==="TB"?(y.depth-1)*g:a-(y.depth-1)*g,y.setLayout({x:m,y:v},!0)}))}}}function jI(r){r.eachSeriesByType("tree",function(e){var t=e.getData(),i=t.tree;i.eachNode(function(n){var a=n.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=t.ensureUniqueItemVisual(n.dataIndex,"style");fe(s,o)})})}function d7(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var n=e.dataIndex,a=i.getData().tree,o=a.getNodeByDataIndex(n);o.isExpand=!o.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,i){t.eachComponent({mainType:"series",subType:"tree",query:e},function(n){var a=n.coordinateSystem,o=Rv(a,e,void 0,i);n.setCenter&&n.setCenter(o.center),n.setZoom&&n.setZoom(o.zoom)})})}function KI(r){r.registerChartView(c7),r.registerSeriesModel(h7),r.registerLayout(ZI),r.registerVisual(jI),d7(r)}var m7=["treemapZoomToNode","treemapRender","treemapMove"];function v7(r){for(var e=0;e1;)a=a.parentNode;var o=P_(r.ecModel,a.name||a.dataIndex+"",i);n.setVisual("decal",o)})}var xge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,i){var n={name:t.name,children:t.data};g7(n);var a=t.levels||[],o=this.designatedVisualItemStyle={},s=new Zt({itemStyle:o},this,i);a=t.levels=Sge(a,i);var l=de(a||[],function(f){return new Zt(f,s,i)},this),u=Lv.createTree(n,this,c);function c(f){f.wrapMethod("getItemModel",function(h,p){var d=u.getNodeByDataIndex(p),g=d?l[d.depth]:null;return h.parentModel=g||s,h})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return Or("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treeAncestors=Yf(n,this),i.treePathInfo=i.treeAncestors,i},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},fe(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var i=this._idIndexMap;i||(i=this._idIndexMap=ke(),this._idIndexMapCount=0);var n=i.get(t);return n==null&&i.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var i=this.getRawData().tree.root;(!t||t!==i&&!i.contains(t))&&(this._viewRoot=i)},e.prototype.enableAriaDecal=function(){Sx(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"\u25B6",zoomToNodeRatio:.32*.32,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(jt);function g7(r){var e=0;N(r.children,function(i){g7(i);var n=i.value;pe(n)&&(n=n[0]),e+=n});var t=r.value;pe(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),pe(r.value)?r.value[0]=t:r.value=t}function Sge(r,e){var t=Jt(e.get("color")),i=Jt(e.get(["aria","decal","decals"]));if(t){r=r||[];var n,a;N(r,function(s){var l=new Zt(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(n=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=r[0]||(r[0]={});return n||(o.color=t.slice()),!a&&i&&(o.decal=i.slice()),r}}var y7=xge;var Mge=8,_7=8,JI=5,bge=function(){function r(e){this.group=new Ze,e.add(this.group)}return r.prototype.render=function(e,t,i,n){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!i)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),f={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,f,u),this._renderContent(e,f,s,l,u,c,n),Ef(o,f.pos,f.box)}},r.prototype._prepare=function(e,t,i){for(var n=e;n;n=n.parentNode){var a=Yr(n.getModel().get("name"),""),o=i.getTextRect(a),s=Math.max(o.width+Mge*2,t.emptyItemWidth);t.totalWidth+=s+_7,t.renderList.push({node:n,text:a,width:s})}},r.prototype._renderContent=function(e,t,i,n,a,o,s){for(var l=0,u=t.emptyItemWidth,c=e.get(["breadcrumb","height"]),f=x5(t.pos,t.box),h=t.totalWidth,p=t.renderList,d=n.getModel("itemStyle").getItemStyle(),g=p.length-1;g>=0;g--){var m=p[g],v=m.node,_=m.width,y=m.text;h>f.width&&(h-=_-u,_=u,y=null);var x=new ei({shape:{points:wge(l,0,_,c,g===p.length-1,g===0)},style:Ye(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new Lt({style:fr(a,{text:y})}),textConfig:{position:"inside"},z2:wu*1e4,onclick:ot(s,v)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=fr(o,{text:y}),x.ensureState("emphasis").style=d,nr(x,n.get("focus"),n.get("blurScope"),n.get("disabled")),this.group.add(x),Tge(x,e,v),l+=_+_7}},r.prototype.remove=function(){this.group.removeAll()},r}();function wge(r,e,t,i,n,a){var o=[[n?r:r-JI,e],[r+t,e],[r+t,e+i],[n?r:r-JI,e+i]];return!a&&o.splice(2,0,[r+t+JI,e+i/2]),!n&&o.push([r,e+i/2]),o}function Tge(r,e,t){rt(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:t&&t.dataIndex,name:t&&t.name},treePathInfo:t&&Yf(t,e)}}var x7=bge;var Ege=function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(e,t,i,n,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:i,delay:n,easing:a}),!0)},r.prototype.finished=function(e){return this._finishedCallback=e,this},r.prototype.start=function(){for(var e=this,t=this._storage.length,i=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},n=0,a=this._storage.length;nb7||Math.abs(t.dy)>b7)){var i=this.seriesModel.getData().tree.root;if(!i)return;var n=i.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var i=t.originX,n=t.originY;if(this._state!=="animating"){var a=this.seriesModel.getData().tree.root;if(!a)return;var o=a.getLayout();if(!o)return;var s=new lt(o.x,o.y,o.width,o.height),l=this.seriesModel.layoutInfo;i-=l.x,n-=l.y;var u=wi();_n(u,u,[-i,-n]),Cm(u,u,[t.scale,t.scale]),_n(u,u,[i,n]),s.applyTransform(u),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(t){var i=this;t.on("click",function(n){if(i._state==="ready"){var a=i.seriesModel.get("nodeClick",!0);if(a){var o=i.findTarget(n.offsetX,n.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)i._rootToNode(o);else if(a==="zoomToNode")i._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&kp(u,c)}}}}},this)},e.prototype._renderBreadcrumb=function(t,i,n){var a=this;n||(n=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(i.getWidth()/2,i.getHeight()/2),n||(n={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new x7(this.group))).render(t,i,n.node,function(o){a._state!=="animating"&&(Pv(t.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=Mx(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,i){var n,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(t,i),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)n={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),n},e.type="treemap",e}(Yt);function Mx(){return{nodeGroup:[],background:[],content:[]}}function Dge(r,e,t,i,n,a,o,s,l,u){if(!o)return;var c=o.getLayout(),f=r.getData(),h=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var p=c.width,d=c.height,g=c.borderWidth,m=c.invisible,v=o.getRawIndex(),_=s&&s.getRawIndex(),y=o.viewChildren,x=c.upperHeight,M=y&&y.length,S=h.getModel("itemStyle"),w=h.getModel(["emphasis","itemStyle"]),T=h.getModel(["blur","itemStyle"]),C=h.getModel(["select","itemStyle"]),b=S.get("borderRadius")||0,E=V("nodeGroup",$I);if(!E)return;if(l.add(E),E.x=c.x||0,E.y=c.y||0,E.markRedraw(),xT(E).nodeWidth=p,xT(E).nodeHeight=d,c.isAboveViewRoot)return E;var I=V("background",M7,u,Rge);I&&k(E,I,M&&c.upperLabelHeight);var R=h.getModel("emphasis"),A=R.get("focus"),D=R.get("blurScope"),U=R.get("disabled"),B=A==="ancestor"?o.getAncestorsIndices():A==="descendant"?o.getDescendantIndices():A;if(M)Tf(E)&&Eu(E,!1),I&&(Eu(I,!U),f.setItemGraphicEl(o.dataIndex,I),tw(I,B,D));else{var F=V("content",M7,u,Lge);F&&G(E,F),I.disableMorphing=!0,I&&Tf(I)&&Eu(I,!1),Eu(E,!U),f.setItemGraphicEl(o.dataIndex,E),tw(E,B,D)}return E;function k(ve,ue,se){var Ee=rt(ue);if(Ee.dataIndex=o.dataIndex,Ee.seriesIndex=r.seriesIndex,ue.setShape({x:0,y:0,width:p,height:d,r:b}),m)Y(ue);else{ue.invisible=!1;var q=o.getVisual("style"),H=q.stroke,We=E7(S);We.fill=H;var _e=id(w);_e.fill=w.get("borderColor");var xe=id(T);xe.fill=T.get("borderColor");var Le=id(C);if(Le.fill=C.get("borderColor"),se){var Ue=p-2*g;J(ue,H,q.opacity,{x:g,y:0,width:Ue,height:x})}else ue.removeTextContent();ue.setStyle(We),ue.ensureState("emphasis").style=_e,ue.ensureState("blur").style=xe,ue.ensureState("select").style=Le,Fs(ue)}ve.add(ue)}function G(ve,ue){var se=rt(ue);se.dataIndex=o.dataIndex,se.seriesIndex=r.seriesIndex;var Ee=Math.max(p-2*g,0),q=Math.max(d-2*g,0);if(ue.culling=!0,ue.setShape({x:g,y:g,width:Ee,height:q,r:b}),m)Y(ue);else{ue.invisible=!1;var H=o.getVisual("style"),We=H.fill,_e=E7(S);_e.fill=We,_e.decal=H.decal;var xe=id(w),Le=id(T),Ue=id(C);J(ue,We,H.opacity,null),ue.setStyle(_e),ue.ensureState("emphasis").style=xe,ue.ensureState("blur").style=Le,ue.ensureState("select").style=Ue,Fs(ue)}ve.add(ue)}function Y(ve){!ve.invisible&&a.push(ve)}function J(ve,ue,se,Ee){var q=h.getModel(Ee?T7:w7),H=Yr(h.get("name"),null),We=q.getShallow("show");Nr(ve,Tr(h,Ee?T7:w7),{defaultText:We?H:null,inheritColor:ue,defaultOpacity:se,labelFetcher:r,labelDataIndex:o.dataIndex});var _e=ve.getTextContent();if(_e){var xe=_e.style,Le=Mm(xe.padding||0);Ee&&(ve.setTextConfig({layoutRect:Ee}),_e.disableLabelLayout=!0),_e.beforeUpdate=function(){var Ne=Math.max((Ee?Ee.width:ve.shape.width)-Le[1]-Le[3],0),Ve=Math.max((Ee?Ee.height:ve.shape.height)-Le[0]-Le[2],0);(xe.width!==Ne||xe.height!==Ve)&&_e.setStyle({width:Ne,height:Ve})},xe.truncateMinChar=2,xe.lineOverflow="truncate",Q(xe,Ee,c);var Ue=_e.getState("emphasis");Q(Ue?Ue.style:null,Ee,c)}}function Q(ve,ue,se){var Ee=ve?ve.text:null;if(!ue&&se.isLeafRoot&&Ee!=null){var q=r.get("drillDownIcon",!0);ve.text=q?q+" "+Ee:Ee}}function V(ve,ue,se,Ee){var q=_!=null&&t[ve][_],H=n[ve];return q?(t[ve][_]=null,K(H,q)):m||(q=new ue,q instanceof gi&&(q.z2=Ige(se,Ee)),ae(H,q)),e[ve][v]=q}function K(ve,ue){var se=ve[v]={};ue instanceof $I?(se.oldX=ue.x,se.oldY=ue.y):se.oldShape=fe({},ue.shape)}function ae(ve,ue){var se=ve[v]={},Ee=o.parentNode,q=ue instanceof Ze;if(Ee&&(!i||i.direction==="drillDown")){var H=0,We=0,_e=n.background[Ee.getRawIndex()];!i&&_e&&_e.oldShape&&(H=_e.oldShape.width,We=_e.oldShape.height),q?(se.oldX=0,se.oldY=We):se.oldShape={x:H,y:We,width:0,height:0}}se.fadein=!q}}function Ige(r,e){return r*Cge+e}var A7=Pge;var Ex=N,Nge=qe,bT=-1,rN=function(){function r(e){var t=e.mappingMethod,i=e.type,n=this.option=Qe(e);this.type=i,this.mappingMethod=t,this._normalizeData=Fge[t];var a=r.visualHandlers[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(QI(n),Uge(n)):t==="category"?n.categories?Oge(n):QI(n,!0):(kr(t!=="linear"||n.dataExtent),QI(n))}return r.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},r.prototype.getNormalizer=function(){return Be(this._normalizeData,this)},r.listVisualTypes=function(){return bt(r.visualHandlers)},r.isValidType=function(e){return r.visualHandlers.hasOwnProperty(e)},r.eachVisual=function(e,t,i){qe(e)?N(e,t,i):t.call(i,e)},r.mapVisual=function(e,t,i){var n,a=pe(e)?[]:qe(e)?{}:(n=!0,null);return r.eachVisual(e,function(o,s){var l=t.call(i,o,s);n?a=l:a[s]=l}),a},r.retrieveVisuals=function(e){var t={},i;return e&&Ex(r.visualHandlers,function(n,a){e.hasOwnProperty(a)&&(t[a]=e[a],i=!0)}),i?t:null},r.prepareVisualTypes=function(e){if(pe(e))e=e.slice();else if(Nge(e)){var t=[];Ex(e,function(i,n){t.push(n)}),e=t}else return[];return e.sort(function(i,n){return n==="color"&&i!=="color"&&i.indexOf("color")===0?1:-1}),e},r.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},r.findPieceIndex=function(e,t,i){for(var n,a=1/0,o=0,s=t.length;o=0;a--)i[a]==null&&(delete t[e[a]],e.pop())}function QI(r,e){var t=r.visual,i=[];qe(t)?Ex(t,function(a){i.push(a)}):t!=null&&i.push(t);var n={color:1,symbol:1};!e&&i.length===1&&!n.hasOwnProperty(r.type)&&(i[1]=i[0]),R7(r,i)}function ST(r){return{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);i("color",r(t("color"),n))},_normalizedToVisual:eN([0,1])}}function C7(r){var e=this.option.visual;return e[Math.round(rr(r,[0,1],[0,e.length-1],!0))]||{}}function bx(r){return function(e,t,i){i(r,this.mapValueToVisual(e))}}function Tx(r){var e=this.option.visual;return e[this.option.loop&&r!==bT?r%e.length:r]}function nd(){return this.option.visual[0]}function eN(r){return{linear:function(e){return rr(e,r,this.option.visual,!0)},category:Tx,piecewise:function(e,t){var i=tN.call(this,t);return i==null&&(i=rr(e,r,this.option.visual,!0)),i},fixed:nd}}function tN(r){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var i=rN.findPieceIndex(r,t),n=t[i];if(n&&n.visual)return n.visual[this.type]}}function R7(r,e){return r.visual=e,r.type==="color"&&(r.parsedVisual=de(e,function(t){var i=cn(t);return i||[0,0,0,1]})),e}var Fge={linear:function(r){return rr(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var e=this.option.pieceList,t=rN.findPieceIndex(r,e,!0);if(t!=null)return rr(t,[0,e.length-1],[0,1],!0)},category:function(r){var e=this.option.categories?this.option.categoryMap[r]:r;return e??bT},fixed:Ir};function MT(r,e,t){return r?e<=t:e=t.length||g===t[g.depth]){var v=Gge(n,l,g,m,d,i);I7(g,v,t,i)}})}}}function Bge(r,e,t){var i=fe({},e),n=t.designatedVisualItemStyle;return N(["color","colorAlpha","colorSaturation"],function(a){n[a]=e[a];var o=r.get(a);n[a]=null,o!=null&&(i[a]=o)}),i}function L7(r){var e=iN(r,"color");if(e){var t=iN(r,"colorAlpha"),i=iN(r,"colorSaturation");return i&&(e=up(e,null,null,i)),t&&(e=cp(e,t)),e}}function kge(r,e){return e!=null?up(e,null,null,r):null}function iN(r,e){var t=r[e];if(t!=null&&t!=="none")return t}function Vge(r,e,t,i,n,a){if(!(!a||!a.length)){var o=nN(e,"color")||n.color!=null&&n.color!=="none"&&(nN(e,"colorAlpha")||nN(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var c=e.get("colorMappingBy"),f={type:o.name,dataExtent:u,visual:o.range};f.type==="color"&&(c==="index"||c==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var h=new pi(f);return P7(h).drColorMappingBy=c,h}}}function nN(r,e){var t=r.get(e);return pe(t)&&t.length?{name:e,range:t}:null}function Gge(r,e,t,i,n,a){var o=fe({},e);if(n){var s=n.type,l=s==="color"&&P7(n).drColorMappingBy,u=l==="index"?i:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(r.get("visualDimension"));o[s]=n.mapValueToVisual(u)}return o}var Ax=Math.max,wT=Math.min,N7=Br,aN=N,O7=["itemStyle","borderWidth"],Hge=["itemStyle","gapWidth"],Wge=["upperLabel","show"],Xge=["upperLabel","height"],F7={seriesType:"treemap",reset:function(r,e,t,i){var n=t.getWidth(),a=t.getHeight(),o=r.option,s=xr(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=o.size||[],u=Fe(N7(s.width,l[0]),n),c=Fe(N7(s.height,l[1]),a),f=i&&i.type,h=["treemapZoomToNode","treemapRootToNode"],p=Gu(i,h,r),d=f==="treemapRender"||f==="treemapMove"?i.rootRect:null,g=r.getViewRoot(),m=YI(g);if(f!=="treemapMove"){var v=f==="treemapZoomToNode"?Jge(r,p,g,u,c):d?[d.width,d.height]:[u,c],_=o.sort;_&&_!=="asc"&&_!=="desc"&&(_="desc");var y={squareRatio:o.squareRatio,sort:_,leafDepth:o.leafDepth};g.hostTree.clearLayouts();var x={x:0,y:0,width:v[0],height:v[1],area:v[0]*v[1]};g.setLayout(x),z7(g,y,!1,0),x=g.getLayout(),aN(m,function(S,w){var T=(m[w+1]||g).getValue();S.setLayout(fe({dataExtent:[T,T],borderWidth:0,upperHeight:0},x))})}var M=r.getData().tree.root;M.setLayout($ge(s,d,p),!0),r.setLayoutInfo(s),B7(M,new lt(-s.x,-s.y,n,a),m,g,0)}};function z7(r,e,t,i){var n,a;if(!r.isRemoved()){var o=r.getLayout();n=o.width,a=o.height;var s=r.getModel(),l=s.get(O7),u=s.get(Hge)/2,c=k7(s),f=Math.max(l,c),h=l-u,p=f-u;r.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),n=Ax(n-2*h,0),a=Ax(a-h-p,0);var d=n*a,g=Yge(r,s,d,e,t,i);if(g.length){var m={x:h,y:p,width:n,height:a},v=wT(n,a),_=1/0,y=[];y.area=0;for(var x=0,M=g.length;x=0;l--){var u=n[i==="asc"?o-l-1:l].getValue();u/t*es[1]&&(s[1]=u)})),{sum:i,dataExtent:s}}function Kge(r,e,t){for(var i=0,n=1/0,a=0,o=void 0,s=r.length;ai&&(i=o));var l=r.area*r.area,u=e*e*t;return l?Ax(u*i/l,l/(u*n)):1/0}function U7(r,e,t,i,n){var a=e===t.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=t[s[a]],c=e?r.area/e:0;(n||c>t[l[o]])&&(c=t[l[o]]);for(var f=0,h=r.length;fe_&&(u=e_),a=s}ui&&(i=e);var a=i%2?i+2:i+3;n=[];for(var o=0;o0&&(M[0]=-M[0],M[1]=-M[1]);var w=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var T=-Math.atan2(x[1],x[0]);f[0].8?"left":h[0]<-.8?"right":"center",g=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":a.x=-h[0]*v+c[0],a.y=-h[1]*_+c[1],d=h[0]>.8?"right":h[0]<-.8?"left":"center",g=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=v*w+c[0],a.y=c[1]+C,d=x[0]<0?"right":"left",a.originX=-v*w,a.originY=-C;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=S[0],a.y=S[1]+C,d="center",a.originY=-C;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-v*w+f[0],a.y=f[1]+C,d=x[0]>=0?"right":"left",a.originX=v*w,a.originY=-C;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||d})}},e}(Ze),Ov=aye;var oye=function(){function r(e){this.group=new Ze,this._LineCtor=e||Ov}return r.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var i=this,n=i.group,a=i._lineData;i._lineData=e,a||n.removeAll();var o=Q7(e);e.diff(a).add(function(s){t._doAdd(e,s,o)}).update(function(s,l){t._doUpdate(a,e,l,s,o)}).remove(function(s){n.remove(a.getItemGraphicEl(s))}).execute()},r.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,i){t.updateLayout(e,i)},this)},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=Q7(e),this._lineData=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function i(s){!s.isGroup&&!sye(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var n=e.start;n0}function Q7(r){var e=r.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:Tr(e)}}function eY(r){return isNaN(r[0])||isNaN(r[1])}function MN(r){return r&&!eY(r[0])&&!eY(r[1])}var Fv=oye;var bN=[],wN=[],TN=[],zv=vi,EN=yu,tY=Math.abs;function rY(r,e,t){for(var i=r[0],n=r[1],a=r[2],o=1/0,s,l=t*t,u=.1,c=.1;c<=.9;c+=.1){bN[0]=zv(i[0],n[0],a[0],c),bN[1]=zv(i[1],n[1],a[1],c);var f=tY(EN(bN,e)-l);f=0?s=s+u:s=s-u:d>=0?s=s-u:s=s+u}return s}function Lx(r,e){var t=[],i=pf,n=[[],[],[]],a=[[],[]],o=[];e/=2,r.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");u.__original||(u.__original=[wa(u[0]),wa(u[1])],u[2]&&u.__original.push(wa(u[2])));var h=u.__original;if(u[2]!=null){if(qi(n[0],h[0]),qi(n[1],h[2]),qi(n[2],h[1]),c&&c!=="none"){var p=od(s.node1),d=rY(n,h[0],p*e);i(n[0][0],n[1][0],n[2][0],d,t),n[0][0]=t[3],n[1][0]=t[4],i(n[0][1],n[1][1],n[2][1],d,t),n[0][1]=t[3],n[1][1]=t[4]}if(f&&f!=="none"){var p=od(s.node2),d=rY(n,h[1],p*e);i(n[0][0],n[1][0],n[2][0],d,t),n[1][0]=t[1],n[2][0]=t[2],i(n[0][1],n[1][1],n[2][1],d,t),n[1][1]=t[1],n[2][1]=t[2]}qi(u[0],n[0]),qi(u[1],n[2]),qi(u[2],n[1])}else{if(qi(a[0],h[0]),qi(a[1],h[1]),Is(o,a[1],a[0]),Wo(o,o),c&&c!=="none"){var p=od(s.node1);N0(a[0],a[0],o,p*e)}if(f&&f!=="none"){var p=od(s.node2);N0(a[1],a[1],o,-p*e)}qi(u[0],a[0]),qi(u[1],a[1])}})}function iY(r){return r.type==="view"}var lye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){var n=new Yl,a=new Fv,o=this.group;this._controller=new Kl(i.getZr()),this._controllerHost={target:o},o.add(n.group),o.add(a.group),this._symbolDraw=n,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,i,n){var a=this,o=t.coordinateSystem;this._model=t;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(iY(o)){var c={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(c):Dt(u,c,t)}Lx(t.getGraph(),ad(t));var f=t.getData();s.updateData(f);var h=t.getEdgeData();l.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,i,n),clearTimeout(this._layoutTimeout);var p=t.forceLayout,d=t.get(["force","layoutAnimation"]);p&&this._startForceLayoutIteration(p,d);var g=t.get("layout");f.graph.eachNode(function(y){var x=y.dataIndex,M=y.getGraphicEl(),S=y.getModel();if(M){M.off("drag").off("dragend");var w=S.get("draggable");w&&M.on("drag",function(C){switch(g){case"force":p.warmUp(),!a._layouting&&a._startForceLayoutIteration(p,d),p.setFixed(x),f.setItemLayout(x,[M.x,M.y]);break;case"circular":f.setItemLayout(x,[M.x,M.y]),y.setLayout({fixed:!0},!0),Nv(t,"symbolSize",y,[C.offsetX,C.offsetY]),a.updateLayout(t);break;case"none":default:f.setItemLayout(x,[M.x,M.y]),Rx(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){p&&p.setUnfixed(x)}),M.setDraggable(w,!!S.get("cursor"));var T=S.get(["emphasis","focus"]);T==="adjacency"&&(rt(M).focus=y.getAdjacentDataIndices())}}),f.graph.eachEdge(function(y){var x=y.getGraphicEl(),M=y.getModel().get(["emphasis","focus"]);x&&M==="adjacency"&&(rt(x).focus={edge:[y.dataIndex],node:[y.node1.dataIndex,y.node2.dataIndex]})});var m=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),v=f.getLayout("cx"),_=f.getLayout("cy");f.graph.eachNode(function(y){dN(y,m,v,_)}),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,i){var n=this;(function a(){t.step(function(o){n.updateLayout(n._model),(n._layouting=!o)&&(i?n._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,i,n){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,c,f){var h=l.getBoundingRect();return h.applyTransform(l.transform),h.contain(c,f)&&!Wf(u,n,t)}),!iY(t.coordinateSystem)){o.disable();return}o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){Av(s,u.dx,u.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){Cv(s,u.scale,u.originX,u.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),Lx(t.getGraph(),ad(t)),a._lineDraw.updateLayout(),n.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,i=t.getData(),n=ad(t);i.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(n)})},e.prototype.updateLayout=function(t){Lx(t.getGraph(),ad(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(Yt),nY=lye;function Bv(r){return"_EC_"+r}var uye=function(){function r(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var i=this._nodesMap;if(!i[Bv(e)]){var n=new sd(e,t);return n.hostGraph=this,this.nodes.push(n),i[Bv(e)]=n,n}},r.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},r.prototype.getNodeById=function(e){return this._nodesMap[Bv(e)]},r.prototype.addEdge=function(e,t,i){var n=this._nodesMap,a=this._edgesMap;if(At(e)&&(e=this.nodes[e]),At(t)&&(t=this.nodes[t]),e instanceof sd||(e=n[Bv(e)]),t instanceof sd||(t=n[Bv(t)]),!(!e||!t)){var o=e.id+"-"+t.id,s=new aY(e,t,i);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),a[o]=s,s}},r.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},r.prototype.getEdge=function(e,t){e instanceof sd&&(e=e.id),t instanceof sd&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},r.prototype.eachNode=function(e,t){for(var i=this.nodes,n=i.length,a=0;a=0&&e.call(t,i[a],a)},r.prototype.eachEdge=function(e,t){for(var i=this.edges,n=i.length,a=0;a=0&&i[a].node1.dataIndex>=0&&i[a].node2.dataIndex>=0&&e.call(t,i[a],a)},r.prototype.breadthFirstTraverse=function(e,t,i,n){if(t instanceof sd||(t=this._nodesMap[Bv(t)]),!!t){for(var a=i==="out"?"outEdges":i==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=n.length;a=0&&this[r][e].setItemVisual(this.dataIndex,t,i)},getVisual:function(t){return this[r][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,i){this.dataIndex>=0&&this[r][e].setItemLayout(this.dataIndex,t,i)},getLayout:function(){return this[r][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][e].getRawIndex(this.dataIndex)}}}wr(sd,oY("hostGraph","data"));wr(aY,oY("hostGraph","edgeData"));var sY=uye;function Px(r,e,t,i,n){for(var a=new sY(i),o=0;o "+h)),u++)}var p=t.get("coordinateSystem"),d;if(p==="cartesian2d"||p==="polar")d=hn(r,t);else{var g=Uu.get(p),m=g?g.dimensions||[]:[];dt(m,"value")<0&&m.concat(["value"]);var v=js(r,{coordDimensions:m,encodeDefine:t.getEncode()}).dimensions;d=new ti(v,t),d.initData(r)}var _=new ti(["value"],t);return _.initData(l,s),n&&n(d,_),_T({mainData:d,struct:a,structAttr:"graph",datas:{node:d,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var cye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments);var i=this;function n(){return i._categoriesData}this.legendVisualProvider=new jl(n,n),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){r.prototype.mergeDefaultAndTheme.apply(this,arguments),yo(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,i){var n=t.edges||t.links||[],a=t.data||t.nodes||[],o=this;if(a&&n){H7(this);var s=Px(a,n,this,!0,l);return N(s.edges,function(u){W7(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(d){var g=o._categoriesModels,m=d.getShallow("category"),v=g[m];return v&&(v.parentModel=d.parentModel,d.parentModel=v),d});var f=Zt.prototype.getModel;function h(d,g){var m=f.call(this,d,g);return m.resolveParentPath=p,m}c.wrapMethod("getItemModel",function(d){return d.resolveParentPath=p,d.getModel=h,d});function p(d){if(d&&(d[0]==="label"||d[1]==="label")){var g=d.slice();return d[0]==="label"?g[0]="edgeLabel":d[1]==="label"&&(g[1]="edgeLabel"),g}return d}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,i,n){if(n==="edge"){var a=this.getData(),o=this.getDataParams(t,n),s=a.graph.getEdgeByIndex(t),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Or("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=Zw({series:this,dataIndex:t,multipleSeries:i});return f},e.prototype._updateCategoriesData=function(){var t=de(this.option.categories||[],function(n){return n.value!=null?n:fe({value:0},n)}),i=new ti(["value"],this);i.initData(t),this._categoriesData=i,this._categoriesModels=i.mapArray(function(n){return i.getItemModel(n)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(jt),lY=cye;var fye={type:"graphRoam",event:"graphRoam",update:"none"};function AN(r){r.registerChartView(nY),r.registerSeriesModel(lY),r.registerProcessor(sN),r.registerVisual(lN),r.registerVisual(uN),r.registerLayout(hN),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,mN),r.registerLayout(vN),r.registerCoordinateSystem("graphView",{dimensions:Vu.dimensions,create:gN}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Ir),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Ir),r.registerAction(fye,function(e,t,i){t.eachComponent({mainType:"series",query:e},function(n){var a=n.coordinateSystem,o=Rv(a,e,void 0,i);n.setCenter&&n.setCenter(o.center),n.setZoom&&n.setZoom(o.zoom)})})}var hye=function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r}(),pye=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="pointer",i}return e.prototype.getDefaultShape=function(){return new hye},e.prototype.buildPath=function(t,i){var n=Math.cos,a=Math.sin,o=i.r,s=i.width,l=i.angle,u=i.x-n(l)*s*(s>=o/3?1:2),c=i.y-a(l)*s*(s>=o/3?1:2);l=i.angle-Math.PI/2,t.moveTo(u,c),t.lineTo(i.x+n(l)*s,i.y+a(l)*s),t.lineTo(i.x+n(i.angle)*o,i.y+a(i.angle)*o),t.lineTo(i.x-n(l)*s,i.y-a(l)*s),t.lineTo(u,c)},e}(ut),uY=pye;function dye(r,e){var t=r.get("center"),i=e.getWidth(),n=e.getHeight(),a=Math.min(i,n),o=Fe(t[0],e.getWidth()),s=Fe(t[1],e.getHeight()),l=Fe(r.get("radius"),a/2);return{cx:o,cy:s,r:l}}function CT(r,e){var t=r==null?"":r+"";return e&&(Ce(e)?t=e.replace("{value}",t):He(e)&&(t=e(r))),t}var mye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),o=dye(t,n);this._renderMain(t,i,n,a,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,i,n,a,o){var s=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,c=-t.get("endAngle")/180*Math.PI,f=t.getModel("axisLine"),h=f.get("roundCap"),p=h?Tv:yi,d=f.get("show"),g=f.getModel("lineStyle"),m=g.get("width"),v=[u,c];l_(v,!l),u=v[0],c=v[1];for(var _=c-u,y=u,x=[],M=0;d&&M=C&&(b===0?0:a[b-1][0])Math.PI/2&&(V+=Math.PI)):Q==="tangential"?V=-T-Math.PI/2:At(Q)&&(V=Q*Math.PI/180),V===0?f.add(new Lt({style:fr(y,{text:k,x:Y,y:J,verticalAlign:D<-.8?"top":D>.8?"bottom":"middle",align:A<-.4?"left":A>.4?"right":"center"},{inheritColor:G}),silent:!0})):f.add(new Lt({style:fr(y,{text:k,x:Y,y:J,verticalAlign:"middle",align:"center"},{inheritColor:G}),silent:!0,originX:Y,originY:J,rotation:V}))}if(_.get("show")&&U!==x){var B=_.get("distance");B=B?B+c:c;for(var K=0;K<=M;K++){A=Math.cos(T),D=Math.sin(T);var ae=new Kr({shape:{x1:A*(d-B)+h,y1:D*(d-B)+p,x2:A*(d-w-B)+h,y2:D*(d-w-B)+p},silent:!0,style:I});I.stroke==="auto"&&ae.setStyle({stroke:a((U+K/M)/x)}),f.add(ae),T+=b}T-=b}else T+=C}},e.prototype._renderPointer=function(t,i,n,a,o,s,l,u,c){var f=this.group,h=this._data,p=this._progressEls,d=[],g=t.get(["pointer","show"]),m=t.getModel("progress"),v=m.get("show"),_=t.getData(),y=_.mapDimension("value"),x=+t.get("min"),M=+t.get("max"),S=[x,M],w=[s,l];function T(b,E){var I=_.getItemModel(b),R=I.getModel("pointer"),A=Fe(R.get("width"),o.r),D=Fe(R.get("length"),o.r),U=t.get(["pointer","icon"]),B=R.get("offsetCenter"),F=Fe(B[0],o.r),k=Fe(B[1],o.r),G=R.get("keepAspect"),Y;return U?Y=Sr(U,F-A/2,k-D,A,D,null,G):Y=new uY({shape:{angle:-Math.PI/2,width:A,r:D,x:F,y:k}}),Y.rotation=-(E+Math.PI/2),Y.x=o.cx,Y.y=o.cy,Y}function C(b,E){var I=m.get("roundCap"),R=I?Tv:yi,A=m.get("overlap"),D=A?m.get("width"):c/_.count(),U=A?o.r-D:o.r-(b+1)*D,B=A?o.r:o.r-b*D,F=new R({shape:{startAngle:s,endAngle:E,cx:o.cx,cy:o.cy,clockwise:u,r0:U,r:B}});return A&&(F.z2=M-_.get(y,b)%M),F}(v||g)&&(_.diff(h).add(function(b){var E=_.get(y,b);if(g){var I=T(b,s);ar(I,{rotation:-((isNaN(+E)?w[0]:rr(E,S,w,!0))+Math.PI/2)},t),f.add(I),_.setItemGraphicEl(b,I)}if(v){var R=C(b,s),A=m.get("clip");ar(R,{shape:{endAngle:rr(E,S,w,A)}},t),f.add(R),c_(t.seriesIndex,_.dataType,b,R),d[b]=R}}).update(function(b,E){var I=_.get(y,b);if(g){var R=h.getItemGraphicEl(E),A=R?R.rotation:s,D=T(b,A);D.rotation=A,Dt(D,{rotation:-((isNaN(+I)?w[0]:rr(I,S,w,!0))+Math.PI/2)},t),f.add(D),_.setItemGraphicEl(b,D)}if(v){var U=p[E],B=U?U.shape.endAngle:s,F=C(b,B),k=m.get("clip");Dt(F,{shape:{endAngle:rr(I,S,w,k)}},t),f.add(F),c_(t.seriesIndex,_.dataType,b,F),d[b]=F}}).execute(),_.each(function(b){var E=_.getItemModel(b),I=E.getModel("emphasis"),R=I.get("focus"),A=I.get("blurScope"),D=I.get("disabled");if(g){var U=_.getItemGraphicEl(b),B=_.getItemVisual(b,"style"),F=B.fill;if(U instanceof Ur){var k=U.style;U.useStyle(fe({image:k.image,x:k.x,y:k.y,width:k.width,height:k.height},B))}else U.useStyle(B),U.type!=="pointer"&&U.setColor(F);U.setStyle(E.getModel(["pointer","itemStyle"]).getItemStyle()),U.style.fill==="auto"&&U.setStyle("fill",a(rr(_.get(y,b),S,[0,1],!0))),U.z2EmphasisLift=0,Gr(U,E),nr(U,R,A,D)}if(v){var G=d[b];G.useStyle(_.getItemVisual(b,"style")),G.setStyle(E.getModel(["progress","itemStyle"]).getItemStyle()),G.z2EmphasisLift=0,Gr(G,E),nr(G,R,A,D)}}),this._progressEls=d)},e.prototype._renderAnchor=function(t,i){var n=t.getModel("anchor"),a=n.get("show");if(a){var o=n.get("size"),s=n.get("icon"),l=n.get("offsetCenter"),u=n.get("keepAspect"),c=Sr(s,i.cx-o/2+Fe(l[0],i.r),i.cy-o/2+Fe(l[1],i.r),o,o,null,u);c.z2=n.get("showAbove")?1:0,c.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(c)}},e.prototype._renderTitleAndDetail=function(t,i,n,a,o){var s=this,l=t.getData(),u=l.mapDimension("value"),c=+t.get("min"),f=+t.get("max"),h=new Ze,p=[],d=[],g=t.isAnimationEnabled(),m=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(v){p[v]=new Lt({silent:!0}),d[v]=new Lt({silent:!0})}).update(function(v,_){p[v]=s._titleEls[_],d[v]=s._detailEls[_]}).execute(),l.each(function(v){var _=l.getItemModel(v),y=l.get(u,v),x=new Ze,M=a(rr(y,[c,f],[0,1],!0)),S=_.getModel("title");if(S.get("show")){var w=S.get("offsetCenter"),T=o.cx+Fe(w[0],o.r),C=o.cy+Fe(w[1],o.r),b=p[v];b.attr({z2:m?0:2,style:fr(S,{x:T,y:C,text:l.getName(v),align:"center",verticalAlign:"middle"},{inheritColor:M})}),x.add(b)}var E=_.getModel("detail");if(E.get("show")){var I=E.get("offsetCenter"),R=o.cx+Fe(I[0],o.r),A=o.cy+Fe(I[1],o.r),D=Fe(E.get("width"),o.r),U=Fe(E.get("height"),o.r),B=t.get(["progress","show"])?l.getItemVisual(v,"style").fill:M,b=d[v],F=E.get("formatter");b.attr({z2:m?0:2,style:fr(E,{x:R,y:A,text:CT(y,F),width:isNaN(D)?null:D,height:isNaN(U)?null:U,align:"center",verticalAlign:"middle"},{inheritColor:B})}),vw(b,{normal:E},y,function(G){return CT(G,F)}),g&&gw(b,v,l,t,{getFormattedLabel:function(G,Y,J,Q,V,K){return CT(K?K.interpolatedValue:y,F)}}),x.add(b)}h.add(x)}),this.group.add(h),this._titleEls=p,this._detailEls=d},e.type="gauge",e}(Yt),cY=mye;var vye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,i){return To(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(jt),fY=vye;function CN(r){r.registerChartView(cY),r.registerSeriesModel(fY)}var gye=["itemStyle","opacity"],yye=function(r){Z(e,r);function e(t,i){var n=r.call(this)||this,a=n,o=new $r,s=new Lt;return a.setTextContent(s),n.setTextGuideLine(o),n.updateData(t,i,!0),n}return e.prototype.updateData=function(t,i,n){var a=this,o=t.hostModel,s=t.getItemModel(i),l=t.getItemLayout(i),u=s.getModel("emphasis"),c=s.get(gye);c=c??1,n||Ii(a),a.useStyle(t.getItemVisual(i,"style")),a.style.lineJoin="round",n?(a.setShape({points:l.points}),a.style.opacity=0,ar(a,{style:{opacity:c}},o,i)):Dt(a,{style:{opacity:c},shape:{points:l.points}},o,i),Gr(a,s),this._updateLabel(t,i),nr(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,i){var n=this,a=this.getTextGuideLine(),o=n.getTextContent(),s=t.hostModel,l=t.getItemModel(i),u=t.getItemLayout(i),c=u.label,f=t.getItemVisual(i,"style"),h=f.fill;Nr(o,Tr(l),{labelFetcher:t.hostModel,labelDataIndex:i,defaultOpacity:f.opacity,defaultText:t.getName(i)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}}),n.setTextConfig({local:!0,inside:!!c.inside,insideStroke:h,outsideFill:h});var p=c.linePoints;a.setShape({points:p}),n.textGuideLineConfig={anchor:p?new Nt(p[0][0],p[0][1]):null},Dt(o,{style:{x:c.x,y:c.y}},s,i),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),Sv(n,Mv(l),{stroke:h})},e}(ei),_ye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new yye(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);Cu(u,t,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(Yt),hY=_ye;var xye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new jl(Be(this.getData,this),Be(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,i){return To(this,{coordDimensions:["value"],encodeDefaulter:ot(uv,this)})},e.prototype._defaultLabelLine=function(t){yo(t,"labelLine",["show"]);var i=t.labelLine,n=t.emphasis.labelLine;i.show=i.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var i=this.getData(),n=r.prototype.getDataParams.call(this,t),a=i.mapDimension("value"),o=i.getSum(a);return n.percent=o?+(i.get(a,t)/o*100).toFixed(2):0,n.$vars.push("percent"),n},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(jt),pY=xye;function Sye(r,e){return xr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Mye(r,e){for(var t=r.mapDimension("value"),i=r.mapArray(t,function(l){return l}),n=[],a=e==="ascending",o=0,s=r.count();oUye)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]);n.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(r){if(!(this._mouseDownPoint||!IN(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]),i=t.behavior;i==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(i==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:i==="jump"?null:{duration:0}})}}};function IN(r,e){var t=r._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}var xY=Oye;var zye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){r.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var i=this.option;t&&_t(i,t,!0),this._initDimensions()},e.prototype.contains=function(t,i){var n=t.get("parallelIndex");return n!=null&&i.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){N(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(i){t.hasOwnProperty(i)&&(this.option[i]=t[i])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],i=this.parallelAxisIndex=[],n=Wt(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);N(n,function(a){t.push("dim"+a.get("dim")),i.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Pt),SY=zye;var Bye=function(r){Z(e,r);function e(t,i,n,a,o){var s=r.call(this,t,i,n)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(pn),MY=Bye;function Xa(r,e,t,i,n,a){r=r||0;var o=t[1]-t[0];if(n!=null&&(n=kv(n,[0,o])),a!=null&&(a=Math.max(a,n??0)),i==="all"){var s=Math.abs(e[1]-e[0]);s=kv(s,[0,o]),n=a=kv(s,[n,a]),i=0}e[0]=kv(e[0],t),e[1]=kv(e[1],t);var l=NN(e,i);e[i]+=r;var u=n||0,c=t.slice();l.sign<0?c[0]+=u:c[1]-=u,e[i]=kv(e[i],c);var f;return f=NN(e,i),n!=null&&(f.sign!==l.sign||f.spana&&(e[1-i]=e[i]+f.sign*a),e}function NN(r,e){var t=r[e]-r[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function kv(r,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,r))}var UN=N,TY=Math.min,EY=Math.max,bY=Math.floor,kye=Math.ceil,wY=Ar,Vye=Math.PI,Gye=function(){function r(e,t,i){this.type="parallel",this._axesMap=ke(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,i)}return r.prototype._init=function(e,t,i){var n=e.dimensions,a=e.parallelAxisIndex;UN(n,function(o,s){var l=a[s],u=t.getComponent("parallelAxis",l),c=this._axesMap.set(o,new MY(o,zf(u),[0,0],u.get("type"),l)),f=c.type==="category";c.onBand=f&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},r.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},r.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),i=t.axisBase,n=t.layoutBase,a=t.pixelDimIndex,o=e[1-a],s=e[a];return o>=i&&o<=i+t.axisLength&&s>=n&&s<=n+t.layoutLength},r.prototype.getModel=function(){return this._model},r.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(i){if(e.contains(i,t)){var n=i.getData();UN(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(n,n.mapDimension(a)),Vl(o.scale,o.model)},this)}},this)},r.prototype.resize=function(e,t){this._rect=xr(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},r.prototype.getRect=function(){return this._rect},r.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,i=["x","y"],n=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=t[n[o]],l=[0,s],u=this.dimensions.length,c=RT(e.get("axisExpandWidth"),l),f=RT(e.get("axisExpandCount")||0,[0,u]),h=e.get("axisExpandable")&&u>3&&u>f&&f>1&&c>0&&s>0,p=e.get("axisExpandWindow"),d;if(p)d=RT(p[1]-p[0],l),p[1]=p[0]+d;else{d=RT(c*(f-1),l);var g=e.get("axisExpandCenter")||bY(u/2);p=[c*g-d/2],p[1]=p[0]+d}var m=(s-d)/(u-f);m<3&&(m=0);var v=[bY(wY(p[0]/c,1))+1,kye(wY(p[1]/c,1))-1],_=m/c*p[0];return{layout:a,pixelDimIndex:o,layoutBase:t[i[o]],layoutLength:s,axisBase:t[i[1-o]],axisLength:t[n[1-o]],axisExpandable:h,axisExpandWidth:c,axisCollapseWidth:m,axisExpandWindow:p,axisCount:u,winInnerIndices:v,axisExpandWindow0Pos:_}},r.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),a=n.layout;t.each(function(o){var s=[0,n.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),UN(i,function(o,s){var l=(n.axisExpandable?Wye:Hye)(s,n),u={horizontal:{x:l.position,y:n.axisLength},vertical:{x:0,y:l.position}},c={horizontal:Vye/2,vertical:0},f=[u[a].x+e.x,u[a].y+e.y],h=c[a],p=wi();Ca(p,p,h),_n(p,p,f),this._axesLayout[o]={position:f,rotation:h,transform:p,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},r.prototype.getAxis=function(e){return this._axesMap.get(e)},r.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},r.prototype.eachActiveState=function(e,t,i,n){i==null&&(i=0),n==null&&(n=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];N(o,function(m){s.push(e.mapDimension(m)),l.push(a.get(m).model)});for(var u=this.hasAxisBrushed(),c=i;ca*(1-f[0])?(u="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=t.axisExpandWidth/c,l?Xa(l,n,o,"all"):u="none";else{var p=n[1]-n[0],d=o[1]*s/p;n=[EY(0,d-p/2)],n[1]=TY(o[1],n[0]+p),n[0]=n[1]-p}return{axisExpandWindow:n,behavior:u}},r}();function RT(r,e){return TY(EY(r,e[0]),e[1])}function Hye(r,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*r,axisNameAvailableWidth:t,axisLabelShow:!0}}function Wye(r,e){var t=e.layoutLength,i=e.axisExpandWidth,n=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,c;return r=0;n--)Ti(i[n])},e.prototype.getActiveState=function(t){var i=this.activeIntervals;if(!i.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(i.length===1){var n=i[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var a=0,o=i.length;ajye}function VY(r){var e=r.length-1;return e<0&&(e=0),[r[0],r[e]]}function GY(r,e,t,i){var n=new Ze;return n.add(new Tt({name:"main",style:XN(t),silent:!0,draggable:!0,cursor:"move",drift:ot(DY,r,e,n,["n","s","w","e"]),ondragend:ot(ud,e,{isEnd:!0})})),N(i,function(a){n.add(new Tt({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:ot(DY,r,e,n,a),ondragend:ot(ud,e,{isEnd:!0})}))}),n}function HY(r,e,t,i){var n=i.brushStyle.lineWidth||0,a=Vv(n,Kye),o=t[0][0],s=t[1][0],l=o-n/2,u=s-n/2,c=t[0][1],f=t[1][1],h=c-a+n/2,p=f-a+n/2,d=c-o,g=f-s,m=d+n,v=g+n;Hu(r,e,"main",o,s,d,g),i.transformable&&(Hu(r,e,"w",l,u,a,v),Hu(r,e,"e",h,u,a,v),Hu(r,e,"n",l,u,m,a),Hu(r,e,"s",l,p,m,a),Hu(r,e,"nw",l,u,a,a),Hu(r,e,"ne",h,u,a,a),Hu(r,e,"sw",l,p,a,a),Hu(r,e,"se",h,p,a,a))}function zN(r,e){var t=e.__brushOption,i=t.transformable,n=e.childAt(0);n.useStyle(XN(t)),n.attr({silent:!i,cursor:i?"move":"default"}),N([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?BN(r,a[0]):i0e(r,a);o&&o.attr({silent:!i,invisible:!i,cursor:i?$ye[s]+"-resize":null})})}function Hu(r,e,t,i,n,a,o){var s=e.childOfName(t);s&&s.setShape(a0e(YN(r,e,[[i,n],[i+a,n+o]])))}function XN(r){return Ye({strokeNoScale:!0},r.brushStyle)}function WY(r,e,t,i){var n=[Dx(r,t),Dx(e,i)],a=[Vv(r,t),Vv(e,i)];return[[n[0],a[0]],[n[1],a[1]]]}function r0e(r){return ks(r.group)}function BN(r,e){var t={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},n=Up(t[e],r0e(r));return i[n]}function i0e(r,e){var t=[BN(r,e[0]),BN(r,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function DY(r,e,t,i,n,a){var o=t.__brushOption,s=r.toRectRange(o.range),l=XY(e,n,a);N(i,function(u){var c=Jye[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=r.fromRectRange(WY(s[0][0],s[1][0],s[0][1],s[1][1])),GN(e,t),ud(e,{isEnd:!1})}function n0e(r,e,t,i){var n=e.__brushOption.range,a=XY(r,t,i);N(n,function(o){o[0]+=a[0],o[1]+=a[1]}),GN(r,e),ud(r,{isEnd:!1})}function XY(r,e,t){var i=r.group,n=i.transformCoordToLocal(e,t),a=i.transformCoordToLocal(0,0);return[n[0]-a[0],n[1]-a[1]]}function YN(r,e,t){var i=kY(r,e);return i&&i!==ld?i.clipPath(t,r._transform):Qe(t)}function a0e(r){var e=Dx(r[0][0],r[1][0]),t=Dx(r[0][1],r[1][1]),i=Vv(r[0][0],r[1][0]),n=Vv(r[0][1],r[1][1]);return{x:e,y:t,width:i-e,height:n-t}}function o0e(r,e,t){if(!(!r._brushType||l0e(r,e.offsetX,e.offsetY))){var i=r._zr,n=r._covers,a=WN(r,e,t);if(!r._dragging)for(var o=0;oi.getWidth()||t<0||t>i.getHeight()}var LT={lineX:UY(0),lineY:UY(1),rect:{createCover:function(r,e){function t(i){return i}return GY({toRectRange:t,fromRectRange:t},r,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(r){var e=VY(r);return WY(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(r,e,t,i){HY(r,e,t,i)},updateCommon:zN,contain:VN},polygon:{createCover:function(r,e){var t=new Ze;return t.add(new $r({name:"main",style:XN(e),silent:!0})),t},getCreatingRange:function(r){return r},endCreating:function(r,e){e.remove(e.childAt(0)),e.add(new ei({name:"main",draggable:!0,drift:ot(n0e,r,e),ondragend:ot(ud,r,{isEnd:!0})}))},updateCoverShape:function(r,e,t,i){e.childAt(0).setShape({points:YN(r,e,t)})},updateCommon:zN,contain:VN}};function UY(r){return{createCover:function(e,t){return GY({toRectRange:function(i){var n=[i,[0,100]];return r&&n.reverse(),n},fromRectRange:function(i){return i[r]}},e,t,[[["w"],["e"]],[["n"],["s"]]][r])},getCreatingRange:function(e){var t=VY(e),i=Dx(t[0][r],t[1][r]),n=Vv(t[0][r],t[1][r]);return[i,n]},updateCoverShape:function(e,t,i,n){var a,o=kY(e,t);if(o!==ld&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(r);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-r]]}var l=[i,a];r&&l.reverse(),HY(e,t,l,n)},updateCommon:zN,contain:VN}}var Gv=e0e;function PT(r){return r=qN(r),function(e){return UP(e,r)}}function DT(r,e){return r=qN(r),function(t){var i=e??t,n=i?r.width:r.height,a=i?r.x:r.y;return[a,a+(n||0)]}}function IT(r,e,t){var i=qN(r);return function(n,a){return i.contain(a[0],a[1])&&!Wf(n,e,t)}}function qN(r){return lt.create(r)}var u0e=["axisLine","axisTickLabel","axisName"],c0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){r.prototype.init.apply(this,arguments),(this._brushController=new Gv(i.getZr())).on("brush",Be(this._onBrush,this))},e.prototype.render=function(t,i,n,a){if(!f0e(t,i,a)){this.axisModel=t,this.api=n,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ze,this.group.add(this._axisGroup),!!t.get("show")){var s=p0e(t,i),l=s.coordinateSystem,u=t.getAreaSelectStyle(),c=u.width,f=t.axis.dim,h=l.getAxisLayout(f),p=fe({strokeContainThreshold:c},h),d=new Cn(t,p);N(u0e,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(p,u,t,s,c,n),Lu(o,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,i,n,a,o,s){var l=n.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),f=lt.create({x:l[0],y:-o/2,width:u,height:o});f.x-=c,f.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:PT(f),isTargetByCursor:IT(f,s,a),getLinearBrushOtherExtent:DT(f,0)}]).enableBrush({brushType:"lineX",brushStyle:i,removeOnClick:!0}).updateCovers(h0e(n))},e.prototype._onBrush=function(t){var i=t.areas,n=this.axisModel,a=n.axis,o=de(i,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!n.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(Qt);function f0e(r,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===r}function h0e(r){var e=r.axis;return de(r.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function p0e(r,e){return e.getComponent("parallel",r.get("parallelIndex"))}var ZY=c0e;var d0e={type:"axisAreaSelect",event:"axisAreaSelected"};function jY(r){r.registerAction(d0e,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(i){i.axis.model.setActiveIntervals(e.intervals)})}),r.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(i){i.setAxisExpand(e)})})}var m0e={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Ix(r){r.registerComponentView(xY),r.registerComponentModel(SY),r.registerCoordinateSystem("parallel",CY),r.registerPreprocessor(DN),r.registerComponentModel(ON),r.registerComponentView(ZY),rl(r,"parallel",ON,m0e),jY(r)}function ZN(r){It(Ix),r.registerChartView(gY),r.registerSeriesModel(yY),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,_Y)}var v0e=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r}(),g0e=function(r){Z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new v0e},e.prototype.buildPath=function(t,i){var n=i.extent;t.moveTo(i.x1,i.y1),t.bezierCurveTo(i.cpx1,i.cpy1,i.cpx2,i.cpy2,i.x2,i.y2),i.orient==="vertical"?(t.lineTo(i.x2+n,i.y2),t.bezierCurveTo(i.cpx2+n,i.cpy2,i.cpx1+n,i.cpy1,i.x1+n,i.y1)):(t.lineTo(i.x2,i.y2+n),t.bezierCurveTo(i.cpx2,i.cpy2+n,i.cpx1,i.cpy1+n,i.x1,i.y1+n)),t.closePath()},e.prototype.highlight=function(){Bn(this)},e.prototype.downplay=function(){kn(this)},e}(ut),y0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,i,n){var a=this,o=t.getGraph(),s=this.group,l=t.layoutInfo,u=l.width,c=l.height,f=t.getData(),h=t.getData("edge"),p=t.get("orient");this._model=t,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(d){var g=new g0e,m=rt(g);m.dataIndex=d.dataIndex,m.seriesIndex=t.seriesIndex,m.dataType="edge";var v=d.getModel(),_=v.getModel("lineStyle"),y=_.get("curveness"),x=d.node1.getLayout(),M=d.node1.getModel(),S=M.get("localX"),w=M.get("localY"),T=d.node2.getLayout(),C=d.node2.getModel(),b=C.get("localX"),E=C.get("localY"),I=d.getLayout(),R,A,D,U,B,F,k,G;g.shape.extent=Math.max(1,I.dy),g.shape.orient=p,p==="vertical"?(R=(S!=null?S*u:x.x)+I.sy,A=(w!=null?w*c:x.y)+x.dy,D=(b!=null?b*u:T.x)+I.ty,U=E!=null?E*c:T.y,B=R,F=A*(1-y)+U*y,k=D,G=A*y+U*(1-y)):(R=(S!=null?S*u:x.x)+x.dx,A=(w!=null?w*c:x.y)+I.sy,D=b!=null?b*u:T.x,U=(E!=null?E*c:T.y)+I.ty,B=R*(1-y)+D*y,F=A,k=R*y+D*(1-y),G=U),g.setShape({x1:R,y1:A,x2:D,y2:U,cpx1:B,cpy1:F,cpx2:k,cpy2:G}),g.useStyle(_.getItemStyle()),KY(g.style,p,d);var Y=""+v.get("value"),J=Tr(v,"edgeLabel");Nr(g,J,{labelFetcher:{getFormattedLabel:function(K,ae,ve,ue,se,Ee){return t.getFormattedLabel(K,ae,"edge",ue,Xi(se,J.normal&&J.normal.get("formatter"),Y),Ee)}},labelDataIndex:d.dataIndex,defaultText:Y}),g.setTextConfig({position:"inside"});var Q=v.getModel("emphasis");Gr(g,v,"lineStyle",function(K){var ae=K.getItemStyle();return KY(ae,p,d),ae}),s.add(g),h.setItemGraphicEl(d.dataIndex,g);var V=Q.get("focus");nr(g,V==="adjacency"?d.getAdjacentDataIndices():V==="trajectory"?d.getTrajectoryDataIndices():V,Q.get("blurScope"),Q.get("disabled"))}),o.eachNode(function(d){var g=d.getLayout(),m=d.getModel(),v=m.get("localX"),_=m.get("localY"),y=m.getModel("emphasis"),x=new Tt({shape:{x:v!=null?v*u:g.x,y:_!=null?_*c:g.y,width:g.dx,height:g.dy},style:m.getModel("itemStyle").getItemStyle(),z2:10});Nr(x,Tr(m),{labelFetcher:{getFormattedLabel:function(S,w){return t.getFormattedLabel(S,w,"node")}},labelDataIndex:d.dataIndex,defaultText:d.id}),x.disableLabelAnimation=!0,x.setStyle("fill",d.getVisual("color")),x.setStyle("decal",d.getVisual("style").decal),Gr(x,m),s.add(x),f.setItemGraphicEl(d.dataIndex,x),rt(x).dataType="node";var M=y.get("focus");nr(x,M==="adjacency"?d.getAdjacentDataIndices():M==="trajectory"?d.getTrajectoryDataIndices():M,y.get("blurScope"),y.get("disabled"))}),f.eachItemGraphicEl(function(d,g){var m=f.getItemModel(g);m.get("draggable")&&(d.drift=function(v,_){a._focusAdjacencyDisabled=!0,this.shape.x+=v,this.shape.y+=_,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:f.getRawIndex(g),localX:this.shape.x/u,localY:this.shape.y/c})},d.ondragend=function(){a._focusAdjacencyDisabled=!1},d.draggable=!0,d.cursor="move")}),!this._data&&t.isAnimationEnabled()&&s.setClipPath(_0e(s.getBoundingRect(),t,function(){s.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(Yt);function KY(r,e,t){switch(r.fill){case"source":r.fill=t.node1.getVisual("color"),r.decal=t.node1.getVisual("style").decal;break;case"target":r.fill=t.node2.getVisual("color"),r.decal=t.node2.getVisual("style").decal;break;case"gradient":var i=t.node1.getVisual("color"),n=t.node2.getVisual("color");Ce(i)&&Ce(n)&&(r.fill=new zl(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:i,offset:0},{color:n,offset:1}]))}}function _0e(r,e,t){var i=new Tt({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return ar(i,{shape:{width:r.width+20}},e,t),i}var JY=y0e;var x0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){var n=t.edges||t.links,a=t.data||t.nodes,o=t.levels;this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new Zt(o[l],this,i));if(a&&n){var u=Px(a,n,this,!0,c);return u.data}function c(f,h){f.wrapMethod("getItemModel",function(p,d){var g=p.parentModel,m=g.getData().getItemLayout(d);if(m){var v=m.depth,_=g.levelModels[v];_&&(p.parentModel=_)}return p}),h.wrapMethod("getItemModel",function(p,d){var g=p.parentModel,m=g.getGraph().getEdgeByIndex(d),v=m.node1.getLayout();if(v){var _=v.depth,y=g.levelModels[_];y&&(p.parentModel=y)}return p})}},e.prototype.setNodePosition=function(t,i){var n=this.option.data||this.option.nodes,a=n[t];a.localX=i[0],a.localY=i[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,i,n){function a(p){return isNaN(p)||p==null}if(n==="edge"){var o=this.getDataParams(t,n),s=o.data,l=o.value,u=s.source+" -- "+s.target;return Or("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(t),f=c.getLayout().value,h=this.getDataParams(t,n).data.name;return Or("nameValue",{name:h!=null?h+"":null,value:f,noValue:a(f)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,i){var n=r.prototype.getDataParams.call(this,t,i);if(n.value==null&&i==="node"){var a=this.getGraph().getNodeByIndex(t),o=a.getLayout().value;n.value=o}return n},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(jt),$Y=x0e;function KN(r,e){r.eachSeriesByType("sankey",function(t){var i=t.get("nodeWidth"),n=t.get("nodeGap"),a=S0e(t,e);t.layoutInfo=a;var o=a.width,s=a.height,l=t.getGraph(),u=l.nodes,c=l.edges;b0e(u);var f=Wt(u,function(g){return g.getLayout().value===0}),h=f.length!==0?0:t.get("layoutIterations"),p=t.get("orient"),d=t.get("nodeAlign");M0e(u,c,i,n,o,s,h,p,d)})}function S0e(r,e){return xr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function M0e(r,e,t,i,n,a,o,s,l){w0e(r,e,t,n,a,s,l),C0e(r,e,a,n,i,o,s),F0e(r,s)}function b0e(r){N(r,function(e){var t=qf(e.outEdges,NT),i=qf(e.inEdges,NT),n=e.getValue()||0,a=Math.max(t,i,n);e.setLayout({value:a},!0)})}function w0e(r,e,t,i,n,a,o){for(var s=[],l=[],u=[],c=[],f=0,h=0;h=0;v&&m.depth>p&&(p=m.depth),g.setLayout({depth:v?m.depth:f},!0),a==="vertical"?g.setLayout({dy:t},!0):g.setLayout({dx:t},!0);for(var _=0;_f-1?p:f-1;o&&o!=="left"&&T0e(r,o,a,w);var T=a==="vertical"?(n-t)/w:(i-t)/w;A0e(r,T,a)}function QY(r){var e=r.hostGraph.data.getRawDataItem(r.dataIndex);return e.depth!=null&&e.depth>=0}function T0e(r,e,t,i){if(e==="right"){for(var n=[],a=r,o=0;a.length;){for(var s=0;s0;a--)l*=.99,P0e(s,l,o),jN(s,n,t,i,o),O0e(s,l,o),jN(s,n,t,i,o)}function R0e(r,e){var t=[],i=e==="vertical"?"y":"x",n=a_(r,function(a){return a.getLayout()[i]});return n.keys.sort(function(a,o){return a-o}),N(n.keys,function(a){t.push(n.buckets.get(a))}),t}function L0e(r,e,t,i,n,a){var o=1/0;N(r,function(s){var l=s.length,u=0;N(s,function(f){u+=f.getLayout().value});var c=a==="vertical"?(i-(l-1)*n)/u:(t-(l-1)*n)/u;c0&&(s=l.getLayout()[a]+u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[h]+e;var d=n==="vertical"?i:t;if(u=c-e-d,u>0){s=l.getLayout()[a]-u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var p=f-2;p>=0;--p)l=o[p],u=l.getLayout()[a]+l.getLayout()[h]+e-c,u>0&&(s=l.getLayout()[a]-u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function P0e(r,e,t){N(r.slice().reverse(),function(i){N(i,function(n){if(n.outEdges.length){var a=qf(n.outEdges,D0e,t)/qf(n.outEdges,NT);if(isNaN(a)){var o=n.outEdges.length;a=o?qf(n.outEdges,I0e,t)/o:0}if(t==="vertical"){var s=n.getLayout().x+(a-Zf(n,t))*e;n.setLayout({x:s},!0)}else{var l=n.getLayout().y+(a-Zf(n,t))*e;n.setLayout({y:l},!0)}}})})}function D0e(r,e){return Zf(r.node2,e)*r.getValue()}function I0e(r,e){return Zf(r.node2,e)}function N0e(r,e){return Zf(r.node1,e)*r.getValue()}function U0e(r,e){return Zf(r.node1,e)}function Zf(r,e){return e==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function NT(r){return r.getValue()}function qf(r,e,t){for(var i=0,n=r.length,a=-1;++ao&&(o=l)}),N(i,function(s){var l=new pi({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}n.length&&N(n,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function $N(r){r.registerChartView(JY),r.registerSeriesModel($Y),r.registerLayout(KN),r.registerVisual(JN),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(i){i.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var UT=function(){function r(){}return r.prototype.getInitialData=function(e,t){var i,n=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=n.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",i=n.getOrdinalMeta(),l=!0):s==="category"?(e.layout="vertical",i=a.getOrdinalMeta(),l=!0):e.layout=e.layout||"horizontal";var u=["x","y"],c=e.layout==="horizontal"?0:1,f=this._baseAxisDim=u[c],h=u[1-c],p=[n,a],d=p[c].get("type"),g=p[1-c].get("type"),m=e.data;if(m&&l){var v=[];N(m,function(x,M){var S;pe(x)?(S=x.slice(),x.unshift(M)):pe(x.value)?(S=fe({},x),S.value=S.value.slice(),x.value.unshift(M)):S=x,v.push(S)}),e.data=v}var _=this.defaultValueDimensions,y=[{name:f,type:Yp(d),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:Yp(g),dimsDef:_.slice()}];return To(this,{coordDimensions:y,dimensionsCount:_.length+1,encodeDefaulter:ot(Lw,y,this)})},r.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},r}();var eq=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],t.visualDrawType="stroke",t}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(jt);wr(eq,UT,!0);var tq=eq;var z0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),f=rq(c,a,u,l,!0);a.setItemGraphicEl(u,f),o.add(f)}}).update(function(u,c){var f=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(f);return}var h=a.getItemLayout(u);f?(Ii(f),iq(h,f,a,u)):f=rq(h,a,u,l),o.add(f),a.setItemGraphicEl(u,f)}).remove(function(u){var c=s.getItemGraphicEl(u);c&&o.remove(c)}).execute(),this._data=a},e.prototype.remove=function(t){var i=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl(function(a){a&&i.remove(a)})},e.type="boxplot",e}(Yt),B0e=function(){function r(){}return r}(),k0e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="boxplotBoxPath",i}return e.prototype.getDefaultShape=function(){return new B0e},e.prototype.buildPath=function(t,i){var n=i.points,a=0;for(t.moveTo(n[a][0],n[a][1]),a++;a<4;a++)t.lineTo(n[a][0],n[a][1]);for(t.closePath();ag){var x=[v,y];i.push(x)}}}return{boxData:t,outliers:i}}var aq={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==Ei){var i="";ur(i)}var n=eU(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:n.boxData},{data:n.outliers}]}};function tU(r){r.registerSeriesModel(tq),r.registerChartView(nq),r.registerLayout(QN),r.registerTransform(aq)}var X0e=["color","borderColor"],Y0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,i,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,i,n,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,i):this._incrementalRenderNormal(t,i)},e.prototype.eachRendered=function(t){sa(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var i=t.pipelineContext.large;(this._isLargeDraw==null||i!==this._isLargeDraw)&&(this._isLargeDraw=i,this._clear())},e.prototype._renderNormal=function(t){var i=t.getData(),n=this._data,a=this.group,o=i.getLayout("isSimpleBox"),s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),i.diff(n).add(function(c){if(i.hasValue(c)){var f=i.getItemLayout(c);if(s&&oq(u,f))return;var h=rU(f,c,!0);ar(h,{shape:{points:f.ends}},t,c),iU(h,i,c,o),a.add(h),i.setItemGraphicEl(c,h)}}).update(function(c,f){var h=n.getItemGraphicEl(f);if(!i.hasValue(c)){a.remove(h);return}var p=i.getItemLayout(c);if(s&&oq(u,p)){a.remove(h);return}h?(Dt(h,{shape:{points:p.ends}},t,c),Ii(h)):h=rU(p,c),iU(h,i,c,o),a.add(h),i.setItemGraphicEl(c,h)}).remove(function(c){var f=n.getItemGraphicEl(c);f&&a.remove(f)}).execute(),this._data=i},e.prototype._renderLarge=function(t){this._clear(),sq(t,this.group);var i=t.get("clip",!0)?ql(t.coordinateSystem,!1,t):null;i?this.group.setClipPath(i):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,i){for(var n=i.getData(),a=n.getLayout("isSimpleBox"),o;(o=t.next())!=null;){var s=n.getItemLayout(o),l=rU(s,o);iU(l,n,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,i){sq(i,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(Yt),q0e=function(){function r(){}return r}(),Z0e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="normalCandlestickBox",i}return e.prototype.getDefaultShape=function(){return new q0e},e.prototype.buildPath=function(t,i){var n=i.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(ut);function rU(r,e,t){var i=r.ends;return new Z0e({shape:{points:t?j0e(i,r):i},z2:100})}function oq(r,e){for(var t=!0,i=0;i0?"borderColor":"borderColor0"])||t.get(["itemStyle",r>0?"color":"color0"]);r===0&&(n=t.get(["itemStyle","borderColorDoji"]));var a=t.getModel("itemStyle").getItemStyle(X0e);e.useStyle(a),e.style.fill=null,e.style.stroke=n}var lq=Y0e;var uq=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],t}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,i,n){var a=i.getItemLayout(t);return a&&n.rect(a.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(jt);wr(uq,UT,!0);var cq=uq;function oU(r){!r||!pe(r.series)||N(r.series,function(e){qe(e)&&e.type==="k"&&(e.type="candlestick")})}var J0e=["itemStyle","borderColor"],$0e=["itemStyle","borderColor0"],Q0e=["itemStyle","borderColorDoji"],e_e=["itemStyle","color"],t_e=["itemStyle","color0"],r_e={seriesType:"candlestick",plan:Mo(),performRawSeries:!0,reset:function(r,e){function t(a,o){return o.get(a>0?e_e:t_e)}function i(a,o){return o.get(a===0?Q0e:a>0?J0e:$0e)}if(!e.isSeriesFiltered(r)){var n=r.pipelineContext.large;return!n&&{progress:function(a,o){for(var s;(s=a.next())!=null;){var l=o.getItemModel(s),u=o.getItemLayout(s).sign,c=l.getItemStyle();c.fill=t(u,l),c.stroke=i(u,l)||c.fill;var f=o.ensureUniqueItemVisual(s,"style");fe(f,c)}}}}}},fq=r_e;var i_e={seriesType:"candlestick",plan:Mo(),reset:function(r){var e=r.coordinateSystem,t=r.getData(),i=n_e(r,t),n=0,a=1,o=["x","y"],s=t.getDimensionIndex(t.mapDimension(o[n])),l=de(t.mapDimensionsAll(o[a]),t.getDimensionIndex,t),u=l[0],c=l[1],f=l[2],h=l[3];if(t.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),s<0||l.length<4)return;return{progress:r.pipelineContext.large?d:p};function p(g,m){for(var v,_=m.getStore();(v=g.next())!=null;){var y=_.get(s,v),x=_.get(u,v),M=_.get(c,v),S=_.get(f,v),w=_.get(h,v),T=Math.min(x,M),C=Math.max(x,M),b=B(T,y),E=B(C,y),I=B(S,y),R=B(w,y),A=[];F(A,E,0),F(A,b,1),A.push(G(R),G(E),G(I),G(b));var D=m.getItemModel(v),U=!!D.get(["itemStyle","borderColorDoji"]);m.setItemLayout(v,{sign:hq(_,v,x,M,c,U),initBaseline:x>M?E[a]:b[a],ends:A,brushRect:k(S,w,y)})}function B(Y,J){var Q=[];return Q[n]=J,Q[a]=Y,isNaN(J)||isNaN(Y)?[NaN,NaN]:e.dataToPoint(Q)}function F(Y,J,Q){var V=J.slice(),K=J.slice();V[n]=S_(V[n]+i/2,1,!1),K[n]=S_(K[n]-i/2,1,!0),Q?Y.push(V,K):Y.push(K,V)}function k(Y,J,Q){var V=B(Y,Q),K=B(J,Q);return V[n]-=i/2,K[n]-=i/2,{x:V[0],y:V[1],width:a?i:K[0]-V[0],height:a?K[1]-V[1]:i}}function G(Y){return Y[n]=S_(Y[n],1),Y}}function d(g,m){for(var v=ca(g.count*4),_=0,y,x=[],M=[],S,w=m.getStore(),T=!!r.get(["itemStyle","borderColorDoji"]);(S=g.next())!=null;){var C=w.get(s,S),b=w.get(u,S),E=w.get(c,S),I=w.get(f,S),R=w.get(h,S);if(isNaN(C)||isNaN(I)||isNaN(R)){v[_++]=NaN,_+=3;continue}v[_++]=hq(w,S,b,E,c,T),x[n]=C,x[a]=I,y=e.dataToPoint(x,null,M),v[_++]=y?y[0]:NaN,v[_++]=y?y[1]:NaN,x[a]=R,y=e.dataToPoint(x,null,M),v[_++]=y?y[1]:NaN}m.setLayout("largePoints",v)}}};function hq(r,e,t,i,n,a){var o;return t>i?o=-1:t0?r.get(n,e-1)<=i?1:-1:1,o}function n_e(r,e){var t=r.getBaseAxis(),i,n=t.type==="category"?t.getBandWidth():(i=t.getExtent(),Math.abs(i[1]-i[0])/e.count()),a=Fe(ft(r.get("barMaxWidth"),n),n),o=Fe(ft(r.get("barMinWidth"),1),n),s=r.get("barWidth");return s!=null?Fe(s,n):Math.max(Math.min(n/2,a),o)}var pq=i_e;function sU(r){r.registerChartView(lq),r.registerSeriesModel(cq),r.registerPreprocessor(oU),r.registerVisual(fq),r.registerLayout(pq)}function dq(r,e){var t=e.rippleEffectColor||e.color;r.eachChild(function(i){i.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var a_e=function(r){Z(e,r);function e(t,i){var n=r.call(this)||this,a=new ku(t,i),o=new Ze;return n.add(a),n.add(o),n.updateData(t,i),n}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var i=t.symbolType,n=t.color,a=t.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var h=void 0;He(f)?h=f(n):h=f,a.__t>0&&(h=-s*a.__t),this._animateSymbol(a,s,h,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,i,n,a,o){if(i>0){t.__t=0;var s=this,l=t.animate("",a).when(o?i*2:i,{__t:o?2:1}).delay(n).during(function(){s._updateSymbolPosition(t)});a||l.done(function(){s.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return Xo(t.__p1,t.__cp1)+Xo(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,i){t.__p1=i[0],t.__p2=i[1],t.__cp1=i[2]||[(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2]},e.prototype.updateData=function(t,i,n){this.childAt(0).updateData(t,i,n),this._updateEffectSymbol(t,i)},e.prototype._updateSymbolPosition=function(t){var i=t.__p1,n=t.__p2,a=t.__cp1,o=t.__t<1?t.__t:2-t.__t,s=[t.x,t.y],l=s.slice(),u=vi,c=G0;s[0]=u(i[0],a[0],n[0],o),s[1]=u(i[1],a[1],n[1],o);var f=t.__t<1?c(i[0],a[0],n[0],o):c(n[0],a[0],i[0],1-o),h=t.__t<1?c(i[1],a[1],n[1],o):c(n[1],a[1],i[1],1-o);t.rotation=-Math.atan2(h,f)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT=0&&!(a[l]<=i);l--);l=Math.min(l,o-2)}else{for(l=s;li);l++);l=Math.min(l-1,o-2)}var c=(i-a[l])/(a[l+1]-a[l]),f=n[l],h=n[l+1];t.x=f[0]*(1-c)+c*h[0],t.y=f[1]*(1-c)+c*h[1];var p=t.__t<1?h[0]-f[0]:f[0]-h[0],d=t.__t<1?h[1]-f[1]:f[1]-h[1];t.rotation=-Math.atan2(d,p)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=i,t.ignore=!1}},e}(OT),yq=c_e;var f_e=function(){function r(){this.polyline=!1,this.curveness=0,this.segs=[]}return r}(),h_e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i._off=0,i.hoverDataIdx=-1,i}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new f_e},e.prototype.buildPath=function(t,i){var n=i.segs,a=i.curveness,o;if(i.polyline)for(o=this._off;o0){t.moveTo(n[o++],n[o++]);for(var l=1;l0){var p=(u+f)/2-(c-h)*a,d=(c+h)/2-(f-u)*a;t.quadraticCurveTo(p,d,f,h)}else t.lineTo(f,h)}this.incremental&&(this._off=o,this.notClear=!0)},e.prototype.findDataIndex=function(t,i){var n=this.shape,a=n.segs,o=n.curveness,s=this.style.lineWidth;if(n.polyline)for(var l=0,u=0;u0)for(var f=a[u++],h=a[u++],p=1;p0){var m=(f+d)/2-(h-g)*o,v=(h+g)/2-(d-f)*o;if(Zb(f,h,m,v,d,g,s,t,i))return l}else if(Ul(f,h,d,g,s,t,i))return l;l++}return-1},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect();if(t=n[0],i=n[1],a.contain(t,i)){var o=this.hoverDataIdx=this.findDataIndex(t,i);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var i=this.shape,n=i.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+e.__startIndex)})},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),_q=p_e;var d_e={seriesType:"lines",plan:Mo(),reset:function(r){var e=r.coordinateSystem;if(e){var t=r.get("polyline"),i=r.pipelineContext.large;return{progress:function(n,a){var o=[];if(i){var s=void 0,l=n.end-n.start;if(t){for(var u=0,c=n.start;c0&&(c||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var f=t.get("clip",!0)&&ql(t.coordinateSystem,!1,t);f?this.group.setClipPath(f):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,i,n){var a=t.getData(),o=this._updateLineDraw(a,t);o.incrementalPrepareUpdate(a),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,i,n){this._lineDraw.incrementalUpdate(t,i.getData()),this._finished=t.end===i.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,i,n){var a=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=zT.reset(t,i,n);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,i){var n=this._lineDraw,a=this._showEffect(i),o=!!i.get("polyline"),s=i.pipelineContext,l=s.large;return(!n||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(n&&n.remove(),n=this._lineDraw=l?new _q:new Fv(o?a?yq:FT:a?OT:Ov),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var i=t.getZr(),n=i.painter.getType()==="svg";!n&&this._lastZlevel!=null&&i.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,i){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(i)},e.prototype.dispose=function(t,i){this.remove(t,i)},e.type="lines",e}(Yt),xq=m_e;var v_e=typeof Uint32Array>"u"?Array:Uint32Array,g_e=typeof Float64Array>"u"?Array:Float64Array;function Sq(r){var e=r.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(r.data=de(e,function(t){var i=[t[0].coord,t[1].coord],n={coords:i};return t[0].name&&(n.fromName=t[0].name),t[1].name&&(n.toName=t[1].name),Sm([n,t[0],t[1]])}))}var y_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.init=function(t){t.data=t.data||[],Sq(t);var i=this._processFlatCoordsArray(t.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(t.data=new Float32Array(i.count)),r.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(Sq(t),t.data){var i=this._processFlatCoordsArray(t.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(t.data=new Float32Array(i.count))}r.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var i=this._processFlatCoordsArray(t.data);i.flatCoords&&(this._flatCoords?(this._flatCoords=ep(this._flatCoords,i.flatCoords),this._flatCoordsOffset=ep(this._flatCoordsOffset,i.flatCoordsOffset)):(this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset),t.data=new Float32Array(i.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var i=this.getData().getItemModel(t),n=i.option instanceof Array?i.option:i.getShallow("coords");return n},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[t*2+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,i){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],o=0;on}}return{flatCoordsOffset:new Uint32Array(a.buffer,0,l),flatCoords:o,count:u}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,i){if(0)var n;var a=new ti(["value"],this);return a.hasItemOption=!1,a.initData(t.data,[],function(o,s,l,u){if(o instanceof Array)return NaN;a.hasItemOption=!0;var c=o.value;if(c!=null)return c instanceof Array?c[u]:c}),a},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=a.getItemModel(t),s=o.get("name");if(s)return s;var l=o.get("fromName"),u=o.get("toName"),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Or("nameValue",{name:c.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?1e4:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?2e4:this.get("progressiveThreshold"))},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),i=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&i>0?i+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(jt),Mq=y_e;function BT(r){return r instanceof Array||(r=[r,r]),r}var __e={seriesType:"lines",reset:function(r){var e=BT(r.get("symbol")),t=BT(r.get("symbolSize")),i=r.getData();i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",t&&t[0]),i.setVisual("toSymbolSize",t&&t[1]);function n(a,o){var s=a.getItemModel(o),l=BT(s.getShallow("symbol",!0)),u=BT(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:i.hasItemOption?n:null}}},bq=__e;function uU(r){r.registerChartView(xq),r.registerSeriesModel(Mq),r.registerLayout(zT),r.registerVisual(bq)}var x_e=256,S_e=function(){function r(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=zn.createCanvas();this.canvas=e}return r.prototype.update=function(e,t,i,n,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,f=this.canvas,h=f.getContext("2d"),p=e.length;f.width=t,f.height=i;for(var d=0;d0){var I=o(y)?l:u;y>0&&(y=y*b+T),M[S++]=I[E],M[S++]=I[E+1],M[S++]=I[E+2],M[S++]=I[E+3]*y*256}else S+=4}return h.putImageData(x,0,0),f},r.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=zn.createCanvas()),t=this.pointSize+this.blurSize,i=t*2;e.width=i,e.height=i;var n=e.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-t,t,this.pointSize,0,Math.PI*2,!0),n.closePath(),n.fill(),e},r.prototype._getGradient=function(e,t){for(var i=this._gradientPixels,n=i[t]||(i[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,a),n[o++]=a[0],n[o++]=a[1],n[o++]=a[2],n[o++]=a[3];return n},r}(),wq=S_e;function M_e(r,e,t){var i=r[1]-r[0];e=de(e,function(o){return{interval:[(o.interval[0]-r[0])/i,(o.interval[1]-r[0])/i]}});var n=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&i<=e[1]}}function Tq(r){var e=r.dimensions;return e[0]==="lng"&&e[1]==="lat"}var w_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a;i.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===t&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):Tq(o)&&this._renderOnGeo(o,t,a,n)},e.prototype.incrementalPrepareRender=function(t,i,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,i,n,a){var o=i.coordinateSystem;o&&(Tq(o)?this.render(i,n,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(i,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){sa(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,i,n,a,o){var s=t.coordinateSystem,l=ls(s,"cartesian2d"),u,c,f,h;if(l){var p=s.getAxis("x"),d=s.getAxis("y");u=p.getBandWidth()+.5,c=d.getBandWidth()+.5,f=p.scale.getExtent(),h=d.scale.getExtent()}for(var g=this.group,m=t.getData(),v=t.getModel(["emphasis","itemStyle"]).getItemStyle(),_=t.getModel(["blur","itemStyle"]).getItemStyle(),y=t.getModel(["select","itemStyle"]).getItemStyle(),x=t.get(["itemStyle","borderRadius"]),M=Tr(t),S=t.getModel("emphasis"),w=S.get("focus"),T=S.get("blurScope"),C=S.get("disabled"),b=l?[m.mapDimension("x"),m.mapDimension("y"),m.mapDimension("value")]:[m.mapDimension("time"),m.mapDimension("value")],E=n;Ef[1]||Dh[1])continue;var U=s.dataToPoint([A,D]);I=new Tt({shape:{x:U[0]-u/2,y:U[1]-c/2,width:u,height:c},style:R})}else{if(isNaN(m.get(b[1],E)))continue;I=new Tt({z2:1,shape:s.dataToRect([m.get(b[0],E)]).contentShape,style:R})}if(m.hasItemOption){var B=m.getItemModel(E),F=B.getModel("emphasis");v=F.getModel("itemStyle").getItemStyle(),_=B.getModel(["blur","itemStyle"]).getItemStyle(),y=B.getModel(["select","itemStyle"]).getItemStyle(),x=B.get(["itemStyle","borderRadius"]),w=F.get("focus"),T=F.get("blurScope"),C=F.get("disabled"),M=Tr(B)}I.shape.r=x;var k=t.getRawValue(E),G="-";k&&k[2]!=null&&(G=k[2]+""),Nr(I,M,{labelFetcher:t,labelDataIndex:E,defaultOpacity:R.opacity,defaultText:G}),I.ensureState("emphasis").style=v,I.ensureState("blur").style=_,I.ensureState("select").style=y,nr(I,w,T,C),I.incremental=o,o&&(I.states.emphasis.hoverLayer=!0),g.add(I),m.setItemGraphicEl(E,I),this._progressiveEls&&this._progressiveEls.push(I)}},e.prototype._renderOnGeo=function(t,i,n,a){var o=n.targetVisuals.inRange,s=n.targetVisuals.outOfRange,l=i.getData(),u=this._hmLayer||this._hmLayer||new wq;u.blurSize=i.get("blurSize"),u.pointSize=i.get("pointSize"),u.minOpacity=i.get("minOpacity"),u.maxOpacity=i.get("maxOpacity");var c=t.getViewRect().clone(),f=t.getRoamTransform();c.applyTransform(f);var h=Math.max(c.x,0),p=Math.max(c.y,0),d=Math.min(c.width+c.x,a.getWidth()),g=Math.min(c.height+c.y,a.getHeight()),m=d-h,v=g-p,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],y=l.mapArray(_,function(w,T,C){var b=t.dataToPoint([w,T]);return b[0]-=h,b[1]-=p,b.push(C),b}),x=n.getExtent(),M=n.type==="visualMap.continuous"?b_e(x,n.option.range):M_e(x,n.getPieceList(),n.option.selected);u.update(y,m,v,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},M);var S=new Ur({style:{width:m,height:v,x:h,y:p,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(Yt),Eq=w_e;var T_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){return hn(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=Uu.get(this.get("coordinateSystem"));if(t&&t.dimensions)return t.dimensions[0]==="lng"&&t.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(jt),Aq=T_e;function cU(r){r.registerChartView(Eq),r.registerSeriesModel(Aq)}var E_e=["itemStyle","borderWidth"],Cq=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],fU=new oa,A_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),f=l.master.getRect(),h={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:c,valueDim:Cq[+c],categoryDim:Cq[1-+c]};o.diff(s).add(function(d){if(o.hasValue(d)){var g=Lq(o,d),m=Rq(o,d,g,h),v=Pq(o,h,m);o.setItemGraphicEl(d,v),a.add(v),Iq(v,h,m)}}).update(function(d,g){var m=s.getItemGraphicEl(g);if(!o.hasValue(d)){a.remove(m);return}var v=Lq(o,d),_=Rq(o,d,v,h),y=kq(o,_);m&&y!==m.__pictorialShapeStr&&(a.remove(m),o.setItemGraphicEl(d,null),m=null),m?N_e(m,h,_):m=Pq(o,h,_,!0),o.setItemGraphicEl(d,m),m.__pictorialSymbolMeta=_,a.add(m),Iq(m,h,_)}).remove(function(d){var g=s.getItemGraphicEl(d);g&&Dq(s,d,g.__pictorialSymbolMeta.animationModel,g)}).execute();var p=t.get("clip",!0)?ql(t.coordinateSystem,!1,t):null;return p?a.setClipPath(p):a.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(t,i){var n=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(o){Dq(a,rt(o).dataIndex,t,o)}):n.removeAll()},e.type="pictorialBar",e}(Yt);function Rq(r,e,t,i){var n=r.getItemLayout(e),a=t.get("symbolRepeat"),o=t.get("symbolClip"),s=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=t.get("symbolPatternSize")||2,f=t.isAnimationEnabled(),h={dataIndex:e,layout:n,itemModel:t,symbolType:r.getItemVisual(e,"symbol")||"circle",style:r.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:f?t:null,hoverScale:f&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};C_e(t,a,n,i,h),R_e(r,e,n,a,o,h.boundingLength,h.pxSign,c,i,h),L_e(t,h.symbolScale,u,i,h);var p=h.symbolSize,d=bo(t.get("symbolOffset"),p);return P_e(t,p,n,a,o,d,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,i,h),h}function C_e(r,e,t,i,n){var a=i.valueDim,o=r.get("symbolBoundingData"),s=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(t[a.wh]<=0),c;if(pe(o)){var f=[hU(s,o[0])-l,hU(s,o[1])-l];f[1]0?1:-1}function hU(r,e){return r.toGlobalCoord(r.dataToCoord(r.scale.parse(e)))}function R_e(r,e,t,i,n,a,o,s,l,u){var c=l.valueDim,f=l.categoryDim,h=Math.abs(t[f.wh]),p=r.getItemVisual(e,"symbolSize"),d;pe(p)?d=p.slice():p==null?d=["100%","100%"]:d=[p,p],d[f.index]=Fe(d[f.index],h),d[c.index]=Fe(d[c.index],i?h:Math.abs(a)),u.symbolSize=d;var g=u.symbolScale=[d[0]/s,d[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*o}function L_e(r,e,t,i,n){var a=r.get(E_e)||0;a&&(fU.attr({scaleX:e[0],scaleY:e[1],rotation:t}),fU.updateTransform(),a/=fU.getLineScale(),a*=e[i.valueDim.index]),n.valueLineWidth=a||0}function P_e(r,e,t,i,n,a,o,s,l,u,c,f){var h=c.categoryDim,p=c.valueDim,d=f.pxSign,g=Math.max(e[p.index]+s,0),m=g;if(i){var v=Math.abs(l),_=Br(r.get("symbolMargin"),"15%")+"",y=!1;_.lastIndexOf("!")===_.length-1&&(y=!0,_=_.slice(0,_.length-1));var x=Fe(_,e[p.index]),M=Math.max(g+x*2,0),S=y?0:x*2,w=yp(i),T=w?i:Nq((v+S)/M),C=v-T*g;x=C/2/(y?T:Math.max(T-1,1)),M=g+x*2,S=y?0:x*2,!w&&i!=="fixed"&&(T=u?Nq((Math.abs(u)+S)/M):0),m=T*M-S,f.repeatTimes=T,f.symbolMargin=x}var b=d*(m/2),E=f.pathPosition=[];E[h.index]=t[h.wh]/2,E[p.index]=o==="start"?b:o==="end"?l-b:l/2,a&&(E[0]+=a[0],E[1]+=a[1]);var I=f.bundlePosition=[];I[h.index]=t[h.xy],I[p.index]=t[p.xy];var R=f.barRectShape=fe({},t);R[p.wh]=d*Math.max(Math.abs(t[p.wh]),Math.abs(E[p.index]+b)),R[h.wh]=t[h.wh];var A=f.clipShape={};A[h.xy]=-t[h.xy],A[h.wh]=c.ecSize[h.wh],A[p.xy]=0,A[p.wh]=t[p.wh]}function Uq(r){var e=r.symbolPatternSize,t=Sr(r.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function Oq(r,e,t,i){var n=r.__pictorialBundle,a=t.symbolSize,o=t.valueLineWidth,s=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,c=0,f=a[e.valueDim.index]+o+t.symbolMargin*2;for(pU(r,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c0:v<0)&&(_=u-1-g),m[l.index]=f*(_-u/2+.5)+s[l.index],{x:m[0],y:m[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function Fq(r,e,t,i){var n=r.__pictorialBundle,a=r.__pictorialMainPath;a?Hv(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,i):(a=r.__pictorialMainPath=Uq(t),n.add(a),Hv(a,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:0,scaleY:0,rotation:t.rotation},{scaleX:t.symbolScale[0],scaleY:t.symbolScale[1]},t,i))}function zq(r,e,t){var i=fe({},e.barRectShape),n=r.__pictorialBarRect;n?Hv(n,null,{shape:i},e,t):(n=r.__pictorialBarRect=new Tt({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),n.disableMorphing=!0,r.add(n))}function Bq(r,e,t,i){if(t.symbolClip){var n=r.__pictorialClipPath,a=fe({},t.clipShape),o=e.valueDim,s=t.animationModel,l=t.dataIndex;if(n)Dt(n,{shape:a},s,l);else{a[o.wh]=0,n=new Tt({shape:a}),r.__pictorialBundle.setClipPath(n),r.__pictorialClipPath=n;var u={};u[o.wh]=t.clipShape[o.wh],Ct[i?"updateProps":"initProps"](n,{shape:u},s,l)}}}function Lq(r,e){var t=r.getItemModel(e);return t.getAnimationDelayParams=D_e,t.isAnimationEnabled=I_e,t}function D_e(r){return{index:r.__pictorialAnimationIndex,count:r.__pictorialRepeatTimes}}function I_e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function Pq(r,e,t,i){var n=new Ze,a=new Ze;return n.add(a),n.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?Oq(n,e,t):Fq(n,e,t),zq(n,t,i),Bq(n,e,t,i),n.__pictorialShapeStr=kq(r,t),n.__pictorialSymbolMeta=t,n}function N_e(r,e,t){var i=t.animationModel,n=t.dataIndex,a=r.__pictorialBundle;Dt(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},i,n),t.symbolRepeat?Oq(r,e,t,!0):Fq(r,e,t,!0),zq(r,t,!0),Bq(r,e,t,!0)}function Dq(r,e,t,i){var n=i.__pictorialBarRect;n&&n.removeTextContent();var a=[];pU(i,function(o){a.push(o)}),i.__pictorialMainPath&&a.push(i.__pictorialMainPath),i.__pictorialClipPath&&(t=null),N(a,function(o){es(o,{scaleX:0,scaleY:0},t,e,function(){i.parent&&i.parent.remove(i)})}),r.setItemGraphicEl(e,null)}function kq(r,e){return[r.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function pU(r,e,t){N(r.__pictorialBundle.children(),function(i){i!==r.__pictorialBarRect&&e.call(t,i)})}function Hv(r,e,t,i,n,a){e&&r.attr(e),i.symbolClip&&!n?t&&r.attr(t):t&&Ct[n?"updateProps":"initProps"](r,t,i.animationModel,i.dataIndex,a)}function Iq(r,e,t){var i=t.dataIndex,n=t.itemModel,a=n.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=n.getModel(["blur","itemStyle"]).getItemStyle(),l=n.getModel(["select","itemStyle"]).getItemStyle(),u=n.getShallow("cursor"),c=a.get("focus"),f=a.get("blurScope"),h=a.get("scale");pU(r,function(g){if(g instanceof Ur){var m=g.style;g.useStyle(fe({image:m.image,x:m.x,y:m.y,width:m.width,height:m.height},t.style))}else g.useStyle(t.style);var v=g.ensureState("emphasis");v.style=o,h&&(v.scaleX=g.scaleX*1.1,v.scaleY=g.scaleY*1.1),g.ensureState("blur").style=s,g.ensureState("select").style=l,u&&(g.cursor=u),g.z2=t.z2});var p=e.valueDim.posDesc[+(t.boundingLength>0)],d=r.__pictorialBarRect;d.ignoreClip=!0,Nr(d,Tr(n),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:Qs(e.seriesModel.getData(),i),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:p}),nr(r,c,f,a.get("disabled"))}function Nq(r){var e=Math.round(r);return Math.abs(r-e)<1e-4?e:Math.ceil(r)}var Vq=A_e;var U_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t.defaultSymbol="roundRect",t}return e.prototype.getInitialData=function(t){return t.stack=null,r.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=Hn(wv.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(wv),Gq=U_e;function dU(r){r.registerChartView(Vq),r.registerSeriesModel(Gq),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ot(S1,"pictorialBar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,M1("pictorialBar"))}var O_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this,s=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,f=u.boundaryGap;s.x=0,s.y=c.y+f[0];function h(m){return m.name}var p=new An(this._layersSeries||[],l,h,h),d=[];p.add(Be(g,this,"add")).update(Be(g,this,"update")).remove(Be(g,this,"remove")).execute();function g(m,v,_){var y=o._layers;if(m==="remove"){s.remove(y[v]);return}for(var x=[],M=[],S,w=l[v].indices,T=0;Ta&&(a=s),i.push(s)}for(var u=0;ua&&(a=f)}return{y0:n,max:a}}function gU(r){r.registerChartView(Hq),r.registerSeriesModel(Wq),r.registerLayout(vU),r.registerProcessor(tl("themeRiver"))}var k_e=2,V_e=4,G_e=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this)||this;o.z2=k_e,o.textConfig={inside:!0},rt(o).seriesIndex=i.seriesIndex;var s=new Lt({z2:V_e,silent:t.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,t,i,n,a),o}return e.prototype.updateData=function(t,i,n,a,o){this.node=i,i.piece=this,n=n||this._seriesModel,a=a||this._ecModel;var s=this;rt(s).dataIndex=i.dataIndex;var l=i.getModel(),u=l.getModel("emphasis"),c=i.getLayout(),f=fe({},c);f.label=null;var h=i.getVisual("style");h.lineJoin="bevel";var p=i.getVisual("decal");p&&(h.decal=Zs(p,o));var d=Zl(l.getModel("itemStyle"),f,!0);fe(f,d),N(Bi,function(_){var y=s.ensureState(_),x=l.getModel([_,"itemStyle"]);y.style=x.getItemStyle();var M=Zl(x,f);M&&(y.shape=M)}),t?(s.setShape(f),s.shape.r=c.r0,ar(s,{shape:{r:c.r}},n,i.dataIndex)):(Dt(s,{shape:f},n),Ii(s)),s.useStyle(h),this._updateLabel(n);var g=l.getShallow("cursor");g&&s.attr("cursor",g),this._seriesModel=n||this._seriesModel,this._ecModel=a||this._ecModel;var m=u.get("focus"),v=m==="ancestor"?i.getAncestorsIndices():m==="descendant"?i.getDescendantIndices():m;nr(this,v,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var i=this,n=this.node.getModel(),a=n.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),f=this,h=f.getTextContent(),p=this.node.dataIndex,d=a.get("minAngle")/180*Math.PI,g=a.get("show")&&!(d!=null&&Math.abs(s)A&&!Su(U-A)&&U0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,t,i,n):(o.virtualPiece=new yU(_,t,i,n),c.add(o.virtualPiece)),y.piece.off("click"),o.virtualPiece.on("click",function(x){o._rootToNode(y.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(i){var n=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(o){if(!n&&o.piece&&o.piece===i.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")t._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";kp(u,c)}}n=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:kT,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,i){var n=i.getData(),a=n.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(Yt),Zq=W_e;var X_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,i){var n={name:t.name,children:t.data};jq(n);var a=this._levelModels=de(t.levels||[],function(l){return new Zt(l,this,i)},this),o=Lv.createTree(n,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var f=o.getNodeByDataIndex(c),h=a[f.depth];return h&&(u.parentModel=h),u})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treePathInfo=Yf(n,this),i},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var i=this.getRawData().tree.root;(!t||t!==i&&!i.contains(t))&&(this._viewRoot=i)},e.prototype.enableAriaDecal=function(){Sx(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(jt);function jq(r){var e=0;N(r.children,function(i){jq(i);var n=i.value;pe(n)&&(n=n[0]),e+=n});var t=r.value;pe(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),pe(r.value)?r.value[0]=t:r.value=t}var Kq=X_e;var Jq=Math.PI/180;function _U(r,e,t){e.eachSeriesByType(r,function(i){var n=i.get("center"),a=i.get("radius");pe(a)||(a=[0,a]),pe(n)||(n=[n,n]);var o=t.getWidth(),s=t.getHeight(),l=Math.min(o,s),u=Fe(n[0],o),c=Fe(n[1],s),f=Fe(a[0],l/2),h=Fe(a[1],l/2),p=-i.get("startAngle")*Jq,d=i.get("minAngle")*Jq,g=i.getData().tree.root,m=i.getViewRoot(),v=m.depth,_=i.get("sort");_!=null&&$q(m,_);var y=0;N(m.children,function(U){!isNaN(U.getValue())&&y++});var x=m.getValue(),M=Math.PI/(x||y)*2,S=m.depth>0,w=m.height-(S?-1:1),T=(h-f)/(w||1),C=i.get("clockwise"),b=i.get("stillShowZeroSum"),E=C?1:-1,I=function(U,B){if(U){var F=B;if(U!==g){var k=U.getValue(),G=x===0&&b?M:k*M;G1;)o=o.parentNode;var s=n.getColorFromPalette(o.name||o.dataIndex+"",e);return i.depth>1&&Ce(s)&&(s=Sb(s,(i.depth-1)/(a-1)*.5)),s}r.eachSeriesByType("sunburst",function(i){var n=i.getData(),a=n.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(o,i,a.root.height));var u=n.ensureUniqueItemVisual(o.dataIndex,"style");fe(u,l)})})}function SU(r){r.registerChartView(Zq),r.registerSeriesModel(Kq),r.registerLayout(ot(_U,"sunburst")),r.registerProcessor(ot(tl,"sunburst")),r.registerVisual(xU),qq(r)}var MU={color:"fill",borderColor:"stroke"},Qq={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Jl=vt(),q_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,i){return hn(null,this)},e.prototype.getDataParams=function(t,i,n){var a=r.prototype.getDataParams.call(this,t,i);return n&&(a.info=Jl(n).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(jt),eZ=q_e;function Z_e(r,e){return e=e||[0,0],de(["x","y"],function(t,i){var n=this.getAxis(t),a=e[i],o=r[i]/2;return n.type==="category"?n.getBandWidth():Math.abs(n.dataToCoord(a-o)-n.dataToCoord(a+o))},this)}function bU(r){var e=r.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:Be(Z_e,r)}}}function j_e(r,e){return e=e||[0,0],de([0,1],function(t){var i=e[t],n=r[t]/2,a=[],o=[];return a[t]=i-n,o[t]=i+n,a[1-t]=o[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(o)[t])},this)}function wU(r){var e=r.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:r.getZoom()},api:{coord:function(t){return r.dataToPoint(t)},size:Be(j_e,r)}}}function K_e(r,e){var t=this.getAxis(),i=e instanceof Array?e[0]:e,n=(r instanceof Array?r[0]:r)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(i-n)-t.dataToCoord(i+n))}function TU(r){var e=r.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:Be(K_e,r)}}}function J_e(r,e){return e=e||[0,0],de(["Radius","Angle"],function(t,i){var n="get"+t+"Axis",a=this[n](),o=e[i],s=r[i]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function EU(r){var e=r.getRadiusAxis(),t=r.getAngleAxis(),i=e.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:r.cx,cy:r.cy,r:i[1],r0:i[0]},api:{coord:function(n){var a=e.dataToRadius(n[0]),o=t.dataToAngle(n[1]),s=r.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:Be(J_e,r)}}}function AU(r){var e=r.getRect(),t=r.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:r.getCellWidth(),cellHeight:r.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(i,n){return r.dataToPoint(i,n)}}}}function VT(r,e,t,i){return r&&(r.legacy||r.legacy!==!1&&!t&&!i&&e!=="tspan"&&(e==="text"||tt(r,"text")))}function GT(r,e,t){var i=r,n,a,o;if(e==="text")o=i;else{o={},tt(i,"text")&&(o.text=i.text),tt(i,"rich")&&(o.rich=i.rich),tt(i,"textFill")&&(o.fill=i.textFill),tt(i,"textStroke")&&(o.stroke=i.textStroke),tt(i,"fontFamily")&&(o.fontFamily=i.fontFamily),tt(i,"fontSize")&&(o.fontSize=i.fontSize),tt(i,"fontStyle")&&(o.fontStyle=i.fontStyle),tt(i,"fontWeight")&&(o.fontWeight=i.fontWeight),a={type:"text",style:o,silent:!0},n={};var s=tt(i,"textPosition");t?n.position=s?i.textPosition:"inside":s&&(n.position=i.textPosition),tt(i,"textPosition")&&(n.position=i.textPosition),tt(i,"textOffset")&&(n.offset=i.textOffset),tt(i,"textRotation")&&(n.rotation=i.textRotation),tt(i,"textDistance")&&(n.distance=i.textDistance)}return tZ(o,r),N(o.rich,function(l){tZ(l,l)}),{textConfig:n,textContent:a}}function tZ(r,e){e&&(e.font=e.textFont||e.font,tt(e,"textStrokeWidth")&&(r.lineWidth=e.textStrokeWidth),tt(e,"textAlign")&&(r.align=e.textAlign),tt(e,"textVerticalAlign")&&(r.verticalAlign=e.textVerticalAlign),tt(e,"textLineHeight")&&(r.lineHeight=e.textLineHeight),tt(e,"textWidth")&&(r.width=e.textWidth),tt(e,"textHeight")&&(r.height=e.textHeight),tt(e,"textBackgroundColor")&&(r.backgroundColor=e.textBackgroundColor),tt(e,"textPadding")&&(r.padding=e.textPadding),tt(e,"textBorderColor")&&(r.borderColor=e.textBorderColor),tt(e,"textBorderWidth")&&(r.borderWidth=e.textBorderWidth),tt(e,"textBorderRadius")&&(r.borderRadius=e.textBorderRadius),tt(e,"textBoxShadowColor")&&(r.shadowColor=e.textBoxShadowColor),tt(e,"textBoxShadowBlur")&&(r.shadowBlur=e.textBoxShadowBlur),tt(e,"textBoxShadowOffsetX")&&(r.shadowOffsetX=e.textBoxShadowOffsetX),tt(e,"textBoxShadowOffsetY")&&(r.shadowOffsetY=e.textBoxShadowOffsetY))}function CU(r,e,t){var i=r;i.textPosition=i.textPosition||t.position||"inside",t.offset!=null&&(i.textOffset=t.offset),t.rotation!=null&&(i.textRotation=t.rotation),t.distance!=null&&(i.textDistance=t.distance);var n=i.textPosition.indexOf("inside")>=0,a=r.fill||"#000";rZ(i,e);var o=i.textFill==null;return n?o&&(i.textFill=t.insideFill||"#fff",!i.textStroke&&t.insideStroke&&(i.textStroke=t.insideStroke),!i.textStroke&&(i.textStroke=a),i.textStrokeWidth==null&&(i.textStrokeWidth=2)):(o&&(i.textFill=r.fill||t.outsideFill||"#000"),!i.textStroke&&t.outsideStroke&&(i.textStroke=t.outsideStroke)),i.text=e.text,i.rich=e.rich,N(e.rich,function(s){rZ(s,s)}),i}function rZ(r,e){e&&(tt(e,"fill")&&(r.textFill=e.fill),tt(e,"stroke")&&(r.textStroke=e.fill),tt(e,"lineWidth")&&(r.textStrokeWidth=e.lineWidth),tt(e,"font")&&(r.font=e.font),tt(e,"fontStyle")&&(r.fontStyle=e.fontStyle),tt(e,"fontWeight")&&(r.fontWeight=e.fontWeight),tt(e,"fontSize")&&(r.fontSize=e.fontSize),tt(e,"fontFamily")&&(r.fontFamily=e.fontFamily),tt(e,"align")&&(r.textAlign=e.align),tt(e,"verticalAlign")&&(r.textVerticalAlign=e.verticalAlign),tt(e,"lineHeight")&&(r.textLineHeight=e.lineHeight),tt(e,"width")&&(r.textWidth=e.width),tt(e,"height")&&(r.textHeight=e.height),tt(e,"backgroundColor")&&(r.textBackgroundColor=e.backgroundColor),tt(e,"padding")&&(r.textPadding=e.padding),tt(e,"borderColor")&&(r.textBorderColor=e.borderColor),tt(e,"borderWidth")&&(r.textBorderWidth=e.borderWidth),tt(e,"borderRadius")&&(r.textBorderRadius=e.borderRadius),tt(e,"shadowColor")&&(r.textBoxShadowColor=e.shadowColor),tt(e,"shadowBlur")&&(r.textBoxShadowBlur=e.shadowBlur),tt(e,"shadowOffsetX")&&(r.textBoxShadowOffsetX=e.shadowOffsetX),tt(e,"shadowOffsetY")&&(r.textBoxShadowOffsetY=e.shadowOffsetY),tt(e,"textShadowColor")&&(r.textShadowColor=e.textShadowColor),tt(e,"textShadowBlur")&&(r.textShadowBlur=e.textShadowBlur),tt(e,"textShadowOffsetX")&&(r.textShadowOffsetX=e.textShadowOffsetX),tt(e,"textShadowOffsetY")&&(r.textShadowOffsetY=e.textShadowOffsetY))}var oZ={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},iZ=bt(oZ),xst=gn(go,function(r,e){return r[e]=1,r},{}),Sst=go.join(", "),Ux=["","style","shape","extra"],Wv=vt();function RU(r,e,t,i,n){var a=r+"Animation",o=Bl(r,i,n)||{},s=Wv(e).userDuring;return o.duration>0&&(o.during=s?Be(rxe,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=r),fe(o,t[a]),o}function Xv(r,e,t,i){i=i||{};var n=i.dataIndex,a=i.isInit,o=i.clearStyle,s=t.isAnimationEnabled(),l=Wv(r),u=e.style;l.userDuring=e.during;var c={},f={};if(nxe(r,e,f),aZ("shape",e,f),aZ("extra",e,f),!a&&s&&(ixe(r,e,c),nZ("shape",r,e,c),nZ("extra",r,e,c),axe(r,e,u,c)),f.style=u,$_e(r,f,o),exe(r,e),s)if(a){var h={};N(Ux,function(d){var g=d?e[d]:e;g&&g.enterFrom&&(d&&(h[d]=h[d]||{}),fe(d?h[d]:h,g.enterFrom))});var p=RU("enter",r,e,t,n);p.duration>0&&r.animateFrom(h,p)}else Q_e(r,e,n||0,t,c);LU(r,e),u?r.dirty():r.markRedraw()}function LU(r,e){for(var t=Wv(r).leaveToProps,i=0;i0&&r.animateFrom(n,a)}}function exe(r,e){tt(e,"silent")&&(r.silent=e.silent),tt(e,"ignore")&&(r.ignore=e.ignore),r instanceof gi&&tt(e,"invisible")&&(r.invisible=e.invisible),r instanceof ut&&tt(e,"autoBatch")&&(r.autoBatch=e.autoBatch)}var $l={},txe={setTransform:function(r,e){return $l.el[r]=e,this},getTransform:function(r){return $l.el[r]},setShape:function(r,e){var t=$l.el,i=t.shape||(t.shape={});return i[r]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(r){var e=$l.el.shape;if(e)return e[r]},setStyle:function(r,e){var t=$l.el,i=t.style;return i&&(i[r]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(r){var e=$l.el.style;if(e)return e[r]},setExtra:function(r,e){var t=$l.el.extra||($l.el.extra={});return t[r]=e,this},getExtra:function(r){var e=$l.el.extra;if(e)return e[r]}};function rxe(){var r=this,e=r.el;if(e){var t=Wv(e).userDuring,i=r.userDuring;if(t!==i){r.el=r.userDuring=null;return}$l.el=e,i(txe)}}function nZ(r,e,t,i){var n=t[r];if(n){var a=e[r],o;if(a){var s=t.transition,l=n.transition;if(l)if(!o&&(o=i[r]={}),jf(l))fe(o,a);else for(var u=Jt(l),c=0;c=0){!o&&(o=i[r]={});for(var p=bt(a),c=0;c=0)){var h=r.getAnimationStyleProps(),p=h?h.style:null;if(p){!a&&(a=i.style={});for(var d=bt(t),u=0;u=0?e.getStore().get(B,D):void 0}var F=e.get(U.name,D),k=U&&U.ordinalMeta;return k?k.categories[F]:F}function S(A,D){D==null&&(D=u);var U=e.getItemVisual(D,"style"),B=U&&U.fill,F=U&&U.opacity,k=_(D,Kf).getItemStyle();B!=null&&(k.fill=B),F!=null&&(k.opacity=F);var G={inheritColor:Ce(B)?B:"#000"},Y=y(D,Kf),J=fr(Y,null,G,!1,!0);J.text=Y.getShallow("show")?ft(r.getFormattedLabel(D,Kf),Qs(e,D)):null;var Q=M_(Y,G,!1);return C(A,k),k=CU(k,J,Q),A&&T(k,A),k.legacy=!0,k}function w(A,D){D==null&&(D=u);var U=_(D,Wu).getItemStyle(),B=y(D,Wu),F=fr(B,null,null,!0,!0);F.text=B.getShallow("show")?Xi(r.getFormattedLabel(D,Wu),r.getFormattedLabel(D,Kf),Qs(e,D)):null;var k=M_(B,null,!0);return C(A,U),U=CU(U,F,k),A&&T(U,A),U.legacy=!0,U}function T(A,D){for(var U in D)tt(D,U)&&(A[U]=D[U])}function C(A,D){A&&(A.textFill&&(D.textFill=A.textFill),A.textPosition&&(D.textPosition=A.textPosition))}function b(A,D){if(D==null&&(D=u),tt(MU,A)){var U=e.getItemVisual(D,"style");return U?U[MU[A]]:null}if(tt(Qq,A))return e.getItemVisual(D,A)}function E(A){if(a.type==="cartesian2d"){var D=a.getBaseAxis();return J6(Ye({axis:D},A))}}function I(){return t.getCurrentSeriesIndices()}function R(A){return iv(A,t)}}function mxe(r){var e={};return N(r.dimensions,function(t){var i=r.getDimensionInfo(t);if(!i.isExtraCoord){var n=i.coordDim,a=e[n]=e[n]||[];a[i.coordDimIndex]=r.getDimensionIndex(t)}}),e}function IU(r,e,t,i,n,a,o){if(!i){a.remove(e);return}var s=kU(r,e,t,i,n,a);return s&&o.setItemGraphicEl(t,s),s&&nr(s,i.focus,i.blurScope,i.emphasisDisabled),s}function kU(r,e,t,i,n,a){var o=-1,s=e;e&&dZ(e,i,n)&&(o=dt(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=zU(i),s&&fxe(s,u)),i.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),hs.normal.cfg=hs.normal.conOpt=hs.emphasis.cfg=hs.emphasis.conOpt=hs.blur.cfg=hs.blur.conOpt=hs.select.cfg=hs.select.conOpt=null,hs.isLegacy=!1,gxe(u,t,i,n,l,hs),vxe(u,t,i,n,l),BU(r,u,t,i,hs,n,l),tt(i,"info")&&(Jl(u).info=i.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function dZ(r,e,t){var i=Jl(r),n=e.type,a=e.shape,o=e.style;return t.isUniversalTransitionEnabled()||n!=null&&n!==i.customGraphicType||n==="path"&&Mxe(a)&&mZ(a)!==i.customPathData||n==="image"&&tt(o,"image")&&o.image!==i.customImagePath}function vxe(r,e,t,i,n){var a=t.clipPath;if(a===!1)r&&r.getClipPath()&&r.removeClipPath();else if(a){var o=r.getClipPath();o&&dZ(o,a,i)&&(o=null),o||(o=zU(a),r.setClipPath(o)),BU(null,o,e,a,null,i,n)}}function gxe(r,e,t,i,n,a){if(!r.isGroup){uZ(t,null,a),uZ(t,Wu,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=r.getTextContent();if(o===!1)c&&r.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=zU(o),r.setTextContent(c)),BU(null,c,e,o,null,i,n);for(var f=o&&o.style,h=0;h=c;p--){var d=e.childAt(p);_xe(e,d,n)}}}function _xe(r,e,t){e&&Yv(e,Jl(r).option,t)}function xxe(r){new An(r.oldChildren,r.newChildren,cZ,cZ,r).add(fZ).update(fZ).remove(Sxe).execute()}function cZ(r,e){var t=r&&r.name;return t??uxe+e}function fZ(r,e){var t=this.context,i=r!=null?t.newChildren[r]:null,n=e!=null?t.oldChildren[e]:null;kU(t.api,n,t.dataIndex,i,t.seriesModel,t.group)}function Sxe(r){var e=this.context,t=e.oldChildren[r];t&&Yv(t,Jl(t).option,e.seriesModel)}function mZ(r){return r&&(r.pathData||r.d)}function Mxe(r){return r&&(tt(r,"pathData")||tt(r,"d"))}function GU(r){r.registerChartView(hZ),r.registerSeriesModel(eZ)}var cd=vt(),vZ=Qe,HU=Be,bxe=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(e,t,i,n){var a=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,i);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=c;var f=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new Ze,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),i.getZr().add(s);else{var h=ot(gZ,t,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,t)}_Z(s,t,!0),this._renderHandle(a)}},r.prototype.remove=function(e){this.clear(e)},r.prototype.dispose=function(e){this.clear(e)},r.prototype.determineAnimation=function(e,t){var i=t.get("animation"),n=e.axis,a=n.type==="category",o=t.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=oT(e).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},r.prototype.makeElOption=function(e,t,i,n,a){},r.prototype.createPointerEl=function(e,t,i,n){var a=t.pointer;if(a){var o=cd(e).pointerEl=new Ct[a.type](vZ(t.pointer));e.add(o)}},r.prototype.createLabelEl=function(e,t,i,n){if(t.label){var a=cd(e).labelEl=new Lt(vZ(t.label));e.add(a),yZ(a,n)}},r.prototype.updatePointerEl=function(e,t,i){var n=cd(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},r.prototype.updateLabelEl=function(e,t,i,n){var a=cd(e).labelEl;a&&(a.setStyle(t.label.style),i(a,{x:t.label.x,y:t.label.y}),yZ(a,n))},r.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=t.getModel("handle"),o=t.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=Pu(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Ea(u.event)},onmousedown:HU(this._onHandleDragMove,this,0,0),drift:HU(this._onHandleDragMove,this),ondragend:HU(this._onHandleDragEnd,this)}),i.add(n)),_Z(n,t,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");pe(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,as(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},r.prototype._moveHandleToValue=function(e,t){gZ(this._axisPointerModel,!t&&this._moveAnimation,this._handle,WU(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(WU(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(WU(n)),cd(i).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,n=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),zu(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(e,t,i){return i=i||0,{x:e[i],y:e[1-i],width:t[i],height:t[1-i]}},r}();function gZ(r,e,t,i){xZ(cd(t).lastProp,i)||(cd(t).lastProp=i,e?Dt(t,i,r):(t.stopAnimation(),t.attr(i)))}function xZ(r,e){if(qe(r)&&qe(e)){var t=!0;return N(e,function(i,n){t=t&&xZ(r[n],i)}),!!t}else return r===e}function yZ(r,e){r[e.get(["label","show"])?"show":"hide"]()}function WU(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function _Z(r,e,t){var i=e.get("z"),n=e.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=t)})}var Zv=bxe;function jv(r){var e=r.get("type"),t=r.getModel(e+"Style"),i;return e==="line"?(i=t.getLineStyle(),i.fill=null):e==="shadow"&&(i=t.getAreaStyle(),i.stroke=null),i}function XU(r,e,t,i,n){var a=t.get("value"),o=YU(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=Gs(s.get("padding")||0),u=s.getFont(),c=Ll(o,u),f=n.position,h=c.width+l[1]+l[3],p=c.height+l[0]+l[2],d=n.align;d==="right"&&(f[0]-=h),d==="center"&&(f[0]-=h/2);var g=n.verticalAlign;g==="bottom"&&(f[1]-=p),g==="middle"&&(f[1]-=p/2),wxe(f,h,p,i);var m=s.get("backgroundColor");(!m||m==="auto")&&(m=e.get(["axisLine","lineStyle","color"])),r.label={x:f[0],y:f[1],style:fr(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:m}),z2:10}}function wxe(r,e,t,i){var n=i.getWidth(),a=i.getHeight();r[0]=Math.min(r[0]+e,n)-e,r[1]=Math.min(r[1]+t,a)-t,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function YU(r,e,t,i,n){r=e.scale.parse(r);var a=e.scale.getLabel({value:r},{precision:n.precision}),o=n.formatter;if(o){var s={value:ox(e,{value:r}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};N(i,function(l){var u=t.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),Ce(o)?a=o.replace("{value}",a):He(o)&&(a=o(s))}return a}function Ox(r,e,t){var i=wi();return Ca(i,i,t.rotation),_n(i,i,t.position),wn([r.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],i)}function XT(r,e,t,i,n,a){var o=Cn.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=n.get(["label","margin"]),XU(e,i,n,a,{position:Ox(i.axis,r,t),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function Kv(r,e,t){return t=t||0,{x1:r[t],y1:r[1-t],x2:e[t],y2:e[1-t]}}function YT(r,e,t){return t=t||0,{x:r[t],y:r[1-t],width:e[t],height:e[1-t]}}function qU(r,e,t,i,n,a){return{cx:r,cy:e,r0:t,r:i,startAngle:n,endAngle:a,clockwise:!0}}var Txe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),c=SZ(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var h=jv(a),p=Exe[u](s,f,c);p.style=h,t.graphicKey=p.type,t.pointer=p}var d=gx(l.model,n);XT(i,t,d,n,a,o)},e.prototype.getHandleTransform=function(t,i,n){var a=gx(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=Ox(i.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=SZ(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,f=[t.x,t.y];f[c]+=i[c],f[c]=Math.min(l[1],f[c]),f[c]=Math.max(l[0],f[c]);var h=(u[1]+u[0])/2,p=[h,h];p[c]=f[c];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:t.rotation,cursorPoint:p,tooltipOption:d[c]}},e}(Zv);function SZ(r,e){var t={};return t[e.dim+"AxisIndex"]=e.index,r.getCartesian(t)}var Exe={line:function(r,e,t){var i=Kv([e,t[0]],[e,t[1]],MZ(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,e,t){var i=Math.max(1,r.getBandWidth()),n=t[1]-t[0];return{type:"Rect",shape:YT([e-i/2,t[0]],[i,n],MZ(r))}}};function MZ(r){return r.dim==="x"?0:1}var bZ=Txe;var Axe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Pt),wZ=Axe;var Xu=vt(),Cxe=N;function ZT(r,e,t){if(!Ft.node){var i=e.getZr();Xu(i).records||(Xu(i).records={}),Rxe(i,e);var n=Xu(i).records[r]||(Xu(i).records[r]={});n.handler=t}}function Rxe(r,e){if(Xu(r).initialized)return;Xu(r).initialized=!0,t("click",ot(TZ,"click")),t("mousemove",ot(TZ,"mousemove")),t("globalout",Pxe);function t(i,n){r.on(i,function(a){var o=Dxe(e);Cxe(Xu(r).records,function(s){s&&n(s,a,o.dispatchAction)}),Lxe(o.pendings,e)})}}function Lxe(r,e){var t=r.showTip.length,i=r.hideTip.length,n;t?n=r.showTip[t-1]:i&&(n=r.hideTip[i-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function Pxe(r,e,t){r.handler("leave",null,t)}function TZ(r,e,t,i){e.handler(r,t,i)}function Dxe(r){var e={showTip:[],hideTip:[]},t=function(i){var n=e[i.type];n?n.push(i):(i.dispatchAction=t,r.dispatchAction(i))};return{dispatchAction:t,pendings:e}}function Fx(r,e){if(!Ft.node){var t=e.getZr(),i=(Xu(t).records||{})[r];i&&(Xu(t).records[r]=null)}}var Ixe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=i.getComponent("tooltip"),o=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";ZT("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,i){Fx("axisPointer",i)},e.prototype.dispose=function(t,i){Fx("axisPointer",i)},e.type="axisPointer",e}(Qt),AZ=Ixe;function zx(r,e){var t=[],i=r.seriesIndex,n;if(i==null||!(n=e.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=Jo(a,r);if(o==null||o<0||pe(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)t=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),f=c.dim,h=u.dim,p=f==="x"||f==="radius"?1:0,d=a.mapDimension(h),g=[];g[p]=a.get(d,o),g[1-p]=a.get(a.getCalculationInfo("stackResultDimension"),o),t=l.dataToPoint(g)||[]}else t=l.dataToPoint(a.getValues(de(l.dimensions,function(v){return a.mapDimension(v)}),o))||[];else if(s){var m=s.getBoundingRect().clone();m.applyTransform(s.transform),t=[m.x+m.width/2,m.y+m.height/2]}return{point:t,el:s}}var CZ=vt();function ZU(r,e,t){var i=r.currTrigger,n=[r.x,r.y],a=r,o=r.dispatchAction||Be(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){jT(n)&&(n=zx({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=jT(n),u=a.axesInfo,c=s.axesInfo,f=i==="leave"||jT(n),h={},p={},d={list:[],map:{}},g={showPointer:ot(Uxe,p),showTooltip:ot(Oxe,d)};N(s.coordSysMap,function(v,_){var y=l||v.containPoint(n);N(s.coordSysAxesInfo[_],function(x,M){var S=x.axis,w=kxe(u,x);if(!f&&y&&(!u||w)){var T=w&&w.value;T==null&&!l&&(T=S.pointToData(n)),T!=null&&RZ(x,T,g,!1,h)}})});var m={};return N(c,function(v,_){var y=v.linkGroup;y&&!p[_]&&N(y.axesInfo,function(x,M){var S=p[M];if(x!==v&&S){var w=S.value;y.mapper&&(w=v.axis.scale.parse(y.mapper(w,LZ(x),LZ(v)))),m[v.key]=w}})}),N(m,function(v,_){RZ(c[_],v,g,!0,h)}),Fxe(p,c,h),zxe(d,n,r,o),Bxe(c,o,t),h}}function RZ(r,e,t,i,n){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!r.involveSeries){t.showPointer(r,e);return}var o=Nxe(e,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&fe(n,s[0]),!i&&r.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(r,e,s),t.showTooltip(r,o,l)}}function Nxe(r,e){var t=e.axis,i=t.dim,n=r,a=[],o=Number.MAX_VALUE,s=-1;return N(e.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(i),f,h;if(l.getAxisTooltipData){var p=l.getAxisTooltipData(c,r,t);h=p.dataIndices,f=p.nestestValue}else{if(h=l.getData().indicesOfNearest(c[0],r,t.type==="category"?.5:null),!h.length)return;f=l.getData().get(c[0],h[0])}if(!(f==null||!isFinite(f))){var d=r-f,g=Math.abs(d);g<=o&&((g=0&&s<0)&&(o=g,s=d,n=f,a.length=0),N(h,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:n}}function Uxe(r,e,t,i){r[e.key]={value:t,payloadBatch:i}}function Oxe(r,e,t,i){var n=t.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!n.length)){var l=e.coordSys.model,u=Ev(l),c=r.map[u];c||(c=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function Fxe(r,e,t){var i=t.axesInfo=[];N(e,function(n,a){var o=n.axisPointerModel.option,s=r[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function zxe(r,e,t,i){if(jT(e)||!r.list.length){i({type:"hideTip"});return}var n=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:r.list})}function Bxe(r,e,t){var i=t.getZr(),n="axisPointerLastHighlights",a=CZ(i)[n]||{},o=CZ(i)[n]={};N(r,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&N(f.seriesDataIndices,function(h){var p=h.seriesIndex+" | "+h.dataIndex;o[p]=h})});var s=[],l=[];N(a,function(u,c){!o[c]&&l.push(u)}),N(o,function(u,c){!a[c]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function kxe(r,e){for(var t=0;t<(r||[]).length;t++){var i=r[t];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function LZ(r){var e=r.axis.model,t={},i=t.axisDim=r.axis.dim;return t.axisIndex=t[i+"AxisIndex"]=e.componentIndex,t.axisName=t[i+"AxisName"]=e.name,t.axisId=t[i+"AxisId"]=e.id,t}function jT(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function il(r){Wa.registerAxisPointerClass("CartesianAxisPointer",bZ),r.registerComponentModel(wZ),r.registerComponentView(AZ),r.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!pe(t)&&(e.axisPointer.link=[t])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=i9(e,t)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},ZU)}function jU(r){It(uT),It(il)}var Vxe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),c=u.getExtent(),f=s.dataToCoord(i),h=a.get("type");if(h&&h!=="none"){var p=jv(a),d=Hxe[h](s,l,f,c);d.style=p,t.graphicKey=d.type,t.pointer=d}var g=a.get(["label","margin"]),m=Gxe(i,n,a,l,g);XU(t,n,a,o,m)},e}(Zv);function Gxe(r,e,t,i,n){var a=e.axis,o=a.dataToCoord(r),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=i.getRadiusAxis().getExtent(),u,c,f;if(a.dim==="radius"){var h=wi();Ca(h,h,s),_n(h,h,[i.cx,i.cy]),u=wn([o,-n],h);var p=e.getModel("axisLabel").get("rotate")||0,d=Cn.innerTextLayout(s,p*Math.PI/180,-1);c=d.textAlign,f=d.textVerticalAlign}else{var g=l[1];u=i.coordToPoint([g+n,o]);var m=i.cx,v=i.cy;c=Math.abs(u[0]-m)/g<.3?"center":u[0]>m?"left":"right",f=Math.abs(u[1]-v)/g<.3?"middle":u[1]>v?"top":"bottom"}return{position:u,align:c,verticalAlign:f}}var Hxe={line:function(r,e,t,i){return r.dim==="angle"?{type:"Line",shape:Kv(e.coordToPoint([i[0],t]),e.coordToPoint([i[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(r,e,t,i){var n=Math.max(1,r.getBandWidth()),a=Math.PI/180;return r.dim==="angle"?{type:"Sector",shape:qU(e.cx,e.cy,i[0],i[1],(-t-n/2)*a,(-t+n/2)*a)}:{type:"Sector",shape:qU(e.cx,e.cy,t-n/2,t+n/2,0,Math.PI*2)}}},PZ=Vxe;var Wxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var i,n=this.ecModel;return n.eachComponent(t,function(a){a.getCoordSysModel()===this&&(i=a)},this),i},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Pt),DZ=Wxe;var KU=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Cr).models[0]},e.type="polarAxis",e}(Pt);wr(KU,Gl);var IZ=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(KU);var NZ=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(KU);var JU=function(r){Z(e,r);function e(t,i){return r.call(this,"radius",t,i)||this}return e.prototype.pointToData=function(t,i){return this.polar.pointToData(t,i)[this.dim==="radius"?0:1]},e}(pn);JU.prototype.dataToRadius=pn.prototype.dataToCoord;JU.prototype.radiusToData=pn.prototype.coordToData;var UZ=JU;var Xxe=vt(),$U=function(r){Z(e,r);function e(t,i){return r.call(this,"angle",t,i||[0,360])||this}return e.prototype.pointToData=function(t,i){return this.polar.pointToData(t,i)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,i=t.getLabelModel(),n=t.scale,a=n.getExtent(),o=n.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=t.dataToCoord(s+1)-t.dataToCoord(s),u=Math.abs(l),c=Ll(s==null?"":s+"",i.getFont(),"center","top"),f=Math.max(c.height,7),h=f/u;isNaN(h)&&(h=1/0);var p=Math.max(0,Math.floor(h)),d=Xxe(t.model),g=d.lastAutoInterval,m=d.lastTickCount;return g!=null&&m!=null&&Math.abs(g-p)<=1&&Math.abs(m-o)<=1&&g>p?p=g:(d.lastTickCount=o,d.lastAutoInterval=p),p},e}(pn);$U.prototype.dataToAngle=pn.prototype.dataToCoord;$U.prototype.angleToData=pn.prototype.coordToData;var OZ=$U;var QU=["radius","angle"],Yxe=function(){function r(e){this.dimensions=QU,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new UZ,this._angleAxis=new OZ,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return r.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},r.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},r.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},r.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},r.prototype.getAxesByScale=function(e){var t=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===e&&t.push(i),n.scale.type===e&&t.push(n),t},r.prototype.getAngleAxis=function(){return this._angleAxis},r.prototype.getRadiusAxis=function(){return this._radiusAxis},r.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},r.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},r.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},r.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},r.prototype.pointToData=function(e,t){var i=this.pointToCoord(e);return[this._radiusAxis.radiusToData(i[0],t),this._angleAxis.angleToData(i[1],t)]},r.prototype.pointToCoord=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=this.getAngleAxis(),a=n.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);n.inverse?o=s-360:s=o+360;var l=Math.sqrt(t*t+i*i);t/=l,i/=l;for(var u=Math.atan2(-i,t)/Math.PI*180,c=us;)u+=c*360;return[l,u]},r.prototype.coordToPoint=function(e){var t=e[0],i=e[1]/180*Math.PI,n=Math.cos(i)*t+this.cx,a=-Math.sin(i)*t+this.cy;return[n,a]},r.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),i=t.getExtent().slice();i[0]>i[1]&&i.reverse();var n=e.getExtent(),a=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:i[0],r:i[1],startAngle:-n[0]*a,endAngle:-n[1]*a,clockwise:e.inverse,contain:function(o,s){var l=o-this.cx,u=s-this.cy,c=l*l+u*u-1e-4,f=this.r,h=this.r0;return c<=f*f&&c>=h*h}}},r.prototype.convertToPixel=function(e,t,i){var n=FZ(t);return n===this?this.dataToPoint(i):null},r.prototype.convertFromPixel=function(e,t,i){var n=FZ(t);return n===this?this.pointToData(i):null},r}();function FZ(r){var e=r.seriesModel,t=r.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}var zZ=Yxe;function qxe(r,e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight();r.cx=Fe(i[0],n),r.cy=Fe(i[1],a);var o=r.getRadiusAxis(),s=Math.min(n,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:pe(l)||(l=[0,l]);var u=[Fe(l[0],s),Fe(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function Zxe(r,e){var t=this,i=t.getAngleAxis(),n=t.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),n.scale.setExtent(1/0,-1/0),r.eachSeries(function(s){if(s.coordinateSystem===t){var l=s.getData();N(_v(l,"radius"),function(u){n.scale.unionExtentFromData(l,u)}),N(_v(l,"angle"),function(u){i.scale.unionExtentFromData(l,u)})}}),Vl(i.scale,i.model),Vl(n.scale,n.model),i.type==="category"&&!i.onBand){var a=i.getExtent(),o=360/i.scale.count();i.inverse?a[1]+=o:a[1]-=o,i.setExtent(a[0],a[1])}}function jxe(r){return r.mainType==="angleAxis"}function BZ(r,e){var t;if(r.type=e.get("type"),r.scale=zf(e),r.onBand=e.get("boundaryGap")&&r.type==="category",r.inverse=e.get("inverse"),jxe(e)){r.inverse=r.inverse!==e.get("clockwise");var i=e.get("startAngle"),n=(t=e.get("endAngle"))!==null&&t!==void 0?t:i+(r.inverse?-360:360);r.setExtent(i,n)}e.axis=r,r.model=e}var Kxe={dimensions:QU,create:function(r,e){var t=[];return r.eachComponent("polar",function(i,n){var a=new zZ(n+"");a.update=Zxe;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=i.findAxisModel("radiusAxis"),u=i.findAxisModel("angleAxis");BZ(o,l),BZ(s,u),qxe(a,i,e),t.push(a),i.coordinateSystem=a,a.model=i}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="polar"){var n=i.getReferringComponents("polar",Cr).models[0];i.coordinateSystem=n.coordinateSystem}}),t}},kZ=Kxe;var Jxe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function KT(r,e,t){e[1]>e[0]&&(e=e.slice().reverse());var i=r.coordToPoint([e[0],t]),n=r.coordToPoint([e[1],t]);return{x1:i[0],y1:i[1],x2:n[0],y2:n[1]}}function JT(r){var e=r.getRadiusAxis();return e.inverse?0:1}function VZ(r){var e=r[0],t=r[r.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&r.pop()}var $xe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,i){if(this.group.removeAll(),!!t.get("show")){var n=t.axis,a=n.polar,o=a.getRadiusAxis().getExtent(),s=n.getTicksCoords(),l=n.getMinorTicksCoords(),u=de(n.getViewLabels(),function(c){c=Qe(c);var f=n.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=n.dataToCoord(h),c});VZ(u),VZ(s),N(Jxe,function(c){t.get([c,"show"])&&(!n.scale.isBlank()||c==="axisLine")&&Qxe[c](this.group,t,a,s,l,o,u)},this)}},e.type="angleAxis",e}(Wa),Qxe={axisLine:function(r,e,t,i,n,a){var o=e.getModel(["axisLine","lineStyle"]),s=t.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=JT(t),f=c?0:1,h,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new Ct[p]({shape:{cx:t.cx,cy:t.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):h=new Pp({shape:{cx:t.cx,cy:t.cy,r:a[c],r0:a[f]},style:o.getLineStyle(),z2:1,silent:!0}),h.style.fill=null,r.add(h)},axisTick:function(r,e,t,i,n,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[JT(t)],u=de(i,function(c){return new Kr({shape:KT(t,[l,l+s],c.coord)})});r.add(Gn(u,{style:Ye(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(r,e,t,i,n,a){if(n.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[JT(t)],c=[],f=0;fv?"left":"right",x=Math.abs(m[1]-_)/g<.3?"middle":m[1]>_?"top":"bottom";if(s&&s[d]){var M=s[d];qe(M)&&M.textStyle&&(p=new Zt(M.textStyle,l,l.ecModel))}var S=new Lt({silent:Cn.isLabelSilent(e),style:fr(p,{x:m[0],y:m[1],fill:p.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:y,verticalAlign:x})});if(r.add(S),c){var w=Cn.makeAxisEventDataBase(e);w.targetType="axisLabel",w.value=f.rawLabel,rt(S).eventData=w}},this)},splitLine:function(r,e,t,i,n,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],f=0;f=0?"p":"n",R=w;M&&(i[c][E]||(i[c][E]={p:w,n:w}),R=i[c][E][I]);var A=void 0,D=void 0,U=void 0,B=void 0;if(d.dim==="radius"){var F=d.dataToCoord(b)-w,k=l.dataToCoord(E);Math.abs(F)=B})}}})}function oSe(r){var e={};N(r,function(i,n){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=XZ(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),f=e[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=f.stacks;e[l]=f;var p=WZ(i);h[p]||f.autoWidthCount++,h[p]=h[p]||{width:0,maxWidth:0};var d=Fe(i.get("barWidth"),c),g=Fe(i.get("barMaxWidth"),c),m=i.get("barGap"),v=i.get("barCategoryGap");d&&!h[p].width&&(d=Math.min(f.remainedWidth,d),h[p].width=d,f.remainedWidth-=d),g&&(h[p].maxWidth=g),m!=null&&(f.gap=m),v!=null&&(f.categoryGap=v)});var t={};return N(e,function(i,n){t[n]={};var a=i.stacks,o=i.bandWidth,s=Fe(i.categoryGap,o),l=Fe(i.gap,1),u=i.remainedWidth,c=i.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),N(a,function(g,m){var v=g.maxWidth;v&&v=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},r.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},r.prototype.dataToPoint=function(e){var t=this.getAxis(),i=this.getRect(),n=[],a=t.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),n[a]=t.toGlobalCoord(t.dataToCoord(+e)),n[1-a]=a===0?i.y+i.height/2:i.x+i.width/2,n},r.prototype.convertToPixel=function(e,t,i){var n=JZ(t);return n===this?this.dataToPoint(i):null},r.prototype.convertFromPixel=function(e,t,i){var n=JZ(t);return n===this?this.pointToData(i):null},r}();function JZ(r){var e=r.seriesModel,t=r.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}var $Z=mSe;function vSe(r,e){var t=[];return r.eachComponent("singleAxis",function(i,n){var a=new $Z(i,r,e);a.name="single_"+n,a.resize(i,e),i.coordinateSystem=a,t.push(a)}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="singleAxis"){var n=i.getReferringComponents("singleAxis",Cr).models[0];i.coordinateSystem=n&&n.coordinateSystem}}),t}var gSe={create:vSe,dimensions:tO},QZ=gSe;var ej=["x","y"],ySe=["width","height"],_Se=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis,l=s.coordinateSystem,u=rO(l,1-QT(s)),c=l.dataToPoint(i)[0],f=a.get("type");if(f&&f!=="none"){var h=jv(a),p=xSe[f](s,c,u);p.style=h,t.graphicKey=p.type,t.pointer=p}var d=Bx(n);XT(i,t,d,n,a,o)},e.prototype.getHandleTransform=function(t,i,n){var a=Bx(i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=Ox(i.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,i,n,a){var o=n.axis,s=o.coordinateSystem,l=QT(o),u=rO(s,l),c=[t.x,t.y];c[l]+=i[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var f=rO(s,1-l),h=(f[1]+f[0])/2,p=[h,h];return p[l]=c[l],{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:p,tooltipOption:{verticalAlign:"middle"}}},e}(Zv),xSe={line:function(r,e,t){var i=Kv([e,t[0]],[e,t[1]],QT(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,e,t){var i=r.getBandWidth(),n=t[1]-t[0];return{type:"Rect",shape:YT([e-i/2,t[0]],[i,n],QT(r))}}};function QT(r){return r.isHorizontal()?0:1}function rO(r,e){var t=r.getRect();return[t[ej[e]],t[ej[e]]+t[ySe[e]]]}var tj=_Se;var SSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(Qt);function iO(r){It(il),Wa.registerAxisPointerClass("SingleAxisPointer",tj),r.registerComponentView(SSe),r.registerComponentView(ZZ),r.registerComponentModel($T),rl(r,"single",$T,$T.defaultOption),r.registerCoordinateSystem("single",QZ)}var MSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i,n){var a=rs(t);r.prototype.init.apply(this,arguments),rj(t,a)},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),rj(this.option,t)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Pt);function rj(r,e){var t=r.cellSize,i;pe(t)?i=t:i=r.cellSize=[t,t],i.length===1&&(i[1]=i[0]);var n=de([0,1],function(a){return S5(e,a)&&(i[a]="auto"),i[a]!=null&&i[a]!=="auto"});za(r,e,{type:"box",ignoreSize:n})}var ij=MSe;var bSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group;a.removeAll();var o=t.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=i.getLocaleModel();this._renderDayRect(t,s,a),this._renderLines(t,s,l,a),this._renderYearText(t,s,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,s,l,a)},e.prototype._renderDayRect=function(t,i,n){for(var a=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=i.start.time;u<=i.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToRect([u],!1).tl,f=new Tt({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});n.add(f)}},e.prototype._renderLines=function(t,i,n,a){var o=this,s=t.coordinateSystem,l=t.getModel(["splitLine","lineStyle"]).getLineStyle(),u=t.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var f=i.start,h=0;f.time<=i.end.time;h++){d(f.formatedDate),h===0&&(f=s.getDateInfo(i.start.y+"-"+i.start.m));var p=f.date;p.setMonth(p.getMonth()+1),f=s.getDateInfo(p)}d(s.getNextNDay(i.end.time,1).formatedDate);function d(g){o._firstDayOfMonth.push(s.getDateInfo(g)),o._firstDayPoints.push(s.dataToRect([g],!1).tl);var m=o._getLinePointsOfOneWeek(t,g,n);o._tlpoints.push(m[0]),o._blpoints.push(m[m.length-1]),u&&o._drawSplitline(m,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,n),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,n),l,a)},e.prototype._getEdgesPoints=function(t,i,n){var a=[t[0].slice(),t[t.length-1].slice()],o=n==="horizontal"?0:1;return a[0][o]=a[0][o]-i/2,a[1][o]=a[1][o]+i/2,a},e.prototype._drawSplitline=function(t,i,n){var a=new $r({z2:20,shape:{points:t},style:i});n.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,i,n){for(var a=t.coordinateSystem,o=a.getDateInfo(i),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToRect([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[n==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(t,i){return Ce(t)&&t?y5(t,i):He(t)?t(i):i.nameMap},e.prototype._yearTextPositionControl=function(t,i,n,a,o){var s=i[0],l=i[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,i,n,a){var o=t.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=n!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,f=(u[0][1]+u[1][1])/2,h=n==="horizontal"?0:1,p={top:[c,u[h][1]],bottom:[c,u[1-h][1]],left:[u[1-h][0],f],right:[u[h][0],f]},d=i.start.y;+i.end.y>+i.start.y&&(d=d+"-"+i.end.y);var g=o.get("formatter"),m={start:i.start.y,end:i.end.y,nameMap:d},v=this._formatterLabel(g,m),_=new Lt({z2:30,style:fr(o,{text:v})});_.attr(this._yearTextPositionControl(_,p[l],n,l,s)),a.add(_)}},e.prototype._monthTextPositionControl=function(t,i,n,a,o){var s="left",l="top",u=t[0],c=t[1];return n==="horizontal"?(c=c+o,i&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,i&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(t,i,n,a){var o=t.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),f=[this._tlpoints,this._blpoints];(!s||Ce(s))&&(s&&(i=b_(s)||i),s=i.get(["time","monthAbbr"])||[]);var h=u==="start"?0:1,p=n==="horizontal"?0:1;l=u==="start"?-l:l;for(var d=c==="center",g=0;g=n.start.time&&i.times.end.time&&t.reverse(),t},r.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],i;t[0].time>t[1].time&&(i=!0,t.reverse());var n=Math.floor(t[1].time/nO)-Math.floor(t[0].time/nO)+1,a=new Date(t[0].time),o=a.getDate(),s=t[1].date.getDate();a.setDate(o+n-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-t[1].time)*u>0;)n-=u,a.setDate(l-u);var c=Math.floor((n+t[0].day+6)/7),f=i?-c+1:c-1;return i&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:n,weeks:c,nthWeek:f,fweek:t[0].day,lweek:t[1].day}},r.prototype._getDateByWeeksAndDay=function(e,t,i){var n=this._getRangeInfo(i);if(e>n.weeks||e===0&&tn.lweek)return null;var a=(e-1)*7-n.fweek+t,o=new Date(n.start.time);return o.setDate(+n.start.d+a),this.getDateInfo(o)},r.create=function(e,t){var i=[];return e.eachComponent("calendar",function(n){var a=new r(n,e,t);i.push(a),n.coordinateSystem=a}),e.eachSeries(function(n){n.get("coordinateSystem")==="calendar"&&(n.coordinateSystem=i[n.get("calendarIndex")||0])}),i},r.dimensions=["time","value"],r}();function aj(r){var e=r.calendarModel,t=r.seriesModel,i=e?e.coordinateSystem:t?t.coordinateSystem:null;return i}var oj=wSe;function aO(r){r.registerComponentModel(ij),r.registerComponentView(nj),r.registerCoordinateSystem("calendar",oj)}function TSe(r,e){var t=r.existing;if(e.id=r.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var i=e.parentOption;i?e.parentId=i.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function sj(r,e){var t;return N(e,function(i){r[i]!=null&&r[i]!=="auto"&&(t=!0)}),t}function ESe(r,e,t){var i=fe({},t),n=r[e],a=t.$action||"merge";if(a==="merge")if(n){if(0)var o;_t(n,i,!0),za(n,i,{ignoreSize:!0}),aD(t,n),eE(t,n),eE(t,n,"shape"),eE(t,n,"style"),eE(t,n,"extra"),t.clipPath=n.clipPath}else r[e]=i;else a==="replace"?r[e]=i:a==="remove"&&n&&(r[e]=null)}var lj=["transition","enterFrom","leaveTo"],ASe=lj.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function eE(r,e,t){if(t&&(!r[t]&&e[t]&&(r[t]={}),r=r[t],e=e[t]),!(!r||!e))for(var i=t?lj:ASe,n=0;n=0;c--){var f=n[c],h=Yr(f.id,null),p=h!=null?o.get(h):null;if(p){var d=p.parent,v=ps(d),_=d===a?{width:s,height:l}:{width:v.width,height:v.height},y={},x=Ef(p,f,_,null,{hv:f.hv,boundingMode:f.bounding},y);if(!ps(p).isNew&&x){for(var M=f.transition,S={},w=0;w=0)?S[T]=C:p[T]=C}Dt(p,S,t,0)}else p.attr(y)}}},e.prototype._clear=function(){var t=this,i=this._elMap;i.each(function(n){tE(n,ps(n).option,i,t._lastGraphicModel)}),this._elMap=ke()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Qt);function oO(r){var e=tt(cj,r)?cj[r]:x_(r),t=new e({});return ps(t).type=r,t}function fj(r,e,t,i){var n=oO(t);return e.add(n),i.set(r,n),ps(n).id=r,ps(n).isNew=!0,n}function tE(r,e,t,i){var n=r&&r.parent;n&&(r.type==="group"&&r.traverse(function(a){tE(a,e,t,i)}),Yv(r,e,i),t.removeKey(ps(r).id))}function hj(r,e,t,i){r.isGroup||N([["cursor",gi.prototype.cursor],["zlevel",i||0],["z",t||0],["z2",0]],function(n){var a=n[0];tt(e,a)?r[a]=ft(e[a],n[1]):r[a]==null&&(r[a]=n[1])}),N(bt(e),function(n){if(n.indexOf("on")===0){var a=e[n];r[n]=He(a)?a:null}}),tt(e,"draggable")&&(r.draggable=e.draggable),e.name!=null&&(r.name=e.name),e.id!=null&&(r.id=e.id)}function RSe(r){return r=fe({},r),N(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(iD),function(e){delete r[e]}),r}function LSe(r,e,t){var i=rt(r).eventData;!r.silent&&!r.ignore&&!i&&(i=rt(r).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:r.name}),i&&(i.info=t.info)}function sO(r){r.registerComponentModel(uj),r.registerComponentView(pj),r.registerPreprocessor(function(e){var t=e.graphic;pe(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var lO=["x","y","radius","angle","single"],PSe=["cartesian2d","polar","singleAxis"];function dj(r){var e=r.get("coordinateSystem");return dt(PSe,e)>=0}function ds(r){return r+"Axis"}function mj(r,e){var t=ke(),i=[],n=ke();r.eachComponent({mainType:"dataZoom",query:e},function(c){n.get(c.uid)||s(c)});var a;do a=!1,r.eachComponent("dataZoom",o);while(a);function o(c){!n.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){n.set(c.uid,!0),i.push(c),u(c)}function l(c){var f=!1;return c.eachTargetAxis(function(h,p){var d=t.get(h);d&&d[p]&&(f=!0)}),f}function u(c){c.eachTargetAxis(function(f,h){(t.get(f)||t.set(f,[]))[h]=!0})}return i}function rE(r){var e=r.ecModel,t={infoList:[],infoMap:ke()};return r.eachTargetAxis(function(i,n){var a=e.getComponent(ds(i),n);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=t.infoMap.get(s);l||(l={model:o,axisModels:[]},t.infoList.push(l),t.infoMap.set(s,l)),l.axisModels.push(a)}}}),t}var uO=function(){function r(){this.indexList=[],this.indexMap=[]}return r.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},r}(),DSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,i,n){var a=vj(t);this.settledOption=a,this.mergeDefaultAndTheme(t,n),this._doInit(a)},e.prototype.mergeOption=function(t){var i=vj(t);_t(this.option,t,!0),_t(this.settledOption,i,!0),this._doInit(i)},e.prototype._doInit=function(t){var i=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;N([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(i[a[0]]=n[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),i=this._targetAxisInfoMap=ke(),n=this._fillSpecifiedTargetAxis(i);n?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var i=!1;return N(lO,function(n){var a=this.getReferringComponents(ds(n),cH);if(a.specified){i=!0;var o=new uO;N(a.models,function(s){o.add(s.componentIndex)}),t.set(n,o)}},this),i},e.prototype._fillAutoTargetAxisByOrient=function(t,i){var n=this.ecModel,a=!0;if(a){var o=i==="vertical"?"y":"x",s=n.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=n.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===i}});l(s,"single")}function l(u,c){var f=u[0];if(f){var h=new uO;if(h.add(f.componentIndex),t.set(c,h),a=!1,c==="x"||c==="y"){var p=f.getReferringComponents("grid",Cr).models[0];p&&N(u,function(d){f.componentIndex!==d.componentIndex&&p===d.getReferringComponents("grid",Cr).models[0]&&h.add(d.componentIndex)})}}}a&&N(lO,function(u){if(a){var c=n.findComponents({mainType:ds(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new uO;f.add(c[0].componentIndex),t.set(u,f),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(i){!t&&(t=i)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var i=this._rangePropMode,n=this.get("rangeMode");N([["start","startValue"],["end","endValue"]],function(a,o){var s=t[a[0]]!=null,l=t[a[1]]!=null;s&&!l?i[o]="percent":!s&&l?i[o]="value":n?i[o]=n[o]:s&&(i[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(i,n){t==null&&(t=this.ecModel.getComponent(ds(i),n))},this),t},e.prototype.eachTargetAxis=function(t,i){this._targetAxisInfoMap.each(function(n,a){N(n.indexList,function(o){t.call(i,a,o)})})},e.prototype.getAxisProxy=function(t,i){var n=this.getAxisModel(t,i);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,i){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[i])return this.ecModel.getComponent(ds(t),i)},e.prototype.setRawRange=function(t){var i=this.option,n=this.settledOption;N([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(i[a[0]]=n[a[0]]=t[a[0]],i[a[1]]=n[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var i=this.option;N(["start","startValue","end","endValue"],function(n){i[n]=t[n]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,i){if(t==null&&i==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(t,i).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var i,n=this._targetAxisInfoMap.keys(),a=0;ao[1];if(y&&!x&&!M)return!0;y&&(m=!0),x&&(d=!0),M&&(g=!0)}return m&&d&&g})}else $v(c,function(p){if(a==="empty")l.setData(u=u.map(p,function(g){return s(g)?g:NaN}));else{var d={};d[p]=o,u.selectRange(d)}});$v(c,function(p){u.setApproximateExtent(o,p)})}});function s(l){return l>=o[0]&&l<=o[1]}},r.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,i=this._dataExtent;$v(["min","max"],function(n){var a=t.get(n+"Span"),o=t.get(n+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=rr(i[0]+o,i,[0,100],!0):a!=null&&(o=rr(a,[0,100],i,!0)-i[0]),e[n+"Span"]=a,e[n+"ValueSpan"]=o},this)},r.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,i=this._valueWindow;if(t){var n=Fm(i,[0,500]);n=Math.min(n,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+i[0].toFixed(n)),t[1]!==100&&a.setDeterminedMinMax("max",+i[1].toFixed(n)),a.freeze()}},r}();function FSe(r,e,t){var i=[1/0,-1/0];$v(t,function(o){u8(i,o.getData(),e)});var n=r.getAxisModel(),a=C1(n.axis.scale,n,i).calculate();return[a.min,a.max]}var xj=OSe;var zSe={getTargetSeries:function(r){function e(n){r.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=r.getComponent(ds(o),s);n(o,s,l,a)})})}e(function(n,a,o,s){o.__dzAxisProxy=null});var t=[];e(function(n,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new xj(n,a,s,r),t.push(o.__dzAxisProxy))});var i=ke();return N(t,function(n){N(n.getTargetSeriesModels(),function(a){i.set(a.uid,a)})}),i},overallReset:function(r,e){r.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(i,n){t.getAxisProxy(i,n).reset(t)}),t.eachTargetAxis(function(i,n){t.getAxisProxy(i,n).filterData(t,e)})}),r.eachComponent("dataZoom",function(t){var i=t.findRepresentativeAxisProxy();if(i){var n=i.getDataPercentWindow(),a=i.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:a[0],endValue:a[1]})}})}},Sj=zSe;function cO(r){r.registerAction("dataZoom",function(e,t){var i=mj(t,e);N(i,function(n){n.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var Mj=!1;function fd(r){Mj||(Mj=!0,r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,Sj),cO(r),r.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function bj(r){r.registerComponentModel(gj),r.registerComponentView(yj),fd(r)}var $i=function(){function r(){}return r}();var wj={};function Qf(r,e){wj[r]=e}function iE(r){return wj[r]}var kSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){r.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;N(this.option.feature,function(i,n){var a=iE(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),_t(i,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Pt),Tj=kSe;function Ej(r,e,t){var i=e.getBoxLayoutParams(),n=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},o=xr(i,a,n);Ws(e.get("orient"),r,e.get("itemGap"),o.width,o.height),Ef(r,i,a,n)}function nE(r,e){var t=Gs(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),r=new Tt({shape:{x:r.x-t[3],y:r.y-t[0],width:r.width+t[1]+t[3],height:r.height+t[0]+t[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1}),r}var GSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n,a){var o=this.group;if(o.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},c=this._features||(this._features={}),f=[];N(u,function(d,g){f.push(g)}),new An(this._featureNames||[],f).add(h).update(h).remove(ot(h,null)).execute(),this._featureNames=f;function h(d,g){var m=f[d],v=f[g],_=u[m],y=new Zt(_,t,t.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===m&&(_.title=a.newTitle),m&&!v){if(HSe(m))x={onclick:y.option.onclick,featureName:m};else{var M=iE(m);if(!M)return;x=new M}c[m]=x}else if(x=c[v],!x)return;x.uid=ts("toolbox-feature"),x.model=y,x.ecModel=i,x.api=n;var S=x instanceof $i;if(!m&&v){S&&x.dispose&&x.dispose(i,n);return}if(!y.get("show")||S&&x.unusable){S&&x.remove&&x.remove(i,n);return}p(y,x,m),y.setIconStatus=function(w,T){var C=this.option,b=this.iconPaths;C.iconStatus=C.iconStatus||{},C.iconStatus[w]=T,b[w]&&(T==="emphasis"?Bn:kn)(b[w])},x instanceof $i&&x.render&&x.render(y,i,n,a)}function p(d,g,m){var v=d.getModel("iconStyle"),_=d.getModel(["emphasis","iconStyle"]),y=g instanceof $i&&g.getIcons?g.getIcons():d.get("icon"),x=d.get("title")||{},M,S;Ce(y)?(M={},M[m]=y):M=y,Ce(x)?(S={},S[m]=x):S=x;var w=d.iconPaths={};N(M,function(T,C){var b=Pu(T,{},{x:-s/2,y:-s/2,width:s,height:s});b.setStyle(v.getItemStyle());var E=b.ensureState("emphasis");E.style=_.getItemStyle();var I=new Lt({style:{text:S[C],align:_.get("textAlign"),borderRadius:_.get("textBorderRadius"),padding:_.get("textPadding"),fill:null,font:iv({fontStyle:_.get("textFontStyle"),fontFamily:_.get("textFontFamily"),fontSize:_.get("textFontSize"),fontWeight:_.get("textFontWeight")},i)},ignore:!0});b.setTextContent(I),Vs({el:b,componentModel:t,itemName:C,formatterParamsExtra:{title:S[C]}}),b.__title=S[C],b.on("mouseover",function(){var R=_.getItemStyle(),A=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";I.setStyle({fill:_.get("textFill")||R.fill||R.stroke||"#000",backgroundColor:_.get("textBackgroundColor")}),b.setTextConfig({position:_.get("textPosition")||A}),I.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){d.get(["iconStatus",C])!=="emphasis"&&n.leaveEmphasis(this),I.hide()}),(d.get(["iconStatus",C])==="emphasis"?Bn:kn)(b),o.add(b),b.on("click",Be(g.onclick,g,i,n,C)),w[C]=b})}Ej(o,t,n),o.add(nE(o.getBoundingRect(),t)),l||o.eachChild(function(d){var g=d.__title,m=d.ensureState("emphasis"),v=m.textConfig||(m.textConfig={}),_=d.getTextContent(),y=_&&_.ensureState("emphasis");if(y&&!He(y)&&g){var x=y.style||(y.style={}),M=Ll(g,Lt.makeFont(x)),S=d.x+o.x,w=d.y+o.y+s,T=!1;w+M.height>n.getHeight()&&(v.position="top",T=!0);var C=T?-5-M.height:s+10;S+M.width/2>n.getWidth()?(v.position=["100%",C],x.align="right"):S-M.width/2<0&&(v.position=[0,C],x.align="left")}})},e.prototype.updateView=function(t,i,n,a){N(this._features,function(o){o instanceof $i&&o.updateView&&o.updateView(o.model,i,n,a)})},e.prototype.remove=function(t,i){N(this._features,function(n){n instanceof $i&&n.remove&&n.remove(t,i)}),this.group.removeAll()},e.prototype.dispose=function(t,i){N(this._features,function(n){n instanceof $i&&n.dispose&&n.dispose(t,i)})},e.type="toolbox",e}(Qt);function HSe(r){return r.indexOf("my")===0}var Aj=GSe;var WSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){var n=this.model,a=n.get("name")||t.get("title.0.text")||"echarts",o=i.getZr().painter.getType()==="svg",s=o?"svg":n.get("type",!0)||"png",l=i.getConnectedDataURL({type:s,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),u=Ft.browser;if(He(MouseEvent)&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(f)}else if(window.navigator.msSaveOrOpenBlob||o){var h=l.split(","),p=h[0].indexOf("base64")>-1,d=o?decodeURIComponent(h[1]):h[1];p&&(d=window.atob(d));var g=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var m=d.length,v=new Uint8Array(m);m--;)v[m]=d.charCodeAt(m);var _=new Blob([v]);window.navigator.msSaveOrOpenBlob(_,g)}else{var y=document.createElement("iframe");document.body.appendChild(y);var x=y.contentWindow,M=x.document;M.open("image/svg+xml","replace"),M.write(d),M.close(),x.focus(),M.execCommand("SaveAs",!0,g),document.body.removeChild(y)}}else{var S=n.get("lang"),w='',T=window.open();T.document.write(w),T.document.title=a}},e.getDefaultOption=function(t){var i={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return i},e}($i),Cj=WSe;var Rj="__ec_magicType_stack__";var XSe=[["line","bar"],["stack"]],YSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,i=t.get("icon"),n={};return N(t.get("type"),function(a){i[a]&&(n[a]=i[a])}),n},e.getDefaultOption=function(t){var i={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return i},e.prototype.onclick=function(t,i,n){var a=this.model,o=a.get(["seriesIndex",n]);if(Lj[n]){var s={series:[]},l=function(f){var h=f.subType,p=f.id,d=Lj[n](h,p,f,a);d&&(Ye(d,f.option),s.series.push(d));var g=f.coordinateSystem;if(g&&g.type==="cartesian2d"&&(n==="line"||n==="bar")){var m=g.getAxesByScale("ordinal")[0];if(m){var v=m.dim,_=v+"Axis",y=f.getReferringComponents(_,Cr).models[0],x=y.componentIndex;s[_]=s[_]||[];for(var M=0;M<=x;M++)s[_][x]=s[_][x]||{};s[_][x].boundaryGap=n==="bar"}}};N(XSe,function(f){dt(f,n)>=0&&N(f,function(h){a.setIconStatus(h,"normal")})}),a.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=n;n==="stack"&&(u=_t({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",n])!=="emphasis"&&(c="tiled")),i.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},e}($i),Lj={line:function(r,e,t,i){if(r==="bar")return _t({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(r,e,t,i){if(r==="line")return _t({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(r,e,t,i){var n=t.get("stack")===Rj;if(r==="line"||r==="bar")return i.setIconStatus("stack",n?"normal":"emphasis"),_t({id:e,stack:n?"":Rj},i.get(["option","stack"])||{},!0)}};ua({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(r,e){e.mergeOption(r.newOption)});var Pj=YSe;var oE=new Array(60).join("-"),Qv=" ";function qSe(r){var e={},t=[],i=[];return r.eachRawSeries(function(n){var a=n.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(n)}else t.push(n)}else t.push(n)}),{seriesGroupByCategoryAxis:e,other:t,meta:i}}function ZSe(r){var e=[];return N(r,function(t,i){var n=t.categoryAxis,a=t.valueAxis,o=a.dim,s=[" "].concat(de(t.series,function(p){return p.name})),l=[n.model.getCategories()];N(t.series,function(p){var d=p.getRawData();l.push(p.getRawData().mapArray(d.mapDimension(o),function(g){return g}))});for(var u=[s.join(Qv)],c=0;c1||t>0&&!r.noHeader;return N(r.blocks,function(n){var a=fW(n);a>=e&&(e=a+ +(i&&(!a||ED(n)&&!n.noHeader)))}),e}return 0}function jfe(r,e,t,i){var n=e.noHeader,a=Jfe(fW(e)),o=[],s=e.blocks||[];kr(!s||pe(s)),s=s||[];var l=r.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(tt(u,l)){var c=new Hw(u[l],null);s.sort(function(d,g){return c.evaluate(d.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}N(s,function(d,g){var m=e.valueFormatter,v=cW(d)(m?fe(fe({},r),{valueFormatter:m}):r,d,g>0?a.html:0,i);v!=null&&o.push(v)});var f=r.renderMode==="richText"?o.join(a.richText):AD(o.join(""),n?t:a.html);if(n)return f;var h=Cw(e.header,"ordinal",r.useUTC),p=uW(i,r.renderMode).nameStyle;return r.renderMode==="richText"?hW(r,h,p)+a.richText+f:AD('
'+yn(h)+"
"+f,t)}function Kfe(r,e,t,i){var n=r.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=r.useUTC,c=e.valueFormatter||r.valueFormatter||function(x){return x=pe(x)?x:[x],de(x,function(M,S){return Cw(M,pe(p)?p[S]:p,u)})};if(!(a&&o)){var f=s?"":r.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",n),h=a?"":Cw(l,"ordinal",u),p=e.valueType,d=o?[]:c(e.value,e.dataIndex),g=!s||!a,m=!s&&a,v=uW(i,n),_=v.nameStyle,y=v.valueStyle;return n==="richText"?(s?"":f)+(a?"":hW(r,h,_))+(o?"":ehe(r,d,g,m,y)):AD((s?"":f)+(a?"":$fe(h,!s,_))+(o?"":Qfe(d,g,m,y)),t)}}function CD(r,e,t,i,n,a){if(r){var o=cW(r),s={useUTC:n,renderMode:t,orderMode:i,markupStyleCreator:e,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function Jfe(r){return{html:qfe[r],richText:Zfe[r]}}function AD(r,e){var t='
',i="margin: "+e+"px 0 0";return'
'+r+t+"
"}function $fe(r,e,t){var i=e?"margin-left:2px":"";return''+yn(r)+""}function Qfe(r,e,t,i){var n=t?"10px":"20px",a=e?"float:right;margin-left:"+n:"";return r=pe(r)?r:[r],''+de(r,function(o){return yn(o)}).join("  ")+""}function hW(r,e,t){return r.markupStyleCreator.wrapRichTextStyle(e,t)}function ehe(r,e,t,i,n){var a=[n],o=i?10:20;return t&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(pe(e)?e.join(" "):e,a)}function qw(r,e){var t=r.getData().getItemVisual(e,"style"),i=t[r.visualDrawType];return Ws(i)}function Zw(r,e){var t=r.get("padding");return t??(e==="richText"?[8,10]:10)}var jw=function(){function r(){this.richTextStyles={},this._nextStyleNameId=Hb()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(e,t,i){var n=i==="richText"?this._generateStyleName():null,a=_5({color:t,type:e,renderMode:i,markerId:n});return Ce(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(e,t){var i={};pe(t)?N(t,function(a){return fe(i,a)}):fe(i,t);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+e+"}"},r}();function Kw(r){var e=r.series,t=r.dataIndex,i=r.multipleSeries,n=e.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(t),l=pe(s),u=qw(e,t),c,f,h,p;if(o>1||l&&!o){var d=the(s,e,t,a,u);c=d.inlineValues,f=d.inlineValueTypes,h=d.blocks,p=d.inlineValues[0]}else if(o){var g=n.getDimensionInfo(a[0]);p=c=Ou(n,t,a[0]),f=g.type}else p=c=l?s[0]:s;var m=Wm(e),v=m&&e.name||"",_=n.getName(t),y=i?v:_;return Or("section",{header:v,noHeader:i||!m,sortParam:p,blocks:[Or("nameValue",{markerType:"item",markerColor:u,name:y,noName:!Yi(y),value:c,valueType:f,dataIndex:t})].concat(h||[])})}function the(r,e,t,i,n){var a=e.getData(),o=gn(r,function(f,h,p){var d=a.getDimensionInfo(p);return f=f||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];i.length?N(i,function(f){c(Ou(a,t,f),f)}):N(r,c);function c(f,h){var p=a.getDimensionInfo(h);!p||p.otherDims.tooltip===!1||(o?u.push(Or("nameValue",{markerType:"subItem",markerColor:n,name:p.displayName,value:f,valueType:p.type})):(s.push(f),l.push(p.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Pf=vt();function Jw(r,e){return r.getName(e)||r.getId(e)}var k_="__universalTransitionEnabled",$w=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Lf({count:ihe,reset:nhe}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n);var a=Pf(this).sourceManager=new Yw(this);a.prepareSource();var o=this.getInitialData(t,n);dW(o,this),this.dataTask.context.data=o,Pf(this).dataBeforeProcessed=o,pW(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(t,i){var n=Rf(this),a=n?is(t):{},o=this.subType;Pt.hasClass(o)&&(o+="Series"),_t(t,i.getTheme().get(this.subType)),_t(t,this.getDefaultOption()),yo(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Va(t,a,n)},e.prototype.mergeOption=function(t,i){t=_t(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Rf(this);n&&Va(this.option,t,n);var a=Pf(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(t,i);dW(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Pf(this).dataBeforeProcessed=o,pW(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){if(t&&!bi(t))for(var i=["show"],n=0;nthis.getShallow("animationThreshold")&&(i=!1),!!i},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,i,n){var a=this.ecModel,o=P_.prototype.getColorFromPalette.call(this,t,i,n);return o||(o=a.getColorFromPalette(t,i,n)),o},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,i){this._innerSelect(this.getData(i),t)},e.prototype.unselect=function(t,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&n.push(o)}return n},e.prototype.isSelected=function(t,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[Jw(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[k_])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){qe(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(t,i)}},e.registerClass=function(t){return Pt.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Pt);br($w,dv);br($w,P_);Yb($w,Pt);function pW(r){var e=r.name;Wm(r)||(r.name=rhe(r)||e)}function rhe(r){var e=r.getRawData(),t=e.mapDimensionsAll("seriesName"),i=[];return N(t,function(n){var a=e.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function ihe(r){return r.model.getRawData().count()}function nhe(r){var e=r.model;return e.setData(e.getRawData().cloneShallow()),ahe}function ahe(r,e){e.outputData&&r.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function dW(r,e){N(rp(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(t){r.wrapMethod(t,ot(ohe,e))})}function ohe(r,e){var t=RD(r);return t&&t.setOutputEnd((e||this).count()),e}function RD(r){var e=(r.ecModel||{}).scheduler,t=e&&e.getPipeline(r.uid);if(t){var i=t.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(r.uid))}return i}}var jt=$w;var LD=function(){function r(){this.group=new Ze,this.uid=rs("viewComponent")}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,i,n){},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,i,n){},r.prototype.updateLayout=function(e,t,i,n){},r.prototype.updateVisual=function(e,t,i,n){},r.prototype.toggleBlurSeries=function(e,t,i){},r.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},r}();Xm(LD);xf(LD);var er=LD;function Mo(){var r=vt();return function(e){var t=r(e),i=e.pipelineContext,n=!!t.large,a=!!t.progressiveRender,o=t.large=!!(i&&i.large),s=t.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var gW=vt(),she=Mo(),PD=function(){function r(){this.group=new Ze,this.uid=rs("viewChart"),this.renderTask=Lf({plan:lhe,reset:uhe}),this.renderTask.context={view:this}}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,i,n){},r.prototype.highlight=function(e,t,i,n){var a=e.getData(n&&n.dataType);a&&vW(a,n,"emphasis")},r.prototype.downplay=function(e,t,i,n){var a=e.getData(n&&n.dataType);a&&vW(a,n,"normal")},r.prototype.remove=function(e,t){this.group.removeAll()},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.updateLayout=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.updateVisual=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.eachRendered=function(e){ca(this.group,e)},r.markUpdateMethod=function(e,t){gW(e).updateMethod=t},r.protoInitialize=function(){var e=r.prototype;e.type="chart"}(),r}();function mW(r,e,t){r&&Af(r)&&(e==="emphasis"?Bn:kn)(r,t)}function vW(r,e,t){var i=$o(r,e),n=e&&e.highlightKey!=null?g4(e.highlightKey):null;i!=null?N($t(i),function(a){mW(r.getItemGraphicEl(a),t,n)}):r.eachItemGraphicEl(function(a){mW(a,t,n)})}Xm(PD,["dispose"]);xf(PD);function lhe(r){return she(r.model)}function uhe(r){var e=r.model,t=r.ecModel,i=r.api,n=r.payload,a=e.pipelineContext.progressiveRender,o=r.view,s=n&&gW(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,t,i,n),che[l]}var che={incrementalPrepareRender:{progress:function(r,e){e.view.incrementalRender(r,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(r,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Yt=PD;var Qw="\0__throttleOriginMethod",yW="\0__throttleRate",_W="\0__throttleType";function V_(r,e,t){var i,n=0,a=0,o=null,s,l,u,c;e=e||0;function f(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var h=function(){for(var p=[],d=0;d=0?f():o=setTimeout(f,-s),n=i};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(p){c=p},h}function os(r,e,t,i){var n=r[e];if(n){var a=n[Qw]||n,o=n[_W],s=n[yW];if(s!==t||o!==i){if(t==null||!i)return r[e]=a;n=r[e]=V_(a,t,i==="debounce"),n[Qw]=a,n[_W]=i,n[yW]=t}return n}}function zu(r,e){var t=r[e];t&&t[Qw]&&(t.clear&&t.clear(),r[e]=t[Qw])}var xW=vt(),SW={itemStyle:za(GP,!0),lineStyle:za(VP,!0)},fhe={lineStyle:"stroke",itemStyle:"fill"};function MW(r,e){var t=r.visualStyleMapper||SW[e];return t||(console.warn("Unknown style type '"+e+"'."),SW.itemStyle)}function bW(r,e){var t=r.visualDrawType||fhe[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var wW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=r.getModel(i),a=MW(r,i),o=a(n),s=n.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=bW(r,i),u=o[l],c=He(u)?u:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||f){var h=r.getColorFromPalette(r.name,null,e.getSeriesCount());o[l]||(o[l]=h,t.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||He(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||He(o.stroke)?h:o.stroke}if(t.setVisual("style",o),t.setVisual("drawType",l),!e.isSeriesFiltered(r)&&c)return t.setVisual("colorFromPalette",!1),{dataEach:function(p,d){var g=r.getDataParams(d),m=fe({},o);m[l]=c(g),p.setItemVisual(d,"style",m)}}}},G_=new Zt,TW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){if(!(r.ignoreStyleOnData||e.isSeriesFiltered(r))){var t=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=MW(r,i),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){G_.option=l[i];var u=n(G_),c=o.ensureUniqueItemVisual(s,"style");fe(c,u),G_.option.decal&&(o.setItemVisual(s,"decal",G_.option.decal),G_.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},EW={performRawSeries:!0,overallReset:function(r){var e=ke();r.eachSeries(function(t){var i=t.getColorBy();if(!t.isColorBySeries()){var n=t.type+"-"+i,a=e.get(n);a||(a={},e.set(n,a)),xW(t).scope=a}}),r.eachSeries(function(t){if(!(t.isColorBySeries()||r.isSeriesFiltered(t))){var i=t.getRawData(),n={},a=t.getData(),o=xW(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=bW(t,s);a.each(function(u){var c=a.getRawIndex(u);n[c]=u}),i.each(function(u){var c=n[u],f=a.getItemVisual(c,"colorFromPalette");if(f){var h=a.ensureUniqueItemVisual(c,"style"),p=i.getName(u)||u+"",d=i.count();h[l]=t.getColorFromPalette(p,o,d)}})}})}};var t1=Math.PI;function DD(r,e){e=e||{},Ye(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var t=new Ze,i=new Et({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(i);var n=new Lt({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Et({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var o;return e.showSpinner&&(o=new x_({shape:{startAngle:-t1/2,endAngle:-t1/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:t1*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:t1*3/2}).delay(300).start("circularInOut"),t.add(o)),t.resize=function(){var s=n.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(r.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),c=r.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},t.resize(),t}var hhe=function(){function r(e,t,i,n){this._stageTaskMap=ke(),this.ecInstance=e,this.api=t,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return r.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},r.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,a=!t&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},r.prototype.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),n=e.getData(),a=n.count(),o=i.progressiveEnabled&&t.incrementalPrepareRender&&a>=i.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(e){var t=this,i=t._pipelineMap=ke();e.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),t._pipe(n,n.dataTask)})},r.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),i=this.api;N(this._allHandlers,function(n){var a=e.get(n.uid)||e.set(n.uid,{}),o="";kr(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,t,i),n.overallReset&&this._createOverallStageTask(n,a,t,i)},this)},r.prototype.prepareView=function(e,t,i,n){var a=e.renderTask,o=a.context;o.model=t,o.ecModel=i,o.api=n,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},r.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},r.prototype.performVisualTasks=function(e,t,i){this._performStageTasks(this._visualHandlers,e,t,i)},r.prototype._performStageTasks=function(e,t,i,n){n=n||{};var a=!1,o=this;N(e,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),f=c.seriesTaskMap,h=c.overallTask;if(h){var p,d=h.agentStubMap;d.each(function(m){s(n,m)&&(m.dirty(),p=!0)}),p&&h.dirty(),o.updatePayload(h,i);var g=o.getPerformArgs(h,n.block);d.each(function(m){m.perform(g)}),h.perform(g)&&(a=!0)}else f&&f.each(function(m,v){s(n,m)&&m.dirty();var _=o.getPerformArgs(m,n.block);_.skip=!l.performRawSeries&&t.isSeriesFiltered(m.context.model),o.updatePayload(m,i),m.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(i){t=i.dataTask.perform()||t}),this.unfinished=t||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},r.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},r.prototype._createSeriesStageTask=function(e,t,i,n){var a=this,o=t.seriesTaskMap,s=t.seriesTaskMap=ke(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?i.eachRawSeries(c):l?i.eachRawSeriesByType(l,c):u&&u(i,n).each(c);function c(f){var h=f.uid,p=s.set(h,o&&o.get(h)||Lf({plan:ghe,reset:yhe,count:xhe}));p.context={model:f,ecModel:i,api:n,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(f,p)}},r.prototype._createOverallStageTask=function(e,t,i,n){var a=this,o=t.overallTask=t.overallTask||Lf({reset:phe});o.context={ecModel:i,api:n,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=ke(),u=e.seriesType,c=e.getTargetSeries,f=!0,h=!1,p="";kr(!e.createOnAllSeries,p),u?i.eachRawSeriesByType(u,d):c?c(i,n).each(d):(f=!1,N(i.getSeries(),d));function d(g){var m=g.uid,v=l.set(m,s&&s.get(m)||(h=!0,Lf({reset:dhe,onDirty:vhe})));v.context={model:g,overallProgress:f},v.agent=o,v.__block=f,a._pipe(g,v)}h&&o.dirty()},r.prototype._pipe=function(e,t){var i=e.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=t),n.tail&&n.tail.pipe(t),n.tail=t,t.__idxInPipeline=n.count++,t.__pipeline=n},r.wrapStageHandler=function(e,t){return He(e)&&(e={overallReset:e,seriesType:She(e)}),e.uid=rs("stageHandler"),t&&(e.visualType=t),e},r}();function phe(r){r.overallReset(r.ecModel,r.api,r.payload)}function dhe(r){return r.overallProgress&&mhe}function mhe(){this.agent.dirty(),this.getDownstream().dirty()}function vhe(){this.agent&&this.agent.dirty()}function ghe(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function yhe(r){r.useClearVisual&&r.data.clearAllVisual();var e=r.resetDefines=$t(r.reset(r.model,r.ecModel,r.api,r.payload));return e.length>1?de(e,function(t,i){return AW(i)}):_he}var _he=AW(0);function AW(r){return function(e,t){var i=t.data,n=t.resetDefines[r];if(n&&n.dataEach)for(var a=e.start;a0&&p===u.length-h.length){var d=u.slice(0,p);d!=="data"&&(t.mainType=d,t[h.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(i[u]=l,c=!0),c||(n[u]=l)})}return{cptQuery:t,dataQuery:i,otherQuery:n}},r.prototype.filter=function(e,t){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,n,a));function c(f,h,p,d){return f[p]==null||h[d||p]===f[p]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}();var ND=["symbol","symbolSize","symbolRotate","symbolOffset"],zW=ND.concat(["symbolKeepAspect"]),FW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData();if(r.legendIcon&&t.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o=0&&qp(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function Y_(r,e,t){for(var i=e.type==="radial"?Nhe(r,e,t):Ihe(r,e,t),n=e.colorStops,a=0;a0)?null:r==="dashed"?[4*e,2*e]:r==="dotted"?[e]:Ct(r)?[r]:pe(r)?r:null}function q_(r){var e=r.style,t=e.lineDash&&e.lineWidth>0&&Uhe(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(t){var n=e.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(t=de(t,function(a){return a/n}),i/=n)}return[t,i]}var Ohe=new Ki(!0);function o1(r){var e=r.stroke;return!(e==null||e==="none"||!(r.lineWidth>0))}function WW(r){return typeof r=="string"&&r!=="none"}function s1(r){var e=r.fill;return e!=null&&e!=="none"}function XW(r,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.fillOpacity*e.opacity,r.fill(),r.globalAlpha=t}else r.fill()}function YW(r,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.strokeOpacity*e.opacity,r.stroke(),r.globalAlpha=t}else r.stroke()}function l1(r,e,t){var i=s_(e.image,e.__image,t);if(Ym(i)){var n=r.createPattern(i,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*Tm),a.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(a)}return n}}function zhe(r,e,t,i){var n,a=o1(t),o=s1(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var c=e.path||Ohe,f=e.__dirty;if(!i){var h=t.fill,p=t.stroke,d=o&&!!h.colorStops,g=a&&!!p.colorStops,m=o&&!!h.image,v=a&&!!p.image,_=void 0,y=void 0,x=void 0,M=void 0,S=void 0;(d||g)&&(S=e.getBoundingRect()),d&&(_=f?Y_(r,h,S):e.__canvasFillGradient,e.__canvasFillGradient=_),g&&(y=f?Y_(r,p,S):e.__canvasStrokeGradient,e.__canvasStrokeGradient=y),m&&(x=f||!e.__canvasFillPattern?l1(r,h,e):e.__canvasFillPattern,e.__canvasFillPattern=x),v&&(M=f||!e.__canvasStrokePattern?l1(r,p,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),d?r.fillStyle=_:m&&(x?r.fillStyle=x:o=!1),g?r.strokeStyle=y:v&&(M?r.strokeStyle=M:a=!1)}var w=e.getGlobalScale();c.setScale(w[0],w[1],e.segmentIgnoreThreshold);var T,C;r.setLineDash&&t.lineDash&&(n=q_(e),T=n[0],C=n[1]);var b=!0;(u||f&hf)&&(c.setDPR(r.dpr),l?c.setContext(null):(c.setContext(r),b=!1),c.reset(),e.buildPath(c,e.shape,i),c.toStatic(),e.pathUpdated()),b&&c.rebuildPath(r,l?s:1),T&&(r.setLineDash(T),r.lineDashOffset=C),i||(t.strokeFirst?(a&&YW(r,t),o&&XW(r,t)):(o&&XW(r,t),a&&YW(r,t))),T&&r.setLineDash([])}function Fhe(r,e,t){var i=e.__image=s_(t.image,e.__image,e,e.onload);if(!(!i||!Ym(i))){var n=t.x||0,a=t.y||0,o=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),t.sWidth&&t.sHeight){var u=t.sx||0,c=t.sy||0;r.drawImage(i,u,c,t.sWidth,t.sHeight,n,a,o,s)}else if(t.sx&&t.sy){var u=t.sx,c=t.sy,f=o-u,h=s-c;r.drawImage(i,u,c,f,h,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function Bhe(r,e,t){var i,n=t.text;if(n!=null&&(n+=""),n){r.font=t.font||ho,r.textAlign=t.textAlign,r.textBaseline=t.textBaseline;var a=void 0,o=void 0;r.setLineDash&&t.lineDash&&(i=q_(e),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),t.strokeFirst?(o1(t)&&r.strokeText(n,t.x,t.y),s1(t)&&r.fillText(n,t.x,t.y)):(s1(t)&&r.fillText(n,t.x,t.y),o1(t)&&r.strokeText(n,t.x,t.y)),a&&r.setLineDash([])}}var qW=["shadowBlur","shadowOffsetX","shadowOffsetY"],ZW=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function e6(r,e,t,i,n){var a=!1;if(!i&&(t=t||{},e===t))return!1;if(i||e.opacity!==t.opacity){Ha(r,n),a=!0;var o=Math.max(Math.min(e.opacity,1),0);r.globalAlpha=isNaN(o)?Ll.opacity:o}(i||e.blend!==t.blend)&&(a||(Ha(r,n),a=!0),r.globalCompositeOperation=e.blend||Ll.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,i,n){if(!this[Xn]){if(this._disposed){this.id;return}var a,o,s;if(qe(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[Xn]=!0,!this._model||i){var l=new F5(this._api),u=this._theme,c=this._model=new Ow;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:o},YD);var f={seriesTransition:s,optionChanged:!0};if(n)this[Wa]={silent:a,updateParams:f},this[Xn]=!1,this.getZr().wakeUp();else{try{gv(this),Nf.update.call(this,null,f)}catch(h){throw this[Wa]=null,this[Xn]=!1,h}this._ssr||this._zr.flush(),this[Wa]=null,this[Xn]=!1,j_.call(this,a),K_.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||zt.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var i=this._zr.painter;return i.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(zt.svgSupported){var t=this._zr,i=t.storage.getDisplayList();return N(i,function(n){n.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var i=t.excludeComponents,n=this._model,a=[],o=this;N(i,function(l){n.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return N(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var i=t.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(g6[n]){var l=s,u=s,c=-s,f=-s,h=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();N($_,function(y,x){if(y.group===n){var M=i?y.getZr().painter.getSvgDom().innerHTML:y.renderToCanvas(Qe(t)),S=y.getDom().getBoundingClientRect();l=a(S.left,l),u=a(S.top,u),c=o(S.right,c),f=o(S.bottom,f),h.push({dom:M,left:S.left,top:S.top})}}),l*=p,u*=p,c*=p,f*=p;var d=c-l,g=f-u,m=Fn.createCanvas(),v=ZL(m,{renderer:i?"svg":"canvas"});if(v.resize({width:d,height:g}),i){var _="";return N(h,function(y){var x=y.left-l,M=y.top-u;_+=''+y.dom+""}),v.painter.getSvgRoot().innerHTML=_,t.connectedBackgroundColor&&v.painter.setBackgroundColor(t.connectedBackgroundColor),v.refreshImmediately(),v.painter.toDataURL()}else return t.connectedBackgroundColor&&v.add(new Et({shape:{x:0,y:0,width:d,height:g},style:{fill:t.connectedBackgroundColor}})),N(h,function(y){var x=new Ur({style:{x:y.left*p-l,y:y.top*p-u,image:y.dom}});v.add(x)}),v.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,i){return VD(this,"convertToPixel",t,i)},e.prototype.convertFromPixel=function(t,i){return VD(this,"convertFromPixel",t,i)},e.prototype.containPixel=function(t,i){if(this._disposed){this.id;return}var n=this._model,a,o=yf(n,t);return N(o,function(s,l){l.indexOf("Models")>=0&&N(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(i);else if(l==="seriesModels"){var f=this._chartsMap[u.__viewId];f&&f.containPoint&&(a=a||f.containPoint(i,u))}},this)},this),!!a},e.prototype.getVisual=function(t,i){var n=this._model,a=yf(n,t,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?W_(s,l,i):Bl(s,i)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;N(spe,function(i){var n=function(a){var o=t.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&qs(s,function(d){var g=rt(d);if(g&&g.dataIndex!=null){var m=g.dataModel||o.getSeriesByIndex(g.seriesIndex);return l=m&&m.getDataParams(g.dataIndex,g.dataType,s)||{},!0}else if(g.eventData)return l=fe({},g.eventData),!0},!0),l){var c=l.componentType,f=l.componentIndex;(c==="markLine"||c==="markPoint"||c==="markArea")&&(c="series",f=l.seriesIndex);var h=c&&f!=null&&o.getComponent(c,f),p=h&&t[h.mainType==="series"?"_chartsMap":"_componentsMap"][h.__viewId];l.event=a,l.type=i,t._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:h,view:p},t.trigger(i,l)}};n.zrEventfulCallAtLast=!0,t._zr.on(i,n,t)}),N(J_,function(i,n){t._messageCenter.on(n,function(a){this.trigger(n,a)},t)}),N(["selectchanged"],function(i){t._messageCenter.on(i,function(n){this.trigger(i,n)},t)}),kW(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var t=this.getDom();t&&QL(this.getDom(),KD,"");var i=this,n=i._api,a=i._model;N(i._componentsViews,function(o){o.dispose(a,n)}),N(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete $_[i.id]},e.prototype.resize=function(t){if(!this[Xn]){if(this._disposed){this.id;return}this._zr.resize(t);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=t&&t.silent;this[Wa]&&(a==null&&(a=this[Wa].silent),n=!0,this[Wa]=null),this[Xn]=!0;try{n&&gv(this),Nf.update.call(this,{type:"resize",animation:fe({duration:0},t&&t.animation)})}catch(o){throw this[Xn]=!1,o}this[Xn]=!1,j_.call(this,a),K_.call(this,a)}}},e.prototype.showLoading=function(t,i){if(this._disposed){this.id;return}if(qe(t)&&(i=t,t=""),t=t||"default",this.hideLoading(),!!qD[t]){var n=qD[t](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var i=fe({},t);return i.type=J_[t.type],i},e.prototype.dispatchAction=function(t,i){if(this._disposed){this.id;return}if(qe(i)||(i={silent:!!i}),!!h1[t.type]&&this._model){if(this[Xn]){this._pendingActions.push(t);return}var n=i.silent;HD.call(this,t,n);var a=i.flush;a?this._zr.flush():a!==!1&&zt.browser.weChat&&this._throttledZrFlush(),j_.call(this,n),K_.call(this,n)}},e.prototype.updateLabelLayout=function(){ss.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var i=t.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){gv=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),kD(f,!0),kD(f,!1),h.plan()},kD=function(f,h){for(var p=f._model,d=f._scheduler,g=h?f._componentsViews:f._chartsViews,m=h?f._componentsMap:f._chartsMap,v=f._zr,_=f._api,y=0;yh.get("hoverLayerThreshold")&&!zt.node&&!zt.worker&&h.eachSeries(function(m){if(!m.preventUsingHoverLayer){var v=f._chartsMap[m.__viewId];v.__alive&&v.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function o(f,h){var p=f.get("blendMode")||null;h.eachRendered(function(d){d.isGroup||(d.style.blend=p)})}function s(f,h){if(!f.preventAutoZ){var p=f.get("z")||0,d=f.get("zlevel")||0;h.eachRendered(function(g){return l(g,p,d,-1/0),!0})}}function l(f,h,p,d){var g=f.getTextContent(),m=f.getTextGuideLine(),v=f.isGroup;if(v)for(var _=f.childrenRef(),y=0;y<_.length;y++)d=Math.max(l(_[y],h,p,d),d);else f.z=h,f.zlevel=p,d=Math.max(f.z2,d);if(g&&(g.z=h,g.zlevel=p,isFinite(d)&&(g.z2=d+2)),m){var x=f.textGuideLineConfig;m.z=h,m.zlevel=p,isFinite(d)&&(m.z2=d+(x&&x.showAbove?1:-1))}return d}function u(f,h){h.eachRendered(function(p){if(!Eu(p)){var d=p.getTextContent(),g=p.getTextGuideLine();p.stateTransition&&(p.stateTransition=null),d&&d.stateTransition&&(d.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),p.hasState()?(p.prevStates=p.currentStates,p.clearStates()):p.prevStates&&(p.prevStates=null)}})}function c(f,h){var p=f.getModel("stateAnimation"),d=f.isAnimationEnabled(),g=p.get("duration"),m=g>0?{duration:g,delay:p.get("delay"),easing:p.get("easing")}:null;h.eachRendered(function(v){if(v.states&&v.states.emphasis){if(Eu(v))return;if(v instanceof ut&&y4(v),v.__dirty){var _=v.prevStates;_&&v.useStates(_)}if(d){v.stateTransition=m;var y=v.getTextContent(),x=v.getTextGuideLine();y&&(y.stateTransition=m),x&&(x.stateTransition=m)}v.__dirty&&n(v)}})}m6=function(f){return new(function(h){Z(p,h);function p(){return h!==null&&h.apply(this,arguments)||this}return p.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},p.prototype.getComponentByElement=function(d){for(;d;){var g=d.__ecComponentInfo;if(g!=null)return f._model.getComponent(g.mainType,g.index);d=d.parent}},p.prototype.enterEmphasis=function(d,g){Bn(d,g),ls(f)},p.prototype.leaveEmphasis=function(d,g){kn(d,g),ls(f)},p.prototype.enterBlur=function(d){tw(d),ls(f)},p.prototype.leaveBlur=function(d){m_(d),ls(f)},p.prototype.enterSelect=function(d){wP(d),ls(f)},p.prototype.leaveSelect=function(d){TP(d),ls(f)},p.prototype.getModel=function(){return f.getModel()},p.prototype.getViewOfComponentModel=function(d){return f.getViewOfComponentModel(d)},p.prototype.getViewOfSeriesModel=function(d){return f.getViewOfSeriesModel(d)},p}(zw))(f)},C6=function(f){function h(p,d){for(var g=0;g=0)){y6.push(t);var a=ID.wrapStageHandler(t,n);a.__prio=e,a.__raw=t,r.push(a)}}function e2(r,e){qD[r]=e}function z6(r,e,t){var i=u6("registerMap");i&&i(r,e,t)}var F6=rW;Uf(ZD,wW);Uf(d1,TW);Uf(d1,EW);Uf(ZD,FW);Uf(d1,BW);Uf(S6,zD);JD(Fw);$D(Khe,dD);e2("default",DD);ha({type:Ef,event:Ef,update:Ef},Dr);ha({type:p_,event:p_,update:p_},Dr);ha({type:Km,event:Km,update:Km},Dr);ha({type:d_,event:d_,update:d_},Dr);ha({type:Jm,event:Jm,update:Jm},Dr);D6("light",PW);D6("dark",UW);var B6=[],cpe={registerPreprocessor:JD,registerProcessor:$D,registerPostInit:I6,registerPostUpdate:N6,registerUpdateLifecycle:m1,registerAction:ha,registerCoordinateSystem:U6,registerLayout:O6,registerVisual:Uf,registerTransform:F6,registerLoading:e2,registerMap:z6,registerImpl:l6,PRIORITY:M6,ComponentModel:Pt,ComponentView:er,SeriesModel:jt,ChartView:Yt,registerComponentModel:function(r){Pt.registerClass(r)},registerComponentView:function(r){er.registerClass(r)},registerSeriesModel:function(r){jt.registerClass(r)},registerChartView:function(r){Yt.registerClass(r)},registerSubTypeDefaulter:function(r,e){Pt.registerSubTypeDefaulter(r,e)},registerPainter:function(r,e){YG(r,e)}};function It(r){if(pe(r)){N(r,function(e){It(e)});return}dt(B6,r)>=0||(B6.push(r),He(r)&&(r={install:r}),r.install(cpe))}function Q_(r){return r==null?0:r.length||1}function k6(r){return r}var fpe=function(){function r(e,t,i,n,a,o){this._old=e,this._new=t,this._oldKeyGetter=i||k6,this._newKeyGetter=n||k6,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(e){return this._add=e,this},r.prototype.update=function(e){return this._update=e,this},r.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},r.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},r.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},r.prototype.remove=function(e){return this._remove=e,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var e=this._old,t=this._new,i={},n=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,n,"_oldKeyGetter"),this._initIndexMap(t,i,a,"_newKeyGetter");for(var o=0;o1){var c=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(c,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},r.prototype._executeMultiple=function(){var e=this._old,t=this._new,i={},n={},a=[],o=[];this._initIndexMap(e,i,a,"_oldKeyGetter"),this._initIndexMap(t,n,o,"_newKeyGetter");for(var s=0;s1&&h===1)this._updateManyToOne&&this._updateManyToOne(c,u),n[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(c,u),n[l]=null;else if(f===1&&h===1)this._update&&this._update(c,u),n[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,u),n[l]=null;else if(f>1)for(var p=0;p1)for(var s=0;s30}var ex=qe,Of=de,gpe=typeof Int32Array>"u"?Array:Int32Array,ype="e\0\0",G6=-1,_pe=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],xpe=["_approximateExtent"],H6,y1,tx,rx,o2,_1,s2,Spe=function(){function r(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i,n=!1;g1(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(n=!0,i=e),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c=t)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===fn;if(l&&!n.pure)for(var u=[],c=e;c0},r.prototype.ensureUniqueItemVisual=function(e,t){var i=this._itemVisuals,n=i[e];n||(n=i[e]={});var a=n[t];return a==null&&(a=this.getVisual(t),pe(a)?a=a.slice():ex(a)&&(a=fe({},a)),n[t]=a),a},r.prototype.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{};this._itemVisuals[e]=n,ex(t)?fe(n,t):n[t]=i},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(e,t){ex(e)?fe(this._layout,e):this._layout[e]=t},r.prototype.getLayout=function(e){return this._layout[e]},r.prototype.getItemLayout=function(e){return this._itemLayouts[e]},r.prototype.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?fe(this._itemLayouts[e]||{},t):t},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(e,t){var i=this.hostModel&&this.hostModel.seriesIndex;f_(i,this.dataType,e,t),this._graphicEls[e]=t},r.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},r.prototype.eachItemGraphicEl=function(e,t){N(this._graphicEls,function(i,n){i&&e&&e.call(t,i,n)})},r.prototype.cloneShallow=function(e){return e||(e=new r(this._schema?this._schema:Of(this.dimensions,this._getDimInfo,this),this.hostModel)),o2(e,this),e._store=this._store,e},r.prototype.wrapMethod=function(e,t){var i=this[e];He(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var n=i.apply(this,arguments);return t.apply(this,[n].concat(nb(arguments)))})},r.internalField=function(){H6=function(e){var t=e._invertedIndicesMap;N(t,function(i,n){var a=e._dimInfos[n],o=a.ordinalMeta,s=e._store;if(o){i=t[n]=new gpe(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),n[t]=l}}}(),r}(),ri=Spe;function Ks(r,e){hv(r)||(r=pv(r)),e=e||{};var t=e.coordDimensions||[],i=e.dimensionsDefine||r.dimensionsDefine||[],n=ke(),a=[],o=bpe(r,t,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&a2(o),l=i===r.dimensionsDefine,u=l?n2(r):i2(i),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(r,o));for(var f=ke(c),h=new wD(o),p=0;p0&&(i.name=n+(a-1)),a++,e.set(n,a)}}function bpe(r,e,t,i){var n=Math.max(r.dimensionsDetectedCount||1,e.length,t.length,i||0);return N(e,function(a){var o;qe(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function wpe(r,e,t){if(t||e.hasKey(r)){for(var i=0;e.hasKey(r+i);)i++;r+=i}return e.set(r,!0),r}var Tpe=function(){function r(e){this.coordSysDims=[],this.axisMap=ke(),this.categoryAxisMap=ke(),this.coordSysName=e}return r}();function W6(r){var e=r.get("coordinateSystem"),t=new Tpe(e),i=Epe[e];if(i)return i(r,t,t.axisMap,t.categoryAxisMap),t}var Epe={cartesian2d:function(r,e,t,i){var n=r.getReferringComponents("xAxis",Ar).models[0],a=r.getReferringComponents("yAxis",Ar).models[0];e.coordSysDims=["x","y"],t.set("x",n),t.set("y",a),_v(n)&&(i.set("x",n),e.firstCategoryDimIndex=0),_v(a)&&(i.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(r,e,t,i){var n=r.getReferringComponents("singleAxis",Ar).models[0];e.coordSysDims=["single"],t.set("single",n),_v(n)&&(i.set("single",n),e.firstCategoryDimIndex=0)},polar:function(r,e,t,i){var n=r.getReferringComponents("polar",Ar).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",o),_v(a)&&(i.set("radius",a),e.firstCategoryDimIndex=0),_v(o)&&(i.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(r,e,t,i){e.coordSysDims=["lng","lat"]},parallel:function(r,e,t,i){var n=r.ecModel,a=n.getComponent("parallel",r.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();N(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),c=o[l];t.set(c,u),_v(u)&&(i.set(c,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function _v(r){return r.get("type")==="category"}function X6(r,e,t){t=t||{};var i=t.byIndex,n=t.stackedCoordDimension,a,o,s;Ape(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(r&&r.get("stack")),u,c,f,h;if(N(a,function(_,y){Ce(_)&&(a[y]=_={name:_}),l&&!_.isExtraCoord&&(!i&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!n||n===_.coordDim)&&(c=_))}),c&&!i&&!u&&(i=!0),c){f="__\0ecstackresult_"+r.id,h="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var p=c.coordDim,d=c.type,g=0;N(a,function(_){_.coordDim===p&&g++});var m={name:f,coordDim:p,coordDimIndex:g,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},v={name:h,coordDim:h,coordDimIndex:g+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(m.storeDimIndex=s.ensureCalculationDimension(h,d),v.storeDimIndex=s.ensureCalculationDimension(f,d)),o.appendCalculationDimension(m),o.appendCalculationDimension(v)):(a.push(m),a.push(v))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:h,stackResultDimension:f}}function Ape(r){return!g1(r.schema)}function wo(r,e){return!!e&&e===r.getCalculationInfo("stackedDimension")}function x1(r,e){return wo(r,e)?r.getCalculationInfo("stackResultDimension"):e}function Cpe(r,e){var t=r.get("coordinateSystem"),i=Nu.get(t),n;return e&&e.coordSysDims&&(n=de(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=Zp(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function Rpe(r,e,t){var i,n;return t&&N(r,function(a,o){var s=a.coordDim,l=t.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(r[i].otherDims.itemName=0),i}function Lpe(r,e,t){t=t||{};var i=e.getSourceManager(),n,a=!1;r?(a=!0,n=pv(r)):(n=i.getSource(),a=n.sourceFormat===fn);var o=W6(e),s=Cpe(e,o),l=t.useEncodeDefaulter,u=He(l)?l:l?ot(Dw,s,e):null,c={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=Ks(n,c),h=Rpe(f.dimensions,t.createInvertedIndices,o),p=a?null:i.getSharedDataStore(f),d=X6(e,{schema:f,store:p}),g=new ri(f,e);g.setCalculationInfo(d);var m=h!=null&&Ppe(n)?function(v,_,y,x){return x===h?y:this.defaultDimValueGetter(v,_,y,x)}:null;return g.hasItemOption=!1,g.initData(a?n:p,null,m),g}function Ppe(r){if(r.sourceFormat===fn){var e=Dpe(r.data||[]);return!pe(zs(e))}}function Dpe(r){for(var e=0;et[1]&&(t[1]=e[1])},r.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},r.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(e){this._isBlank=e},r}();xf(Y6);var Xa=Y6;var Ipe=0,Npe=function(){function r(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++Ipe}return r.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&de(i,Upe);return new r({categories:n,needCollect:!n,deduplication:t.dedplication!==!1})},r.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},r.prototype.parseAndCollect=function(e){var t,i=this._needCollect;if(!Ce(e)&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=this._getOrCreateMap();return t=n.get(e),t==null&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t},r.prototype._getOrCreateMap=function(){return this._map||(this._map=ke(this.categories))},r}();function Upe(r){return qe(r)&&r.value!=null?r.value:r+""}var ix=Npe;function nx(r){return r.type==="interval"||r.type==="log"}function Z6(r,e,t,i){var n={},a=r[1]-r[0],o=n.interval=Vm(a/e,!0);t!=null&&oi&&(o=n.interval=i);var s=n.intervalPrecision=l2(o),l=n.niceTickExtent=[Er(Math.ceil(r[0]/o)*o,s),Er(Math.floor(r[1]/o)*o,s)];return Ope(l,r),n}function S1(r){var e=Math.pow(10,km(r)),t=r/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,Er(t*e)}function l2(r){return Sn(r)+2}function q6(r,e,t){r[e]=Math.max(Math.min(r[e],t[1]),t[0])}function Ope(r,e){!isFinite(r[0])&&(r[0]=e[0]),!isFinite(r[1])&&(r[1]=e[1]),q6(r,0,e),q6(r,1,e),r[0]>r[1]&&(r[0]=r[1])}function zf(r,e){return r>=e[0]&&r<=e[1]}function Ff(r,e){return e[1]===e[0]?.5:(r-e[0])/(e[1]-e[0])}function Bf(r,e){return r*(e[1]-e[0])+e[0]}var j6=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new ix({})),pe(n)&&(n=new ix({categories:de(n,function(a){return qe(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return e.prototype.parse=function(t){return t==null?NaN:Ce(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),zf(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),Ff(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(Bf(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],i=this._extent,n=i[0];n<=i[1];)t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Xa);Xa.registerClass(j6);var ax=j6;var jp=Er,K6=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return zf(t,this._extent)},e.prototype.normalize=function(t){return Ff(t,this._extent)},e.prototype.scale=function(t){return Bf(t,this._extent)},e.prototype.setExtent=function(t,i){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(i)||(n[1]=parseFloat(i))},e.prototype.unionExtent=function(t){var i=this._extent;t[0]i[1]&&(i[1]=t[1]),this.setExtent(i[0],i[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=l2(t)},e.prototype.getTicks=function(t){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]l)return[];var c=s.length?s[s.length-1].value:a[1];return n[1]>c&&(t?s.push({value:jp(c+i,o)}):s.push({value:n[1]})),s},e.prototype.getMinorTicks=function(t){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;oa[0]&&p0&&(a=a===null?s:Math.min(a,s))}t[i]=a}}return t}function p2(r){var e=Fpe(r),t=[];return N(r,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],c=Math.abs(o[1]-o[0]),f=a.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=u?c/h*u:c}else{var p=i.getData();s=Math.abs(o[1]-o[0])/p.count()}var d=ze(i.get("barWidth"),s),g=ze(i.get("barMaxWidth"),s),m=ze(i.get("barMinWidth")||(r8(i)?.5:1),s),v=i.get("barGap"),_=i.get("barCategoryGap");t.push({bandWidth:s,barWidth:d,barMaxWidth:g,barMinWidth:m,barGap:v,barCategoryGap:_,axisKey:f2(a),stackId:c2(i)})}),Q6(t)}function Q6(r){var e={};N(r,function(i,n){var a=i.axisKey,o=i.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=i.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var f=i.barMaxWidth;f&&(l[u].maxWidth=f);var h=i.barMinWidth;h&&(l[u].minWidth=h);var p=i.barGap;p!=null&&(s.gap=p);var d=i.barCategoryGap;d!=null&&(s.categoryGap=d)});var t={};return N(e,function(i,n){t[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=bt(a).length;s=Math.max(35-l*4,15)+"%"}var u=ze(s,o),c=ze(i.gap,1),f=i.remainedWidth,h=i.autoWidthCount,p=(f-u)/(h+(h-1)*c);p=Math.max(p,0),N(a,function(v){var _=v.maxWidth,y=v.minWidth;if(v.width){var x=v.width;_&&(x=Math.min(x,_)),y&&(x=Math.max(x,y)),v.width=x,f-=x+c*x,h--}else{var x=p;_&&_x&&(x=y),x!==p&&(v.width=x,f-=x+c*x,h--)}}),p=(f-u)/(h+(h-1)*c),p=Math.max(p,0);var d=0,g;N(a,function(v,_){v.width||(v.width=p),g=v,d+=v.width*(1+c)}),g&&(d-=g.width*c);var m=-d/2;N(a,function(v,_){t[n][_]=t[n][_]||{bandWidth:o,offset:m,width:v.width},m+=v.width*(1+c)})}),t}function e8(r,e,t){if(r&&e){var i=r[f2(e)];return i!=null&&t!=null?i[c2(t)]:i}}function b1(r,e){var t=h2(r,e),i=p2(t);N(t,function(n){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=c2(n),u=i[f2(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function w1(r){return{seriesType:r,plan:Mo(),reset:function(e){if(t8(e)){var t=e.getData(),i=e.coordinateSystem,n=i.getBaseAxis(),a=i.getOtherAxis(n),o=t.getDimensionIndex(t.mapDimension(a.dim)),s=t.getDimensionIndex(t.mapDimension(n.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),c=t.getCalculationInfo("stackResultDimension"),f=wo(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),p=Bpe(n,a),d=r8(e),g=e.get("barMinHeight")||0,m=c&&t.getDimensionIndex(c),v=t.getLayout("size"),_=t.getLayout("offset");return{progress:function(y,x){for(var M=y.count,S=d&&pa(M*3),w=d&&l&&pa(M*3),T=d&&pa(M),C=i.master.getRect(),b=h?C.width:C.height,E,I=x.getStore(),R=0;(E=y.next())!=null;){var A=I.get(f?m:o,E),D=I.get(s,E),U=p,B=void 0;f&&(B=+A-I.get(o,E));var z=void 0,k=void 0,G=void 0,Y=void 0;if(h){var J=i.dataToPoint([A,D]);if(f){var Q=i.dataToPoint([B,D]);U=Q[0]}z=U,k=J[1]+_,G=J[0]-U,Y=v,Math.abs(G)>>1;r[n][1]n&&(this._approxInterval=n);var s=T1.length,l=Math.min(kpe(T1,this._approxInterval,0,s),s-1);this._interval=T1[l][1],this._minLevelUnit=T1[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return Ct(t)?t:+Mn(t)},e.prototype.contain=function(t){return zf(this.parse(t),this._extent)},e.prototype.normalize=function(t){return Ff(this.parse(t),this._extent)},e.prototype.scale=function(t){return Bf(t,this._extent)},e.type="time",e}(Ya),T1=[["second",ww],["minute",Tw],["hour",lv],["quarter-day",lv*6],["half-day",lv*12],["day",_o*1.2],["half-week",_o*3.5],["week",_o*7],["month",_o*31],["quarter",_o*95],["half-year",qP/2],["year",qP]];function Vpe(r,e,t,i){var n=Mn(e),a=Mn(t),o=function(d){return KP(n,d,i)===KP(a,d,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},f=function(){return c()&&o("minute")},h=function(){return f()&&o("second")},p=function(){return h()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return f();case"second":return h();case"millisecond":return p()}}function Gpe(r,e){return r/=_o,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function Hpe(r){var e=30*_o;return r/=e,r>6?6:r>3?3:r>2?2:1}function Wpe(r){return r/=lv,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function i8(r,e){return r/=e?Tw:ww,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function Xpe(r){return Vm(r,!0)}function Ype(r,e,t){var i=new Date(r);switch(kp(e)){case"year":case"month":i[JP(t)](0);case"day":i[$P(t)](1);case"hour":i[QP(t)](0);case"minute":i[eD(t)](0);case"second":i[tD(t)](0),i[rD(t)](0)}return i.getTime()}function qpe(r,e,t,i){var n=1e4,a=jP,o=0;function s(b,E,I,R,A,D,U){for(var B=new Date(E),z=E,k=B[R]();z1&&D===0&&I.unshift({value:I[0].value-z})}}for(var D=0;D=i[0]&&_<=i[1]&&f++)}var y=(i[1]-i[0])/e;if(f>y*1.5&&h>y/1.5||(u.push(m),f>y||r===a[p]))break}c=[]}}}for(var x=Wt(de(u,function(b){return Wt(b,function(E){return E.value>=i[0]&&E.value<=i[1]&&!E.notAdd})}),function(b){return b.length>0}),M=[],S=x.length-1,p=0;p0;)a*=10;var s=[Er(Kpe(i[0]/a)*a),Er(jpe(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){ox.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=Js(t)/Js(this.base),zf(t,this._extent)},e.prototype.normalize=function(t){return t=Js(t)/Js(this.base),Ff(t,this._extent)},e.prototype.scale=function(t){return t=Bf(t,this._extent),A1(this.base,t)},e.type="log",e}(Xa),o8=d2.prototype;o8.getMinorTicks=ox.getMinorTicks;o8.getLabel=ox.getLabel;function C1(r,e){return Zpe(r,Sn(e))}Xa.registerClass(d2);var s8=d2;var Jpe=function(){function r(e,t,i){this._prepareParams(e,t,i)}return r.prototype._prepareParams=function(e,t,i){i[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var h=this._determinedMin,p=this._determinedMax;return h!=null&&(s=h,u=!0),p!=null&&(l=p,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:f}},r.prototype.modifyDataMinMax=function(e,t){this[Qpe[e]]=t},r.prototype.setDeterminedMinMax=function(e,t){var i=$pe[e];this[i]=t},r.prototype.freeze=function(){this.frozen=!0},r}();var $pe={min:"_determinedMin",max:"_determinedMax"},Qpe={min:"_dataMin",max:"_dataMax"};function L1(r,e,t){var i=r.rawExtentInfo;return i||(i=new Jpe(r,e,t),r.rawExtentInfo=i,i)}function R1(r,e){return e==null?null:uf(e)?NaN:r.parse(e)}function m2(r,e){var t=r.type,i=L1(r,e,r.getExtent()).calculate();r.setBlank(i.isBlank);var n=i.min,a=i.max,o=e.ecModel;if(o&&t==="time"){var s=h2("bar",o),l=!1;if(N(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var u=p2(s),c=ede(n,a,e,u);n=c.min,a=c.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function ede(r,e,t,i){var n=t.axis.getExtent(),a=n[1]-n[0],o=e8(i,t.axis);if(o===void 0)return{min:r,max:e};var s=1/0;N(o,function(p){s=Math.min(p.offset,s)});var l=-1/0;N(o,function(p){l=Math.max(p.offset+p.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=e-r,f=1-(s+l)/a,h=c/f-c;return e+=h*(l/u),r-=h*(s/u),{min:r,max:e}}function kl(r,e){var t=e,i=m2(r,t),n=i.extent,a=t.get("splitNumber");r instanceof s8&&(r.base=t.get("logBase"));var o=r.type,s=t.get("interval"),l=o==="interval"||o==="time";r.setExtent(n[0],n[1]),r.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function kf(r,e){if(e=e||r.get("type"),e)switch(e){case"category":return new ax({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new E1({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(Xa.getClass(e)||Ya)}}function l8(r){var e=r.scale.getExtent(),t=e[0],i=e[1];return!(t>0&&i>0||t<0&&i<0)}function xv(r){var e=r.getLabelModel().get("formatter"),t=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(i){return function(n,a){return r.scale.getFormattedLabel(n,a,i)}}(e):Ce(e)?function(i){return function(n){var a=r.scale.getLabel(n),o=i.replace("{value}",a??"");return o}}(e):He(e)?function(i){return function(n,a){return t!=null&&(a=n.value-t),i(sx(r,n),a,n.level!=null?{level:n.level}:null)}}(e):function(i){return r.scale.getLabel(i)}}function sx(r,e){return r.type==="category"?r.scale.getLabel(e):e.value}function u8(r){var e=r.model,t=r.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var i,n,a=t.getExtent();t instanceof ax?n=t.count():(i=t.getTicks(),n=i.length);var o=r.getLabelModel(),s=xv(r),l,u=1;n>40&&(u=Math.ceil(n/40));for(var c=0;cr[1]&&(r[1]=n[1])})}var Vl=function(){function r(){}return r.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},r.prototype.getCoordSysModel=function(){},r}();var rde=1e-8;function f8(r,e){return Math.abs(r-e)n&&(i=o,n=l)}if(i)return nde(i.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var i=this._rect;if(i&&!t)return i;var n=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return N(o,function(s){s.type==="polygon"?p8(s.exterior,n,a,t):N(s.points,function(l){p8(l,n,a,t)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(a[0])&&isFinite(a[1])||(n[0]=n[1]=a[0]=a[1]=0),i=new lt(n[0],n[1],a[0]-n[0],a[1]-n[1]),t||(this._rect=i),i},e.prototype.contain=function(t){var i=this.getBoundingRect(),n=this.geometries;if(!i.contain(t[0],t[1]))return!1;e:for(var a=0,o=n.length;a>1^-(s&1),l=l>>1^-(l&1),s+=n,l+=a,n=s,a=l,i.push([s/t,l/t])}return i}function x2(r,e){return r=ade(r),de(Wt(r.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var i=t.properties,n=t.geometry,a=[];switch(n.type){case"Polygon":var o=n.coordinates;a.push(new g2(o[0],o.slice(1)));break;case"MultiPolygon":N(n.coordinates,function(l){l[0]&&a.push(new g2(l[0],l.slice(1)))});break;case"LineString":a.push(new y2([n.coordinates]));break;case"MultiLineString":a.push(new y2(n.coordinates))}var s=new N1(i[e||"name"],a,i.cp);return s.properties=i,s})}var Mv={};qR(Mv,{MAX_SAFE_INTEGER:()=>t_,asc:()=>Ti,getPercentWithPrecision:()=>JG,getPixelPrecision:()=>Bm,getPrecision:()=>Sn,getPrecisionSafe:()=>jL,isNumeric:()=>xp,isRadianAroundZero:()=>xu,linearMap:()=>rr,nice:()=>Vm,numericToNumber:()=>Na,parseDate:()=>Mn,quantile:()=>Gm,quantity:()=>Gb,quantityExponent:()=>km,reformIntervals:()=>i_,remRadian:()=>r_,round:()=>Er});var lx=vt();function g8(r){return r.type==="category"?ode(r):lde(r)}function y8(r,e){return r.type==="category"?sde(r,e):{ticks:de(r.scale.getTicks(),function(t){return t.value})}}function ode(r){var e=r.getLabelModel(),t=_8(r,e);return!e.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function _8(r,e){var t=x8(r,"labels"),i=P1(e),n=S8(t,i);if(n)return n;var a,o;return He(i)?a=T8(r,i):(o=i==="auto"?ude(r):i,a=w8(r,o)),M8(t,i,{labels:a,labelCategoryInterval:o})}function sde(r,e){var t=x8(r,"ticks"),i=P1(e),n=S8(t,i);if(n)return n;var a,o;if((!e.get("show")||r.scale.isBlank())&&(a=[]),He(i))a=T8(r,i,!0);else if(i==="auto"){var s=_8(r,r.getLabelModel());o=s.labelCategoryInterval,a=de(s.labels,function(l){return l.tickValue})}else o=i,a=w8(r,o,!0);return M8(t,i,{ticks:a,tickCategoryInterval:o})}function lde(r){var e=r.scale.getTicks(),t=xv(r);return{labels:de(e,function(i,n){return{level:i.level,formattedLabel:t(i,n),rawLabel:r.scale.getLabel(i),tickValue:i.value}})}}function x8(r,e){return lx(r)[e]||(lx(r)[e]=[])}function S8(r,e){for(var t=0;t40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),c=Math.abs(u*Math.cos(i)),f=Math.abs(u*Math.sin(i)),h=0,p=0;l<=a[1];l+=s){var d=0,g=0,m=Rl(t({value:l}),e.font,"center","top");d=m.width*1.3,g=m.height*1.3,h=Math.max(h,d,7),p=Math.max(p,g,7)}var v=h/c,_=p/f;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var y=Math.max(0,Math.floor(Math.min(v,_))),x=lx(r.model),M=r.getExtent(),S=x.lastAutoInterval,w=x.lastTickCount;return S!=null&&w!=null&&Math.abs(S-y)<=1&&Math.abs(w-o)<=1&&S>y&&x.axisExtent0===M[0]&&x.axisExtent1===M[1]?y=S:(x.lastTickCount=o,x.lastAutoInterval=y,x.axisExtent0=M[0],x.axisExtent1=M[1]),y}function cde(r){var e=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function w8(r,e,t){var i=xv(r),n=r.scale,a=n.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],c=n.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var f=D1(r),h=o.get("showMinLabel")||f,p=o.get("showMaxLabel")||f;h&&u!==a[0]&&g(a[0]);for(var d=u;d<=a[1];d+=l)g(d);p&&d-l!==a[1]&&g(a[1]);function g(m){var v={value:m};s.push(t?m:{formattedLabel:i(v),rawLabel:n.getLabel(v),tickValue:m})}return s}function T8(r,e,t){var i=r.scale,n=xv(r),a=[];return N(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;e(o.value,s)&&a.push(t?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var E8=[0,1],fde=function(){function r(e,t,i){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=i||[0,0]}return r.prototype.contain=function(e){var t=this._extent,i=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return e>=i&&e<=n},r.prototype.containData=function(e){return this.scale.contain(e)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(e){return Bm(e||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(e,t){var i=this._extent;i[0]=e,i[1]=t},r.prototype.dataToCoord=function(e,t){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&n.type==="ordinal"&&(i=i.slice(),A8(i,n.count())),rr(e,E8,i,t)},r.prototype.coordToData=function(e,t){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),A8(i,n.count()));var a=rr(e,i,E8,t);return this.scale.scale(a)},r.prototype.pointToData=function(e,t){},r.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),i=y8(this,t),n=i.ticks,a=de(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=t.get("alignWithLabel");return hde(this,a,o,e.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var i=this.scale.getMinorTicks(t),n=de(i,function(a){return de(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},r.prototype.getViewLabels=function(){return g8(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},r.prototype.calculateCategoryInterval=function(){return b8(this)},r}();function A8(r,e){var t=r[1]-r[0],i=e,n=t/i/2;r[0]+=n,r[1]-=n}function hde(r,e,t,i){var n=e.length;if(!r.onBand||t||!n)return;var a=r.getExtent(),o,s;if(n===1)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[n-1].tickValue-e[0].tickValue,u=(e[n-1].coord-e[0].coord)/l;N(e,function(p){p.coord-=u/2});var c=r.scale.getExtent();s=1+c[1]-e[n-1].tickValue,o={coord:e[n-1].coord+u*s},e.push(o)}var f=a[0]>a[1];h(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift()),i&&h(a[0],e[0].coord)&&e.unshift({coord:a[0]}),h(a[1],o.coord)&&(i?o.coord=a[1]:e.pop()),i&&h(o.coord,a[1])&&e.push({coord:a[1]});function h(p,d){return p=Er(p),d=Er(d),f?p>d:pn&&(n+=ux);var p=Math.atan2(s,o);if(p<0&&(p+=ux),p>=i&&p<=n||p+ux>=i&&p+ux<=n)return l[0]=c,l[1]=f,u-t;var d=t*Math.cos(i)+r,g=t*Math.sin(i)+e,m=t*Math.cos(n)+r,v=t*Math.sin(n)+e,_=(d-o)*(d-o)+(g-s)*(g-s),y=(m-o)*(m-o)+(v-s)*(v-s);return _0){e=e/180*Math.PI,Qs.fromArray(r[0]),Zr.fromArray(r[1]),Ai.fromArray(r[2]),Nt.sub(Hl,Qs,Zr),Nt.sub(Gl,Ai,Zr);var t=Hl.len(),i=Gl.len();if(!(t<.001||i<.001)){Hl.scale(1/t),Gl.scale(1/i);var n=Hl.dot(Gl),a=Math.cos(e);if(a1&&Nt.copy(da,Ai),da.toArray(r[1])}}}}function R8(r,e,t){if(t<=180&&t>0){t=t/180*Math.PI,Qs.fromArray(r[0]),Zr.fromArray(r[1]),Ai.fromArray(r[2]),Nt.sub(Hl,Zr,Qs),Nt.sub(Gl,Ai,Zr);var i=Hl.len(),n=Gl.len();if(!(i<.001||n<.001)){Hl.scale(1/i),Gl.scale(1/n);var a=Hl.dot(e),o=Math.cos(t);if(a=l)Nt.copy(da,Ai);else{da.scaleAndAdd(Gl,s/Math.tan(Math.PI/2-c));var f=Ai.x!==Zr.x?(da.x-Zr.x)/(Ai.x-Zr.x):(da.y-Zr.y)/(Ai.y-Zr.y);if(isNaN(f))return;f<0?Nt.copy(da,Zr):f>1&&Nt.copy(da,Ai)}da.toArray(r[1])}}}}function S2(r,e,t,i){var n=t==="normal",a=n?r:r.ensureState(t);a.ignore=e;var o=i.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();n?r.useStyle(s):a.style=s}function yde(r,e){var t=e.smooth,i=e.points;if(i)if(r.moveTo(i[0][0],i[0][1]),t>0&&i.length>=3){var n=Yo(i[0],i[1]),a=Yo(i[1],i[2]);if(!n||!a){r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*t,s=Am([],i[1],i[0],o/n),l=Am([],i[1],i[2],o/a),u=Am([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c0&&a&&S(-f/o,0,o);var m=r[0],v=r[o-1],_,y;x(),_<0&&w(-_,.8),y<0&&w(y,.8),x(),M(_,y,1),M(y,_,-1),x(),_<0&&T(-_),y<0&&T(y);function x(){_=m.rect[e]-i,y=n-v.rect[e]-v.rect[t]}function M(C,b,E){if(C<0){var I=Math.min(b,-C);if(I>0){S(I*E,0,o);var R=I+C;R<0&&w(-R*E,1)}else w(-C*E,1)}}function S(C,b,E){C!==0&&(u=!0);for(var I=b;I0)for(var R=0;R0;R--){var B=E[R-1]*U;S(-B,R,o)}}}function T(C){var b=C<0?-1:1;C=Math.abs(C);for(var E=Math.ceil(C/(o-1)),I=0;I0?S(E,0,I+1):S(-E,o-I-1,o),C-=E,C<=0)return}return u}function P8(r,e,t,i){return L8(r,"x","width",e,t,i)}function F1(r,e,t,i){return L8(r,"y","height",e,t,i)}function B1(r){var e=[];r.sort(function(g,m){return m.priority-g.priority});var t=new lt(0,0,0,0);function i(g){if(!g.ignore){var m=g.ensureState("emphasis");m.ignore==null&&(m.ignore=!1)}g.ignore=!0}for(var n=0;n=0&&i.attr(a.oldLayoutSelect),dt(h,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),Dt(i,u,t,l)}else if(i.attr(u),!Pu(i).valueAnimation){var f=ft(i.style.opacity,1);i.style.opacity=0,or(i,{style:{opacity:f}},t,l)}if(a.oldLayout=u,i.states.select){var p=a.oldLayoutSelect={};k1(p,u,V1),k1(p,i.states.select,V1)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};k1(d,u,V1),k1(d,i.states.emphasis,V1)}_w(i,l,c,t,t)}if(n&&!n.ignore&&!n.invisible){var a=Sde(n),o=a.oldLayout,g={points:n.shape.points};o?(n.attr({shape:o}),Dt(n,{shape:g},t)):(n.setShape(g),n.style.strokePercent=0,or(n,{style:{strokePercent:1}},t)),a.oldLayout=g}},r}(),I8=Mde;var T2=vt();function E2(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,i){var n=T2(t).labelManager;n||(n=T2(t).labelManager=new I8),n.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(e,t,i){var n=T2(t).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),n.updateLayoutConfig(t),n.layout(t),n.processLabelsOverall()})}var A2=Math.sin,C2=Math.cos,N8=Math.PI,Jp=Math.PI*2,bde=180/N8,wde=function(){function r(){}return r.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},r.prototype.moveTo=function(e,t){this._add("M",e,t)},r.prototype.lineTo=function(e,t){this._add("L",e,t)},r.prototype.bezierCurveTo=function(e,t,i,n,a,o){this._add("C",e,t,i,n,a,o)},r.prototype.quadraticCurveTo=function(e,t,i,n){this._add("Q",e,t,i,n)},r.prototype.arc=function(e,t,i,n,a,o){this.ellipse(e,t,i,i,0,n,a,o)},r.prototype.ellipse=function(e,t,i,n,a,o,s,l){var u=s-o,c=!l,f=Math.abs(u),h=Cl(f-Jp)||(c?u>=Jp:-u>=Jp),p=u>0?u%Jp:u%Jp+Jp,d=!1;h?d=!0:Cl(f)?d=!1:d=p>=N8==!!c;var g=e+i*C2(o),m=t+n*A2(o);this._start&&this._add("M",g,m);var v=Math.round(a*bde);if(h){var _=1/this._p,y=(c?1:-1)*(Jp-_);this._add("A",i,n,v,1,+c,e+i*C2(o+y),t+n*A2(o+y)),_>.01&&this._add("A",i,n,v,0,+c,g,m)}else{var x=e+i*C2(s),M=t+n*A2(s);this._add("A",i,n,v,+d,+c,x,M)}},r.prototype.rect=function(e,t,i,n){this._add("M",e,t),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(e,t,i,n,a,o,s,l,u){for(var c=[],f=this._p,h=1;h"}function Lde(r){return""}function fx(r,e){e=e||{};var t=e.newline?` +`:"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return Rde(o,s)+(o!=="style"?yn(l):l||"")+(a?""+t+de(a,function(u){return i(u)}).join(t)+t:"")+Lde(o)}return i(r)}function F8(r,e,t){t=t||{};var i=t.newline?` +`:"",n=" {"+i,a=i+"}",o=de(bt(r),function(l){return l+n+de(bt(r[l]),function(u){return u+":"+r[l][u]+";"}).join(i)+a}).join(i),s=de(bt(e),function(l){return"@keyframes "+l+n+de(bt(e[l]),function(u){return u+n+de(bt(e[l][u]),function(c){var f=e[l][u][c];return c==="d"&&(f='path("'+f+'")'),c+":"+f+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":[""].join(i)}function hx(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function I2(r,e,t,i){return Ci("svg","root",{width:r,height:e,xmlns:U8,"xmlns:xlink":P2,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+e:!1},t)}var Pde=0;function W1(){return Pde++}var B8={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},$p="transform-origin";function Dde(r,e,t){var i=fe({},r.shape);fe(i,e),r.buildPath(t,i);var n=new G1;return n.reset(Pb(r)),t.rebuildPath(n,1),n.generateStr(),n.getStr()}function Ide(r,e){var t=e.originX,i=e.originY;(t||i)&&(r[$p]=t+"px "+i+"px")}var Nde={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function V8(r,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=r,t}function Ude(r,e,t){var i=r.shape.paths,n={},a,o;if(N(i,function(l){var u=hx(t.zrId);u.animation=!0,px(l,{},u,!0);var c=u.cssAnims,f=u.cssNodes,h=bt(c),p=h.length;if(p){o=h[p-1];var d=c[o];for(var g in d){var m=d[g];n[g]=n[g]||{d:""},n[g].d+=m.d||""}for(var v in f){var _=f[v].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){e.d=!1;var s=V8(n,t);return a.replace(o,s)}}function k8(r){return Ce(r)?B8[r]?"cubic-bezier("+B8[r]+")":Dm(r)?r:"":""}function px(r,e,t,i){var n=r.animators,a=n.length,o=[];if(r instanceof tv){var s=Ude(r,e,t);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var ve=V8(w,t);return ve+" "+_[0]+" both"}}for(var m in l){var s=g(l[m]);s&&o.push(s)}if(o.length){var v=t.zrId+"-cls-"+W1();t.cssNodes["."+v]={animation:o.join(",")},e.class=v}}function H8(r,e,t){if(!r.ignore)if(r.isSilent()){var i={"pointer-events":"none"};G8(i,e,t,!0)}else{var n=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=n.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=Y0(l))}var u=n.lineWidth;if(u){var c=!n.strokeNoScale&&r.transform?r.transform[0]:1;u=u/c}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),G8(i,e,t,!0)}}function G8(r,e,t,i){var n=JSON.stringify(r),a=t.cssStyleCache[n];a||(a=t.zrId+"-cls-"+W1(),t.cssStyleCache[n]=a,t.cssNodes["."+a+(i?":hover":"")]=r),e.class=e.class?e.class+" "+a:a}var dx=Math.round;function q8(r){return r&&Ce(r.src)}function Z8(r){return r&&He(r.toDataURL)}function N2(r,e,t,i){L2(function(n,a){var o=n==="fill"||n==="stroke";o&&Lb(a)?F2(e,r,n,i):o&&q0(a)?B2(t,r,n,i):o&&a==="none"?r[n]="transparent":r[n]=a},e,t,!1),Gde(t,r,i)}function U2(r,e){var t=qG(e);t&&(t.each(function(i,n){i!=null&&(r[(D2+n).toLowerCase()]=i+"")}),e.isSilent()&&(r[D2+"silent"]="true"))}function W8(r){return Cl(r[0]-1)&&Cl(r[1])&&Cl(r[2])&&Cl(r[3]-1)}function Ode(r){return Cl(r[4])&&Cl(r[5])}function O2(r,e,t){if(e&&!(Ode(e)&&W8(e))){var i=t?10:1e4;r.transform=W8(e)?"translate("+dx(e[4]*i)/i+" "+dx(e[5]*i)/i+")":SG(e)}}function X8(r,e,t){for(var i=r.points,n=[],a=0;a"u"){var m="Image width/height must been given explictly in svg-ssr renderer.";kr(h,m),kr(p,m)}else if(h==null||p==null){var v=function(b,E){if(b){var I=b.elm,R=h||E.width,A=p||E.height;b.tag==="pattern"&&(u?(A=1,R/=a.width):c&&(R=1,A/=a.height)),b.attrs.width=R,b.attrs.height=A,I&&(I.setAttribute("width",R),I.setAttribute("height",A))}},_=s_(d,null,r,function(b){l||v(S,b),v(f,b)});_&&_.width&&_.height&&(h=h||_.width,p=p||_.height)}f=Ci("image","img",{href:d,width:h,height:p}),o.width=h,o.height=p}else n.svgElement&&(f=Qe(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(f){var y,x;l?y=x=1:u?(x=1,y=o.width/a.width):c?(y=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",y!=null&&!isNaN(y)&&(o.width=y),x!=null&&!isNaN(x)&&(o.height=x);var M=Db(n);M&&(o.patternTransform=M);var S=Ci("pattern","",o,[f]),w=fx(S),T=i.patternCache,C=T[w];C||(C=i.zrId+"-p"+i.patternIdx++,T[w]=C,o.id=C,S=i.defs[C]=Ci("pattern",C,o,[f])),e[t]=Z0(C)}}function K8(r,e,t){var i=t.clipPathCache,n=t.defs,a=i[r.id];if(!a){a=t.zrId+"-c"+t.clipPathIdx++;var o={id:a};i[r.id]=a,n[a]=Ci("clipPath",a,o,[j8(r,t)])}e["clip-path"]=Z0(a)}function k2(r){return document.createTextNode(r)}function Vf(r,e,t){r.insertBefore(e,t)}function V2(r,e){r.removeChild(e)}function G2(r,e){r.appendChild(e)}function H2(r){return r.parentNode}function W2(r){return r.nextSibling}function X1(r,e){r.textContent=e}var J8=58,Wde=120,Xde=Ci("","");function X2(r){return r===void 0}function Wl(r){return r!==void 0}function Yde(r,e,t){for(var i={},n=e;n<=t;++n){var a=r[n].key;a!==void 0&&(i[a]=n)}return i}function mx(r,e){var t=r.key===e.key,i=r.tag===e.tag;return i&&t}function vx(r){var e,t=r.children,i=r.tag;if(Wl(i)){var n=r.elm=H1(i);if(q1(Xde,r),pe(t))for(e=0;ea?(d=t[l+1]==null?null:t[l+1].elm,$8(r,d,t,n,l)):Y1(r,e,i,a))}function Tv(r,e){var t=e.elm=r.elm,i=r.children,n=e.children;r!==e&&(q1(r,e),X2(e.text)?Wl(i)&&Wl(n)?i!==n&&qde(t,i,n):Wl(n)?(Wl(r.text)&&X1(t,""),$8(t,null,n,0,n.length-1)):Wl(i)?Y1(t,i,0,i.length-1):Wl(r.text)&&X1(t,""):r.text!==e.text&&(Wl(i)&&Y1(t,i,0,i.length-1),X1(t,e.text)))}function Y2(r,e){if(mx(r,e))Tv(r,e);else{var t=r.elm,i=H2(t);vx(e),i!==null&&(Vf(i,e.elm,W2(t)),Y1(i,[r],0,0))}return e}var Zde=0,jde=function(){function r(e,t,i){if(this.type="svg",this.refreshHover=Q8("refreshHover"),this.configLayer=Q8("configLayer"),this.storage=t,this._opts=i=fe({},i),this.root=e,this._id="zr"+Zde++,this._oldVNode=I2(i.width,i.height),e&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=H1("svg");q1(null,this._oldVNode),n.appendChild(a),e.appendChild(n)}this.resize(i.width,i.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",Y2(this._oldVNode,e),this._oldVNode=e}},r.prototype.renderOneToVNode=function(e){return z2(e,hx(this._id))},r.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=hx(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis;var o=[],s=this._bgVNode=Kde(i,n,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=Ci("g","main",{},[]);this._paintList(t,a,l?l.children:o),l&&o.push(l);var u=de(bt(a.defs),function(h){return a.defs[h]});if(u.length&&o.push(Ci("defs","defs",{},u)),e.animation){var c=F8(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=Ci("style","stl",{},[],c);o.push(f)}}return I2(i,n,o,e.useViewBox)},r.prototype.renderToString=function(e){return e=e||{},fx(this.renderToVNode({animation:ft(e.cssAnimation,!0),emphasis:ft(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:ft(e.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(e,t,i){for(var n=e.length,a=[],o=0,s,l,u=0,c=0;c=0&&!(h&&l&&h[g]===l[g]);g--);for(var m=d-1;m>g;m--)o--,s=a[o-1];for(var v=g+1;v=s)}}for(var f=this.__startIndex;f15)break}}A.prevElClipPaths&&v.restore()};if(_)if(_.length===0)T=m.__endIndex;else for(var b=p.dpr,E=0;E<_.length;++E){var I=_[E];v.save(),v.beginPath(),v.rect(I.x*b,I.y*b,I.width*b,I.height*b),v.clip(),C(I),v.restore()}else v.save(),C(),v.restore();m.__drawIndex=T,m.__drawIndex0&&e>n[0]){for(l=0;le);l++);s=i[n[l]]}if(n.splice(l+1,0,e),i[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(t.dom,u.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}},r.prototype.eachLayer=function(e,t){for(var i=this._zlevelList,n=0;n0?j1:0),this._needsManuallyCompositing),c.__builtin__||ep("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,t(l),a=c),n.__dirty&zi&&!n.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(e){e.clear()},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e,N(this._layers,function(t){t.setUnpainted()})},r.prototype.configLayer=function(e,t){if(t){var i=this._layerConfig;i[e]?_t(i[e],t,!0):i[e]=t;for(var n=0;n-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(jt),nX=rme;function el(r,e){var t=r.mapDimensionsAll("defaultedLabel"),i=t.length;if(i===1){var n=Ou(r,e,t[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o=0&&i.push(e[a])}return i.join(" ")}var ime=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this)||this;return o.updateData(t,i,n,a),o}return e.prototype._createSymbol=function(t,i,n,a,o){this.removeAll();var s=Sr(t,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=nme,this._symbolType=t,this.add(s)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Bn(this.childAt(0))},e.prototype.downplay=function(){kn(this.childAt(0))},e.prototype.setZ=function(t,i){var n=this.childAt(0);n.zlevel=t,n.z=i},e.prototype.setDraggable=function(t,i){var n=this.childAt(0);n.draggable=t,n.cursor=!i&&t?"move":n.cursor},e.prototype.updateData=function(t,i,n,a){this.silent=!1;var o=t.getItemVisual(i,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,i),u=o!==this._symbolType,c=a&&a.disableAnimation;if(u){var f=t.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,t,i,l,f)}else{var h=this.childAt(0);h.silent=!1;var p={scaleX:l[0]/2,scaleY:l[1]/2};c?h.attr(p):Dt(h,p,s,i),Di(h)}if(this._updateCommon(t,i,l,n,a),u){var h=this.childAt(0);if(!c){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,or(h,p,s,i)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,i,n,a,o){var s=this.childAt(0),l=t.hostModel,u,c,f,h,p,d,g,m,v;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,f=a.selectItemStyle,h=a.focus,p=a.blurScope,g=a.labelStatesModels,m=a.hoverScale,v=a.cursorStyle,d=a.emphasisDisabled),!a||t.hasItemOption){var _=a&&a.itemModel?a.itemModel:t.getItemModel(i),y=_.getModel("emphasis");u=y.getModel("itemStyle").getItemStyle(),f=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),h=y.get("focus"),p=y.get("blurScope"),d=y.get("disabled"),g=wr(_),m=y.getShallow("scale"),v=_.getShallow("cursor")}var x=t.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var M=bo(t.getItemVisual(i,"symbolOffset"),n);M&&(s.x=M[0],s.y=M[1]),v&&s.attr("cursor",v);var S=t.getItemVisual(i,"style"),w=S.fill;if(s instanceof Ur){var T=s.style;s.useStyle(fe({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},S))}else s.__isEmptyBrush?s.useStyle(fe({},S)):s.useStyle(S),s.style.decal=null,s.setColor(w,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=t.getItemVisual(i,"liftZ"),b=this._z2;C!=null?b==null&&(this._z2=s.z2,s.z2+=C):b!=null&&(s.z2=b,this._z2=null);var E=o&&o.useNameLabel;Ir(s,g,{labelFetcher:l,labelDataIndex:i,defaultText:I,inheritColor:w,defaultOpacity:S.opacity});function I(D){return E?t.getName(D):el(t,D)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var R=s.ensureState("emphasis");R.style=u,s.ensureState("select").style=f,s.ensureState("blur").style=c;var A=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;R.scaleX=this._sizeX*A,R.scaleY=this._sizeY*A,this.setSymbolScale(1),ar(this,h,p,d)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,i,n){var a=this.childAt(0),o=rt(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&ts(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();ts(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:t,removeOpt:s})},e.getSymbolSize=function(t,i){return Zs(t.getItemVisual(i,"symbolSize"))},e}(Ze);function nme(r,e){this.parent.drift(r,e)}var Bu=ime;function j2(r,e,t,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(t))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&r.getItemVisual(t,"symbol")!=="none"}function aX(r){return r!=null&&!qe(r)&&(r={isIgnore:r}),r||{}}function oX(r){var e=r.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:wr(e),cursorStyle:e.get("cursor")}}var ame=function(){function r(e){this.group=new Ze,this._SymbolCtor=e||Bu}return r.prototype.updateData=function(e,t){this._progressiveEls=null,t=aX(t);var i=this.group,n=e.hostModel,a=this._data,o=this._SymbolCtor,s=t.disableAnimation,l=oX(e),u={disableAnimation:s},c=t.getSymbolPoint||function(f){return e.getItemLayout(f)};a||i.removeAll(),e.diff(a).add(function(f){var h=c(f);if(j2(e,h,f,t)){var p=new o(e,f,l,u);p.setPosition(h),e.setItemGraphicEl(f,p),i.add(p)}}).update(function(f,h){var p=a.getItemGraphicEl(h),d=c(f);if(!j2(e,d,f,t)){i.remove(p);return}var g=e.getItemVisual(f,"symbol")||"circle",m=p&&p.getSymbolType&&p.getSymbolType();if(!p||m&&m!==g)i.remove(p),p=new o(e,f,l,u),p.setPosition(d);else{p.updateData(e,f,l,u);var v={x:d[0],y:d[1]};s?p.attr(v):Dt(p,v,n)}i.add(p),e.setItemGraphicEl(f,p)}).remove(function(f){var h=a.getItemGraphicEl(f);h&&h.fadeOut(function(){i.remove(h)},n)}).execute(),this._getSymbolPoint=c,this._data=e},r.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(i,n){var a=e._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=oX(e),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t,i){this._progressiveEls=[],i=aX(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a0?t=i[0]:i[1]<0&&(t=i[1]),t}function $1(r,e,t,i){var n=NaN;r.stacked&&(n=t.get(t.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=t.get(r.baseDim,i),o[1-a]=n,e.dataToPoint(o)}function sme(r,e){var t=[];return e.diff(r).add(function(i){t.push({cmd:"+",idx:i})}).update(function(i,n){t.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){t.push({cmd:"-",idx:i})}).execute(),t}function K2(r,e,t,i,n,a,o,s){for(var l=sme(r,e),u=[],c=[],f=[],h=[],p=[],d=[],g=[],m=J1(n,e,o),v=r.getLayout("points")||[],_=e.getLayout("points")||[],y=0;y=n||g<0)break;if(ed(v,_)){if(l){g+=a;continue}break}if(g===t)r[a>0?"moveTo":"lineTo"](v,_),f=v,h=_;else{var y=v-u,x=_-c;if(y*y+x*x<.5){g+=a;continue}if(o>0){for(var M=g+a,S=e[M*2],w=e[M*2+1];S===v&&w===_&&m=i||ed(S,w))p=v,d=_;else{b=S-u,E=w-c;var A=v-u,D=S-v,U=_-c,B=w-_,z=void 0,k=void 0;if(s==="x"){z=Math.abs(A),k=Math.abs(D);var G=b>0?1:-1;p=v-G*z*o,d=_,I=v+G*k*o,R=_}else if(s==="y"){z=Math.abs(U),k=Math.abs(B);var Y=E>0?1:-1;p=v,d=_-Y*z*o,I=v,R=_+Y*k*o}else z=Math.sqrt(A*A+U*U),k=Math.sqrt(D*D+B*B),C=k/(k+z),p=v-b*o*(1-C),d=_-E*o*(1-C),I=v+b*o*C,R=_+E*o*C,I=Gf(I,Hf(S,v)),R=Gf(R,Hf(w,_)),I=Hf(I,Gf(S,v)),R=Hf(R,Gf(w,_)),b=I-v,E=R-_,p=v-b*z/k,d=_-E*z/k,p=Gf(p,Hf(u,v)),d=Gf(d,Hf(c,_)),p=Hf(p,Gf(u,v)),d=Hf(d,Gf(c,_)),b=v-p,E=_-d,I=v+b*k/z,R=_+E*k/z}r.bezierCurveTo(f,h,p,d,v,_),f=I,h=R}else r.lineTo(v,_)}u=v,c=_,g+=a}return m}var sX=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),lX=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="ec-polyline",i}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new sX},e.prototype.buildPath=function(t,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&ed(n[o*2-2],n[o*2-1]);o--);for(;a=0){var x=u?(d-l)*y+l:(p-s)*y+s;return u?[t,x]:[x,t]}s=p,l=d;break;case o.C:p=a[f++],d=a[f++],g=a[f++],m=a[f++],v=a[f++],_=a[f++];var M=u?up(s,p,g,v,t,c):up(l,d,m,_,t,c);if(M>0)for(var S=0;S=0){var x=u?hi(l,d,m,_,w):hi(s,p,g,v,w);return u?[t,x]:[x,t]}}s=v,l=_;break}}},e}(ut);var lme=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(sX),Q1=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="ec-polygon",i}return e.prototype.getDefaultShape=function(){return new lme},e.prototype.buildPath=function(t,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&ed(n[s*2-2],n[s*2-1]);s--);for(;oe){a?t.push(o(a,l,e)):n&&t.push(o(n,l,0),o(n,l,e));break}else n&&(t.push(o(n,l,0)),n=null),t.push(l),a=l}return t}function fme(r,e,t){var i=r.getVisual("visualMeta");if(!(!i||!i.length||!r.count())&&e.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=r.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=e.getAxis(n),u=de(a.stops,function(y){return{coord:l.toGlobalCoord(l.dataToCoord(y.value)),color:y.color}}),c=u.length,f=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),f.reverse());var h=cme(u,n==="x"?t.getWidth():t.getHeight()),p=h.length;if(!p&&c)return u[0].coord<0?f[1]?f[1]:u[c-1].color:f[0]?f[0]:u[0].color;var d=10,g=h[0].coord-d,m=h[p-1].coord+d,v=m-g;if(v<.001)return"transparent";N(h,function(y){y.offset=(y.coord-g)/v}),h.push({offset:p?h[p-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:p?h[0].offset:.5,color:f[0]||"transparent"});var _=new zl(0,0,0,0,h,!0);return _[n]=g,_[n+"2"]=m,_}}}function hme(r,e,t){var i=r.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=t.getAxesByScale("ordinal")[0];if(a&&!(n&&pme(a,e))){var o=e.mapDimension(a.dim),s={};return N(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function pme(r,e){var t=r.getExtent(),i=Math.abs(t[1]-t[0])/r.scale.count();isNaN(i)&&(i=0);for(var n=e.count(),a=Math.max(1,Math.round(n/5)),o=0;oi)return!1;return!0}function dme(r,e){return isNaN(r)||isNaN(e)}function mme(r){for(var e=r.length/2;e>0&&dme(r[e*2-2],r[e*2-1]);e--);return e-1}function pX(r,e){return[r[e*2],r[e*2+1]]}function vme(r,e,t){for(var i=r.length/2,n=t==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function dX(r){if(r.get(["endLabel","show"]))return!0;for(var e=0;e0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var G=g.getState("emphasis").style;G.lineWidth=+g.style.lineWidth+1}rt(g).seriesIndex=t.seriesIndex,ar(g,B,z,k);var Y=hX(t.get("smooth")),J=t.get("smoothMonotone");if(g.setShape({smooth:Y,smoothMonotone:J,connectNulls:T}),m){var Q=l.getCalculationInfo("stackedOnSeries"),V=0;m.useStyle(Ye(c.getAreaStyle(),{fill:R,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),Q&&(V=hX(Q.get("smooth"))),m.setShape({smooth:Y,stackedOnSmooth:V,smoothMonotone:J,connectNulls:T}),Gr(m,t,"areaStyle"),rt(m).seriesIndex=t.seriesIndex,ar(m,B,z,k)}var K=function(ae){a._changePolyState(ae)};l.eachItemGraphicEl(function(ae){ae&&(ae.onHoverStateChange=K)}),this._polyline.onHoverStateChange=K,this._data=l,this._coordSys=o,this._stackedOnPoints=S,this._points=f,this._step=E,this._valueOrigin=x,t.get("triggerLineEvent")&&(this.packEventData(t,g),m&&this.packEventData(t,m))},e.prototype.packEventData=function(t,i){rt(i).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,i,n,a){var o=t.getData(),s=$o(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],f=l[s*2+1];if(isNaN(c)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,f))return;var h=t.get("zlevel")||0,p=t.get("z")||0;u=new Bu(o,s),u.x=c,u.y=f,u.setZ(h,p);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=h,d.z=p,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Yt.prototype.highlight.call(this,t,i,n,a)},e.prototype.downplay=function(t,i,n,a){var o=t.getData(),s=$o(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Yt.prototype.downplay.call(this,t,i,n,a)},e.prototype._changePolyState=function(t){var i=this._polygon;Pp(this._polyline,t),i&&Pp(i,t)},e.prototype._newPolyline=function(t){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new lX({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},e.prototype._newPolygon=function(t,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new Q1({shape:{points:t,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=t.hostModel,c=u.get("animationDuration");He(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=He(f)?f(null):f;t.eachItemGraphicEl(function(p,d){var g=p;if(g){var m=[p.x,p.y],v=void 0,_=void 0,y=void 0;if(n)if(o){var x=n,M=i.pointToCoord(m);a?(v=x.startAngle,_=x.endAngle,y=-M[1]/180*Math.PI):(v=x.r0,_=x.r,y=M[0])}else{var S=n;a?(v=S.x,_=S.x+S.width,y=p.x):(v=S.y+S.height,_=S.y,y=p.y)}var w=_===v?0:(y-v)/(_-v);l&&(w=1-w);var T=He(f)?f(d):c*w+h,C=g.getSymbolPath(),b=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,i,n){var a=t.getModel("endLabel");if(dX(t)){var o=t.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new Lt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=mme(l);c>=0&&(Ir(s,wr(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:c,defaultText:function(f,h,p){return p!=null?K1(o,p):el(o,f)},enableTextSetter:!0},gme(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,i,n,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var f=n.getLayout("points"),h=n.hostModel,p=h.get("connectNulls"),d=s.get("precision"),g=s.get("distance")||0,m=l.getBaseAxis(),v=m.isHorizontal(),_=m.inverse,y=i.shape,x=_?v?y.x:y.y+y.height:v?y.x+y.width:y.y,M=(v?g:0)*(_?-1:1),S=(v?0:-g)*(_?-1:1),w=v?"x":"y",T=vme(f,x,w),C=T.range,b=C[1]-C[0],E=void 0;if(b>=1){if(b>1&&!p){var I=pX(f,C[0]);u.attr({x:I[0]+M,y:I[1]+S}),o&&(E=h.getRawValue(C[0]))}else{var I=c.getPointOn(x,w);I&&u.attr({x:I[0]+M,y:I[1]+S});var R=h.getRawValue(C[0]),A=h.getRawValue(C[1]);o&&(E=Xb(n,d,R,A,T.t))}a.lastFrameIndex=C[0]}else{var D=t===1||a.lastFrameIndex>0?C[0]:0,I=pX(f,D);o&&(E=h.getRawValue(D)),u.attr({x:I[0]+M,y:I[1]+S})}if(o){var U=Pu(u);typeof U.setLabelText=="function"&&U.setLabelText(E)}}},e.prototype._doUpdateAnimation=function(t,i,n,a,o,s,l){var u=this._polyline,c=this._polygon,f=t.hostModel,h=K2(this._data,t,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin,s),p=h.current,d=h.stackedOnCurrent,g=h.next,m=h.stackedOnNext;if(o&&(p=Wf(h.current,n,o,l),d=Wf(h.stackedOnCurrent,n,o,l),g=Wf(h.next,n,o,l),m=Wf(h.stackedOnNext,n,o,l)),fX(p,g)>3e3||c&&fX(d,m)>3e3){u.stopAnimation(),u.setShape({points:g}),c&&(c.stopAnimation(),c.setShape({points:g,stackedOnPoints:m}));return}u.shape.__points=h.current,u.shape.points=p;var v={shape:{points:g}};h.current!==p&&(v.shape.__points=h.next),u.stopAnimation(),Dt(u,v,f),c&&(c.setShape({points:p,stackedOnPoints:d}),c.stopAnimation(),Dt(c,{shape:{stackedOnPoints:m}},f),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],y=h.status,x=0;xe&&(e=r[t]);return isFinite(e)?e:NaN},min:function(r){for(var e=1/0,t=0;te&&(e=a,t=n)}return isFinite(t)?t:NaN},nearest:function(r){return r[0]}},xme=function(r){return Math.round(r.length/2)};function gx(r){return{seriesType:r,reset:function(e,t,i){var n=e.getData(),a=e.get("sampling"),o=e.coordinateSystem,s=n.count();if(s>10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),f=i.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(f||1),p=Math.round(s/h);if(isFinite(p)&&p>1){a==="lttb"&&e.setData(n.lttbDownSample(n.mapDimension(u.dim),1/p));var d=void 0;Ce(a)?d=_me[a]:He(a)&&(d=a),d&&e.setData(n.downSample(n.mapDimension(u.dim),1/p,d,xme))}}}}}function tI(r){r.registerChartView(mX),r.registerSeriesModel(nX),r.registerLayout(tl("line",!0)),r.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),i=e.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",i)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,gx("line"))}var vX=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){return hn(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,i,n){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(t),s=a.dataToPoint(o);if(n)N(a.getAxes(),function(h,p){if(h.type==="category"&&i!=null){var d=h.getTicksCoords(),g=h.getTickModel().get("alignWithLabel"),m=o[p],v=i[p]==="x1"||i[p]==="y1";if(v&&!g&&(m+=1),d.length<2)return;if(d.length===2){s[p]=h.toGlobalCoord(h.getExtent()[v?1:0]);return}for(var _=void 0,y=void 0,x=1,M=0;Mm){y=(S+_)/2;break}M===1&&(x=w-d[0].tickValue)}y==null&&(_?_&&(y=d[d.length-1].coord):y=d[0].coord),s[p]=h.toGlobalCoord(y)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),f=a.getBaseAxis().isHorizontal()?0:1;s[f]+=u+c/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(jt);jt.registerClass(vX);var Ev=vX;var Sme=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return hn(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),i=this.get("largeThreshold");return i>t&&(t=i),t},e.prototype.brushSelector=function(t,i,n){return n.rect(i.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Hn(Ev.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(Ev),gX=Sme;var Mme=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),bme=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="sausage",i}return e.prototype.getDefaultShape=function(){return new Mme},e.prototype.buildPath=function(t,i){var n=i.cx,a=i.cy,o=Math.max(i.r0||0,0),s=Math.max(i.r,0),l=(s-o)*.5,u=o+l,c=i.startAngle,f=i.endAngle,h=i.clockwise,p=Math.PI*2,d=h?f-cMath.PI/2&&cs)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(t,i){for(var n=i.scale,a=n.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],n.getOrdinalMeta().categories.length-1);o<=s;++o)if(t.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,i,n,a){if(this._isOrderChangedWithinSameData(t,i,n)){var o=this._dataSort(t,n,i);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,i,n){var a=i.baseAxis,o=this._dataSort(t,a,function(s){return t.get(t.mapDimension(i.otherAxis.dim),s)});n.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(t,i){this._clear(this._model),this._removeOnRenderedListener(i)},e.prototype.dispose=function(t,i){this._removeOnRenderedListener(i)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var i=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(a){Au(a,t,rt(a).dataIndex)})):i.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(Yt),xX={cartesian2d:function(r,e){var t=e.width<0?-1:1,i=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var n=r.x+r.width,a=r.y+r.height,o=rI(e.x,r.x),s=iI(e.x+e.width,n),l=rI(e.y,r.y),u=iI(e.y+e.height,a),c=sn?s:o,e.y=f&&l>a?u:l,e.width=c?0:s-o,e.height=f?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),c||f},polar:function(r,e){var t=e.r0<=e.r?1:-1;if(t<0){var i=e.r;e.r=e.r0,e.r0=i}var n=iI(e.r,r.r),a=rI(e.r0,r.r0);e.r=n,e.r0=a;var o=n-a<0;if(t<0){var i=e.r;e.r=e.r0,e.r0=i}return o}},SX={cartesian2d:function(r,e,t,i,n,a,o,s,l){var u=new Et({shape:fe({},i),z2:1});if(u.__dataIndex=t,u.name="item",a){var c=u.shape,f=n?"height":"width";c[f]=0}return u},polar:function(r,e,t,i,n,a,o,s,l){var u=!n&&l?Av:yi,c=new u({shape:i,z2:1});c.name="item";var f=RX(n);if(c.calculateTextPosition=yX(f,{isRoundCap:u===Av}),a){var h=c.shape,p=n?"r":"endAngle",d={};h[p]=n?i.r0:i.startAngle,d[p]=i[p],(s?Dt:or)(c,{shape:d},a)}return c}};function Eme(r,e){var t=r.get("realtimeSort",!0),i=e.getBaseAxis();if(t&&i.type==="category"&&e.type==="cartesian2d")return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}function MX(r,e,t,i,n,a,o,s){var l,u;a?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?Dt:or)(t,{shape:l},e,n,null);var c=e?r.baseAxis.model:null;(o?Dt:or)(t,{shape:u},c,n)}function bX(r,e){for(var t=0;t0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*n/2,y:i.y+o*n/2,width:i.width-a*n,height:i.height-o*n}},polar:function(r,e,t){var i=r.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function Rme(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function RX(r){return function(e){var t=e?"Arc":"Angle";return function(i){switch(i){case"start":case"insideStart":case"end":case"insideEnd":return i+t;default:return i}}}(r)}function TX(r,e,t,i,n,a,o,s){var l=e.getItemVisual(t,"style");if(s){if(!a.get("roundCap")){var c=r.shape,f=ql(i.getModel("itemStyle"),c,!0);fe(c,f),r.setShape(c)}}else{var u=i.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var h=i.getShallow("cursor");h&&r.attr("cursor",h);var p=s?o?n.r>=n.r0?"endArc":"startArc":n.endAngle>=n.startAngle?"endAngle":"startAngle":o?n.height>=0?"bottom":"top":n.width>=0?"right":"left",d=wr(i);Ir(r,d,{labelFetcher:a,labelDataIndex:t,defaultText:el(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var g=r.getTextContent();if(s&&g){var m=i.get(["label","position"]);r.textConfig.inside=m==="middle"?!0:null,_X(r,m==="outside"?p:m,RX(o),i.get(["label","rotate"]))}yw(g,d,a.getRawValue(t),function(_){return K1(e,_)});var v=i.getModel(["emphasis"]);ar(r,v.get("focus"),v.get("blurScope"),v.get("disabled")),Gr(r,i),Rme(n)&&(r.style.fill="none",r.style.stroke="none",N(r.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function Lme(r,e){var t=r.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var i=r.get(["itemStyle","borderWidth"])||0,n=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(i,n,a)}var Pme=function(){function r(){}return r}(),EX=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="largeBar",i}return e.prototype.getDefaultShape=function(){return new Pme},e.prototype.buildPath=function(t,i){for(var n=i.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c=0?t:null},30,!1);function Dme(r,e,t){for(var i=r.baseDimIdx,n=1-i,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,c=0,f=a.length/3;c=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return o[c]}return-1}function LX(r,e,t){if(us(t,"cartesian2d")){var i=e,n=t.getArea();return{x:r?i.x:n.x,y:r?n.y:i.y,width:r?i.width:n.width,height:r?n.height:i.height}}else{var n=t.getArea(),a=e;return{cx:n.cx,cy:n.cy,r0:r?n.r0:a.r0,r:r?n.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function Ime(r,e,t){var i=r.type==="polar"?yi:Et;return new i({shape:LX(e,t,r),silent:!0,z2:0})}var PX=Tme;function nI(r){r.registerChartView(PX),r.registerSeriesModel(gX),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ot(b1,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,w1("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,gx("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},function(n){e.sortInfo&&n.axis.setCategorySortInfo(e.sortInfo)})})}var DX=Math.PI*2,iT=Math.PI/180;function IX(r,e){return xr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function aI(r,e){var t=IX(r,e),i=r.get("center"),n=r.get("radius");pe(n)||(n=[0,n]);var a=ze(t.width,e.getWidth()),o=ze(t.height,e.getHeight()),s=Math.min(a,o),l=ze(n[0],s/2),u=ze(n[1],s/2),c,f,h=r.coordinateSystem;if(h){var p=h.dataToPoint(i);c=p[0]||0,f=p[1]||0}else pe(i)||(i=[i,i]),c=ze(i[0],a)+t.x,f=ze(i[1],o)+t.y;return{cx:c,cy:f,r0:l,r:u}}function oI(r,e,t){e.eachSeriesByType(r,function(i){var n=i.getData(),a=n.mapDimension("value"),o=IX(i,t),s=aI(i,t),l=s.cx,u=s.cy,c=s.r,f=s.r0,h=-i.get("startAngle")*iT,p=i.get("endAngle"),d=i.get("padAngle")*iT;p=p==="auto"?h-DX:-p*iT;var g=i.get("minAngle")*iT,m=g+d,v=0;n.each(a,function(U){!isNaN(U)&&v++});var _=n.getSum(a),y=Math.PI/(_||v)*2,x=i.get("clockwise"),M=i.get("roseType"),S=i.get("stillShowZeroSum"),w=n.getDataExtent(a);w[0]=0;var T=x?1:-1,C=[h,p],b=T*d/2;u_(C,!x),h=C[0],p=C[1];var E=Math.abs(p-h),I=E,R=0,A=h;if(n.setLayout({viewRect:o,r:c}),n.each(a,function(U,B){var z;if(isNaN(U)){n.setItemLayout(B,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:l,cy:u,r0:f,r:M?NaN:c});return}M!=="area"?z=_===0&&S?y:U*y:z=E/v,zz?(G=A+T*z/2,Y=G):(G=A+b,Y=k-b),n.setItemLayout(B,{angle:z,startAngle:G,endAngle:Y,clockwise:x,cx:l,cy:u,r0:f,r:M?rr(U,w,[f,c]):c}),A=k}),It?v:m,M=Math.abs(y.label.y-t);if(M>=x.maxY){var S=y.label.x-e-y.len2*n,w=i+y.len,T=Math.abs(S)r.unconstrainedWidth?null:p:null;i.setStyle("width",d)}var g=i.getBoundingRect();a.width=g.width;var m=(i.style.margin||0)+2.1;a.height=g.height+m,a.y-=(a.height-f)/2}}}function sI(r){return r.position==="center"}function lI(r){var e=r.getData(),t=[],i,n,a=!1,o=(r.get("minShowLabelAngle")||0)*Nme,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function p(S){S.ignore=!0}function d(S){if(!S.ignore)return!0;for(var w in S.states)if(S.states[w].ignore===!1)return!0;return!1}e.each(function(S){var w=e.getItemGraphicEl(S),T=w.shape,C=w.getTextContent(),b=w.getTextGuideLine(),E=e.getItemModel(S),I=E.getModel("label"),R=I.get("position")||E.get(["emphasis","label","position"]),A=I.get("distanceToLabelLine"),D=I.get("alignTo"),U=ze(I.get("edgeDistance"),u),B=I.get("bleedMargin"),z=E.getModel("labelLine"),k=z.get("length");k=ze(k,u);var G=z.get("length2");if(G=ze(G,u),Math.abs(T.endAngle-T.startAngle)0?"right":"left":J>0?"left":"right"}var xe=Math.PI,Le=0,Ue=I.get("rotate");if(Ct(Ue))Le=Ue*(xe/180);else if(R==="center")Le=0;else if(Ue==="radial"||Ue===!0){var Ne=J<0?-Y+xe:-Y;Le=Ne}else if(Ue==="tangential"&&R!=="outside"&&R!=="outer"){var Ve=Math.atan2(J,Q);Ve<0&&(Ve=xe*2+Ve);var ct=Q>0;ct&&(Ve=xe+Ve),Le=Ve-xe}if(a=!!Le,C.x=V,C.y=K,C.rotation=Le,C.setStyle({verticalAlign:"middle"}),ue){C.setStyle({align:ve});var ne=C.states.select;ne&&(ne.x+=C.x,ne.y+=C.y)}else{var F=C.getBoundingRect().clone();F.applyTransform(C.getComputedTransform());var L=(C.style.margin||0)+2.1;F.y-=L/2,F.height+=L,t.push({label:C,labelLine:b,position:R,len:k,len2:G,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new Nt(J,Q),linePoints:ae,textAlign:ve,labelDistance:A,labelAlignTo:D,edgeDistance:U,bleedMargin:B,rect:F,unconstrainedWidth:F.width,labelStyleWidth:C.style.width})}w.setTextConfig({inside:ue})}}),!a&&r.get("avoidLabelOverlap")&&Ume(t,i,n,l,u,h,c,f);for(var g=0;g0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f=a.r0}},e.type="pie",e}(Yt),OX=zme;function To(r,e,t){e=pe(e)&&{coordDimensions:e}||fe({encodeDefine:r.getEncode()},e);var i=r.getSource(),n=Ks(i,e).dimensions,a=new ri(n,r);return a.initData(i,t),a}var Fme=function(){function r(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return r.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},r.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},r.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},r.prototype.getItemVisual=function(e,t){var i=this._getDataWithEncodedVisual();return i.getItemVisual(e,t)},r}(),Zl=Fme;var Bme=vt(),kme=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Zl(Be(this.getData,this),Be(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return To(this,{coordDimensions:["value"],encodeDefaulter:ot(fv,this)})},e.prototype.getDataParams=function(t){var i=this.getData(),n=Bme(i),a=n.seats;if(!a){var o=[];i.each(i.mapDimension("value"),function(l){o.push(l)}),a=n.seats=KL(o,i.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,t);return s.percent=a[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){yo(t,"labelLine",["show"]);var i=t.labelLine,n=t.emphasis.labelLine;i.show=i.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(jt),zX=kme;function uI(r){return{seriesType:r,reset:function(e,t){var i=e.getData();i.filterSelf(function(n){var a=i.mapDimension("value"),o=i.get(a,n);return!(Ct(o)&&!isNaN(o)&&o<0)})}}}function cI(r){r.registerChartView(OX),r.registerSeriesModel(zX),n1("pie",r.registerAction),r.registerLayout(ot(oI,"pie")),r.registerProcessor(rl("pie")),r.registerProcessor(uI("pie"))}var Vme=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,i){return hn(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(t,i,n){return n.point(i.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(jt),FX=Vme;var BX=4,Gme=function(){function r(){}return r}(),Hme=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i._off=0,i.hoverDataIdx=-1,i}return e.prototype.getDefaultShape=function(){return new Gme},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,i){var n=i.points,a=i.size,o=this.symbolProxy,s=o.shape,l=t.getContext?t.getContext():t,u=l&&a[0]=0;u--){var c=u*2,f=a[c]-s/2,h=a[c+1]-l/2;if(t>=f&&i>=h&&t<=f+s&&i<=h+l)return u}return-1},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect();if(t=n[0],i=n[1],a.contain(t,i)){var o=this.hoverDataIdx=this.findDataIndex(t,i);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var i=this.shape,n=i.points,a=i.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,f=-1/0,h=0;h=0&&(u.dataIndex=f+(e.startIndex||0))})},r.prototype.remove=function(){this._clear()},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),kX=Wme;var Xme=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,i,n){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,i,n){this._symbolDraw.incrementalUpdate(t,i.getData(),{clipShape:this._getClipShape(i)}),this._finished=t.end===i.getData().count()},e.prototype.updateTransform=function(t,i,n){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=tl("").reset(t,i,n);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var i=t.coordinateSystem;return i&&i.getArea&&i.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,i){var n=this._symbolDraw,a=i.pipelineContext,o=a.large;return(!n||o!==this._isLargeDraw)&&(n&&n.remove(),n=this._symbolDraw=o?new kX:new Xl,this._isLargeDraw=o,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,i){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Yt),VX=Xme;var Yme=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Pt),GX=Yme;var nT=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ar).models[0]},e.type="cartesian2dAxis",e}(Pt);br(nT,Vl);var HX={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},qme=_t({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},HX),fI=_t({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},HX),Zme=_t({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},fI),jme=Ye({logBase:10},fI),aT={category:qme,value:fI,time:Zme,log:jme};var WX={value:1,category:1,time:1,log:1};function il(r,e,t,i){N(WX,function(n,a){var o=_t(_t({},aT[a],!0),i,!0),s=function(l){Z(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=e+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,f){var h=Rf(this),p=h?is(c):{},d=f.getTheme();_t(c,d.get(a+"Axis")),_t(c,this.getDefaultOption()),c.type=XX(c),h&&Va(c,p,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=ix.createByAxisModel(this))},u.prototype.getCategories=function(c){var f=this.option;if(f.type==="category")return c?f.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(t);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(e+"Axis",XX)}function XX(r){return r.type||(r.data?"category":"value")}var Kme=function(){function r(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return r.prototype.getAxis=function(e){return this._axes[e]},r.prototype.getAxes=function(){return de(this._dimList,function(e){return this._axes[e]},this)},r.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Wt(this.getAxes(),function(t){return t.scale.type===e})},r.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},r}(),YX=Kme;var oT=["x","y"];function qX(r){return r.type==="interval"||r.type==="time"}var Jme=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=oT,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!qX(t)||!qX(i))){var n=t.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,f=(s[1]-o[1])/u,h=o[0]-n[0]*c,p=o[1]-a[0]*f,d=this._transform=[c,0,0,f,h,p];this._invTransform=qo([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,i){var n=this.dataToPoint(t),a=this.dataToPoint(i),o=this.getArea(),s=new lt(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},e.prototype.dataToPoint=function(t,i,n){n=n||[];var a=t[0],o=t[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return fi(n,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},e.prototype.clampData=function(t,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(t[0]),u=a.parse(t[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},e.prototype.pointToData=function(t,i){var n=[];if(this._invTransform)return fi(n,t,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(t[0]),i),n[1]=o.coordToData(o.toLocalCoord(t[1]),i),n},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-t,o=Math.min(n[0],n[1])-t,s=Math.max(i[0],i[1])-a+t,l=Math.max(n[0],n[1])-o+t;return new lt(a,o,s,l)},e}(YX),ZX=Jme;var $me=function(r){Z(e,r);function e(t,i,n,a,o){var s=r.call(this,t,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),t&&i[0]>i[1]&&i.reverse(),i},e.prototype.pointToData=function(t,i){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),i)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(pn),jX=$me;function yx(r,e,t){t=t||{};var i=r.coordinateSystem,n=e.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,c=i.getRect(),f=[c.x,c.x+c.width,c.y,c.y+c.height],h={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,d=u==="x"?[f[2]-p,f[3]+p]:[f[0]-p,f[1]+p];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));d[h.onZero]=Math.max(Math.min(g,d[1]),d[0])}a.position=[u==="y"?d[h[l]]:f[0],u==="x"?d[h[l]]:f[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var m={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=m[s],a.labelOffset=o?d[h[s]]-d[h.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),Br(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var v=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-v:v,a.z2=1,a}function hI(r){return r.get("coordinateSystem")==="cartesian2d"}function pI(r){var e={xAxisModel:null,yAxisModel:null};return N(e,function(t,i){var n=i.replace(/Model$/,""),a=r.getReferringComponents(n,Ar).models[0];e[i]=a}),e}var dI=Math.log;function sT(r,e,t){var i=Ya.prototype,n=i.getTicks.call(t),a=i.getTicks.call(t,!0),o=n.length-1,s=i.getInterval.call(t),l=m2(r,e),u=l.extent,c=l.fixMin,f=l.fixMax;if(r.type==="log"){var h=dI(r.base);u=[dI(u[0])/h,dI(u[1])/h]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:c,fixMax:f});var p=i.getExtent.call(r);c&&(u[0]=p[0]),f&&(u[1]=p[1]);var d=i.getInterval.call(r),g=u[0],m=u[1];if(c&&f)d=(m-g)/o;else if(c)for(m=u[0]+d*o;mu[0]&&isFinite(g)&&isFinite(u[0]);)d=S1(d),g=u[1]-d*o;else{var v=r.getTicks().length-1;v>o&&(d=S1(d));var _=d*o;m=Math.ceil(u[1]/d)*d,g=Er(m-_),g<0&&u[0]>=0?(g=0,m=Er(_)):m>0&&u[1]<=0&&(m=0,g=-Er(_))}var y=(n[0].value-a[0].value)/s,x=(n[o].value-a[o].value)/s;if(i.setExtent.call(r,g+d*y,m+d*x),i.setInterval.call(r,d),(y||x)&&i.setNiceExtent.call(r,g+d,m-d),0)var M}var Qme=function(){function r(e,t,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=oT,this._initCartesian(e,t,i),this.model=e}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model);function n(o){var s,l=bt(o),u=l.length;if(u){for(var c=[],f=u-1;f>=0;f--){var h=+l[f],p=o[h],d=p.model,g=p.scale;nx(g)&&d.get("alignTicks")&&d.get("interval")==null?c.push(p):(kl(g,d),nx(g)&&(s=p))}c.length&&(s||(s=c.pop(),kl(s.scale,s.model)),N(c,function(m){sT(m.scale,m.model,s.scale)}))}}n(i.x),n(i.y);var a={};N(i.x,function(o){JX(i,"y",o,a)}),N(i.y,function(o){JX(i,"x",o,a)}),this.resize(this.model,t)},r.prototype.resize=function(e,t,i){var n=e.getBoxLayoutParams(),a=!i&&e.get("containLabel"),o=xr(n,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(N(s,function(u){if(!u.model.get(["axisLabel","inside"])){var c=u8(u);if(c){var f=u.isHorizontal()?"height":"width",h=u.model.get(["axisLabel","margin"]);o[f]-=c[f]+h,u.position==="top"?o.y+=c.height+h:u.position==="left"&&(o.x+=c.width+h)}}}),l()),N(this._coordsList,function(u){u.calcAffineTransform()});function l(){N(s,function(u){var c=u.isHorizontal(),f=c?[0,o.width]:[0,o.height],h=u.inverse?1:0;u.setExtent(f[h],f[1-h]),eve(u,c?o.x:o.y)})}},r.prototype.getAxis=function(e,t){var i=this._axesMap[e];if(i!=null)return i[t||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var i="x"+e+"y"+t;return this._coordsMap[i]}qe(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,a=this._coordsList;n0?"top":"bottom",a="center"):xu(n-Xf)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},r.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},r}(),e9={axisLine:function(r,e,t,i){var n=e.get(["axisLine","show"]);if(n==="auto"&&r.handleAutoShown&&(n=r.handleAutoShown("axisLine")),!!n){var a=e.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(fi(s,s,o),fi(l,l,o));var c=fe({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),f=new Jr({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});Cu(f.shape,f.style.lineWidth),f.anid="line",t.add(f);var h=e.get(["axisLine","symbol"]);if(h!=null){var p=e.get(["axisLine","symbolSize"]);Ce(h)&&(h=[h,h]),(Ce(p)||Ct(p))&&(p=[p,p]);var d=bo(e.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];N([{rotate:r.rotation+Math.PI/2,offset:d[0],r:0},{rotate:r.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(v,_){if(h[_]!=="none"&&h[_]!=null){var y=Sr(h[_],-g/2,-m/2,g,m,c.stroke,!0),x=v.r+v.offset,M=u?l:s;y.attr({rotation:v.rotate,x:M[0]+x*Math.cos(r.rotation),y:M[1]-x*Math.sin(r.rotation),silent:!0,z2:11}),t.add(y)}})}}},axisTickLabel:function(r,e,t,i){var n=ive(t,i,e,r),a=ave(t,i,e,r);if(rve(e,a,n),nve(t,i,e,r.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=z1(de(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));B1(o)}},axisName:function(r,e,t,i){var n=Br(r.axisName,e.get("name"));if(n){var a=e.get("nameLocation"),o=r.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),c=u[0]>u[1]?-1:1,f=[a==="start"?u[0]-c*l:a==="end"?u[1]+c*l:(u[0]+u[1])/2,r9(a)?r.labelOffset+o*l:0],h,p=e.get("nameRotate");p!=null&&(p=p*Xf/180);var d;r9(a)?h=td.innerTextLayout(r.rotation,p??r.rotation,o):(h=tve(r.rotation,a,p||0,u),d=r.axisNameAvailableWidth,d!=null&&(d=Math.abs(d/Math.sin(h.rotation)),!isFinite(d)&&(d=null)));var g=s.getFont(),m=e.get("nameTruncate",!0)||{},v=m.ellipsis,_=Br(r.nameTruncateMaxWidth,m.maxWidth,d),y=new Lt({x:f[0],y:f[1],rotation:h.rotation,silent:td.isLabelSilent(e),style:fr(s,{text:n,font:g,overflow:"truncate",width:_,ellipsis:v,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||h.textAlign,verticalAlign:s.get("verticalAlign")||h.textVerticalAlign}),z2:1});if(Gs({el:y,componentModel:e,itemName:n}),y.__fullText=n,y.anid="name",e.get("triggerEvent")){var x=td.makeAxisEventDataBase(e);x.targetType="axisName",x.name=n,rt(y).eventData=x}i.add(y),y.updateTransform(),t.add(y),y.decomposeTransform()}}};function tve(r,e,t,i){var n=r_(t-r),a,o,s=i[0]>i[1],l=e==="start"&&!s||e!=="start"&&s;return xu(n-Xf/2)?(o=l?"bottom":"top",a="center"):xu(n-Xf*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",nXf/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function rve(r,e,t){if(!D1(r.axis)){var i=r.get(["axisLabel","showMinLabel"]),n=r.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=t[0],c=t[1],f=t[t.length-1],h=t[t.length-2];i===!1?(cs(a),cs(u)):t9(a,o)&&(i?(cs(o),cs(c)):(cs(a),cs(u))),n===!1?(cs(s),cs(f)):t9(l,s)&&(n?(cs(l),cs(h)):(cs(s),cs(f)))}}function cs(r){r&&(r.ignore=!0)}function t9(r,e){var t=r&&r.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(!(!t||!i)){var n=ff([]);return Pa(n,n,-r.rotation),t.applyTransform(La([],n,r.getLocalTransform())),i.applyTransform(La([],n,e.getLocalTransform())),t.intersect(i)}}function r9(r){return r==="middle"||r==="center"}function i9(r,e,t,i,n){for(var a=[],o=[],s=[],l=0;l=0||r===e}function a9(r){var e=lT(r);if(e){var t=e.axisPointerModel,i=e.axis.scale,n=t.option,a=t.get("status"),o=t.get("value");o!=null&&(o=i.parse(o));var s=gI(t);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0&&!d.min?d.min=0:d.min!=null&&d.min<0&&!d.max&&(d.max=0);var g=l;d.color!=null&&(g=Ye({color:d.color},l));var m=_t(Qe(d),{boundaryGap:t,splitNumber:i,scale:n,axisLine:a,axisTick:o,axisLabel:s,name:d.text,showName:u,nameLocation:"end",nameGap:f,nameTextStyle:g,triggerEvent:h},!1);if(Ce(c)){var v=m.name;m.name=c.replace("{value}",v??"")}else He(c)&&(m.name=c(m.name,m));var _=new Zt(m,null,this.ecModel);return br(_,Vl.prototype),_.mainType="radar",_.componentIndex=this.componentIndex,_},this);this._indicatorModels=p},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:_t({lineStyle:{color:"#bbb"}},_x.axisLine),axisLabel:hT(_x.axisLabel,!1),axisTick:hT(_x.axisTick,!1),splitLine:hT(_x.splitLine,!0),splitArea:hT(_x.splitArea,!0),indicator:[]},e}(Pt),m9=gve;var yve=["axisLine","axisTickLabel","axisName"],_ve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var i=t.coordinateSystem,n=i.getIndicatorAxes(),a=de(n,function(o){var s=o.model.get("showName")?o.name:"",l=new Cn(o.model,{axisName:s,position:[i.cx,i.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});N(a,function(o){N(yve,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var i=t.coordinateSystem,n=i.getIndicatorAxes();if(!n.length)return;var a=t.get("shape"),o=t.getModel("splitLine"),s=t.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),f=s.get("show"),h=l.get("color"),p=u.get("color"),d=pe(h)?h:[h],g=pe(p)?p:[p],m=[],v=[];function _(D,U,B){var z=B%U.length;return D[z]=D[z]||[],z}if(a==="circle")for(var y=n[0].getTicksCoords(),x=i.cx,M=i.cy,S=0;S3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;AI(this,"zoom","zoomOnMouseWheel",t,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(n){var f=Math.abs(a),h=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);AI(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!TI(this._zr,"globalPan")){var i=t.pinchScale>1?1.1:1/1.1;AI(this,"zoom",null,t,{scale:i,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(Pi);function AI(r,e,t,i,n){r.pointerChecker&&r.pointerChecker(i,n.originX,n.originY)&&(Ra(i.event),w9(r,e,t,i,n))}function w9(r,e,t,i,n){n.isAvailableBehavior=Be(pT,null,t,i),r.trigger(e,n)}function pT(r,e,t){var i=t[r];return!r||i&&(!Ce(i)||e.event[i+"Key"])}var jl=Mve;function Rv(r,e,t){var i=r.target;i.x+=e,i.y+=t,i.dirty()}function Lv(r,e,t,i){var n=r.target,a=r.zoomLimit,o=r.zoom=r.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/r.zoom;r.zoom=o,n.x-=(t-n.x)*(u-1),n.y-=(i-n.y)*(u-1),n.scaleX*=u,n.scaleY*=u,n.dirty()}var bve={axisPointer:1,tooltip:1,brush:1};function Yf(r,e,t){var i=e.getComponentByElement(r.topTarget),n=i&&i.coordinateSystem;return i&&i!==t&&!bve.hasOwnProperty(i.mainType)&&n&&n.model!==t}function dT(r){if(Ce(r)){var e=new DOMParser;r=e.parseFromString(r,"text/xml")}var t=r;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var RI,mT={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},T9=bt(mT),vT={"alignment-baseline":"textBaseline","stop-color":"stopColor"},E9=bt(vT),wve=function(){function r(){this._defs={},this._root=null}return r.prototype.parse=function(e,t){t=t||{};var i=dT(e);this._defsUsePending=[];var n=new Ze;this._root=n;var a=[],o=i.getAttribute("viewBox")||"",s=parseFloat(i.getAttribute("width")||t.width),l=parseFloat(i.getAttribute("height")||t.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),Eo(i,n,null,!0,!1);for(var u=i.firstChild;u;)this._parseNode(u,n,a,null,!1,!1),u=u.nextSibling;Ave(this._defs,this._defsUsePending),this._defsUsePending=[];var c,f;if(o){var h=gT(o);h.length>=4&&(c={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(c&&s!=null&&l!=null&&(f=PI(c,{x:0,y:0,width:s,height:l}),!t.ignoreViewBox)){var p=n;n=new Ze,n.add(p),p.scaleX=p.scaleY=f.scale,p.x=f.x,p.y=f.y}return!t.ignoreRootClip&&s!=null&&l!=null&&n.setClipPath(new Et({shape:{x:0,y:0,width:s,height:l}})),{root:n,width:s,height:l,viewBoxRect:c,viewBoxTransform:f,named:a}},r.prototype._parseNode=function(e,t,i,n,a,o){var s=e.nodeName.toLowerCase(),l,u=n;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=t;else{if(!a){var c=RI[s];if(c&&tt(RI,s)){l=c.call(this,e,t);var f=e.getAttribute("name");if(f){var h={name:f,namedFrom:null,svgNodeTagLower:s,el:l};i.push(h),s==="g"&&(u=h)}else n&&i.push({name:n.name,namedFrom:n,svgNodeTagLower:s,el:l});t.add(l)}}var p=A9[s];if(p&&tt(A9,s)){var d=p.call(this,e),g=e.getAttribute("id");g&&(this._defs[g]=d)}}if(l&&l.isGroup)for(var m=e.firstChild;m;)m.nodeType===1?this._parseNode(m,l,i,u,a,o):m.nodeType===3&&o&&this._parseText(m,l),m=m.nextSibling},r.prototype._parseText=function(e,t){var i=new Mu({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});fs(t,i),Eo(e,i,this._defsUsePending,!1,!1),Tve(i,t);var n=i.style,a=n.fontSize;a&&a<9&&(n.fontSize=9,i.scaleX*=a/9,i.scaleY*=a/9);var o=(n.fontSize||n.fontFamily)&&[n.fontStyle,n.fontWeight,(n.fontSize||12)+"px",n.fontFamily||"sans-serif"].join(" ");n.font=o;var s=i.getBoundingRect();return this._textX+=s.width,t.add(i),i},r.internalField=function(){RI={g:function(e,t){var i=new Ze;return fs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i},rect:function(e,t){var i=new Et;return fs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),i.silent=!0,i},circle:function(e,t){var i=new ua;return fs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),i.silent=!0,i},line:function(e,t){var i=new Jr;return fs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),i.silent=!0,i},ellipse:function(e,t){var i=new g_;return fs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),i.silent=!0,i},polygon:function(e,t){var i=e.getAttribute("points"),n;i&&(n=L9(i));var a=new ti({shape:{points:n||[]},silent:!0});return fs(t,a),Eo(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var i=e.getAttribute("points"),n;i&&(n=L9(i));var a=new Qr({shape:{points:n||[]},silent:!0});return fs(t,a),Eo(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var i=new Ur;return fs(t,i),Eo(e,i,this._defsUsePending,!1,!1),i.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),i.silent=!0,i},text:function(e,t){var i=e.getAttribute("x")||"0",n=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(i)+parseFloat(a),this._textY=parseFloat(n)+parseFloat(o);var s=new Ze;return fs(t,s),Eo(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,t){var i=e.getAttribute("x"),n=e.getAttribute("y");i!=null&&(this._textX=parseFloat(i)),n!=null&&(this._textY=parseFloat(n));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new Ze;return fs(t,s),Eo(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,t){var i=e.getAttribute("d")||"",n=lw(i);return fs(t,n),Eo(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}}(),r}(),A9={lineargradient:function(r){var e=parseInt(r.getAttribute("x1")||"0",10),t=parseInt(r.getAttribute("y1")||"0",10),i=parseInt(r.getAttribute("x2")||"10",10),n=parseInt(r.getAttribute("y2")||"0",10),a=new zl(e,t,i,n);return C9(r,a),R9(r,a),a},radialgradient:function(r){var e=parseInt(r.getAttribute("cx")||"0",10),t=parseInt(r.getAttribute("cy")||"0",10),i=parseInt(r.getAttribute("r")||"0",10),n=new hw(e,t,i);return C9(r,n),R9(r,n),n}};function C9(r,e){var t=r.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function R9(r,e){for(var t=r.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var i=t.getAttribute("offset"),n=void 0;i&&i.indexOf("%")>0?n=parseInt(i,10)/100:i?n=parseFloat(i):n=0;var a={};I9(t,a,a);var o=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:n,color:o})}t=t.nextSibling}}function fs(r,e){r&&r.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),Ye(e.__inheritedStyle,r.__inheritedStyle))}function L9(r){for(var e=gT(r),t=[],i=0;i0;a-=2){var o=i[a],s=i[a-1],l=gT(o);switch(n=n||wi(),s){case"translate":_n(n,n,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Lm(n,n,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Pa(n,n,-parseFloat(l[0])*LI,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*LI);La(n,[1,0,u,1,0,0],n);break;case"skewY":var c=Math.tan(parseFloat(l[0])*LI);La(n,[1,c,0,1,0,0],n);break;case"matrix":n[0]=parseFloat(l[0]),n[1]=parseFloat(l[1]),n[2]=parseFloat(l[2]),n[3]=parseFloat(l[3]),n[4]=parseFloat(l[4]),n[5]=parseFloat(l[5]);break}}e.setLocalTransform(n)}}var D9=/([^\s:;]+)\s*:\s*([^:;]+)/g;function I9(r,e,t){var i=r.getAttribute("style");if(i){D9.lastIndex=0;for(var n;(n=D9.exec(i))!=null;){var a=n[1],o=tt(mT,a)?mT[a]:null;o&&(e[o]=n[2]);var s=tt(vT,a)?vT[a]:null;s&&(t[s]=n[2])}}}function Pve(r,e,t){for(var i=0;i0,m={api:i,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:g,isGeo:o,transformInfoRaw:h};l.resourceType==="geoJSON"?this._buildGeoJSON(m):l.resourceType==="geoSVG"&&this._buildSVG(m),this._updateController(e,t,i),this._updateMapSelectHandler(e,u,i,n)},r.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=ke(),i=ke(),n=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function c(p,d){return d&&(p=d(p)),p&&[p[0]*a.scaleX+a.x,p[1]*a.scaleY+a.y]}function f(p){for(var d=[],g=!u&&l&&l.project,m=0;m=0)&&(h=n);var p=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Ir(e,wr(i),{labelFetcher:h,labelDataIndex:f,defaultText:t},p);var d=e.getTextContent();if(d&&(X9(d).ignore=d.ignore,e.textConfig&&o)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function V9(r,e,t,i,n,a){r.data?r.data.setItemGraphicEl(a,e):rt(e).eventData={componentType:"geo",componentIndex:n.componentIndex,geoIndex:n.componentIndex,name:t,region:i&&i.option||{}}}function G9(r,e,t,i,n){r.data||Gs({el:e,componentModel:n,itemName:t,itemTooltipOption:i.get("tooltip")})}function H9(r,e,t,i,n){e.highDownSilentOnTouch=!!n.get("selectedMode");var a=i.getModel("emphasis"),o=a.get("focus");return ar(e,o,a.get("blurScope"),a.get("disabled")),r.isGeo&&v4(e,n,t),o}function W9(r,e,t){var i=[],n;function a(){n=[]}function o(){n.length&&(i.push(n),n=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&n.push([l,u])},sphere:function(){}});return!t&&s.polygonStart(),N(r,function(l){s.lineStart();for(var u=0;u-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(jt),q9=Xve;function Yve(r,e){var t={};return N(r,function(i){i.each(i.mapDimension("value"),function(n,a){var o="ec-"+i.getName(a);t[o]=t[o]||[],isNaN(n)||t[o].push(n)})}),r[0].map(r[0].mapDimension("value"),function(i,n){for(var a="ec-"+r[0].getName(n),o=0,s=1/0,l=-1/0,u=t[a].length,c=0;c1?(x.width=y,x.height=y/m):(x.height=y,x.width=y*m),x.y=_[1]-x.height/2,x.x=_[0]-x.width/2;else{var M=r.getBoxLayoutParams();M.aspect=m,x=xr(M,{width:d,height:g})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(r.get("center"),e),this.setZoom(r.get("zoom"))}function jve(r,e){N(e.get("geoCoord"),function(t,i){r.addGeoCoord(i,t)})}var Kve=function(){function r(){this.dimensions=BI}return r.prototype.create=function(e,t){var i=[];function n(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}e.eachComponent("geo",function(o,s){var l=o.get("map"),u=new kI(l+s,l,fe({nameMap:o.get("nameMap")},n(o)));u.zoomLimit=o.get("scaleLimit"),i.push(u),o.coordinateSystem=u,u.model=o,u.resize=$9,u.resize(o,t)}),e.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=i[l]}});var a={};return e.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),N(a,function(o,s){var l=de(o,function(c){return c.get("nameMap")}),u=new kI(s,s,fe({nameMap:bm(l)},n(o[0])));u.zoomLimit=Br.apply(null,de(o,function(c){return c.get("scaleLimit")})),i.push(u),u.resize=$9,u.resize(o[0],t),N(o,function(c){c.coordinateSystem=u,jve(u,c)})}),i},r.prototype.getFilledRegions=function(e,t,i,n){for(var a=(e||[]).slice(),o=ke(),s=0;s=0;o--){var s=n[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},t.push(s)}}function i7(r,e){var t=r.isExpand?r.children:[],i=r.parentNode.children,n=r.hierNode.i?i[r.hierNode.i-1]:null;if(t.length){tge(r);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;n?(r.hierNode.prelim=n.hierNode.prelim+e(r,n),r.hierNode.modifier=r.hierNode.prelim-a):r.hierNode.prelim=a}else n&&(r.hierNode.prelim=n.hierNode.prelim+e(r,n));r.parentNode.hierNode.defaultAncestor=rge(r,n,r.parentNode.hierNode.defaultAncestor||i[0],e)}function n7(r){var e=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:e},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function WI(r){return arguments.length?r:age}function nd(r,e){return r-=Math.PI/2,{x:e*Math.cos(r),y:e*Math.sin(r)}}function a7(r,e){return xr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function tge(r){for(var e=r.children,t=e.length,i=0,n=0;--t>=0;){var a=e[t];a.hierNode.prelim+=i,a.hierNode.modifier+=i,n+=a.hierNode.change,i+=a.hierNode.shift+n}}function rge(r,e,t,i){if(e){for(var n=r,a=r,o=a.parentNode.children[0],s=e,l=n.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,f=s.hierNode.modifier;s=GI(s),a=HI(a),s&&a;){n=GI(n),o=HI(o),n.hierNode.ancestor=r;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+i(s,a);h>0&&(nge(ige(s,r,t),r,h),u+=h,l+=h),f+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=n.hierNode.modifier,c+=o.hierNode.modifier}s&&!GI(n)&&(n.hierNode.thread=s,n.hierNode.modifier+=f-l),a&&!HI(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,t=r)}return t}function GI(r){var e=r.children;return e.length&&r.isExpand?e[e.length-1]:r.hierNode.thread}function HI(r){var e=r.children;return e.length&&r.isExpand?e[0]:r.hierNode.thread}function ige(r,e,t){return r.hierNode.ancestor.parentNode===e.parentNode?r.hierNode.ancestor:t}function nge(r,e,t){var i=t/(e.hierNode.i-r.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,r.hierNode.change+=i}function age(r,e){return r.parentNode===e.parentNode?1:2}var oge=function(){function r(){this.parentPoint=[],this.childPoints=[]}return r}(),sge=function(r){Z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new oge},e.prototype.buildPath=function(t,i){var n=i.childPoints,a=n.length,o=i.parentPoint,s=n[0],l=n[a-1];if(a===1){t.moveTo(o[0],o[1]),t.lineTo(s[0],s[1]);return}var u=i.orient,c=u==="TB"||u==="BT"?0:1,f=1-c,h=ze(i.forkPosition,1),p=[];p[c]=o[c],p[f]=o[f]+(l[f]-o[f])*h,t.moveTo(o[0],o[1]),t.lineTo(p[0],p[1]),t.moveTo(s[0],s[1]),p[c]=s[c],t.lineTo(p[0],p[1]),p[c]=l[c],t.lineTo(p[0],p[1]),t.lineTo(l[0],l[1]);for(var d=1;d_.x,M||(x=x-Math.PI));var w=M?"left":"right",T=s.getModel("label"),C=T.get("rotate"),b=C*(Math.PI/180),E=m.getTextContent();E&&(m.setTextConfig({position:T.get("position")||w,rotation:C==null?-x:b,origin:"center"}),E.setStyle("verticalAlign","middle"))}var I=s.get(["emphasis","focus"]),R=I==="relative"?rp(o.getAncestorsIndices(),o.getDescendantIndices()):I==="ancestor"?o.getAncestorsIndices():I==="descendant"?o.getDescendantIndices():null;R&&(rt(t).focus=R),uge(n,o,c,t,d,p,g,i),t.__edge&&(t.onHoverStateChange=function(A){if(A!=="blur"){var D=o.parentNode&&r.getItemGraphicEl(o.parentNode.dataIndex);D&&D.hoverState===Lp||Pp(t.__edge,A)}})}function uge(r,e,t,i,n,a,o,s){var l=e.getModel(),u=r.get("edgeShape"),c=r.get("layout"),f=r.getOrient(),h=r.get(["lineStyle","curveness"]),p=r.get("edgeForkPosition"),d=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(g||(g=i.__edge=new Np({shape:XI(c,f,h,n,n)})),Dt(g,{shape:XI(c,f,h,a,o)},r));else if(u==="polyline"&&c==="orthogonal"&&e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var m=e.children,v=[],_=0;_t&&(t=n.height)}this.height=t+1},r.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,i=t.data.getItemModel(this.dataIndex);return i.getModel(e)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},r.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var i=t.getData().tree.root,n=r.targetNode;if(Ce(n)&&(n=i.getNodeById(n)),n&&i.contains(n))return{node:n};var a=r.targetNodeId;if(a!=null&&(n=i.getNodeById(a)))return{node:n}}}function qI(r){for(var e=[];r;)r=r.parentNode,r&&e.push(r);return e.reverse()}function Iv(r,e){var t=qI(r);return dt(t,e)>=0}function Zf(r,e){for(var t=[];r;){var i=r.dataIndex;t.push({name:r.name,dataIndex:i,value:e.getRawValue(i)}),r=r.parentNode}return t.reverse(),t}var xge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var i={name:t.name,children:t.data},n=t.leaves||{},a=new Zt(n,this,this.ecModel),o=Dv.createTree(i,this,s);function s(f){f.wrapMethod("getItemModel",function(h,p){var d=o.getNodeByDataIndex(p);return d&&d.children.length&&d.isExpand||(h.parentModel=a),h})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var u=t.expandAndCollapse,c=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var h=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=h&&h.collapsed!=null?!h.collapsed:f.depth<=c}),o.data},e.prototype.getOrient=function(){var t=this.get("orient");return t==="horizontal"?t="LR":t==="vertical"&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,i,n){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(t),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return Or("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treeAncestors=Zf(n,this),i.collapsed=!n.isExpand,i},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(jt),p7=xge;function d7(r,e,t){for(var i=[r],n=[],a;a=i.pop();)if(n.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)t.push(n[a])}}function jI(r,e){r.eachSeriesByType("tree",function(t){Sge(t,e)})}function Sge(r,e){var t=a7(r,e);r.layoutInfo=t;var i=r.get("layout"),n=0,a=0,o=null;i==="radial"?(n=2*Math.PI,a=Math.min(t.height,t.width)/2,o=WI(function(y,x){return(y.parentNode===x.parentNode?1:2)/y.depth})):(n=t.width,a=t.height,o=WI());var s=r.getData().tree.root,l=s.children[0];if(l){r7(s),d7(l,i7,o),s.hierNode.modifier=-l.hierNode.prelim,Nv(l,n7);var u=l,c=l,f=l;Nv(l,function(y){var x=y.getLayout().x;xc.getLayout().x&&(c=y),y.depth>f.depth&&(f=y)});var h=u===c?1:o(u,c)/2,p=h-u.getLayout().x,d=0,g=0,m=0,v=0;if(i==="radial")d=n/(c.getLayout().x+h+p),g=a/(f.depth-1||1),Nv(l,function(y){m=(y.getLayout().x+p)*d,v=(y.depth-1)*g;var x=nd(m,v);y.setLayout({x:x.x,y:x.y,rawX:m,rawY:v},!0)});else{var _=r.getOrient();_==="RL"||_==="LR"?(g=a/(c.getLayout().x+h+p),d=n/(f.depth-1||1),Nv(l,function(y){v=(y.getLayout().x+p)*g,m=_==="LR"?(y.depth-1)*d:n-(y.depth-1)*d,y.setLayout({x:m,y:v},!0)})):(_==="TB"||_==="BT")&&(d=n/(c.getLayout().x+h+p),g=a/(f.depth-1||1),Nv(l,function(y){m=(y.getLayout().x+p)*d,v=_==="TB"?(y.depth-1)*g:a-(y.depth-1)*g,y.setLayout({x:m,y:v},!0)}))}}}function KI(r){r.eachSeriesByType("tree",function(e){var t=e.getData(),i=t.tree;i.eachNode(function(n){var a=n.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=t.ensureUniqueItemVisual(n.dataIndex,"style");fe(s,o)})})}function m7(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var n=e.dataIndex,a=i.getData().tree,o=a.getNodeByDataIndex(n);o.isExpand=!o.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,i){t.eachComponent({mainType:"series",subType:"tree",query:e},function(n){var a=n.coordinateSystem,o=Pv(a,e,void 0,i);n.setCenter&&n.setCenter(o.center),n.setZoom&&n.setZoom(o.zoom)})})}function JI(r){r.registerChartView(f7),r.registerSeriesModel(p7),r.registerLayout(jI),r.registerVisual(KI),m7(r)}var v7=["treemapZoomToNode","treemapRender","treemapMove"];function g7(r){for(var e=0;e1;)a=a.parentNode;var o=D_(r.ecModel,a.name||a.dataIndex+"",i);n.setVisual("decal",o)})}var Mge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,i){var n={name:t.name,children:t.data};y7(n);var a=t.levels||[],o=this.designatedVisualItemStyle={},s=new Zt({itemStyle:o},this,i);a=t.levels=bge(a,i);var l=de(a||[],function(f){return new Zt(f,s,i)},this),u=Dv.createTree(n,this,c);function c(f){f.wrapMethod("getItemModel",function(h,p){var d=u.getNodeByDataIndex(p),g=d?l[d.depth]:null;return h.parentModel=g||s,h})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return Or("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treeAncestors=Zf(n,this),i.treePathInfo=i.treeAncestors,i},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},fe(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var i=this._idIndexMap;i||(i=this._idIndexMap=ke(),this._idIndexMapCount=0);var n=i.get(t);return n==null&&i.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var i=this.getRawData().tree.root;(!t||t!==i&&!i.contains(t))&&(this._viewRoot=i)},e.prototype.enableAriaDecal=function(){Mx(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"\u25B6",zoomToNodeRatio:.32*.32,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(jt);function y7(r){var e=0;N(r.children,function(i){y7(i);var n=i.value;pe(n)&&(n=n[0]),e+=n});var t=r.value;pe(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),pe(r.value)?r.value[0]=t:r.value=t}function bge(r,e){var t=$t(e.get("color")),i=$t(e.get(["aria","decal","decals"]));if(t){r=r||[];var n,a;N(r,function(s){var l=new Zt(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(n=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=r[0]||(r[0]={});return n||(o.color=t.slice()),!a&&i&&(o.decal=i.slice()),r}}var _7=Mge;var wge=8,x7=8,$I=5,Tge=function(){function r(e){this.group=new Ze,e.add(this.group)}return r.prototype.render=function(e,t,i,n){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!i)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),f={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,f,u),this._renderContent(e,f,s,l,u,c,n),Cf(o,f.pos,f.box)}},r.prototype._prepare=function(e,t,i){for(var n=e;n;n=n.parentNode){var a=qr(n.getModel().get("name"),""),o=i.getTextRect(a),s=Math.max(o.width+wge*2,t.emptyItemWidth);t.totalWidth+=s+x7,t.renderList.push({node:n,text:a,width:s})}},r.prototype._renderContent=function(e,t,i,n,a,o,s){for(var l=0,u=t.emptyItemWidth,c=e.get(["breadcrumb","height"]),f=x5(t.pos,t.box),h=t.totalWidth,p=t.renderList,d=n.getModel("itemStyle").getItemStyle(),g=p.length-1;g>=0;g--){var m=p[g],v=m.node,_=m.width,y=m.text;h>f.width&&(h-=_-u,_=u,y=null);var x=new ti({shape:{points:Ege(l,0,_,c,g===p.length-1,g===0)},style:Ye(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new Lt({style:fr(a,{text:y})}),textConfig:{position:"inside"},z2:bu*1e4,onclick:ot(s,v)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=fr(o,{text:y}),x.ensureState("emphasis").style=d,ar(x,n.get("focus"),n.get("blurScope"),n.get("disabled")),this.group.add(x),Age(x,e,v),l+=_+x7}},r.prototype.remove=function(){this.group.removeAll()},r}();function Ege(r,e,t,i,n,a){var o=[[n?r:r-$I,e],[r+t,e],[r+t,e+i],[n?r:r-$I,e+i]];return!a&&o.splice(2,0,[r+t+$I,e+i/2]),!n&&o.push([r,e+i/2]),o}function Age(r,e,t){rt(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:t&&t.dataIndex,name:t&&t.name},treePathInfo:t&&Zf(t,e)}}var S7=Tge;var Cge=function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(e,t,i,n,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:i,delay:n,easing:a}),!0)},r.prototype.finished=function(e){return this._finishedCallback=e,this},r.prototype.start=function(){for(var e=this,t=this._storage.length,i=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},n=0,a=this._storage.length;nw7||Math.abs(t.dy)>w7)){var i=this.seriesModel.getData().tree.root;if(!i)return;var n=i.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var i=t.originX,n=t.originY;if(this._state!=="animating"){var a=this.seriesModel.getData().tree.root;if(!a)return;var o=a.getLayout();if(!o)return;var s=new lt(o.x,o.y,o.width,o.height),l=this.seriesModel.layoutInfo;i-=l.x,n-=l.y;var u=wi();_n(u,u,[-i,-n]),Lm(u,u,[t.scale,t.scale]),_n(u,u,[i,n]),s.applyTransform(u),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(t){var i=this;t.on("click",function(n){if(i._state==="ready"){var a=i.seriesModel.get("nodeClick",!0);if(a){var o=i.findTarget(n.offsetX,n.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)i._rootToNode(o);else if(a==="zoomToNode")i._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&Gp(u,c)}}}}},this)},e.prototype._renderBreadcrumb=function(t,i,n){var a=this;n||(n=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(i.getWidth()/2,i.getHeight()/2),n||(n={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new S7(this.group))).render(t,i,n.node,function(o){a._state!=="animating"&&(Iv(t.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=bx(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,i){var n,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(t,i),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)n={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),n},e.type="treemap",e}(Yt);function bx(){return{nodeGroup:[],background:[],content:[]}}function Nge(r,e,t,i,n,a,o,s,l,u){if(!o)return;var c=o.getLayout(),f=r.getData(),h=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var p=c.width,d=c.height,g=c.borderWidth,m=c.invisible,v=o.getRawIndex(),_=s&&s.getRawIndex(),y=o.viewChildren,x=c.upperHeight,M=y&&y.length,S=h.getModel("itemStyle"),w=h.getModel(["emphasis","itemStyle"]),T=h.getModel(["blur","itemStyle"]),C=h.getModel(["select","itemStyle"]),b=S.get("borderRadius")||0,E=V("nodeGroup",QI);if(!E)return;if(l.add(E),E.x=c.x||0,E.y=c.y||0,E.markRedraw(),MT(E).nodeWidth=p,MT(E).nodeHeight=d,c.isAboveViewRoot)return E;var I=V("background",b7,u,Pge);I&&k(E,I,M&&c.upperLabelHeight);var R=h.getModel("emphasis"),A=R.get("focus"),D=R.get("blurScope"),U=R.get("disabled"),B=A==="ancestor"?o.getAncestorsIndices():A==="descendant"?o.getDescendantIndices():A;if(M)Af(E)&&Tu(E,!1),I&&(Tu(I,!U),f.setItemGraphicEl(o.dataIndex,I),iw(I,B,D));else{var z=V("content",b7,u,Dge);z&&G(E,z),I.disableMorphing=!0,I&&Af(I)&&Tu(I,!1),Tu(E,!U),f.setItemGraphicEl(o.dataIndex,E),iw(E,B,D)}return E;function k(ve,ue,se){var Ee=rt(ue);if(Ee.dataIndex=o.dataIndex,Ee.seriesIndex=r.seriesIndex,ue.setShape({x:0,y:0,width:p,height:d,r:b}),m)Y(ue);else{ue.invisible=!1;var q=o.getVisual("style"),H=q.stroke,We=A7(S);We.fill=H;var _e=ad(w);_e.fill=w.get("borderColor");var xe=ad(T);xe.fill=T.get("borderColor");var Le=ad(C);if(Le.fill=C.get("borderColor"),se){var Ue=p-2*g;J(ue,H,q.opacity,{x:g,y:0,width:Ue,height:x})}else ue.removeTextContent();ue.setStyle(We),ue.ensureState("emphasis").style=_e,ue.ensureState("blur").style=xe,ue.ensureState("select").style=Le,Fs(ue)}ve.add(ue)}function G(ve,ue){var se=rt(ue);se.dataIndex=o.dataIndex,se.seriesIndex=r.seriesIndex;var Ee=Math.max(p-2*g,0),q=Math.max(d-2*g,0);if(ue.culling=!0,ue.setShape({x:g,y:g,width:Ee,height:q,r:b}),m)Y(ue);else{ue.invisible=!1;var H=o.getVisual("style"),We=H.fill,_e=A7(S);_e.fill=We,_e.decal=H.decal;var xe=ad(w),Le=ad(T),Ue=ad(C);J(ue,We,H.opacity,null),ue.setStyle(_e),ue.ensureState("emphasis").style=xe,ue.ensureState("blur").style=Le,ue.ensureState("select").style=Ue,Fs(ue)}ve.add(ue)}function Y(ve){!ve.invisible&&a.push(ve)}function J(ve,ue,se,Ee){var q=h.getModel(Ee?E7:T7),H=qr(h.get("name"),null),We=q.getShallow("show");Ir(ve,wr(h,Ee?E7:T7),{defaultText:We?H:null,inheritColor:ue,defaultOpacity:se,labelFetcher:r,labelDataIndex:o.dataIndex});var _e=ve.getTextContent();if(_e){var xe=_e.style,Le=wm(xe.padding||0);Ee&&(ve.setTextConfig({layoutRect:Ee}),_e.disableLabelLayout=!0),_e.beforeUpdate=function(){var Ne=Math.max((Ee?Ee.width:ve.shape.width)-Le[1]-Le[3],0),Ve=Math.max((Ee?Ee.height:ve.shape.height)-Le[0]-Le[2],0);(xe.width!==Ne||xe.height!==Ve)&&_e.setStyle({width:Ne,height:Ve})},xe.truncateMinChar=2,xe.lineOverflow="truncate",Q(xe,Ee,c);var Ue=_e.getState("emphasis");Q(Ue?Ue.style:null,Ee,c)}}function Q(ve,ue,se){var Ee=ve?ve.text:null;if(!ue&&se.isLeafRoot&&Ee!=null){var q=r.get("drillDownIcon",!0);ve.text=q?q+" "+Ee:Ee}}function V(ve,ue,se,Ee){var q=_!=null&&t[ve][_],H=n[ve];return q?(t[ve][_]=null,K(H,q)):m||(q=new ue,q instanceof gi&&(q.z2=Uge(se,Ee)),ae(H,q)),e[ve][v]=q}function K(ve,ue){var se=ve[v]={};ue instanceof QI?(se.oldX=ue.x,se.oldY=ue.y):se.oldShape=fe({},ue.shape)}function ae(ve,ue){var se=ve[v]={},Ee=o.parentNode,q=ue instanceof Ze;if(Ee&&(!i||i.direction==="drillDown")){var H=0,We=0,_e=n.background[Ee.getRawIndex()];!i&&_e&&_e.oldShape&&(H=_e.oldShape.width,We=_e.oldShape.height),q?(se.oldX=0,se.oldY=We):se.oldShape={x:H,y:We,width:0,height:0}}se.fadein=!q}}function Uge(r,e){return r*Lge+e}var C7=Ige;var Ax=N,Oge=qe,TT=-1,iN=function(){function r(e){var t=e.mappingMethod,i=e.type,n=this.option=Qe(e);this.type=i,this.mappingMethod=t,this._normalizeData=Bge[t];var a=r.visualHandlers[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(eN(n),zge(n)):t==="category"?n.categories?Fge(n):eN(n,!0):(kr(t!=="linear"||n.dataExtent),eN(n))}return r.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},r.prototype.getNormalizer=function(){return Be(this._normalizeData,this)},r.listVisualTypes=function(){return bt(r.visualHandlers)},r.isValidType=function(e){return r.visualHandlers.hasOwnProperty(e)},r.eachVisual=function(e,t,i){qe(e)?N(e,t,i):t.call(i,e)},r.mapVisual=function(e,t,i){var n,a=pe(e)?[]:qe(e)?{}:(n=!0,null);return r.eachVisual(e,function(o,s){var l=t.call(i,o,s);n?a=l:a[s]=l}),a},r.retrieveVisuals=function(e){var t={},i;return e&&Ax(r.visualHandlers,function(n,a){e.hasOwnProperty(a)&&(t[a]=e[a],i=!0)}),i?t:null},r.prepareVisualTypes=function(e){if(pe(e))e=e.slice();else if(Oge(e)){var t=[];Ax(e,function(i,n){t.push(n)}),e=t}else return[];return e.sort(function(i,n){return n==="color"&&i!=="color"&&i.indexOf("color")===0?1:-1}),e},r.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},r.findPieceIndex=function(e,t,i){for(var n,a=1/0,o=0,s=t.length;o=0;a--)i[a]==null&&(delete t[e[a]],e.pop())}function eN(r,e){var t=r.visual,i=[];qe(t)?Ax(t,function(a){i.push(a)}):t!=null&&i.push(t);var n={color:1,symbol:1};!e&&i.length===1&&!n.hasOwnProperty(r.type)&&(i[1]=i[0]),L7(r,i)}function bT(r){return{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);i("color",r(t("color"),n))},_normalizedToVisual:tN([0,1])}}function R7(r){var e=this.option.visual;return e[Math.round(rr(r,[0,1],[0,e.length-1],!0))]||{}}function Tx(r){return function(e,t,i){i(r,this.mapValueToVisual(e))}}function Ex(r){var e=this.option.visual;return e[this.option.loop&&r!==TT?r%e.length:r]}function od(){return this.option.visual[0]}function tN(r){return{linear:function(e){return rr(e,r,this.option.visual,!0)},category:Ex,piecewise:function(e,t){var i=rN.call(this,t);return i==null&&(i=rr(e,r,this.option.visual,!0)),i},fixed:od}}function rN(r){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var i=iN.findPieceIndex(r,t),n=t[i];if(n&&n.visual)return n.visual[this.type]}}function L7(r,e){return r.visual=e,r.type==="color"&&(r.parsedVisual=de(e,function(t){var i=cn(t);return i||[0,0,0,1]})),e}var Bge={linear:function(r){return rr(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var e=this.option.pieceList,t=iN.findPieceIndex(r,e,!0);if(t!=null)return rr(t,[0,e.length-1],[0,1],!0)},category:function(r){var e=this.option.categories?this.option.categoryMap[r]:r;return e??TT},fixed:Dr};function wT(r,e,t){return r?e<=t:e=t.length||g===t[g.depth]){var v=Wge(n,l,g,m,d,i);N7(g,v,t,i)}})}}}function Vge(r,e,t){var i=fe({},e),n=t.designatedVisualItemStyle;return N(["color","colorAlpha","colorSaturation"],function(a){n[a]=e[a];var o=r.get(a);n[a]=null,o!=null&&(i[a]=o)}),i}function P7(r){var e=nN(r,"color");if(e){var t=nN(r,"colorAlpha"),i=nN(r,"colorSaturation");return i&&(e=fp(e,null,null,i)),t&&(e=hp(e,t)),e}}function Gge(r,e){return e!=null?fp(e,null,null,r):null}function nN(r,e){var t=r[e];if(t!=null&&t!=="none")return t}function Hge(r,e,t,i,n,a){if(!(!a||!a.length)){var o=aN(e,"color")||n.color!=null&&n.color!=="none"&&(aN(e,"colorAlpha")||aN(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var c=e.get("colorMappingBy"),f={type:o.name,dataExtent:u,visual:o.range};f.type==="color"&&(c==="index"||c==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var h=new pi(f);return D7(h).drColorMappingBy=c,h}}}function aN(r,e){var t=r.get(e);return pe(t)&&t.length?{name:e,range:t}:null}function Wge(r,e,t,i,n,a){var o=fe({},e);if(n){var s=n.type,l=s==="color"&&D7(n).drColorMappingBy,u=l==="index"?i:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(r.get("visualDimension"));o[s]=n.mapValueToVisual(u)}return o}var Cx=Math.max,ET=Math.min,U7=Br,oN=N,z7=["itemStyle","borderWidth"],Xge=["itemStyle","gapWidth"],Yge=["upperLabel","show"],qge=["upperLabel","height"],F7={seriesType:"treemap",reset:function(r,e,t,i){var n=t.getWidth(),a=t.getHeight(),o=r.option,s=xr(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=o.size||[],u=ze(U7(s.width,l[0]),n),c=ze(U7(s.height,l[1]),a),f=i&&i.type,h=["treemapZoomToNode","treemapRootToNode"],p=Vu(i,h,r),d=f==="treemapRender"||f==="treemapMove"?i.rootRect:null,g=r.getViewRoot(),m=qI(g);if(f!=="treemapMove"){var v=f==="treemapZoomToNode"?Qge(r,p,g,u,c):d?[d.width,d.height]:[u,c],_=o.sort;_&&_!=="asc"&&_!=="desc"&&(_="desc");var y={squareRatio:o.squareRatio,sort:_,leafDepth:o.leafDepth};g.hostTree.clearLayouts();var x={x:0,y:0,width:v[0],height:v[1],area:v[0]*v[1]};g.setLayout(x),B7(g,y,!1,0),x=g.getLayout(),oN(m,function(S,w){var T=(m[w+1]||g).getValue();S.setLayout(fe({dataExtent:[T,T],borderWidth:0,upperHeight:0},x))})}var M=r.getData().tree.root;M.setLayout(eye(s,d,p),!0),r.setLayoutInfo(s),k7(M,new lt(-s.x,-s.y,n,a),m,g,0)}};function B7(r,e,t,i){var n,a;if(!r.isRemoved()){var o=r.getLayout();n=o.width,a=o.height;var s=r.getModel(),l=s.get(z7),u=s.get(Xge)/2,c=V7(s),f=Math.max(l,c),h=l-u,p=f-u;r.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),n=Cx(n-2*h,0),a=Cx(a-h-p,0);var d=n*a,g=Zge(r,s,d,e,t,i);if(g.length){var m={x:h,y:p,width:n,height:a},v=ET(n,a),_=1/0,y=[];y.area=0;for(var x=0,M=g.length;x=0;l--){var u=n[i==="asc"?o-l-1:l].getValue();u/t*es[1]&&(s[1]=u)})),{sum:i,dataExtent:s}}function $ge(r,e,t){for(var i=0,n=1/0,a=0,o=void 0,s=r.length;ai&&(i=o));var l=r.area*r.area,u=e*e*t;return l?Cx(u*i/l,l/(u*n)):1/0}function O7(r,e,t,i,n){var a=e===t.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=t[s[a]],c=e?r.area/e:0;(n||c>t[l[o]])&&(c=t[l[o]]);for(var f=0,h=r.length;ft_&&(u=t_),a=s}ui&&(i=e);var a=i%2?i+2:i+3;n=[];for(var o=0;o0&&(M[0]=-M[0],M[1]=-M[1]);var w=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var T=-Math.atan2(x[1],x[0]);f[0].8?"left":h[0]<-.8?"right":"center",g=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":a.x=-h[0]*v+c[0],a.y=-h[1]*_+c[1],d=h[0]>.8?"right":h[0]<-.8?"left":"center",g=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=v*w+c[0],a.y=c[1]+C,d=x[0]<0?"right":"left",a.originX=-v*w,a.originY=-C;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=S[0],a.y=S[1]+C,d="center",a.originY=-C;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-v*w+f[0],a.y=f[1]+C,d=x[0]>=0?"right":"left",a.originX=v*w,a.originY=-C;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||d})}},e}(Ze),Fv=sye;var lye=function(){function r(e){this.group=new Ze,this._LineCtor=e||Fv}return r.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var i=this,n=i.group,a=i._lineData;i._lineData=e,a||n.removeAll();var o=eY(e);e.diff(a).add(function(s){t._doAdd(e,s,o)}).update(function(s,l){t._doUpdate(a,e,l,s,o)}).remove(function(s){n.remove(a.getItemGraphicEl(s))}).execute()},r.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,i){t.updateLayout(e,i)},this)},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=eY(e),this._lineData=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function i(s){!s.isGroup&&!uye(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var n=e.start;n0}function eY(r){var e=r.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:wr(e)}}function tY(r){return isNaN(r[0])||isNaN(r[1])}function bN(r){return r&&!tY(r[0])&&!tY(r[1])}var Bv=lye;var wN=[],TN=[],EN=[],kv=vi,AN=gu,rY=Math.abs;function iY(r,e,t){for(var i=r[0],n=r[1],a=r[2],o=1/0,s,l=t*t,u=.1,c=.1;c<=.9;c+=.1){wN[0]=kv(i[0],n[0],a[0],c),wN[1]=kv(i[1],n[1],a[1],c);var f=rY(AN(wN,e)-l);f=0?s=s+u:s=s-u:d>=0?s=s-u:s=s+u}return s}function Px(r,e){var t=[],i=mf,n=[[],[],[]],a=[[],[]],o=[];e/=2,r.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");u.__original||(u.__original=[Aa(u[0]),Aa(u[1])],u[2]&&u.__original.push(Aa(u[2])));var h=u.__original;if(u[2]!=null){if(qi(n[0],h[0]),qi(n[1],h[2]),qi(n[2],h[1]),c&&c!=="none"){var p=ld(s.node1),d=iY(n,h[0],p*e);i(n[0][0],n[1][0],n[2][0],d,t),n[0][0]=t[3],n[1][0]=t[4],i(n[0][1],n[1][1],n[2][1],d,t),n[0][1]=t[3],n[1][1]=t[4]}if(f&&f!=="none"){var p=ld(s.node2),d=iY(n,h[1],p*e);i(n[0][0],n[1][0],n[2][0],d,t),n[1][0]=t[1],n[2][0]=t[2],i(n[0][1],n[1][1],n[2][1],d,t),n[1][1]=t[1],n[2][1]=t[2]}qi(u[0],n[0]),qi(u[1],n[2]),qi(u[2],n[1])}else{if(qi(a[0],h[0]),qi(a[1],h[1]),Ns(o,a[1],a[0]),Xo(o,o),c&&c!=="none"){var p=ld(s.node1);U0(a[0],a[0],o,p*e)}if(f&&f!=="none"){var p=ld(s.node2);U0(a[1],a[1],o,-p*e)}qi(u[0],a[0]),qi(u[1],a[1])}})}function nY(r){return r.type==="view"}var cye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){var n=new Xl,a=new Bv,o=this.group;this._controller=new jl(i.getZr()),this._controllerHost={target:o},o.add(n.group),o.add(a.group),this._symbolDraw=n,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,i,n){var a=this,o=t.coordinateSystem;this._model=t;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(nY(o)){var c={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(c):Dt(u,c,t)}Px(t.getGraph(),sd(t));var f=t.getData();s.updateData(f);var h=t.getEdgeData();l.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,i,n),clearTimeout(this._layoutTimeout);var p=t.forceLayout,d=t.get(["force","layoutAnimation"]);p&&this._startForceLayoutIteration(p,d);var g=t.get("layout");f.graph.eachNode(function(y){var x=y.dataIndex,M=y.getGraphicEl(),S=y.getModel();if(M){M.off("drag").off("dragend");var w=S.get("draggable");w&&M.on("drag",function(C){switch(g){case"force":p.warmUp(),!a._layouting&&a._startForceLayoutIteration(p,d),p.setFixed(x),f.setItemLayout(x,[M.x,M.y]);break;case"circular":f.setItemLayout(x,[M.x,M.y]),y.setLayout({fixed:!0},!0),Ov(t,"symbolSize",y,[C.offsetX,C.offsetY]),a.updateLayout(t);break;case"none":default:f.setItemLayout(x,[M.x,M.y]),Lx(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){p&&p.setUnfixed(x)}),M.setDraggable(w,!!S.get("cursor"));var T=S.get(["emphasis","focus"]);T==="adjacency"&&(rt(M).focus=y.getAdjacentDataIndices())}}),f.graph.eachEdge(function(y){var x=y.getGraphicEl(),M=y.getModel().get(["emphasis","focus"]);x&&M==="adjacency"&&(rt(x).focus={edge:[y.dataIndex],node:[y.node1.dataIndex,y.node2.dataIndex]})});var m=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),v=f.getLayout("cx"),_=f.getLayout("cy");f.graph.eachNode(function(y){mN(y,m,v,_)}),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,i){var n=this;(function a(){t.step(function(o){n.updateLayout(n._model),(n._layouting=!o)&&(i?n._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,i,n){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,c,f){var h=l.getBoundingRect();return h.applyTransform(l.transform),h.contain(c,f)&&!Yf(u,n,t)}),!nY(t.coordinateSystem)){o.disable();return}o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){Rv(s,u.dx,u.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){Lv(s,u.scale,u.originX,u.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),Px(t.getGraph(),sd(t)),a._lineDraw.updateLayout(),n.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,i=t.getData(),n=sd(t);i.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(n)})},e.prototype.updateLayout=function(t){Px(t.getGraph(),sd(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(Yt),aY=cye;function Vv(r){return"_EC_"+r}var fye=function(){function r(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var i=this._nodesMap;if(!i[Vv(e)]){var n=new ud(e,t);return n.hostGraph=this,this.nodes.push(n),i[Vv(e)]=n,n}},r.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},r.prototype.getNodeById=function(e){return this._nodesMap[Vv(e)]},r.prototype.addEdge=function(e,t,i){var n=this._nodesMap,a=this._edgesMap;if(Ct(e)&&(e=this.nodes[e]),Ct(t)&&(t=this.nodes[t]),e instanceof ud||(e=n[Vv(e)]),t instanceof ud||(t=n[Vv(t)]),!(!e||!t)){var o=e.id+"-"+t.id,s=new oY(e,t,i);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),a[o]=s,s}},r.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},r.prototype.getEdge=function(e,t){e instanceof ud&&(e=e.id),t instanceof ud&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},r.prototype.eachNode=function(e,t){for(var i=this.nodes,n=i.length,a=0;a=0&&e.call(t,i[a],a)},r.prototype.eachEdge=function(e,t){for(var i=this.edges,n=i.length,a=0;a=0&&i[a].node1.dataIndex>=0&&i[a].node2.dataIndex>=0&&e.call(t,i[a],a)},r.prototype.breadthFirstTraverse=function(e,t,i,n){if(t instanceof ud||(t=this._nodesMap[Vv(t)]),!!t){for(var a=i==="out"?"outEdges":i==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=n.length;a=0&&this[r][e].setItemVisual(this.dataIndex,t,i)},getVisual:function(t){return this[r][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,i){this.dataIndex>=0&&this[r][e].setItemLayout(this.dataIndex,t,i)},getLayout:function(){return this[r][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][e].getRawIndex(this.dataIndex)}}}br(ud,sY("hostGraph","data"));br(oY,sY("hostGraph","edgeData"));var lY=fye;function Dx(r,e,t,i,n){for(var a=new lY(i),o=0;o "+h)),u++)}var p=t.get("coordinateSystem"),d;if(p==="cartesian2d"||p==="polar")d=hn(r,t);else{var g=Nu.get(p),m=g?g.dimensions||[]:[];dt(m,"value")<0&&m.concat(["value"]);var v=Ks(r,{coordDimensions:m,encodeDefine:t.getEncode()}).dimensions;d=new ri(v,t),d.initData(r)}var _=new ri(["value"],t);return _.initData(l,s),n&&n(d,_),ST({mainData:d,struct:a,structAttr:"graph",datas:{node:d,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var hye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments);var i=this;function n(){return i._categoriesData}this.legendVisualProvider=new Zl(n,n),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){r.prototype.mergeDefaultAndTheme.apply(this,arguments),yo(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,i){var n=t.edges||t.links||[],a=t.data||t.nodes||[],o=this;if(a&&n){W7(this);var s=Dx(a,n,this,!0,l);return N(s.edges,function(u){X7(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(d){var g=o._categoriesModels,m=d.getShallow("category"),v=g[m];return v&&(v.parentModel=d.parentModel,d.parentModel=v),d});var f=Zt.prototype.getModel;function h(d,g){var m=f.call(this,d,g);return m.resolveParentPath=p,m}c.wrapMethod("getItemModel",function(d){return d.resolveParentPath=p,d.getModel=h,d});function p(d){if(d&&(d[0]==="label"||d[1]==="label")){var g=d.slice();return d[0]==="label"?g[0]="edgeLabel":d[1]==="label"&&(g[1]="edgeLabel"),g}return d}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,i,n){if(n==="edge"){var a=this.getData(),o=this.getDataParams(t,n),s=a.graph.getEdgeByIndex(t),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Or("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=Kw({series:this,dataIndex:t,multipleSeries:i});return f},e.prototype._updateCategoriesData=function(){var t=de(this.option.categories||[],function(n){return n.value!=null?n:fe({value:0},n)}),i=new ri(["value"],this);i.initData(t),this._categoriesData=i,this._categoriesModels=i.mapArray(function(n){return i.getItemModel(n)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(jt),uY=hye;var pye={type:"graphRoam",event:"graphRoam",update:"none"};function CN(r){r.registerChartView(aY),r.registerSeriesModel(uY),r.registerProcessor(lN),r.registerVisual(uN),r.registerVisual(cN),r.registerLayout(pN),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,vN),r.registerLayout(gN),r.registerCoordinateSystem("graphView",{dimensions:ku.dimensions,create:yN}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Dr),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Dr),r.registerAction(pye,function(e,t,i){t.eachComponent({mainType:"series",query:e},function(n){var a=n.coordinateSystem,o=Pv(a,e,void 0,i);n.setCenter&&n.setCenter(o.center),n.setZoom&&n.setZoom(o.zoom)})})}var dye=function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r}(),mye=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="pointer",i}return e.prototype.getDefaultShape=function(){return new dye},e.prototype.buildPath=function(t,i){var n=Math.cos,a=Math.sin,o=i.r,s=i.width,l=i.angle,u=i.x-n(l)*s*(s>=o/3?1:2),c=i.y-a(l)*s*(s>=o/3?1:2);l=i.angle-Math.PI/2,t.moveTo(u,c),t.lineTo(i.x+n(l)*s,i.y+a(l)*s),t.lineTo(i.x+n(i.angle)*o,i.y+a(i.angle)*o),t.lineTo(i.x-n(l)*s,i.y-a(l)*s),t.lineTo(u,c)},e}(ut),cY=mye;function vye(r,e){var t=r.get("center"),i=e.getWidth(),n=e.getHeight(),a=Math.min(i,n),o=ze(t[0],e.getWidth()),s=ze(t[1],e.getHeight()),l=ze(r.get("radius"),a/2);return{cx:o,cy:s,r:l}}function LT(r,e){var t=r==null?"":r+"";return e&&(Ce(e)?t=e.replace("{value}",t):He(e)&&(t=e(r))),t}var gye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),o=vye(t,n);this._renderMain(t,i,n,a,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,i,n,a,o){var s=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,c=-t.get("endAngle")/180*Math.PI,f=t.getModel("axisLine"),h=f.get("roundCap"),p=h?Av:yi,d=f.get("show"),g=f.getModel("lineStyle"),m=g.get("width"),v=[u,c];u_(v,!l),u=v[0],c=v[1];for(var _=c-u,y=u,x=[],M=0;d&&M=C&&(b===0?0:a[b-1][0])Math.PI/2&&(V+=Math.PI)):Q==="tangential"?V=-T-Math.PI/2:Ct(Q)&&(V=Q*Math.PI/180),V===0?f.add(new Lt({style:fr(y,{text:k,x:Y,y:J,verticalAlign:D<-.8?"top":D>.8?"bottom":"middle",align:A<-.4?"left":A>.4?"right":"center"},{inheritColor:G}),silent:!0})):f.add(new Lt({style:fr(y,{text:k,x:Y,y:J,verticalAlign:"middle",align:"center"},{inheritColor:G}),silent:!0,originX:Y,originY:J,rotation:V}))}if(_.get("show")&&U!==x){var B=_.get("distance");B=B?B+c:c;for(var K=0;K<=M;K++){A=Math.cos(T),D=Math.sin(T);var ae=new Jr({shape:{x1:A*(d-B)+h,y1:D*(d-B)+p,x2:A*(d-w-B)+h,y2:D*(d-w-B)+p},silent:!0,style:I});I.stroke==="auto"&&ae.setStyle({stroke:a((U+K/M)/x)}),f.add(ae),T+=b}T-=b}else T+=C}},e.prototype._renderPointer=function(t,i,n,a,o,s,l,u,c){var f=this.group,h=this._data,p=this._progressEls,d=[],g=t.get(["pointer","show"]),m=t.getModel("progress"),v=m.get("show"),_=t.getData(),y=_.mapDimension("value"),x=+t.get("min"),M=+t.get("max"),S=[x,M],w=[s,l];function T(b,E){var I=_.getItemModel(b),R=I.getModel("pointer"),A=ze(R.get("width"),o.r),D=ze(R.get("length"),o.r),U=t.get(["pointer","icon"]),B=R.get("offsetCenter"),z=ze(B[0],o.r),k=ze(B[1],o.r),G=R.get("keepAspect"),Y;return U?Y=Sr(U,z-A/2,k-D,A,D,null,G):Y=new cY({shape:{angle:-Math.PI/2,width:A,r:D,x:z,y:k}}),Y.rotation=-(E+Math.PI/2),Y.x=o.cx,Y.y=o.cy,Y}function C(b,E){var I=m.get("roundCap"),R=I?Av:yi,A=m.get("overlap"),D=A?m.get("width"):c/_.count(),U=A?o.r-D:o.r-(b+1)*D,B=A?o.r:o.r-b*D,z=new R({shape:{startAngle:s,endAngle:E,cx:o.cx,cy:o.cy,clockwise:u,r0:U,r:B}});return A&&(z.z2=M-_.get(y,b)%M),z}(v||g)&&(_.diff(h).add(function(b){var E=_.get(y,b);if(g){var I=T(b,s);or(I,{rotation:-((isNaN(+E)?w[0]:rr(E,S,w,!0))+Math.PI/2)},t),f.add(I),_.setItemGraphicEl(b,I)}if(v){var R=C(b,s),A=m.get("clip");or(R,{shape:{endAngle:rr(E,S,w,A)}},t),f.add(R),f_(t.seriesIndex,_.dataType,b,R),d[b]=R}}).update(function(b,E){var I=_.get(y,b);if(g){var R=h.getItemGraphicEl(E),A=R?R.rotation:s,D=T(b,A);D.rotation=A,Dt(D,{rotation:-((isNaN(+I)?w[0]:rr(I,S,w,!0))+Math.PI/2)},t),f.add(D),_.setItemGraphicEl(b,D)}if(v){var U=p[E],B=U?U.shape.endAngle:s,z=C(b,B),k=m.get("clip");Dt(z,{shape:{endAngle:rr(I,S,w,k)}},t),f.add(z),f_(t.seriesIndex,_.dataType,b,z),d[b]=z}}).execute(),_.each(function(b){var E=_.getItemModel(b),I=E.getModel("emphasis"),R=I.get("focus"),A=I.get("blurScope"),D=I.get("disabled");if(g){var U=_.getItemGraphicEl(b),B=_.getItemVisual(b,"style"),z=B.fill;if(U instanceof Ur){var k=U.style;U.useStyle(fe({image:k.image,x:k.x,y:k.y,width:k.width,height:k.height},B))}else U.useStyle(B),U.type!=="pointer"&&U.setColor(z);U.setStyle(E.getModel(["pointer","itemStyle"]).getItemStyle()),U.style.fill==="auto"&&U.setStyle("fill",a(rr(_.get(y,b),S,[0,1],!0))),U.z2EmphasisLift=0,Gr(U,E),ar(U,R,A,D)}if(v){var G=d[b];G.useStyle(_.getItemVisual(b,"style")),G.setStyle(E.getModel(["progress","itemStyle"]).getItemStyle()),G.z2EmphasisLift=0,Gr(G,E),ar(G,R,A,D)}}),this._progressEls=d)},e.prototype._renderAnchor=function(t,i){var n=t.getModel("anchor"),a=n.get("show");if(a){var o=n.get("size"),s=n.get("icon"),l=n.get("offsetCenter"),u=n.get("keepAspect"),c=Sr(s,i.cx-o/2+ze(l[0],i.r),i.cy-o/2+ze(l[1],i.r),o,o,null,u);c.z2=n.get("showAbove")?1:0,c.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(c)}},e.prototype._renderTitleAndDetail=function(t,i,n,a,o){var s=this,l=t.getData(),u=l.mapDimension("value"),c=+t.get("min"),f=+t.get("max"),h=new Ze,p=[],d=[],g=t.isAnimationEnabled(),m=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(v){p[v]=new Lt({silent:!0}),d[v]=new Lt({silent:!0})}).update(function(v,_){p[v]=s._titleEls[_],d[v]=s._detailEls[_]}).execute(),l.each(function(v){var _=l.getItemModel(v),y=l.get(u,v),x=new Ze,M=a(rr(y,[c,f],[0,1],!0)),S=_.getModel("title");if(S.get("show")){var w=S.get("offsetCenter"),T=o.cx+ze(w[0],o.r),C=o.cy+ze(w[1],o.r),b=p[v];b.attr({z2:m?0:2,style:fr(S,{x:T,y:C,text:l.getName(v),align:"center",verticalAlign:"middle"},{inheritColor:M})}),x.add(b)}var E=_.getModel("detail");if(E.get("show")){var I=E.get("offsetCenter"),R=o.cx+ze(I[0],o.r),A=o.cy+ze(I[1],o.r),D=ze(E.get("width"),o.r),U=ze(E.get("height"),o.r),B=t.get(["progress","show"])?l.getItemVisual(v,"style").fill:M,b=d[v],z=E.get("formatter");b.attr({z2:m?0:2,style:fr(E,{x:R,y:A,text:LT(y,z),width:isNaN(D)?null:D,height:isNaN(U)?null:U,align:"center",verticalAlign:"middle"},{inheritColor:B})}),yw(b,{normal:E},y,function(G){return LT(G,z)}),g&&_w(b,v,l,t,{getFormattedLabel:function(G,Y,J,Q,V,K){return LT(K?K.interpolatedValue:y,z)}}),x.add(b)}h.add(x)}),this.group.add(h),this._titleEls=p,this._detailEls=d},e.type="gauge",e}(Yt),fY=gye;var yye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,i){return To(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(jt),hY=yye;function RN(r){r.registerChartView(fY),r.registerSeriesModel(hY)}var _ye=["itemStyle","opacity"],xye=function(r){Z(e,r);function e(t,i){var n=r.call(this)||this,a=n,o=new Qr,s=new Lt;return a.setTextContent(s),n.setTextGuideLine(o),n.updateData(t,i,!0),n}return e.prototype.updateData=function(t,i,n){var a=this,o=t.hostModel,s=t.getItemModel(i),l=t.getItemLayout(i),u=s.getModel("emphasis"),c=s.get(_ye);c=c??1,n||Di(a),a.useStyle(t.getItemVisual(i,"style")),a.style.lineJoin="round",n?(a.setShape({points:l.points}),a.style.opacity=0,or(a,{style:{opacity:c}},o,i)):Dt(a,{style:{opacity:c},shape:{points:l.points}},o,i),Gr(a,s),this._updateLabel(t,i),ar(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,i){var n=this,a=this.getTextGuideLine(),o=n.getTextContent(),s=t.hostModel,l=t.getItemModel(i),u=t.getItemLayout(i),c=u.label,f=t.getItemVisual(i,"style"),h=f.fill;Ir(o,wr(l),{labelFetcher:t.hostModel,labelDataIndex:i,defaultOpacity:f.opacity,defaultText:t.getName(i)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}}),n.setTextConfig({local:!0,inside:!!c.inside,insideStroke:h,outsideFill:h});var p=c.linePoints;a.setShape({points:p}),n.textGuideLineConfig={anchor:p?new Nt(p[0][0],p[0][1]):null},Dt(o,{style:{x:c.x,y:c.y}},s,i),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),bv(n,wv(l),{stroke:h})},e}(ti),Sye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new xye(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);Au(u,t,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(Yt),pY=Sye;var Mye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Zl(Be(this.getData,this),Be(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,i){return To(this,{coordDimensions:["value"],encodeDefaulter:ot(fv,this)})},e.prototype._defaultLabelLine=function(t){yo(t,"labelLine",["show"]);var i=t.labelLine,n=t.emphasis.labelLine;i.show=i.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var i=this.getData(),n=r.prototype.getDataParams.call(this,t),a=i.mapDimension("value"),o=i.getSum(a);return n.percent=o?+(i.get(a,t)/o*100).toFixed(2):0,n.$vars.push("percent"),n},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(jt),dY=Mye;function bye(r,e){return xr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function wye(r,e){for(var t=r.mapDimension("value"),i=r.mapArray(t,function(l){return l}),n=[],a=e==="ascending",o=0,s=r.count();ozye)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]);n.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(r){if(!(this._mouseDownPoint||!NN(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]),i=t.behavior;i==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(i==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:i==="jump"?null:{duration:0}})}}};function NN(r,e){var t=r._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}var SY=Fye;var kye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){r.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var i=this.option;t&&_t(i,t,!0),this._initDimensions()},e.prototype.contains=function(t,i){var n=t.get("parallelIndex");return n!=null&&i.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){N(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(i){t.hasOwnProperty(i)&&(this.option[i]=t[i])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],i=this.parallelAxisIndex=[],n=Wt(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);N(n,function(a){t.push("dim"+a.get("dim")),i.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Pt),MY=kye;var Vye=function(r){Z(e,r);function e(t,i,n,a,o){var s=r.call(this,t,i,n)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(pn),bY=Vye;function Za(r,e,t,i,n,a){r=r||0;var o=t[1]-t[0];if(n!=null&&(n=Gv(n,[0,o])),a!=null&&(a=Math.max(a,n??0)),i==="all"){var s=Math.abs(e[1]-e[0]);s=Gv(s,[0,o]),n=a=Gv(s,[n,a]),i=0}e[0]=Gv(e[0],t),e[1]=Gv(e[1],t);var l=UN(e,i);e[i]+=r;var u=n||0,c=t.slice();l.sign<0?c[0]+=u:c[1]-=u,e[i]=Gv(e[i],c);var f;return f=UN(e,i),n!=null&&(f.sign!==l.sign||f.spana&&(e[1-i]=e[i]+f.sign*a),e}function UN(r,e){var t=r[e]-r[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function Gv(r,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,r))}var ON=N,EY=Math.min,AY=Math.max,wY=Math.floor,Gye=Math.ceil,TY=Er,Hye=Math.PI,Wye=function(){function r(e,t,i){this.type="parallel",this._axesMap=ke(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,i)}return r.prototype._init=function(e,t,i){var n=e.dimensions,a=e.parallelAxisIndex;ON(n,function(o,s){var l=a[s],u=t.getComponent("parallelAxis",l),c=this._axesMap.set(o,new bY(o,kf(u),[0,0],u.get("type"),l)),f=c.type==="category";c.onBand=f&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},r.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},r.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),i=t.axisBase,n=t.layoutBase,a=t.pixelDimIndex,o=e[1-a],s=e[a];return o>=i&&o<=i+t.axisLength&&s>=n&&s<=n+t.layoutLength},r.prototype.getModel=function(){return this._model},r.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(i){if(e.contains(i,t)){var n=i.getData();ON(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(n,n.mapDimension(a)),kl(o.scale,o.model)},this)}},this)},r.prototype.resize=function(e,t){this._rect=xr(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},r.prototype.getRect=function(){return this._rect},r.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,i=["x","y"],n=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=t[n[o]],l=[0,s],u=this.dimensions.length,c=PT(e.get("axisExpandWidth"),l),f=PT(e.get("axisExpandCount")||0,[0,u]),h=e.get("axisExpandable")&&u>3&&u>f&&f>1&&c>0&&s>0,p=e.get("axisExpandWindow"),d;if(p)d=PT(p[1]-p[0],l),p[1]=p[0]+d;else{d=PT(c*(f-1),l);var g=e.get("axisExpandCenter")||wY(u/2);p=[c*g-d/2],p[1]=p[0]+d}var m=(s-d)/(u-f);m<3&&(m=0);var v=[wY(TY(p[0]/c,1))+1,Gye(TY(p[1]/c,1))-1],_=m/c*p[0];return{layout:a,pixelDimIndex:o,layoutBase:t[i[o]],layoutLength:s,axisBase:t[i[1-o]],axisLength:t[n[1-o]],axisExpandable:h,axisExpandWidth:c,axisCollapseWidth:m,axisExpandWindow:p,axisCount:u,winInnerIndices:v,axisExpandWindow0Pos:_}},r.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),a=n.layout;t.each(function(o){var s=[0,n.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),ON(i,function(o,s){var l=(n.axisExpandable?Yye:Xye)(s,n),u={horizontal:{x:l.position,y:n.axisLength},vertical:{x:0,y:l.position}},c={horizontal:Hye/2,vertical:0},f=[u[a].x+e.x,u[a].y+e.y],h=c[a],p=wi();Pa(p,p,h),_n(p,p,f),this._axesLayout[o]={position:f,rotation:h,transform:p,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},r.prototype.getAxis=function(e){return this._axesMap.get(e)},r.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},r.prototype.eachActiveState=function(e,t,i,n){i==null&&(i=0),n==null&&(n=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];N(o,function(m){s.push(e.mapDimension(m)),l.push(a.get(m).model)});for(var u=this.hasAxisBrushed(),c=i;ca*(1-f[0])?(u="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=t.axisExpandWidth/c,l?Za(l,n,o,"all"):u="none";else{var p=n[1]-n[0],d=o[1]*s/p;n=[AY(0,d-p/2)],n[1]=EY(o[1],n[0]+p),n[0]=n[1]-p}return{axisExpandWindow:n,behavior:u}},r}();function PT(r,e){return EY(AY(r,e[0]),e[1])}function Xye(r,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*r,axisNameAvailableWidth:t,axisLabelShow:!0}}function Yye(r,e){var t=e.layoutLength,i=e.axisExpandWidth,n=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,c;return r=0;n--)Ti(i[n])},e.prototype.getActiveState=function(t){var i=this.activeIntervals;if(!i.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(i.length===1){var n=i[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var a=0,o=i.length;aJye}function GY(r){var e=r.length-1;return e<0&&(e=0),[r[0],r[e]]}function HY(r,e,t,i){var n=new Ze;return n.add(new Et({name:"main",style:YN(t),silent:!0,draggable:!0,cursor:"move",drift:ot(IY,r,e,n,["n","s","w","e"]),ondragend:ot(fd,e,{isEnd:!0})})),N(i,function(a){n.add(new Et({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:ot(IY,r,e,n,a),ondragend:ot(fd,e,{isEnd:!0})}))}),n}function WY(r,e,t,i){var n=i.brushStyle.lineWidth||0,a=Hv(n,$ye),o=t[0][0],s=t[1][0],l=o-n/2,u=s-n/2,c=t[0][1],f=t[1][1],h=c-a+n/2,p=f-a+n/2,d=c-o,g=f-s,m=d+n,v=g+n;Gu(r,e,"main",o,s,d,g),i.transformable&&(Gu(r,e,"w",l,u,a,v),Gu(r,e,"e",h,u,a,v),Gu(r,e,"n",l,u,m,a),Gu(r,e,"s",l,p,m,a),Gu(r,e,"nw",l,u,a,a),Gu(r,e,"ne",h,u,a,a),Gu(r,e,"sw",l,p,a,a),Gu(r,e,"se",h,p,a,a))}function BN(r,e){var t=e.__brushOption,i=t.transformable,n=e.childAt(0);n.useStyle(YN(t)),n.attr({silent:!i,cursor:i?"move":"default"}),N([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?kN(r,a[0]):a0e(r,a);o&&o.attr({silent:!i,invisible:!i,cursor:i?e0e[s]+"-resize":null})})}function Gu(r,e,t,i,n,a,o){var s=e.childOfName(t);s&&s.setShape(s0e(qN(r,e,[[i,n],[i+a,n+o]])))}function YN(r){return Ye({strokeNoScale:!0},r.brushStyle)}function XY(r,e,t,i){var n=[Ix(r,t),Ix(e,i)],a=[Hv(r,t),Hv(e,i)];return[[n[0],a[0]],[n[1],a[1]]]}function n0e(r){return Vs(r.group)}function kN(r,e){var t={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},n=zp(t[e],n0e(r));return i[n]}function a0e(r,e){var t=[kN(r,e[0]),kN(r,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function IY(r,e,t,i,n,a){var o=t.__brushOption,s=r.toRectRange(o.range),l=YY(e,n,a);N(i,function(u){var c=Qye[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=r.fromRectRange(XY(s[0][0],s[1][0],s[0][1],s[1][1])),HN(e,t),fd(e,{isEnd:!1})}function o0e(r,e,t,i){var n=e.__brushOption.range,a=YY(r,t,i);N(n,function(o){o[0]+=a[0],o[1]+=a[1]}),HN(r,e),fd(r,{isEnd:!1})}function YY(r,e,t){var i=r.group,n=i.transformCoordToLocal(e,t),a=i.transformCoordToLocal(0,0);return[n[0]-a[0],n[1]-a[1]]}function qN(r,e,t){var i=VY(r,e);return i&&i!==cd?i.clipPath(t,r._transform):Qe(t)}function s0e(r){var e=Ix(r[0][0],r[1][0]),t=Ix(r[0][1],r[1][1]),i=Hv(r[0][0],r[1][0]),n=Hv(r[0][1],r[1][1]);return{x:e,y:t,width:i-e,height:n-t}}function l0e(r,e,t){if(!(!r._brushType||c0e(r,e.offsetX,e.offsetY))){var i=r._zr,n=r._covers,a=XN(r,e,t);if(!r._dragging)for(var o=0;oi.getWidth()||t<0||t>i.getHeight()}var DT={lineX:OY(0),lineY:OY(1),rect:{createCover:function(r,e){function t(i){return i}return HY({toRectRange:t,fromRectRange:t},r,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(r){var e=GY(r);return XY(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(r,e,t,i){WY(r,e,t,i)},updateCommon:BN,contain:GN},polygon:{createCover:function(r,e){var t=new Ze;return t.add(new Qr({name:"main",style:YN(e),silent:!0})),t},getCreatingRange:function(r){return r},endCreating:function(r,e){e.remove(e.childAt(0)),e.add(new ti({name:"main",draggable:!0,drift:ot(o0e,r,e),ondragend:ot(fd,r,{isEnd:!0})}))},updateCoverShape:function(r,e,t,i){e.childAt(0).setShape({points:qN(r,e,t)})},updateCommon:BN,contain:GN}};function OY(r){return{createCover:function(e,t){return HY({toRectRange:function(i){var n=[i,[0,100]];return r&&n.reverse(),n},fromRectRange:function(i){return i[r]}},e,t,[[["w"],["e"]],[["n"],["s"]]][r])},getCreatingRange:function(e){var t=GY(e),i=Ix(t[0][r],t[1][r]),n=Hv(t[0][r],t[1][r]);return[i,n]},updateCoverShape:function(e,t,i,n){var a,o=VY(e,t);if(o!==cd&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(r);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-r]]}var l=[i,a];r&&l.reverse(),WY(e,t,l,n)},updateCommon:BN,contain:GN}}var Wv=r0e;function IT(r){return r=ZN(r),function(e){return zP(e,r)}}function NT(r,e){return r=ZN(r),function(t){var i=e??t,n=i?r.width:r.height,a=i?r.x:r.y;return[a,a+(n||0)]}}function UT(r,e,t){var i=ZN(r);return function(n,a){return i.contain(a[0],a[1])&&!Yf(n,e,t)}}function ZN(r){return lt.create(r)}var f0e=["axisLine","axisTickLabel","axisName"],h0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){r.prototype.init.apply(this,arguments),(this._brushController=new Wv(i.getZr())).on("brush",Be(this._onBrush,this))},e.prototype.render=function(t,i,n,a){if(!p0e(t,i,a)){this.axisModel=t,this.api=n,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ze,this.group.add(this._axisGroup),!!t.get("show")){var s=m0e(t,i),l=s.coordinateSystem,u=t.getAreaSelectStyle(),c=u.width,f=t.axis.dim,h=l.getAxisLayout(f),p=fe({strokeContainThreshold:c},h),d=new Cn(t,p);N(f0e,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(p,u,t,s,c,n),Ru(o,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,i,n,a,o,s){var l=n.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),f=lt.create({x:l[0],y:-o/2,width:u,height:o});f.x-=c,f.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:IT(f),isTargetByCursor:UT(f,s,a),getLinearBrushOtherExtent:NT(f,0)}]).enableBrush({brushType:"lineX",brushStyle:i,removeOnClick:!0}).updateCovers(d0e(n))},e.prototype._onBrush=function(t){var i=t.areas,n=this.axisModel,a=n.axis,o=de(i,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!n.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(er);function p0e(r,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===r}function d0e(r){var e=r.axis;return de(r.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function m0e(r,e){return e.getComponent("parallel",r.get("parallelIndex"))}var jY=h0e;var v0e={type:"axisAreaSelect",event:"axisAreaSelected"};function KY(r){r.registerAction(v0e,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(i){i.axis.model.setActiveIntervals(e.intervals)})}),r.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(i){i.setAxisExpand(e)})})}var g0e={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Nx(r){r.registerComponentView(SY),r.registerComponentModel(MY),r.registerCoordinateSystem("parallel",RY),r.registerPreprocessor(IN),r.registerComponentModel(zN),r.registerComponentView(jY),il(r,"parallel",zN,g0e),KY(r)}function jN(r){It(Nx),r.registerChartView(yY),r.registerSeriesModel(_Y),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,xY)}var y0e=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r}(),_0e=function(r){Z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new y0e},e.prototype.buildPath=function(t,i){var n=i.extent;t.moveTo(i.x1,i.y1),t.bezierCurveTo(i.cpx1,i.cpy1,i.cpx2,i.cpy2,i.x2,i.y2),i.orient==="vertical"?(t.lineTo(i.x2+n,i.y2),t.bezierCurveTo(i.cpx2+n,i.cpy2,i.cpx1+n,i.cpy1,i.x1+n,i.y1)):(t.lineTo(i.x2,i.y2+n),t.bezierCurveTo(i.cpx2,i.cpy2+n,i.cpx1,i.cpy1+n,i.x1,i.y1+n)),t.closePath()},e.prototype.highlight=function(){Bn(this)},e.prototype.downplay=function(){kn(this)},e}(ut),x0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,i,n){var a=this,o=t.getGraph(),s=this.group,l=t.layoutInfo,u=l.width,c=l.height,f=t.getData(),h=t.getData("edge"),p=t.get("orient");this._model=t,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(d){var g=new _0e,m=rt(g);m.dataIndex=d.dataIndex,m.seriesIndex=t.seriesIndex,m.dataType="edge";var v=d.getModel(),_=v.getModel("lineStyle"),y=_.get("curveness"),x=d.node1.getLayout(),M=d.node1.getModel(),S=M.get("localX"),w=M.get("localY"),T=d.node2.getLayout(),C=d.node2.getModel(),b=C.get("localX"),E=C.get("localY"),I=d.getLayout(),R,A,D,U,B,z,k,G;g.shape.extent=Math.max(1,I.dy),g.shape.orient=p,p==="vertical"?(R=(S!=null?S*u:x.x)+I.sy,A=(w!=null?w*c:x.y)+x.dy,D=(b!=null?b*u:T.x)+I.ty,U=E!=null?E*c:T.y,B=R,z=A*(1-y)+U*y,k=D,G=A*y+U*(1-y)):(R=(S!=null?S*u:x.x)+x.dx,A=(w!=null?w*c:x.y)+I.sy,D=b!=null?b*u:T.x,U=(E!=null?E*c:T.y)+I.ty,B=R*(1-y)+D*y,z=A,k=R*y+D*(1-y),G=U),g.setShape({x1:R,y1:A,x2:D,y2:U,cpx1:B,cpy1:z,cpx2:k,cpy2:G}),g.useStyle(_.getItemStyle()),JY(g.style,p,d);var Y=""+v.get("value"),J=wr(v,"edgeLabel");Ir(g,J,{labelFetcher:{getFormattedLabel:function(K,ae,ve,ue,se,Ee){return t.getFormattedLabel(K,ae,"edge",ue,Xi(se,J.normal&&J.normal.get("formatter"),Y),Ee)}},labelDataIndex:d.dataIndex,defaultText:Y}),g.setTextConfig({position:"inside"});var Q=v.getModel("emphasis");Gr(g,v,"lineStyle",function(K){var ae=K.getItemStyle();return JY(ae,p,d),ae}),s.add(g),h.setItemGraphicEl(d.dataIndex,g);var V=Q.get("focus");ar(g,V==="adjacency"?d.getAdjacentDataIndices():V==="trajectory"?d.getTrajectoryDataIndices():V,Q.get("blurScope"),Q.get("disabled"))}),o.eachNode(function(d){var g=d.getLayout(),m=d.getModel(),v=m.get("localX"),_=m.get("localY"),y=m.getModel("emphasis"),x=new Et({shape:{x:v!=null?v*u:g.x,y:_!=null?_*c:g.y,width:g.dx,height:g.dy},style:m.getModel("itemStyle").getItemStyle(),z2:10});Ir(x,wr(m),{labelFetcher:{getFormattedLabel:function(S,w){return t.getFormattedLabel(S,w,"node")}},labelDataIndex:d.dataIndex,defaultText:d.id}),x.disableLabelAnimation=!0,x.setStyle("fill",d.getVisual("color")),x.setStyle("decal",d.getVisual("style").decal),Gr(x,m),s.add(x),f.setItemGraphicEl(d.dataIndex,x),rt(x).dataType="node";var M=y.get("focus");ar(x,M==="adjacency"?d.getAdjacentDataIndices():M==="trajectory"?d.getTrajectoryDataIndices():M,y.get("blurScope"),y.get("disabled"))}),f.eachItemGraphicEl(function(d,g){var m=f.getItemModel(g);m.get("draggable")&&(d.drift=function(v,_){a._focusAdjacencyDisabled=!0,this.shape.x+=v,this.shape.y+=_,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:f.getRawIndex(g),localX:this.shape.x/u,localY:this.shape.y/c})},d.ondragend=function(){a._focusAdjacencyDisabled=!1},d.draggable=!0,d.cursor="move")}),!this._data&&t.isAnimationEnabled()&&s.setClipPath(S0e(s.getBoundingRect(),t,function(){s.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(Yt);function JY(r,e,t){switch(r.fill){case"source":r.fill=t.node1.getVisual("color"),r.decal=t.node1.getVisual("style").decal;break;case"target":r.fill=t.node2.getVisual("color"),r.decal=t.node2.getVisual("style").decal;break;case"gradient":var i=t.node1.getVisual("color"),n=t.node2.getVisual("color");Ce(i)&&Ce(n)&&(r.fill=new zl(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:i,offset:0},{color:n,offset:1}]))}}function S0e(r,e,t){var i=new Et({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return or(i,{shape:{width:r.width+20}},e,t),i}var $Y=x0e;var M0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){var n=t.edges||t.links,a=t.data||t.nodes,o=t.levels;this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new Zt(o[l],this,i));if(a&&n){var u=Dx(a,n,this,!0,c);return u.data}function c(f,h){f.wrapMethod("getItemModel",function(p,d){var g=p.parentModel,m=g.getData().getItemLayout(d);if(m){var v=m.depth,_=g.levelModels[v];_&&(p.parentModel=_)}return p}),h.wrapMethod("getItemModel",function(p,d){var g=p.parentModel,m=g.getGraph().getEdgeByIndex(d),v=m.node1.getLayout();if(v){var _=v.depth,y=g.levelModels[_];y&&(p.parentModel=y)}return p})}},e.prototype.setNodePosition=function(t,i){var n=this.option.data||this.option.nodes,a=n[t];a.localX=i[0],a.localY=i[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,i,n){function a(p){return isNaN(p)||p==null}if(n==="edge"){var o=this.getDataParams(t,n),s=o.data,l=o.value,u=s.source+" -- "+s.target;return Or("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(t),f=c.getLayout().value,h=this.getDataParams(t,n).data.name;return Or("nameValue",{name:h!=null?h+"":null,value:f,noValue:a(f)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,i){var n=r.prototype.getDataParams.call(this,t,i);if(n.value==null&&i==="node"){var a=this.getGraph().getNodeByIndex(t),o=a.getLayout().value;n.value=o}return n},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(jt),QY=M0e;function JN(r,e){r.eachSeriesByType("sankey",function(t){var i=t.get("nodeWidth"),n=t.get("nodeGap"),a=b0e(t,e);t.layoutInfo=a;var o=a.width,s=a.height,l=t.getGraph(),u=l.nodes,c=l.edges;T0e(u);var f=Wt(u,function(g){return g.getLayout().value===0}),h=f.length!==0?0:t.get("layoutIterations"),p=t.get("orient"),d=t.get("nodeAlign");w0e(u,c,i,n,o,s,h,p,d)})}function b0e(r,e){return xr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function w0e(r,e,t,i,n,a,o,s,l){E0e(r,e,t,n,a,s,l),L0e(r,e,a,n,i,o,s),B0e(r,s)}function T0e(r){N(r,function(e){var t=jf(e.outEdges,OT),i=jf(e.inEdges,OT),n=e.getValue()||0,a=Math.max(t,i,n);e.setLayout({value:a},!0)})}function E0e(r,e,t,i,n,a,o){for(var s=[],l=[],u=[],c=[],f=0,h=0;h=0;v&&m.depth>p&&(p=m.depth),g.setLayout({depth:v?m.depth:f},!0),a==="vertical"?g.setLayout({dy:t},!0):g.setLayout({dx:t},!0);for(var _=0;_f-1?p:f-1;o&&o!=="left"&&A0e(r,o,a,w);var T=a==="vertical"?(n-t)/w:(i-t)/w;R0e(r,T,a)}function eq(r){var e=r.hostGraph.data.getRawDataItem(r.dataIndex);return e.depth!=null&&e.depth>=0}function A0e(r,e,t,i){if(e==="right"){for(var n=[],a=r,o=0;a.length;){for(var s=0;s0;a--)l*=.99,I0e(s,l,o),KN(s,n,t,i,o),F0e(s,l,o),KN(s,n,t,i,o)}function P0e(r,e){var t=[],i=e==="vertical"?"y":"x",n=o_(r,function(a){return a.getLayout()[i]});return n.keys.sort(function(a,o){return a-o}),N(n.keys,function(a){t.push(n.buckets.get(a))}),t}function D0e(r,e,t,i,n,a){var o=1/0;N(r,function(s){var l=s.length,u=0;N(s,function(f){u+=f.getLayout().value});var c=a==="vertical"?(i-(l-1)*n)/u:(t-(l-1)*n)/u;c0&&(s=l.getLayout()[a]+u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[h]+e;var d=n==="vertical"?i:t;if(u=c-e-d,u>0){s=l.getLayout()[a]-u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var p=f-2;p>=0;--p)l=o[p],u=l.getLayout()[a]+l.getLayout()[h]+e-c,u>0&&(s=l.getLayout()[a]-u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function I0e(r,e,t){N(r.slice().reverse(),function(i){N(i,function(n){if(n.outEdges.length){var a=jf(n.outEdges,N0e,t)/jf(n.outEdges,OT);if(isNaN(a)){var o=n.outEdges.length;a=o?jf(n.outEdges,U0e,t)/o:0}if(t==="vertical"){var s=n.getLayout().x+(a-Kf(n,t))*e;n.setLayout({x:s},!0)}else{var l=n.getLayout().y+(a-Kf(n,t))*e;n.setLayout({y:l},!0)}}})})}function N0e(r,e){return Kf(r.node2,e)*r.getValue()}function U0e(r,e){return Kf(r.node2,e)}function O0e(r,e){return Kf(r.node1,e)*r.getValue()}function z0e(r,e){return Kf(r.node1,e)}function Kf(r,e){return e==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function OT(r){return r.getValue()}function jf(r,e,t){for(var i=0,n=r.length,a=-1;++ao&&(o=l)}),N(i,function(s){var l=new pi({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}n.length&&N(n,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function QN(r){r.registerChartView($Y),r.registerSeriesModel(QY),r.registerLayout(JN),r.registerVisual($N),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(i){i.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var zT=function(){function r(){}return r.prototype.getInitialData=function(e,t){var i,n=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=n.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",i=n.getOrdinalMeta(),l=!0):s==="category"?(e.layout="vertical",i=a.getOrdinalMeta(),l=!0):e.layout=e.layout||"horizontal";var u=["x","y"],c=e.layout==="horizontal"?0:1,f=this._baseAxisDim=u[c],h=u[1-c],p=[n,a],d=p[c].get("type"),g=p[1-c].get("type"),m=e.data;if(m&&l){var v=[];N(m,function(x,M){var S;pe(x)?(S=x.slice(),x.unshift(M)):pe(x.value)?(S=fe({},x),S.value=S.value.slice(),x.value.unshift(M)):S=x,v.push(S)}),e.data=v}var _=this.defaultValueDimensions,y=[{name:f,type:Zp(d),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:Zp(g),dimsDef:_.slice()}];return To(this,{coordDimensions:y,dimensionsCount:_.length+1,encodeDefaulter:ot(Dw,y,this)})},r.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},r}();var tq=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],t.visualDrawType="stroke",t}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(jt);br(tq,zT,!0);var rq=tq;var k0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),f=iq(c,a,u,l,!0);a.setItemGraphicEl(u,f),o.add(f)}}).update(function(u,c){var f=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(f);return}var h=a.getItemLayout(u);f?(Di(f),nq(h,f,a,u)):f=iq(h,a,u,l),o.add(f),a.setItemGraphicEl(u,f)}).remove(function(u){var c=s.getItemGraphicEl(u);c&&o.remove(c)}).execute(),this._data=a},e.prototype.remove=function(t){var i=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl(function(a){a&&i.remove(a)})},e.type="boxplot",e}(Yt),V0e=function(){function r(){}return r}(),G0e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="boxplotBoxPath",i}return e.prototype.getDefaultShape=function(){return new V0e},e.prototype.buildPath=function(t,i){var n=i.points,a=0;for(t.moveTo(n[a][0],n[a][1]),a++;a<4;a++)t.lineTo(n[a][0],n[a][1]);for(t.closePath();ag){var x=[v,y];i.push(x)}}}return{boxData:t,outliers:i}}var oq={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==Ei){var i="";ur(i)}var n=tU(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:n.boxData},{data:n.outliers}]}};function rU(r){r.registerSeriesModel(rq),r.registerChartView(aq),r.registerLayout(eU),r.registerTransform(oq)}var q0e=["color","borderColor"],Z0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,i,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,i,n,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,i):this._incrementalRenderNormal(t,i)},e.prototype.eachRendered=function(t){ca(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var i=t.pipelineContext.large;(this._isLargeDraw==null||i!==this._isLargeDraw)&&(this._isLargeDraw=i,this._clear())},e.prototype._renderNormal=function(t){var i=t.getData(),n=this._data,a=this.group,o=i.getLayout("isSimpleBox"),s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),i.diff(n).add(function(c){if(i.hasValue(c)){var f=i.getItemLayout(c);if(s&&sq(u,f))return;var h=iU(f,c,!0);or(h,{shape:{points:f.ends}},t,c),nU(h,i,c,o),a.add(h),i.setItemGraphicEl(c,h)}}).update(function(c,f){var h=n.getItemGraphicEl(f);if(!i.hasValue(c)){a.remove(h);return}var p=i.getItemLayout(c);if(s&&sq(u,p)){a.remove(h);return}h?(Dt(h,{shape:{points:p.ends}},t,c),Di(h)):h=iU(p,c),nU(h,i,c,o),a.add(h),i.setItemGraphicEl(c,h)}).remove(function(c){var f=n.getItemGraphicEl(c);f&&a.remove(f)}).execute(),this._data=i},e.prototype._renderLarge=function(t){this._clear(),lq(t,this.group);var i=t.get("clip",!0)?Yl(t.coordinateSystem,!1,t):null;i?this.group.setClipPath(i):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,i){for(var n=i.getData(),a=n.getLayout("isSimpleBox"),o;(o=t.next())!=null;){var s=n.getItemLayout(o),l=iU(s,o);nU(l,n,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,i){lq(i,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(Yt),j0e=function(){function r(){}return r}(),K0e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="normalCandlestickBox",i}return e.prototype.getDefaultShape=function(){return new j0e},e.prototype.buildPath=function(t,i){var n=i.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(ut);function iU(r,e,t){var i=r.ends;return new K0e({shape:{points:t?J0e(i,r):i},z2:100})}function sq(r,e){for(var t=!0,i=0;i0?"borderColor":"borderColor0"])||t.get(["itemStyle",r>0?"color":"color0"]);r===0&&(n=t.get(["itemStyle","borderColorDoji"]));var a=t.getModel("itemStyle").getItemStyle(q0e);e.useStyle(a),e.style.fill=null,e.style.stroke=n}var uq=Z0e;var cq=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],t}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,i,n){var a=i.getItemLayout(t);return a&&n.rect(a.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(jt);br(cq,zT,!0);var fq=cq;function sU(r){!r||!pe(r.series)||N(r.series,function(e){qe(e)&&e.type==="k"&&(e.type="candlestick")})}var Q0e=["itemStyle","borderColor"],e_e=["itemStyle","borderColor0"],t_e=["itemStyle","borderColorDoji"],r_e=["itemStyle","color"],i_e=["itemStyle","color0"],n_e={seriesType:"candlestick",plan:Mo(),performRawSeries:!0,reset:function(r,e){function t(a,o){return o.get(a>0?r_e:i_e)}function i(a,o){return o.get(a===0?t_e:a>0?Q0e:e_e)}if(!e.isSeriesFiltered(r)){var n=r.pipelineContext.large;return!n&&{progress:function(a,o){for(var s;(s=a.next())!=null;){var l=o.getItemModel(s),u=o.getItemLayout(s).sign,c=l.getItemStyle();c.fill=t(u,l),c.stroke=i(u,l)||c.fill;var f=o.ensureUniqueItemVisual(s,"style");fe(f,c)}}}}}},hq=n_e;var a_e={seriesType:"candlestick",plan:Mo(),reset:function(r){var e=r.coordinateSystem,t=r.getData(),i=o_e(r,t),n=0,a=1,o=["x","y"],s=t.getDimensionIndex(t.mapDimension(o[n])),l=de(t.mapDimensionsAll(o[a]),t.getDimensionIndex,t),u=l[0],c=l[1],f=l[2],h=l[3];if(t.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),s<0||l.length<4)return;return{progress:r.pipelineContext.large?d:p};function p(g,m){for(var v,_=m.getStore();(v=g.next())!=null;){var y=_.get(s,v),x=_.get(u,v),M=_.get(c,v),S=_.get(f,v),w=_.get(h,v),T=Math.min(x,M),C=Math.max(x,M),b=B(T,y),E=B(C,y),I=B(S,y),R=B(w,y),A=[];z(A,E,0),z(A,b,1),A.push(G(R),G(E),G(I),G(b));var D=m.getItemModel(v),U=!!D.get(["itemStyle","borderColorDoji"]);m.setItemLayout(v,{sign:pq(_,v,x,M,c,U),initBaseline:x>M?E[a]:b[a],ends:A,brushRect:k(S,w,y)})}function B(Y,J){var Q=[];return Q[n]=J,Q[a]=Y,isNaN(J)||isNaN(Y)?[NaN,NaN]:e.dataToPoint(Q)}function z(Y,J,Q){var V=J.slice(),K=J.slice();V[n]=M_(V[n]+i/2,1,!1),K[n]=M_(K[n]-i/2,1,!0),Q?Y.push(V,K):Y.push(K,V)}function k(Y,J,Q){var V=B(Y,Q),K=B(J,Q);return V[n]-=i/2,K[n]-=i/2,{x:V[0],y:V[1],width:a?i:K[0]-V[0],height:a?K[1]-V[1]:i}}function G(Y){return Y[n]=M_(Y[n],1),Y}}function d(g,m){for(var v=pa(g.count*4),_=0,y,x=[],M=[],S,w=m.getStore(),T=!!r.get(["itemStyle","borderColorDoji"]);(S=g.next())!=null;){var C=w.get(s,S),b=w.get(u,S),E=w.get(c,S),I=w.get(f,S),R=w.get(h,S);if(isNaN(C)||isNaN(I)||isNaN(R)){v[_++]=NaN,_+=3;continue}v[_++]=pq(w,S,b,E,c,T),x[n]=C,x[a]=I,y=e.dataToPoint(x,null,M),v[_++]=y?y[0]:NaN,v[_++]=y?y[1]:NaN,x[a]=R,y=e.dataToPoint(x,null,M),v[_++]=y?y[1]:NaN}m.setLayout("largePoints",v)}}};function pq(r,e,t,i,n,a){var o;return t>i?o=-1:t0?r.get(n,e-1)<=i?1:-1:1,o}function o_e(r,e){var t=r.getBaseAxis(),i,n=t.type==="category"?t.getBandWidth():(i=t.getExtent(),Math.abs(i[1]-i[0])/e.count()),a=ze(ft(r.get("barMaxWidth"),n),n),o=ze(ft(r.get("barMinWidth"),1),n),s=r.get("barWidth");return s!=null?ze(s,n):Math.max(Math.min(n/2,a),o)}var dq=a_e;function lU(r){r.registerChartView(uq),r.registerSeriesModel(fq),r.registerPreprocessor(sU),r.registerVisual(hq),r.registerLayout(dq)}function mq(r,e){var t=e.rippleEffectColor||e.color;r.eachChild(function(i){i.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var s_e=function(r){Z(e,r);function e(t,i){var n=r.call(this)||this,a=new Bu(t,i),o=new Ze;return n.add(a),n.add(o),n.updateData(t,i),n}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var i=t.symbolType,n=t.color,a=t.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var h=void 0;He(f)?h=f(n):h=f,a.__t>0&&(h=-s*a.__t),this._animateSymbol(a,s,h,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,i,n,a,o){if(i>0){t.__t=0;var s=this,l=t.animate("",a).when(o?i*2:i,{__t:o?2:1}).delay(n).during(function(){s._updateSymbolPosition(t)});a||l.done(function(){s.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return Yo(t.__p1,t.__cp1)+Yo(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,i){t.__p1=i[0],t.__p2=i[1],t.__cp1=i[2]||[(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2]},e.prototype.updateData=function(t,i,n){this.childAt(0).updateData(t,i,n),this._updateEffectSymbol(t,i)},e.prototype._updateSymbolPosition=function(t){var i=t.__p1,n=t.__p2,a=t.__cp1,o=t.__t<1?t.__t:2-t.__t,s=[t.x,t.y],l=s.slice(),u=vi,c=H0;s[0]=u(i[0],a[0],n[0],o),s[1]=u(i[1],a[1],n[1],o);var f=t.__t<1?c(i[0],a[0],n[0],o):c(n[0],a[0],i[0],1-o),h=t.__t<1?c(i[1],a[1],n[1],o):c(n[1],a[1],i[1],1-o);t.rotation=-Math.atan2(h,f)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT=0&&!(a[l]<=i);l--);l=Math.min(l,o-2)}else{for(l=s;li);l++);l=Math.min(l-1,o-2)}var c=(i-a[l])/(a[l+1]-a[l]),f=n[l],h=n[l+1];t.x=f[0]*(1-c)+c*h[0],t.y=f[1]*(1-c)+c*h[1];var p=t.__t<1?h[0]-f[0]:f[0]-h[0],d=t.__t<1?h[1]-f[1]:f[1]-h[1];t.rotation=-Math.atan2(d,p)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=i,t.ignore=!1}},e}(FT),_q=h_e;var p_e=function(){function r(){this.polyline=!1,this.curveness=0,this.segs=[]}return r}(),d_e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i._off=0,i.hoverDataIdx=-1,i}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new p_e},e.prototype.buildPath=function(t,i){var n=i.segs,a=i.curveness,o;if(i.polyline)for(o=this._off;o0){t.moveTo(n[o++],n[o++]);for(var l=1;l0){var p=(u+f)/2-(c-h)*a,d=(c+h)/2-(f-u)*a;t.quadraticCurveTo(p,d,f,h)}else t.lineTo(f,h)}this.incremental&&(this._off=o,this.notClear=!0)},e.prototype.findDataIndex=function(t,i){var n=this.shape,a=n.segs,o=n.curveness,s=this.style.lineWidth;if(n.polyline)for(var l=0,u=0;u0)for(var f=a[u++],h=a[u++],p=1;p0){var m=(f+d)/2-(h-g)*o,v=(h+g)/2-(d-f)*o;if(Kb(f,h,m,v,d,g,s,t,i))return l}else if(Nl(f,h,d,g,s,t,i))return l;l++}return-1},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect();if(t=n[0],i=n[1],a.contain(t,i)){var o=this.hoverDataIdx=this.findDataIndex(t,i);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var i=this.shape,n=i.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+e.__startIndex)})},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),xq=m_e;var v_e={seriesType:"lines",plan:Mo(),reset:function(r){var e=r.coordinateSystem;if(e){var t=r.get("polyline"),i=r.pipelineContext.large;return{progress:function(n,a){var o=[];if(i){var s=void 0,l=n.end-n.start;if(t){for(var u=0,c=n.start;c0&&(c||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var f=t.get("clip",!0)&&Yl(t.coordinateSystem,!1,t);f?this.group.setClipPath(f):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,i,n){var a=t.getData(),o=this._updateLineDraw(a,t);o.incrementalPrepareUpdate(a),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,i,n){this._lineDraw.incrementalUpdate(t,i.getData()),this._finished=t.end===i.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,i,n){var a=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=kT.reset(t,i,n);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,i){var n=this._lineDraw,a=this._showEffect(i),o=!!i.get("polyline"),s=i.pipelineContext,l=s.large;return(!n||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(n&&n.remove(),n=this._lineDraw=l?new xq:new Bv(o?a?_q:BT:a?FT:Fv),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var i=t.getZr(),n=i.painter.getType()==="svg";!n&&this._lastZlevel!=null&&i.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,i){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(i)},e.prototype.dispose=function(t,i){this.remove(t,i)},e.type="lines",e}(Yt),Sq=g_e;var y_e=typeof Uint32Array>"u"?Array:Uint32Array,__e=typeof Float64Array>"u"?Array:Float64Array;function Mq(r){var e=r.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(r.data=de(e,function(t){var i=[t[0].coord,t[1].coord],n={coords:i};return t[0].name&&(n.fromName=t[0].name),t[1].name&&(n.toName=t[1].name),bm([n,t[0],t[1]])}))}var x_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.init=function(t){t.data=t.data||[],Mq(t);var i=this._processFlatCoordsArray(t.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(t.data=new Float32Array(i.count)),r.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(Mq(t),t.data){var i=this._processFlatCoordsArray(t.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(t.data=new Float32Array(i.count))}r.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var i=this._processFlatCoordsArray(t.data);i.flatCoords&&(this._flatCoords?(this._flatCoords=rp(this._flatCoords,i.flatCoords),this._flatCoordsOffset=rp(this._flatCoordsOffset,i.flatCoordsOffset)):(this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset),t.data=new Float32Array(i.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var i=this.getData().getItemModel(t),n=i.option instanceof Array?i.option:i.getShallow("coords");return n},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[t*2+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,i){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],o=0;on}}return{flatCoordsOffset:new Uint32Array(a.buffer,0,l),flatCoords:o,count:u}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,i){if(0)var n;var a=new ri(["value"],this);return a.hasItemOption=!1,a.initData(t.data,[],function(o,s,l,u){if(o instanceof Array)return NaN;a.hasItemOption=!0;var c=o.value;if(c!=null)return c instanceof Array?c[u]:c}),a},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=a.getItemModel(t),s=o.get("name");if(s)return s;var l=o.get("fromName"),u=o.get("toName"),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Or("nameValue",{name:c.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?1e4:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?2e4:this.get("progressiveThreshold"))},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),i=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&i>0?i+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(jt),bq=x_e;function VT(r){return r instanceof Array||(r=[r,r]),r}var S_e={seriesType:"lines",reset:function(r){var e=VT(r.get("symbol")),t=VT(r.get("symbolSize")),i=r.getData();i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",t&&t[0]),i.setVisual("toSymbolSize",t&&t[1]);function n(a,o){var s=a.getItemModel(o),l=VT(s.getShallow("symbol",!0)),u=VT(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:i.hasItemOption?n:null}}},wq=S_e;function cU(r){r.registerChartView(Sq),r.registerSeriesModel(bq),r.registerLayout(kT),r.registerVisual(wq)}var M_e=256,b_e=function(){function r(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=Fn.createCanvas();this.canvas=e}return r.prototype.update=function(e,t,i,n,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,f=this.canvas,h=f.getContext("2d"),p=e.length;f.width=t,f.height=i;for(var d=0;d0){var I=o(y)?l:u;y>0&&(y=y*b+T),M[S++]=I[E],M[S++]=I[E+1],M[S++]=I[E+2],M[S++]=I[E+3]*y*256}else S+=4}return h.putImageData(x,0,0),f},r.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=Fn.createCanvas()),t=this.pointSize+this.blurSize,i=t*2;e.width=i,e.height=i;var n=e.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-t,t,this.pointSize,0,Math.PI*2,!0),n.closePath(),n.fill(),e},r.prototype._getGradient=function(e,t){for(var i=this._gradientPixels,n=i[t]||(i[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,a),n[o++]=a[0],n[o++]=a[1],n[o++]=a[2],n[o++]=a[3];return n},r}(),Tq=b_e;function w_e(r,e,t){var i=r[1]-r[0];e=de(e,function(o){return{interval:[(o.interval[0]-r[0])/i,(o.interval[1]-r[0])/i]}});var n=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&i<=e[1]}}function Eq(r){var e=r.dimensions;return e[0]==="lng"&&e[1]==="lat"}var E_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a;i.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===t&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):Eq(o)&&this._renderOnGeo(o,t,a,n)},e.prototype.incrementalPrepareRender=function(t,i,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,i,n,a){var o=i.coordinateSystem;o&&(Eq(o)?this.render(i,n,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(i,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){ca(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,i,n,a,o){var s=t.coordinateSystem,l=us(s,"cartesian2d"),u,c,f,h;if(l){var p=s.getAxis("x"),d=s.getAxis("y");u=p.getBandWidth()+.5,c=d.getBandWidth()+.5,f=p.scale.getExtent(),h=d.scale.getExtent()}for(var g=this.group,m=t.getData(),v=t.getModel(["emphasis","itemStyle"]).getItemStyle(),_=t.getModel(["blur","itemStyle"]).getItemStyle(),y=t.getModel(["select","itemStyle"]).getItemStyle(),x=t.get(["itemStyle","borderRadius"]),M=wr(t),S=t.getModel("emphasis"),w=S.get("focus"),T=S.get("blurScope"),C=S.get("disabled"),b=l?[m.mapDimension("x"),m.mapDimension("y"),m.mapDimension("value")]:[m.mapDimension("time"),m.mapDimension("value")],E=n;Ef[1]||Dh[1])continue;var U=s.dataToPoint([A,D]);I=new Et({shape:{x:U[0]-u/2,y:U[1]-c/2,width:u,height:c},style:R})}else{if(isNaN(m.get(b[1],E)))continue;I=new Et({z2:1,shape:s.dataToRect([m.get(b[0],E)]).contentShape,style:R})}if(m.hasItemOption){var B=m.getItemModel(E),z=B.getModel("emphasis");v=z.getModel("itemStyle").getItemStyle(),_=B.getModel(["blur","itemStyle"]).getItemStyle(),y=B.getModel(["select","itemStyle"]).getItemStyle(),x=B.get(["itemStyle","borderRadius"]),w=z.get("focus"),T=z.get("blurScope"),C=z.get("disabled"),M=wr(B)}I.shape.r=x;var k=t.getRawValue(E),G="-";k&&k[2]!=null&&(G=k[2]+""),Ir(I,M,{labelFetcher:t,labelDataIndex:E,defaultOpacity:R.opacity,defaultText:G}),I.ensureState("emphasis").style=v,I.ensureState("blur").style=_,I.ensureState("select").style=y,ar(I,w,T,C),I.incremental=o,o&&(I.states.emphasis.hoverLayer=!0),g.add(I),m.setItemGraphicEl(E,I),this._progressiveEls&&this._progressiveEls.push(I)}},e.prototype._renderOnGeo=function(t,i,n,a){var o=n.targetVisuals.inRange,s=n.targetVisuals.outOfRange,l=i.getData(),u=this._hmLayer||this._hmLayer||new Tq;u.blurSize=i.get("blurSize"),u.pointSize=i.get("pointSize"),u.minOpacity=i.get("minOpacity"),u.maxOpacity=i.get("maxOpacity");var c=t.getViewRect().clone(),f=t.getRoamTransform();c.applyTransform(f);var h=Math.max(c.x,0),p=Math.max(c.y,0),d=Math.min(c.width+c.x,a.getWidth()),g=Math.min(c.height+c.y,a.getHeight()),m=d-h,v=g-p,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],y=l.mapArray(_,function(w,T,C){var b=t.dataToPoint([w,T]);return b[0]-=h,b[1]-=p,b.push(C),b}),x=n.getExtent(),M=n.type==="visualMap.continuous"?T_e(x,n.option.range):w_e(x,n.getPieceList(),n.option.selected);u.update(y,m,v,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},M);var S=new Ur({style:{width:m,height:v,x:h,y:p,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(Yt),Aq=E_e;var A_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){return hn(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=Nu.get(this.get("coordinateSystem"));if(t&&t.dimensions)return t.dimensions[0]==="lng"&&t.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(jt),Cq=A_e;function fU(r){r.registerChartView(Aq),r.registerSeriesModel(Cq)}var C_e=["itemStyle","borderWidth"],Rq=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],hU=new ua,R_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),f=l.master.getRect(),h={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:c,valueDim:Rq[+c],categoryDim:Rq[1-+c]};o.diff(s).add(function(d){if(o.hasValue(d)){var g=Pq(o,d),m=Lq(o,d,g,h),v=Dq(o,h,m);o.setItemGraphicEl(d,v),a.add(v),Nq(v,h,m)}}).update(function(d,g){var m=s.getItemGraphicEl(g);if(!o.hasValue(d)){a.remove(m);return}var v=Pq(o,d),_=Lq(o,d,v,h),y=Vq(o,_);m&&y!==m.__pictorialShapeStr&&(a.remove(m),o.setItemGraphicEl(d,null),m=null),m?O_e(m,h,_):m=Dq(o,h,_,!0),o.setItemGraphicEl(d,m),m.__pictorialSymbolMeta=_,a.add(m),Nq(m,h,_)}).remove(function(d){var g=s.getItemGraphicEl(d);g&&Iq(s,d,g.__pictorialSymbolMeta.animationModel,g)}).execute();var p=t.get("clip",!0)?Yl(t.coordinateSystem,!1,t):null;return p?a.setClipPath(p):a.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(t,i){var n=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(o){Iq(a,rt(o).dataIndex,t,o)}):n.removeAll()},e.type="pictorialBar",e}(Yt);function Lq(r,e,t,i){var n=r.getItemLayout(e),a=t.get("symbolRepeat"),o=t.get("symbolClip"),s=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=t.get("symbolPatternSize")||2,f=t.isAnimationEnabled(),h={dataIndex:e,layout:n,itemModel:t,symbolType:r.getItemVisual(e,"symbol")||"circle",style:r.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:f?t:null,hoverScale:f&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};L_e(t,a,n,i,h),P_e(r,e,n,a,o,h.boundingLength,h.pxSign,c,i,h),D_e(t,h.symbolScale,u,i,h);var p=h.symbolSize,d=bo(t.get("symbolOffset"),p);return I_e(t,p,n,a,o,d,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,i,h),h}function L_e(r,e,t,i,n){var a=i.valueDim,o=r.get("symbolBoundingData"),s=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(t[a.wh]<=0),c;if(pe(o)){var f=[pU(s,o[0])-l,pU(s,o[1])-l];f[1]0?1:-1}function pU(r,e){return r.toGlobalCoord(r.dataToCoord(r.scale.parse(e)))}function P_e(r,e,t,i,n,a,o,s,l,u){var c=l.valueDim,f=l.categoryDim,h=Math.abs(t[f.wh]),p=r.getItemVisual(e,"symbolSize"),d;pe(p)?d=p.slice():p==null?d=["100%","100%"]:d=[p,p],d[f.index]=ze(d[f.index],h),d[c.index]=ze(d[c.index],i?h:Math.abs(a)),u.symbolSize=d;var g=u.symbolScale=[d[0]/s,d[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*o}function D_e(r,e,t,i,n){var a=r.get(C_e)||0;a&&(hU.attr({scaleX:e[0],scaleY:e[1],rotation:t}),hU.updateTransform(),a/=hU.getLineScale(),a*=e[i.valueDim.index]),n.valueLineWidth=a||0}function I_e(r,e,t,i,n,a,o,s,l,u,c,f){var h=c.categoryDim,p=c.valueDim,d=f.pxSign,g=Math.max(e[p.index]+s,0),m=g;if(i){var v=Math.abs(l),_=Br(r.get("symbolMargin"),"15%")+"",y=!1;_.lastIndexOf("!")===_.length-1&&(y=!0,_=_.slice(0,_.length-1));var x=ze(_,e[p.index]),M=Math.max(g+x*2,0),S=y?0:x*2,w=xp(i),T=w?i:Uq((v+S)/M),C=v-T*g;x=C/2/(y?T:Math.max(T-1,1)),M=g+x*2,S=y?0:x*2,!w&&i!=="fixed"&&(T=u?Uq((Math.abs(u)+S)/M):0),m=T*M-S,f.repeatTimes=T,f.symbolMargin=x}var b=d*(m/2),E=f.pathPosition=[];E[h.index]=t[h.wh]/2,E[p.index]=o==="start"?b:o==="end"?l-b:l/2,a&&(E[0]+=a[0],E[1]+=a[1]);var I=f.bundlePosition=[];I[h.index]=t[h.xy],I[p.index]=t[p.xy];var R=f.barRectShape=fe({},t);R[p.wh]=d*Math.max(Math.abs(t[p.wh]),Math.abs(E[p.index]+b)),R[h.wh]=t[h.wh];var A=f.clipShape={};A[h.xy]=-t[h.xy],A[h.wh]=c.ecSize[h.wh],A[p.xy]=0,A[p.wh]=t[p.wh]}function Oq(r){var e=r.symbolPatternSize,t=Sr(r.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function zq(r,e,t,i){var n=r.__pictorialBundle,a=t.symbolSize,o=t.valueLineWidth,s=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,c=0,f=a[e.valueDim.index]+o+t.symbolMargin*2;for(dU(r,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c0:v<0)&&(_=u-1-g),m[l.index]=f*(_-u/2+.5)+s[l.index],{x:m[0],y:m[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function Fq(r,e,t,i){var n=r.__pictorialBundle,a=r.__pictorialMainPath;a?Xv(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,i):(a=r.__pictorialMainPath=Oq(t),n.add(a),Xv(a,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:0,scaleY:0,rotation:t.rotation},{scaleX:t.symbolScale[0],scaleY:t.symbolScale[1]},t,i))}function Bq(r,e,t){var i=fe({},e.barRectShape),n=r.__pictorialBarRect;n?Xv(n,null,{shape:i},e,t):(n=r.__pictorialBarRect=new Et({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),n.disableMorphing=!0,r.add(n))}function kq(r,e,t,i){if(t.symbolClip){var n=r.__pictorialClipPath,a=fe({},t.clipShape),o=e.valueDim,s=t.animationModel,l=t.dataIndex;if(n)Dt(n,{shape:a},s,l);else{a[o.wh]=0,n=new Et({shape:a}),r.__pictorialBundle.setClipPath(n),r.__pictorialClipPath=n;var u={};u[o.wh]=t.clipShape[o.wh],Rt[i?"updateProps":"initProps"](n,{shape:u},s,l)}}}function Pq(r,e){var t=r.getItemModel(e);return t.getAnimationDelayParams=N_e,t.isAnimationEnabled=U_e,t}function N_e(r){return{index:r.__pictorialAnimationIndex,count:r.__pictorialRepeatTimes}}function U_e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function Dq(r,e,t,i){var n=new Ze,a=new Ze;return n.add(a),n.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?zq(n,e,t):Fq(n,e,t),Bq(n,t,i),kq(n,e,t,i),n.__pictorialShapeStr=Vq(r,t),n.__pictorialSymbolMeta=t,n}function O_e(r,e,t){var i=t.animationModel,n=t.dataIndex,a=r.__pictorialBundle;Dt(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},i,n),t.symbolRepeat?zq(r,e,t,!0):Fq(r,e,t,!0),Bq(r,t,!0),kq(r,e,t,!0)}function Iq(r,e,t,i){var n=i.__pictorialBarRect;n&&n.removeTextContent();var a=[];dU(i,function(o){a.push(o)}),i.__pictorialMainPath&&a.push(i.__pictorialMainPath),i.__pictorialClipPath&&(t=null),N(a,function(o){ts(o,{scaleX:0,scaleY:0},t,e,function(){i.parent&&i.parent.remove(i)})}),r.setItemGraphicEl(e,null)}function Vq(r,e){return[r.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function dU(r,e,t){N(r.__pictorialBundle.children(),function(i){i!==r.__pictorialBarRect&&e.call(t,i)})}function Xv(r,e,t,i,n,a){e&&r.attr(e),i.symbolClip&&!n?t&&r.attr(t):t&&Rt[n?"updateProps":"initProps"](r,t,i.animationModel,i.dataIndex,a)}function Nq(r,e,t){var i=t.dataIndex,n=t.itemModel,a=n.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=n.getModel(["blur","itemStyle"]).getItemStyle(),l=n.getModel(["select","itemStyle"]).getItemStyle(),u=n.getShallow("cursor"),c=a.get("focus"),f=a.get("blurScope"),h=a.get("scale");dU(r,function(g){if(g instanceof Ur){var m=g.style;g.useStyle(fe({image:m.image,x:m.x,y:m.y,width:m.width,height:m.height},t.style))}else g.useStyle(t.style);var v=g.ensureState("emphasis");v.style=o,h&&(v.scaleX=g.scaleX*1.1,v.scaleY=g.scaleY*1.1),g.ensureState("blur").style=s,g.ensureState("select").style=l,u&&(g.cursor=u),g.z2=t.z2});var p=e.valueDim.posDesc[+(t.boundingLength>0)],d=r.__pictorialBarRect;d.ignoreClip=!0,Ir(d,wr(n),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:el(e.seriesModel.getData(),i),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:p}),ar(r,c,f,a.get("disabled"))}function Uq(r){var e=Math.round(r);return Math.abs(r-e)<1e-4?e:Math.ceil(r)}var Gq=R_e;var z_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t.defaultSymbol="roundRect",t}return e.prototype.getInitialData=function(t){return t.stack=null,r.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=Hn(Ev.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(Ev),Hq=z_e;function mU(r){r.registerChartView(Gq),r.registerSeriesModel(Hq),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ot(b1,"pictorialBar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,w1("pictorialBar"))}var F_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this,s=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,f=u.boundaryGap;s.x=0,s.y=c.y+f[0];function h(m){return m.name}var p=new An(this._layersSeries||[],l,h,h),d=[];p.add(Be(g,this,"add")).update(Be(g,this,"update")).remove(Be(g,this,"remove")).execute();function g(m,v,_){var y=o._layers;if(m==="remove"){s.remove(y[v]);return}for(var x=[],M=[],S,w=l[v].indices,T=0;Ta&&(a=s),i.push(s)}for(var u=0;ua&&(a=f)}return{y0:n,max:a}}function yU(r){r.registerChartView(Wq),r.registerSeriesModel(Xq),r.registerLayout(gU),r.registerProcessor(rl("themeRiver"))}var G_e=2,H_e=4,W_e=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this)||this;o.z2=G_e,o.textConfig={inside:!0},rt(o).seriesIndex=i.seriesIndex;var s=new Lt({z2:H_e,silent:t.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,t,i,n,a),o}return e.prototype.updateData=function(t,i,n,a,o){this.node=i,i.piece=this,n=n||this._seriesModel,a=a||this._ecModel;var s=this;rt(s).dataIndex=i.dataIndex;var l=i.getModel(),u=l.getModel("emphasis"),c=i.getLayout(),f=fe({},c);f.label=null;var h=i.getVisual("style");h.lineJoin="bevel";var p=i.getVisual("decal");p&&(h.decal=js(p,o));var d=ql(l.getModel("itemStyle"),f,!0);fe(f,d),N(Fi,function(_){var y=s.ensureState(_),x=l.getModel([_,"itemStyle"]);y.style=x.getItemStyle();var M=ql(x,f);M&&(y.shape=M)}),t?(s.setShape(f),s.shape.r=c.r0,or(s,{shape:{r:c.r}},n,i.dataIndex)):(Dt(s,{shape:f},n),Di(s)),s.useStyle(h),this._updateLabel(n);var g=l.getShallow("cursor");g&&s.attr("cursor",g),this._seriesModel=n||this._seriesModel,this._ecModel=a||this._ecModel;var m=u.get("focus"),v=m==="ancestor"?i.getAncestorsIndices():m==="descendant"?i.getDescendantIndices():m;ar(this,v,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var i=this,n=this.node.getModel(),a=n.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),f=this,h=f.getTextContent(),p=this.node.dataIndex,d=a.get("minAngle")/180*Math.PI,g=a.get("show")&&!(d!=null&&Math.abs(s)A&&!xu(U-A)&&U0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,t,i,n):(o.virtualPiece=new _U(_,t,i,n),c.add(o.virtualPiece)),y.piece.off("click"),o.virtualPiece.on("click",function(x){o._rootToNode(y.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(i){var n=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(o){if(!n&&o.piece&&o.piece===i.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")t._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";Gp(u,c)}}n=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:GT,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,i){var n=i.getData(),a=n.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(Yt),jq=Y_e;var q_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,i){var n={name:t.name,children:t.data};Kq(n);var a=this._levelModels=de(t.levels||[],function(l){return new Zt(l,this,i)},this),o=Dv.createTree(n,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var f=o.getNodeByDataIndex(c),h=a[f.depth];return h&&(u.parentModel=h),u})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treePathInfo=Zf(n,this),i},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var i=this.getRawData().tree.root;(!t||t!==i&&!i.contains(t))&&(this._viewRoot=i)},e.prototype.enableAriaDecal=function(){Mx(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(jt);function Kq(r){var e=0;N(r.children,function(i){Kq(i);var n=i.value;pe(n)&&(n=n[0]),e+=n});var t=r.value;pe(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),pe(r.value)?r.value[0]=t:r.value=t}var Jq=q_e;var $q=Math.PI/180;function xU(r,e,t){e.eachSeriesByType(r,function(i){var n=i.get("center"),a=i.get("radius");pe(a)||(a=[0,a]),pe(n)||(n=[n,n]);var o=t.getWidth(),s=t.getHeight(),l=Math.min(o,s),u=ze(n[0],o),c=ze(n[1],s),f=ze(a[0],l/2),h=ze(a[1],l/2),p=-i.get("startAngle")*$q,d=i.get("minAngle")*$q,g=i.getData().tree.root,m=i.getViewRoot(),v=m.depth,_=i.get("sort");_!=null&&Qq(m,_);var y=0;N(m.children,function(U){!isNaN(U.getValue())&&y++});var x=m.getValue(),M=Math.PI/(x||y)*2,S=m.depth>0,w=m.height-(S?-1:1),T=(h-f)/(w||1),C=i.get("clockwise"),b=i.get("stillShowZeroSum"),E=C?1:-1,I=function(U,B){if(U){var z=B;if(U!==g){var k=U.getValue(),G=x===0&&b?M:k*M;G1;)o=o.parentNode;var s=n.getColorFromPalette(o.name||o.dataIndex+"",e);return i.depth>1&&Ce(s)&&(s=bb(s,(i.depth-1)/(a-1)*.5)),s}r.eachSeriesByType("sunburst",function(i){var n=i.getData(),a=n.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(o,i,a.root.height));var u=n.ensureUniqueItemVisual(o.dataIndex,"style");fe(u,l)})})}function MU(r){r.registerChartView(jq),r.registerSeriesModel(Jq),r.registerLayout(ot(xU,"sunburst")),r.registerProcessor(ot(rl,"sunburst")),r.registerVisual(SU),Zq(r)}var bU={color:"fill",borderColor:"stroke"},eZ={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Kl=vt(),j_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,i){return hn(null,this)},e.prototype.getDataParams=function(t,i,n){var a=r.prototype.getDataParams.call(this,t,i);return n&&(a.info=Kl(n).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(jt),tZ=j_e;function K_e(r,e){return e=e||[0,0],de(["x","y"],function(t,i){var n=this.getAxis(t),a=e[i],o=r[i]/2;return n.type==="category"?n.getBandWidth():Math.abs(n.dataToCoord(a-o)-n.dataToCoord(a+o))},this)}function wU(r){var e=r.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:Be(K_e,r)}}}function J_e(r,e){return e=e||[0,0],de([0,1],function(t){var i=e[t],n=r[t]/2,a=[],o=[];return a[t]=i-n,o[t]=i+n,a[1-t]=o[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(o)[t])},this)}function TU(r){var e=r.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:r.getZoom()},api:{coord:function(t){return r.dataToPoint(t)},size:Be(J_e,r)}}}function $_e(r,e){var t=this.getAxis(),i=e instanceof Array?e[0]:e,n=(r instanceof Array?r[0]:r)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(i-n)-t.dataToCoord(i+n))}function EU(r){var e=r.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:Be($_e,r)}}}function Q_e(r,e){return e=e||[0,0],de(["Radius","Angle"],function(t,i){var n="get"+t+"Axis",a=this[n](),o=e[i],s=r[i]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function AU(r){var e=r.getRadiusAxis(),t=r.getAngleAxis(),i=e.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:r.cx,cy:r.cy,r:i[1],r0:i[0]},api:{coord:function(n){var a=e.dataToRadius(n[0]),o=t.dataToAngle(n[1]),s=r.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:Be(Q_e,r)}}}function CU(r){var e=r.getRect(),t=r.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:r.getCellWidth(),cellHeight:r.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(i,n){return r.dataToPoint(i,n)}}}}function HT(r,e,t,i){return r&&(r.legacy||r.legacy!==!1&&!t&&!i&&e!=="tspan"&&(e==="text"||tt(r,"text")))}function WT(r,e,t){var i=r,n,a,o;if(e==="text")o=i;else{o={},tt(i,"text")&&(o.text=i.text),tt(i,"rich")&&(o.rich=i.rich),tt(i,"textFill")&&(o.fill=i.textFill),tt(i,"textStroke")&&(o.stroke=i.textStroke),tt(i,"fontFamily")&&(o.fontFamily=i.fontFamily),tt(i,"fontSize")&&(o.fontSize=i.fontSize),tt(i,"fontStyle")&&(o.fontStyle=i.fontStyle),tt(i,"fontWeight")&&(o.fontWeight=i.fontWeight),a={type:"text",style:o,silent:!0},n={};var s=tt(i,"textPosition");t?n.position=s?i.textPosition:"inside":s&&(n.position=i.textPosition),tt(i,"textPosition")&&(n.position=i.textPosition),tt(i,"textOffset")&&(n.offset=i.textOffset),tt(i,"textRotation")&&(n.rotation=i.textRotation),tt(i,"textDistance")&&(n.distance=i.textDistance)}return rZ(o,r),N(o.rich,function(l){rZ(l,l)}),{textConfig:n,textContent:a}}function rZ(r,e){e&&(e.font=e.textFont||e.font,tt(e,"textStrokeWidth")&&(r.lineWidth=e.textStrokeWidth),tt(e,"textAlign")&&(r.align=e.textAlign),tt(e,"textVerticalAlign")&&(r.verticalAlign=e.textVerticalAlign),tt(e,"textLineHeight")&&(r.lineHeight=e.textLineHeight),tt(e,"textWidth")&&(r.width=e.textWidth),tt(e,"textHeight")&&(r.height=e.textHeight),tt(e,"textBackgroundColor")&&(r.backgroundColor=e.textBackgroundColor),tt(e,"textPadding")&&(r.padding=e.textPadding),tt(e,"textBorderColor")&&(r.borderColor=e.textBorderColor),tt(e,"textBorderWidth")&&(r.borderWidth=e.textBorderWidth),tt(e,"textBorderRadius")&&(r.borderRadius=e.textBorderRadius),tt(e,"textBoxShadowColor")&&(r.shadowColor=e.textBoxShadowColor),tt(e,"textBoxShadowBlur")&&(r.shadowBlur=e.textBoxShadowBlur),tt(e,"textBoxShadowOffsetX")&&(r.shadowOffsetX=e.textBoxShadowOffsetX),tt(e,"textBoxShadowOffsetY")&&(r.shadowOffsetY=e.textBoxShadowOffsetY))}function RU(r,e,t){var i=r;i.textPosition=i.textPosition||t.position||"inside",t.offset!=null&&(i.textOffset=t.offset),t.rotation!=null&&(i.textRotation=t.rotation),t.distance!=null&&(i.textDistance=t.distance);var n=i.textPosition.indexOf("inside")>=0,a=r.fill||"#000";iZ(i,e);var o=i.textFill==null;return n?o&&(i.textFill=t.insideFill||"#fff",!i.textStroke&&t.insideStroke&&(i.textStroke=t.insideStroke),!i.textStroke&&(i.textStroke=a),i.textStrokeWidth==null&&(i.textStrokeWidth=2)):(o&&(i.textFill=r.fill||t.outsideFill||"#000"),!i.textStroke&&t.outsideStroke&&(i.textStroke=t.outsideStroke)),i.text=e.text,i.rich=e.rich,N(e.rich,function(s){iZ(s,s)}),i}function iZ(r,e){e&&(tt(e,"fill")&&(r.textFill=e.fill),tt(e,"stroke")&&(r.textStroke=e.fill),tt(e,"lineWidth")&&(r.textStrokeWidth=e.lineWidth),tt(e,"font")&&(r.font=e.font),tt(e,"fontStyle")&&(r.fontStyle=e.fontStyle),tt(e,"fontWeight")&&(r.fontWeight=e.fontWeight),tt(e,"fontSize")&&(r.fontSize=e.fontSize),tt(e,"fontFamily")&&(r.fontFamily=e.fontFamily),tt(e,"align")&&(r.textAlign=e.align),tt(e,"verticalAlign")&&(r.textVerticalAlign=e.verticalAlign),tt(e,"lineHeight")&&(r.textLineHeight=e.lineHeight),tt(e,"width")&&(r.textWidth=e.width),tt(e,"height")&&(r.textHeight=e.height),tt(e,"backgroundColor")&&(r.textBackgroundColor=e.backgroundColor),tt(e,"padding")&&(r.textPadding=e.padding),tt(e,"borderColor")&&(r.textBorderColor=e.borderColor),tt(e,"borderWidth")&&(r.textBorderWidth=e.borderWidth),tt(e,"borderRadius")&&(r.textBorderRadius=e.borderRadius),tt(e,"shadowColor")&&(r.textBoxShadowColor=e.shadowColor),tt(e,"shadowBlur")&&(r.textBoxShadowBlur=e.shadowBlur),tt(e,"shadowOffsetX")&&(r.textBoxShadowOffsetX=e.shadowOffsetX),tt(e,"shadowOffsetY")&&(r.textBoxShadowOffsetY=e.shadowOffsetY),tt(e,"textShadowColor")&&(r.textShadowColor=e.textShadowColor),tt(e,"textShadowBlur")&&(r.textShadowBlur=e.textShadowBlur),tt(e,"textShadowOffsetX")&&(r.textShadowOffsetX=e.textShadowOffsetX),tt(e,"textShadowOffsetY")&&(r.textShadowOffsetY=e.textShadowOffsetY))}var sZ={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},nZ=bt(sZ),Mst=gn(go,function(r,e){return r[e]=1,r},{}),bst=go.join(", "),Ox=["","style","shape","extra"],Yv=vt();function LU(r,e,t,i,n){var a=r+"Animation",o=Fl(r,i,n)||{},s=Yv(e).userDuring;return o.duration>0&&(o.during=s?Be(nxe,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=r),fe(o,t[a]),o}function qv(r,e,t,i){i=i||{};var n=i.dataIndex,a=i.isInit,o=i.clearStyle,s=t.isAnimationEnabled(),l=Yv(r),u=e.style;l.userDuring=e.during;var c={},f={};if(oxe(r,e,f),oZ("shape",e,f),oZ("extra",e,f),!a&&s&&(axe(r,e,c),aZ("shape",r,e,c),aZ("extra",r,e,c),sxe(r,e,u,c)),f.style=u,exe(r,f,o),rxe(r,e),s)if(a){var h={};N(Ox,function(d){var g=d?e[d]:e;g&&g.enterFrom&&(d&&(h[d]=h[d]||{}),fe(d?h[d]:h,g.enterFrom))});var p=LU("enter",r,e,t,n);p.duration>0&&r.animateFrom(h,p)}else txe(r,e,n||0,t,c);PU(r,e),u?r.dirty():r.markRedraw()}function PU(r,e){for(var t=Yv(r).leaveToProps,i=0;i0&&r.animateFrom(n,a)}}function rxe(r,e){tt(e,"silent")&&(r.silent=e.silent),tt(e,"ignore")&&(r.ignore=e.ignore),r instanceof gi&&tt(e,"invisible")&&(r.invisible=e.invisible),r instanceof ut&&tt(e,"autoBatch")&&(r.autoBatch=e.autoBatch)}var Jl={},ixe={setTransform:function(r,e){return Jl.el[r]=e,this},getTransform:function(r){return Jl.el[r]},setShape:function(r,e){var t=Jl.el,i=t.shape||(t.shape={});return i[r]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(r){var e=Jl.el.shape;if(e)return e[r]},setStyle:function(r,e){var t=Jl.el,i=t.style;return i&&(i[r]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(r){var e=Jl.el.style;if(e)return e[r]},setExtra:function(r,e){var t=Jl.el.extra||(Jl.el.extra={});return t[r]=e,this},getExtra:function(r){var e=Jl.el.extra;if(e)return e[r]}};function nxe(){var r=this,e=r.el;if(e){var t=Yv(e).userDuring,i=r.userDuring;if(t!==i){r.el=r.userDuring=null;return}Jl.el=e,i(ixe)}}function aZ(r,e,t,i){var n=t[r];if(n){var a=e[r],o;if(a){var s=t.transition,l=n.transition;if(l)if(!o&&(o=i[r]={}),Jf(l))fe(o,a);else for(var u=$t(l),c=0;c=0){!o&&(o=i[r]={});for(var p=bt(a),c=0;c=0)){var h=r.getAnimationStyleProps(),p=h?h.style:null;if(p){!a&&(a=i.style={});for(var d=bt(t),u=0;u=0?e.getStore().get(B,D):void 0}var z=e.get(U.name,D),k=U&&U.ordinalMeta;return k?k.categories[z]:z}function S(A,D){D==null&&(D=u);var U=e.getItemVisual(D,"style"),B=U&&U.fill,z=U&&U.opacity,k=_(D,$f).getItemStyle();B!=null&&(k.fill=B),z!=null&&(k.opacity=z);var G={inheritColor:Ce(B)?B:"#000"},Y=y(D,$f),J=fr(Y,null,G,!1,!0);J.text=Y.getShallow("show")?ft(r.getFormattedLabel(D,$f),el(e,D)):null;var Q=b_(Y,G,!1);return C(A,k),k=RU(k,J,Q),A&&T(k,A),k.legacy=!0,k}function w(A,D){D==null&&(D=u);var U=_(D,Hu).getItemStyle(),B=y(D,Hu),z=fr(B,null,null,!0,!0);z.text=B.getShallow("show")?Xi(r.getFormattedLabel(D,Hu),r.getFormattedLabel(D,$f),el(e,D)):null;var k=b_(B,null,!0);return C(A,U),U=RU(U,z,k),A&&T(U,A),U.legacy=!0,U}function T(A,D){for(var U in D)tt(D,U)&&(A[U]=D[U])}function C(A,D){A&&(A.textFill&&(D.textFill=A.textFill),A.textPosition&&(D.textPosition=A.textPosition))}function b(A,D){if(D==null&&(D=u),tt(bU,A)){var U=e.getItemVisual(D,"style");return U?U[bU[A]]:null}if(tt(eZ,A))return e.getItemVisual(D,A)}function E(A){if(a.type==="cartesian2d"){var D=a.getBaseAxis();return $6(Ye({axis:D},A))}}function I(){return t.getCurrentSeriesIndices()}function R(A){return av(A,t)}}function gxe(r){var e={};return N(r.dimensions,function(t){var i=r.getDimensionInfo(t);if(!i.isExtraCoord){var n=i.coordDim,a=e[n]=e[n]||[];a[i.coordDimIndex]=r.getDimensionIndex(t)}}),e}function NU(r,e,t,i,n,a,o){if(!i){a.remove(e);return}var s=VU(r,e,t,i,n,a);return s&&o.setItemGraphicEl(t,s),s&&ar(s,i.focus,i.blurScope,i.emphasisDisabled),s}function VU(r,e,t,i,n,a){var o=-1,s=e;e&&mZ(e,i,n)&&(o=dt(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=BU(i),s&&pxe(s,u)),i.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),ps.normal.cfg=ps.normal.conOpt=ps.emphasis.cfg=ps.emphasis.conOpt=ps.blur.cfg=ps.blur.conOpt=ps.select.cfg=ps.select.conOpt=null,ps.isLegacy=!1,_xe(u,t,i,n,l,ps),yxe(u,t,i,n,l),kU(r,u,t,i,ps,n,l),tt(i,"info")&&(Kl(u).info=i.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function mZ(r,e,t){var i=Kl(r),n=e.type,a=e.shape,o=e.style;return t.isUniversalTransitionEnabled()||n!=null&&n!==i.customGraphicType||n==="path"&&wxe(a)&&vZ(a)!==i.customPathData||n==="image"&&tt(o,"image")&&o.image!==i.customImagePath}function yxe(r,e,t,i,n){var a=t.clipPath;if(a===!1)r&&r.getClipPath()&&r.removeClipPath();else if(a){var o=r.getClipPath();o&&mZ(o,a,i)&&(o=null),o||(o=BU(a),r.setClipPath(o)),kU(null,o,e,a,null,i,n)}}function _xe(r,e,t,i,n,a){if(!r.isGroup){cZ(t,null,a),cZ(t,Hu,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=r.getTextContent();if(o===!1)c&&r.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=BU(o),r.setTextContent(c)),kU(null,c,e,o,null,i,n);for(var f=o&&o.style,h=0;h=c;p--){var d=e.childAt(p);Sxe(e,d,n)}}}function Sxe(r,e,t){e&&Zv(e,Kl(r).option,t)}function Mxe(r){new An(r.oldChildren,r.newChildren,fZ,fZ,r).add(hZ).update(hZ).remove(bxe).execute()}function fZ(r,e){var t=r&&r.name;return t??fxe+e}function hZ(r,e){var t=this.context,i=r!=null?t.newChildren[r]:null,n=e!=null?t.oldChildren[e]:null;VU(t.api,n,t.dataIndex,i,t.seriesModel,t.group)}function bxe(r){var e=this.context,t=e.oldChildren[r];t&&Zv(t,Kl(t).option,e.seriesModel)}function vZ(r){return r&&(r.pathData||r.d)}function wxe(r){return r&&(tt(r,"pathData")||tt(r,"d"))}function HU(r){r.registerChartView(pZ),r.registerSeriesModel(tZ)}var hd=vt(),gZ=Qe,WU=Be,Txe=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(e,t,i,n){var a=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,i);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=c;var f=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new Ze,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),i.getZr().add(s);else{var h=ot(yZ,t,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,t)}xZ(s,t,!0),this._renderHandle(a)}},r.prototype.remove=function(e){this.clear(e)},r.prototype.dispose=function(e){this.clear(e)},r.prototype.determineAnimation=function(e,t){var i=t.get("animation"),n=e.axis,a=n.type==="category",o=t.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=lT(e).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},r.prototype.makeElOption=function(e,t,i,n,a){},r.prototype.createPointerEl=function(e,t,i,n){var a=t.pointer;if(a){var o=hd(e).pointerEl=new Rt[a.type](gZ(t.pointer));e.add(o)}},r.prototype.createLabelEl=function(e,t,i,n){if(t.label){var a=hd(e).labelEl=new Lt(gZ(t.label));e.add(a),_Z(a,n)}},r.prototype.updatePointerEl=function(e,t,i){var n=hd(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},r.prototype.updateLabelEl=function(e,t,i,n){var a=hd(e).labelEl;a&&(a.setStyle(t.label.style),i(a,{x:t.label.x,y:t.label.y}),_Z(a,n))},r.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=t.getModel("handle"),o=t.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=Lu(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Ra(u.event)},onmousedown:WU(this._onHandleDragMove,this,0,0),drift:WU(this._onHandleDragMove,this),ondragend:WU(this._onHandleDragEnd,this)}),i.add(n)),xZ(n,t,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");pe(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,os(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},r.prototype._moveHandleToValue=function(e,t){yZ(this._axisPointerModel,!t&&this._moveAnimation,this._handle,XU(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(XU(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(XU(n)),hd(i).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,n=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),zu(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(e,t,i){return i=i||0,{x:e[i],y:e[1-i],width:t[i],height:t[1-i]}},r}();function yZ(r,e,t,i){SZ(hd(t).lastProp,i)||(hd(t).lastProp=i,e?Dt(t,i,r):(t.stopAnimation(),t.attr(i)))}function SZ(r,e){if(qe(r)&&qe(e)){var t=!0;return N(e,function(i,n){t=t&&SZ(r[n],i)}),!!t}else return r===e}function _Z(r,e){r[e.get(["label","show"])?"show":"hide"]()}function XU(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function xZ(r,e,t){var i=e.get("z"),n=e.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=t)})}var Kv=Txe;function Jv(r){var e=r.get("type"),t=r.getModel(e+"Style"),i;return e==="line"?(i=t.getLineStyle(),i.fill=null):e==="shadow"&&(i=t.getAreaStyle(),i.stroke=null),i}function YU(r,e,t,i,n){var a=t.get("value"),o=qU(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=Hs(s.get("padding")||0),u=s.getFont(),c=Rl(o,u),f=n.position,h=c.width+l[1]+l[3],p=c.height+l[0]+l[2],d=n.align;d==="right"&&(f[0]-=h),d==="center"&&(f[0]-=h/2);var g=n.verticalAlign;g==="bottom"&&(f[1]-=p),g==="middle"&&(f[1]-=p/2),Exe(f,h,p,i);var m=s.get("backgroundColor");(!m||m==="auto")&&(m=e.get(["axisLine","lineStyle","color"])),r.label={x:f[0],y:f[1],style:fr(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:m}),z2:10}}function Exe(r,e,t,i){var n=i.getWidth(),a=i.getHeight();r[0]=Math.min(r[0]+e,n)-e,r[1]=Math.min(r[1]+t,a)-t,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function qU(r,e,t,i,n){r=e.scale.parse(r);var a=e.scale.getLabel({value:r},{precision:n.precision}),o=n.formatter;if(o){var s={value:sx(e,{value:r}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};N(i,function(l){var u=t.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),Ce(o)?a=o.replace("{value}",a):He(o)&&(a=o(s))}return a}function zx(r,e,t){var i=wi();return Pa(i,i,t.rotation),_n(i,i,t.position),wn([r.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],i)}function qT(r,e,t,i,n,a){var o=Cn.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=n.get(["label","margin"]),YU(e,i,n,a,{position:zx(i.axis,r,t),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function $v(r,e,t){return t=t||0,{x1:r[t],y1:r[1-t],x2:e[t],y2:e[1-t]}}function ZT(r,e,t){return t=t||0,{x:r[t],y:r[1-t],width:e[t],height:e[1-t]}}function ZU(r,e,t,i,n,a){return{cx:r,cy:e,r0:t,r:i,startAngle:n,endAngle:a,clockwise:!0}}var Axe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),c=MZ(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var h=Jv(a),p=Cxe[u](s,f,c);p.style=h,t.graphicKey=p.type,t.pointer=p}var d=yx(l.model,n);qT(i,t,d,n,a,o)},e.prototype.getHandleTransform=function(t,i,n){var a=yx(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=zx(i.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=MZ(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,f=[t.x,t.y];f[c]+=i[c],f[c]=Math.min(l[1],f[c]),f[c]=Math.max(l[0],f[c]);var h=(u[1]+u[0])/2,p=[h,h];p[c]=f[c];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:t.rotation,cursorPoint:p,tooltipOption:d[c]}},e}(Kv);function MZ(r,e){var t={};return t[e.dim+"AxisIndex"]=e.index,r.getCartesian(t)}var Cxe={line:function(r,e,t){var i=$v([e,t[0]],[e,t[1]],bZ(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,e,t){var i=Math.max(1,r.getBandWidth()),n=t[1]-t[0];return{type:"Rect",shape:ZT([e-i/2,t[0]],[i,n],bZ(r))}}};function bZ(r){return r.dim==="x"?0:1}var wZ=Axe;var Rxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Pt),TZ=Rxe;var Wu=vt(),Lxe=N;function KT(r,e,t){if(!zt.node){var i=e.getZr();Wu(i).records||(Wu(i).records={}),Pxe(i,e);var n=Wu(i).records[r]||(Wu(i).records[r]={});n.handler=t}}function Pxe(r,e){if(Wu(r).initialized)return;Wu(r).initialized=!0,t("click",ot(EZ,"click")),t("mousemove",ot(EZ,"mousemove")),t("globalout",Ixe);function t(i,n){r.on(i,function(a){var o=Nxe(e);Lxe(Wu(r).records,function(s){s&&n(s,a,o.dispatchAction)}),Dxe(o.pendings,e)})}}function Dxe(r,e){var t=r.showTip.length,i=r.hideTip.length,n;t?n=r.showTip[t-1]:i&&(n=r.hideTip[i-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function Ixe(r,e,t){r.handler("leave",null,t)}function EZ(r,e,t,i){e.handler(r,t,i)}function Nxe(r){var e={showTip:[],hideTip:[]},t=function(i){var n=e[i.type];n?n.push(i):(i.dispatchAction=t,r.dispatchAction(i))};return{dispatchAction:t,pendings:e}}function Fx(r,e){if(!zt.node){var t=e.getZr(),i=(Wu(t).records||{})[r];i&&(Wu(t).records[r]=null)}}var Uxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=i.getComponent("tooltip"),o=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";KT("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,i){Fx("axisPointer",i)},e.prototype.dispose=function(t,i){Fx("axisPointer",i)},e.type="axisPointer",e}(er),CZ=Uxe;function Bx(r,e){var t=[],i=r.seriesIndex,n;if(i==null||!(n=e.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=$o(a,r);if(o==null||o<0||pe(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)t=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),f=c.dim,h=u.dim,p=f==="x"||f==="radius"?1:0,d=a.mapDimension(h),g=[];g[p]=a.get(d,o),g[1-p]=a.get(a.getCalculationInfo("stackResultDimension"),o),t=l.dataToPoint(g)||[]}else t=l.dataToPoint(a.getValues(de(l.dimensions,function(v){return a.mapDimension(v)}),o))||[];else if(s){var m=s.getBoundingRect().clone();m.applyTransform(s.transform),t=[m.x+m.width/2,m.y+m.height/2]}return{point:t,el:s}}var RZ=vt();function jU(r,e,t){var i=r.currTrigger,n=[r.x,r.y],a=r,o=r.dispatchAction||Be(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){JT(n)&&(n=Bx({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=JT(n),u=a.axesInfo,c=s.axesInfo,f=i==="leave"||JT(n),h={},p={},d={list:[],map:{}},g={showPointer:ot(zxe,p),showTooltip:ot(Fxe,d)};N(s.coordSysMap,function(v,_){var y=l||v.containPoint(n);N(s.coordSysAxesInfo[_],function(x,M){var S=x.axis,w=Gxe(u,x);if(!f&&y&&(!u||w)){var T=w&&w.value;T==null&&!l&&(T=S.pointToData(n)),T!=null&&LZ(x,T,g,!1,h)}})});var m={};return N(c,function(v,_){var y=v.linkGroup;y&&!p[_]&&N(y.axesInfo,function(x,M){var S=p[M];if(x!==v&&S){var w=S.value;y.mapper&&(w=v.axis.scale.parse(y.mapper(w,PZ(x),PZ(v)))),m[v.key]=w}})}),N(m,function(v,_){LZ(c[_],v,g,!0,h)}),Bxe(p,c,h),kxe(d,n,r,o),Vxe(c,o,t),h}}function LZ(r,e,t,i,n){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!r.involveSeries){t.showPointer(r,e);return}var o=Oxe(e,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&fe(n,s[0]),!i&&r.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(r,e,s),t.showTooltip(r,o,l)}}function Oxe(r,e){var t=e.axis,i=t.dim,n=r,a=[],o=Number.MAX_VALUE,s=-1;return N(e.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(i),f,h;if(l.getAxisTooltipData){var p=l.getAxisTooltipData(c,r,t);h=p.dataIndices,f=p.nestestValue}else{if(h=l.getData().indicesOfNearest(c[0],r,t.type==="category"?.5:null),!h.length)return;f=l.getData().get(c[0],h[0])}if(!(f==null||!isFinite(f))){var d=r-f,g=Math.abs(d);g<=o&&((g=0&&s<0)&&(o=g,s=d,n=f,a.length=0),N(h,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:n}}function zxe(r,e,t,i){r[e.key]={value:t,payloadBatch:i}}function Fxe(r,e,t,i){var n=t.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!n.length)){var l=e.coordSys.model,u=Cv(l),c=r.map[u];c||(c=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function Bxe(r,e,t){var i=t.axesInfo=[];N(e,function(n,a){var o=n.axisPointerModel.option,s=r[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function kxe(r,e,t,i){if(JT(e)||!r.list.length){i({type:"hideTip"});return}var n=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:r.list})}function Vxe(r,e,t){var i=t.getZr(),n="axisPointerLastHighlights",a=RZ(i)[n]||{},o=RZ(i)[n]={};N(r,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&N(f.seriesDataIndices,function(h){var p=h.seriesIndex+" | "+h.dataIndex;o[p]=h})});var s=[],l=[];N(a,function(u,c){!o[c]&&l.push(u)}),N(o,function(u,c){!a[c]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function Gxe(r,e){for(var t=0;t<(r||[]).length;t++){var i=r[t];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function PZ(r){var e=r.axis.model,t={},i=t.axisDim=r.axis.dim;return t.axisIndex=t[i+"AxisIndex"]=e.componentIndex,t.axisName=t[i+"AxisName"]=e.name,t.axisId=t[i+"AxisId"]=e.id,t}function JT(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function nl(r){qa.registerAxisPointerClass("CartesianAxisPointer",wZ),r.registerComponentModel(TZ),r.registerComponentView(CZ),r.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!pe(t)&&(e.axisPointer.link=[t])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=n9(e,t)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},jU)}function KU(r){It(fT),It(nl)}var Hxe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),c=u.getExtent(),f=s.dataToCoord(i),h=a.get("type");if(h&&h!=="none"){var p=Jv(a),d=Xxe[h](s,l,f,c);d.style=p,t.graphicKey=d.type,t.pointer=d}var g=a.get(["label","margin"]),m=Wxe(i,n,a,l,g);YU(t,n,a,o,m)},e}(Kv);function Wxe(r,e,t,i,n){var a=e.axis,o=a.dataToCoord(r),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=i.getRadiusAxis().getExtent(),u,c,f;if(a.dim==="radius"){var h=wi();Pa(h,h,s),_n(h,h,[i.cx,i.cy]),u=wn([o,-n],h);var p=e.getModel("axisLabel").get("rotate")||0,d=Cn.innerTextLayout(s,p*Math.PI/180,-1);c=d.textAlign,f=d.textVerticalAlign}else{var g=l[1];u=i.coordToPoint([g+n,o]);var m=i.cx,v=i.cy;c=Math.abs(u[0]-m)/g<.3?"center":u[0]>m?"left":"right",f=Math.abs(u[1]-v)/g<.3?"middle":u[1]>v?"top":"bottom"}return{position:u,align:c,verticalAlign:f}}var Xxe={line:function(r,e,t,i){return r.dim==="angle"?{type:"Line",shape:$v(e.coordToPoint([i[0],t]),e.coordToPoint([i[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(r,e,t,i){var n=Math.max(1,r.getBandWidth()),a=Math.PI/180;return r.dim==="angle"?{type:"Sector",shape:ZU(e.cx,e.cy,i[0],i[1],(-t-n/2)*a,(-t+n/2)*a)}:{type:"Sector",shape:ZU(e.cx,e.cy,t-n/2,t+n/2,0,Math.PI*2)}}},DZ=Hxe;var Yxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var i,n=this.ecModel;return n.eachComponent(t,function(a){a.getCoordSysModel()===this&&(i=a)},this),i},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Pt),IZ=Yxe;var JU=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Ar).models[0]},e.type="polarAxis",e}(Pt);br(JU,Vl);var NZ=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(JU);var UZ=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(JU);var $U=function(r){Z(e,r);function e(t,i){return r.call(this,"radius",t,i)||this}return e.prototype.pointToData=function(t,i){return this.polar.pointToData(t,i)[this.dim==="radius"?0:1]},e}(pn);$U.prototype.dataToRadius=pn.prototype.dataToCoord;$U.prototype.radiusToData=pn.prototype.coordToData;var OZ=$U;var qxe=vt(),QU=function(r){Z(e,r);function e(t,i){return r.call(this,"angle",t,i||[0,360])||this}return e.prototype.pointToData=function(t,i){return this.polar.pointToData(t,i)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,i=t.getLabelModel(),n=t.scale,a=n.getExtent(),o=n.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=t.dataToCoord(s+1)-t.dataToCoord(s),u=Math.abs(l),c=Rl(s==null?"":s+"",i.getFont(),"center","top"),f=Math.max(c.height,7),h=f/u;isNaN(h)&&(h=1/0);var p=Math.max(0,Math.floor(h)),d=qxe(t.model),g=d.lastAutoInterval,m=d.lastTickCount;return g!=null&&m!=null&&Math.abs(g-p)<=1&&Math.abs(m-o)<=1&&g>p?p=g:(d.lastTickCount=o,d.lastAutoInterval=p),p},e}(pn);QU.prototype.dataToAngle=pn.prototype.dataToCoord;QU.prototype.angleToData=pn.prototype.coordToData;var zZ=QU;var eO=["radius","angle"],Zxe=function(){function r(e){this.dimensions=eO,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new OZ,this._angleAxis=new zZ,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return r.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},r.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},r.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},r.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},r.prototype.getAxesByScale=function(e){var t=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===e&&t.push(i),n.scale.type===e&&t.push(n),t},r.prototype.getAngleAxis=function(){return this._angleAxis},r.prototype.getRadiusAxis=function(){return this._radiusAxis},r.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},r.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},r.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},r.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},r.prototype.pointToData=function(e,t){var i=this.pointToCoord(e);return[this._radiusAxis.radiusToData(i[0],t),this._angleAxis.angleToData(i[1],t)]},r.prototype.pointToCoord=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=this.getAngleAxis(),a=n.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);n.inverse?o=s-360:s=o+360;var l=Math.sqrt(t*t+i*i);t/=l,i/=l;for(var u=Math.atan2(-i,t)/Math.PI*180,c=us;)u+=c*360;return[l,u]},r.prototype.coordToPoint=function(e){var t=e[0],i=e[1]/180*Math.PI,n=Math.cos(i)*t+this.cx,a=-Math.sin(i)*t+this.cy;return[n,a]},r.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),i=t.getExtent().slice();i[0]>i[1]&&i.reverse();var n=e.getExtent(),a=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:i[0],r:i[1],startAngle:-n[0]*a,endAngle:-n[1]*a,clockwise:e.inverse,contain:function(o,s){var l=o-this.cx,u=s-this.cy,c=l*l+u*u-1e-4,f=this.r,h=this.r0;return c<=f*f&&c>=h*h}}},r.prototype.convertToPixel=function(e,t,i){var n=FZ(t);return n===this?this.dataToPoint(i):null},r.prototype.convertFromPixel=function(e,t,i){var n=FZ(t);return n===this?this.pointToData(i):null},r}();function FZ(r){var e=r.seriesModel,t=r.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}var BZ=Zxe;function jxe(r,e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight();r.cx=ze(i[0],n),r.cy=ze(i[1],a);var o=r.getRadiusAxis(),s=Math.min(n,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:pe(l)||(l=[0,l]);var u=[ze(l[0],s),ze(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function Kxe(r,e){var t=this,i=t.getAngleAxis(),n=t.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),n.scale.setExtent(1/0,-1/0),r.eachSeries(function(s){if(s.coordinateSystem===t){var l=s.getData();N(Sv(l,"radius"),function(u){n.scale.unionExtentFromData(l,u)}),N(Sv(l,"angle"),function(u){i.scale.unionExtentFromData(l,u)})}}),kl(i.scale,i.model),kl(n.scale,n.model),i.type==="category"&&!i.onBand){var a=i.getExtent(),o=360/i.scale.count();i.inverse?a[1]+=o:a[1]-=o,i.setExtent(a[0],a[1])}}function Jxe(r){return r.mainType==="angleAxis"}function kZ(r,e){var t;if(r.type=e.get("type"),r.scale=kf(e),r.onBand=e.get("boundaryGap")&&r.type==="category",r.inverse=e.get("inverse"),Jxe(e)){r.inverse=r.inverse!==e.get("clockwise");var i=e.get("startAngle"),n=(t=e.get("endAngle"))!==null&&t!==void 0?t:i+(r.inverse?-360:360);r.setExtent(i,n)}e.axis=r,r.model=e}var $xe={dimensions:eO,create:function(r,e){var t=[];return r.eachComponent("polar",function(i,n){var a=new BZ(n+"");a.update=Kxe;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=i.findAxisModel("radiusAxis"),u=i.findAxisModel("angleAxis");kZ(o,l),kZ(s,u),jxe(a,i,e),t.push(a),i.coordinateSystem=a,a.model=i}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="polar"){var n=i.getReferringComponents("polar",Ar).models[0];i.coordinateSystem=n.coordinateSystem}}),t}},VZ=$xe;var Qxe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function $T(r,e,t){e[1]>e[0]&&(e=e.slice().reverse());var i=r.coordToPoint([e[0],t]),n=r.coordToPoint([e[1],t]);return{x1:i[0],y1:i[1],x2:n[0],y2:n[1]}}function QT(r){var e=r.getRadiusAxis();return e.inverse?0:1}function GZ(r){var e=r[0],t=r[r.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&r.pop()}var eSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,i){if(this.group.removeAll(),!!t.get("show")){var n=t.axis,a=n.polar,o=a.getRadiusAxis().getExtent(),s=n.getTicksCoords(),l=n.getMinorTicksCoords(),u=de(n.getViewLabels(),function(c){c=Qe(c);var f=n.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=n.dataToCoord(h),c});GZ(u),GZ(s),N(Qxe,function(c){t.get([c,"show"])&&(!n.scale.isBlank()||c==="axisLine")&&tSe[c](this.group,t,a,s,l,o,u)},this)}},e.type="angleAxis",e}(qa),tSe={axisLine:function(r,e,t,i,n,a){var o=e.getModel(["axisLine","lineStyle"]),s=t.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=QT(t),f=c?0:1,h,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new Rt[p]({shape:{cx:t.cx,cy:t.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):h=new Ip({shape:{cx:t.cx,cy:t.cy,r:a[c],r0:a[f]},style:o.getLineStyle(),z2:1,silent:!0}),h.style.fill=null,r.add(h)},axisTick:function(r,e,t,i,n,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[QT(t)],u=de(i,function(c){return new Jr({shape:$T(t,[l,l+s],c.coord)})});r.add(Gn(u,{style:Ye(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(r,e,t,i,n,a){if(n.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[QT(t)],c=[],f=0;fv?"left":"right",x=Math.abs(m[1]-_)/g<.3?"middle":m[1]>_?"top":"bottom";if(s&&s[d]){var M=s[d];qe(M)&&M.textStyle&&(p=new Zt(M.textStyle,l,l.ecModel))}var S=new Lt({silent:Cn.isLabelSilent(e),style:fr(p,{x:m[0],y:m[1],fill:p.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:y,verticalAlign:x})});if(r.add(S),c){var w=Cn.makeAxisEventDataBase(e);w.targetType="axisLabel",w.value=f.rawLabel,rt(S).eventData=w}},this)},splitLine:function(r,e,t,i,n,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],f=0;f=0?"p":"n",R=w;M&&(i[c][E]||(i[c][E]={p:w,n:w}),R=i[c][E][I]);var A=void 0,D=void 0,U=void 0,B=void 0;if(d.dim==="radius"){var z=d.dataToCoord(b)-w,k=l.dataToCoord(E);Math.abs(z)=B})}}})}function lSe(r){var e={};N(r,function(i,n){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=YZ(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),f=e[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=f.stacks;e[l]=f;var p=XZ(i);h[p]||f.autoWidthCount++,h[p]=h[p]||{width:0,maxWidth:0};var d=ze(i.get("barWidth"),c),g=ze(i.get("barMaxWidth"),c),m=i.get("barGap"),v=i.get("barCategoryGap");d&&!h[p].width&&(d=Math.min(f.remainedWidth,d),h[p].width=d,f.remainedWidth-=d),g&&(h[p].maxWidth=g),m!=null&&(f.gap=m),v!=null&&(f.categoryGap=v)});var t={};return N(e,function(i,n){t[n]={};var a=i.stacks,o=i.bandWidth,s=ze(i.categoryGap,o),l=ze(i.gap,1),u=i.remainedWidth,c=i.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),N(a,function(g,m){var v=g.maxWidth;v&&v=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},r.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},r.prototype.dataToPoint=function(e){var t=this.getAxis(),i=this.getRect(),n=[],a=t.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),n[a]=t.toGlobalCoord(t.dataToCoord(+e)),n[1-a]=a===0?i.y+i.height/2:i.x+i.width/2,n},r.prototype.convertToPixel=function(e,t,i){var n=$Z(t);return n===this?this.dataToPoint(i):null},r.prototype.convertFromPixel=function(e,t,i){var n=$Z(t);return n===this?this.pointToData(i):null},r}();function $Z(r){var e=r.seriesModel,t=r.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}var QZ=gSe;function ySe(r,e){var t=[];return r.eachComponent("singleAxis",function(i,n){var a=new QZ(i,r,e);a.name="single_"+n,a.resize(i,e),i.coordinateSystem=a,t.push(a)}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="singleAxis"){var n=i.getReferringComponents("singleAxis",Ar).models[0];i.coordinateSystem=n&&n.coordinateSystem}}),t}var _Se={create:ySe,dimensions:rO},ej=_Se;var tj=["x","y"],xSe=["width","height"],SSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis,l=s.coordinateSystem,u=iO(l,1-tE(s)),c=l.dataToPoint(i)[0],f=a.get("type");if(f&&f!=="none"){var h=Jv(a),p=MSe[f](s,c,u);p.style=h,t.graphicKey=p.type,t.pointer=p}var d=kx(n);qT(i,t,d,n,a,o)},e.prototype.getHandleTransform=function(t,i,n){var a=kx(i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=zx(i.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,i,n,a){var o=n.axis,s=o.coordinateSystem,l=tE(o),u=iO(s,l),c=[t.x,t.y];c[l]+=i[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var f=iO(s,1-l),h=(f[1]+f[0])/2,p=[h,h];return p[l]=c[l],{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:p,tooltipOption:{verticalAlign:"middle"}}},e}(Kv),MSe={line:function(r,e,t){var i=$v([e,t[0]],[e,t[1]],tE(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,e,t){var i=r.getBandWidth(),n=t[1]-t[0];return{type:"Rect",shape:ZT([e-i/2,t[0]],[i,n],tE(r))}}};function tE(r){return r.isHorizontal()?0:1}function iO(r,e){var t=r.getRect();return[t[tj[e]],t[tj[e]]+t[xSe[e]]]}var rj=SSe;var bSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(er);function nO(r){It(nl),qa.registerAxisPointerClass("SingleAxisPointer",rj),r.registerComponentView(bSe),r.registerComponentView(jZ),r.registerComponentModel(eE),il(r,"single",eE,eE.defaultOption),r.registerCoordinateSystem("single",ej)}var wSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i,n){var a=is(t);r.prototype.init.apply(this,arguments),ij(t,a)},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),ij(this.option,t)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Pt);function ij(r,e){var t=r.cellSize,i;pe(t)?i=t:i=r.cellSize=[t,t],i.length===1&&(i[1]=i[0]);var n=de([0,1],function(a){return S5(e,a)&&(i[a]="auto"),i[a]!=null&&i[a]!=="auto"});Va(r,e,{type:"box",ignoreSize:n})}var nj=wSe;var TSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group;a.removeAll();var o=t.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=i.getLocaleModel();this._renderDayRect(t,s,a),this._renderLines(t,s,l,a),this._renderYearText(t,s,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,s,l,a)},e.prototype._renderDayRect=function(t,i,n){for(var a=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=i.start.time;u<=i.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToRect([u],!1).tl,f=new Et({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});n.add(f)}},e.prototype._renderLines=function(t,i,n,a){var o=this,s=t.coordinateSystem,l=t.getModel(["splitLine","lineStyle"]).getLineStyle(),u=t.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var f=i.start,h=0;f.time<=i.end.time;h++){d(f.formatedDate),h===0&&(f=s.getDateInfo(i.start.y+"-"+i.start.m));var p=f.date;p.setMonth(p.getMonth()+1),f=s.getDateInfo(p)}d(s.getNextNDay(i.end.time,1).formatedDate);function d(g){o._firstDayOfMonth.push(s.getDateInfo(g)),o._firstDayPoints.push(s.dataToRect([g],!1).tl);var m=o._getLinePointsOfOneWeek(t,g,n);o._tlpoints.push(m[0]),o._blpoints.push(m[m.length-1]),u&&o._drawSplitline(m,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,n),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,n),l,a)},e.prototype._getEdgesPoints=function(t,i,n){var a=[t[0].slice(),t[t.length-1].slice()],o=n==="horizontal"?0:1;return a[0][o]=a[0][o]-i/2,a[1][o]=a[1][o]+i/2,a},e.prototype._drawSplitline=function(t,i,n){var a=new Qr({z2:20,shape:{points:t},style:i});n.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,i,n){for(var a=t.coordinateSystem,o=a.getDateInfo(i),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToRect([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[n==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(t,i){return Ce(t)&&t?y5(t,i):He(t)?t(i):i.nameMap},e.prototype._yearTextPositionControl=function(t,i,n,a,o){var s=i[0],l=i[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,i,n,a){var o=t.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=n!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,f=(u[0][1]+u[1][1])/2,h=n==="horizontal"?0:1,p={top:[c,u[h][1]],bottom:[c,u[1-h][1]],left:[u[1-h][0],f],right:[u[h][0],f]},d=i.start.y;+i.end.y>+i.start.y&&(d=d+"-"+i.end.y);var g=o.get("formatter"),m={start:i.start.y,end:i.end.y,nameMap:d},v=this._formatterLabel(g,m),_=new Lt({z2:30,style:fr(o,{text:v})});_.attr(this._yearTextPositionControl(_,p[l],n,l,s)),a.add(_)}},e.prototype._monthTextPositionControl=function(t,i,n,a,o){var s="left",l="top",u=t[0],c=t[1];return n==="horizontal"?(c=c+o,i&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,i&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(t,i,n,a){var o=t.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),f=[this._tlpoints,this._blpoints];(!s||Ce(s))&&(s&&(i=w_(s)||i),s=i.get(["time","monthAbbr"])||[]);var h=u==="start"?0:1,p=n==="horizontal"?0:1;l=u==="start"?-l:l;for(var d=c==="center",g=0;g=n.start.time&&i.times.end.time&&t.reverse(),t},r.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],i;t[0].time>t[1].time&&(i=!0,t.reverse());var n=Math.floor(t[1].time/aO)-Math.floor(t[0].time/aO)+1,a=new Date(t[0].time),o=a.getDate(),s=t[1].date.getDate();a.setDate(o+n-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-t[1].time)*u>0;)n-=u,a.setDate(l-u);var c=Math.floor((n+t[0].day+6)/7),f=i?-c+1:c-1;return i&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:n,weeks:c,nthWeek:f,fweek:t[0].day,lweek:t[1].day}},r.prototype._getDateByWeeksAndDay=function(e,t,i){var n=this._getRangeInfo(i);if(e>n.weeks||e===0&&tn.lweek)return null;var a=(e-1)*7-n.fweek+t,o=new Date(n.start.time);return o.setDate(+n.start.d+a),this.getDateInfo(o)},r.create=function(e,t){var i=[];return e.eachComponent("calendar",function(n){var a=new r(n,e,t);i.push(a),n.coordinateSystem=a}),e.eachSeries(function(n){n.get("coordinateSystem")==="calendar"&&(n.coordinateSystem=i[n.get("calendarIndex")||0])}),i},r.dimensions=["time","value"],r}();function oj(r){var e=r.calendarModel,t=r.seriesModel,i=e?e.coordinateSystem:t?t.coordinateSystem:null;return i}var sj=ESe;function oO(r){r.registerComponentModel(nj),r.registerComponentView(aj),r.registerCoordinateSystem("calendar",sj)}function ASe(r,e){var t=r.existing;if(e.id=r.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var i=e.parentOption;i?e.parentId=i.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function lj(r,e){var t;return N(e,function(i){r[i]!=null&&r[i]!=="auto"&&(t=!0)}),t}function CSe(r,e,t){var i=fe({},t),n=r[e],a=t.$action||"merge";if(a==="merge")if(n){if(0)var o;_t(n,i,!0),Va(n,i,{ignoreSize:!0}),sD(t,n),rE(t,n),rE(t,n,"shape"),rE(t,n,"style"),rE(t,n,"extra"),t.clipPath=n.clipPath}else r[e]=i;else a==="replace"?r[e]=i:a==="remove"&&n&&(r[e]=null)}var uj=["transition","enterFrom","leaveTo"],RSe=uj.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function rE(r,e,t){if(t&&(!r[t]&&e[t]&&(r[t]={}),r=r[t],e=e[t]),!(!r||!e))for(var i=t?uj:RSe,n=0;n=0;c--){var f=n[c],h=qr(f.id,null),p=h!=null?o.get(h):null;if(p){var d=p.parent,v=ds(d),_=d===a?{width:s,height:l}:{width:v.width,height:v.height},y={},x=Cf(p,f,_,null,{hv:f.hv,boundingMode:f.bounding},y);if(!ds(p).isNew&&x){for(var M=f.transition,S={},w=0;w=0)?S[T]=C:p[T]=C}Dt(p,S,t,0)}else p.attr(y)}}},e.prototype._clear=function(){var t=this,i=this._elMap;i.each(function(n){iE(n,ds(n).option,i,t._lastGraphicModel)}),this._elMap=ke()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(er);function sO(r){var e=tt(fj,r)?fj[r]:S_(r),t=new e({});return ds(t).type=r,t}function hj(r,e,t,i){var n=sO(t);return e.add(n),i.set(r,n),ds(n).id=r,ds(n).isNew=!0,n}function iE(r,e,t,i){var n=r&&r.parent;n&&(r.type==="group"&&r.traverse(function(a){iE(a,e,t,i)}),Zv(r,e,i),t.removeKey(ds(r).id))}function pj(r,e,t,i){r.isGroup||N([["cursor",gi.prototype.cursor],["zlevel",i||0],["z",t||0],["z2",0]],function(n){var a=n[0];tt(e,a)?r[a]=ft(e[a],n[1]):r[a]==null&&(r[a]=n[1])}),N(bt(e),function(n){if(n.indexOf("on")===0){var a=e[n];r[n]=He(a)?a:null}}),tt(e,"draggable")&&(r.draggable=e.draggable),e.name!=null&&(r.name=e.name),e.id!=null&&(r.id=e.id)}function PSe(r){return r=fe({},r),N(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(aD),function(e){delete r[e]}),r}function DSe(r,e,t){var i=rt(r).eventData;!r.silent&&!r.ignore&&!i&&(i=rt(r).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:r.name}),i&&(i.info=t.info)}function lO(r){r.registerComponentModel(cj),r.registerComponentView(dj),r.registerPreprocessor(function(e){var t=e.graphic;pe(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var uO=["x","y","radius","angle","single"],ISe=["cartesian2d","polar","singleAxis"];function mj(r){var e=r.get("coordinateSystem");return dt(ISe,e)>=0}function ms(r){return r+"Axis"}function vj(r,e){var t=ke(),i=[],n=ke();r.eachComponent({mainType:"dataZoom",query:e},function(c){n.get(c.uid)||s(c)});var a;do a=!1,r.eachComponent("dataZoom",o);while(a);function o(c){!n.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){n.set(c.uid,!0),i.push(c),u(c)}function l(c){var f=!1;return c.eachTargetAxis(function(h,p){var d=t.get(h);d&&d[p]&&(f=!0)}),f}function u(c){c.eachTargetAxis(function(f,h){(t.get(f)||t.set(f,[]))[h]=!0})}return i}function nE(r){var e=r.ecModel,t={infoList:[],infoMap:ke()};return r.eachTargetAxis(function(i,n){var a=e.getComponent(ms(i),n);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=t.infoMap.get(s);l||(l={model:o,axisModels:[]},t.infoList.push(l),t.infoMap.set(s,l)),l.axisModels.push(a)}}}),t}var cO=function(){function r(){this.indexList=[],this.indexMap=[]}return r.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},r}(),NSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,i,n){var a=gj(t);this.settledOption=a,this.mergeDefaultAndTheme(t,n),this._doInit(a)},e.prototype.mergeOption=function(t){var i=gj(t);_t(this.option,t,!0),_t(this.settledOption,i,!0),this._doInit(i)},e.prototype._doInit=function(t){var i=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;N([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(i[a[0]]=n[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),i=this._targetAxisInfoMap=ke(),n=this._fillSpecifiedTargetAxis(i);n?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var i=!1;return N(uO,function(n){var a=this.getReferringComponents(ms(n),cH);if(a.specified){i=!0;var o=new cO;N(a.models,function(s){o.add(s.componentIndex)}),t.set(n,o)}},this),i},e.prototype._fillAutoTargetAxisByOrient=function(t,i){var n=this.ecModel,a=!0;if(a){var o=i==="vertical"?"y":"x",s=n.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=n.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===i}});l(s,"single")}function l(u,c){var f=u[0];if(f){var h=new cO;if(h.add(f.componentIndex),t.set(c,h),a=!1,c==="x"||c==="y"){var p=f.getReferringComponents("grid",Ar).models[0];p&&N(u,function(d){f.componentIndex!==d.componentIndex&&p===d.getReferringComponents("grid",Ar).models[0]&&h.add(d.componentIndex)})}}}a&&N(uO,function(u){if(a){var c=n.findComponents({mainType:ms(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new cO;f.add(c[0].componentIndex),t.set(u,f),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(i){!t&&(t=i)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var i=this._rangePropMode,n=this.get("rangeMode");N([["start","startValue"],["end","endValue"]],function(a,o){var s=t[a[0]]!=null,l=t[a[1]]!=null;s&&!l?i[o]="percent":!s&&l?i[o]="value":n?i[o]=n[o]:s&&(i[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(i,n){t==null&&(t=this.ecModel.getComponent(ms(i),n))},this),t},e.prototype.eachTargetAxis=function(t,i){this._targetAxisInfoMap.each(function(n,a){N(n.indexList,function(o){t.call(i,a,o)})})},e.prototype.getAxisProxy=function(t,i){var n=this.getAxisModel(t,i);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,i){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[i])return this.ecModel.getComponent(ms(t),i)},e.prototype.setRawRange=function(t){var i=this.option,n=this.settledOption;N([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(i[a[0]]=n[a[0]]=t[a[0]],i[a[1]]=n[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var i=this.option;N(["start","startValue","end","endValue"],function(n){i[n]=t[n]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,i){if(t==null&&i==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(t,i).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var i,n=this._targetAxisInfoMap.keys(),a=0;ao[1];if(y&&!x&&!M)return!0;y&&(m=!0),x&&(d=!0),M&&(g=!0)}return m&&d&&g})}else eg(c,function(p){if(a==="empty")l.setData(u=u.map(p,function(g){return s(g)?g:NaN}));else{var d={};d[p]=o,u.selectRange(d)}});eg(c,function(p){u.setApproximateExtent(o,p)})}});function s(l){return l>=o[0]&&l<=o[1]}},r.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,i=this._dataExtent;eg(["min","max"],function(n){var a=t.get(n+"Span"),o=t.get(n+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=rr(i[0]+o,i,[0,100],!0):a!=null&&(o=rr(a,[0,100],i,!0)-i[0]),e[n+"Span"]=a,e[n+"ValueSpan"]=o},this)},r.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,i=this._valueWindow;if(t){var n=Bm(i,[0,500]);n=Math.min(n,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+i[0].toFixed(n)),t[1]!==100&&a.setDeterminedMinMax("max",+i[1].toFixed(n)),a.freeze()}},r}();function BSe(r,e,t){var i=[1/0,-1/0];eg(t,function(o){c8(i,o.getData(),e)});var n=r.getAxisModel(),a=L1(n.axis.scale,n,i).calculate();return[a.min,a.max]}var Sj=FSe;var kSe={getTargetSeries:function(r){function e(n){r.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=r.getComponent(ms(o),s);n(o,s,l,a)})})}e(function(n,a,o,s){o.__dzAxisProxy=null});var t=[];e(function(n,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new Sj(n,a,s,r),t.push(o.__dzAxisProxy))});var i=ke();return N(t,function(n){N(n.getTargetSeriesModels(),function(a){i.set(a.uid,a)})}),i},overallReset:function(r,e){r.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(i,n){t.getAxisProxy(i,n).reset(t)}),t.eachTargetAxis(function(i,n){t.getAxisProxy(i,n).filterData(t,e)})}),r.eachComponent("dataZoom",function(t){var i=t.findRepresentativeAxisProxy();if(i){var n=i.getDataPercentWindow(),a=i.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:a[0],endValue:a[1]})}})}},Mj=kSe;function fO(r){r.registerAction("dataZoom",function(e,t){var i=vj(t,e);N(i,function(n){n.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var bj=!1;function pd(r){bj||(bj=!0,r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,Mj),fO(r),r.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function wj(r){r.registerComponentModel(yj),r.registerComponentView(_j),pd(r)}var $i=function(){function r(){}return r}();var Tj={};function th(r,e){Tj[r]=e}function aE(r){return Tj[r]}var GSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){r.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;N(this.option.feature,function(i,n){var a=aE(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),_t(i,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Pt),Ej=GSe;function Aj(r,e,t){var i=e.getBoxLayoutParams(),n=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},o=xr(i,a,n);Xs(e.get("orient"),r,e.get("itemGap"),o.width,o.height),Cf(r,i,a,n)}function oE(r,e){var t=Hs(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),r=new Et({shape:{x:r.x-t[3],y:r.y-t[0],width:r.width+t[1]+t[3],height:r.height+t[0]+t[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1}),r}var WSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n,a){var o=this.group;if(o.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},c=this._features||(this._features={}),f=[];N(u,function(d,g){f.push(g)}),new An(this._featureNames||[],f).add(h).update(h).remove(ot(h,null)).execute(),this._featureNames=f;function h(d,g){var m=f[d],v=f[g],_=u[m],y=new Zt(_,t,t.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===m&&(_.title=a.newTitle),m&&!v){if(XSe(m))x={onclick:y.option.onclick,featureName:m};else{var M=aE(m);if(!M)return;x=new M}c[m]=x}else if(x=c[v],!x)return;x.uid=rs("toolbox-feature"),x.model=y,x.ecModel=i,x.api=n;var S=x instanceof $i;if(!m&&v){S&&x.dispose&&x.dispose(i,n);return}if(!y.get("show")||S&&x.unusable){S&&x.remove&&x.remove(i,n);return}p(y,x,m),y.setIconStatus=function(w,T){var C=this.option,b=this.iconPaths;C.iconStatus=C.iconStatus||{},C.iconStatus[w]=T,b[w]&&(T==="emphasis"?Bn:kn)(b[w])},x instanceof $i&&x.render&&x.render(y,i,n,a)}function p(d,g,m){var v=d.getModel("iconStyle"),_=d.getModel(["emphasis","iconStyle"]),y=g instanceof $i&&g.getIcons?g.getIcons():d.get("icon"),x=d.get("title")||{},M,S;Ce(y)?(M={},M[m]=y):M=y,Ce(x)?(S={},S[m]=x):S=x;var w=d.iconPaths={};N(M,function(T,C){var b=Lu(T,{},{x:-s/2,y:-s/2,width:s,height:s});b.setStyle(v.getItemStyle());var E=b.ensureState("emphasis");E.style=_.getItemStyle();var I=new Lt({style:{text:S[C],align:_.get("textAlign"),borderRadius:_.get("textBorderRadius"),padding:_.get("textPadding"),fill:null,font:av({fontStyle:_.get("textFontStyle"),fontFamily:_.get("textFontFamily"),fontSize:_.get("textFontSize"),fontWeight:_.get("textFontWeight")},i)},ignore:!0});b.setTextContent(I),Gs({el:b,componentModel:t,itemName:C,formatterParamsExtra:{title:S[C]}}),b.__title=S[C],b.on("mouseover",function(){var R=_.getItemStyle(),A=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";I.setStyle({fill:_.get("textFill")||R.fill||R.stroke||"#000",backgroundColor:_.get("textBackgroundColor")}),b.setTextConfig({position:_.get("textPosition")||A}),I.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){d.get(["iconStatus",C])!=="emphasis"&&n.leaveEmphasis(this),I.hide()}),(d.get(["iconStatus",C])==="emphasis"?Bn:kn)(b),o.add(b),b.on("click",Be(g.onclick,g,i,n,C)),w[C]=b})}Aj(o,t,n),o.add(oE(o.getBoundingRect(),t)),l||o.eachChild(function(d){var g=d.__title,m=d.ensureState("emphasis"),v=m.textConfig||(m.textConfig={}),_=d.getTextContent(),y=_&&_.ensureState("emphasis");if(y&&!He(y)&&g){var x=y.style||(y.style={}),M=Rl(g,Lt.makeFont(x)),S=d.x+o.x,w=d.y+o.y+s,T=!1;w+M.height>n.getHeight()&&(v.position="top",T=!0);var C=T?-5-M.height:s+10;S+M.width/2>n.getWidth()?(v.position=["100%",C],x.align="right"):S-M.width/2<0&&(v.position=[0,C],x.align="left")}})},e.prototype.updateView=function(t,i,n,a){N(this._features,function(o){o instanceof $i&&o.updateView&&o.updateView(o.model,i,n,a)})},e.prototype.remove=function(t,i){N(this._features,function(n){n instanceof $i&&n.remove&&n.remove(t,i)}),this.group.removeAll()},e.prototype.dispose=function(t,i){N(this._features,function(n){n instanceof $i&&n.dispose&&n.dispose(t,i)})},e.type="toolbox",e}(er);function XSe(r){return r.indexOf("my")===0}var Cj=WSe;var YSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){var n=this.model,a=n.get("name")||t.get("title.0.text")||"echarts",o=i.getZr().painter.getType()==="svg",s=o?"svg":n.get("type",!0)||"png",l=i.getConnectedDataURL({type:s,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),u=zt.browser;if(He(MouseEvent)&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(f)}else if(window.navigator.msSaveOrOpenBlob||o){var h=l.split(","),p=h[0].indexOf("base64")>-1,d=o?decodeURIComponent(h[1]):h[1];p&&(d=window.atob(d));var g=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var m=d.length,v=new Uint8Array(m);m--;)v[m]=d.charCodeAt(m);var _=new Blob([v]);window.navigator.msSaveOrOpenBlob(_,g)}else{var y=document.createElement("iframe");document.body.appendChild(y);var x=y.contentWindow,M=x.document;M.open("image/svg+xml","replace"),M.write(d),M.close(),x.focus(),M.execCommand("SaveAs",!0,g),document.body.removeChild(y)}}else{var S=n.get("lang"),w='',T=window.open();T.document.write(w),T.document.title=a}},e.getDefaultOption=function(t){var i={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return i},e}($i),Rj=YSe;var Lj="__ec_magicType_stack__";var qSe=[["line","bar"],["stack"]],ZSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,i=t.get("icon"),n={};return N(t.get("type"),function(a){i[a]&&(n[a]=i[a])}),n},e.getDefaultOption=function(t){var i={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return i},e.prototype.onclick=function(t,i,n){var a=this.model,o=a.get(["seriesIndex",n]);if(Pj[n]){var s={series:[]},l=function(f){var h=f.subType,p=f.id,d=Pj[n](h,p,f,a);d&&(Ye(d,f.option),s.series.push(d));var g=f.coordinateSystem;if(g&&g.type==="cartesian2d"&&(n==="line"||n==="bar")){var m=g.getAxesByScale("ordinal")[0];if(m){var v=m.dim,_=v+"Axis",y=f.getReferringComponents(_,Ar).models[0],x=y.componentIndex;s[_]=s[_]||[];for(var M=0;M<=x;M++)s[_][x]=s[_][x]||{};s[_][x].boundaryGap=n==="bar"}}};N(qSe,function(f){dt(f,n)>=0&&N(f,function(h){a.setIconStatus(h,"normal")})}),a.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=n;n==="stack"&&(u=_t({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",n])!=="emphasis"&&(c="tiled")),i.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},e}($i),Pj={line:function(r,e,t,i){if(r==="bar")return _t({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(r,e,t,i){if(r==="line")return _t({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(r,e,t,i){var n=t.get("stack")===Lj;if(r==="line"||r==="bar")return i.setIconStatus("stack",n?"normal":"emphasis"),_t({id:e,stack:n?"":Lj},i.get(["option","stack"])||{},!0)}};ha({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(r,e){e.mergeOption(r.newOption)});var Dj=ZSe;var lE=new Array(60).join("-"),tg=" ";function jSe(r){var e={},t=[],i=[];return r.eachRawSeries(function(n){var a=n.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(n)}else t.push(n)}else t.push(n)}),{seriesGroupByCategoryAxis:e,other:t,meta:i}}function KSe(r){var e=[];return N(r,function(t,i){var n=t.categoryAxis,a=t.valueAxis,o=a.dim,s=[" "].concat(de(t.series,function(p){return p.name})),l=[n.model.getCategories()];N(t.series,function(p){var d=p.getRawData();l.push(p.getRawData().mapArray(d.mapDimension(o),function(g){return g}))});for(var u=[s.join(tg)],c=0;c=0)return!0}var fO=new RegExp("["+Qv+"]+","g");function $Se(r){for(var e=r.split(/\n+/g),t=aE(e.shift()).split(fO),i=[],n=de(t,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=t[a];if(o[n])break}if(a<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(s){var l=s.getPercentRange();t[0][n]={dataZoomId:n,start:l[0],end:l[1]}}}}),t.push(e)}function Oj(r){var e=hO(r),t=e[e.length-1];e.length>1&&e.pop();var i={};return Ij(t,function(n,a){for(var o=e.length-1;o>=0;o--)if(n=e[o][a],n){i[a]=n;break}}),i}function Fj(r){Nj(r).snapshots=null}function zj(r){return hO(r).length}function hO(r){var e=Nj(r);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var iMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){Fj(t),i.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var i={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return i},e}($i);ua({type:"restore",event:"restore",update:"prepareAndUpdate"},function(r,e){e.resetOption("recreate")});var kj=iMe;var nMe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],aMe=function(){function r(e,t,i){var n=this;this._targetInfoList=[];var a=Vj(t,e);N(oMe,function(o,s){(!i||!i.include||dt(i.include,s)>=0)&&o(a,n._targetInfoList)})}return r.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(i,n,a){if((i.coordRanges||(i.coordRanges=[])).push(n),!i.coordRange){i.coordRange=n;var o=pO[i.brushType](0,a,n);i.__rangeOffset={offset:Xj[i.brushType](o.values,i.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},r.prototype.matchOutputRanges=function(e,t,i){N(e,function(n){var a=this.findTargetInfo(n,t);a&&a!==!0&&N(a.coordSyses,function(o){var s=pO[n.brushType](1,o,n.range,!0);i(n,s.values,o,t)})},this)},r.prototype.setInputRanges=function(e,t){N(e,function(i){var n=this.findTargetInfo(i,t);if(i.range=i.range||[],n&&n!==!0){i.panelId=n.panelId;var a=pO[i.brushType](0,n.coordSys,i.coordRange),o=i.__rangeOffset;i.range=o?Xj[i.brushType](a.values,o.offset,sMe(a.xyMinMax,o.xyMinMax)):a.values}},this)},r.prototype.makePanelOpts=function(e,t){return de(this._targetInfoList,function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t?t(i):null,clipPath:PT(n),isTargetByCursor:IT(n,e,i.coordSysModel),getLinearBrushOtherExtent:DT(n)}})},r.prototype.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return n===!0||n&&dt(n.coordSyses,t.coordinateSystem)>=0},r.prototype.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=Vj(t,e),a=0;ar[1]&&r.reverse(),r}function Vj(r,e){return vf(r,e,{includeMainTypes:nMe})}var oMe={grid:function(r,e){var t=r.xAxisModels,i=r.yAxisModels,n=r.gridModels,a=ke(),o={},s={};!t&&!i&&!n||(N(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),N(i,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),N(n,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];N(u.getCartesians(),function(f,h){(dt(t,f.getAxis("x").model)>=0||dt(i,f.getAxis("y").model)>=0)&&c.push(f)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:Hj.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(r,e){N(r.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:Hj.geo})})}},Gj=[function(r,e){var t=r.xAxisModel,i=r.yAxisModel,n=r.gridModel;return!n&&t&&(n=t.axis.grid.model),!n&&i&&(n=i.axis.grid.model),n&&n===e.gridModel},function(r,e){var t=r.geoModel;return t&&t===e.geoModel}],Hj={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var r=this.coordSys,e=r.getBoundingRect().clone();return e.applyTransform(ks(r)),e}},pO={lineX:ot(Wj,0),lineY:ot(Wj,1),rect:function(r,e,t,i){var n=r?e.pointToData([t[0][0],t[1][0]],i):e.dataToPoint([t[0][0],t[1][0]],i),a=r?e.pointToData([t[0][1],t[1][1]],i):e.dataToPoint([t[0][1],t[1][1]],i),o=[dO([n[0],a[0]]),dO([n[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(r,e,t,i){var n=[[1/0,-1/0],[1/0,-1/0]],a=de(t,function(o){var s=r?e.pointToData(o,i):e.dataToPoint(o,i);return n[0][0]=Math.min(n[0][0],s[0]),n[1][0]=Math.min(n[1][0],s[1]),n[0][1]=Math.max(n[0][1],s[0]),n[1][1]=Math.max(n[1][1],s[1]),s});return{values:a,xyMinMax:n}}};function Wj(r,e,t,i){var n=t.getAxis(["x","y"][r]),a=dO(de([0,1],function(s){return e?n.coordToData(n.toLocalCoord(i[s]),!0):n.toGlobalCoord(n.dataToCoord(i[s]))})),o=[];return o[r]=a,o[1-r]=[NaN,NaN],{values:a,xyMinMax:o}}var Xj={lineX:ot(Yj,0),lineY:ot(Yj,1),rect:function(r,e,t){return[[r[0][0]-t[0]*e[0][0],r[0][1]-t[0]*e[0][1]],[r[1][0]-t[1]*e[1][0],r[1][1]-t[1]*e[1][1]]]},polygon:function(r,e,t){return de(r,function(i,n){return[i[0]-t[0]*e[n][0],i[1]-t[1]*e[n][1]]})}};function Yj(r,e,t,i){return[e[0]-i[r]*t[0],e[1]-i[r]*t[1]]}function sMe(r,e){var t=qj(r),i=qj(e),n=[t[0]/i[0],t[1]/i[1]];return isNaN(n[0])&&(n[0]=1),isNaN(n[1])&&(n[1]=1),n}function qj(r){return r?[r[0][1]-r[0][0],r[1][1]-r[1][0]]:[NaN,NaN]}var kx=aMe;var mO=N,lMe=sH("toolbox-dataZoom_");var uMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n,a){this._brushController||(this._brushController=new Gv(n.getZr()),this._brushController.on("brush",Be(this._onBrush,this)).mount()),hMe(t,i,this,a,n),fMe(t,i)},e.prototype.onclick=function(t,i,n){cMe[n].call(this)},e.prototype.remove=function(t,i){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,i){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var i=t.areas;if(!t.isEnd||!i.length)return;var n={},a=this.ecModel;this._brushController.updateCovers([]);var o=new kx(vO(this.model),a,{include:["grid"]});o.matchOutputRanges(i,a,function(u,c,f){if(f.type==="cartesian2d"){var h=u.brushType;h==="rect"?(s("x",f,c[0]),s("y",f,c[1])):s({lineX:"x",lineY:"y"}[h],f,c)}}),Uj(a,n),this._dispatchZoomAction(n);function s(u,c,f){var h=c.getAxis(u),p=h.model,d=l(u,p,a),g=d.findRepresentativeAxisProxy(p).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(f=Xa(0,f.slice(),h.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),d&&(n[d.id]={dataZoomId:d.id,startValue:f[0],endValue:f[1]})}function l(u,c,f){var h;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(p){var d=p.getAxisModel(u,c.componentIndex);d&&(h=p)}),h}},e.prototype._dispatchZoomAction=function(t){var i=[];mO(t,function(n,a){i.push(Qe(n))}),i.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:i})},e.getDefaultOption=function(t){var i={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return i},e}($i),cMe={zoom:function(){var r=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:r})},back:function(){this._dispatchZoomAction(Oj(this.ecModel))}};function vO(r){var e={xAxisIndex:r.get("xAxisIndex",!0),yAxisIndex:r.get("yAxisIndex",!0),xAxisId:r.get("xAxisId",!0),yAxisId:r.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function fMe(r,e){r.setIconStatus("back",zj(e)>1?"emphasis":"normal")}function hMe(r,e,t,i,n){var a=t._isZoomActive;i&&i.type==="takeGlobalCursor"&&(a=i.key==="dataZoomSelect"?i.dataZoomSelectActive:!1),t._isZoomActive=a,r.setIconStatus("zoom",a?"emphasis":"normal");var o=new kx(vO(r),e,{include:["grid"]}),s=o.makePanelOpts(n,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}:!1)}C5("dataZoom",function(r){var e=r.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var i=e.getModel(t),n=[],a=vO(i),o=vf(r,a);mO(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),mO(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var f=l.componentIndex,h={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:lMe+u+f};h[c]=f,n.push(h)}return n});var Zj=uMe;function gO(r){r.registerComponentModel(Tj),r.registerComponentView(Aj),Qf("saveAsImage",Cj),Qf("magicType",Pj),Qf("dataView",Dj),Qf("dataZoom",Zj),Qf("restore",kj),It(bj)}var pMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Pt),jj=pMe;function sE(r){var e=r.get("confine");return e!=null?!!e:r.get("renderMode")==="richText"}function Kj(r){if(Ft.domSupported){for(var e=document.documentElement.style,t=0,i=r.length;t-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,f=o+n,h=f*Math.abs(Math.cos(c))+f*Math.abs(Math.sin(c)),p=Math.round(((h-Math.SQRT2*n)/2+Math.SQRT2*n-(h-f)/2)*100)/100;s+=";"+a+":-"+p+"px";var d=e+" solid "+n+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+i+";"];return'
'}function yMe(r,e){var t="cubic-bezier(0.23,1,0.32,1)",i=" "+r/2+"s "+t,n="opacity"+i+",visibility"+i;return e||(i=" "+r+"s "+t,n+=Ft.transformSupported?","+xO+i:",left"+i+",top"+i),dMe+":"+n}function Qj(r,e,t){var i=r.toFixed(0)+"px",n=e.toFixed(0)+"px";if(!Ft.transformSupported)return t?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=Ft.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return t?"top:0;left:0;"+xO+":"+o+";":[["top",0],["left",0],[yO,o]]}function _Me(r){var e=[],t=r.get("fontSize"),i=r.getTextColor();i&&e.push("color:"+i),e.push("font:"+r.getFont()),t&&e.push("line-height:"+Math.round(t*3/2)+"px");var n=r.get("textShadowColor"),a=r.get("textShadowBlur")||0,o=r.get("textShadowOffsetX")||0,s=r.get("textShadowOffsetY")||0;return n&&a&&e.push("text-shadow:"+o+"px "+s+"px "+a+"px "+n),N(["decoration","align"],function(l){var u=r.get(l);u&&e.push("text-"+l+":"+u)}),e.join(";")}function xMe(r,e,t){var i=[],n=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),c=r.getModel("textStyle"),f=Yw(r,"html"),h=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+h),e&&n&&i.push(yMe(n,t)),a&&i.push("background-color:"+a),N(["width","color","radius"],function(p){var d="border-"+p,g=Tw(d),m=r.get(g);m!=null&&i.push(d+":"+m+(p==="color"?"":"px"))}),i.push(_Me(c)),f!=null&&i.push("padding:"+Gs(f).join("px ")+"px"),i.join(";")+";"}function eK(r,e,t,i,n){var a=e&&e.painter;if(t){var o=a&&a.getViewportRoot();o&&WV(r,o,t,i,n)}else{r[0]=i,r[1]=n;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/e.getWidth(),r[3]=r[1]/e.getHeight()}var SMe=function(){function r(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Ft.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=e.getZr(),a=t.appendTo,o=a&&(Ce(a)?document.querySelector(a):af(a)?a:He(a)&&a(e.getDom()));eK(this._styleCoord,n,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(i),this._api=e,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,c=n.painter.getViewportRoot();Ta(c,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),i=$j(t,"position"),n=t.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},r.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=mMe+xMe(e,!this._firstShow,this._longHide)+Qj(a[0],a[1],!0)+("border-color:"+Hs(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(e,t,i,n,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(Ce(a)&&i.get("trigger")==="item"&&!sE(i)&&(s=gMe(i,n,a)),Ce(e))o.innerHTML=e+s;else if(e){o.innerHTML="",pe(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,i=this._ecModel,n=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(t,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,i,n,a){if(!(a.from===this.uid||Ft.node||!n.getDom())){var o=aK(a,n);this._ticket="";var s=a.dataByCoordSys,l=CMe(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=bMe;c.x=a.x,c.y=a.y,c.update(),rt(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,i,n,a))return;var f=zx(a,i),h=f.point[0],p=f.point[1];h!=null&&p!=null&&this._tryShow({offsetX:h,offsetY:p,target:f.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(t,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(aK(a,n))},e.prototype._manuallyAxisShowTip=function(t,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var c=u.getData(),f=Vx([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(t,i){var n=t.target,a=this._tooltipModel;if(a){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,t);else if(n){var s=rt(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Ys(n,function(c){if(rt(c).dataIndex!=null)return l=c,!0;if(rt(c).tooltipConfig!=null)return u=c,!0},!0),l?this._showSeriesItemTooltip(t,l,i):u?this._showComponentItemTooltip(t,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},e.prototype._showOrMove=function(t,i){var n=t.get("showDelay");i=Be(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},e.prototype._showAxisTooltip=function(t,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=Vx([i.tooltipOption],a),l=this._renderMode,u=[],c=Or("section",{blocks:[],noHeader:!0}),f=[],h=new qw;N(t,function(_){N(_.dataByAxis,function(y){var x=n.getComponent(y.axisDim+"Axis",y.axisIndex),M=y.value;if(!(!x||M==null)){var S=YU(M,x.axis,n,y.seriesDataIndices,y.valueLabelOpt),w=Or("section",{header:S,noHeader:!Yi(S),sortBlocks:!0,blocks:[]});c.blocks.push(w),N(y.seriesDataIndices,function(T){var C=n.getSeriesByIndex(T.seriesIndex),b=T.dataIndexInside,E=C.getDataParams(b);if(!(E.dataIndex<0)){E.axisDim=y.axisDim,E.axisIndex=y.axisIndex,E.axisType=y.axisType,E.axisId=y.axisId,E.axisValue=ox(x.axis,{value:M}),E.axisValueLabel=S,E.marker=h.makeTooltipMarker("item",Hs(E.color),l);var I=_D(C.formatTooltip(b,!0,null)),R=I.frag;if(R){var A=Vx([C],a).get("valueFormatter");w.blocks.push(A?fe({valueFormatter:A},R):R)}I.text&&f.push(I.text),u.push(E)}})}})}),c.blocks.reverse(),f.reverse();var p=i.position,d=s.get("order"),g=ED(c,h,l,d,n.get("useUTC"),s.get("textStyle"));g&&f.unshift(g);var m=l==="richText"?` +`),meta:e.meta}}function sE(r){return r.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function QSe(r){var e=r.slice(0,r.indexOf(` +`));if(e.indexOf(tg)>=0)return!0}var hO=new RegExp("["+tg+"]+","g");function eMe(r){for(var e=r.split(/\n+/g),t=sE(e.shift()).split(hO),i=[],n=de(t,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=t[a];if(o[n])break}if(a<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(s){var l=s.getPercentRange();t[0][n]={dataZoomId:n,start:l[0],end:l[1]}}}}),t.push(e)}function zj(r){var e=pO(r),t=e[e.length-1];e.length>1&&e.pop();var i={};return Nj(t,function(n,a){for(var o=e.length-1;o>=0;o--)if(n=e[o][a],n){i[a]=n;break}}),i}function Fj(r){Uj(r).snapshots=null}function Bj(r){return pO(r).length}function pO(r){var e=Uj(r);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var aMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){Fj(t),i.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var i={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return i},e}($i);ha({type:"restore",event:"restore",update:"prepareAndUpdate"},function(r,e){e.resetOption("recreate")});var Vj=aMe;var oMe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],sMe=function(){function r(e,t,i){var n=this;this._targetInfoList=[];var a=Gj(t,e);N(lMe,function(o,s){(!i||!i.include||dt(i.include,s)>=0)&&o(a,n._targetInfoList)})}return r.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(i,n,a){if((i.coordRanges||(i.coordRanges=[])).push(n),!i.coordRange){i.coordRange=n;var o=dO[i.brushType](0,a,n);i.__rangeOffset={offset:Yj[i.brushType](o.values,i.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},r.prototype.matchOutputRanges=function(e,t,i){N(e,function(n){var a=this.findTargetInfo(n,t);a&&a!==!0&&N(a.coordSyses,function(o){var s=dO[n.brushType](1,o,n.range,!0);i(n,s.values,o,t)})},this)},r.prototype.setInputRanges=function(e,t){N(e,function(i){var n=this.findTargetInfo(i,t);if(i.range=i.range||[],n&&n!==!0){i.panelId=n.panelId;var a=dO[i.brushType](0,n.coordSys,i.coordRange),o=i.__rangeOffset;i.range=o?Yj[i.brushType](a.values,o.offset,uMe(a.xyMinMax,o.xyMinMax)):a.values}},this)},r.prototype.makePanelOpts=function(e,t){return de(this._targetInfoList,function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t?t(i):null,clipPath:IT(n),isTargetByCursor:UT(n,e,i.coordSysModel),getLinearBrushOtherExtent:NT(n)}})},r.prototype.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return n===!0||n&&dt(n.coordSyses,t.coordinateSystem)>=0},r.prototype.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=Gj(t,e),a=0;ar[1]&&r.reverse(),r}function Gj(r,e){return yf(r,e,{includeMainTypes:oMe})}var lMe={grid:function(r,e){var t=r.xAxisModels,i=r.yAxisModels,n=r.gridModels,a=ke(),o={},s={};!t&&!i&&!n||(N(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),N(i,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),N(n,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];N(u.getCartesians(),function(f,h){(dt(t,f.getAxis("x").model)>=0||dt(i,f.getAxis("y").model)>=0)&&c.push(f)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:Wj.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(r,e){N(r.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:Wj.geo})})}},Hj=[function(r,e){var t=r.xAxisModel,i=r.yAxisModel,n=r.gridModel;return!n&&t&&(n=t.axis.grid.model),!n&&i&&(n=i.axis.grid.model),n&&n===e.gridModel},function(r,e){var t=r.geoModel;return t&&t===e.geoModel}],Wj={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var r=this.coordSys,e=r.getBoundingRect().clone();return e.applyTransform(Vs(r)),e}},dO={lineX:ot(Xj,0),lineY:ot(Xj,1),rect:function(r,e,t,i){var n=r?e.pointToData([t[0][0],t[1][0]],i):e.dataToPoint([t[0][0],t[1][0]],i),a=r?e.pointToData([t[0][1],t[1][1]],i):e.dataToPoint([t[0][1],t[1][1]],i),o=[mO([n[0],a[0]]),mO([n[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(r,e,t,i){var n=[[1/0,-1/0],[1/0,-1/0]],a=de(t,function(o){var s=r?e.pointToData(o,i):e.dataToPoint(o,i);return n[0][0]=Math.min(n[0][0],s[0]),n[1][0]=Math.min(n[1][0],s[1]),n[0][1]=Math.max(n[0][1],s[0]),n[1][1]=Math.max(n[1][1],s[1]),s});return{values:a,xyMinMax:n}}};function Xj(r,e,t,i){var n=t.getAxis(["x","y"][r]),a=mO(de([0,1],function(s){return e?n.coordToData(n.toLocalCoord(i[s]),!0):n.toGlobalCoord(n.dataToCoord(i[s]))})),o=[];return o[r]=a,o[1-r]=[NaN,NaN],{values:a,xyMinMax:o}}var Yj={lineX:ot(qj,0),lineY:ot(qj,1),rect:function(r,e,t){return[[r[0][0]-t[0]*e[0][0],r[0][1]-t[0]*e[0][1]],[r[1][0]-t[1]*e[1][0],r[1][1]-t[1]*e[1][1]]]},polygon:function(r,e,t){return de(r,function(i,n){return[i[0]-t[0]*e[n][0],i[1]-t[1]*e[n][1]]})}};function qj(r,e,t,i){return[e[0]-i[r]*t[0],e[1]-i[r]*t[1]]}function uMe(r,e){var t=Zj(r),i=Zj(e),n=[t[0]/i[0],t[1]/i[1]];return isNaN(n[0])&&(n[0]=1),isNaN(n[1])&&(n[1]=1),n}function Zj(r){return r?[r[0][1]-r[0][0],r[1][1]-r[1][0]]:[NaN,NaN]}var Vx=sMe;var vO=N,cMe=sH("toolbox-dataZoom_");var fMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n,a){this._brushController||(this._brushController=new Wv(n.getZr()),this._brushController.on("brush",Be(this._onBrush,this)).mount()),dMe(t,i,this,a,n),pMe(t,i)},e.prototype.onclick=function(t,i,n){hMe[n].call(this)},e.prototype.remove=function(t,i){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,i){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var i=t.areas;if(!t.isEnd||!i.length)return;var n={},a=this.ecModel;this._brushController.updateCovers([]);var o=new Vx(gO(this.model),a,{include:["grid"]});o.matchOutputRanges(i,a,function(u,c,f){if(f.type==="cartesian2d"){var h=u.brushType;h==="rect"?(s("x",f,c[0]),s("y",f,c[1])):s({lineX:"x",lineY:"y"}[h],f,c)}}),Oj(a,n),this._dispatchZoomAction(n);function s(u,c,f){var h=c.getAxis(u),p=h.model,d=l(u,p,a),g=d.findRepresentativeAxisProxy(p).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(f=Za(0,f.slice(),h.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),d&&(n[d.id]={dataZoomId:d.id,startValue:f[0],endValue:f[1]})}function l(u,c,f){var h;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(p){var d=p.getAxisModel(u,c.componentIndex);d&&(h=p)}),h}},e.prototype._dispatchZoomAction=function(t){var i=[];vO(t,function(n,a){i.push(Qe(n))}),i.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:i})},e.getDefaultOption=function(t){var i={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return i},e}($i),hMe={zoom:function(){var r=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:r})},back:function(){this._dispatchZoomAction(zj(this.ecModel))}};function gO(r){var e={xAxisIndex:r.get("xAxisIndex",!0),yAxisIndex:r.get("yAxisIndex",!0),xAxisId:r.get("xAxisId",!0),yAxisId:r.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function pMe(r,e){r.setIconStatus("back",Bj(e)>1?"emphasis":"normal")}function dMe(r,e,t,i,n){var a=t._isZoomActive;i&&i.type==="takeGlobalCursor"&&(a=i.key==="dataZoomSelect"?i.dataZoomSelectActive:!1),t._isZoomActive=a,r.setIconStatus("zoom",a?"emphasis":"normal");var o=new Vx(gO(r),e,{include:["grid"]}),s=o.makePanelOpts(n,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}:!1)}C5("dataZoom",function(r){var e=r.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var i=e.getModel(t),n=[],a=gO(i),o=yf(r,a);vO(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),vO(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var f=l.componentIndex,h={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:cMe+u+f};h[c]=f,n.push(h)}return n});var jj=fMe;function yO(r){r.registerComponentModel(Ej),r.registerComponentView(Cj),th("saveAsImage",Rj),th("magicType",Dj),th("dataView",Ij),th("dataZoom",jj),th("restore",Vj),It(wj)}var mMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Pt),Kj=mMe;function uE(r){var e=r.get("confine");return e!=null?!!e:r.get("renderMode")==="richText"}function Jj(r){if(zt.domSupported){for(var e=document.documentElement.style,t=0,i=r.length;t-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,f=o+n,h=f*Math.abs(Math.cos(c))+f*Math.abs(Math.sin(c)),p=Math.round(((h-Math.SQRT2*n)/2+Math.SQRT2*n-(h-f)/2)*100)/100;s+=";"+a+":-"+p+"px";var d=e+" solid "+n+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+i+";"];return'
'}function xMe(r,e){var t="cubic-bezier(0.23,1,0.32,1)",i=" "+r/2+"s "+t,n="opacity"+i+",visibility"+i;return e||(i=" "+r+"s "+t,n+=zt.transformSupported?","+SO+i:",left"+i+",top"+i),vMe+":"+n}function eK(r,e,t){var i=r.toFixed(0)+"px",n=e.toFixed(0)+"px";if(!zt.transformSupported)return t?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=zt.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return t?"top:0;left:0;"+SO+":"+o+";":[["top",0],["left",0],[_O,o]]}function SMe(r){var e=[],t=r.get("fontSize"),i=r.getTextColor();i&&e.push("color:"+i),e.push("font:"+r.getFont()),t&&e.push("line-height:"+Math.round(t*3/2)+"px");var n=r.get("textShadowColor"),a=r.get("textShadowBlur")||0,o=r.get("textShadowOffsetX")||0,s=r.get("textShadowOffsetY")||0;return n&&a&&e.push("text-shadow:"+o+"px "+s+"px "+a+"px "+n),N(["decoration","align"],function(l){var u=r.get(l);u&&e.push("text-"+l+":"+u)}),e.join(";")}function MMe(r,e,t){var i=[],n=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),c=r.getModel("textStyle"),f=Zw(r,"html"),h=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+h),e&&n&&i.push(xMe(n,t)),a&&i.push("background-color:"+a),N(["width","color","radius"],function(p){var d="border-"+p,g=Aw(d),m=r.get(g);m!=null&&i.push(d+":"+m+(p==="color"?"":"px"))}),i.push(SMe(c)),f!=null&&i.push("padding:"+Hs(f).join("px ")+"px"),i.join(";")+";"}function tK(r,e,t,i,n){var a=e&&e.painter;if(t){var o=a&&a.getViewportRoot();o&&WV(r,o,t,i,n)}else{r[0]=i,r[1]=n;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/e.getWidth(),r[3]=r[1]/e.getHeight()}var bMe=function(){function r(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,zt.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=e.getZr(),a=t.appendTo,o=a&&(Ce(a)?document.querySelector(a):sf(a)?a:He(a)&&a(e.getDom()));tK(this._styleCoord,n,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(i),this._api=e,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,c=n.painter.getViewportRoot();Ca(c,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),i=Qj(t,"position"),n=t.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},r.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=gMe+MMe(e,!this._firstShow,this._longHide)+eK(a[0],a[1],!0)+("border-color:"+Ws(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(e,t,i,n,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(Ce(a)&&i.get("trigger")==="item"&&!uE(i)&&(s=_Me(i,n,a)),Ce(e))o.innerHTML=e+s;else if(e){o.innerHTML="",pe(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,i=this._ecModel,n=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(t,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,i,n,a){if(!(a.from===this.uid||zt.node||!n.getDom())){var o=oK(a,n);this._ticket="";var s=a.dataByCoordSys,l=LMe(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=TMe;c.x=a.x,c.y=a.y,c.update(),rt(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,i,n,a))return;var f=Bx(a,i),h=f.point[0],p=f.point[1];h!=null&&p!=null&&this._tryShow({offsetX:h,offsetY:p,target:f.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(t,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(oK(a,n))},e.prototype._manuallyAxisShowTip=function(t,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var c=u.getData(),f=Gx([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(t,i){var n=t.target,a=this._tooltipModel;if(a){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,t);else if(n){var s=rt(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;qs(n,function(c){if(rt(c).dataIndex!=null)return l=c,!0;if(rt(c).tooltipConfig!=null)return u=c,!0},!0),l?this._showSeriesItemTooltip(t,l,i):u?this._showComponentItemTooltip(t,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},e.prototype._showOrMove=function(t,i){var n=t.get("showDelay");i=Be(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},e.prototype._showAxisTooltip=function(t,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=Gx([i.tooltipOption],a),l=this._renderMode,u=[],c=Or("section",{blocks:[],noHeader:!0}),f=[],h=new jw;N(t,function(_){N(_.dataByAxis,function(y){var x=n.getComponent(y.axisDim+"Axis",y.axisIndex),M=y.value;if(!(!x||M==null)){var S=qU(M,x.axis,n,y.seriesDataIndices,y.valueLabelOpt),w=Or("section",{header:S,noHeader:!Yi(S),sortBlocks:!0,blocks:[]});c.blocks.push(w),N(y.seriesDataIndices,function(T){var C=n.getSeriesByIndex(T.seriesIndex),b=T.dataIndexInside,E=C.getDataParams(b);if(!(E.dataIndex<0)){E.axisDim=y.axisDim,E.axisIndex=y.axisIndex,E.axisType=y.axisType,E.axisId=y.axisId,E.axisValue=sx(x.axis,{value:M}),E.axisValueLabel=S,E.marker=h.makeTooltipMarker("item",Ws(E.color),l);var I=SD(C.formatTooltip(b,!0,null)),R=I.frag;if(R){var A=Gx([C],a).get("valueFormatter");w.blocks.push(A?fe({valueFormatter:A},R):R)}I.text&&f.push(I.text),u.push(E)}})}})}),c.blocks.reverse(),f.reverse();var p=i.position,d=s.get("order"),g=CD(c,h,l,d,n.get("useUTC"),s.get("textStyle"));g&&f.unshift(g);var m=l==="richText"?` -`:"
",v=f.join(m);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,p,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,v,u,Math.random()+"",o[0],o[1],p,null,h)})},e.prototype._showSeriesItemTooltip=function(t,i,n){var a=this._ecModel,o=rt(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,f=o.dataType,h=u.getData(f),p=this._renderMode,d=t.positionDefault,g=Vx([h.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),m=g.get("trigger");if(!(m!=null&&m!=="item")){var v=u.getDataParams(c,f),_=new qw;v.marker=_.makeTooltipMarker("item",Hs(v.color),p);var y=_D(u.formatTooltip(c,!1,f)),x=g.get("order"),M=g.get("valueFormatter"),S=y.frag,w=S?ED(M?fe({valueFormatter:M},S):S,_,p,x,a.get("useUTC"),g.get("textStyle")):y.text,T="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,w,v,T,t.offsetX,t.offsetY,t.position,t.target,_)}),n({type:"showTip",dataIndexInside:c,dataIndex:h.getRawIndex(c),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,i,n){var a=rt(i),o=a.tooltipConfig,s=o.option||{};if(Ce(s)){var l=s;s={content:l,formatter:l}}var u=[s],c=this._ecModel.getComponent(a.componentMainType,a.componentIndex);c&&u.push(c),u.push({formatter:s.content});var f=t.positionDefault,h=Vx(u,this._tooltipModel,f?{position:f}:null),p=h.get("content"),d=Math.random()+"",g=new qw;this._showOrMove(h,function(){var m=Qe(h.get("formatterParams")||{});this._showTooltipContent(h,p,m,d,t.offsetX,t.offsetY,t.position,i,g)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,i,n,a,o,s,l,u,c){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var f=this._tooltipContent;f.setEnterable(t.get("enterable"));var h=t.get("formatter");l=l||t.get("position");var p=i,d=this._getNearestPoint([o,s],n,t.get("trigger"),t.get("borderColor")),g=d.color;if(h)if(Ce(h)){var m=t.ecModel.get("useUTC"),v=pe(n)?n[0]:n,_=v&&v.axisType&&v.axisType.indexOf("time")>=0;p=h,_&&(p=Bp(v.axisValue,p,m)),p=Aw(p,n,!0)}else if(He(h)){var y=Be(function(x,M){x===this._ticket&&(f.setContent(M,c,t,g,l),this._updatePosition(t,l,o,s,f,n,u))},this);this._ticket=a,p=h(n,a,y)}else p=h;f.setContent(p,c,t,g,l),f.show(t,g),this._updatePosition(t,l,o,s,f,n,u)}},e.prototype._getNearestPoint=function(t,i,n,a){if(n==="axis"||pe(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!pe(i))return{color:a||i.color||i.borderColor}},e.prototype._updatePosition=function(t,i,n,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();i=i||t.get("position");var f=o.getSize(),h=t.get("align"),p=t.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),He(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,c],contentSize:f.slice()})),pe(i))n=Fe(i[0],u),a=Fe(i[1],c);else if(qe(i)){var g=i;g.width=f[0],g.height=f[1];var m=xr(g,{width:u,height:c});n=m.x,a=m.y,h=null,p=null}else if(Ce(i)&&l){var v=AMe(i,d,f,t.get("borderWidth"));n=v[0],a=v[1]}else{var v=TMe(n,a,o,u,c,h?null:20,p?null:20);n=v[0],a=v[1]}if(h&&(n-=oK(h)?f[0]/2:h==="right"?f[0]:0),p&&(a-=oK(p)?f[1]/2:p==="bottom"?f[1]:0),sE(t)){var v=EMe(n,a,o,u,c);n=v[0],a=v[1]}o.moveTo(n,a)},e.prototype._updateContentNotChangedOnAxis=function(t,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===t.length;return o&&N(n,function(s,l){var u=s.dataByAxis||[],c=t[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&N(u,function(h,p){var d=f[p]||{},g=h.seriesDataIndices||[],m=d.seriesDataIndices||[];o=o&&h.value===d.value&&h.axisType===d.axisType&&h.axisId===d.axisId&&g.length===m.length,o&&N(g,function(v,_){var y=m[_];o=o&&v.seriesIndex===y.seriesIndex&&v.dataIndex===y.dataIndex}),a&&N(h.seriesDataIndices,function(v){var _=v.seriesIndex,y=i[_],x=a[_];y&&x&&x.data!==y.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=i,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,i){Ft.node||!i.getDom()||(zu(this,"_updatePosition"),this._tooltipContent.dispose(),Fx("itemTooltip",i))},e.type="tooltip",e}(Qt);function Vx(r,e,t){var i=e.ecModel,n;t?(n=new Zt(t,i,i),n=new Zt(e.option,n,i)):n=e;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof Zt&&(o=o.get("tooltip",!0)),Ce(o)&&(o={formatter:o}),o&&(n=new Zt(o,n,i)))}return n}function aK(r,e){return r.dispatchAction||Be(e.dispatchAction,e)}function TMe(r,e,t,i,n,a,o){var s=t.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>i?r-=l+a:r+=a),o!=null&&(e+u+o>n?e-=u+o:e+=o),[r,e]}function EMe(r,e,t,i,n){var a=t.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,i)-o,e=Math.min(e+s,n)-s,r=Math.max(r,0),e=Math.max(e,0),[r,e]}function AMe(r,e,t,i){var n=t[0],a=t[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,c=e.height;switch(r){case"inside":s=e.x+u/2-n/2,l=e.y+c/2-a/2;break;case"top":s=e.x+u/2-n/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-n/2,l=e.y+c+o;break;case"left":s=e.x-n-o,l=e.y+c/2-a/2;break;case"right":s=e.x+u+o,l=e.y+c/2-a/2}return[s,l]}function oK(r){return r==="center"||r==="middle"}function CMe(r,e,t){var i=n_(r).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=gf(e,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=t.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=rt(u).tooltipConfig;if(c&&c.name===r.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}var sK=wMe;function SO(r){It(il),r.registerComponentModel(jj),r.registerComponentView(sK),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Ir),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Ir)}var RMe=["rect","polygon","keep","clear"];function MO(r,e){var t=Jt(r?r.brush:[]);if(t.length){var i=[];N(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(i=i.concat(u))});var n=r&&r.toolbox;pe(n)&&(n=n[0]),n||(n={feature:{}},r.toolbox=[n]);var a=n.feature||(n.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,i),LMe(s),e&&!s.length&&s.push.apply(s,RMe)}}function LMe(r){var e={};N(r,function(t){e[t]=1}),r.length=0,N(e,function(t,i){r.push(i)})}var lK=N;function uK(r){if(r){for(var e in r)if(r.hasOwnProperty(e))return!0}}function Gx(r,e,t){var i={};return lK(e,function(a){var o=i[a]=n();lK(r[a],function(s,l){if(pi.isValidType(l)){var u={type:l,visual:s};t&&t(u,a),o[l]=new pi(u),l==="opacity"&&(u=Qe(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new pi(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function lE(r,e,t){var i;N(t,function(n){e.hasOwnProperty(n)&&uK(e[n])&&(i=!0)}),i&&N(t,function(n){e.hasOwnProperty(n)&&uK(e[n])?r[n]=Qe(e[n]):delete r[n]})}function cK(r,e,t,i,n,a){var o={};N(r,function(f){var h=pi.prepareVisualTypes(e[f]);o[f]=h});var s;function l(f){return H_(t,s,f)}function u(f,h){ID(t,s,f,h)}a==null?t.each(c):t.each([a],c);function c(f,h){s=a==null?f:h;var p=t.getRawDataItem(s);if(!(p&&p.visualMap===!1))for(var d=i.call(n,f),g=e[d],m=o[d],v=0,_=m.length;v<_;v++){var y=m[v];g[y]&&g[y].applyVisual(f,l,u)}}}function fK(r,e,t,i){var n={};return N(r,function(a){var o=pi.prepareVisualTypes(e[a]);n[a]=o}),{progress:function(o,s){var l;i!=null&&(l=s.getDimensionIndex(i));function u(M){return H_(s,f,M)}function c(M,S){ID(s,f,M,S)}for(var f,h=s.getStore();(f=o.next())!=null;){var p=s.getRawDataItem(f);if(!(p&&p.visualMap===!1))for(var d=i!=null?h.get(l,f):f,g=t(d),m=e[g],v=n[g],_=0,y=v.length;_e[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&gK(e)}};function gK(r){return new lt(r[0][0],r[1][0],r[0][1]-r[0][0],r[1][1]-r[1][0])}var UMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){this.ecModel=t,this.api=i,this.model,(this._brushController=new Gv(i.getZr())).on("brush",Be(this._onBrush,this)).mount()},e.prototype.render=function(t,i,n,a){this.model=t,this._updateController(t,i,n,a)},e.prototype.updateTransform=function(t,i,n,a){TO(i),this._updateController(t,i,n,a)},e.prototype.updateVisual=function(t,i,n,a){this.updateTransform(t,i,n,a)},e.prototype.updateView=function(t,i,n,a){this._updateController(t,i,n,a)},e.prototype._updateController=function(t,i,n,a){(!a||a.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var i=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:Qe(n),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:Qe(n),$from:i})},e.type="brush",e}(Qt),yK=UMe;var OMe="#ddd",FMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,i){var n=this.option;!i&&lE(n,t,["inBrush","outOfBrush"]);var a=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:OMe},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=de(t,function(i){return _K(this.option,i)},this))},e.prototype.setBrushOption=function(t){this.brushOption=_K(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Pt);function _K(r,e){return _t({brushType:r.brushType,brushMode:r.brushMode,transformable:r.transformable,brushStyle:new Zt(r.brushStyle).getItemStyle(),removeOnClick:r.removeOnClick,z:r.z},e,!0)}var xK=FMe;var zMe=["rect","polygon","lineX","lineY","keep","clear"],BMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n){var a,o,s;i.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,N(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,i,n){this.render(t,i,n)},e.prototype.getIcons=function(){var t=this.model,i=t.get("icon",!0),n={};return N(t.get("type",!0),function(a){i[a]&&(n[a]=i[a])}),n},e.prototype.onclick=function(t,i,n){var a=this._brushType,o=this._brushMode;n==="clear"?(i.dispatchAction({type:"axisAreaSelect",intervals:[]}),i.dispatchAction({type:"brush",command:"clear",areas:[]})):i.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:n==="keep"?a:a===n?!1:n,brushMode:n==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(t){var i={show:!0,type:zMe.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return i},e}($i),SK=BMe;function AO(r){r.registerComponentView(yK),r.registerComponentModel(xK),r.registerPreprocessor(MO),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,EO),r.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(i){i.setAreas(e.areas)})}),r.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Ir),r.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Ir),Qf("brush",SK)}var kMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Pt),VMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){if(this.group.removeAll(),!!t.get("show")){var a=this.group,o=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=ft(t.get("textBaseline"),t.get("textVerticalAlign")),c=new Lt({style:fr(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=c.getBoundingRect(),h=t.get("subtext"),p=new Lt({style:fr(s,{text:h,fill:s.getTextColor(),y:f.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),g=t.get("sublink"),m=t.get("triggerEvent",!0);c.silent=!d&&!m,p.silent=!g&&!m,d&&c.on("click",function(){kp(d,"_"+t.get("target"))}),g&&p.on("click",function(){kp(g,"_"+t.get("subtarget"))}),rt(c).eventData=rt(p).eventData=m?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(c),h&&a.add(p);var v=a.getBoundingRect(),_=t.getBoxLayoutParams();_.width=v.width,_.height=v.height;var y=xr(_,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?y.x+=y.width:l==="center"&&(y.x+=y.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?y.y+=y.height:u==="middle"&&(y.y+=y.height/2),u=u||"top"),a.x=y.x,a.y=y.y,a.markRedraw();var x={align:l,verticalAlign:u};c.setStyle(x),p.setStyle(x),v=a.getBoundingRect();var M=y.margin,S=t.getItemStyle(["color","opacity"]);S.fill=t.get("backgroundColor");var w=new Tt({shape:{x:v.x-M[3],y:v.y-M[0],width:v.width+M[1]+M[3],height:v.height+M[0]+M[2],r:t.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});a.add(w)}},e.type="title",e}(Qt);function CO(r){r.registerComponentModel(kMe),r.registerComponentView(VMe)}var GMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n),this._initData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var i=this._data.count();this.option.loop?t=(t%i+i)%i:(t>=i&&(t=i-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t=this.option,i=t.data||[],n=t.axisType,a=this._names=[],o;n==="category"?(o=[],N(i,function(u,c){var f=Yr(Os(u),""),h;qe(u)?(h=Qe(u),h.value=c):h=c,o.push(h),a.push(f)})):o=i;var s={category:"ordinal",time:"time",value:"number"}[n]||"number",l=this._data=new ti([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Pt),RO=GMe;var MK=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=Hn(RO.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(RO);wr(MK,hv.prototype);var bK=MK;var HMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(Qt),wK=HMe;var WMe=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this,t,i,n)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(pn),TK=WMe;var LO=Math.PI,EK=vt(),XMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){this.api=i},e.prototype.render=function(t,i,n){if(this.model=t,this.api=n,this.ecModel=i,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,n),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return Or("nameValue",{noName:!0,value:c})},N(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,t)},this),this._renderAxisLabel(a,s,l,t),this._position(a,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,i){var n=t.get(["label","position"]),a=t.get("orient"),o=qMe(t,i),s;n==null||n==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:LO/2},f=a==="vertical"?o.height:o.width,h=t.getModel("controlStyle"),p=h.get("show",!0),d=p?h.get("itemSize"):0,g=p?h.get("itemGap"):0,m=d+g,v=t.get(["label","rotate"])||0;v=v*LO/180;var _,y,x,M=h.get("position",!0),S=p&&h.get("showPlayBtn",!0),w=p&&h.get("showPrevBtn",!0),T=p&&h.get("showNextBtn",!0),C=0,b=f;M==="left"||M==="bottom"?(S&&(_=[0,0],C+=m),w&&(y=[C,0],C+=m),T&&(x=[b-d,0],b-=m)):(S&&(_=[b-d,0],b-=m),w&&(y=[0,0],C+=m),T&&(x=[b-d,0],b-=m));var E=[C,b];return t.get("inverse")&&E.reverse(),{viewRect:o,mainLength:f,orient:a,rotation:c[a],labelRotation:v,labelPosOpt:s,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:_,prevBtnPosition:y,nextBtnPosition:x,axisExtent:E,controlSize:d,controlGap:g}},e.prototype._position=function(t,i){var n=this._mainGroup,a=this._labelGroup,o=t.viewRect;if(t.orient==="vertical"){var s=wi(),l=o.x,u=o.y+o.height;_n(s,s,[-l,-u]),Ca(s,s,-LO/2),_n(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),f=_(n.getBoundingRect()),h=_(a.getBoundingRect()),p=[n.x,n.y],d=[a.x,a.y];d[0]=p[0]=c[0][0];var g=t.labelPosOpt;if(g==null||Ce(g)){var m=g==="+"?0:1;y(p,f,c,1,m),y(d,h,c,1,1-m)}else{var m=g>=0?0:1;y(p,f,c,1,m),d[1]=p[1]+g}n.setPosition(p),a.setPosition(d),n.rotation=a.rotation=t.rotation,v(n),v(a);function v(x){x.originX=c[0][0]-x.x,x.originY=c[1][0]-x.y}function _(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function y(x,M,S,w,T){x[w]+=S[w][T]-M[w][T]}},e.prototype._createAxis=function(t,i){var n=i.getData(),a=i.get("axisType"),o=YMe(i,a);o.getTicks=function(){return n.mapArray(["value"],function(u){return{value:u}})};var s=n.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new TK("value",o,t.axisExtent,a);return l.model=i,l},e.prototype._createGroup=function(t){var i=this[t]=new Ze;return this.group.add(i),i},e.prototype._renderAxisLine=function(t,i,n,a){var o=n.getExtent();if(a.get(["lineStyle","show"])){var s=new Kr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:fe({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});i.add(s);var l=this._progressLine=new Kr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ye({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});i.add(l)}},e.prototype._renderAxisTick=function(t,i,n,a){var o=this,s=a.getData(),l=n.scale.getTicks();this._tickSymbols=[],N(l,function(u){var c=n.dataToCoord(u.value),f=s.getItemModel(u.value),h=f.getModel("itemStyle"),p=f.getModel(["emphasis","itemStyle"]),d=f.getModel(["progress","itemStyle"]),g={x:c,y:0,onclick:Be(o._changeTimeline,o,u.value)},m=AK(f,h,i,g);m.ensureState("emphasis").style=p.getItemStyle(),m.ensureState("progress").style=d.getItemStyle(),Ol(m);var v=rt(m);f.get("tooltip")?(v.dataIndex=u.value,v.dataModel=a):v.dataIndex=v.dataModel=null,o._tickSymbols.push(m)})},e.prototype._renderAxisLabel=function(t,i,n,a){var o=this,s=n.getLabelModel();if(s.get("show")){var l=a.getData(),u=n.getViewLabels();this._tickLabels=[],N(u,function(c){var f=c.tickValue,h=l.getItemModel(f),p=h.getModel("label"),d=h.getModel(["emphasis","label"]),g=h.getModel(["progress","label"]),m=n.dataToCoord(c.tickValue),v=new Lt({x:m,y:0,rotation:t.labelRotation-t.rotation,onclick:Be(o._changeTimeline,o,f),silent:!1,style:fr(p,{text:c.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});v.ensureState("emphasis").style=fr(d),v.ensureState("progress").style=fr(g),i.add(v),Ol(v),EK(v).dataIndex=f,o._tickLabels.push(v)})}},e.prototype._renderControl=function(t,i,n,a){var o=t.controlSize,s=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),f=a.get("inverse",!0);h(t.nextBtnPosition,"next",Be(this._changeTimeline,this,f?"-":"+")),h(t.prevBtnPosition,"prev",Be(this._changeTimeline,this,f?"+":"-")),h(t.playPosition,c?"stop":"play",Be(this._handlePlayClick,this,!c),!0);function h(p,d,g,m){if(p){var v=xn(ft(a.get(["controlStyle",d+"BtnSize"]),o),o),_=[0,-v/2,v,v],y=ZMe(a,d+"Icon",_,{x:p[0],y:p[1],originX:o/2,originY:0,rotation:m?-s:0,rectHover:!0,style:l,onclick:g});y.ensureState("emphasis").style=u,i.add(y),Ol(y)}}},e.prototype._renderCurrentPointer=function(t,i,n,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(f){f.draggable=!0,f.drift=Be(u._handlePointerDrag,u),f.ondragend=Be(u._handlePointerDragend,u),CK(f,u._progressLine,s,n,a,!0)},onUpdate:function(f){CK(f,u._progressLine,s,n,a)}};this._currentPointer=AK(l,l,this._mainGroup,{},this._currentPointer,c)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,i,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,i){var n=this._toAxisCoord(t)[0],a=this._axis,o=Ti(a.getExtent().slice());n>o[1]&&(n=o[1]),n=0&&(o[a]=+o[a].toFixed(h)),[o,f]}var IO={min:ot(hE,"min"),max:ot(hE,"max"),average:ot(hE,"average"),median:ot(hE,"median")};function th(r,e){if(e){var t=r.getData(),i=r.coordinateSystem,n=i&&i.dimensions;if(!JMe(e)&&!pe(e.coord)&&pe(n)){var a=UO(e,t,i,r);if(e=Qe(e),e.type&&IO[e.type]&&a.baseAxis&&a.valueAxis){var o=dt(n,a.baseAxis.dim),s=dt(n,a.valueAxis.dim),l=IO[e.type](t,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!pe(n))e.coord=[];else for(var u=e.coord,c=0;c<2;c++)IO[u[c]]&&(u[c]=dE(t,t.mapDimension(n[c]),u[c]));return e}}function UO(r,e,t,i){var n={};return r.valueIndex!=null||r.valueDim!=null?(n.valueDataDim=r.valueIndex!=null?e.getDimension(r.valueIndex):r.valueDim,n.valueAxis=t.getAxis($Me(i,n.valueDataDim)),n.baseAxis=t.getOtherAxis(n.valueAxis),n.baseDataDim=e.mapDimension(n.baseAxis.dim)):(n.baseAxis=i.getBaseAxis(),n.valueAxis=t.getOtherAxis(n.baseAxis),n.baseDataDim=e.mapDimension(n.baseAxis.dim),n.valueDataDim=e.mapDimension(n.valueAxis.dim)),n}function $Me(r,e){var t=r.getData().getDimensionInfo(e);return t&&t.coordDim}function rh(r,e){return r&&r.containData&&e.coord&&!NO(e)?r.containData(e.coord):!0}function NK(r,e,t){return r&&r.containZone&&e.coord&&t.coord&&!NO(e)&&!NO(t)?r.containZone(e.coord,t.coord):!0}function pE(r,e){return r?function(t,i,n,a){var o=a<2?t.coord&&t.coord[a]:t.value;return ns(o,e[a])}:function(t,i,n,a){return ns(t.value,e[a])}}function dE(r,e,t){if(t==="average"){var i=0,n=0;return r.each(e,function(a,o){isNaN(a)||(i+=a,n++)}),i/n}else return t==="median"?r.getMedian(e):r.getDataExtent(e)[t==="max"?1:0]}var FO=vt(),QMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=ke()},e.prototype.render=function(t,i,n){var a=this,o=this.markerGroupMap;o.each(function(s){FO(s).keep=!1}),i.eachSeries(function(s){var l=da.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,i,n)}),o.each(function(s){!FO(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(t){FO(t).keep=!0},e.prototype.toggleBlurSeries=function(t,i){var n=this;N(t,function(a){var o=da.getMarkerModelFromSeries(a,n.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(i?Qb(l):d_(l))})}})},e.type="marker",e}(Qt),eg=QMe;function UK(r,e,t){var i=e.coordinateSystem;r.each(function(n){var a=r.getItemModel(n),o,s=Fe(a.get("x"),t.getWidth()),l=Fe(a.get("y"),t.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(r.getValues(r.dimensions,n));else if(i){var u=r.get(i.dimensions[0],n),c=r.get(i.dimensions[1],n);o=i.dataToPoint([u,c])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),r.setItemLayout(n,o)})}var ebe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=da.getMarkerModelFromSeries(a,"markPoint");o&&(UK(o.getData(),a,n),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Yl),f=tbe(o,t,i);i.setData(f),UK(i.getData(),t,a),f.each(function(h){var p=f.getItemModel(h),d=p.getShallow("symbol"),g=p.getShallow("symbolSize"),m=p.getShallow("symbolRotate"),v=p.getShallow("symbolOffset"),_=p.getShallow("symbolKeepAspect");if(He(d)||He(g)||He(m)||He(v)){var y=i.getRawValue(h),x=i.getDataParams(h);He(d)&&(d=d(y,x)),He(g)&&(g=g(y,x)),He(m)&&(m=m(y,x)),He(v)&&(v=v(y,x))}var M=p.getModel("itemStyle").getItemStyle(),S=kl(l,"color");M.fill||(M.fill=S),f.setItemVisual(h,{symbol:d,symbolSize:g,symbolRotate:m,symbolOffset:v,symbolKeepAspect:_,style:M})}),c.updateData(f),this.group.add(c.group),f.eachItemGraphicEl(function(h){h.traverse(function(p){rt(p).dataModel=i})}),this.markKeep(c),c.group.silent=i.get("silent")||t.get("silent")},e.type="markPoint",e}(eg);function tbe(r,e,t){var i;r?i=de(r&&r.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return fe(fe({},l),{name:s,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var n=new ti(i,t),a=de(t.get("data"),ot(th,e));r&&(a=Wt(a,ot(rh,r)));var o=pE(!!r,i);return n.initData(a,null,o),n}var OK=ebe;function zO(r){r.registerComponentModel(IK),r.registerComponentView(OK),r.registerPreprocessor(function(e){pd(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var rbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(da),FK=rbe;var mE=vt(),ibe=function(r,e,t,i){var n=r.getData(),a;if(pe(i))a=i;else{var o=i.type;if(o==="min"||o==="max"||o==="average"||o==="median"||i.xAxis!=null||i.yAxis!=null){var s=void 0,l=void 0;if(i.yAxis!=null||i.xAxis!=null)s=e.getAxis(i.yAxis!=null?"y":"x"),l=Br(i.yAxis,i.xAxis);else{var u=UO(i,n,e,r);s=u.valueAxis;var c=y1(n,u.valueDataDim);l=dE(n,c,o)}var f=s.dim==="x"?0:1,h=1-f,p=Qe(i),d={coord:[]};p.type=null,p.coord=[],p.coord[h]=-1/0,d.coord[h]=1/0;var g=t.get("precision");g>=0&&At(l)&&(l=+l.toFixed(Math.min(g,20))),p.coord[f]=d.coord[f]=l,a=[p,d,{type:o,valueIndex:i.valueIndex,value:l}]}else a=[]}var m=[th(r,a[0]),th(r,a[1]),fe({},a[2])];return m[2].type=m[2].type||null,_t(m[2],m[0]),_t(m[2],m[1]),m};function vE(r){return!isNaN(r)&&!isFinite(r)}function zK(r,e,t,i){var n=1-r,a=i.dimensions[r];return vE(e[n])&&vE(t[n])&&e[r]===t[r]&&i.getAxis(a).containData(e[r])}function nbe(r,e){if(r.type==="cartesian2d"){var t=e[0].coord,i=e[1].coord;if(t&&i&&(zK(1,t,i,r)||zK(0,t,i,r)))return!0}return rh(r,e[0])&&rh(r,e[1])}function BO(r,e,t,i,n){var a=i.coordinateSystem,o=r.getItemModel(e),s,l=Fe(o.get("x"),n.getWidth()),u=Fe(o.get("y"),n.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition)s=i.getMarkerPosition(r.getValues(r.dimensions,e));else{var c=a.dimensions,f=r.get(c[0],e),h=r.get(c[1],e);s=a.dataToPoint([f,h])}if(ls(a,"cartesian2d")){var p=a.getAxis("x"),d=a.getAxis("y"),c=a.dimensions;vE(r.get(c[0],e))?s[0]=p.toGlobalCoord(p.getExtent()[t?0:1]):vE(r.get(c[1],e))&&(s[1]=d.toGlobalCoord(d.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}r.setItemLayout(e,s)}var abe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=da.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=mE(o).from,u=mE(o).to;l.each(function(c){BO(l,c,!0,a,n),BO(u,c,!1,a,n)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Fv);this.group.add(c.group);var f=obe(o,t,i),h=f.from,p=f.to,d=f.line;mE(i).from=h,mE(i).to=p,i.setData(d);var g=i.get("symbol"),m=i.get("symbolSize"),v=i.get("symbolRotate"),_=i.get("symbolOffset");pe(g)||(g=[g,g]),pe(m)||(m=[m,m]),pe(v)||(v=[v,v]),pe(_)||(_=[_,_]),f.from.each(function(x){y(h,x,!0),y(p,x,!1)}),d.each(function(x){var M=d.getItemModel(x).getModel("lineStyle").getLineStyle();d.setItemLayout(x,[h.getItemLayout(x),p.getItemLayout(x)]),M.stroke==null&&(M.stroke=h.getItemVisual(x,"style").fill),d.setItemVisual(x,{fromSymbolKeepAspect:h.getItemVisual(x,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(x,"symbolOffset"),fromSymbolRotate:h.getItemVisual(x,"symbolRotate"),fromSymbolSize:h.getItemVisual(x,"symbolSize"),fromSymbol:h.getItemVisual(x,"symbol"),toSymbolKeepAspect:p.getItemVisual(x,"symbolKeepAspect"),toSymbolOffset:p.getItemVisual(x,"symbolOffset"),toSymbolRotate:p.getItemVisual(x,"symbolRotate"),toSymbolSize:p.getItemVisual(x,"symbolSize"),toSymbol:p.getItemVisual(x,"symbol"),style:M})}),c.updateData(d),f.line.eachItemGraphicEl(function(x){rt(x).dataModel=i,x.traverse(function(M){rt(M).dataModel=i})});function y(x,M,S){var w=x.getItemModel(M);BO(x,M,S,t,a);var T=w.getModel("itemStyle").getItemStyle();T.fill==null&&(T.fill=kl(l,"color")),x.setItemVisual(M,{symbolKeepAspect:w.get("symbolKeepAspect"),symbolOffset:ft(w.get("symbolOffset",!0),_[S?0:1]),symbolRotate:ft(w.get("symbolRotate",!0),v[S?0:1]),symbolSize:ft(w.get("symbolSize"),m[S?0:1]),symbol:ft(w.get("symbol",!0),g[S?0:1]),style:T})}this.markKeep(c),c.group.silent=i.get("silent")||t.get("silent")},e.type="markLine",e}(eg);function obe(r,e,t){var i;r?i=de(r&&r.dimensions,function(u){var c=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return fe(fe({},c),{name:u,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var n=new ti(i,t),a=new ti(i,t),o=new ti([],t),s=de(t.get("data"),ot(ibe,e,r,t));r&&(s=Wt(s,ot(nbe,r)));var l=pE(!!r,i);return n.initData(de(s,function(u){return u[0]}),null,l),a.initData(de(s,function(u){return u[1]}),null,l),o.initData(de(s,function(u){return u[2]})),o.hasItemOption=!0,{from:n,to:a,line:o}}var BK=abe;function kO(r){r.registerComponentModel(FK),r.registerComponentView(BK),r.registerPreprocessor(function(e){pd(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var sbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(da),kK=sbe;var gE=vt(),lbe=function(r,e,t,i){var n=i[0],a=i[1];if(!(!n||!a)){var o=th(r,n),s=th(r,a),l=o.coord,u=s.coord;l[0]=Br(l[0],-1/0),l[1]=Br(l[1],-1/0),u[0]=Br(u[0],1/0),u[1]=Br(u[1],1/0);var c=Sm([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function yE(r){return!isNaN(r)&&!isFinite(r)}function VK(r,e,t,i){var n=1-r;return yE(e[n])&&yE(t[n])}function ube(r,e){var t=e.coord[0],i=e.coord[1],n={coord:t,x:e.x0,y:e.y0},a={coord:i,x:e.x1,y:e.y1};return ls(r,"cartesian2d")?t&&i&&(VK(1,t,i,r)||VK(0,t,i,r))?!0:NK(r,n,a):rh(r,n)||rh(r,a)}function GK(r,e,t,i,n){var a=i.coordinateSystem,o=r.getItemModel(e),s,l=Fe(o.get(t[0]),n.getWidth()),u=Fe(o.get(t[1]),n.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition){var c=r.getValues(["x0","y0"],e),f=r.getValues(["x1","y1"],e),h=a.clampData(c),p=a.clampData(f),d=[];t[0]==="x0"?d[0]=h[0]>p[0]?f[0]:c[0]:d[0]=h[0]>p[0]?c[0]:f[0],t[1]==="y0"?d[1]=h[1]>p[1]?f[1]:c[1]:d[1]=h[1]>p[1]?c[1]:f[1],s=i.getMarkerPosition(d,t,!0)}else{var g=r.get(t[0],e),m=r.get(t[1],e),v=[g,m];a.clampData&&a.clampData(v,v),s=a.dataToPoint(v,!0)}if(ls(a,"cartesian2d")){var _=a.getAxis("x"),y=a.getAxis("y"),g=r.get(t[0],e),m=r.get(t[1],e);yE(g)?s[0]=_.toGlobalCoord(_.getExtent()[t[0]==="x0"?0:1]):yE(m)&&(s[1]=y.toGlobalCoord(y.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var HK=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],cbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=da.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=de(HK,function(f){return GK(s,l,f,a,n)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Ze});this.group.add(c.group),this.markKeep(c);var f=fbe(o,t,i);i.setData(f),f.each(function(h){var p=de(HK,function(T){return GK(f,h,T,t,a)}),d=o.getAxis("x").scale,g=o.getAxis("y").scale,m=d.getExtent(),v=g.getExtent(),_=[d.parse(f.get("x0",h)),d.parse(f.get("x1",h))],y=[g.parse(f.get("y0",h)),g.parse(f.get("y1",h))];Ti(_),Ti(y);var x=!(m[0]>_[1]||m[1]<_[0]||v[0]>y[1]||v[1]=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Pt),Wx=pbe;var tg=ot,GO=N,_E=Ze,dbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new _E),this.group.add(this._selectorGroup=new _E),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var o=t.get("align"),s=t.get("orient");(!o||o==="auto")&&(o=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,t,i,n,l,s,u);var c=t.getBoxLayoutParams(),f={width:n.getWidth(),height:n.getHeight()},h=t.get("padding"),p=xr(c,f,h),d=this.layoutInner(t,o,p,a,l,u),g=xr(Ye({width:d.width,height:d.height},c),f,h);this.group.x=g.x-d.x,this.group.y=g.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=nE(d,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,i,n,a,o,s,l){var u=this.getContentGroup(),c=ke(),f=i.get("selectedMode"),h=[];n.eachRawSeries(function(p){!p.get("legendHoverLink")&&h.push(p.id)}),GO(i.getData(),function(p,d){var g=p.get("name");if(!this.newlineDisabled&&(g===""||g===` -`)){var m=new _E;m.newline=!0,u.add(m);return}var v=n.getSeriesByName(g)[0];if(!c.get(g))if(v){var _=v.getData(),y=_.getVisual("legendLineStyle")||{},x=_.getVisual("legendIcon"),M=_.getVisual("style"),S=this._createItem(v,g,d,p,i,t,y,M,x,f,a);S.on("click",tg(XK,g,null,a,h)).on("mouseover",tg(HO,v.name,null,a,h)).on("mouseout",tg(WO,v.name,null,a,h)),n.ssr&&S.eachChild(function(w){var T=rt(w);T.seriesIndex=v.seriesIndex,T.dataIndex=d,T.ssrType="legend"}),c.set(g,!0)}else n.eachRawSeries(function(w){if(!c.get(g)&&w.legendVisualProvider){var T=w.legendVisualProvider;if(!T.containName(g))return;var C=T.indexOfName(g),b=T.getItemVisual(C,"style"),E=T.getItemVisual(C,"legendIcon"),I=cn(b.fill);I&&I[3]===0&&(I[3]=.2,b=fe(fe({},b),{fill:Ko(I,"rgba")}));var R=this._createItem(w,g,d,p,i,t,{},b,E,f,a);R.on("click",tg(XK,null,g,a,h)).on("mouseover",tg(HO,null,g,a,h)).on("mouseout",tg(WO,null,g,a,h)),n.ssr&&R.eachChild(function(A){var D=rt(A);D.seriesIndex=w.seriesIndex,D.dataIndex=d,D.ssrType="legend"}),c.set(g,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},e.prototype._createSelector=function(t,i,n,a,o){var s=this.getSelectorGroup();GO(t,function(u){var c=u.type,f=new Lt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(f);var h=i.getModel("selectorLabel"),p=i.getModel(["emphasis","selectorLabel"]);Nr(f,{normal:h,emphasis:p},{defaultText:u.title}),Ol(f)})},e.prototype._createItem=function(t,i,n,a,o,s,l,u,c,f,h){var p=t.visualDrawType,d=o.get("itemWidth"),g=o.get("itemHeight"),m=o.isSelected(i),v=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),y=a.get("icon");c=y||c||"roundRect";var x=mbe(c,a,l,u,p,m,h),M=new _E,S=a.getModel("textStyle");if(He(t.getLegendIcon)&&(!y||y==="inherit"))M.add(t.getLegendIcon({itemWidth:d,itemHeight:g,icon:c,iconRotate:v,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}));else{var w=y==="inherit"&&t.getData().getVisual("symbol")?v==="inherit"?t.getData().getVisual("symbolRotate"):v:0;M.add(vbe({itemWidth:d,itemHeight:g,icon:c,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}))}var T=s==="left"?d+5:-5,C=s,b=o.get("formatter"),E=i;Ce(b)&&b?E=b.replace("{name}",i??""):He(b)&&(E=b(i));var I=m?S.getTextColor():a.get("inactiveColor");M.add(new Lt({style:fr(S,{text:E,x:T,y:g/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var R=new Tt({shape:M.getBoundingRect(),style:{fill:"transparent"}}),A=a.getModel("tooltip");return A.get("show")&&Vs({el:R,componentModel:o,itemName:i,itemTooltipOption:A.option}),M.add(R),M.eachChild(function(D){D.silent=!0}),R.silent=!f,this.getContentGroup().add(M),Ol(M),M.__legendDataIndex=n,M},e.prototype.layoutInner=function(t,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Ws(t.get("orient"),l,t.get("itemGap"),n.width,n.height);var c=l.getBoundingRect(),f=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){Ws("horizontal",u,t.get("selectorItemGap",!0));var h=u.getBoundingRect(),p=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),g=t.getOrient().index,m=g===0?"width":"height",v=g===0?"height":"width",_=g===0?"y":"x";s==="end"?p[g]+=c[m]+d:f[g]+=h[m]+d,p[1-g]+=c[v]/2-h[v]/2,u.x=p[0],u.y=p[1],l.x=f[0],l.y=f[1];var y={x:0,y:0};return y[m]=c[m]+d+h[m],y[v]=Math.max(c[v],h[v]),y[_]=Math.min(0,h[_]+p[1-g]),y}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Qt);function mbe(r,e,t,i,n,a,o){function s(m,v){m.lineWidth==="auto"&&(m.lineWidth=v.lineWidth>0?2:0),GO(m,function(_,y){m[y]==="inherit"&&(m[y]=v[y])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=r.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?i.decal:Zs(f,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[c]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:t).opacity),s(u,i);var h=e.getModel("lineStyle"),p=h.getLineStyle();if(s(p,t),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),p.stroke==="auto"&&(p.stroke=i.fill),!a){var d=e.get("inactiveBorderWidth"),g=u[c];u.lineWidth=d==="auto"?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=h.get("inactiveColor"),p.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}function vbe(r){var e=r.icon||"roundRect",t=Sr(e,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return t.setStyle(r.itemStyle),t.rotation=(r.iconRotate||0)*Math.PI/180,t.setOrigin([r.itemWidth/2,r.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function XK(r,e,t,i){WO(r,e,t,i),t.dispatchAction({type:"legendToggleSelect",name:r??e}),HO(r,e,t,i)}function YK(r){for(var e=r.getZr().storage.getDisplayList(),t,i=0,n=e.length;in[o],m=[-p.x,-p.y];i||(m[a]=c[u]);var v=[0,0],_=[-d.x,-d.y],y=ft(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(g){var x=t.get("pageButtonPosition",!0);x==="end"?_[a]+=n[o]-d[o]:v[a]+=d[o]+y}_[1-a]+=p[s]/2-d[s]/2,c.setPosition(m),f.setPosition(v),h.setPosition(_);var M={x:0,y:0};if(M[o]=g?n[o]:p[o],M[s]=Math.max(p[s],d[s]),M[l]=Math.min(0,d[l]+_[1-a]),f.__rectSize=n[o],g){var S={x:0,y:0};S[o]=Math.max(n[o]-d[o]-y,0),S[s]=M[s],f.setClipPath(new Tt({shape:S})),f.__rectSize=S[o]}else h.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(t);return w.pageIndex!=null&&Dt(c,{x:w.contentPosition[0],y:w.contentPosition[1]},g?t:null),this._updatePageInfoView(t,w),M},e.prototype._pageGo=function(t,i,n){var a=this._getPageInfo(i)[t];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},e.prototype._updatePageInfoView=function(t,i){var n=this._controllerGroup;N(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",h=i[f]!=null,p=n.childOfName(c);p&&(p.setStyle("fill",h?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),p.cursor=h?"pointer":"default")});var a=n.childOfName("pageText"),o=t.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",Ce(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var i=t.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=t.getOrient().index,s=YO[o],l=qO[o],u=this._findTargetItemIndex(i),c=n.children(),f=c[u],h=c.length,p=h?1:0,d={contentPosition:[n.x,n.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return d;var g=x(f);d.contentPosition[o]=-g.s;for(var m=u+1,v=g,_=g,y=null;m<=h;++m)y=x(c[m]),(!y&&_.e>v.s+a||y&&!M(y,v.s))&&(_.i>v.i?v=_:v=y,v&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=v.i),++d.pageCount)),_=y;for(var m=u-1,v=g,_=g,y=null;m>=-1;--m)y=x(c[m]),(!y||!M(_,y.s))&&v.i<_.i&&(_=v,d.pagePrevDataIndex==null&&(d.pagePrevDataIndex=v.i),++d.pageCount,++d.pageIndex),v=y;return d;function x(S){if(S){var w=S.getBoundingRect(),T=w[l]+S[l];return{s:T,e:T+w[s],i:S.__legendDataIndex}}}function M(S,w){return S.e>=w&&S.s<=w+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===t&&(i=s)}),i??a},e.type="legend.scroll",e}(xE),JK=ybe;function ZO(r){r.registerAction("legendScroll","legendscroll",function(e,t){var i=e.scrollDataIndex;i!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(n){n.setScrollDataIndex(i)})})}function $K(r){It(SE),r.registerComponentModel(jK),r.registerComponentView(JK),ZO(r)}function jO(r){It(SE),It($K)}var _be=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=Hn($f.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}($f),QK=_be;var KO=vt();function eJ(r,e,t){KO(r).coordSysRecordMap.each(function(i){var n=i.dataZoomInfoMap.get(e.uid);n&&(n.getRange=t)})}function tJ(r,e){for(var t=KO(r).coordSysRecordMap,i=t.keys(),n=0;ni[t+e]&&(e=s),n=n&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}function iJ(r){r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,function(e,t){var i=KO(t),n=i.coordSysRecordMap||(i.coordSysRecordMap=ke());n.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=rE(a);N(o.infoList,function(s){var l=s.model.uid,u=n.get(l)||n.set(l,xbe(t,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=ke());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),n.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){rJ(n,a);return}var c=bbe(l);o.enable(c.controlType,c.opt),o.setPointerChecker(a.containsPoint),as(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Tbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,i,n){if(r.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),eJ(n,t,{pan:Be(JO.pan,this),zoom:Be(JO.zoom,this),scrollMove:Be(JO.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){tJ(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Jv),JO={zoom:function(r,e,t,i){var n=this.range,a=n.slice(),o=r.axisModels[0];if(o){var s=$O[e](null,[i.originX,i.originY],o,t,r),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Xa(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,n[0]!==a[0]||n[1]!==a[1])return a}},pan:nJ(function(r,e,t,i,n,a){var o=$O[i]([a.oldX,a.oldY],[a.newX,a.newY],e,n,t);return o.signal*(r[1]-r[0])*o.pixel/o.pixelLength}),scrollMove:nJ(function(r,e,t,i,n,a){var o=$O[i]([0,0],[a.scrollDelta,a.scrollDelta],e,n,t);return o.signal*(r[1]-r[0])*a.scrollDelta})};function nJ(r){return function(e,t,i,n){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=r(o,s,e,t,i,n);if(Xa(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var $O={grid:function(r,e,t,i,n){var a=t.axis,o={},s=n.model.coordinateSystem.getRect();return r=r||[0,0],a.dim==="x"?(o.pixel=e[0]-r[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(r,e,t,i,n){var a=t.axis,o={},s=n.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return r=r?s.pointToCoord(r):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-r[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(r,e,t,i,n){var a=t.axis,o=n.model.coordinateSystem.getRect(),s={};return r=r||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-r[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-r[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},aJ=Tbe;function Yx(r){fd(r),r.registerComponentModel(QK),r.registerComponentView(aJ),iJ(r)}var Ebe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=Hn($f.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}($f),oJ=Ebe;var qx=Tt,sJ=7,Abe=1,QO=30,Cbe=7,Zx="horizontal",lJ="vertical",Rbe=5,Lbe=["line","bar","candlestick","scatter"],Pbe={easing:"cubicOut",duration:100,delay:0},Dbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,i){this.api=i,this._onBrush=Be(this._onBrush,this),this._onBrushEnd=Be(this._onBrushEnd,this)},e.prototype.render=function(t,i,n,a){if(r.prototype.render.apply(this,arguments),as(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){zu(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var i=this._displayables.sliderGroup=new Ze;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(i),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,i=this.api,n=t.get("brushSelect"),a=n?Cbe:0,o=this._findCoordRect(),s={width:i.getWidth(),height:i.getHeight()},l=this._orient===Zx?{right:s.width-o.x-o.width,top:s.height-QO-sJ-a,width:o.width,height:QO}:{right:sJ,top:o.y,width:QO,height:o.height},u=rs(t.option);N(["right","top","width","height"],function(f){u[f]==="ph"&&(u[f]=l[f])});var c=xr(u,s);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===lJ&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,i=this._location,n=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(n===Zx&&!o?{scaleY:l?1:-1,scaleX:1}:n===Zx&&o?{scaleY:l?1:-1,scaleX:-1}:n===lJ&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=i.x-u.x,t.y=i.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,i=this._size,n=this._displayables.sliderGroup,a=t.get("brushSelect");n.add(new qx({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new qx({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:Be(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),n.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var i=this._size,n=this._shadowSize||[],a=t.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||i[0]!==n[0]||i[1]!==n[1]){var f=o.getDataExtent(l),h=(f[1]-f[0])*.3;f=[f[0]-h,f[1]+h];var p=[0,i[1]],d=[0,i[0]],g=[[i[0],0],[0,0]],m=[],v=d[1]/(o.count()-1),_=0,y=Math.round(o.count()/i[0]),x;o.each([l],function(C,b){if(y>0&&b%y){_+=v;return}var E=C==null||isNaN(C)||C==="",I=E?0:rr(C,f,p,!0);E&&!x&&b?(g.push([g[g.length-1][0],0]),m.push([m[m.length-1][0],0])):!E&&x&&(g.push([_,0]),m.push([_,0])),g.push([_,I]),m.push([_,I]),_+=v,x=E}),u=this._shadowPolygonPts=g,c=this._shadowPolylinePts=m}this._shadowData=o,this._shadowDim=l,this._shadowSize=[i[0],i[1]];var M=this.dataZoomModel;function S(C){var b=M.getModel(C?"selectedDataBackground":"dataBackground"),E=new Ze,I=new ei({shape:{points:u},segmentIgnoreThreshold:1,style:b.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),R=new $r({shape:{points:c},segmentIgnoreThreshold:1,style:b.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return E.add(I),E.add(R),E}for(var w=0;w<3;w++){var T=S(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,i=t.get("showDataShadow");if(i!==!1){var n,a=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();N(l,function(u){if(!n&&!(i!==!0&&dt(Lbe,u.get("type"))<0)){var c=a.getComponent(ds(o),s).axis,f=Ibe(o),h,p=u.coordinateSystem;f!=null&&p.getOtherAxis&&(h=p.getOtherAxis(c).inverse),f=u.getData().mapDimension(f),n={thisAxis:c,series:u,thisDim:o,otherDim:f,otherAxisInverse:h}}},this)},this),n}},e.prototype._renderHandle=function(){var t=this.group,i=this._displayables,n=i.handles=[null,null],a=i.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,f=l.get("brushSelect"),h=i.filler=new qx({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new qx({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:Abe,fill:"rgba(0,0,0,0)"}})),N([0,1],function(y){var x=l.get("handleIcon");!W_[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var M=Sr(x,-1,0,2,2,null,!0);M.attr({cursor:uJ(this._orient),draggable:!0,drift:Be(this._onDragMove,this,y),ondragend:Be(this._onDragEnd,this),onmouseover:Be(this._showDataInfo,this,!0),onmouseout:Be(this._showDataInfo,this,!1),z2:5});var S=M.getBoundingRect(),w=l.get("handleSize");this._handleHeight=Fe(w,this._size[1]),this._handleWidth=S.width/S.height*this._handleHeight,M.setStyle(l.getModel("handleStyle").getItemStyle()),M.style.strokeNoScale=!0,M.rectHover=!0,M.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Ol(M);var T=l.get("handleColor");T!=null&&(M.style.fill=T),o.add(n[y]=M);var C=l.getModel("textStyle");t.add(a[y]=new Lt({silent:!0,invisible:!0,style:fr(C,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:C.getTextColor(),font:C.getFont()}),z2:10}))},this);var p=h;if(f){var d=Fe(l.get("moveHandleSize"),s[1]),g=i.moveHandle=new Tt({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:d}}),m=d*.8,v=i.moveHandleIcon=Sr(l.get("moveHandleIcon"),-m/2,-m/2,m,m,"#fff",!0);v.silent=!0,v.y=s[1]+d/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(d,10));p=i.moveZone=new Tt({invisible:!0,shape:{y:s[1]-_,height:d+_}}),p.on("mouseover",function(){u.enterEmphasis(g)}).on("mouseout",function(){u.leaveEmphasis(g)}),o.add(g),o.add(v),o.add(p)}p.attr({draggable:!0,cursor:uJ(this._orient),drift:Be(this._onDragMove,this,"all"),ondragstart:Be(this._showDataInfo,this,!0),ondragend:Be(this._onDragEnd,this),onmouseover:Be(this._showDataInfo,this,!0),onmouseout:Be(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[rr(t[0],[0,100],i,!0),rr(t[1],[0,100],i,!0)]},e.prototype._updateInterval=function(t,i){var n=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=n.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Xa(i,a,o,n.get("zoomLock")?"all":t,s.minSpan!=null?rr(s.minSpan,l,o,!0):null,s.maxSpan!=null?rr(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Ti([rr(a[0],o,l,!0),rr(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},e.prototype._updateView=function(t){var i=this._displayables,n=this._handleEnds,a=Ti(n.slice()),o=this._size;N([0,1],function(p){var d=i.handles[p],g=this._handleHeight;d.attr({scaleX:g/2,scaleY:g/2,x:n[p]+(p?-1:1),y:o[1]/2-g/2})},this),i.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};i.moveHandle&&(i.moveHandle.setShape(s),i.moveZone.setShape(s),i.moveZone.getBoundingRect(),i.moveHandleIcon&&i.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=i.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;ci[0]||n[1]<0||n[1]>i[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",n[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var i=t.offsetX,n=t.offsetY;this._brushStart=new Nt(i,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var i=this._displayables.brushRect;if(this._brushing=!1,!!i){i.attr("ignore",!0);var n=i.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(n.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Ti([rr(n.x,o,s,!0),rr(n.x+n.width,o,s,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(Ea(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,i){var n=this._displayables,a=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new qx({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,i),c=l.transformCoordToLocal(s.x,s.y),f=this._size;u[0]=Math.max(Math.min(f[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:f[1]})},e.prototype._dispatchZoomAction=function(t){var i=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?Pbe:null,start:i[0],end:i[1]})},e.prototype._findCoordRect=function(){var t,i=rE(this.dataZoomModel).infoList;if(!t&&i.length){var n=i[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var a=this.api.getWidth(),o=this.api.getHeight();t={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(Jv);function Ibe(r){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[r]}function uJ(r){return r==="vertical"?"ns-resize":"ew-resize"}var cJ=Dbe;function jx(r){r.registerComponentModel(oJ),r.registerComponentView(cJ),fd(r)}function e3(r){It(Yx),It(jx)}var Nbe={get:function(r,e,t){var i=Qe((Ube[r]||{})[e]);return t&&pe(i)?i[i.length-1]:i}},Ube={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},ME=Nbe;var fJ=pi.mapVisual,Obe=pi.eachVisual,Fbe=pe,hJ=N,zbe=Ti,Bbe=rr,kbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n)},e.prototype.optionUpdated=function(t,i){var n=this.option;!i&&lE(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var i=this.stateList;t=Be(t,this),this.controllerVisuals=Gx(this.option.controller,i,t),this.targetVisuals=Gx(this.option.target,i,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,i=[];return t==null||t==="all"?this.ecModel.eachSeries(function(n,a){i.push(a)}):i=Jt(t),i},e.prototype.eachTargetSeries=function(t,i){N(this.getTargetSeriesIndices(),function(n){var a=this.ecModel.getSeriesByIndex(n);a&&t.call(i,a)},this)},e.prototype.isTargetSeries=function(t){var i=!1;return this.eachTargetSeries(function(n){n===t&&(i=!0)}),i},e.prototype.formatValueText=function(t,i,n){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;n=n||["<",">"],pe(t)&&(t=t.slice(),u=!0);var c=i?t:u?[f(t[0]),f(t[1])]:f(t);if(Ce(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(He(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?n[0]+" "+c[1]:t[1]===s[1]?n[1]+" "+c[0]:c[0]+" - "+c[1];return c;function f(h){return h===s[0]?"min":h===s[1]?"max":(+h).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,i=zbe([t.min,t.max]);this._dataExtent=i},e.prototype.getDataDimensionIndex=function(t){var i=this.option.dimension;if(i!=null)return t.getDimensionIndex(i);for(var n=t.dimensions,a=n.length-1;a>=0;a--){var o=n[a],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,i=this.option,n={inRange:i.inRange,outOfRange:i.outOfRange},a=i.target||(i.target={}),o=i.controller||(i.controller={});_t(a,n),_t(o,n);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(f){Fbe(i.color)&&!f.inRange&&(f.inRange={color:i.color.slice().reverse()}),f.inRange=f.inRange||{color:t.get("gradientColor")}}function u(f,h,p){var d=f[h],g=f[p];d&&!g&&(g=f[p]={},hJ(d,function(m,v){if(pi.isValidType(v)){var _=ME.get(v,"inactive",s);_!=null&&(g[v]=_,v==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function c(f){var h=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,p=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,d=this.get("inactiveColor"),g=this.getItemSymbol(),m=g||"roundRect";hJ(this.stateList,function(v){var _=this.itemSize,y=f[v];y||(y=f[v]={color:s?d:[d]}),y.symbol==null&&(y.symbol=h&&Qe(h)||(s?m:[m])),y.symbolSize==null&&(y.symbolSize=p&&Qe(p)||(s?_[0]:[_[0],_[0]])),y.symbol=fJ(y.symbol,function(S){return S==="none"?m:S});var x=y.symbolSize;if(x!=null){var M=-1/0;Obe(x,function(S){S>M&&(M=S)}),y.symbolSize=fJ(x,function(S){return Bbe(S,[0,M],[0,_[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Pt),rg=kbe;var pJ=[20,140],Vbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(n){n.mappingMethod="linear",n.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=pJ[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=pJ[1])},e.prototype._resetRange=function(){var t=this.getExtent(),i=this.option.range;!i||i.auto?(t.auto=1,this.option.range=t):pe(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],t[0]),i[1]=Math.min(i[1],t[1]))},e.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),N(this.stateList,function(t){var i=this.option.controller[t].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),i=Ti((this.get("range")||[]).slice());return i[0]>t[1]&&(i[0]=t[1]),i[1]>t[1]&&(i[1]=t[1]),i[0]=n[1]||t<=i[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var i=[];return this.eachTargetSeries(function(n){var a=[],o=n.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&a.push(l)},this),i.push({seriesId:n.id,dataIndex:a})},this),i},e.prototype.getVisualMeta=function(t){var i=dJ(this,"outOfRange",this.getExtent()),n=dJ(this,"inRange",this.option.range.slice()),a=[];function o(p,d){a.push({value:p,color:t(p,d)})}for(var s=0,l=0,u=n.length,c=i.length;lt[1])break;a.push({color:this.getControllerVisual(l,"color",i),offset:s/n})}return a.push({color:this.getControllerVisual(t[1],"color",i),offset:1}),a},e.prototype._createBarPoints=function(t,i){var n=this.visualMapModel.itemSize;return[[n[0]-i[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-i[1],t[1]]]},e.prototype._createBarGroup=function(t){var i=this._orient,n=this.visualMapModel.get("inverse");return new Ze(i==="horizontal"&&!n?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&n?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!n?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,i){if(this._useHandle){var n=this._shapes,a=this.visualMapModel,o=n.handleThumbs,s=n.handleLabels,l=a.itemSize,u=a.getExtent();Hbe([0,1],function(c){var f=o[c];f.setStyle("fill",i.handlesColor[c]),f.y=t[c];var h=Ql(t[c],[0,l[1]],u,!0),p=this.getControllerVisual(h,"symbolSize");f.scaleX=f.scaleY=p/l[0],f.x=l[0]-p/2;var d=wn(n.handleLabelPoints[c],ks(f,this.group));s[c].setStyle({x:d[0],y:d[1],text:a.formatValueText(this._dataInterval[c]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",n.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,i,n,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,f=c.indicator;if(f){f.attr("invisible",!1);var h={convertOpacityToAlpha:!0},p=this.getControllerVisual(t,"color",h),d=this.getControllerVisual(t,"symbolSize"),g=Ql(t,s,u,!0),m=l[0]-d/2,v={x:f.x,y:f.y};f.y=g,f.x=m;var _=wn(c.indicatorLabelPoint,ks(f,this.group)),y=c.indicatorLabel;y.attr("invisible",!1);var x=this._applyTransform("left",c.mainGroup),M=this._orient,S=M==="horizontal";y.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:S?x:"middle",align:S?"center":x});var w={x:m,y:g,style:{fill:p}},T={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var C={duration:100,easing:"cubicInOut",additive:!0};f.x=v.x,f.y=v.y,f.animateTo(w,C),y.animateTo(T,C)}else f.attr(w),y.attr(T);this._firstShowIndicator=!1;var b=this._shapes.handleLabels;if(b)for(var E=0;Eo[1]&&(f[1]=1/0),i&&(f[0]===-1/0?this._showIndicator(c,f[1],"< ",l):f[1]===1/0?this._showIndicator(c,f[0],"> ",l):this._showIndicator(c,c,"\u2248 ",l));var h=this._hoverLinkDataIndices,p=[];(i||xJ(n))&&(p=this._hoverLinkDataIndices=n.findTargetDataIndices(f));var d=uH(h,p);this._dispatchHighDown("downplay",ig(d[0],n)),this._dispatchHighDown("highlight",ig(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var i;if(Ys(t.target,function(l){var u=rt(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var n=this.ecModel.getSeriesByIndex(i.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(n)){var o=n.getData(i.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var n=0;n=0&&(a.dimension=o,i.push(a))}}),r.getData().setVisual("visualMeta",i)}}];function Zbe(r,e,t,i){for(var n=e.targetVisuals[i],a=pi.prepareVisualTypes(n),o={color:kl(r.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),r.registerAction(bJ,wJ),N(TJ,function(e){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,e)}),r.registerPreprocessor(r3))}function Jx(r){r.registerComponentModel(mJ),r.registerComponentView(MJ),Kx(r)}var jbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],Kbe[this._mode].call(this,this._pieceList),this._resetSelected(t,i);var a=this.option.categories;this.resetVisual(function(o,s){n==="categories"?(o.mappingMethod="category",o.categories=Qe(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=de(this._pieceList,function(l){return l=Qe(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,i={},n=pi.listVisualTypes(),a=this.isCategory();N(t.pieces,function(s){N(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),N(i,function(s,l){var u=!1;N(this.stateList,function(c){u=u||o(t,c,l)||o(t.target,c,l)},this),!u&&N(this.stateList,function(c){(t[c]||(t[c]={}))[l]=ME.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,i){var n=this.option,a=this._pieceList,o=(i?n:t).selected||{};if(n.selected=o,N(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),n.selectedMode==="single"){var s=!1;N(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Qe(t)},e.prototype.getValueState=function(t){var i=pi.findPieceIndex(t,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var i=[],n=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=pi.findPieceIndex(l,n);c===t&&o.push(u)},this),i.push({seriesId:a.id,dataIndex:o})},this),i},e.prototype.getRepresentValue=function(t){var i;if(this.isCategory())i=t.value;else if(t.value!=null)i=t.value;else{var n=t.interval||[];i=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return i},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var i=[],n=["",""],a=this;function o(c,f){var h=a.getRepresentValue({interval:c});f||(f=a.getValueState(h));var p=t(h,f);c[0]===-1/0?n[0]=p:c[1]===1/0?n[1]=p:i.push({value:c[0],color:p},{value:c[1],color:p})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return N(s,function(c){var f=c.interval;f&&(f[0]>u&&o([u,f[0]],"outOfRange"),o(f.slice()),u=f[1])},this),{stops:i,outerColors:n}},e.type="visualMap.piecewise",e.defaultOption=Hn(rg.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(rg),Kbe={splitNumber:function(r){var e=this.option,t=Math.min(e.precision,20),i=this.getExtent(),n=e.splitNumber;n=Math.max(parseInt(n,10),1),e.splitNumber=n;for(var a=(i[1]-i[0])/n;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&r.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","\u2265"][i[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,n)},this)}};function CJ(r,e){var t=r.inverse;(r.orient==="vertical"?!t:t)&&e.reverse()}var RJ=jbe;var Jbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var i=this.visualMapModel,n=i.get("textGap"),a=i.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=i.itemSize,c=this._getViewData(),f=c.endsText,h=Br(i.get("showLabel",!0),!f);f&&this._renderEndsText(t,f[0],u,h,l),N(c.viewPieceList,function(p){var d=p.piece,g=new Ze;g.onclick=Be(this._onItemClick,this,d),this._enableHoverLink(g,p.indexInModelPieceList);var m=i.getRepresentValue(d);if(this._createItemSymbol(g,m,[0,0,u[0],u[1]]),h){var v=this.visualMapModel.getValueState(m);g.add(new Lt({style:{x:l==="right"?-n:u[0]+n,y:u[1]/2,text:d.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:v==="outOfRange"?.5:1}}))}t.add(g)},this),f&&this._renderEndsText(t,f[1],u,h,l),Ws(i.get("orient"),t,i.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,i){var n=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=n.visualMapModel;s.option.hoverLink&&n.api.dispatchAction({type:o,batch:ig(s.findTargetDataIndices(i),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,i=t.option;if(i.orient==="vertical")return wE(t,this.api,t.itemSize);var n=i.align;return(!n||n==="auto")&&(n="left"),n},e.prototype._renderEndsText=function(t,i,n,a,o){if(i){var s=new Ze,l=this.visualMapModel.textStyleModel;s.add(new Lt({style:fr(l,{x:a?o==="right"?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:a?o:"center",text:i})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,i=de(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),n=t.get("text"),a=t.get("orient"),o=t.get("inverse");return(a==="horizontal"?o:!o)?i.reverse():n&&(n=n.slice().reverse()),{viewPieceList:i,endsText:n}},e.prototype._createItemSymbol=function(t,i,n){t.add(Sr(this.getControllerVisual(i,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(i,"color")))},e.prototype._onItemClick=function(t){var i=this.visualMapModel,n=i.option,a=n.selectedMode;if(a){var o=Qe(n.selected),s=i.getSelectedMapKey(t);a==="single"||a===!0?(o[s]=!0,N(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(bE),LJ=Jbe;function $x(r){r.registerComponentModel(RJ),r.registerComponentView(LJ),Kx(r)}function i3(r){It(Jx),It($x)}var $be={label:{enabled:!0},decal:{show:!1}},PJ=vt(),Qbe={};function n3(r,e){var t=r.getModel("aria");if(!t.get("enabled"))return;var i=Qe($be);_t(i.label,r.getLocaleModel().get("aria"),!1),_t(t.option,i,!1),n(),a();function n(){var u=t.getModel("decal"),c=u.get("show");if(c){var f=ke();r.eachSeries(function(h){if(!h.isColorBySeries()){var p=f.get(h.type);p||(p={},f.set(h.type,p)),PJ(h).scope=p}}),r.eachRawSeries(function(h){if(r.isSeriesFiltered(h))return;if(He(h.enableAriaDecal)){h.enableAriaDecal();return}var p=h.getData();if(h.isColorBySeries()){var _=P_(h.ecModel,h.name,Qbe,r.getSeriesCount()),y=p.getVisual("decal");p.setVisual("decal",x(y,_))}else{var d=h.getRawData(),g={},m=PJ(h).scope;p.each(function(M){var S=p.getRawIndex(M);g[S]=M});var v=d.count();d.each(function(M){var S=g[M],w=d.getName(M)||M+"",T=P_(h.ecModel,w,m,v),C=p.getItemVisual(S,"decal");p.setItemVisual(S,"decal",x(C,T))})}function x(M,S){var w=M?fe(fe({},S),M):S;return w.dirty=!0,w}})}}function a(){var u=r.getLocaleModel().get("aria"),c=t.getModel("label");if(c.option=Ye(c.option,u),!!c.get("enabled")){var f=e.getZr().dom;if(c.get("description")){f.setAttribute("aria-label",c.get("description"));return}var h=r.getSeriesCount(),p=c.get(["data","maxCount"])||10,d=c.get(["series","maxCount"])||10,g=Math.min(h,d),m;if(!(h<1)){var v=s();if(v){var _=c.get(["general","withTitle"]);m=o(_,{title:v})}else m=c.get(["general","withoutTitle"]);var y=[],x=h>1?c.get(["series","multiple","prefix"]):c.get(["series","single","prefix"]);m+=o(x,{seriesCount:h}),r.eachSeries(function(T,C){if(C1?c.get(["series","multiple",I]):c.get(["series","single",I]),b=o(b,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var R=T.getData();if(R.count()>p){var A=c.get(["data","partialData"]);b+=o(A,{displayCnt:p})}else b+=c.get(["data","allData"]);for(var D=c.get(["data","separator","middle"]),U=c.get(["data","separator","end"]),B=[],F=0;F":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},ewe=function(){function r(e){var t=this._condVal=Ce(e)?new RegExp(e):zV(e)?e:null;if(t==null){var i="";ur(i)}}return r.prototype.evaluate=function(e){var t=typeof e;return Ce(t)?this._condVal.test(e):At(t)?this._condVal.test(e+""):!1},r}(),twe=function(){function r(){}return r.prototype.evaluate=function(){return this.value},r}(),rwe=function(){function r(){}return r.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&i.push(n),n=[R,A]}function c(R,A,D,U){ag(R,D)&&ag(A,U)||n.push(R,A,D,U,D,U)}function f(R,A,D,U,B,F){var k=Math.abs(A-R),G=Math.tan(k/4)*4/3,Y=AT:E2&&i.push(n),i}function c3(r,e,t,i,n,a,o,s,l,u){if(ag(r,t)&&ag(e,i)&&ag(n,o)&&ag(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-r,p=s-e,d=Math.sqrt(h*h+p*p);h/=d,p/=d;var g=t-r,m=i-e,v=n-o,_=a-s,y=g*g+m*m,x=v*v+_*_;if(y=0&&T=0){l.push(o,s);return}var C=[],b=[];Zo(r,t,n,o,.5,C),Zo(e,i,a,s,.5,b),c3(C[0],b[0],C[1],b[1],C[2],b[2],C[3],b[3],l,u),c3(C[4],b[4],C[5],b[5],C[6],b[6],C[7],b[7],l,u)}function zJ(r,e){var t=TE(r),i=[];e=e||1;for(var n=0;n0)for(var u=0;uMath.abs(u),f=GJ([l,u],c?0:1,e),h=(c?s:u)/f.length,p=0;pn,o=GJ([i,n],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=r[s]/o.length,h=0;h1?null:new Nt(g*l+r,g*u+e)}function pwe(r,e,t){var i=new Nt;Nt.sub(i,t,e),i.normalize();var n=new Nt;Nt.sub(n,r,e);var a=n.dot(i);return a}function og(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function dwe(r,e,t){for(var i=r.length,n=[],a=0;ao?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),dwe(e,u,c)}function EE(r,e,t,i){if(t===1)i.push(e);else{var n=Math.floor(t/2),a=r(e);EE(r,a[0],n,i),EE(r,a[1],t-n,i)}return i}function mwe(r,e){for(var t=[],i=0;i0)for(var M=i/t,S=-i/2;S<=i/2;S+=M){for(var w=Math.sin(S),T=Math.cos(S),C=0,y=0;y0;u/=2){var c=0,f=0;(r&u)>0&&(c=1),(e&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(r=u-1-r,e=u-1-e),l=r,r=e,e=l)}return s}function CE(r){var e=1/0,t=1/0,i=-1/0,n=-1/0,a=de(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),t=Math.min(f,t),i=Math.max(c,i),n=Math.max(f,n),[c,f]}),o=de(a,function(s,l){return{cp:s,z:bwe(s[0],s[1],e,t,i,n),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function jJ(r){return HJ(r.path,r.count)}function f3(){return{fromIndividuals:[],toIndividuals:[],count:0}}function KJ(r,e,t){var i=[];function n(M){for(var S=0;S=0;n--)if(!t[n].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var a=l.length,u=Math.ceil(a/2);t[n].many=l.slice(u,a),t[s].many=l.slice(0,u),s++}return t}var wwe={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),i=0;i0))return;var s=i.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;$J(r)&&(u=r,c=e),$J(e)&&(u=e,c=r);function f(v,_,y,x,M){var S=v.many,w=v.one;if(S.length===1&&!M){var T=_?S[0]:w,C=_?w:S[0];if(eS(T))f({many:[T],one:C},!0,y,x,!0);else{var b=s?Ye({delay:s(y,x)},l):l;RE(T,C,b),a(T,C,T,C,b)}}else for(var E=Ye({dividePath:wwe[t],individualDelay:s&&function(B,F,k,G){return s(B+y,x)}},l),I=_?KJ(S,w,E):JJ(w,S,E),R=I.fromIndividuals,A=I.toIndividuals,D=R.length,U=0;Ue.length,p=u?QJ(c,u):QJ(h?e:r,[h?r:e]),d=0,g=0;gs$))for(var a=i.getIndices(),o=0;o0&&S.group.traverse(function(T){T instanceof ut&&!T.animators.length&&T.animateFrom({style:{opacity:0}},w)})})}function n$(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function a$(r){return pe(r)?r.sort().join(","):r}function nh(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function Pwe(r,e){var t=ke(),i=ke(),n=ke();N(r.oldSeries,function(o,s){var l=r.oldDataGroupIds[s],u=r.oldData[s],c=n$(o),f=a$(c);i.set(f,{dataGroupId:l,data:u}),pe(c)&&N(c,function(h){n.set(h,{key:f,dataGroupId:l,data:u})})});function a(o){t.get(o)&&tH("Duplicated seriesKey in universalTransition "+o)}return N(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=n$(o),c=a$(u),f=i.get(c);if(f)t.set(c,{oldSeries:[{dataGroupId:f.dataGroupId,divide:nh(f.data),data:f.data}],newSeries:[{dataGroupId:s,divide:nh(l),data:l}]});else if(pe(u)){var h=[];N(u,function(g){var m=i.get(g);m.data&&h.push({dataGroupId:m.dataGroupId,divide:nh(m.data),data:m.data})}),h.length&&t.set(c,{oldSeries:h,newSeries:[{dataGroupId:s,data:l,divide:nh(l)}]})}else{var p=n.get(u);if(p){var d=t.get(p.key);d||(d={oldSeries:[{dataGroupId:p.dataGroupId,data:p.data,divide:nh(p.data)}],newSeries:[]},t.set(p.key,d)),d.newSeries.push({dataGroupId:s,data:l,divide:nh(l)})}}}}),t}function o$(r,e){for(var t=0;t=0&&n.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:nh(e.oldData[s]),groupIdDim:o.dimension})}),N(Jt(r.to),function(o){var s=o$(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:nh(l),groupIdDim:o.dimension})}}),n.length>0&&a.length>0&&l$(n,a,i)}function d3(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,i){N(Jt(i.seriesTransition),function(n){N(Jt(n.to),function(a){for(var o=i.updatedSeries,s=0;s{let e=class e{constructor(){this.chartInstance=null,this.options={},this.defaultTooltipOptions={tooltip:{trigger:"item",borderColor:"#00eff8",backgroundColor:"#12192C",padding:[6,14,6,14],textStyle:{fontSize:14,color:"#74FAFB"},position:"top",axisPointer:{type:"shadow"}},series:[{type:"gauge",startAngle:180,endAngle:0,center:["50%","75%"],radius:"90%",min:0,max:1,splitNumber:8,axisLine:{lineStyle:{width:6,color:[[.25,"#74FAFB"],[.5,"#74FAFB"],[.75,"#74FAFB"],[1,"#74FAFB"]]}},pointer:{icon:"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",length:"12%",width:20,offsetCenter:[0,"-60%"],itemStyle:{color:"auto"}},axisTick:{length:12,lineStyle:{color:"auto",width:2}},splitLine:{length:20,lineStyle:{color:"auto",width:5}},axisLabel:{color:"#464646",fontSize:20,distance:-60,rotate:"tangential",formatter:function(i){return""}},title:{offsetCenter:[0,"-10%"],fontSize:20},tooltip:{trigger:"item",borderColor:"#00eff8",backgroundColor:"#12192C",padding:[6,14,6,14],textStyle:{fontSize:14,color:"#74FAFB"},position:"top",axisPointer:{type:"shadow"}},detail:{fontSize:30,offsetCenter:[0,"-5%"],valueAnimation:!0,formatter:function(i){return Math.round(i*100)+""},color:"inherit"}}]}}ngOnInit(){console.log("ChartComponentComponent ngOnInit"),this.initEcharts()}ngOnChanges(i){i.options&&!i.options.isFirstChange()&&(console.log("ChartComponentComponent ngOnChanges"),this.updateChartOptions())}ngOnDestroy(){this.chartInstance&&(console.log("ChartComponentComponent ngOnInit"),this.chartInstance.dispose())}initEcharts(){let i=this.chartContainer.nativeElement;this.chartInstance=jD(i,"dark");let n=E0(E0({},this.defaultTooltipOptions),this.options);this.chartInstance.setOption(n)}updateChartOptions(){this.chartInstance&&this.chartInstance.setOption(this.options)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["app-chart-component"]],viewQuery:function(n,a){if(n&1&&vm(Iwe,7),n&2){let o;co(o=fo())&&(a.chartContainer=o.first)}},inputs:{options:"options"},standalone:!0,features:[C0,ui],decls:2,vars:0,consts:[[2,"width","100%","height","100%"],["chart",""]],template:function(n,a){n&1&&li(0,"div",0,1)}});let r=e;return r})();var ah=["*"];function Nwe(r,e){if(r&1&&li(0,"nz-avatar",3),r&2){let t=Lr();Rt("nzSrc",t.nzSrc)}}function Uwe(r,e){r&1&&Li(0,0,["*ngIf","!nzSrc"])}function Owe(r,e){if(r&1&&li(0,"nz-list-item-meta-avatar",3),r&2){let t=Lr();Rt("nzSrc",t.avatarStr)}}function Fwe(r,e){if(r&1&&(tr(0,"nz-list-item-meta-avatar"),dV(1,4),lr()),r&2){let t=Lr();Ot(),Rt("ngTemplateOutlet",t.avatarTpl)}}function zwe(r,e){if(r&1&&(Sl(0),Pi(1),Ml()),r&2){let t=Lr(3);Ot(),Ec(t.nzTitle)}}function Bwe(r,e){if(r&1&&(tr(0,"nz-list-item-meta-title"),br(1,zwe,2,1,"ng-container",6),lr()),r&2){let t=Lr(2);Ot(),Rt("nzStringTemplateOutlet",t.nzTitle)}}function kwe(r,e){if(r&1&&(Sl(0),Pi(1),Ml()),r&2){let t=Lr(3);Ot(),Ec(t.nzDescription)}}function Vwe(r,e){if(r&1&&(tr(0,"nz-list-item-meta-description"),br(1,kwe,2,1,"ng-container",6),lr()),r&2){let t=Lr(2);Ot(),Rt("nzStringTemplateOutlet",t.nzDescription)}}function Gwe(r,e){if(r&1&&(tr(0,"div",5),br(1,Bwe,2,1,"nz-list-item-meta-title",1)(2,Vwe,2,1,"nz-list-item-meta-description",1),Li(3,1),Li(4,2),lr()),r&2){let t=Lr();Ot(),Rt("ngIf",t.nzTitle&&!t.titleComponent),Ot(),Rt("ngIf",t.nzDescription&&!t.descriptionComponent)}}var Hwe=[[["nz-list-item-meta-avatar"]],[["nz-list-item-meta-title"]],[["nz-list-item-meta-description"]]],Wwe=["nz-list-item-meta-avatar","nz-list-item-meta-title","nz-list-item-meta-description"];function Xwe(r,e){r&1&&Li(0)}var Ywe=["nz-list-item-actions",""];function qwe(r,e){}function Zwe(r,e){r&1&&li(0,"em",3)}function jwe(r,e){if(r&1&&(tr(0,"li"),br(1,qwe,0,0,"ng-template",1)(2,Zwe,1,0,"em",2),lr()),r&2){let t=e.$implicit,i=e.last;Ot(),Rt("ngTemplateOutlet",t),Ot(),Rt("ngIf",!i)}}function Kwe(r,e){}var m$=(r,e)=>({$implicit:r,index:e});function Jwe(r,e){if(r&1&&(Sl(0),br(1,Kwe,0,0,"ng-template",9),Ml()),r&2){let t=e.$implicit,i=e.index,n=Lr(2);Ot(),Rt("ngTemplateOutlet",n.nzRenderItem)("ngTemplateOutletContext",tL(2,m$,t,i))}}function $we(r,e){if(r&1&&(tr(0,"div",7),br(1,Jwe,2,5,"ng-container",8),Li(2,4),lr()),r&2){let t=Lr();Ot(),Rt("ngForOf",t.nzDataSource)}}function Qwe(r,e){if(r&1&&(Sl(0),Pi(1),Ml()),r&2){let t=Lr(2);Ot(),Ec(t.nzHeader)}}function e1e(r,e){if(r&1&&(tr(0,"nz-list-header"),br(1,Qwe,2,1,"ng-container",10),lr()),r&2){let t=Lr();Ot(),Rt("nzStringTemplateOutlet",t.nzHeader)}}function t1e(r,e){r&1&&li(0,"div"),r&2&&hV("min-height",53,"px")}function r1e(r,e){}function i1e(r,e){if(r&1&&(tr(0,"div",13),br(1,r1e,0,0,"ng-template",9),lr()),r&2){let t=e.$implicit,i=e.index,n=Lr(2);Rt("nzSpan",n.nzGrid.span||null)("nzXs",n.nzGrid.xs||null)("nzSm",n.nzGrid.sm||null)("nzMd",n.nzGrid.md||null)("nzLg",n.nzGrid.lg||null)("nzXl",n.nzGrid.xl||null)("nzXXl",n.nzGrid.xxl||null),Ot(),Rt("ngTemplateOutlet",n.nzRenderItem)("ngTemplateOutletContext",tL(9,m$,t,i))}}function n1e(r,e){if(r&1&&(tr(0,"div",11),br(1,i1e,2,12,"div",12),lr()),r&2){let t=Lr();Rt("nzGutter",t.nzGrid.gutter||null),Ot(),Rt("ngForOf",t.nzDataSource)}}function a1e(r,e){if(r&1&&li(0,"nz-list-empty",14),r&2){let t=Lr();Rt("nzNoResult",t.nzNoResult)}}function o1e(r,e){if(r&1&&(Sl(0),Pi(1),Ml()),r&2){let t=Lr(2);Ot(),Ec(t.nzFooter)}}function s1e(r,e){if(r&1&&(tr(0,"nz-list-footer"),br(1,o1e,2,1,"ng-container",10),lr()),r&2){let t=Lr();Ot(),Rt("nzStringTemplateOutlet",t.nzFooter)}}function l1e(r,e){}function u1e(r,e){}function c1e(r,e){if(r&1&&(tr(0,"nz-list-pagination"),br(1,u1e,0,0,"ng-template",6),lr()),r&2){let t=Lr();Ot(),Rt("ngTemplateOutlet",t.nzPagination)}}var f1e=[[["nz-list-header"]],[["nz-list-footer"],["","nz-list-footer",""]],[["nz-list-load-more"],["","nz-list-load-more",""]],[["nz-list-pagination"],["","nz-list-pagination",""]],"*"],h1e=["nz-list-header","nz-list-footer, [nz-list-footer]","nz-list-load-more, [nz-list-load-more]","nz-list-pagination, [nz-list-pagination]","*"];function p1e(r,e){if(r&1&&li(0,"ul",6),r&2){let t=Lr(2);Rt("nzActions",t.nzActions)}}function d1e(r,e){if(r&1&&(br(0,p1e,1,1,"ul",5),Li(1)),r&2){let t=Lr();Rt("ngIf",t.nzActions&&t.nzActions.length>0)}}function m1e(r,e){if(r&1&&(Sl(0),Pi(1),Ml()),r&2){let t=Lr(3);Ot(),Ec(t.nzContent)}}function v1e(r,e){if(r&1&&(Sl(0),br(1,m1e,2,1,"ng-container",8),Ml()),r&2){let t=Lr(2);Ot(),Rt("nzStringTemplateOutlet",t.nzContent)}}function g1e(r,e){if(r&1&&(Li(0,1),Li(1,2),br(2,v1e,2,1,"ng-container",7)),r&2){let t=Lr();Ot(2),Rt("ngIf",t.nzContent)}}function y1e(r,e){r&1&&Li(0,3)}function _1e(r,e){}function x1e(r,e){}function S1e(r,e){}function M1e(r,e){}function b1e(r,e){if(r&1&&br(0,_1e,0,0,"ng-template",9)(1,x1e,0,0,"ng-template",9)(2,S1e,0,0,"ng-template",9)(3,M1e,0,0,"ng-template",9),r&2){let t=Lr(),i=gu(3),n=gu(5),a=gu(1);Rt("ngTemplateOutlet",i),Ot(),Rt("ngTemplateOutlet",t.nzExtra),Ot(),Rt("ngTemplateOutlet",n),Ot(),Rt("ngTemplateOutlet",a)}}function w1e(r,e){}function T1e(r,e){}function E1e(r,e){}function A1e(r,e){if(r&1&&(tr(0,"nz-list-item-extra"),br(1,E1e,0,0,"ng-template",9),lr()),r&2){let t=Lr(2);Ot(),Rt("ngTemplateOutlet",t.nzExtra)}}function C1e(r,e){}function R1e(r,e){if(r&1&&(Sl(0),tr(1,"div",10),br(2,w1e,0,0,"ng-template",9)(3,T1e,0,0,"ng-template",9),lr(),br(4,A1e,2,1,"nz-list-item-extra",7)(5,C1e,0,0,"ng-template",9),Ml()),r&2){let t=Lr(),i=gu(3),n=gu(1),a=gu(5);Ot(2),Rt("ngTemplateOutlet",i),Ot(),Rt("ngTemplateOutlet",n),Ot(),Rt("ngIf",t.nzExtra),Ot(),Rt("ngTemplateOutlet",a)}}var L1e=[[["nz-list-item-actions"],["","nz-list-item-actions",""]],[["nz-list-item-meta"],["","nz-list-item-meta",""]],"*",[["nz-list-item-extra"],["","nz-list-item-extra",""]]],P1e=["nz-list-item-actions, [nz-list-item-actions]","nz-list-item-meta, [nz-list-item-meta]","*","nz-list-item-extra, [nz-list-item-extra]"],c$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-item-meta-title"]],exportAs:["nzListItemMetaTitle"],standalone:!0,features:[ui],ngContentSelectors:ah,decls:2,vars:0,consts:[[1,"ant-list-item-meta-title"]],template:function(n,a){n&1&&(Ho(),tr(0,"h4",0),Li(1),lr())},encapsulation:2,changeDetection:0});let r=e;return r})(),f$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-item-meta-description"]],exportAs:["nzListItemMetaDescription"],standalone:!0,features:[ui],ngContentSelectors:ah,decls:2,vars:0,consts:[[1,"ant-list-item-meta-description"]],template:function(n,a){n&1&&(Ho(),tr(0,"div",0),Li(1),lr())},encapsulation:2,changeDetection:0});let r=e;return r})(),v$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-item-meta-avatar"]],inputs:{nzSrc:"nzSrc"},exportAs:["nzListItemMetaAvatar"],standalone:!0,features:[ui],ngContentSelectors:ah,decls:3,vars:2,consts:[[1,"ant-list-item-meta-avatar"],[3,"nzSrc",4,"ngIf"],[4,"ngIf"],[3,"nzSrc"]],template:function(n,a){n&1&&(Ho(),tr(0,"div",0),br(1,Nwe,1,1,"nz-avatar",1)(2,Uwe,1,0,"ng-content",2),lr()),n&2&&(Ot(),Rt("ngIf",a.nzSrc),Ot(),Rt("ngIf",!a.nzSrc))},dependencies:[El,EV,bl],encapsulation:2,changeDetection:0});let r=e;return r})(),D1e=(()=>{let e=class e{set nzAvatar(i){i instanceof eL?(this.avatarStr="",this.avatarTpl=i):this.avatarStr=i}constructor(i){this.elementRef=i,this.avatarStr=""}};e.\u0275fac=function(n){return new(n||e)(uo(cV))},e.\u0275cmp=si({type:e,selectors:[["nz-list-item-meta"],["","nz-list-item-meta",""]],contentQueries:function(n,a,o){if(n&1&&(Tc(o,f$,5),Tc(o,c$,5)),n&2){let s;co(s=fo())&&(a.descriptionComponent=s.first),co(s=fo())&&(a.titleComponent=s.first)}},hostAttrs:[1,"ant-list-item-meta"],inputs:{nzAvatar:"nzAvatar",nzTitle:"nzTitle",nzDescription:"nzDescription"},exportAs:["nzListItemMeta"],standalone:!0,features:[ui],ngContentSelectors:Wwe,decls:4,vars:3,consts:[[3,"nzSrc",4,"ngIf"],[4,"ngIf"],["class","ant-list-item-meta-content",4,"ngIf"],[3,"nzSrc"],[3,"ngTemplateOutlet"],[1,"ant-list-item-meta-content"],[4,"nzStringTemplateOutlet"]],template:function(n,a){n&1&&(Ho(Hwe),br(0,Owe,1,1,"nz-list-item-meta-avatar",0)(1,Fwe,2,1,"nz-list-item-meta-avatar",1),Li(2),br(3,Gwe,5,2,"div",2)),n&2&&(Rt("ngIf",a.avatarStr),Ot(),Rt("ngIf",a.avatarTpl),Ot(2),Rt("ngIf",a.nzTitle||a.nzDescription||a.descriptionComponent||a.titleComponent))},dependencies:[v$,bl,L0,c$,qM,YM,f$],encapsulation:2,changeDetection:0});let r=e;return r})(),h$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-item-extra"],["","nz-list-item-extra",""]],hostAttrs:[1,"ant-list-item-extra"],exportAs:["nzListItemExtra"],standalone:!0,features:[ui],ngContentSelectors:ah,decls:1,vars:0,template:function(n,a){n&1&&(Ho(),Li(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),I1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-item-action"]],viewQuery:function(n,a){if(n&1&&vm(eL,5),n&2){let o;co(o=fo())&&(a.templateRef=o.first)}},exportAs:["nzListItemAction"],standalone:!0,features:[ui],ngContentSelectors:ah,decls:1,vars:0,template:function(n,a){n&1&&(Ho(),br(0,Xwe,1,0,"ng-template"))},encapsulation:2,changeDetection:0});let r=e;return r})(),N1e=(()=>{let e=class e{constructor(i,n,a){this.ngZone=i,this.nzActions=[],this.actions=[],this.inputActionChanges$=new qR,this.contentChildrenChanges$=rV(()=>this.nzListItemActions?tV(null):this.ngZone.onStable.pipe(nV(1),this.enterZone(),aV(()=>this.nzListItemActions.changes.pipe(oV(this.nzListItemActions))))),iV(this.contentChildrenChanges$,this.inputActionChanges$).pipe(ZR(a)).subscribe(()=>{this.nzActions.length?this.actions=this.nzActions:this.actions=this.nzListItemActions.map(o=>o.templateRef),n.detectChanges()})}ngOnChanges(){this.inputActionChanges$.next(null)}enterZone(){return i=>new Qk(n=>i.subscribe({next:a=>this.ngZone.run(()=>n.next(a))}))}};e.\u0275fac=function(n){return new(n||e)(uo(fV),uo(jR),uo(ZM))},e.\u0275cmp=si({type:e,selectors:[["ul","nz-list-item-actions",""]],contentQueries:function(n,a,o){if(n&1&&Tc(o,I1e,4),n&2){let s;co(s=fo())&&(a.nzListItemActions=s)}},hostAttrs:[1,"ant-list-item-action"],inputs:{nzActions:"nzActions"},exportAs:["nzListItemActions"],standalone:!0,features:[vV([ZM]),C0,ui],attrs:Ywe,decls:1,vars:1,consts:[[4,"ngFor","ngForOf"],[3,"ngTemplateOutlet"],["class","ant-list-item-action-split",4,"ngIf"],[1,"ant-list-item-action-split"]],template:function(n,a){n&1&&br(0,jwe,3,2,"li",0),n&2&&Rt("ngForOf",a.actions)},dependencies:[R0,L0,bl],encapsulation:2,changeDetection:0});let r=e;return r})(),g$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-empty"]],hostAttrs:[1,"ant-list-empty-text"],inputs:{nzNoResult:"nzNoResult"},exportAs:["nzListHeader"],standalone:!0,features:[ui],decls:1,vars:2,consts:[[3,"nzComponentName","specificContent"]],template:function(n,a){n&1&&li(0,"nz-embed-empty",0),n&2&&Rt("nzComponentName","list")("specificContent",a.nzNoResult)},dependencies:[wV,bV],encapsulation:2,changeDetection:0});let r=e;return r})(),U1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-header"]],hostAttrs:[1,"ant-list-header"],exportAs:["nzListHeader"],standalone:!0,features:[ui],ngContentSelectors:ah,decls:1,vars:0,template:function(n,a){n&1&&(Ho(),Li(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),p$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-footer"]],hostAttrs:[1,"ant-list-footer"],exportAs:["nzListFooter"],standalone:!0,features:[ui],ngContentSelectors:ah,decls:1,vars:0,template:function(n,a){n&1&&(Ho(),Li(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),d$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["nz-list-pagination"]],hostAttrs:[1,"ant-list-pagination"],exportAs:["nzListPagination"],standalone:!0,features:[ui],ngContentSelectors:ah,decls:1,vars:0,template:function(n,a){n&1&&(Ho(),Li(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),O1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=uV({type:e,selectors:[["nz-list-load-more"]],exportAs:["nzListLoadMoreDirective"],standalone:!0});let r=e;return r})();var y$=(()=>{let e=class e{get itemLayoutNotify$(){return this.itemLayoutNotifySource.asObservable()}constructor(i){this.directionality=i,this.nzBordered=!1,this.nzGrid="",this.nzItemLayout="horizontal",this.nzRenderItem=null,this.nzLoading=!1,this.nzLoadMore=null,this.nzSize="default",this.nzSplit=!0,this.hasSomethingAfterLastItem=!1,this.dir="ltr",this.itemLayoutNotifySource=new eV(this.nzItemLayout),this.destroy$=new qR}ngOnInit(){this.dir=this.directionality.value,this.directionality.change?.pipe(ZR(this.destroy$)).subscribe(i=>{this.dir=i})}getSomethingAfterLastItem(){return!!(this.nzLoadMore||this.nzPagination||this.nzFooter||this.nzListFooterComponent||this.nzListPaginationComponent||this.nzListLoadMoreDirective)}ngOnChanges(i){i.nzItemLayout&&this.itemLayoutNotifySource.next(this.nzItemLayout)}ngOnDestroy(){this.itemLayoutNotifySource.unsubscribe(),this.destroy$.next(),this.destroy$.complete()}ngAfterContentInit(){this.hasSomethingAfterLastItem=this.getSomethingAfterLastItem()}};e.\u0275fac=function(n){return new(n||e)(uo(SV,8))},e.\u0275cmp=si({type:e,selectors:[["nz-list"],["","nz-list",""]],contentQueries:function(n,a,o){if(n&1&&(Tc(o,p$,5),Tc(o,d$,5),Tc(o,O1e,5)),n&2){let s;co(s=fo())&&(a.nzListFooterComponent=s.first),co(s=fo())&&(a.nzListPaginationComponent=s.first),co(s=fo())&&(a.nzListLoadMoreDirective=s.first)}},hostAttrs:[1,"ant-list"],hostVars:16,hostBindings:function(n,a){n&2&&KR("ant-list-rtl",a.dir==="rtl")("ant-list-vertical",a.nzItemLayout==="vertical")("ant-list-lg",a.nzSize==="large")("ant-list-sm",a.nzSize==="small")("ant-list-split",a.nzSplit)("ant-list-bordered",a.nzBordered)("ant-list-loading",a.nzLoading)("ant-list-something-after-last-item",a.hasSomethingAfterLastItem)},inputs:{nzDataSource:"nzDataSource",nzBordered:"nzBordered",nzGrid:"nzGrid",nzHeader:"nzHeader",nzFooter:"nzFooter",nzItemLayout:"nzItemLayout",nzRenderItem:"nzRenderItem",nzLoading:"nzLoading",nzLoadMore:"nzLoadMore",nzPagination:"nzPagination",nzSize:"nzSize",nzSplit:"nzSplit",nzNoResult:"nzNoResult"},exportAs:["nzList"],standalone:!0,features:[C0,ui],ngContentSelectors:h1e,decls:15,vars:9,consts:[["itemsTpl",""],[4,"ngIf"],[3,"nzSpinning"],[3,"min-height",4,"ngIf"],["nz-row","",3,"nzGutter",4,"ngIf","ngIfElse"],[3,"nzNoResult",4,"ngIf"],[3,"ngTemplateOutlet"],[1,"ant-list-items"],[4,"ngFor","ngForOf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"nzStringTemplateOutlet"],["nz-row","",3,"nzGutter"],["nz-col","",3,"nzSpan","nzXs","nzSm","nzMd","nzLg","nzXl","nzXXl",4,"ngFor","ngForOf"],["nz-col","",3,"nzSpan","nzXs","nzSm","nzMd","nzLg","nzXl","nzXXl"],[3,"nzNoResult"]],template:function(n,a){if(n&1&&(Ho(f1e),br(0,$we,3,1,"ng-template",null,0,gm)(2,e1e,2,1,"nz-list-header",1),Li(3),tr(4,"nz-spin",2),Sl(5),br(6,t1e,1,2,"div",3)(7,n1e,2,2,"div",4)(8,a1e,1,1,"nz-list-empty",5),Ml(),lr(),br(9,s1e,2,1,"nz-list-footer",1),Li(10,1),br(11,l1e,0,0,"ng-template",6),Li(12,2),br(13,c1e,2,1,"nz-list-pagination",1),Li(14,3)),n&2){let o=gu(1);Ot(2),Rt("ngIf",a.nzHeader),Ot(2),Rt("nzSpinning",a.nzLoading),Ot(2),Rt("ngIf",a.nzLoading&&a.nzDataSource&&a.nzDataSource.length===0),Ot(),Rt("ngIf",a.nzGrid&&a.nzDataSource)("ngIfElse",o),Ot(),Rt("ngIf",!a.nzLoading&&a.nzDataSource&&a.nzDataSource.length===0),Ot(),Rt("ngIf",a.nzFooter),Ot(2),Rt("ngTemplateOutlet",a.nzLoadMore),Ot(2),Rt("ngIf",a.nzPagination)}},dependencies:[L0,R0,U1e,bl,qM,YM,wl,TV,Tl,JM,KM,g$,p$,d$],encapsulation:2,changeDetection:0});let r=e;return A0([P0()],r.prototype,"nzBordered",void 0),A0([P0()],r.prototype,"nzLoading",void 0),A0([P0()],r.prototype,"nzSplit",void 0),r})(),F1e=(()=>{let e=class e{get isVerticalAndExtra(){return this.itemLayout==="vertical"&&(!!this.listItemExtraDirective||!!this.nzExtra)}constructor(i,n){this.parentComp=i,this.cdr=n,this.nzActions=[],this.nzExtra=null,this.nzNoFlex=!1}ngAfterViewInit(){this.itemLayout$=this.parentComp.itemLayoutNotify$.subscribe(i=>{this.itemLayout=i,this.cdr.detectChanges()})}ngOnDestroy(){this.itemLayout$&&this.itemLayout$.unsubscribe()}};e.\u0275fac=function(n){return new(n||e)(uo(y$),uo(jR))},e.\u0275cmp=si({type:e,selectors:[["nz-list-item"],["","nz-list-item",""]],contentQueries:function(n,a,o){if(n&1&&Tc(o,h$,5),n&2){let s;co(s=fo())&&(a.listItemExtraDirective=s.first)}},hostAttrs:[1,"ant-list-item"],hostVars:2,hostBindings:function(n,a){n&2&&KR("ant-list-item-no-flex",a.nzNoFlex)},inputs:{nzActions:"nzActions",nzContent:"nzContent",nzExtra:"nzExtra",nzNoFlex:"nzNoFlex"},exportAs:["nzListItem"],standalone:!0,features:[ui],ngContentSelectors:P1e,decls:9,vars:2,consts:[["actionsTpl",""],["contentTpl",""],["extraTpl",""],["simpleTpl",""],[4,"ngIf","ngIfElse"],["nz-list-item-actions","",3,"nzActions",4,"ngIf"],["nz-list-item-actions","",3,"nzActions"],[4,"ngIf"],[4,"nzStringTemplateOutlet"],[3,"ngTemplateOutlet"],[1,"ant-list-item-main"]],template:function(n,a){if(n&1&&(Ho(L1e),br(0,d1e,2,1,"ng-template",null,0,gm)(2,g1e,3,1,"ng-template",null,1,gm)(4,y1e,1,0,"ng-template",null,2,gm)(6,b1e,4,4,"ng-template",null,3,gm)(8,R1e,6,4,"ng-container",4)),n&2){let o=gu(7);Ot(8),Rt("ngIf",a.isVerticalAndExtra)("ngIfElse",o)}},dependencies:[N1e,bl,qM,YM,L0,h$],encapsulation:2,changeDetection:0});let r=e;return A0([P0()],r.prototype,"nzNoFlex",void 0),r})();var NE=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=lV({type:e}),e.\u0275inj=sV({imports:[y$,g$,F1e,D1e,v$]});let r=e;return r})();var B1e=r=>({margin:r,width:"100%",height:"16rem"});function k1e(r,e){if(r&1&&li(0,"app-chart-component",28),r&2){let t=Lr(2).$implicit,i=Lr();pV(gV(3,B1e,"20px "+20/i.chartConfig.rowNumber+"px")),Rt("options",t.options)}}function V1e(r,e){if(r&1&&(tr(0,"div",26),br(1,k1e,1,5,"app-chart-component",27),lr()),r&2){let t=Lr().$implicit,i=Lr();Rt("nzSpan",24/i.chartConfig.rowNumber),Ot(),Rt("ngIf",t.checked)}}function G1e(r,e){if(r&1&&br(0,V1e,2,2,"div",25),r&2){let t=e.$implicit;Rt("ngIf",t.checked)}}function H1e(r,e){if(r&1&&(tr(0,"div",4)(1,"div",29),li(2,"app-chart-component",30),lr()()),r&2){let t=e.$implicit;Ot(2),Rt("options",t)}}var x$=(()=>{let e=class e{handleCheckedItems(i){console.log("\u5F53\u524D\u9009\u4E2D\u7684\u9879\u76EE:",i)}constructor(i){this._mqttService=i,this.http=xl(_m),this.modal=xl(ym),this.chartConfig={rowNumber:1,optionsCheckList:[{label:"\u5168\u6C34",options:{},checked:!0},{label:"\u70ED\u503C",options:{},checked:!0},{label:"\u5168\u786B",options:{},checked:!1},{label:"\u5185\u6C34",options:{},checked:!1},{label:"\u7070\u5206",options:{},checked:!1},{label:"\u6325\u53D1\u5206",options:{},checked:!1}],optionBottomList:[{}],optionsList:[{label:"\u5168\u6C34",options:{},checked:!0},{label:"\u70ED\u503C",options:{},checked:!0}],tableList:[{coldef:[{headerName:"\u65F6\u95F4",field:"rwmc",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u7CFB\u7EDF/\u8BBE\u5907",field:"rwms",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u64CD\u4F5C\u63CF\u8FF0",field:"kssj",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u64CD\u4F5C\u4EBA\u5458",field:"jhwcsj",unSortIcon:!0,minWidth:void 0,flex:1}],rowData:[]},{coldef:[{headerName:"\u5E8F\u53F7",field:"rwmc",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u65F6\u95F4",field:"kssj",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",field:"rwms",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u7B49\u7EA7",field:"dqzt",unSortIcon:!0,minWidth:void 0,flex:1}],rowData:[]}]},this.chart_options={},this.chart_options0={},this.chart_options1={},this.chart_options2={},this.chart_options3={},this.chart_options4={},this.rowData=[],this.colDefs1=[{headerName:"\u65F6\u95F4",field:"rwmc",flex:1},{headerName:"\u7CFB\u7EDF/\u8BBE\u5907",field:"rwms",flex:1},{headerName:"\u64CD\u4F5C\u63CF\u8FF0",field:"kssj",flex:1},{headerName:"\u64CD\u4F5C\u4EBA\u5458",field:"jhwcsj",flex:1}],this.colDefs2=[{headerName:"\u5E8F\u53F7",field:"rwmc",flex:1},{headerName:"\u65F6\u95F4",field:"kssj",flex:2},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",field:"rwms",flex:1},{headerName:"\u7B49\u7EA7",field:"dqzt",flex:1.5}],this.subscription=this._mqttService.observe("s1").subscribe(n=>{let a=JSON.parse(n.payload.toString());console.log("Received message as object: ",a.msg),this.chart_options0=a.msg})}ngOnInit(){this.getServerConfig();for(var i=1;i<30;i++)this.rowData.push({rwmc:"\u4EFB\u52A1"+i,rwms:"\u4EFB\u52A1\u63CF\u8FF0"+i,kssj:"2024-1-"+i+" 13:38:"+i*11,jhwcsj:"2024-1-"+i+" 13:38:"+i*10,sfcq:"\u5426",dqzt:"\u6B63\u5E38",dqjd:"\u8282\u70B9"+i,sjwcsj:"2024-1-"+i+" 13:38:"+i*27,bjmc:"\u62A5\u8B665",bjms:"\u62A5\u8B66\u63CF\u8FF05",bjsj:"2024-1-"+i+" 13:38:"+i*12,gzyy:"-",clff:"-",tzsj:"2024-1-"+i+" 13:38:"+i*19,zycd:"\u4E00\u822C",tzmc:"\u7CFB\u7EDF\u63D0\u793A",tznr:"\u8D26\u6237\u767B\u5F55",fj:"-",cz:"\u64CD\u4F5C"});for(var n=[],a=[],o=[],s=100,i=0;i{this.chartConfig.optionsCheckList[0].options=i.data,console.log(i)})}};e.\u0275fac=function(n){return new(n||e)(uo(LV))},e.\u0275cmp=si({type:e,selectors:[["app-data-v-s1"]],standalone:!0,features:[ui],decls:56,vars:13,consts:[["nz-row","",1,"s1-container",3,"nzGutter"],["nz-col","","nzSpan","8"],["title","\u7CFB\u7EDF\u72B6\u6001"],["nz-row","",2,"justify-content","center","align-items","center"],["nz-col","","nzSpan","12"],[1,"centered-element"],[2,"width","26rem","height","11rem",3,"options"],[1,"sys-status-title"],["title","\u7CFB\u7EDF\u64CD\u4F5C\u8BB0\u5F55",2,"margin-top","1rem"],[1,"ag-theme-datav",3,"rowData","columnDefs"],["title","\u7CFB\u7EDF\u62A5\u8B66\u4FE1\u606F",2,"margin-top","1rem"],["title","",2,"margin-top","1rem"],[1,"progress-container"],[1,"status-text"],[2,"width","100%",3,"nzPercent","nzStrokeColor"],[1,"status-ext-text"],[1,"progress-container","mt-sm"],["title",""],[2,"height","34.6rem"],["src","assets/dashboard/dashboard_ws_demo1.png",2,"width","100%"],["nz-row","",2,"justify-content","center","align-items","center","margin-top","0.5rem"],["nz-col","","nzSpan","12",1,"sys-status-title"],["title","\u5316\u9A8C\u7ED3\u679C",3,"showSetting","optionsList","onCheckedItemsChange"],["nz-row","",1,"scrollable-container"],["nz-row",""],["nz-col","","class","centered-element",3,"nzSpan",4,"ngIf"],["nz-col","",1,"centered-element",3,"nzSpan"],[3,"options","style",4,"ngIf"],[3,"options"],[1,"centered-element",2,"margin","2px"],[2,"width","26rem","height","11rem","margin-left","0.4rem",3,"options"],["nz-col","","class","centered-element",3,"nzSpan"]],template:function(n,a){n&1&&(tr(0,"div",0)(1,"div",1)(2,"data-v-card",2)(3,"div",3)(4,"div",4)(5,"div",5),li(6,"app-chart-component",6),lr(),tr(7,"div",7),Pi(8,"\u7CFB\u7EDF\u5065\u5EB7\u5EA6"),lr()(),tr(9,"div",4)(10,"div",5),li(11,"app-chart-component",6),lr(),tr(12,"div",7),Pi(13,"\u8BBE\u5907\u6295\u8FD0\u5EA6"),lr()()()(),tr(14,"data-v-card",8),li(15,"ag-grid-angular",9),lr(),tr(16,"data-v-card",10),li(17,"ag-grid-angular",9),lr(),tr(18,"data-v-card",11)(19,"div",12)(20,"span",13),Pi(21,"\u5316\u9A8C\u6548\u7387\uFF1A"),lr(),li(22,"nz-progress",14),tr(23,"span",15),Pi(24,"\uFF0816/25\uFF09"),lr()(),tr(25,"div",16)(26,"span",13),Pi(27,"\u5B8C \u6210 \u7387 \uFF1A"),lr(),li(28,"nz-progress",14),tr(29,"span",15),Pi(30,"\uFF0812/20\uFF09"),lr()()()(),tr(31,"div",1)(32,"data-v-card",17)(33,"div",18),li(34,"img",19),tr(35,"div",20)(36,"div",21),Pi(37," \u673A\u5668\u4EBA "),lr(),tr(38,"div",21),Pi(39," \u5168\u786B\u4EEA "),lr(),tr(40,"div",21),Pi(41," \u5168\u6C34\u5206\u6790\u4EEA "),lr(),tr(42,"div",21),Pi(43," \u6325\u53D1\u5206\u4EEA "),lr(),tr(44,"div",21),Pi(45," \u91CF\u70ED\u4EEA "),lr(),tr(46,"div",21),Pi(47," \u78B3\u6C22\u6C2E\u5143\u7D20 "),lr()()()()(),tr(48,"div",1)(49,"data-v-card",22),mV("onCheckedItemsChange",function(s){return a.handleCheckedItems(s)}),tr(50,"div",23),$R(51,G1e,1,1,"div",31,JR),lr(),tr(53,"div",24),$R(54,H1e,3,1,"div",4,JR),lr()()()()),n&2&&(Rt("nzGutter",16),Ot(6),Rt("options",a.chart_options),Ot(5),Rt("options",a.chart_options0),Ot(4),Rt("rowData",a.rowData)("columnDefs",a.colDefs1),Ot(2),Rt("rowData",a.rowData)("columnDefs",a.colDefs2),Ot(5),Rt("nzPercent",64)("nzStrokeColor","#74FAFB"),Ot(6),Rt("nzPercent",60)("nzStrokeColor","#74FAFB"),Ot(21),Rt("showSetting",!0)("optionsList",a.chartConfig.optionsCheckList),Ot(2),QR(a.chartConfig.optionsCheckList),Ot(3),QR(a.chartConfig.optionBottomList))},dependencies:[XM,bl,jM,rf,AV,CV,RV,NE,Dc,Ic,Kc,Wc,$c,Qc,Jc,Zc,Pc,Vc,Hc,nf,qc,Xc,JM,KM,Tl,Cc,Bc,kc,ef,Fc,El,Yc,Oc,Gc,zc,tf,Lc,Rc,jc,Uc,Ac,Nc,wl,u$],styles:[".dashboard-container[_ngcontent-%COMP%]{width:20rem;height:10rem;margin-top:-3rem;margin-bottom:-2rem}.sys-status-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:#94ddf3;text-align:center}.ag-theme-datav[_ngcontent-%COMP%]{--ag-border-color: #74FAFB;--ag-foreground-color: #74FAFB;--ag-background-color: #0A1632;--ag-header-foreground-color: #74FAFB;--ag-header-background-color: #0A1632;--ag-odd-row-background-color: #0A1632;--ag-header-column-resize-handle-color: #7e2e84;--ag-font-size: 17px;--ag-font-family: monospace;height:5rem}.centered-element[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%}.status-container[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.5rem}.status-circle[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%}.status-circle.red[_ngcontent-%COMP%]{background-color:red}.status-circle.green[_ngcontent-%COMP%]{background-color:green}.progress-container[_ngcontent-%COMP%]{display:flex;color:#fff}.progress-container[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%]{width:8rem;margin-left:6px;font-size:16px;font-weight:600;color:#74fafb}.progress-container[_ngcontent-%COMP%] .status-ext-text[_ngcontent-%COMP%]{margin-top:3px;font-size:12px}.progress-display[_ngcontent-%COMP%]{color:#fff;text-align:right}.statistic-item-container[_ngcontent-%COMP%]{display:flex;padding:1rem 0;color:#fff}.white-color-theme[_ngcontent-%COMP%]{color:#74fafb}.scrollable-container[_ngcontent-%COMP%]{scrollbar-color:auto;overflow-y:auto;width:100%;height:20rem} ::-webkit-scrollbar{width:10px} ::-webkit-scrollbar-track{background-color:#0a1632} ::-webkit-scrollbar-thumb{background-color:#74fafb;border-radius:2px} ::-webkit-scrollbar-thumb:hover{background-color:#74fafb}"]});let r=e;return r})();function W1e(r,e){if(r&1&&(tr(0,"li")(1,"a",2),Pi(2),lr()()),r&2){let t=e.$implicit;Ot(),Rt("routerLink",t.link),Ot(),Ec(t.text)}}function X1e(r,e){if(r&1&&(tr(0,"div")(1,"ul"),br(2,W1e,3,2,"li",1),lr()()),r&2){let t=Lr();Ot(2),Rt("ngForOf",t.children)}}var S$=(()=>{let e=class e{constructor(i,n){this.route=i,this.router=n,this.menu=null,this.children=null}ngOnInit(){let i=this.router.getCurrentNavigation();i?.extras.state&&(this.menu=i.extras.state.menu,this.children=this.menu?.children||null,console.log("\u7A7F\u5E26\u8FC7\u6765\u7684\u83DC\u5355\u53C2\u6570"),console.log(this.menu),console.log(this.children))}navigateToChild(i){i.link&&this.router.navigateByUrl(i.link)}};e.\u0275fac=function(n){return new(n||e)(uo(yV),uo(_V))},e.\u0275cmp=si({type:e,selectors:[["app-data-v-s1"]],standalone:!0,features:[ui],decls:1,vars:1,consts:[[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"routerLink"]],template:function(n,a){n&1&&br(0,X1e,3,1,"div",0),n&2&&Rt("ngIf",a.children&&a.children.length)},dependencies:[XM,R0,bl,jM,rf,NE,Dc,Ic,xV,Kc,Wc,$c,Qc,Jc,Zc,Pc,Vc,Hc,nf,qc,Xc,Tl,Cc,Bc,kc,ef,Fc,El,Yc,Oc,Gc,zc,tf,Lc,Rc,jc,Uc,Ac,Nc,wl],styles:[".dashboard-container[_ngcontent-%COMP%]{width:20rem;height:10rem;margin-top:-3rem;margin-bottom:-2rem}.sys-status-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:#94ddf3;text-align:center}.ag-theme-datav[_ngcontent-%COMP%]{--ag-border-color: #74FAFB;--ag-foreground-color: #74FAFB;--ag-background-color: #0A1632;--ag-header-foreground-color: #74FAFB;--ag-header-background-color: #0A1632;--ag-odd-row-background-color: #0A1632;--ag-header-column-resize-handle-color: #7e2e84;--ag-font-size: 17px;--ag-font-family: monospace;height:5rem}.scrollable-container[_ngcontent-%COMP%]{overflow-y:auto;width:100%;height:20rem}.centered-element[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%}.status-container[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.5rem}.status-circle[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%}.status-circle.red[_ngcontent-%COMP%]{background-color:red}.status-circle.green[_ngcontent-%COMP%]{background-color:green}.progress-container[_ngcontent-%COMP%]{display:flex;color:#fff}.progress-container[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%]{width:8rem;margin-left:6px;font-size:16px;font-weight:600;color:#74fafb}.progress-container[_ngcontent-%COMP%] .status-ext-text[_ngcontent-%COMP%]{margin-top:3px;font-size:12px}.progress-display[_ngcontent-%COMP%]{color:#fff;text-align:right}.statistic-item-container[_ngcontent-%COMP%]{display:flex;padding:1rem 0;color:#fff}.white-color-theme[_ngcontent-%COMP%]{color:#74fafb}"]});let r=e;return r})();var rS="162";var M$=0,X3=1,b$=2;var UE=1,w$=2,nl=3,Ao=0,_i=1,Co=2,ms=0,Yu=1,Y3=2,q3=3,Z3=4,T$=5,qu=100,E$=101,A$=102,j3=103,K3=104,C$=200,R$=201,L$=202,P$=203,iS=204,nS=205,D$=206,I$=207,N$=208,U$=209,O$=210,F$=211,z$=212,B$=213,k$=214,V$=0,G$=1,H$=2,lg=3,W$=4,X$=5,Y$=6,q$=7,OE=0,Z$=1,j$=2,vs=0,K$=1,J$=2,$$=3,Q$=4,eQ=5,tQ=6,rQ=7;var J3=300,al=301,tu=302,aS=303,oS=304,oh=306,sS=1e3,ma=1001,lS=1002,ki=1003,$3=1004;var ug=1005;var Qi=1006,FE=1007;var ol=1008;var Ro=1009,iQ=1010,nQ=1011,cg=1012,zE=1013,Lo=1014,Ya=1015,Zu=1016,BE=1017,kE=1018,gs=1020,aQ=1021,Rn=1023,oQ=1024,sQ=1025,sl=1026,ru=1027,lQ=1028,VE=1029,uQ=1030,GE=1031,HE=1033,WE=33776,XE=33777,YE=33778,qE=33779,Q3=35840,eF=35841,tF=35842,rF=35843,ZE=36196,iF=37492,nF=37496,aF=37808,oF=37809,sF=37810,lF=37811,uF=37812,cF=37813,fF=37814,hF=37815,pF=37816,dF=37817,mF=37818,vF=37819,gF=37820,yF=37821,jE=36492,_F=36494,xF=36495,cQ=36283,SF=36284,MF=36285,bF=36286;var fQ=3200,hQ=3201,pQ=0,dQ=1,ys="",qa="srgb",Za="srgb-linear",fg="display-p3",dd="display-p3-linear",hg="linear",Hr="srgb",pg="rec709",dg="p3";var md=7680;var wF=519,mQ=512,vQ=513,gQ=514,KE=515,yQ=516,_Q=517,xQ=518,SQ=519,TF=35044;var EF="300 es",uS=1035,ja=2e3,vd=2001;var Ka=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let n=i.slice(0);for(let a=0,o=n.length;a>8&255]+Yn[r>>16&255]+Yn[r>>24&255]+"-"+Yn[e&255]+Yn[e>>8&255]+"-"+Yn[e>>16&15|64]+Yn[e>>24&255]+"-"+Yn[t&63|128]+Yn[t>>8&255]+"-"+Yn[t>>16&255]+Yn[t>>24&255]+Yn[i&255]+Yn[i>>8&255]+Yn[i>>16&255]+Yn[i>>24&255]).toLowerCase()}function en(r,e,t){return Math.max(e,Math.min(t,r))}function MQ(r,e){return(r%e+e)%e}function $E(r,e,t){return(1-t)*r+t*e}function AF(r){return(r&r-1)===0&&r!==0}function fS(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function mg(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function va(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var Kt=class r{constructor(e=0,t=0){r.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(en(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),a=this.x-e.x,o=this.y-e.y;return this.x=a*i-o*n+e.x,this.y=a*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};var $t=class r{constructor(e,t,i,n,a,o,s,l,u){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u)}set(e,t,i,n,a,o,s,l,u){let c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=a,c[5]=l,c[6]=i,c[7]=o,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[3],l=i[6],u=i[1],c=i[4],f=i[7],h=i[2],p=i[5],d=i[8],g=n[0],m=n[3],v=n[6],_=n[1],y=n[4],x=n[7],M=n[2],S=n[5],w=n[8];return a[0]=o*g+s*_+l*M,a[3]=o*m+s*y+l*S,a[6]=o*v+s*x+l*w,a[1]=u*g+c*_+f*M,a[4]=u*m+c*y+f*S,a[7]=u*v+c*x+f*w,a[2]=h*g+p*_+d*M,a[5]=h*m+p*y+d*S,a[8]=h*v+p*x+d*w,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t*o*c-t*s*u-i*a*c+i*s*l+n*a*u-n*o*l}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=c*o-s*u,h=s*l-c*a,p=u*a-o*l,d=t*f+i*h+n*p;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/d;return e[0]=f*g,e[1]=(n*u-c*i)*g,e[2]=(s*i-n*o)*g,e[3]=h*g,e[4]=(c*t-n*l)*g,e[5]=(n*a-s*t)*g,e[6]=p*g,e[7]=(i*l-u*t)*g,e[8]=(o*t-i*a)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,a,o,s){let l=Math.cos(a),u=Math.sin(a);return this.set(i*l,i*u,-i*(l*o+u*s)+o+e,-n*u,n*l,-n*(-u*o+l*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(CF.makeScale(e,t)),this}rotate(e){return this.premultiply(CF.makeRotation(-e)),this}translate(e,t){return this.premultiply(CF.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},CF=new $t;function QE(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function vg(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function wQ(){let r=vg("canvas");return r.style.display="block",r}var bQ={};function TQ(r){r in bQ||(bQ[r]=!0,console.warn(r))}var EQ=new $t().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),AQ=new $t().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),eA={[Za]:{transfer:hg,primaries:pg,toReference:r=>r,fromReference:r=>r},[qa]:{transfer:Hr,primaries:pg,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[dd]:{transfer:hg,primaries:dg,toReference:r=>r.applyMatrix3(AQ),fromReference:r=>r.applyMatrix3(EQ)},[fg]:{transfer:Hr,primaries:dg,toReference:r=>r.convertSRGBToLinear().applyMatrix3(AQ),fromReference:r=>r.applyMatrix3(EQ).convertLinearToSRGB()}},Y1e=new Set([Za,dd]),Er={enabled:!0,_workingColorSpace:Za,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Y1e.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;let i=eA[e].toReference,n=eA[t].fromReference;return n(i(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return eA[r].primaries},getTransfer:function(r){return r===ys?hg:eA[r].transfer}};function sh(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function tA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var gg,yg=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{gg===void 0&&(gg=vg("canvas")),gg.width=e.width,gg.height=e.height;let i=gg.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=gg}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=vg("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),a=n.data;for(let o=0;o{class r extends Ka{constructor(t=r.DEFAULT_IMAGE,i=r.DEFAULT_MAPPING,n=ma,a=ma,o=Qi,s=ol,l=Rn,u=Ro,c=r.DEFAULT_ANISOTROPY,f=ys){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Z1e++}),this.uuid=iu(),this.name="",this.source=new _g(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=n,this.wrapT=a,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=u,this.offset=new Kt(0,0),this.repeat=new Kt(1,1),this.center=new Kt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=f,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),i||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==J3)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case sS:t.x=t.x-Math.floor(t.x);break;case ma:t.x=t.x<0?0:1;break;case lS:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case sS:t.y=t.y-Math.floor(t.y);break;case ma:t.y=t.y<0?0:1;break;case lS:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}}return r.DEFAULT_IMAGE=null,r.DEFAULT_MAPPING=J3,r.DEFAULT_ANISOTROPY=1,r})();var ii=class r{constructor(e=0,t=0,i=0,n=1){r.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*a,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*a,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*a,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,a,l=e.elements,u=l[0],c=l[4],f=l[8],h=l[1],p=l[5],d=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(c-h)<.01&&Math.abs(f-g)<.01&&Math.abs(d-m)<.01){if(Math.abs(c+h)<.1&&Math.abs(f+g)<.1&&Math.abs(d+m)<.1&&Math.abs(u+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let y=(u+1)/2,x=(p+1)/2,M=(v+1)/2,S=(c+h)/4,w=(f+g)/4,T=(d+m)/4;return y>x&&y>M?y<.01?(i=0,n=.707106781,a=.707106781):(i=Math.sqrt(y),n=S/i,a=w/i):x>M?x<.01?(i=.707106781,n=0,a=.707106781):(n=Math.sqrt(x),i=S/n,a=T/n):M<.01?(i=.707106781,n=.707106781,a=0):(a=Math.sqrt(M),i=w/a,n=T/a),this.set(i,n,a,t),this}let _=Math.sqrt((m-d)*(m-d)+(f-g)*(f-g)+(h-c)*(h-c));return Math.abs(_)<.001&&(_=1),this.x=(m-d)/_,this.y=(f-g)/_,this.z=(h-c)/_,this.w=Math.acos((u+p+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};var rA=class extends Ka{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ii(0,0,e,t),this.scissorTest=!1,this.viewport=new ii(0,0,e,t);let n={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Qi,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let a=new Ja(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);a.flipY=!1,a.generateMipmaps=i.generateMipmaps,a.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let s=0;s=0?1:-1,y=1-v*v;if(y>Number.EPSILON){let M=Math.sqrt(y),S=Math.atan2(M,v*_);m=Math.sin(m*S)/M,s=Math.sin(s*S)/M}let x=s*_;if(l=l*m+h*x,u=u*m+p*x,c=c*m+d*x,f=f*m+g*x,m===1-s){let M=1/Math.sqrt(l*l+u*u+c*c+f*f);l*=M,u*=M,c*=M,f*=M}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,n,a,o){let s=i[n],l=i[n+1],u=i[n+2],c=i[n+3],f=a[o],h=a[o+1],p=a[o+2],d=a[o+3];return e[t]=s*d+c*f+l*p-u*h,e[t+1]=l*d+c*h+u*f-s*p,e[t+2]=u*d+c*p+s*h-l*f,e[t+3]=c*d-s*f-l*h-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let i=e._x,n=e._y,a=e._z,o=e._order,s=Math.cos,l=Math.sin,u=s(i/2),c=s(n/2),f=s(a/2),h=l(i/2),p=l(n/2),d=l(a/2);switch(o){case"XYZ":this._x=h*c*f+u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f-h*p*d;break;case"YXZ":this._x=h*c*f+u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f+h*p*d;break;case"ZXY":this._x=h*c*f-u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f-h*p*d;break;case"ZYX":this._x=h*c*f-u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f+h*p*d;break;case"YZX":this._x=h*c*f+u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f-h*p*d;break;case"XZY":this._x=h*c*f-u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],a=t[8],o=t[1],s=t[5],l=t[9],u=t[2],c=t[6],f=t[10],h=i+s+f;if(h>0){let p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(c-l)*p,this._y=(a-u)*p,this._z=(o-n)*p}else if(i>s&&i>f){let p=2*Math.sqrt(1+i-s-f);this._w=(c-l)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(a+u)/p}else if(s>f){let p=2*Math.sqrt(1+s-i-f);this._w=(a-u)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(l+c)/p}else{let p=2*Math.sqrt(1+f-i-s);this._w=(o-n)/p,this._x=(a+u)/p,this._y=(l+c)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(en(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,a=e._z,o=e._w,s=t._x,l=t._y,u=t._z,c=t._w;return this._x=i*c+o*s+n*u-a*l,this._y=n*c+o*l+a*s-i*u,this._z=a*c+o*u+i*l-n*s,this._w=o*c-i*s-n*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,n=this._y,a=this._z,o=this._w,s=o*e._w+i*e._x+n*e._y+a*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=n,this._z=a,this;let l=1-s*s;if(l<=Number.EPSILON){let p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*a+t*this._z,this.normalize(),this}let u=Math.sqrt(l),c=Math.atan2(u,s),f=Math.sin((1-t)*c)/u,h=Math.sin(t*c)/u;return this._w=o*f+this._w*h,this._x=i*f+this._x*h,this._y=n*f+this._y*h,this._z=a*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};var be=class r{constructor(e=0,t=0,i=0){r.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(CQ.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(CQ.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*n,this.y=a[1]*t+a[4]*i+a[7]*n,this.z=a[2]*t+a[5]*i+a[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=e.elements,o=1/(a[3]*t+a[7]*i+a[11]*n+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*n+a[12])*o,this.y=(a[1]*t+a[5]*i+a[9]*n+a[13])*o,this.z=(a[2]*t+a[6]*i+a[10]*n+a[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,a=e.x,o=e.y,s=e.z,l=e.w,u=2*(o*n-s*i),c=2*(s*t-a*n),f=2*(a*i-o*t);return this.x=t+l*u+o*f-s*c,this.y=i+l*c+s*u-a*f,this.z=n+l*f+a*c-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n,this.y=a[1]*t+a[5]*i+a[9]*n,this.z=a[2]*t+a[6]*i+a[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,a=e.z,o=t.x,s=t.y,l=t.z;return this.x=n*l-a*s,this.y=a*o-i*l,this.z=i*s-n*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return LF.copy(this).projectOnVector(e),this.sub(LF)}reflect(e){return this.sub(LF.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(en(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},LF=new be,CQ=new au;var Ku=class{constructor(e=new be(1/0,1/0,1/0),t=new be(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}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&&this.min.z<=e.min.z&&e.max.z<=this.max.z}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),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ll),ll.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(hS),aA.subVectors(this.max,hS),Sg.subVectors(e.a,hS),Mg.subVectors(e.b,hS),bg.subVectors(e.c,hS),lh.subVectors(Mg,Sg),uh.subVectors(bg,Mg),gd.subVectors(Sg,bg);let t=[0,-lh.z,lh.y,0,-uh.z,uh.y,0,-gd.z,gd.y,lh.z,0,-lh.x,uh.z,0,-uh.x,gd.z,0,-gd.x,-lh.y,lh.x,0,-uh.y,uh.x,0,-gd.y,gd.x,0];return!PF(t,Sg,Mg,bg,aA)||(t=[1,0,0,0,1,0,0,0,1],!PF(t,Sg,Mg,bg,aA))?!1:(oA.crossVectors(lh,uh),t=[oA.x,oA.y,oA.z],PF(t,Sg,Mg,bg,aA))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ll).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ll).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ju[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ju[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ju[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ju[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ju[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ju[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ju[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ju[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ju),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)}},ju=[new be,new be,new be,new be,new be,new be,new be,new be],ll=new be,nA=new Ku,Sg=new be,Mg=new be,bg=new be,lh=new be,uh=new be,gd=new be,hS=new be,aA=new be,oA=new be,yd=new be;function PF(r,e,t,i,n){for(let a=0,o=r.length-3;a<=o;a+=3){yd.fromArray(r,a);let s=n.x*Math.abs(yd.x)+n.y*Math.abs(yd.y)+n.z*Math.abs(yd.z),l=e.dot(yd),u=t.dot(yd),c=i.dot(yd);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var j1e=new Ku,pS=new be,DF=new be,ch=class{constructor(e=new be,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):j1e.setFromPoints(e).getCenter(i);let n=0;for(let a=0,o=e.length;athis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;pS.subVectors(e,this.center);let t=pS.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector(pS,n/i),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(DF.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(pS.copy(e.center).add(DF)),this.expandByPoint(pS.copy(e.center).sub(DF))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};var Ju=new be,IF=new be,sA=new be,fh=new be,NF=new be,lA=new be,UF=new be,uA=class{constructor(e=new be,t=new be(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ju)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Ju.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ju.copy(this.origin).addScaledVector(this.direction,t),Ju.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){IF.copy(e).add(t).multiplyScalar(.5),sA.copy(t).sub(e).normalize(),fh.copy(this.origin).sub(IF);let a=e.distanceTo(t)*.5,o=-this.direction.dot(sA),s=fh.dot(this.direction),l=-fh.dot(sA),u=fh.lengthSq(),c=Math.abs(1-o*o),f,h,p,d;if(c>0)if(f=o*l-s,h=o*s-l,d=a*c,f>=0)if(h>=-d)if(h<=d){let g=1/c;f*=g,h*=g,p=f*(f+o*h+2*s)+h*(o*f+h+2*l)+u}else h=a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;else h=-a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;else h<=-d?(f=Math.max(0,-(-o*a+s)),h=f>0?-a:Math.min(Math.max(-a,-l),a),p=-f*f+h*(h+2*l)+u):h<=d?(f=0,h=Math.min(Math.max(-a,-l),a),p=h*(h+2*l)+u):(f=Math.max(0,-(o*a+s)),h=f>0?a:Math.min(Math.max(-a,-l),a),p=-f*f+h*(h+2*l)+u);else h=o>0?-a:a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,f),n&&n.copy(IF).addScaledVector(sA,h),p}intersectSphere(e,t){Ju.subVectors(e.center,this.origin);let i=Ju.dot(this.direction),n=Ju.dot(Ju)-i*i,a=e.radius*e.radius;if(n>a)return null;let o=Math.sqrt(a-n),s=i-o,l=i+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,a,o,s,l,u=1/this.direction.x,c=1/this.direction.y,f=1/this.direction.z,h=this.origin;return u>=0?(i=(e.min.x-h.x)*u,n=(e.max.x-h.x)*u):(i=(e.max.x-h.x)*u,n=(e.min.x-h.x)*u),c>=0?(a=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(a=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),i>o||a>n||((a>i||isNaN(i))&&(i=a),(o=0?(s=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(s=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||s>n)||((s>i||i!==i)&&(i=s),(l=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,Ju)!==null}intersectTriangle(e,t,i,n,a){NF.subVectors(t,e),lA.subVectors(i,e),UF.crossVectors(NF,lA);let o=this.direction.dot(UF),s;if(o>0){if(n)return null;s=1}else if(o<0)s=-1,o=-o;else return null;fh.subVectors(this.origin,e);let l=s*this.direction.dot(lA.crossVectors(fh,lA));if(l<0)return null;let u=s*this.direction.dot(NF.cross(fh));if(u<0||l+u>o)return null;let c=-s*fh.dot(UF);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};var Wr=class r{constructor(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m)}set(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m){let v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=a,v[5]=o,v[9]=s,v[13]=l,v[2]=u,v[6]=c,v[10]=f,v[14]=h,v[3]=p,v[7]=d,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/wg.setFromMatrixColumn(e,0).length(),a=1/wg.setFromMatrixColumn(e,1).length(),o=1/wg.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,a=e.z,o=Math.cos(i),s=Math.sin(i),l=Math.cos(n),u=Math.sin(n),c=Math.cos(a),f=Math.sin(a);if(e.order==="XYZ"){let h=o*c,p=o*f,d=s*c,g=s*f;t[0]=l*c,t[4]=-l*f,t[8]=u,t[1]=p+d*u,t[5]=h-g*u,t[9]=-s*l,t[2]=g-h*u,t[6]=d+p*u,t[10]=o*l}else if(e.order==="YXZ"){let h=l*c,p=l*f,d=u*c,g=u*f;t[0]=h+g*s,t[4]=d*s-p,t[8]=o*u,t[1]=o*f,t[5]=o*c,t[9]=-s,t[2]=p*s-d,t[6]=g+h*s,t[10]=o*l}else if(e.order==="ZXY"){let h=l*c,p=l*f,d=u*c,g=u*f;t[0]=h-g*s,t[4]=-o*f,t[8]=d+p*s,t[1]=p+d*s,t[5]=o*c,t[9]=g-h*s,t[2]=-o*u,t[6]=s,t[10]=o*l}else if(e.order==="ZYX"){let h=o*c,p=o*f,d=s*c,g=s*f;t[0]=l*c,t[4]=d*u-p,t[8]=h*u+g,t[1]=l*f,t[5]=g*u+h,t[9]=p*u-d,t[2]=-u,t[6]=s*l,t[10]=o*l}else if(e.order==="YZX"){let h=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=g-h*f,t[8]=d*f+p,t[1]=f,t[5]=o*c,t[9]=-s*c,t[2]=-u*c,t[6]=p*f+d,t[10]=h-g*f}else if(e.order==="XZY"){let h=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=-f,t[8]=u*c,t[1]=h*f+g,t[5]=o*c,t[9]=p*f-d,t[2]=d*f-p,t[6]=s*c,t[10]=g*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(K1e,e,J1e)}lookAt(e,t,i){let n=this.elements;return Po.subVectors(e,t),Po.lengthSq()===0&&(Po.z=1),Po.normalize(),hh.crossVectors(i,Po),hh.lengthSq()===0&&(Math.abs(i.z)===1?Po.x+=1e-4:Po.z+=1e-4,Po.normalize(),hh.crossVectors(i,Po)),hh.normalize(),cA.crossVectors(Po,hh),n[0]=hh.x,n[4]=cA.x,n[8]=Po.x,n[1]=hh.y,n[5]=cA.y,n[9]=Po.y,n[2]=hh.z,n[6]=cA.z,n[10]=Po.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[4],l=i[8],u=i[12],c=i[1],f=i[5],h=i[9],p=i[13],d=i[2],g=i[6],m=i[10],v=i[14],_=i[3],y=i[7],x=i[11],M=i[15],S=n[0],w=n[4],T=n[8],C=n[12],b=n[1],E=n[5],I=n[9],R=n[13],A=n[2],D=n[6],U=n[10],B=n[14],F=n[3],k=n[7],G=n[11],Y=n[15];return a[0]=o*S+s*b+l*A+u*F,a[4]=o*w+s*E+l*D+u*k,a[8]=o*T+s*I+l*U+u*G,a[12]=o*C+s*R+l*B+u*Y,a[1]=c*S+f*b+h*A+p*F,a[5]=c*w+f*E+h*D+p*k,a[9]=c*T+f*I+h*U+p*G,a[13]=c*C+f*R+h*B+p*Y,a[2]=d*S+g*b+m*A+v*F,a[6]=d*w+g*E+m*D+v*k,a[10]=d*T+g*I+m*U+v*G,a[14]=d*C+g*R+m*B+v*Y,a[3]=_*S+y*b+x*A+M*F,a[7]=_*w+y*E+x*D+M*k,a[11]=_*T+y*I+x*U+M*G,a[15]=_*C+y*R+x*B+M*Y,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],a=e[12],o=e[1],s=e[5],l=e[9],u=e[13],c=e[2],f=e[6],h=e[10],p=e[14],d=e[3],g=e[7],m=e[11],v=e[15];return d*(+a*l*f-n*u*f-a*s*h+i*u*h+n*s*p-i*l*p)+g*(+t*l*p-t*u*h+a*o*h-n*o*p+n*u*c-a*l*c)+m*(+t*u*f-t*s*p-a*o*f+i*o*p+a*s*c-i*u*c)+v*(-n*s*c-t*l*f+t*s*h+n*o*f-i*o*h+i*l*c)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],_=f*m*u-g*h*u+g*l*p-s*m*p-f*l*v+s*h*v,y=d*h*u-c*m*u-d*l*p+o*m*p+c*l*v-o*h*v,x=c*g*u-d*f*u+d*s*p-o*g*p-c*s*v+o*f*v,M=d*f*l-c*g*l-d*s*h+o*g*h+c*s*m-o*f*m,S=t*_+i*y+n*x+a*M;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/S;return e[0]=_*w,e[1]=(g*h*a-f*m*a-g*n*p+i*m*p+f*n*v-i*h*v)*w,e[2]=(s*m*a-g*l*a+g*n*u-i*m*u-s*n*v+i*l*v)*w,e[3]=(f*l*a-s*h*a-f*n*u+i*h*u+s*n*p-i*l*p)*w,e[4]=y*w,e[5]=(c*m*a-d*h*a+d*n*p-t*m*p-c*n*v+t*h*v)*w,e[6]=(d*l*a-o*m*a-d*n*u+t*m*u+o*n*v-t*l*v)*w,e[7]=(o*h*a-c*l*a+c*n*u-t*h*u-o*n*p+t*l*p)*w,e[8]=x*w,e[9]=(d*f*a-c*g*a-d*i*p+t*g*p+c*i*v-t*f*v)*w,e[10]=(o*g*a-d*s*a+d*i*u-t*g*u-o*i*v+t*s*v)*w,e[11]=(c*s*a-o*f*a-c*i*u+t*f*u+o*i*p-t*s*p)*w,e[12]=M*w,e[13]=(c*g*n-d*f*n+d*i*h-t*g*h-c*i*m+t*f*m)*w,e[14]=(d*s*n-o*g*n-d*i*l+t*g*l+o*i*m-t*s*m)*w,e[15]=(o*f*n-c*s*n+c*i*l-t*f*l-o*i*h+t*s*h)*w,this}scale(e){let t=this.elements,i=e.x,n=e.y,a=e.z;return t[0]*=i,t[4]*=n,t[8]*=a,t[1]*=i,t[5]*=n,t[9]*=a,t[2]*=i,t[6]*=n,t[10]*=a,t[3]*=i,t[7]*=n,t[11]*=a,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),a=1-i,o=e.x,s=e.y,l=e.z,u=a*o,c=a*s;return this.set(u*o+i,u*s-n*l,u*l+n*s,0,u*s+n*l,c*s+i,c*l-n*o,0,u*l-n*s,c*l+n*o,a*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,a,o){return this.set(1,i,a,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,a=t._x,o=t._y,s=t._z,l=t._w,u=a+a,c=o+o,f=s+s,h=a*u,p=a*c,d=a*f,g=o*c,m=o*f,v=s*f,_=l*u,y=l*c,x=l*f,M=i.x,S=i.y,w=i.z;return n[0]=(1-(g+v))*M,n[1]=(p+x)*M,n[2]=(d-y)*M,n[3]=0,n[4]=(p-x)*S,n[5]=(1-(h+v))*S,n[6]=(m+_)*S,n[7]=0,n[8]=(d+y)*w,n[9]=(m-_)*w,n[10]=(1-(h+g))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,a=wg.set(n[0],n[1],n[2]).length(),o=wg.set(n[4],n[5],n[6]).length(),s=wg.set(n[8],n[9],n[10]).length();this.determinant()<0&&(a=-a),e.x=n[12],e.y=n[13],e.z=n[14],ul.copy(this);let u=1/a,c=1/o,f=1/s;return ul.elements[0]*=u,ul.elements[1]*=u,ul.elements[2]*=u,ul.elements[4]*=c,ul.elements[5]*=c,ul.elements[6]*=c,ul.elements[8]*=f,ul.elements[9]*=f,ul.elements[10]*=f,t.setFromRotationMatrix(ul),i.x=a,i.y=o,i.z=s,this}makePerspective(e,t,i,n,a,o,s=ja){let l=this.elements,u=2*a/(t-e),c=2*a/(i-n),f=(t+e)/(t-e),h=(i+n)/(i-n),p,d;if(s===ja)p=-(o+a)/(o-a),d=-2*o*a/(o-a);else if(s===vd)p=-o/(o-a),d=-o*a/(o-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=u,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=c,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=d,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,a,o,s=ja){let l=this.elements,u=1/(t-e),c=1/(i-n),f=1/(o-a),h=(t+e)*u,p=(i+n)*c,d,g;if(s===ja)d=(o+a)*f,g=-2*f;else if(s===vd)d=a*f,g=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=g,l[14]=-d,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},wg=new be,ul=new Wr,K1e=new be(0,0,0),J1e=new be(1,1,1),hh=new be,cA=new be,Po=new be;var RQ=new Wr,LQ=new au,cl=(()=>{class r{constructor(t=0,i=0,n=0,a=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=a}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,n,a=this._order){return this._x=t,this._y=i,this._z=n,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,n=!0){let a=t.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],f=a[9],h=a[2],p=a[6],d=a[10];switch(i){case"XYZ":this._y=Math.asin(en(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,d),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-en(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(l,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(en(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-en(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(en(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(l,d));break;case"XZY":this._z=Math.asin(-en(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-f,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,n){return RQ.makeRotationFromQuaternion(t),this.setFromRotationMatrix(RQ,i,n)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return LQ.setFromEuler(this),this.setFromQuaternion(LQ,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return r.DEFAULT_ORDER="XYZ",r})();var Tg=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<{class r extends Ka{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:$1e++}),this.uuid=iu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new be,i=new cl,n=new au,a=new be(1,1,1);function o(){n.setFromEuler(i,!1)}function s(){i.setFromQuaternion(n,void 0,!1)}i._onChange(o),n._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new Wr},normalMatrix:{value:new $t}}),this.matrix=new Wr,this.matrixWorld=new Wr,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Tg,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Eg.setFromAxisAngle(t,i),this.quaternion.multiply(Eg),this}rotateOnWorldAxis(t,i){return Eg.setFromAxisAngle(t,i),this.quaternion.premultiply(Eg),this}rotateX(t){return this.rotateOnAxis(DQ,t)}rotateY(t){return this.rotateOnAxis(IQ,t)}rotateZ(t){return this.rotateOnAxis(NQ,t)}translateOnAxis(t,i){return PQ.copy(t).applyQuaternion(this.quaternion),this.position.add(PQ.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(DQ,t)}translateY(t){return this.translateOnAxis(IQ,t)}translateZ(t){return this.translateOnAxis(NQ,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4($u.copy(this.matrixWorld).invert())}lookAt(t,i,n){t.isVector3?fA.copy(t):fA.set(t,i,n);let a=this.parent;this.updateWorldMatrix(!0,!1),dS.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?$u.lookAt(dS,fA,this.up):$u.lookAt(fA,dS,this.up),this.quaternion.setFromRotationMatrix($u),a&&($u.extractRotation(a.matrixWorld),Eg.setFromRotationMatrix($u),this.quaternion.premultiply(Eg.invert()))}add(t){if(arguments.length>1){for(let i=0;i1){for(let n=0;n0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.visibility=this._visibility,a.active=this._active,a.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),a.maxGeometryCount=this._maxGeometryCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.geometryCount=this._geometryCount,a.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(a.boundingSphere={center:a.boundingSphere.center.toArray(),radius:a.boundingSphere.radius}),this.boundingBox!==null&&(a.boundingBox={min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}));function o(l,u){return l[u.uuid]===void 0&&(l[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=o(t.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let u=l.shapes;if(Array.isArray(u))for(let c=0,f=u.length;c0){a.children=[];for(let l=0;l0){a.animations=[];for(let l=0;l0&&(n.geometries=l),u.length>0&&(n.materials=u),c.length>0&&(n.textures=c),f.length>0&&(n.images=f),h.length>0&&(n.shapes=h),p.length>0&&(n.skeletons=p),d.length>0&&(n.animations=d),g.length>0&&(n.nodes=g)}return n.object=a,n;function s(l){let u=[];for(let c in l){let f=l[c];delete f.metadata,u.push(f)}return u}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let n=0;n0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(e,t,i,n,a){fl.subVectors(n,t),Qu.subVectors(i,t),zF.subVectors(e,t);let o=fl.dot(fl),s=fl.dot(Qu),l=fl.dot(zF),u=Qu.dot(Qu),c=Qu.dot(zF),f=o*u-s*s;if(f===0)return a.set(0,0,0),null;let h=1/f,p=(u*l-s*c)*h,d=(o*c-s*l)*h;return a.set(1-p-d,d,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,ec)===null?!1:ec.x>=0&&ec.y>=0&&ec.x+ec.y<=1}static getInterpolation(e,t,i,n,a,o,s,l){return this.getBarycoord(e,t,i,n,ec)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,ec.x),l.addScaledVector(o,ec.y),l.addScaledVector(s,ec.z),l)}static isFrontFacing(e,t,i,n){return fl.subVectors(i,t),Qu.subVectors(e,t),fl.cross(Qu).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return fl.subVectors(this.c,this.b),Qu.subVectors(this.a,this.b),fl.cross(Qu).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return r.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return r.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,a){return r.getInterpolation(e,this.a,this.b,this.c,t,i,n,a)}containsPoint(e){return r.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return r.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,n=this.b,a=this.c,o,s;Ag.subVectors(n,i),Cg.subVectors(a,i),BF.subVectors(e,i);let l=Ag.dot(BF),u=Cg.dot(BF);if(l<=0&&u<=0)return t.copy(i);kF.subVectors(e,n);let c=Ag.dot(kF),f=Cg.dot(kF);if(c>=0&&f<=c)return t.copy(n);let h=l*f-c*u;if(h<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(i).addScaledVector(Ag,o);VF.subVectors(e,a);let p=Ag.dot(VF),d=Cg.dot(VF);if(d>=0&&p<=d)return t.copy(a);let g=p*u-l*d;if(g<=0&&u>=0&&d<=0)return s=u/(u-d),t.copy(i).addScaledVector(Cg,s);let m=c*d-p*f;if(m<=0&&f-c>=0&&p-d>=0)return UQ.subVectors(a,n),s=(f-c)/(f-c+(p-d)),t.copy(n).addScaledVector(UQ,s);let v=1/(m+g+h);return o=g*v,s=h*v,t.copy(i).addScaledVector(Ag,o).addScaledVector(Cg,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};var OQ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ph={h:0,s:0,l:0},hA={h:0,s:0,l:0};function GF(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}var ir=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=qa){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Er.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=Er.workingColorSpace){return this.r=e,this.g=t,this.b=i,Er.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=Er.workingColorSpace){if(e=MQ(e,1),t=en(t,0,1),i=en(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,o=2*i-a;this.r=GF(o,a,e+1/3),this.g=GF(o,a,e),this.b=GF(o,a,e-1/3)}return Er.toWorkingColorSpace(this,n),this}setStyle(e,t=qa){function i(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let a,o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=n[1],o=a.length;if(o===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=qa){let i=OQ[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=sh(e.r),this.g=sh(e.g),this.b=sh(e.b),this}copyLinearToSRGB(e){return this.r=tA(e.r),this.g=tA(e.g),this.b=tA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=qa){return Er.fromWorkingColorSpace(qn.copy(this),e),Math.round(en(qn.r*255,0,255))*65536+Math.round(en(qn.g*255,0,255))*256+Math.round(en(qn.b*255,0,255))}getHexString(e=qa){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Er.workingColorSpace){Er.fromWorkingColorSpace(qn.copy(this),t);let i=qn.r,n=qn.g,a=qn.b,o=Math.max(i,n,a),s=Math.min(i,n,a),l,u,c=(s+o)/2;if(s===o)l=0,u=0;else{let f=o-s;switch(u=c<=.5?f/(o+s):f/(2-o-s),o){case i:l=(n-a)/f+(n0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let n=this[t];if(n===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Yu&&(i.blending=this.blending),this.side!==Ao&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==iS&&(i.blendSrc=this.blendSrc),this.blendDst!==nS&&(i.blendDst=this.blendDst),this.blendEquation!==qu&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==lg&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==wF&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==md&&(i.stencilFail=this.stencilFail),this.stencilZFail!==md&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==md&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function n(a){let o=[];for(let s in a){let l=a[s];delete l.metadata,o.push(l)}return o}if(t){let a=n(e.textures),o=n(e.images);a.length>0&&(i.textures=a),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let n=t.length;i=new Array(n);for(let a=0;a!==n;++a)i[a]=t[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};var tc=class extends ou{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ir(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cl,this.combine=OE,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}};var Vi=new be,pA=new Kt,ga=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=TF,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ya,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return TQ("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,a=this.itemSize;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let l in i){let u=i[l];e.data.attributes[l]=u.toJSON(e.data)}let n={},a=!1;for(let l in this.morphAttributes){let u=this.morphAttributes[l],c=[];for(let f=0,h=u.length;f0&&(n[l]=c,a=!0)}a&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let n=e.attributes;for(let u in n){let c=n[u];this.setAttribute(u,c.clone(t))}let a=e.morphAttributes;for(let u in a){let c=[],f=a[u];for(let h=0,p=f.length;h0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a(e.far-e.near)**2))&&(FQ.copy(a).invert(),xd.copy(e.ray).applyMatrix4(FQ),!(i.boundingBox!==null&&xd.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,xd)))}_computeIntersections(e,t,i){let n,a=this.geometry,o=this.material,s=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,f=a.attributes.normal,h=a.groups,p=a.drawRange;if(s!==null)if(Array.isArray(o))for(let d=0,g=h.length;dt.far?null:{distance:u,point:xA.clone(),object:r}}function SA(r,e,t,i,n,a,o,s,l,u){r.getVertexPosition(s,Dg),r.getVertexPosition(l,Ig),r.getVertexPosition(u,Ng);let c=aTe(r,e,t,i,Dg,Ig,Ng,_A);if(c){n&&(vA.fromBufferAttribute(n,s),gA.fromBufferAttribute(n,l),yA.fromBufferAttribute(n,u),c.uv=_d.getInterpolation(_A,Dg,Ig,Ng,vA,gA,yA,new Kt)),a&&(vA.fromBufferAttribute(a,s),gA.fromBufferAttribute(a,l),yA.fromBufferAttribute(a,u),c.uv1=_d.getInterpolation(_A,Dg,Ig,Ng,vA,gA,yA,new Kt)),o&&(BQ.fromBufferAttribute(o,s),kQ.fromBufferAttribute(o,l),VQ.fromBufferAttribute(o,u),c.normal=_d.getInterpolation(_A,Dg,Ig,Ng,BQ,kQ,VQ,new be),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let f={a:s,b:l,c:u,normal:new be,materialIndex:0};_d.getNormal(Dg,Ig,Ng,f.normal),c.face=f}return c}var dh=class r extends Qa{constructor(e=1,t=1,i=1,n=1,a=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:a,depthSegments:o};let s=this;n=Math.floor(n),a=Math.floor(a),o=Math.floor(o);let l=[],u=[],c=[],f=[],h=0,p=0;d("z","y","x",-1,-1,i,t,e,o,a,0),d("z","y","x",1,-1,i,t,-e,o,a,1),d("x","z","y",1,1,e,i,t,n,o,2),d("x","z","y",1,-1,e,i,-t,n,o,3),d("x","y","z",1,-1,e,t,i,n,a,4),d("x","y","z",-1,-1,e,t,-i,n,a,5),this.setIndex(l),this.setAttribute("position",new Zn(u,3)),this.setAttribute("normal",new Zn(c,3)),this.setAttribute("uv",new Zn(f,2));function d(g,m,v,_,y,x,M,S,w,T,C){let b=x/w,E=M/T,I=x/2,R=M/2,A=S/2,D=w+1,U=T+1,B=0,F=0,k=new be;for(let G=0;G0?1:-1,c.push(k.x,k.y,k.z),f.push(J/w),f.push(1-G/T),B+=1}}for(let G=0;G",v=f.join(m);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,p,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,v,u,Math.random()+"",o[0],o[1],p,null,h)})},e.prototype._showSeriesItemTooltip=function(t,i,n){var a=this._ecModel,o=rt(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,f=o.dataType,h=u.getData(f),p=this._renderMode,d=t.positionDefault,g=Gx([h.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),m=g.get("trigger");if(!(m!=null&&m!=="item")){var v=u.getDataParams(c,f),_=new jw;v.marker=_.makeTooltipMarker("item",Ws(v.color),p);var y=SD(u.formatTooltip(c,!1,f)),x=g.get("order"),M=g.get("valueFormatter"),S=y.frag,w=S?CD(M?fe({valueFormatter:M},S):S,_,p,x,a.get("useUTC"),g.get("textStyle")):y.text,T="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,w,v,T,t.offsetX,t.offsetY,t.position,t.target,_)}),n({type:"showTip",dataIndexInside:c,dataIndex:h.getRawIndex(c),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,i,n){var a=rt(i),o=a.tooltipConfig,s=o.option||{};if(Ce(s)){var l=s;s={content:l,formatter:l}}var u=[s],c=this._ecModel.getComponent(a.componentMainType,a.componentIndex);c&&u.push(c),u.push({formatter:s.content});var f=t.positionDefault,h=Gx(u,this._tooltipModel,f?{position:f}:null),p=h.get("content"),d=Math.random()+"",g=new jw;this._showOrMove(h,function(){var m=Qe(h.get("formatterParams")||{});this._showTooltipContent(h,p,m,d,t.offsetX,t.offsetY,t.position,i,g)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,i,n,a,o,s,l,u,c){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var f=this._tooltipContent;f.setEnterable(t.get("enterable"));var h=t.get("formatter");l=l||t.get("position");var p=i,d=this._getNearestPoint([o,s],n,t.get("trigger"),t.get("borderColor")),g=d.color;if(h)if(Ce(h)){var m=t.ecModel.get("useUTC"),v=pe(n)?n[0]:n,_=v&&v.axisType&&v.axisType.indexOf("time")>=0;p=h,_&&(p=Vp(v.axisValue,p,m)),p=Rw(p,n,!0)}else if(He(h)){var y=Be(function(x,M){x===this._ticket&&(f.setContent(M,c,t,g,l),this._updatePosition(t,l,o,s,f,n,u))},this);this._ticket=a,p=h(n,a,y)}else p=h;f.setContent(p,c,t,g,l),f.show(t,g),this._updatePosition(t,l,o,s,f,n,u)}},e.prototype._getNearestPoint=function(t,i,n,a){if(n==="axis"||pe(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!pe(i))return{color:a||i.color||i.borderColor}},e.prototype._updatePosition=function(t,i,n,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();i=i||t.get("position");var f=o.getSize(),h=t.get("align"),p=t.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),He(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,c],contentSize:f.slice()})),pe(i))n=ze(i[0],u),a=ze(i[1],c);else if(qe(i)){var g=i;g.width=f[0],g.height=f[1];var m=xr(g,{width:u,height:c});n=m.x,a=m.y,h=null,p=null}else if(Ce(i)&&l){var v=RMe(i,d,f,t.get("borderWidth"));n=v[0],a=v[1]}else{var v=AMe(n,a,o,u,c,h?null:20,p?null:20);n=v[0],a=v[1]}if(h&&(n-=sK(h)?f[0]/2:h==="right"?f[0]:0),p&&(a-=sK(p)?f[1]/2:p==="bottom"?f[1]:0),uE(t)){var v=CMe(n,a,o,u,c);n=v[0],a=v[1]}o.moveTo(n,a)},e.prototype._updateContentNotChangedOnAxis=function(t,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===t.length;return o&&N(n,function(s,l){var u=s.dataByAxis||[],c=t[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&N(u,function(h,p){var d=f[p]||{},g=h.seriesDataIndices||[],m=d.seriesDataIndices||[];o=o&&h.value===d.value&&h.axisType===d.axisType&&h.axisId===d.axisId&&g.length===m.length,o&&N(g,function(v,_){var y=m[_];o=o&&v.seriesIndex===y.seriesIndex&&v.dataIndex===y.dataIndex}),a&&N(h.seriesDataIndices,function(v){var _=v.seriesIndex,y=i[_],x=a[_];y&&x&&x.data!==y.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=i,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,i){zt.node||!i.getDom()||(zu(this,"_updatePosition"),this._tooltipContent.dispose(),Fx("itemTooltip",i))},e.type="tooltip",e}(er);function Gx(r,e,t){var i=e.ecModel,n;t?(n=new Zt(t,i,i),n=new Zt(e.option,n,i)):n=e;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof Zt&&(o=o.get("tooltip",!0)),Ce(o)&&(o={formatter:o}),o&&(n=new Zt(o,n,i)))}return n}function oK(r,e){return r.dispatchAction||Be(e.dispatchAction,e)}function AMe(r,e,t,i,n,a,o){var s=t.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>i?r-=l+a:r+=a),o!=null&&(e+u+o>n?e-=u+o:e+=o),[r,e]}function CMe(r,e,t,i,n){var a=t.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,i)-o,e=Math.min(e+s,n)-s,r=Math.max(r,0),e=Math.max(e,0),[r,e]}function RMe(r,e,t,i){var n=t[0],a=t[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,c=e.height;switch(r){case"inside":s=e.x+u/2-n/2,l=e.y+c/2-a/2;break;case"top":s=e.x+u/2-n/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-n/2,l=e.y+c+o;break;case"left":s=e.x-n-o,l=e.y+c/2-a/2;break;case"right":s=e.x+u+o,l=e.y+c/2-a/2}return[s,l]}function sK(r){return r==="center"||r==="middle"}function LMe(r,e,t){var i=a_(r).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=_f(e,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=t.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=rt(u).tooltipConfig;if(c&&c.name===r.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}var lK=EMe;function MO(r){It(nl),r.registerComponentModel(Kj),r.registerComponentView(lK),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Dr),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Dr)}var PMe=["rect","polygon","keep","clear"];function bO(r,e){var t=$t(r?r.brush:[]);if(t.length){var i=[];N(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(i=i.concat(u))});var n=r&&r.toolbox;pe(n)&&(n=n[0]),n||(n={feature:{}},r.toolbox=[n]);var a=n.feature||(n.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,i),DMe(s),e&&!s.length&&s.push.apply(s,PMe)}}function DMe(r){var e={};N(r,function(t){e[t]=1}),r.length=0,N(e,function(t,i){r.push(i)})}var uK=N;function cK(r){if(r){for(var e in r)if(r.hasOwnProperty(e))return!0}}function Hx(r,e,t){var i={};return uK(e,function(a){var o=i[a]=n();uK(r[a],function(s,l){if(pi.isValidType(l)){var u={type:l,visual:s};t&&t(u,a),o[l]=new pi(u),l==="opacity"&&(u=Qe(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new pi(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function cE(r,e,t){var i;N(t,function(n){e.hasOwnProperty(n)&&cK(e[n])&&(i=!0)}),i&&N(t,function(n){e.hasOwnProperty(n)&&cK(e[n])?r[n]=Qe(e[n]):delete r[n]})}function fK(r,e,t,i,n,a){var o={};N(r,function(f){var h=pi.prepareVisualTypes(e[f]);o[f]=h});var s;function l(f){return W_(t,s,f)}function u(f,h){UD(t,s,f,h)}a==null?t.each(c):t.each([a],c);function c(f,h){s=a==null?f:h;var p=t.getRawDataItem(s);if(!(p&&p.visualMap===!1))for(var d=i.call(n,f),g=e[d],m=o[d],v=0,_=m.length;v<_;v++){var y=m[v];g[y]&&g[y].applyVisual(f,l,u)}}}function hK(r,e,t,i){var n={};return N(r,function(a){var o=pi.prepareVisualTypes(e[a]);n[a]=o}),{progress:function(o,s){var l;i!=null&&(l=s.getDimensionIndex(i));function u(M){return W_(s,f,M)}function c(M,S){UD(s,f,M,S)}for(var f,h=s.getStore();(f=o.next())!=null;){var p=s.getRawDataItem(f);if(!(p&&p.visualMap===!1))for(var d=i!=null?h.get(l,f):f,g=t(d),m=e[g],v=n[g],_=0,y=v.length;_e[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&yK(e)}};function yK(r){return new lt(r[0][0],r[1][0],r[0][1]-r[0][0],r[1][1]-r[1][0])}var zMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){this.ecModel=t,this.api=i,this.model,(this._brushController=new Wv(i.getZr())).on("brush",Be(this._onBrush,this)).mount()},e.prototype.render=function(t,i,n,a){this.model=t,this._updateController(t,i,n,a)},e.prototype.updateTransform=function(t,i,n,a){EO(i),this._updateController(t,i,n,a)},e.prototype.updateVisual=function(t,i,n,a){this.updateTransform(t,i,n,a)},e.prototype.updateView=function(t,i,n,a){this._updateController(t,i,n,a)},e.prototype._updateController=function(t,i,n,a){(!a||a.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var i=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:Qe(n),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:Qe(n),$from:i})},e.type="brush",e}(er),_K=zMe;var FMe="#ddd",BMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,i){var n=this.option;!i&&cE(n,t,["inBrush","outOfBrush"]);var a=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:FMe},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=de(t,function(i){return xK(this.option,i)},this))},e.prototype.setBrushOption=function(t){this.brushOption=xK(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Pt);function xK(r,e){return _t({brushType:r.brushType,brushMode:r.brushMode,transformable:r.transformable,brushStyle:new Zt(r.brushStyle).getItemStyle(),removeOnClick:r.removeOnClick,z:r.z},e,!0)}var SK=BMe;var kMe=["rect","polygon","lineX","lineY","keep","clear"],VMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n){var a,o,s;i.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,N(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,i,n){this.render(t,i,n)},e.prototype.getIcons=function(){var t=this.model,i=t.get("icon",!0),n={};return N(t.get("type",!0),function(a){i[a]&&(n[a]=i[a])}),n},e.prototype.onclick=function(t,i,n){var a=this._brushType,o=this._brushMode;n==="clear"?(i.dispatchAction({type:"axisAreaSelect",intervals:[]}),i.dispatchAction({type:"brush",command:"clear",areas:[]})):i.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:n==="keep"?a:a===n?!1:n,brushMode:n==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(t){var i={show:!0,type:kMe.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return i},e}($i),MK=VMe;function CO(r){r.registerComponentView(_K),r.registerComponentModel(SK),r.registerPreprocessor(bO),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,AO),r.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(i){i.setAreas(e.areas)})}),r.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Dr),r.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Dr),th("brush",MK)}var GMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Pt),HMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){if(this.group.removeAll(),!!t.get("show")){var a=this.group,o=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=ft(t.get("textBaseline"),t.get("textVerticalAlign")),c=new Lt({style:fr(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=c.getBoundingRect(),h=t.get("subtext"),p=new Lt({style:fr(s,{text:h,fill:s.getTextColor(),y:f.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),g=t.get("sublink"),m=t.get("triggerEvent",!0);c.silent=!d&&!m,p.silent=!g&&!m,d&&c.on("click",function(){Gp(d,"_"+t.get("target"))}),g&&p.on("click",function(){Gp(g,"_"+t.get("subtarget"))}),rt(c).eventData=rt(p).eventData=m?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(c),h&&a.add(p);var v=a.getBoundingRect(),_=t.getBoxLayoutParams();_.width=v.width,_.height=v.height;var y=xr(_,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?y.x+=y.width:l==="center"&&(y.x+=y.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?y.y+=y.height:u==="middle"&&(y.y+=y.height/2),u=u||"top"),a.x=y.x,a.y=y.y,a.markRedraw();var x={align:l,verticalAlign:u};c.setStyle(x),p.setStyle(x),v=a.getBoundingRect();var M=y.margin,S=t.getItemStyle(["color","opacity"]);S.fill=t.get("backgroundColor");var w=new Et({shape:{x:v.x-M[3],y:v.y-M[0],width:v.width+M[1]+M[3],height:v.height+M[0]+M[2],r:t.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});a.add(w)}},e.type="title",e}(er);function RO(r){r.registerComponentModel(GMe),r.registerComponentView(HMe)}var WMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n),this._initData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var i=this._data.count();this.option.loop?t=(t%i+i)%i:(t>=i&&(t=i-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t=this.option,i=t.data||[],n=t.axisType,a=this._names=[],o;n==="category"?(o=[],N(i,function(u,c){var f=qr(zs(u),""),h;qe(u)?(h=Qe(u),h.value=c):h=c,o.push(h),a.push(f)})):o=i;var s={category:"ordinal",time:"time",value:"number"}[n]||"number",l=this._data=new ri([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Pt),LO=WMe;var bK=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=Hn(LO.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(LO);br(bK,dv.prototype);var wK=bK;var XMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(er),TK=XMe;var YMe=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this,t,i,n)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(pn),EK=YMe;var PO=Math.PI,AK=vt(),qMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){this.api=i},e.prototype.render=function(t,i,n){if(this.model=t,this.api=n,this.ecModel=i,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,n),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return Or("nameValue",{noName:!0,value:c})},N(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,t)},this),this._renderAxisLabel(a,s,l,t),this._position(a,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,i){var n=t.get(["label","position"]),a=t.get("orient"),o=jMe(t,i),s;n==null||n==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:PO/2},f=a==="vertical"?o.height:o.width,h=t.getModel("controlStyle"),p=h.get("show",!0),d=p?h.get("itemSize"):0,g=p?h.get("itemGap"):0,m=d+g,v=t.get(["label","rotate"])||0;v=v*PO/180;var _,y,x,M=h.get("position",!0),S=p&&h.get("showPlayBtn",!0),w=p&&h.get("showPrevBtn",!0),T=p&&h.get("showNextBtn",!0),C=0,b=f;M==="left"||M==="bottom"?(S&&(_=[0,0],C+=m),w&&(y=[C,0],C+=m),T&&(x=[b-d,0],b-=m)):(S&&(_=[b-d,0],b-=m),w&&(y=[0,0],C+=m),T&&(x=[b-d,0],b-=m));var E=[C,b];return t.get("inverse")&&E.reverse(),{viewRect:o,mainLength:f,orient:a,rotation:c[a],labelRotation:v,labelPosOpt:s,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:_,prevBtnPosition:y,nextBtnPosition:x,axisExtent:E,controlSize:d,controlGap:g}},e.prototype._position=function(t,i){var n=this._mainGroup,a=this._labelGroup,o=t.viewRect;if(t.orient==="vertical"){var s=wi(),l=o.x,u=o.y+o.height;_n(s,s,[-l,-u]),Pa(s,s,-PO/2),_n(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),f=_(n.getBoundingRect()),h=_(a.getBoundingRect()),p=[n.x,n.y],d=[a.x,a.y];d[0]=p[0]=c[0][0];var g=t.labelPosOpt;if(g==null||Ce(g)){var m=g==="+"?0:1;y(p,f,c,1,m),y(d,h,c,1,1-m)}else{var m=g>=0?0:1;y(p,f,c,1,m),d[1]=p[1]+g}n.setPosition(p),a.setPosition(d),n.rotation=a.rotation=t.rotation,v(n),v(a);function v(x){x.originX=c[0][0]-x.x,x.originY=c[1][0]-x.y}function _(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function y(x,M,S,w,T){x[w]+=S[w][T]-M[w][T]}},e.prototype._createAxis=function(t,i){var n=i.getData(),a=i.get("axisType"),o=ZMe(i,a);o.getTicks=function(){return n.mapArray(["value"],function(u){return{value:u}})};var s=n.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new EK("value",o,t.axisExtent,a);return l.model=i,l},e.prototype._createGroup=function(t){var i=this[t]=new Ze;return this.group.add(i),i},e.prototype._renderAxisLine=function(t,i,n,a){var o=n.getExtent();if(a.get(["lineStyle","show"])){var s=new Jr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:fe({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});i.add(s);var l=this._progressLine=new Jr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ye({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});i.add(l)}},e.prototype._renderAxisTick=function(t,i,n,a){var o=this,s=a.getData(),l=n.scale.getTicks();this._tickSymbols=[],N(l,function(u){var c=n.dataToCoord(u.value),f=s.getItemModel(u.value),h=f.getModel("itemStyle"),p=f.getModel(["emphasis","itemStyle"]),d=f.getModel(["progress","itemStyle"]),g={x:c,y:0,onclick:Be(o._changeTimeline,o,u.value)},m=CK(f,h,i,g);m.ensureState("emphasis").style=p.getItemStyle(),m.ensureState("progress").style=d.getItemStyle(),Ul(m);var v=rt(m);f.get("tooltip")?(v.dataIndex=u.value,v.dataModel=a):v.dataIndex=v.dataModel=null,o._tickSymbols.push(m)})},e.prototype._renderAxisLabel=function(t,i,n,a){var o=this,s=n.getLabelModel();if(s.get("show")){var l=a.getData(),u=n.getViewLabels();this._tickLabels=[],N(u,function(c){var f=c.tickValue,h=l.getItemModel(f),p=h.getModel("label"),d=h.getModel(["emphasis","label"]),g=h.getModel(["progress","label"]),m=n.dataToCoord(c.tickValue),v=new Lt({x:m,y:0,rotation:t.labelRotation-t.rotation,onclick:Be(o._changeTimeline,o,f),silent:!1,style:fr(p,{text:c.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});v.ensureState("emphasis").style=fr(d),v.ensureState("progress").style=fr(g),i.add(v),Ul(v),AK(v).dataIndex=f,o._tickLabels.push(v)})}},e.prototype._renderControl=function(t,i,n,a){var o=t.controlSize,s=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),f=a.get("inverse",!0);h(t.nextBtnPosition,"next",Be(this._changeTimeline,this,f?"-":"+")),h(t.prevBtnPosition,"prev",Be(this._changeTimeline,this,f?"+":"-")),h(t.playPosition,c?"stop":"play",Be(this._handlePlayClick,this,!c),!0);function h(p,d,g,m){if(p){var v=xn(ft(a.get(["controlStyle",d+"BtnSize"]),o),o),_=[0,-v/2,v,v],y=KMe(a,d+"Icon",_,{x:p[0],y:p[1],originX:o/2,originY:0,rotation:m?-s:0,rectHover:!0,style:l,onclick:g});y.ensureState("emphasis").style=u,i.add(y),Ul(y)}}},e.prototype._renderCurrentPointer=function(t,i,n,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(f){f.draggable=!0,f.drift=Be(u._handlePointerDrag,u),f.ondragend=Be(u._handlePointerDragend,u),RK(f,u._progressLine,s,n,a,!0)},onUpdate:function(f){RK(f,u._progressLine,s,n,a)}};this._currentPointer=CK(l,l,this._mainGroup,{},this._currentPointer,c)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,i,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,i){var n=this._toAxisCoord(t)[0],a=this._axis,o=Ti(a.getExtent().slice());n>o[1]&&(n=o[1]),n=0&&(o[a]=+o[a].toFixed(h)),[o,f]}var NO={min:ot(dE,"min"),max:ot(dE,"max"),average:ot(dE,"average"),median:ot(dE,"median")};function ih(r,e){if(e){var t=r.getData(),i=r.coordinateSystem,n=i&&i.dimensions;if(!QMe(e)&&!pe(e.coord)&&pe(n)){var a=OO(e,t,i,r);if(e=Qe(e),e.type&&NO[e.type]&&a.baseAxis&&a.valueAxis){var o=dt(n,a.baseAxis.dim),s=dt(n,a.valueAxis.dim),l=NO[e.type](t,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!pe(n))e.coord=[];else for(var u=e.coord,c=0;c<2;c++)NO[u[c]]&&(u[c]=vE(t,t.mapDimension(n[c]),u[c]));return e}}function OO(r,e,t,i){var n={};return r.valueIndex!=null||r.valueDim!=null?(n.valueDataDim=r.valueIndex!=null?e.getDimension(r.valueIndex):r.valueDim,n.valueAxis=t.getAxis(ebe(i,n.valueDataDim)),n.baseAxis=t.getOtherAxis(n.valueAxis),n.baseDataDim=e.mapDimension(n.baseAxis.dim)):(n.baseAxis=i.getBaseAxis(),n.valueAxis=t.getOtherAxis(n.baseAxis),n.baseDataDim=e.mapDimension(n.baseAxis.dim),n.valueDataDim=e.mapDimension(n.valueAxis.dim)),n}function ebe(r,e){var t=r.getData().getDimensionInfo(e);return t&&t.coordDim}function nh(r,e){return r&&r.containData&&e.coord&&!UO(e)?r.containData(e.coord):!0}function UK(r,e,t){return r&&r.containZone&&e.coord&&t.coord&&!UO(e)&&!UO(t)?r.containZone(e.coord,t.coord):!0}function mE(r,e){return r?function(t,i,n,a){var o=a<2?t.coord&&t.coord[a]:t.value;return as(o,e[a])}:function(t,i,n,a){return as(t.value,e[a])}}function vE(r,e,t){if(t==="average"){var i=0,n=0;return r.each(e,function(a,o){isNaN(a)||(i+=a,n++)}),i/n}else return t==="median"?r.getMedian(e):r.getDataExtent(e)[t==="max"?1:0]}var FO=vt(),tbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=ke()},e.prototype.render=function(t,i,n){var a=this,o=this.markerGroupMap;o.each(function(s){FO(s).keep=!1}),i.eachSeries(function(s){var l=ga.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,i,n)}),o.each(function(s){!FO(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(t){FO(t).keep=!0},e.prototype.toggleBlurSeries=function(t,i){var n=this;N(t,function(a){var o=ga.getMarkerModelFromSeries(a,n.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(i?tw(l):m_(l))})}})},e.type="marker",e}(er),rg=tbe;function OK(r,e,t){var i=e.coordinateSystem;r.each(function(n){var a=r.getItemModel(n),o,s=ze(a.get("x"),t.getWidth()),l=ze(a.get("y"),t.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(r.getValues(r.dimensions,n));else if(i){var u=r.get(i.dimensions[0],n),c=r.get(i.dimensions[1],n);o=i.dataToPoint([u,c])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),r.setItemLayout(n,o)})}var rbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=ga.getMarkerModelFromSeries(a,"markPoint");o&&(OK(o.getData(),a,n),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Xl),f=ibe(o,t,i);i.setData(f),OK(i.getData(),t,a),f.each(function(h){var p=f.getItemModel(h),d=p.getShallow("symbol"),g=p.getShallow("symbolSize"),m=p.getShallow("symbolRotate"),v=p.getShallow("symbolOffset"),_=p.getShallow("symbolKeepAspect");if(He(d)||He(g)||He(m)||He(v)){var y=i.getRawValue(h),x=i.getDataParams(h);He(d)&&(d=d(y,x)),He(g)&&(g=g(y,x)),He(m)&&(m=m(y,x)),He(v)&&(v=v(y,x))}var M=p.getModel("itemStyle").getItemStyle(),S=Bl(l,"color");M.fill||(M.fill=S),f.setItemVisual(h,{symbol:d,symbolSize:g,symbolRotate:m,symbolOffset:v,symbolKeepAspect:_,style:M})}),c.updateData(f),this.group.add(c.group),f.eachItemGraphicEl(function(h){h.traverse(function(p){rt(p).dataModel=i})}),this.markKeep(c),c.group.silent=i.get("silent")||t.get("silent")},e.type="markPoint",e}(rg);function ibe(r,e,t){var i;r?i=de(r&&r.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return fe(fe({},l),{name:s,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var n=new ri(i,t),a=de(t.get("data"),ot(ih,e));r&&(a=Wt(a,ot(nh,r)));var o=mE(!!r,i);return n.initData(a,null,o),n}var zK=rbe;function BO(r){r.registerComponentModel(NK),r.registerComponentView(zK),r.registerPreprocessor(function(e){md(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var nbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(ga),FK=nbe;var gE=vt(),abe=function(r,e,t,i){var n=r.getData(),a;if(pe(i))a=i;else{var o=i.type;if(o==="min"||o==="max"||o==="average"||o==="median"||i.xAxis!=null||i.yAxis!=null){var s=void 0,l=void 0;if(i.yAxis!=null||i.xAxis!=null)s=e.getAxis(i.yAxis!=null?"y":"x"),l=Br(i.yAxis,i.xAxis);else{var u=OO(i,n,e,r);s=u.valueAxis;var c=x1(n,u.valueDataDim);l=vE(n,c,o)}var f=s.dim==="x"?0:1,h=1-f,p=Qe(i),d={coord:[]};p.type=null,p.coord=[],p.coord[h]=-1/0,d.coord[h]=1/0;var g=t.get("precision");g>=0&&Ct(l)&&(l=+l.toFixed(Math.min(g,20))),p.coord[f]=d.coord[f]=l,a=[p,d,{type:o,valueIndex:i.valueIndex,value:l}]}else a=[]}var m=[ih(r,a[0]),ih(r,a[1]),fe({},a[2])];return m[2].type=m[2].type||null,_t(m[2],m[0]),_t(m[2],m[1]),m};function yE(r){return!isNaN(r)&&!isFinite(r)}function BK(r,e,t,i){var n=1-r,a=i.dimensions[r];return yE(e[n])&&yE(t[n])&&e[r]===t[r]&&i.getAxis(a).containData(e[r])}function obe(r,e){if(r.type==="cartesian2d"){var t=e[0].coord,i=e[1].coord;if(t&&i&&(BK(1,t,i,r)||BK(0,t,i,r)))return!0}return nh(r,e[0])&&nh(r,e[1])}function kO(r,e,t,i,n){var a=i.coordinateSystem,o=r.getItemModel(e),s,l=ze(o.get("x"),n.getWidth()),u=ze(o.get("y"),n.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition)s=i.getMarkerPosition(r.getValues(r.dimensions,e));else{var c=a.dimensions,f=r.get(c[0],e),h=r.get(c[1],e);s=a.dataToPoint([f,h])}if(us(a,"cartesian2d")){var p=a.getAxis("x"),d=a.getAxis("y"),c=a.dimensions;yE(r.get(c[0],e))?s[0]=p.toGlobalCoord(p.getExtent()[t?0:1]):yE(r.get(c[1],e))&&(s[1]=d.toGlobalCoord(d.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}r.setItemLayout(e,s)}var sbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=ga.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=gE(o).from,u=gE(o).to;l.each(function(c){kO(l,c,!0,a,n),kO(u,c,!1,a,n)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Bv);this.group.add(c.group);var f=lbe(o,t,i),h=f.from,p=f.to,d=f.line;gE(i).from=h,gE(i).to=p,i.setData(d);var g=i.get("symbol"),m=i.get("symbolSize"),v=i.get("symbolRotate"),_=i.get("symbolOffset");pe(g)||(g=[g,g]),pe(m)||(m=[m,m]),pe(v)||(v=[v,v]),pe(_)||(_=[_,_]),f.from.each(function(x){y(h,x,!0),y(p,x,!1)}),d.each(function(x){var M=d.getItemModel(x).getModel("lineStyle").getLineStyle();d.setItemLayout(x,[h.getItemLayout(x),p.getItemLayout(x)]),M.stroke==null&&(M.stroke=h.getItemVisual(x,"style").fill),d.setItemVisual(x,{fromSymbolKeepAspect:h.getItemVisual(x,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(x,"symbolOffset"),fromSymbolRotate:h.getItemVisual(x,"symbolRotate"),fromSymbolSize:h.getItemVisual(x,"symbolSize"),fromSymbol:h.getItemVisual(x,"symbol"),toSymbolKeepAspect:p.getItemVisual(x,"symbolKeepAspect"),toSymbolOffset:p.getItemVisual(x,"symbolOffset"),toSymbolRotate:p.getItemVisual(x,"symbolRotate"),toSymbolSize:p.getItemVisual(x,"symbolSize"),toSymbol:p.getItemVisual(x,"symbol"),style:M})}),c.updateData(d),f.line.eachItemGraphicEl(function(x){rt(x).dataModel=i,x.traverse(function(M){rt(M).dataModel=i})});function y(x,M,S){var w=x.getItemModel(M);kO(x,M,S,t,a);var T=w.getModel("itemStyle").getItemStyle();T.fill==null&&(T.fill=Bl(l,"color")),x.setItemVisual(M,{symbolKeepAspect:w.get("symbolKeepAspect"),symbolOffset:ft(w.get("symbolOffset",!0),_[S?0:1]),symbolRotate:ft(w.get("symbolRotate",!0),v[S?0:1]),symbolSize:ft(w.get("symbolSize"),m[S?0:1]),symbol:ft(w.get("symbol",!0),g[S?0:1]),style:T})}this.markKeep(c),c.group.silent=i.get("silent")||t.get("silent")},e.type="markLine",e}(rg);function lbe(r,e,t){var i;r?i=de(r&&r.dimensions,function(u){var c=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return fe(fe({},c),{name:u,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var n=new ri(i,t),a=new ri(i,t),o=new ri([],t),s=de(t.get("data"),ot(abe,e,r,t));r&&(s=Wt(s,ot(obe,r)));var l=mE(!!r,i);return n.initData(de(s,function(u){return u[0]}),null,l),a.initData(de(s,function(u){return u[1]}),null,l),o.initData(de(s,function(u){return u[2]})),o.hasItemOption=!0,{from:n,to:a,line:o}}var kK=sbe;function VO(r){r.registerComponentModel(FK),r.registerComponentView(kK),r.registerPreprocessor(function(e){md(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var ube=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(ga),VK=ube;var _E=vt(),cbe=function(r,e,t,i){var n=i[0],a=i[1];if(!(!n||!a)){var o=ih(r,n),s=ih(r,a),l=o.coord,u=s.coord;l[0]=Br(l[0],-1/0),l[1]=Br(l[1],-1/0),u[0]=Br(u[0],1/0),u[1]=Br(u[1],1/0);var c=bm([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function xE(r){return!isNaN(r)&&!isFinite(r)}function GK(r,e,t,i){var n=1-r;return xE(e[n])&&xE(t[n])}function fbe(r,e){var t=e.coord[0],i=e.coord[1],n={coord:t,x:e.x0,y:e.y0},a={coord:i,x:e.x1,y:e.y1};return us(r,"cartesian2d")?t&&i&&(GK(1,t,i,r)||GK(0,t,i,r))?!0:UK(r,n,a):nh(r,n)||nh(r,a)}function HK(r,e,t,i,n){var a=i.coordinateSystem,o=r.getItemModel(e),s,l=ze(o.get(t[0]),n.getWidth()),u=ze(o.get(t[1]),n.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition){var c=r.getValues(["x0","y0"],e),f=r.getValues(["x1","y1"],e),h=a.clampData(c),p=a.clampData(f),d=[];t[0]==="x0"?d[0]=h[0]>p[0]?f[0]:c[0]:d[0]=h[0]>p[0]?c[0]:f[0],t[1]==="y0"?d[1]=h[1]>p[1]?f[1]:c[1]:d[1]=h[1]>p[1]?c[1]:f[1],s=i.getMarkerPosition(d,t,!0)}else{var g=r.get(t[0],e),m=r.get(t[1],e),v=[g,m];a.clampData&&a.clampData(v,v),s=a.dataToPoint(v,!0)}if(us(a,"cartesian2d")){var _=a.getAxis("x"),y=a.getAxis("y"),g=r.get(t[0],e),m=r.get(t[1],e);xE(g)?s[0]=_.toGlobalCoord(_.getExtent()[t[0]==="x0"?0:1]):xE(m)&&(s[1]=y.toGlobalCoord(y.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var WK=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],hbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=ga.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=de(WK,function(f){return HK(s,l,f,a,n)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Ze});this.group.add(c.group),this.markKeep(c);var f=pbe(o,t,i);i.setData(f),f.each(function(h){var p=de(WK,function(T){return HK(f,h,T,t,a)}),d=o.getAxis("x").scale,g=o.getAxis("y").scale,m=d.getExtent(),v=g.getExtent(),_=[d.parse(f.get("x0",h)),d.parse(f.get("x1",h))],y=[g.parse(f.get("y0",h)),g.parse(f.get("y1",h))];Ti(_),Ti(y);var x=!(m[0]>_[1]||m[1]<_[0]||v[0]>y[1]||v[1]=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Pt),Xx=mbe;var ig=ot,HO=N,SE=Ze,vbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new SE),this.group.add(this._selectorGroup=new SE),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var o=t.get("align"),s=t.get("orient");(!o||o==="auto")&&(o=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,t,i,n,l,s,u);var c=t.getBoxLayoutParams(),f={width:n.getWidth(),height:n.getHeight()},h=t.get("padding"),p=xr(c,f,h),d=this.layoutInner(t,o,p,a,l,u),g=xr(Ye({width:d.width,height:d.height},c),f,h);this.group.x=g.x-d.x,this.group.y=g.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=oE(d,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,i,n,a,o,s,l){var u=this.getContentGroup(),c=ke(),f=i.get("selectedMode"),h=[];n.eachRawSeries(function(p){!p.get("legendHoverLink")&&h.push(p.id)}),HO(i.getData(),function(p,d){var g=p.get("name");if(!this.newlineDisabled&&(g===""||g===` +`)){var m=new SE;m.newline=!0,u.add(m);return}var v=n.getSeriesByName(g)[0];if(!c.get(g))if(v){var _=v.getData(),y=_.getVisual("legendLineStyle")||{},x=_.getVisual("legendIcon"),M=_.getVisual("style"),S=this._createItem(v,g,d,p,i,t,y,M,x,f,a);S.on("click",ig(YK,g,null,a,h)).on("mouseover",ig(WO,v.name,null,a,h)).on("mouseout",ig(XO,v.name,null,a,h)),n.ssr&&S.eachChild(function(w){var T=rt(w);T.seriesIndex=v.seriesIndex,T.dataIndex=d,T.ssrType="legend"}),c.set(g,!0)}else n.eachRawSeries(function(w){if(!c.get(g)&&w.legendVisualProvider){var T=w.legendVisualProvider;if(!T.containName(g))return;var C=T.indexOfName(g),b=T.getItemVisual(C,"style"),E=T.getItemVisual(C,"legendIcon"),I=cn(b.fill);I&&I[3]===0&&(I[3]=.2,b=fe(fe({},b),{fill:Jo(I,"rgba")}));var R=this._createItem(w,g,d,p,i,t,{},b,E,f,a);R.on("click",ig(YK,null,g,a,h)).on("mouseover",ig(WO,null,g,a,h)).on("mouseout",ig(XO,null,g,a,h)),n.ssr&&R.eachChild(function(A){var D=rt(A);D.seriesIndex=w.seriesIndex,D.dataIndex=d,D.ssrType="legend"}),c.set(g,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},e.prototype._createSelector=function(t,i,n,a,o){var s=this.getSelectorGroup();HO(t,function(u){var c=u.type,f=new Lt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(f);var h=i.getModel("selectorLabel"),p=i.getModel(["emphasis","selectorLabel"]);Ir(f,{normal:h,emphasis:p},{defaultText:u.title}),Ul(f)})},e.prototype._createItem=function(t,i,n,a,o,s,l,u,c,f,h){var p=t.visualDrawType,d=o.get("itemWidth"),g=o.get("itemHeight"),m=o.isSelected(i),v=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),y=a.get("icon");c=y||c||"roundRect";var x=gbe(c,a,l,u,p,m,h),M=new SE,S=a.getModel("textStyle");if(He(t.getLegendIcon)&&(!y||y==="inherit"))M.add(t.getLegendIcon({itemWidth:d,itemHeight:g,icon:c,iconRotate:v,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}));else{var w=y==="inherit"&&t.getData().getVisual("symbol")?v==="inherit"?t.getData().getVisual("symbolRotate"):v:0;M.add(ybe({itemWidth:d,itemHeight:g,icon:c,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}))}var T=s==="left"?d+5:-5,C=s,b=o.get("formatter"),E=i;Ce(b)&&b?E=b.replace("{name}",i??""):He(b)&&(E=b(i));var I=m?S.getTextColor():a.get("inactiveColor");M.add(new Lt({style:fr(S,{text:E,x:T,y:g/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var R=new Et({shape:M.getBoundingRect(),style:{fill:"transparent"}}),A=a.getModel("tooltip");return A.get("show")&&Gs({el:R,componentModel:o,itemName:i,itemTooltipOption:A.option}),M.add(R),M.eachChild(function(D){D.silent=!0}),R.silent=!f,this.getContentGroup().add(M),Ul(M),M.__legendDataIndex=n,M},e.prototype.layoutInner=function(t,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Xs(t.get("orient"),l,t.get("itemGap"),n.width,n.height);var c=l.getBoundingRect(),f=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){Xs("horizontal",u,t.get("selectorItemGap",!0));var h=u.getBoundingRect(),p=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),g=t.getOrient().index,m=g===0?"width":"height",v=g===0?"height":"width",_=g===0?"y":"x";s==="end"?p[g]+=c[m]+d:f[g]+=h[m]+d,p[1-g]+=c[v]/2-h[v]/2,u.x=p[0],u.y=p[1],l.x=f[0],l.y=f[1];var y={x:0,y:0};return y[m]=c[m]+d+h[m],y[v]=Math.max(c[v],h[v]),y[_]=Math.min(0,h[_]+p[1-g]),y}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(er);function gbe(r,e,t,i,n,a,o){function s(m,v){m.lineWidth==="auto"&&(m.lineWidth=v.lineWidth>0?2:0),HO(m,function(_,y){m[y]==="inherit"&&(m[y]=v[y])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=r.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?i.decal:js(f,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[c]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:t).opacity),s(u,i);var h=e.getModel("lineStyle"),p=h.getLineStyle();if(s(p,t),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),p.stroke==="auto"&&(p.stroke=i.fill),!a){var d=e.get("inactiveBorderWidth"),g=u[c];u.lineWidth=d==="auto"?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=h.get("inactiveColor"),p.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}function ybe(r){var e=r.icon||"roundRect",t=Sr(e,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return t.setStyle(r.itemStyle),t.rotation=(r.iconRotate||0)*Math.PI/180,t.setOrigin([r.itemWidth/2,r.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function YK(r,e,t,i){XO(r,e,t,i),t.dispatchAction({type:"legendToggleSelect",name:r??e}),WO(r,e,t,i)}function qK(r){for(var e=r.getZr().storage.getDisplayList(),t,i=0,n=e.length;in[o],m=[-p.x,-p.y];i||(m[a]=c[u]);var v=[0,0],_=[-d.x,-d.y],y=ft(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(g){var x=t.get("pageButtonPosition",!0);x==="end"?_[a]+=n[o]-d[o]:v[a]+=d[o]+y}_[1-a]+=p[s]/2-d[s]/2,c.setPosition(m),f.setPosition(v),h.setPosition(_);var M={x:0,y:0};if(M[o]=g?n[o]:p[o],M[s]=Math.max(p[s],d[s]),M[l]=Math.min(0,d[l]+_[1-a]),f.__rectSize=n[o],g){var S={x:0,y:0};S[o]=Math.max(n[o]-d[o]-y,0),S[s]=M[s],f.setClipPath(new Et({shape:S})),f.__rectSize=S[o]}else h.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(t);return w.pageIndex!=null&&Dt(c,{x:w.contentPosition[0],y:w.contentPosition[1]},g?t:null),this._updatePageInfoView(t,w),M},e.prototype._pageGo=function(t,i,n){var a=this._getPageInfo(i)[t];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},e.prototype._updatePageInfoView=function(t,i){var n=this._controllerGroup;N(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",h=i[f]!=null,p=n.childOfName(c);p&&(p.setStyle("fill",h?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),p.cursor=h?"pointer":"default")});var a=n.childOfName("pageText"),o=t.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",Ce(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var i=t.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=t.getOrient().index,s=qO[o],l=ZO[o],u=this._findTargetItemIndex(i),c=n.children(),f=c[u],h=c.length,p=h?1:0,d={contentPosition:[n.x,n.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return d;var g=x(f);d.contentPosition[o]=-g.s;for(var m=u+1,v=g,_=g,y=null;m<=h;++m)y=x(c[m]),(!y&&_.e>v.s+a||y&&!M(y,v.s))&&(_.i>v.i?v=_:v=y,v&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=v.i),++d.pageCount)),_=y;for(var m=u-1,v=g,_=g,y=null;m>=-1;--m)y=x(c[m]),(!y||!M(_,y.s))&&v.i<_.i&&(_=v,d.pagePrevDataIndex==null&&(d.pagePrevDataIndex=v.i),++d.pageCount,++d.pageIndex),v=y;return d;function x(S){if(S){var w=S.getBoundingRect(),T=w[l]+S[l];return{s:T,e:T+w[s],i:S.__legendDataIndex}}}function M(S,w){return S.e>=w&&S.s<=w+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===t&&(i=s)}),i??a},e.type="legend.scroll",e}(ME),$K=xbe;function jO(r){r.registerAction("legendScroll","legendscroll",function(e,t){var i=e.scrollDataIndex;i!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(n){n.setScrollDataIndex(i)})})}function QK(r){It(bE),r.registerComponentModel(KK),r.registerComponentView($K),jO(r)}function KO(r){It(bE),It(QK)}var Sbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=Hn(eh.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(eh),eJ=Sbe;var JO=vt();function tJ(r,e,t){JO(r).coordSysRecordMap.each(function(i){var n=i.dataZoomInfoMap.get(e.uid);n&&(n.getRange=t)})}function rJ(r,e){for(var t=JO(r).coordSysRecordMap,i=t.keys(),n=0;ni[t+e]&&(e=s),n=n&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}function nJ(r){r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,function(e,t){var i=JO(t),n=i.coordSysRecordMap||(i.coordSysRecordMap=ke());n.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=nE(a);N(o.infoList,function(s){var l=s.model.uid,u=n.get(l)||n.set(l,Mbe(t,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=ke());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),n.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){iJ(n,a);return}var c=Tbe(l);o.enable(c.controlType,c.opt),o.setPointerChecker(a.containsPoint),os(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Abe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,i,n){if(r.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),tJ(n,t,{pan:Be($O.pan,this),zoom:Be($O.zoom,this),scrollMove:Be($O.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){rJ(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Qv),$O={zoom:function(r,e,t,i){var n=this.range,a=n.slice(),o=r.axisModels[0];if(o){var s=QO[e](null,[i.originX,i.originY],o,t,r),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Za(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,n[0]!==a[0]||n[1]!==a[1])return a}},pan:aJ(function(r,e,t,i,n,a){var o=QO[i]([a.oldX,a.oldY],[a.newX,a.newY],e,n,t);return o.signal*(r[1]-r[0])*o.pixel/o.pixelLength}),scrollMove:aJ(function(r,e,t,i,n,a){var o=QO[i]([0,0],[a.scrollDelta,a.scrollDelta],e,n,t);return o.signal*(r[1]-r[0])*a.scrollDelta})};function aJ(r){return function(e,t,i,n){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=r(o,s,e,t,i,n);if(Za(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var QO={grid:function(r,e,t,i,n){var a=t.axis,o={},s=n.model.coordinateSystem.getRect();return r=r||[0,0],a.dim==="x"?(o.pixel=e[0]-r[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(r,e,t,i,n){var a=t.axis,o={},s=n.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return r=r?s.pointToCoord(r):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-r[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(r,e,t,i,n){var a=t.axis,o=n.model.coordinateSystem.getRect(),s={};return r=r||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-r[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-r[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},oJ=Abe;function qx(r){pd(r),r.registerComponentModel(eJ),r.registerComponentView(oJ),nJ(r)}var Cbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=Hn(eh.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(eh),sJ=Cbe;var Zx=Et,lJ=7,Rbe=1,e3=30,Lbe=7,jx="horizontal",uJ="vertical",Pbe=5,Dbe=["line","bar","candlestick","scatter"],Ibe={easing:"cubicOut",duration:100,delay:0},Nbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,i){this.api=i,this._onBrush=Be(this._onBrush,this),this._onBrushEnd=Be(this._onBrushEnd,this)},e.prototype.render=function(t,i,n,a){if(r.prototype.render.apply(this,arguments),os(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){zu(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var i=this._displayables.sliderGroup=new Ze;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(i),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,i=this.api,n=t.get("brushSelect"),a=n?Lbe:0,o=this._findCoordRect(),s={width:i.getWidth(),height:i.getHeight()},l=this._orient===jx?{right:s.width-o.x-o.width,top:s.height-e3-lJ-a,width:o.width,height:e3}:{right:lJ,top:o.y,width:e3,height:o.height},u=is(t.option);N(["right","top","width","height"],function(f){u[f]==="ph"&&(u[f]=l[f])});var c=xr(u,s);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===uJ&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,i=this._location,n=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(n===jx&&!o?{scaleY:l?1:-1,scaleX:1}:n===jx&&o?{scaleY:l?1:-1,scaleX:-1}:n===uJ&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=i.x-u.x,t.y=i.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,i=this._size,n=this._displayables.sliderGroup,a=t.get("brushSelect");n.add(new Zx({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new Zx({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:Be(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),n.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var i=this._size,n=this._shadowSize||[],a=t.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||i[0]!==n[0]||i[1]!==n[1]){var f=o.getDataExtent(l),h=(f[1]-f[0])*.3;f=[f[0]-h,f[1]+h];var p=[0,i[1]],d=[0,i[0]],g=[[i[0],0],[0,0]],m=[],v=d[1]/(o.count()-1),_=0,y=Math.round(o.count()/i[0]),x;o.each([l],function(C,b){if(y>0&&b%y){_+=v;return}var E=C==null||isNaN(C)||C==="",I=E?0:rr(C,f,p,!0);E&&!x&&b?(g.push([g[g.length-1][0],0]),m.push([m[m.length-1][0],0])):!E&&x&&(g.push([_,0]),m.push([_,0])),g.push([_,I]),m.push([_,I]),_+=v,x=E}),u=this._shadowPolygonPts=g,c=this._shadowPolylinePts=m}this._shadowData=o,this._shadowDim=l,this._shadowSize=[i[0],i[1]];var M=this.dataZoomModel;function S(C){var b=M.getModel(C?"selectedDataBackground":"dataBackground"),E=new Ze,I=new ti({shape:{points:u},segmentIgnoreThreshold:1,style:b.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),R=new Qr({shape:{points:c},segmentIgnoreThreshold:1,style:b.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return E.add(I),E.add(R),E}for(var w=0;w<3;w++){var T=S(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,i=t.get("showDataShadow");if(i!==!1){var n,a=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();N(l,function(u){if(!n&&!(i!==!0&&dt(Dbe,u.get("type"))<0)){var c=a.getComponent(ms(o),s).axis,f=Ube(o),h,p=u.coordinateSystem;f!=null&&p.getOtherAxis&&(h=p.getOtherAxis(c).inverse),f=u.getData().mapDimension(f),n={thisAxis:c,series:u,thisDim:o,otherDim:f,otherAxisInverse:h}}},this)},this),n}},e.prototype._renderHandle=function(){var t=this.group,i=this._displayables,n=i.handles=[null,null],a=i.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,f=l.get("brushSelect"),h=i.filler=new Zx({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new Zx({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:Rbe,fill:"rgba(0,0,0,0)"}})),N([0,1],function(y){var x=l.get("handleIcon");!X_[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var M=Sr(x,-1,0,2,2,null,!0);M.attr({cursor:cJ(this._orient),draggable:!0,drift:Be(this._onDragMove,this,y),ondragend:Be(this._onDragEnd,this),onmouseover:Be(this._showDataInfo,this,!0),onmouseout:Be(this._showDataInfo,this,!1),z2:5});var S=M.getBoundingRect(),w=l.get("handleSize");this._handleHeight=ze(w,this._size[1]),this._handleWidth=S.width/S.height*this._handleHeight,M.setStyle(l.getModel("handleStyle").getItemStyle()),M.style.strokeNoScale=!0,M.rectHover=!0,M.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Ul(M);var T=l.get("handleColor");T!=null&&(M.style.fill=T),o.add(n[y]=M);var C=l.getModel("textStyle");t.add(a[y]=new Lt({silent:!0,invisible:!0,style:fr(C,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:C.getTextColor(),font:C.getFont()}),z2:10}))},this);var p=h;if(f){var d=ze(l.get("moveHandleSize"),s[1]),g=i.moveHandle=new Et({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:d}}),m=d*.8,v=i.moveHandleIcon=Sr(l.get("moveHandleIcon"),-m/2,-m/2,m,m,"#fff",!0);v.silent=!0,v.y=s[1]+d/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(d,10));p=i.moveZone=new Et({invisible:!0,shape:{y:s[1]-_,height:d+_}}),p.on("mouseover",function(){u.enterEmphasis(g)}).on("mouseout",function(){u.leaveEmphasis(g)}),o.add(g),o.add(v),o.add(p)}p.attr({draggable:!0,cursor:cJ(this._orient),drift:Be(this._onDragMove,this,"all"),ondragstart:Be(this._showDataInfo,this,!0),ondragend:Be(this._onDragEnd,this),onmouseover:Be(this._showDataInfo,this,!0),onmouseout:Be(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[rr(t[0],[0,100],i,!0),rr(t[1],[0,100],i,!0)]},e.prototype._updateInterval=function(t,i){var n=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=n.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Za(i,a,o,n.get("zoomLock")?"all":t,s.minSpan!=null?rr(s.minSpan,l,o,!0):null,s.maxSpan!=null?rr(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Ti([rr(a[0],o,l,!0),rr(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},e.prototype._updateView=function(t){var i=this._displayables,n=this._handleEnds,a=Ti(n.slice()),o=this._size;N([0,1],function(p){var d=i.handles[p],g=this._handleHeight;d.attr({scaleX:g/2,scaleY:g/2,x:n[p]+(p?-1:1),y:o[1]/2-g/2})},this),i.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};i.moveHandle&&(i.moveHandle.setShape(s),i.moveZone.setShape(s),i.moveZone.getBoundingRect(),i.moveHandleIcon&&i.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=i.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;ci[0]||n[1]<0||n[1]>i[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",n[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var i=t.offsetX,n=t.offsetY;this._brushStart=new Nt(i,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var i=this._displayables.brushRect;if(this._brushing=!1,!!i){i.attr("ignore",!0);var n=i.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(n.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Ti([rr(n.x,o,s,!0),rr(n.x+n.width,o,s,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(Ra(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,i){var n=this._displayables,a=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new Zx({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,i),c=l.transformCoordToLocal(s.x,s.y),f=this._size;u[0]=Math.max(Math.min(f[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:f[1]})},e.prototype._dispatchZoomAction=function(t){var i=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?Ibe:null,start:i[0],end:i[1]})},e.prototype._findCoordRect=function(){var t,i=nE(this.dataZoomModel).infoList;if(!t&&i.length){var n=i[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var a=this.api.getWidth(),o=this.api.getHeight();t={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(Qv);function Ube(r){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[r]}function cJ(r){return r==="vertical"?"ns-resize":"ew-resize"}var fJ=Nbe;function Kx(r){r.registerComponentModel(sJ),r.registerComponentView(fJ),pd(r)}function t3(r){It(qx),It(Kx)}var Obe={get:function(r,e,t){var i=Qe((zbe[r]||{})[e]);return t&&pe(i)?i[i.length-1]:i}},zbe={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},wE=Obe;var hJ=pi.mapVisual,Fbe=pi.eachVisual,Bbe=pe,pJ=N,kbe=Ti,Vbe=rr,Gbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n)},e.prototype.optionUpdated=function(t,i){var n=this.option;!i&&cE(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var i=this.stateList;t=Be(t,this),this.controllerVisuals=Hx(this.option.controller,i,t),this.targetVisuals=Hx(this.option.target,i,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,i=[];return t==null||t==="all"?this.ecModel.eachSeries(function(n,a){i.push(a)}):i=$t(t),i},e.prototype.eachTargetSeries=function(t,i){N(this.getTargetSeriesIndices(),function(n){var a=this.ecModel.getSeriesByIndex(n);a&&t.call(i,a)},this)},e.prototype.isTargetSeries=function(t){var i=!1;return this.eachTargetSeries(function(n){n===t&&(i=!0)}),i},e.prototype.formatValueText=function(t,i,n){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;n=n||["<",">"],pe(t)&&(t=t.slice(),u=!0);var c=i?t:u?[f(t[0]),f(t[1])]:f(t);if(Ce(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(He(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?n[0]+" "+c[1]:t[1]===s[1]?n[1]+" "+c[0]:c[0]+" - "+c[1];return c;function f(h){return h===s[0]?"min":h===s[1]?"max":(+h).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,i=kbe([t.min,t.max]);this._dataExtent=i},e.prototype.getDataDimensionIndex=function(t){var i=this.option.dimension;if(i!=null)return t.getDimensionIndex(i);for(var n=t.dimensions,a=n.length-1;a>=0;a--){var o=n[a],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,i=this.option,n={inRange:i.inRange,outOfRange:i.outOfRange},a=i.target||(i.target={}),o=i.controller||(i.controller={});_t(a,n),_t(o,n);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(f){Bbe(i.color)&&!f.inRange&&(f.inRange={color:i.color.slice().reverse()}),f.inRange=f.inRange||{color:t.get("gradientColor")}}function u(f,h,p){var d=f[h],g=f[p];d&&!g&&(g=f[p]={},pJ(d,function(m,v){if(pi.isValidType(v)){var _=wE.get(v,"inactive",s);_!=null&&(g[v]=_,v==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function c(f){var h=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,p=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,d=this.get("inactiveColor"),g=this.getItemSymbol(),m=g||"roundRect";pJ(this.stateList,function(v){var _=this.itemSize,y=f[v];y||(y=f[v]={color:s?d:[d]}),y.symbol==null&&(y.symbol=h&&Qe(h)||(s?m:[m])),y.symbolSize==null&&(y.symbolSize=p&&Qe(p)||(s?_[0]:[_[0],_[0]])),y.symbol=hJ(y.symbol,function(S){return S==="none"?m:S});var x=y.symbolSize;if(x!=null){var M=-1/0;Fbe(x,function(S){S>M&&(M=S)}),y.symbolSize=hJ(x,function(S){return Vbe(S,[0,M],[0,_[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Pt),ng=Gbe;var dJ=[20,140],Hbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(n){n.mappingMethod="linear",n.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=dJ[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=dJ[1])},e.prototype._resetRange=function(){var t=this.getExtent(),i=this.option.range;!i||i.auto?(t.auto=1,this.option.range=t):pe(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],t[0]),i[1]=Math.min(i[1],t[1]))},e.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),N(this.stateList,function(t){var i=this.option.controller[t].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),i=Ti((this.get("range")||[]).slice());return i[0]>t[1]&&(i[0]=t[1]),i[1]>t[1]&&(i[1]=t[1]),i[0]=n[1]||t<=i[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var i=[];return this.eachTargetSeries(function(n){var a=[],o=n.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&a.push(l)},this),i.push({seriesId:n.id,dataIndex:a})},this),i},e.prototype.getVisualMeta=function(t){var i=mJ(this,"outOfRange",this.getExtent()),n=mJ(this,"inRange",this.option.range.slice()),a=[];function o(p,d){a.push({value:p,color:t(p,d)})}for(var s=0,l=0,u=n.length,c=i.length;lt[1])break;a.push({color:this.getControllerVisual(l,"color",i),offset:s/n})}return a.push({color:this.getControllerVisual(t[1],"color",i),offset:1}),a},e.prototype._createBarPoints=function(t,i){var n=this.visualMapModel.itemSize;return[[n[0]-i[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-i[1],t[1]]]},e.prototype._createBarGroup=function(t){var i=this._orient,n=this.visualMapModel.get("inverse");return new Ze(i==="horizontal"&&!n?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&n?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!n?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,i){if(this._useHandle){var n=this._shapes,a=this.visualMapModel,o=n.handleThumbs,s=n.handleLabels,l=a.itemSize,u=a.getExtent();Xbe([0,1],function(c){var f=o[c];f.setStyle("fill",i.handlesColor[c]),f.y=t[c];var h=$l(t[c],[0,l[1]],u,!0),p=this.getControllerVisual(h,"symbolSize");f.scaleX=f.scaleY=p/l[0],f.x=l[0]-p/2;var d=wn(n.handleLabelPoints[c],Vs(f,this.group));s[c].setStyle({x:d[0],y:d[1],text:a.formatValueText(this._dataInterval[c]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",n.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,i,n,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,f=c.indicator;if(f){f.attr("invisible",!1);var h={convertOpacityToAlpha:!0},p=this.getControllerVisual(t,"color",h),d=this.getControllerVisual(t,"symbolSize"),g=$l(t,s,u,!0),m=l[0]-d/2,v={x:f.x,y:f.y};f.y=g,f.x=m;var _=wn(c.indicatorLabelPoint,Vs(f,this.group)),y=c.indicatorLabel;y.attr("invisible",!1);var x=this._applyTransform("left",c.mainGroup),M=this._orient,S=M==="horizontal";y.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:S?x:"middle",align:S?"center":x});var w={x:m,y:g,style:{fill:p}},T={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var C={duration:100,easing:"cubicInOut",additive:!0};f.x=v.x,f.y=v.y,f.animateTo(w,C),y.animateTo(T,C)}else f.attr(w),y.attr(T);this._firstShowIndicator=!1;var b=this._shapes.handleLabels;if(b)for(var E=0;Eo[1]&&(f[1]=1/0),i&&(f[0]===-1/0?this._showIndicator(c,f[1],"< ",l):f[1]===1/0?this._showIndicator(c,f[0],"> ",l):this._showIndicator(c,c,"\u2248 ",l));var h=this._hoverLinkDataIndices,p=[];(i||SJ(n))&&(p=this._hoverLinkDataIndices=n.findTargetDataIndices(f));var d=uH(h,p);this._dispatchHighDown("downplay",ag(d[0],n)),this._dispatchHighDown("highlight",ag(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var i;if(qs(t.target,function(l){var u=rt(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var n=this.ecModel.getSeriesByIndex(i.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(n)){var o=n.getData(i.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var n=0;n=0&&(a.dimension=o,i.push(a))}}),r.getData().setVisual("visualMeta",i)}}];function Kbe(r,e,t,i){for(var n=e.targetVisuals[i],a=pi.prepareVisualTypes(n),o={color:Bl(r.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),r.registerAction(wJ,TJ),N(EJ,function(e){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,e)}),r.registerPreprocessor(i3))}function $x(r){r.registerComponentModel(vJ),r.registerComponentView(bJ),Jx(r)}var Jbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],$be[this._mode].call(this,this._pieceList),this._resetSelected(t,i);var a=this.option.categories;this.resetVisual(function(o,s){n==="categories"?(o.mappingMethod="category",o.categories=Qe(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=de(this._pieceList,function(l){return l=Qe(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,i={},n=pi.listVisualTypes(),a=this.isCategory();N(t.pieces,function(s){N(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),N(i,function(s,l){var u=!1;N(this.stateList,function(c){u=u||o(t,c,l)||o(t.target,c,l)},this),!u&&N(this.stateList,function(c){(t[c]||(t[c]={}))[l]=wE.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,i){var n=this.option,a=this._pieceList,o=(i?n:t).selected||{};if(n.selected=o,N(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),n.selectedMode==="single"){var s=!1;N(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Qe(t)},e.prototype.getValueState=function(t){var i=pi.findPieceIndex(t,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var i=[],n=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=pi.findPieceIndex(l,n);c===t&&o.push(u)},this),i.push({seriesId:a.id,dataIndex:o})},this),i},e.prototype.getRepresentValue=function(t){var i;if(this.isCategory())i=t.value;else if(t.value!=null)i=t.value;else{var n=t.interval||[];i=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return i},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var i=[],n=["",""],a=this;function o(c,f){var h=a.getRepresentValue({interval:c});f||(f=a.getValueState(h));var p=t(h,f);c[0]===-1/0?n[0]=p:c[1]===1/0?n[1]=p:i.push({value:c[0],color:p},{value:c[1],color:p})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return N(s,function(c){var f=c.interval;f&&(f[0]>u&&o([u,f[0]],"outOfRange"),o(f.slice()),u=f[1])},this),{stops:i,outerColors:n}},e.type="visualMap.piecewise",e.defaultOption=Hn(ng.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(ng),$be={splitNumber:function(r){var e=this.option,t=Math.min(e.precision,20),i=this.getExtent(),n=e.splitNumber;n=Math.max(parseInt(n,10),1),e.splitNumber=n;for(var a=(i[1]-i[0])/n;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&r.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","\u2265"][i[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,n)},this)}};function RJ(r,e){var t=r.inverse;(r.orient==="vertical"?!t:t)&&e.reverse()}var LJ=Jbe;var Qbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var i=this.visualMapModel,n=i.get("textGap"),a=i.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=i.itemSize,c=this._getViewData(),f=c.endsText,h=Br(i.get("showLabel",!0),!f);f&&this._renderEndsText(t,f[0],u,h,l),N(c.viewPieceList,function(p){var d=p.piece,g=new Ze;g.onclick=Be(this._onItemClick,this,d),this._enableHoverLink(g,p.indexInModelPieceList);var m=i.getRepresentValue(d);if(this._createItemSymbol(g,m,[0,0,u[0],u[1]]),h){var v=this.visualMapModel.getValueState(m);g.add(new Lt({style:{x:l==="right"?-n:u[0]+n,y:u[1]/2,text:d.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:v==="outOfRange"?.5:1}}))}t.add(g)},this),f&&this._renderEndsText(t,f[1],u,h,l),Xs(i.get("orient"),t,i.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,i){var n=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=n.visualMapModel;s.option.hoverLink&&n.api.dispatchAction({type:o,batch:ag(s.findTargetDataIndices(i),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,i=t.option;if(i.orient==="vertical")return EE(t,this.api,t.itemSize);var n=i.align;return(!n||n==="auto")&&(n="left"),n},e.prototype._renderEndsText=function(t,i,n,a,o){if(i){var s=new Ze,l=this.visualMapModel.textStyleModel;s.add(new Lt({style:fr(l,{x:a?o==="right"?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:a?o:"center",text:i})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,i=de(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),n=t.get("text"),a=t.get("orient"),o=t.get("inverse");return(a==="horizontal"?o:!o)?i.reverse():n&&(n=n.slice().reverse()),{viewPieceList:i,endsText:n}},e.prototype._createItemSymbol=function(t,i,n){t.add(Sr(this.getControllerVisual(i,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(i,"color")))},e.prototype._onItemClick=function(t){var i=this.visualMapModel,n=i.option,a=n.selectedMode;if(a){var o=Qe(n.selected),s=i.getSelectedMapKey(t);a==="single"||a===!0?(o[s]=!0,N(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(TE),PJ=Qbe;function Qx(r){r.registerComponentModel(LJ),r.registerComponentView(PJ),Jx(r)}function n3(r){It($x),It(Qx)}var ewe={label:{enabled:!0},decal:{show:!1}},DJ=vt(),twe={};function a3(r,e){var t=r.getModel("aria");if(!t.get("enabled"))return;var i=Qe(ewe);_t(i.label,r.getLocaleModel().get("aria"),!1),_t(t.option,i,!1),n(),a();function n(){var u=t.getModel("decal"),c=u.get("show");if(c){var f=ke();r.eachSeries(function(h){if(!h.isColorBySeries()){var p=f.get(h.type);p||(p={},f.set(h.type,p)),DJ(h).scope=p}}),r.eachRawSeries(function(h){if(r.isSeriesFiltered(h))return;if(He(h.enableAriaDecal)){h.enableAriaDecal();return}var p=h.getData();if(h.isColorBySeries()){var _=D_(h.ecModel,h.name,twe,r.getSeriesCount()),y=p.getVisual("decal");p.setVisual("decal",x(y,_))}else{var d=h.getRawData(),g={},m=DJ(h).scope;p.each(function(M){var S=p.getRawIndex(M);g[S]=M});var v=d.count();d.each(function(M){var S=g[M],w=d.getName(M)||M+"",T=D_(h.ecModel,w,m,v),C=p.getItemVisual(S,"decal");p.setItemVisual(S,"decal",x(C,T))})}function x(M,S){var w=M?fe(fe({},S),M):S;return w.dirty=!0,w}})}}function a(){var u=r.getLocaleModel().get("aria"),c=t.getModel("label");if(c.option=Ye(c.option,u),!!c.get("enabled")){var f=e.getZr().dom;if(c.get("description")){f.setAttribute("aria-label",c.get("description"));return}var h=r.getSeriesCount(),p=c.get(["data","maxCount"])||10,d=c.get(["series","maxCount"])||10,g=Math.min(h,d),m;if(!(h<1)){var v=s();if(v){var _=c.get(["general","withTitle"]);m=o(_,{title:v})}else m=c.get(["general","withoutTitle"]);var y=[],x=h>1?c.get(["series","multiple","prefix"]):c.get(["series","single","prefix"]);m+=o(x,{seriesCount:h}),r.eachSeries(function(T,C){if(C1?c.get(["series","multiple",I]):c.get(["series","single",I]),b=o(b,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var R=T.getData();if(R.count()>p){var A=c.get(["data","partialData"]);b+=o(A,{displayCnt:p})}else b+=c.get(["data","allData"]);for(var D=c.get(["data","separator","middle"]),U=c.get(["data","separator","end"]),B=[],z=0;z":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},rwe=function(){function r(e){var t=this._condVal=Ce(e)?new RegExp(e):FV(e)?e:null;if(t==null){var i="";ur(i)}}return r.prototype.evaluate=function(e){var t=typeof e;return Ce(t)?this._condVal.test(e):Ct(t)?this._condVal.test(e+""):!1},r}(),iwe=function(){function r(){}return r.prototype.evaluate=function(){return this.value},r}(),nwe=function(){function r(){}return r.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&i.push(n),n=[R,A]}function c(R,A,D,U){sg(R,D)&&sg(A,U)||n.push(R,A,D,U,D,U)}function f(R,A,D,U,B,z){var k=Math.abs(A-R),G=Math.tan(k/4)*4/3,Y=AT:E2&&i.push(n),i}function f3(r,e,t,i,n,a,o,s,l,u){if(sg(r,t)&&sg(e,i)&&sg(n,o)&&sg(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-r,p=s-e,d=Math.sqrt(h*h+p*p);h/=d,p/=d;var g=t-r,m=i-e,v=n-o,_=a-s,y=g*g+m*m,x=v*v+_*_;if(y=0&&T=0){l.push(o,s);return}var C=[],b=[];jo(r,t,n,o,.5,C),jo(e,i,a,s,.5,b),f3(C[0],b[0],C[1],b[1],C[2],b[2],C[3],b[3],l,u),f3(C[4],b[4],C[5],b[5],C[6],b[6],C[7],b[7],l,u)}function BJ(r,e){var t=AE(r),i=[];e=e||1;for(var n=0;n0)for(var u=0;uMath.abs(u),f=HJ([l,u],c?0:1,e),h=(c?s:u)/f.length,p=0;pn,o=HJ([i,n],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=r[s]/o.length,h=0;h1?null:new Nt(g*l+r,g*u+e)}function mwe(r,e,t){var i=new Nt;Nt.sub(i,t,e),i.normalize();var n=new Nt;Nt.sub(n,r,e);var a=n.dot(i);return a}function lg(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function vwe(r,e,t){for(var i=r.length,n=[],a=0;ao?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),vwe(e,u,c)}function CE(r,e,t,i){if(t===1)i.push(e);else{var n=Math.floor(t/2),a=r(e);CE(r,a[0],n,i),CE(r,a[1],t-n,i)}return i}function gwe(r,e){for(var t=[],i=0;i0)for(var M=i/t,S=-i/2;S<=i/2;S+=M){for(var w=Math.sin(S),T=Math.cos(S),C=0,y=0;y0;u/=2){var c=0,f=0;(r&u)>0&&(c=1),(e&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(r=u-1-r,e=u-1-e),l=r,r=e,e=l)}return s}function LE(r){var e=1/0,t=1/0,i=-1/0,n=-1/0,a=de(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),t=Math.min(f,t),i=Math.max(c,i),n=Math.max(f,n),[c,f]}),o=de(a,function(s,l){return{cp:s,z:Twe(s[0],s[1],e,t,i,n),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function KJ(r){return WJ(r.path,r.count)}function h3(){return{fromIndividuals:[],toIndividuals:[],count:0}}function JJ(r,e,t){var i=[];function n(M){for(var S=0;S=0;n--)if(!t[n].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var a=l.length,u=Math.ceil(a/2);t[n].many=l.slice(u,a),t[s].many=l.slice(0,u),s++}return t}var Ewe={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),i=0;i0))return;var s=i.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;QJ(r)&&(u=r,c=e),QJ(e)&&(u=e,c=r);function f(v,_,y,x,M){var S=v.many,w=v.one;if(S.length===1&&!M){var T=_?S[0]:w,C=_?w:S[0];if(tS(T))f({many:[T],one:C},!0,y,x,!0);else{var b=s?Ye({delay:s(y,x)},l):l;PE(T,C,b),a(T,C,T,C,b)}}else for(var E=Ye({dividePath:Ewe[t],individualDelay:s&&function(B,z,k,G){return s(B+y,x)}},l),I=_?JJ(S,w,E):$J(w,S,E),R=I.fromIndividuals,A=I.toIndividuals,D=R.length,U=0;Ue.length,p=u?e$(c,u):e$(h?e:r,[h?r:e]),d=0,g=0;gl$))for(var a=i.getIndices(),o=0;o0&&S.group.traverse(function(T){T instanceof ut&&!T.animators.length&&T.animateFrom({style:{opacity:0}},w)})})}function a$(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function o$(r){return pe(r)?r.sort().join(","):r}function oh(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function Iwe(r,e){var t=ke(),i=ke(),n=ke();N(r.oldSeries,function(o,s){var l=r.oldDataGroupIds[s],u=r.oldData[s],c=a$(o),f=o$(c);i.set(f,{dataGroupId:l,data:u}),pe(c)&&N(c,function(h){n.set(h,{key:f,dataGroupId:l,data:u})})});function a(o){t.get(o)&&tH("Duplicated seriesKey in universalTransition "+o)}return N(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=a$(o),c=o$(u),f=i.get(c);if(f)t.set(c,{oldSeries:[{dataGroupId:f.dataGroupId,divide:oh(f.data),data:f.data}],newSeries:[{dataGroupId:s,divide:oh(l),data:l}]});else if(pe(u)){var h=[];N(u,function(g){var m=i.get(g);m.data&&h.push({dataGroupId:m.dataGroupId,divide:oh(m.data),data:m.data})}),h.length&&t.set(c,{oldSeries:h,newSeries:[{dataGroupId:s,data:l,divide:oh(l)}]})}else{var p=n.get(u);if(p){var d=t.get(p.key);d||(d={oldSeries:[{dataGroupId:p.dataGroupId,data:p.data,divide:oh(p.data)}],newSeries:[]},t.set(p.key,d)),d.newSeries.push({dataGroupId:s,data:l,divide:oh(l)})}}}}),t}function s$(r,e){for(var t=0;t=0&&n.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:oh(e.oldData[s]),groupIdDim:o.dimension})}),N($t(r.to),function(o){var s=s$(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:oh(l),groupIdDim:o.dimension})}}),n.length>0&&a.length>0&&u$(n,a,i)}function m3(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,i){N($t(i.seriesTransition),function(n){N($t(n.to),function(a){for(var o=i.updatedSeries,s=0;s{let e=class e{constructor(){this.chartInstance=null,this.options={},this.defaultTooltipOptions={tooltip:{trigger:"item",borderColor:"#00eff8",backgroundColor:"#12192C",padding:[6,14,6,14],textStyle:{fontSize:14,color:"#74FAFB"},position:"top",axisPointer:{type:"shadow"}},series:[{type:"gauge",startAngle:180,endAngle:0,center:["50%","75%"],radius:"90%",min:0,max:1,splitNumber:8,axisLine:{lineStyle:{width:6,color:[[.25,"#74FAFB"],[.5,"#74FAFB"],[.75,"#74FAFB"],[1,"#74FAFB"]]}},pointer:{icon:"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",length:"12%",width:20,offsetCenter:[0,"-60%"],itemStyle:{color:"auto"}},axisTick:{length:12,lineStyle:{color:"auto",width:2}},splitLine:{length:20,lineStyle:{color:"auto",width:5}},axisLabel:{color:"#464646",fontSize:20,distance:-60,rotate:"tangential",formatter:function(i){return""}},title:{offsetCenter:[0,"-10%"],fontSize:20},tooltip:{trigger:"item",borderColor:"#00eff8",backgroundColor:"#12192C",padding:[6,14,6,14],textStyle:{fontSize:14,color:"#74FAFB"},position:"top",axisPointer:{type:"shadow"}},detail:{fontSize:30,offsetCenter:[0,"-5%"],valueAnimation:!0,formatter:function(i){return Math.round(i*100)+""},color:"inherit"}}]}}ngOnInit(){console.log("ChartComponentComponent ngOnInit"),this.initEcharts()}ngOnChanges(i){i.options&&!i.options.isFirstChange()&&(console.log("ChartComponentComponent ngOnChanges"),this.updateChartOptions())}ngOnDestroy(){this.chartInstance&&(console.log("ChartComponentComponent ngOnInit"),this.chartInstance.dispose())}initEcharts(){let i=this.chartContainer.nativeElement;this.chartInstance=P6(i,"dark");let n=XM(XM({},this.defaultTooltipOptions),this.options);this.chartInstance.setOption(n)}updateChartOptions(){this.chartInstance&&this.chartInstance.setOption(this.options)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["app-chart-component"]],viewQuery:function(n,a){if(n&1&&Tc(Uwe,7),n&2){let o;oa(o=sa())&&(a.chartContainer=o.first)}},inputs:{options:"options"},standalone:!0,features:[R0,ui],decls:2,vars:0,consts:[[2,"width","100%","height","100%"],["chart",""]],template:function(n,a){n&1&&Yr(0,"div",0,1)}});let r=e;return r})();var sh=["*"];function Owe(r,e){if(r&1&&Yr(0,"nz-avatar",3),r&2){let t=Nr();Tt("nzSrc",t.nzSrc)}}function zwe(r,e){r&1&&Li(0,0,["*ngIf","!nzSrc"])}function Fwe(r,e){if(r&1&&Yr(0,"nz-list-item-meta-avatar",3),r&2){let t=Nr();Tt("nzSrc",t.avatarStr)}}function Bwe(r,e){if(r&1&&(Jt(0,"nz-list-item-meta-avatar"),dV(1,4),nr()),r&2){let t=Nr();Ot(),Tt("ngTemplateOutlet",t.avatarTpl)}}function kwe(r,e){if(r&1&&(Sl(0),Wi(1),Ml()),r&2){let t=Nr(3);Ot(),ym(t.nzTitle)}}function Vwe(r,e){if(r&1&&(Jt(0,"nz-list-item-meta-title"),Pr(1,kwe,2,1,"ng-container",6),nr()),r&2){let t=Nr(2);Ot(),Tt("nzStringTemplateOutlet",t.nzTitle)}}function Gwe(r,e){if(r&1&&(Sl(0),Wi(1),Ml()),r&2){let t=Nr(3);Ot(),ym(t.nzDescription)}}function Hwe(r,e){if(r&1&&(Jt(0,"nz-list-item-meta-description"),Pr(1,Gwe,2,1,"ng-container",6),nr()),r&2){let t=Nr(2);Ot(),Tt("nzStringTemplateOutlet",t.nzDescription)}}function Wwe(r,e){if(r&1&&(Jt(0,"div",5),Pr(1,Vwe,2,1,"nz-list-item-meta-title",1)(2,Hwe,2,1,"nz-list-item-meta-description",1),Li(3,1),Li(4,2),nr()),r&2){let t=Nr();Ot(),Tt("ngIf",t.nzTitle&&!t.titleComponent),Ot(),Tt("ngIf",t.nzDescription&&!t.descriptionComponent)}}var Xwe=[[["nz-list-item-meta-avatar"]],[["nz-list-item-meta-title"]],[["nz-list-item-meta-description"]]],Ywe=["nz-list-item-meta-avatar","nz-list-item-meta-title","nz-list-item-meta-description"];function qwe(r,e){r&1&&Li(0)}var Zwe=["nz-list-item-actions",""];function jwe(r,e){}function Kwe(r,e){r&1&&Yr(0,"em",3)}function Jwe(r,e){if(r&1&&(Jt(0,"li"),Pr(1,jwe,0,0,"ng-template",1)(2,Kwe,1,0,"em",2),nr()),r&2){let t=e.$implicit,i=e.last;Ot(),Tt("ngTemplateOutlet",t),Ot(),Tt("ngIf",!i)}}function $we(r,e){}var g$=(r,e)=>({$implicit:r,index:e});function Qwe(r,e){if(r&1&&(Sl(0),Pr(1,$we,0,0,"ng-template",9),Ml()),r&2){let t=e.$implicit,i=e.index,n=Nr(2);Ot(),Tt("ngTemplateOutlet",n.nzRenderItem)("ngTemplateOutletContext",rL(2,g$,t,i))}}function e1e(r,e){if(r&1&&(Jt(0,"div",7),Pr(1,Qwe,2,5,"ng-container",8),Li(2,4),nr()),r&2){let t=Nr();Ot(),Tt("ngForOf",t.nzDataSource)}}function t1e(r,e){if(r&1&&(Sl(0),Wi(1),Ml()),r&2){let t=Nr(2);Ot(),ym(t.nzHeader)}}function r1e(r,e){if(r&1&&(Jt(0,"nz-list-header"),Pr(1,t1e,2,1,"ng-container",10),nr()),r&2){let t=Nr();Ot(),Tt("nzStringTemplateOutlet",t.nzHeader)}}function i1e(r,e){r&1&&Yr(0,"div"),r&2&&hV("min-height",53,"px")}function n1e(r,e){}function a1e(r,e){if(r&1&&(Jt(0,"div",13),Pr(1,n1e,0,0,"ng-template",9),nr()),r&2){let t=e.$implicit,i=e.index,n=Nr(2);Tt("nzSpan",n.nzGrid.span||null)("nzXs",n.nzGrid.xs||null)("nzSm",n.nzGrid.sm||null)("nzMd",n.nzGrid.md||null)("nzLg",n.nzGrid.lg||null)("nzXl",n.nzGrid.xl||null)("nzXXl",n.nzGrid.xxl||null),Ot(),Tt("ngTemplateOutlet",n.nzRenderItem)("ngTemplateOutletContext",rL(9,g$,t,i))}}function o1e(r,e){if(r&1&&(Jt(0,"div",11),Pr(1,a1e,2,12,"div",12),nr()),r&2){let t=Nr();Tt("nzGutter",t.nzGrid.gutter||null),Ot(),Tt("ngForOf",t.nzDataSource)}}function s1e(r,e){if(r&1&&Yr(0,"nz-list-empty",14),r&2){let t=Nr();Tt("nzNoResult",t.nzNoResult)}}function l1e(r,e){if(r&1&&(Sl(0),Wi(1),Ml()),r&2){let t=Nr(2);Ot(),ym(t.nzFooter)}}function u1e(r,e){if(r&1&&(Jt(0,"nz-list-footer"),Pr(1,l1e,2,1,"ng-container",10),nr()),r&2){let t=Nr();Ot(),Tt("nzStringTemplateOutlet",t.nzFooter)}}function c1e(r,e){}function f1e(r,e){}function h1e(r,e){if(r&1&&(Jt(0,"nz-list-pagination"),Pr(1,f1e,0,0,"ng-template",6),nr()),r&2){let t=Nr();Ot(),Tt("ngTemplateOutlet",t.nzPagination)}}var p1e=[[["nz-list-header"]],[["nz-list-footer"],["","nz-list-footer",""]],[["nz-list-load-more"],["","nz-list-load-more",""]],[["nz-list-pagination"],["","nz-list-pagination",""]],"*"],d1e=["nz-list-header","nz-list-footer, [nz-list-footer]","nz-list-load-more, [nz-list-load-more]","nz-list-pagination, [nz-list-pagination]","*"];function m1e(r,e){if(r&1&&Yr(0,"ul",6),r&2){let t=Nr(2);Tt("nzActions",t.nzActions)}}function v1e(r,e){if(r&1&&(Pr(0,m1e,1,1,"ul",5),Li(1)),r&2){let t=Nr();Tt("ngIf",t.nzActions&&t.nzActions.length>0)}}function g1e(r,e){if(r&1&&(Sl(0),Wi(1),Ml()),r&2){let t=Nr(3);Ot(),ym(t.nzContent)}}function y1e(r,e){if(r&1&&(Sl(0),Pr(1,g1e,2,1,"ng-container",8),Ml()),r&2){let t=Nr(2);Ot(),Tt("nzStringTemplateOutlet",t.nzContent)}}function _1e(r,e){if(r&1&&(Li(0,1),Li(1,2),Pr(2,y1e,2,1,"ng-container",7)),r&2){let t=Nr();Ot(2),Tt("ngIf",t.nzContent)}}function x1e(r,e){r&1&&Li(0,3)}function S1e(r,e){}function M1e(r,e){}function b1e(r,e){}function w1e(r,e){}function T1e(r,e){if(r&1&&Pr(0,S1e,0,0,"ng-template",9)(1,M1e,0,0,"ng-template",9)(2,b1e,0,0,"ng-template",9)(3,w1e,0,0,"ng-template",9),r&2){let t=Nr(),i=vu(3),n=vu(5),a=vu(1);Tt("ngTemplateOutlet",i),Ot(),Tt("ngTemplateOutlet",t.nzExtra),Ot(),Tt("ngTemplateOutlet",n),Ot(),Tt("ngTemplateOutlet",a)}}function E1e(r,e){}function A1e(r,e){}function C1e(r,e){}function R1e(r,e){if(r&1&&(Jt(0,"nz-list-item-extra"),Pr(1,C1e,0,0,"ng-template",9),nr()),r&2){let t=Nr(2);Ot(),Tt("ngTemplateOutlet",t.nzExtra)}}function L1e(r,e){}function P1e(r,e){if(r&1&&(Sl(0),Jt(1,"div",10),Pr(2,E1e,0,0,"ng-template",9)(3,A1e,0,0,"ng-template",9),nr(),Pr(4,R1e,2,1,"nz-list-item-extra",7)(5,L1e,0,0,"ng-template",9),Ml()),r&2){let t=Nr(),i=vu(3),n=vu(1),a=vu(5);Ot(2),Tt("ngTemplateOutlet",i),Ot(),Tt("ngTemplateOutlet",n),Ot(),Tt("ngIf",t.nzExtra),Ot(),Tt("ngTemplateOutlet",a)}}var D1e=[[["nz-list-item-actions"],["","nz-list-item-actions",""]],[["nz-list-item-meta"],["","nz-list-item-meta",""]],"*",[["nz-list-item-extra"],["","nz-list-item-extra",""]]],I1e=["nz-list-item-actions, [nz-list-item-actions]","nz-list-item-meta, [nz-list-item-meta]","*","nz-list-item-extra, [nz-list-item-extra]"],h$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-item-meta-title"]],exportAs:["nzListItemMetaTitle"],standalone:!0,features:[ui],ngContentSelectors:sh,decls:2,vars:0,consts:[[1,"ant-list-item-meta-title"]],template:function(n,a){n&1&&(Wo(),Jt(0,"h4",0),Li(1),nr())},encapsulation:2,changeDetection:0});let r=e;return r})(),p$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-item-meta-description"]],exportAs:["nzListItemMetaDescription"],standalone:!0,features:[ui],ngContentSelectors:sh,decls:2,vars:0,consts:[[1,"ant-list-item-meta-description"]],template:function(n,a){n&1&&(Wo(),Jt(0,"div",0),Li(1),nr())},encapsulation:2,changeDetection:0});let r=e;return r})(),y$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-item-meta-avatar"]],inputs:{nzSrc:"nzSrc"},exportAs:["nzListItemMetaAvatar"],standalone:!0,features:[ui],ngContentSelectors:sh,decls:3,vars:2,consts:[[1,"ant-list-item-meta-avatar"],[3,"nzSrc",4,"ngIf"],[4,"ngIf"],[3,"nzSrc"]],template:function(n,a){n&1&&(Wo(),Jt(0,"div",0),Pr(1,Owe,1,1,"nz-avatar",1)(2,zwe,1,0,"ng-content",2),nr()),n&2&&(Ot(),Tt("ngIf",a.nzSrc),Ot(),Tt("ngIf",!a.nzSrc))},dependencies:[Tl,EV,Ec],encapsulation:2,changeDetection:0});let r=e;return r})(),N1e=(()=>{let e=class e{set nzAvatar(i){i instanceof tL?(this.avatarStr="",this.avatarTpl=i):this.avatarStr=i}constructor(i){this.elementRef=i,this.avatarStr=""}};e.\u0275fac=function(n){return new(n||e)(Ho(qM))},e.\u0275cmp=li({type:e,selectors:[["nz-list-item-meta"],["","nz-list-item-meta",""]],contentQueries:function(n,a,o){if(n&1&&(wc(o,p$,5),wc(o,h$,5)),n&2){let s;oa(s=sa())&&(a.descriptionComponent=s.first),oa(s=sa())&&(a.titleComponent=s.first)}},hostAttrs:[1,"ant-list-item-meta"],inputs:{nzAvatar:"nzAvatar",nzTitle:"nzTitle",nzDescription:"nzDescription"},exportAs:["nzListItemMeta"],standalone:!0,features:[ui],ngContentSelectors:Ywe,decls:4,vars:3,consts:[[3,"nzSrc",4,"ngIf"],[4,"ngIf"],["class","ant-list-item-meta-content",4,"ngIf"],[3,"nzSrc"],[3,"ngTemplateOutlet"],[1,"ant-list-item-meta-content"],[4,"nzStringTemplateOutlet"]],template:function(n,a){n&1&&(Wo(Xwe),Pr(0,Fwe,1,1,"nz-list-item-meta-avatar",0)(1,Bwe,2,1,"nz-list-item-meta-avatar",1),Li(2),Pr(3,Wwe,5,2,"div",2)),n&2&&(Tt("ngIf",a.avatarStr),Ot(),Tt("ngIf",a.avatarTpl),Ot(2),Tt("ngIf",a.nzTitle||a.nzDescription||a.descriptionComponent||a.titleComponent))},dependencies:[y$,Ec,L0,h$,jM,ZM,p$],encapsulation:2,changeDetection:0});let r=e;return r})(),d$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-item-extra"],["","nz-list-item-extra",""]],hostAttrs:[1,"ant-list-item-extra"],exportAs:["nzListItemExtra"],standalone:!0,features:[ui],ngContentSelectors:sh,decls:1,vars:0,template:function(n,a){n&1&&(Wo(),Li(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),U1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-item-action"]],viewQuery:function(n,a){if(n&1&&Tc(tL,5),n&2){let o;oa(o=sa())&&(a.templateRef=o.first)}},exportAs:["nzListItemAction"],standalone:!0,features:[ui],ngContentSelectors:sh,decls:1,vars:0,template:function(n,a){n&1&&(Wo(),Pr(0,qwe,1,0,"ng-template"))},encapsulation:2,changeDetection:0});let r=e;return r})(),O1e=(()=>{let e=class e{constructor(i,n,a){this.ngZone=i,this.nzActions=[],this.actions=[],this.inputActionChanges$=new ZR,this.contentChildrenChanges$=iV(()=>this.nzListItemActions?rV(null):this.ngZone.onStable.pipe(aV(1),this.enterZone(),oV(()=>this.nzListItemActions.changes.pipe(sV(this.nzListItemActions))))),nV(this.contentChildrenChanges$,this.inputActionChanges$).pipe(jR(a)).subscribe(()=>{this.nzActions.length?this.actions=this.nzActions:this.actions=this.nzListItemActions.map(o=>o.templateRef),n.detectChanges()})}ngOnChanges(){this.inputActionChanges$.next(null)}enterZone(){return i=>new eV(n=>i.subscribe({next:a=>this.ngZone.run(()=>n.next(a))}))}};e.\u0275fac=function(n){return new(n||e)(Ho(fV),Ho(KR),Ho(JM))},e.\u0275cmp=li({type:e,selectors:[["ul","nz-list-item-actions",""]],contentQueries:function(n,a,o){if(n&1&&wc(o,U1e,4),n&2){let s;oa(s=sa())&&(a.nzListItemActions=s)}},hostAttrs:[1,"ant-list-item-action"],inputs:{nzActions:"nzActions"},exportAs:["nzListItemActions"],standalone:!0,features:[vV([JM]),R0,ui],attrs:Zwe,decls:1,vars:1,consts:[[4,"ngFor","ngForOf"],[3,"ngTemplateOutlet"],["class","ant-list-item-action-split",4,"ngIf"],[1,"ant-list-item-action-split"]],template:function(n,a){n&1&&Pr(0,Jwe,3,2,"li",0),n&2&&Tt("ngForOf",a.actions)},dependencies:[iL,L0,Ec],encapsulation:2,changeDetection:0});let r=e;return r})(),_$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-empty"]],hostAttrs:[1,"ant-list-empty-text"],inputs:{nzNoResult:"nzNoResult"},exportAs:["nzListHeader"],standalone:!0,features:[ui],decls:1,vars:2,consts:[[3,"nzComponentName","specificContent"]],template:function(n,a){n&1&&Yr(0,"nz-embed-empty",0),n&2&&Tt("nzComponentName","list")("specificContent",a.nzNoResult)},dependencies:[bV,MV],encapsulation:2,changeDetection:0});let r=e;return r})(),z1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-header"]],hostAttrs:[1,"ant-list-header"],exportAs:["nzListHeader"],standalone:!0,features:[ui],ngContentSelectors:sh,decls:1,vars:0,template:function(n,a){n&1&&(Wo(),Li(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),m$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-footer"]],hostAttrs:[1,"ant-list-footer"],exportAs:["nzListFooter"],standalone:!0,features:[ui],ngContentSelectors:sh,decls:1,vars:0,template:function(n,a){n&1&&(Wo(),Li(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),v$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["nz-list-pagination"]],hostAttrs:[1,"ant-list-pagination"],exportAs:["nzListPagination"],standalone:!0,features:[ui],ngContentSelectors:sh,decls:1,vars:0,template:function(n,a){n&1&&(Wo(),Li(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),F1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=cV({type:e,selectors:[["nz-list-load-more"]],exportAs:["nzListLoadMoreDirective"],standalone:!0});let r=e;return r})();var x$=(()=>{let e=class e{get itemLayoutNotify$(){return this.itemLayoutNotifySource.asObservable()}constructor(i){this.directionality=i,this.nzBordered=!1,this.nzGrid="",this.nzItemLayout="horizontal",this.nzRenderItem=null,this.nzLoading=!1,this.nzLoadMore=null,this.nzSize="default",this.nzSplit=!0,this.hasSomethingAfterLastItem=!1,this.dir="ltr",this.itemLayoutNotifySource=new tV(this.nzItemLayout),this.destroy$=new ZR}ngOnInit(){this.dir=this.directionality.value,this.directionality.change?.pipe(jR(this.destroy$)).subscribe(i=>{this.dir=i})}getSomethingAfterLastItem(){return!!(this.nzLoadMore||this.nzPagination||this.nzFooter||this.nzListFooterComponent||this.nzListPaginationComponent||this.nzListLoadMoreDirective)}ngOnChanges(i){i.nzItemLayout&&this.itemLayoutNotifySource.next(this.nzItemLayout)}ngOnDestroy(){this.itemLayoutNotifySource.unsubscribe(),this.destroy$.next(),this.destroy$.complete()}ngAfterContentInit(){this.hasSomethingAfterLastItem=this.getSomethingAfterLastItem()}};e.\u0275fac=function(n){return new(n||e)(Ho(xV,8))},e.\u0275cmp=li({type:e,selectors:[["nz-list"],["","nz-list",""]],contentQueries:function(n,a,o){if(n&1&&(wc(o,m$,5),wc(o,v$,5),wc(o,F1e,5)),n&2){let s;oa(s=sa())&&(a.nzListFooterComponent=s.first),oa(s=sa())&&(a.nzListPaginationComponent=s.first),oa(s=sa())&&(a.nzListLoadMoreDirective=s.first)}},hostAttrs:[1,"ant-list"],hostVars:16,hostBindings:function(n,a){n&2&&JR("ant-list-rtl",a.dir==="rtl")("ant-list-vertical",a.nzItemLayout==="vertical")("ant-list-lg",a.nzSize==="large")("ant-list-sm",a.nzSize==="small")("ant-list-split",a.nzSplit)("ant-list-bordered",a.nzBordered)("ant-list-loading",a.nzLoading)("ant-list-something-after-last-item",a.hasSomethingAfterLastItem)},inputs:{nzDataSource:"nzDataSource",nzBordered:"nzBordered",nzGrid:"nzGrid",nzHeader:"nzHeader",nzFooter:"nzFooter",nzItemLayout:"nzItemLayout",nzRenderItem:"nzRenderItem",nzLoading:"nzLoading",nzLoadMore:"nzLoadMore",nzPagination:"nzPagination",nzSize:"nzSize",nzSplit:"nzSplit",nzNoResult:"nzNoResult"},exportAs:["nzList"],standalone:!0,features:[R0,ui],ngContentSelectors:d1e,decls:15,vars:9,consts:[["itemsTpl",""],[4,"ngIf"],[3,"nzSpinning"],[3,"min-height",4,"ngIf"],["nz-row","",3,"nzGutter",4,"ngIf","ngIfElse"],[3,"nzNoResult",4,"ngIf"],[3,"ngTemplateOutlet"],[1,"ant-list-items"],[4,"ngFor","ngForOf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"nzStringTemplateOutlet"],["nz-row","",3,"nzGutter"],["nz-col","",3,"nzSpan","nzXs","nzSm","nzMd","nzLg","nzXl","nzXXl",4,"ngFor","ngForOf"],["nz-col","",3,"nzSpan","nzXs","nzSm","nzMd","nzLg","nzXl","nzXXl"],[3,"nzNoResult"]],template:function(n,a){if(n&1&&(Wo(p1e),Pr(0,e1e,3,1,"ng-template",null,0,_m)(2,r1e,2,1,"nz-list-header",1),Li(3),Jt(4,"nz-spin",2),Sl(5),Pr(6,i1e,1,2,"div",3)(7,o1e,2,2,"div",4)(8,s1e,1,1,"nz-list-empty",5),Ml(),nr(),Pr(9,u1e,2,1,"nz-list-footer",1),Li(10,1),Pr(11,c1e,0,0,"ng-template",6),Li(12,2),Pr(13,h1e,2,1,"nz-list-pagination",1),Li(14,3)),n&2){let o=vu(1);Ot(2),Tt("ngIf",a.nzHeader),Ot(2),Tt("nzSpinning",a.nzLoading),Ot(2),Tt("ngIf",a.nzLoading&&a.nzDataSource&&a.nzDataSource.length===0),Ot(),Tt("ngIf",a.nzGrid&&a.nzDataSource)("ngIfElse",o),Ot(),Tt("ngIf",!a.nzLoading&&a.nzDataSource&&a.nzDataSource.length===0),Ot(),Tt("ngIf",a.nzFooter),Ot(2),Tt("ngTemplateOutlet",a.nzLoadMore),Ot(2),Tt("ngIf",a.nzPagination)}},dependencies:[L0,iL,z1e,Ec,jM,ZM,bl,TV,wl,Sm,xm,_$,m$,v$],encapsulation:2,changeDetection:0});let r=e;return C0([P0()],r.prototype,"nzBordered",void 0),C0([P0()],r.prototype,"nzLoading",void 0),C0([P0()],r.prototype,"nzSplit",void 0),r})(),B1e=(()=>{let e=class e{get isVerticalAndExtra(){return this.itemLayout==="vertical"&&(!!this.listItemExtraDirective||!!this.nzExtra)}constructor(i,n){this.parentComp=i,this.cdr=n,this.nzActions=[],this.nzExtra=null,this.nzNoFlex=!1}ngAfterViewInit(){this.itemLayout$=this.parentComp.itemLayoutNotify$.subscribe(i=>{this.itemLayout=i,this.cdr.detectChanges()})}ngOnDestroy(){this.itemLayout$&&this.itemLayout$.unsubscribe()}};e.\u0275fac=function(n){return new(n||e)(Ho(x$),Ho(KR))},e.\u0275cmp=li({type:e,selectors:[["nz-list-item"],["","nz-list-item",""]],contentQueries:function(n,a,o){if(n&1&&wc(o,d$,5),n&2){let s;oa(s=sa())&&(a.listItemExtraDirective=s.first)}},hostAttrs:[1,"ant-list-item"],hostVars:2,hostBindings:function(n,a){n&2&&JR("ant-list-item-no-flex",a.nzNoFlex)},inputs:{nzActions:"nzActions",nzContent:"nzContent",nzExtra:"nzExtra",nzNoFlex:"nzNoFlex"},exportAs:["nzListItem"],standalone:!0,features:[ui],ngContentSelectors:I1e,decls:9,vars:2,consts:[["actionsTpl",""],["contentTpl",""],["extraTpl",""],["simpleTpl",""],[4,"ngIf","ngIfElse"],["nz-list-item-actions","",3,"nzActions",4,"ngIf"],["nz-list-item-actions","",3,"nzActions"],[4,"ngIf"],[4,"nzStringTemplateOutlet"],[3,"ngTemplateOutlet"],[1,"ant-list-item-main"]],template:function(n,a){if(n&1&&(Wo(D1e),Pr(0,v1e,2,1,"ng-template",null,0,_m)(2,_1e,3,1,"ng-template",null,1,_m)(4,x1e,1,0,"ng-template",null,2,_m)(6,T1e,4,4,"ng-template",null,3,_m)(8,P1e,6,4,"ng-container",4)),n&2){let o=vu(7);Ot(8),Tt("ngIf",a.isVerticalAndExtra)("ngIfElse",o)}},dependencies:[O1e,Ec,jM,ZM,L0,d$],encapsulation:2,changeDetection:0});let r=e;return C0([P0()],r.prototype,"nzNoFlex",void 0),r})();var S$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=uV({type:e}),e.\u0275inj=lV({imports:[x$,_$,B1e,N1e,y$]});let r=e;return r})();var V1e=r=>({margin:r,width:"100%",height:"16rem"});function G1e(r,e){if(r&1&&Yr(0,"app-chart-component",28),r&2){let t=Nr(2).$implicit,i=Nr();pV(yV(3,V1e,"20px "+20/i.chartConfig.rowNumber+"px")),Tt("options",t.options)}}function H1e(r,e){if(r&1&&(Jt(0,"div",26),Pr(1,G1e,1,5,"app-chart-component",27),nr()),r&2){let t=Nr().$implicit,i=Nr();Tt("nzSpan",24/i.chartConfig.rowNumber),Ot(),Tt("ngIf",t.checked)}}function W1e(r,e){if(r&1&&Pr(0,H1e,2,2,"div",25),r&2){let t=e.$implicit;Tt("ngIf",t.checked)}}function X1e(r,e){if(r&1&&(Jt(0,"div",4)(1,"div",29),Yr(2,"app-chart-component",30),nr()()),r&2){let t=e.$implicit;Ot(2),Tt("options",t)}}var M$=(()=>{let e=class e{handleCheckedItems(i){console.log("\u5F53\u524D\u9009\u4E2D\u7684\u9879\u76EE:",i)}constructor(i){this._mqttService=i,this.http=aa(Dc),this.modal=aa(Pc),this.chartConfig={rowNumber:1,optionsCheckList:[{label:"\u5168\u6C34",options:{},checked:!0},{label:"\u70ED\u503C",options:{},checked:!0},{label:"\u5168\u786B",options:{},checked:!1},{label:"\u5185\u6C34",options:{},checked:!1},{label:"\u7070\u5206",options:{},checked:!1},{label:"\u6325\u53D1\u5206",options:{},checked:!1}],optionBottomList:[{}],optionsList:[{label:"\u5168\u6C34",options:{},checked:!0},{label:"\u70ED\u503C",options:{},checked:!0}],tableList:[{coldef:[{headerName:"\u65F6\u95F4",field:"rwmc",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u7CFB\u7EDF/\u8BBE\u5907",field:"rwms",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u64CD\u4F5C\u63CF\u8FF0",field:"kssj",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u64CD\u4F5C\u4EBA\u5458",field:"jhwcsj",unSortIcon:!0,minWidth:void 0,flex:1}],rowData:[]},{coldef:[{headerName:"\u5E8F\u53F7",field:"rwmc",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u65F6\u95F4",field:"kssj",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",field:"rwms",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u7B49\u7EA7",field:"dqzt",unSortIcon:!0,minWidth:void 0,flex:1}],rowData:[]}]},this.chart_options={},this.chart_options0={},this.chart_options1={},this.chart_options2={},this.chart_options3={},this.chart_options4={},this.rowData=[],this.colDefs1=[{headerName:"\u65F6\u95F4",field:"rwmc",flex:1},{headerName:"\u7CFB\u7EDF/\u8BBE\u5907",field:"rwms",flex:1},{headerName:"\u64CD\u4F5C\u63CF\u8FF0",field:"kssj",flex:1},{headerName:"\u64CD\u4F5C\u4EBA\u5458",field:"jhwcsj",flex:1}],this.colDefs2=[{headerName:"\u5E8F\u53F7",field:"rwmc",flex:1},{headerName:"\u65F6\u95F4",field:"kssj",flex:2},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",field:"rwms",flex:1},{headerName:"\u7B49\u7EA7",field:"dqzt",flex:1.5}],this.subscription=this._mqttService.observe("s1").subscribe(n=>{let a=JSON.parse(n.payload.toString());console.log("Received message as object: ",a.msg),this.chart_options0=a.msg})}ngOnInit(){this.getServerConfig();for(var i=1;i<30;i++)this.rowData.push({rwmc:"\u4EFB\u52A1"+i,rwms:"\u4EFB\u52A1\u63CF\u8FF0"+i,kssj:"2024-1-"+i+" 13:38:"+i*11,jhwcsj:"2024-1-"+i+" 13:38:"+i*10,sfcq:"\u5426",dqzt:"\u6B63\u5E38",dqjd:"\u8282\u70B9"+i,sjwcsj:"2024-1-"+i+" 13:38:"+i*27,bjmc:"\u62A5\u8B665",bjms:"\u62A5\u8B66\u63CF\u8FF05",bjsj:"2024-1-"+i+" 13:38:"+i*12,gzyy:"-",clff:"-",tzsj:"2024-1-"+i+" 13:38:"+i*19,zycd:"\u4E00\u822C",tzmc:"\u7CFB\u7EDF\u63D0\u793A",tznr:"\u8D26\u6237\u767B\u5F55",fj:"-",cz:"\u64CD\u4F5C"});for(var n=[],a=[],o=[],s=100,i=0;i{this.chartConfig.optionsCheckList[0].options=i.data,console.log(i)})}};e.\u0275fac=function(n){return new(n||e)(Ho(QM))},e.\u0275cmp=li({type:e,selectors:[["app-data-v-s1"]],standalone:!0,features:[ui],decls:56,vars:13,consts:[["nz-row","",1,"s1-container",3,"nzGutter"],["nz-col","","nzSpan","8"],["title","\u7CFB\u7EDF\u72B6\u6001"],["nz-row","",2,"justify-content","center","align-items","center"],["nz-col","","nzSpan","12"],[1,"centered-element"],[2,"width","26rem","height","11rem",3,"options"],[1,"sys-status-title"],["title","\u7CFB\u7EDF\u64CD\u4F5C\u8BB0\u5F55",2,"margin-top","1rem"],[1,"ag-theme-datav",3,"rowData","columnDefs"],["title","\u7CFB\u7EDF\u62A5\u8B66\u4FE1\u606F",2,"margin-top","1rem"],["title","",2,"margin-top","1rem"],[1,"progress-container"],[1,"status-text"],[2,"width","100%",3,"nzPercent","nzStrokeColor"],[1,"status-ext-text"],[1,"progress-container","mt-sm"],["title",""],[2,"height","34.6rem"],["src","assets/dashboard/dashboard_ws_demo1.png",2,"width","100%"],["nz-row","",2,"justify-content","center","align-items","center","margin-top","0.5rem"],["nz-col","","nzSpan","12",1,"sys-status-title"],["title","\u5316\u9A8C\u7ED3\u679C",3,"showSetting","optionsList","onCheckedItemsChange"],["nz-row","",1,"scrollable-container"],["nz-row",""],["nz-col","","class","centered-element",3,"nzSpan",4,"ngIf"],["nz-col","",1,"centered-element",3,"nzSpan"],[3,"options","style",4,"ngIf"],[3,"options"],[1,"centered-element",2,"margin","2px"],[2,"width","26rem","height","11rem","margin-left","0.4rem",3,"options"],["nz-col","","class","centered-element",3,"nzSpan"]],template:function(n,a){n&1&&(Jt(0,"div",0)(1,"div",1)(2,"data-v-card",2)(3,"div",3)(4,"div",4)(5,"div",5),Yr(6,"app-chart-component",6),nr(),Jt(7,"div",7),Wi(8,"\u7CFB\u7EDF\u5065\u5EB7\u5EA6"),nr()(),Jt(9,"div",4)(10,"div",5),Yr(11,"app-chart-component",6),nr(),Jt(12,"div",7),Wi(13,"\u8BBE\u5907\u6295\u8FD0\u5EA6"),nr()()()(),Jt(14,"data-v-card",8),Yr(15,"ag-grid-angular",9),nr(),Jt(16,"data-v-card",10),Yr(17,"ag-grid-angular",9),nr(),Jt(18,"data-v-card",11)(19,"div",12)(20,"span",13),Wi(21,"\u5316\u9A8C\u6548\u7387\uFF1A"),nr(),Yr(22,"nz-progress",14),Jt(23,"span",15),Wi(24,"\uFF0816/25\uFF09"),nr()(),Jt(25,"div",16)(26,"span",13),Wi(27,"\u5B8C \u6210 \u7387 \uFF1A"),nr(),Yr(28,"nz-progress",14),Jt(29,"span",15),Wi(30,"\uFF0812/20\uFF09"),nr()()()(),Jt(31,"div",1)(32,"data-v-card",17)(33,"div",18),Yr(34,"img",19),Jt(35,"div",20)(36,"div",21),Wi(37," \u673A\u5668\u4EBA "),nr(),Jt(38,"div",21),Wi(39," \u5168\u786B\u4EEA "),nr(),Jt(40,"div",21),Wi(41," \u5168\u6C34\u5206\u6790\u4EEA "),nr(),Jt(42,"div",21),Wi(43," \u6325\u53D1\u5206\u4EEA "),nr(),Jt(44,"div",21),Wi(45," \u91CF\u70ED\u4EEA "),nr(),Jt(46,"div",21),Wi(47," \u78B3\u6C22\u6C2E\u5143\u7D20 "),nr()()()()(),Jt(48,"div",1)(49,"data-v-card",22),mV("onCheckedItemsChange",function(s){return a.handleCheckedItems(s)}),Jt(50,"div",23),QR(51,W1e,1,1,"div",31,$R),nr(),Jt(53,"div",24),QR(54,X1e,3,1,"div",4,$R),nr()()()()),n&2&&(Tt("nzGutter",16),Ot(6),Tt("options",a.chart_options),Ot(5),Tt("options",a.chart_options0),Ot(4),Tt("rowData",a.rowData)("columnDefs",a.colDefs1),Ot(2),Tt("rowData",a.rowData)("columnDefs",a.colDefs2),Ot(5),Tt("nzPercent",64)("nzStrokeColor","#74FAFB"),Ot(6),Tt("nzPercent",60)("nzStrokeColor","#74FAFB"),Ot(21),Tt("showSetting",!0)("optionsList",a.chartConfig.optionsCheckList),Ot(2),eL(a.chartConfig.optionsCheckList),Ot(3),eL(a.chartConfig.optionBottomList))},dependencies:[_V,Ec,SV,af,AV,CV,$M,S$,Nc,Uc,$c,Yc,ef,tf,Qc,Kc,Ic,Hc,Xc,of,jc,qc,Sm,xm,wl,Cc,Vc,Gc,rf,Bc,Tl,Zc,Fc,Wc,kc,nf,Lc,Rc,Jc,zc,Ac,Oc,bl,f$],styles:[".dashboard-container[_ngcontent-%COMP%]{width:20rem;height:10rem;margin-top:-3rem;margin-bottom:-2rem}.sys-status-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:#94ddf3;text-align:center}.ag-theme-datav[_ngcontent-%COMP%]{--ag-border-color: #74FAFB;--ag-foreground-color: #74FAFB;--ag-background-color: #0A1632;--ag-header-foreground-color: #74FAFB;--ag-header-background-color: #0A1632;--ag-odd-row-background-color: #0A1632;--ag-header-column-resize-handle-color: #7e2e84;--ag-font-size: 17px;--ag-font-family: monospace;height:5rem}.centered-element[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%}.status-container[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.5rem}.status-circle[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%}.status-circle.red[_ngcontent-%COMP%]{background-color:red}.status-circle.green[_ngcontent-%COMP%]{background-color:green}.progress-container[_ngcontent-%COMP%]{display:flex;color:#fff}.progress-container[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%]{width:8rem;margin-left:6px;font-size:16px;font-weight:600;color:#74fafb}.progress-container[_ngcontent-%COMP%] .status-ext-text[_ngcontent-%COMP%]{margin-top:3px;font-size:12px}.progress-display[_ngcontent-%COMP%]{color:#fff;text-align:right}.statistic-item-container[_ngcontent-%COMP%]{display:flex;padding:1rem 0;color:#fff}.white-color-theme[_ngcontent-%COMP%]{color:#74fafb}.scrollable-container[_ngcontent-%COMP%]{scrollbar-color:auto;overflow-y:auto;width:100%;height:20rem} ::-webkit-scrollbar{width:10px} ::-webkit-scrollbar-track{background-color:#0a1632} ::-webkit-scrollbar-thumb{background-color:#74fafb;border-radius:2px} ::-webkit-scrollbar-thumb:hover{background-color:#74fafb}"]});let r=e;return r})();var Y1e=["myGrid"],q1e=()=>[12,12],b$=(()=>{let e=class e{constructor(i){this._mqttService=i,this.http=aa(Dc),this.modal=aa(Pc),this.elementRef=aa(qM),this.titleService=aa(KM),this.defaultColDef={width:170,editable:!1},this.gridThemedClass="ag-theme-quartz ag-theme-datav",this.rowData=[],this.colDefs1=[{headerName:"\u5E8F\u53F7",valueGetter:function(n){return parseInt(n.node.id)+1},width:90,sortable:!0,unSortIcon:!0,field:"xh"},{headerName:"\u4EFB\u52A1\u540D\u79F0",unSortIcon:!0,width:120,field:"rwmc"},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",unSortIcon:!0,field:"rwms",width:120},{headerName:"\u5F00\u59CB\u65F6\u95F4",headerClass:"ag-header-center",unSortIcon:!0,field:"kssj",width:180},{headerName:"\u8BA1\u5212\u5B8C\u6210\u65F6\u95F4",unSortIcon:!0,field:"jhwcsj",width:180},{headerName:"\u8D85\u671F",width:70,field:"sfcq"},{headerName:"\u64CD\u4F5C",width:90,autoHeaderHeight:!0,field:"cz",cellRenderer:D0}],this.colDefs2=[{headerName:"\u5E8F\u53F7",valueGetter:function(n){return parseInt(n.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u4EFB\u52A1\u540D\u79F0",unSortIcon:!0,field:"rwmc"},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",unSortIcon:!0,field:"rwms",minWidth:170,flex:1},{headerName:"\u5F00\u59CB\u65F6\u95F4",unSortIcon:!0,field:"kssj",minWidth:170,flex:1},{headerName:"\u5F53\u524D\u72B6\u6001",field:"dqzt"},{headerName:"\u5F53\u524D\u8282\u70B9",field:"dqjd"},{headerName:"\u5B9E\u9645\u5B8C\u6210\u65F6\u95F4",field:"sjwcsj",minWidth:170,flex:1},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:D0}],this.colDefs3=[{headerName:"\u5E8F\u53F7",valueGetter:function(n){return parseInt(n.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u62A5\u8B66\u540D\u79F0",unSortIcon:!0,field:"bjmc"},{headerName:"\u62A5\u8B66\u7B49\u7EA7",unSortIcon:!0,field:"bjdg"},{headerName:"\u62A5\u8B66\u63CF\u8FF0",unSortIcon:!0,field:"bjms",minWidth:170,flex:1},{headerName:"\u62A5\u8B66\u65F6\u95F4",unSortIcon:!0,field:"bjsj",minWidth:170,flex:1},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:D0},{headerName:"\u6545\u969C\u539F\u56E0",field:"gzyy"},{headerName:"\u5904\u7406\u65B9\u6CD5",field:"clff"},{headerName:"\u6CE8\u610F\u4E8B\u9879",field:"clff"}],this.colDefs4=[{headerName:"\u5E8F\u53F7",valueGetter:function(n){return parseInt(n.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u901A\u77E5\u65F6\u95F4",unSortIcon:!0,field:"tzsj",minWidth:170,flex:1},{headerName:"\u91CD\u8981\u7A0B\u5EA6",unSortIcon:!0,field:"zycd"},{headerName:"\u901A\u77E5\u540D\u79F0",unSortIcon:!0,field:"tzmc"},{headerName:"\u901A\u77E5\u5185\u5BB9",unSortIcon:!0,field:"tznr",minWidth:170,flex:1},{headerName:"\u9644\u4EF6",field:"fj"},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:D0}],this.client=i}ngOnInit(){this.titleService.setTitle("\u6211\u7684\u5DE5\u4F5C\u7AD9");for(var i=1;i<30;i++)this.rowData.push({rwmc:`\u4EFB\u52A1${i}`,rwms:`\u4EFB\u52A1\u63CF\u8FF0${i}`,kssj:`2024-1-${i} 13:38:${i*11}`,jhwcsj:`2024-1-${i} 13:38:${i*10}`,sfcq:"\u5426",dqzt:"\u6B63\u5E38",dqjd:`\u8282\u70B9${i}`,sjwcsj:`2024-1-${i} 13:38:${i*27}`,bjmc:"\u62A5\u8B665",bjms:"\u62A5\u8B66\u63CF\u8FF05",bjsj:`2024-1-${i} 13:38:${i*12}`,gzyy:"-",clff:"-",tzsj:`2024-1-${i} 13:38:${i*19}`,zycd:"\u4E00\u822C",tzmc:"\u7CFB\u7EDF\u63D0\u793A",tznr:"\u8D26\u6237\u767B\u5F55",fj:"-",cz:"\u64CD\u4F5C"})}ngAfterViewInit(){let i=this.elementRef.nativeElement.querySelector(".ag-theme-datav"),n=i.querySelector(".ag-body-viewport"),a=i.querySelector(".ag-scroller")}add(){}};e.\u0275fac=function(n){return new(n||e)(Ho(QM))},e.\u0275cmp=li({type:e,selectors:[["app-data-v-s1"]],viewQuery:function(n,a){if(n&1&&Tc(Y1e,5),n&2){let o;oa(o=sa())&&(a.grid=o.first)}},standalone:!0,features:[ui],decls:8,vars:15,consts:[["nz-row","",3,"nzGutter"],["title","\u5F85\u529E\u4EFB\u52A1",2,"width","50%",3,"defaultColDef","rowData","columnDefs","gridThemeClass"],["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12","title","\u5DF2\u529E\u4EFB\u52A1"],["gridThemeClass","ag-theme-quartz ag-theme-datav",2,"width","100%",3,"defaultColDef","rowData","columnDefs"],["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12","title","\u62A5\u8B66\u4FE1\u606F"],["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12","title","\u901A\u77E5"]],template:function(n,a){n&1&&(Jt(0,"div",0),Yr(1,"lj-app-ag-grid-component",1),Jt(2,"data-v-card",2),Yr(3,"app-ag-grid-component",3),nr(),Jt(4,"data-v-card",4),Yr(5,"app-ag-grid-component",3),nr(),Jt(6,"data-v-card",5),Yr(7,"app-ag-grid-component",3),nr()()),n&2&&(Tt("nzGutter",gV(14,q1e)),Ot(),Tt("defaultColDef",a.defaultColDef)("rowData",a.rowData)("columnDefs",a.colDefs1)("gridThemeClass",a.gridThemedClass),Ot(2),Tt("defaultColDef",a.defaultColDef)("rowData",a.rowData)("columnDefs",a.colDefs2),Ot(2),Tt("defaultColDef",a.defaultColDef)("rowData",a.rowData)("columnDefs",a.colDefs3),Ot(2),Tt("defaultColDef",a.defaultColDef)("rowData",a.rowData)("columnDefs",a.colDefs4))},dependencies:[RV,LV,wV,$M,Nc,Uc,$c,Yc,ef,tf,Qc,Kc,Ic,Hc,Xc,of,jc,qc,Sm,xm,wl,Cc,Vc,Gc,rf,af,Bc,Tl,Zc,Fc,Wc,kc,nf,Lc,Rc,Jc,zc,Ac,Oc,bl],styles:[".ag-header-center[_ngcontent-%COMP%] .ag-header-group-cell-label[_ngcontent-%COMP%], .ag-header-center[_ngcontent-%COMP%] .ag-header-cell-label[_ngcontent-%COMP%]{display:grid;justify-content:center;color:#000;text-align:center;background:#000} .ag-theme-datav .ag-row-selected .ag-ltr .ag-cell{color:red!important} .ag-theme-datav .ag-ltr .ag-row-focus{font-weight:600;color:red} .ag-theme-datav .ag-ltr .ag-row-focus .ag-cell-focus{border:#74FAFB} .ag-theme-datav .ag-ltr .ag-row-focus .ag-grid-button-style{color:red;border-color:red} .ag-theme-datav{--ag-border-color: #74FAFB;--ag-foreground-color: #74FAFB;--ag-background-color: #0A1632;--ag-header-foreground-color: #74FAFB;--ag-header-background-color: #0A1632;--ag-odd-row-background-color: #0A1632;--ag-header-column-resize-handle-color: #7e2e84;--ag-font-size: 12px;--ag-font-family: monospace;height:17rem;font-weight:700;border-width:3px} .ag-theme-datav .ag-header-cell-resize{--ag-header-column-resize-handle-color: #00eff8} .ag-theme-datav .ag-header-row{font-size:14px;font-weight:700} .ag-theme-datav .ag-root-wrapper{border-radius:0} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar{width:12em} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb{margin-left:40px;background-color:#00eff8;border:2px solid #00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-track{background-color:transparent;border-color:#00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover{margin-left:40px;background-color:#00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:active{background-color:#00eff8} .ag-body-vertical-scroll-viewport{scrollbar-color:auto} .ag-body-horizontal-scroll-viewport{scrollbar-color:auto} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar{height:14em;color:#000} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-track{background-color:transparent;border-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:hover{background-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:active{background-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb{background-color:#00eff8}"]});let r=e;return r})();var iS="162";var w$=0,Y3=1,T$=2;var OE=1,E$=2,al=3,Ao=0,_i=1,Co=2,vs=0,Xu=1,q3=2,Z3=3,j3=4,A$=5,Yu=100,C$=101,R$=102,K3=103,J3=104,L$=200,P$=201,D$=202,I$=203,nS=204,aS=205,N$=206,U$=207,O$=208,z$=209,F$=210,B$=211,k$=212,V$=213,G$=214,H$=0,W$=1,X$=2,cg=3,Y$=4,q$=5,Z$=6,j$=7,zE=0,K$=1,J$=2,gs=0,$$=1,Q$=2,eQ=3,tQ=4,rQ=5,iQ=6,nQ=7;var $3=300,ol=301,eu=302,oS=303,sS=304,lh=306,lS=1e3,ya=1001,uS=1002,Bi=1003,Q3=1004;var fg=1005;var Qi=1006,FE=1007;var sl=1008;var Ro=1009,aQ=1010,oQ=1011,hg=1012,BE=1013,Lo=1014,ja=1015,qu=1016,kE=1017,VE=1018,ys=1020,sQ=1021,Rn=1023,lQ=1024,uQ=1025,ll=1026,tu=1027,cQ=1028,GE=1029,fQ=1030,HE=1031,WE=1033,XE=33776,YE=33777,qE=33778,ZE=33779,ez=35840,tz=35841,rz=35842,iz=35843,jE=36196,nz=37492,az=37496,oz=37808,sz=37809,lz=37810,uz=37811,cz=37812,fz=37813,hz=37814,pz=37815,dz=37816,mz=37817,vz=37818,gz=37819,yz=37820,_z=37821,KE=36492,xz=36494,Sz=36495,hQ=36283,Mz=36284,bz=36285,wz=36286;var pQ=3200,dQ=3201,mQ=0,vQ=1,_s="",Ka="srgb",Ja="srgb-linear",pg="display-p3",vd="display-p3-linear",dg="linear",Hr="srgb",mg="rec709",vg="p3";var gd=7680;var Tz=519,gQ=512,yQ=513,_Q=514,JE=515,xQ=516,SQ=517,MQ=518,bQ=519,Ez=35044;var Az="300 es",cS=1035,$a=2e3,yd=2001;var Qa=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let n=i.slice(0);for(let a=0,o=n.length;a>8&255]+Yn[r>>16&255]+Yn[r>>24&255]+"-"+Yn[e&255]+Yn[e>>8&255]+"-"+Yn[e>>16&15|64]+Yn[e>>24&255]+"-"+Yn[t&63|128]+Yn[t>>8&255]+"-"+Yn[t>>16&255]+Yn[t>>24&255]+Yn[i&255]+Yn[i>>8&255]+Yn[i>>16&255]+Yn[i>>24&255]).toLowerCase()}function en(r,e,t){return Math.max(e,Math.min(t,r))}function wQ(r,e){return(r%e+e)%e}function QE(r,e,t){return(1-t)*r+t*e}function Cz(r){return(r&r-1)===0&&r!==0}function hS(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function gg(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function _a(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var Kt=class r{constructor(e=0,t=0){r.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(en(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),a=this.x-e.x,o=this.y-e.y;return this.x=a*i-o*n+e.x,this.y=a*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};var Qt=class r{constructor(e,t,i,n,a,o,s,l,u){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u)}set(e,t,i,n,a,o,s,l,u){let c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=a,c[5]=l,c[6]=i,c[7]=o,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[3],l=i[6],u=i[1],c=i[4],f=i[7],h=i[2],p=i[5],d=i[8],g=n[0],m=n[3],v=n[6],_=n[1],y=n[4],x=n[7],M=n[2],S=n[5],w=n[8];return a[0]=o*g+s*_+l*M,a[3]=o*m+s*y+l*S,a[6]=o*v+s*x+l*w,a[1]=u*g+c*_+f*M,a[4]=u*m+c*y+f*S,a[7]=u*v+c*x+f*w,a[2]=h*g+p*_+d*M,a[5]=h*m+p*y+d*S,a[8]=h*v+p*x+d*w,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t*o*c-t*s*u-i*a*c+i*s*l+n*a*u-n*o*l}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=c*o-s*u,h=s*l-c*a,p=u*a-o*l,d=t*f+i*h+n*p;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/d;return e[0]=f*g,e[1]=(n*u-c*i)*g,e[2]=(s*i-n*o)*g,e[3]=h*g,e[4]=(c*t-n*l)*g,e[5]=(n*a-s*t)*g,e[6]=p*g,e[7]=(i*l-u*t)*g,e[8]=(o*t-i*a)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,a,o,s){let l=Math.cos(a),u=Math.sin(a);return this.set(i*l,i*u,-i*(l*o+u*s)+o+e,-n*u,n*l,-n*(-u*o+l*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(Rz.makeScale(e,t)),this}rotate(e){return this.premultiply(Rz.makeRotation(-e)),this}translate(e,t){return this.premultiply(Rz.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Rz=new Qt;function eA(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function yg(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function EQ(){let r=yg("canvas");return r.style.display="block",r}var TQ={};function AQ(r){r in TQ||(TQ[r]=!0,console.warn(r))}var CQ=new Qt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),RQ=new Qt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),tA={[Ja]:{transfer:dg,primaries:mg,toReference:r=>r,fromReference:r=>r},[Ka]:{transfer:Hr,primaries:mg,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[vd]:{transfer:dg,primaries:vg,toReference:r=>r.applyMatrix3(RQ),fromReference:r=>r.applyMatrix3(CQ)},[pg]:{transfer:Hr,primaries:vg,toReference:r=>r.convertSRGBToLinear().applyMatrix3(RQ),fromReference:r=>r.applyMatrix3(CQ).convertLinearToSRGB()}},Z1e=new Set([Ja,vd]),Tr={enabled:!0,_workingColorSpace:Ja,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Z1e.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;let i=tA[e].toReference,n=tA[t].fromReference;return n(i(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return tA[r].primaries},getTransfer:function(r){return r===_s?dg:tA[r].transfer}};function uh(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function rA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var _g,xg=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{_g===void 0&&(_g=yg("canvas")),_g.width=e.width,_g.height=e.height;let i=_g.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=_g}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=yg("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),a=n.data;for(let o=0;o{class r extends Qa{constructor(t=r.DEFAULT_IMAGE,i=r.DEFAULT_MAPPING,n=ya,a=ya,o=Qi,s=sl,l=Rn,u=Ro,c=r.DEFAULT_ANISOTROPY,f=_s){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:K1e++}),this.uuid=ru(),this.name="",this.source=new Sg(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=n,this.wrapT=a,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=u,this.offset=new Kt(0,0),this.repeat=new Kt(1,1),this.center=new Kt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Qt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=f,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),i||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==$3)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case lS:t.x=t.x-Math.floor(t.x);break;case ya:t.x=t.x<0?0:1;break;case uS:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case lS:t.y=t.y-Math.floor(t.y);break;case ya:t.y=t.y<0?0:1;break;case uS:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}}return r.DEFAULT_IMAGE=null,r.DEFAULT_MAPPING=$3,r.DEFAULT_ANISOTROPY=1,r})();var ni=class r{constructor(e=0,t=0,i=0,n=1){r.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*a,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*a,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*a,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,a,l=e.elements,u=l[0],c=l[4],f=l[8],h=l[1],p=l[5],d=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(c-h)<.01&&Math.abs(f-g)<.01&&Math.abs(d-m)<.01){if(Math.abs(c+h)<.1&&Math.abs(f+g)<.1&&Math.abs(d+m)<.1&&Math.abs(u+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let y=(u+1)/2,x=(p+1)/2,M=(v+1)/2,S=(c+h)/4,w=(f+g)/4,T=(d+m)/4;return y>x&&y>M?y<.01?(i=0,n=.707106781,a=.707106781):(i=Math.sqrt(y),n=S/i,a=w/i):x>M?x<.01?(i=.707106781,n=0,a=.707106781):(n=Math.sqrt(x),i=S/n,a=T/n):M<.01?(i=.707106781,n=.707106781,a=0):(a=Math.sqrt(M),i=w/a,n=T/a),this.set(i,n,a,t),this}let _=Math.sqrt((m-d)*(m-d)+(f-g)*(f-g)+(h-c)*(h-c));return Math.abs(_)<.001&&(_=1),this.x=(m-d)/_,this.y=(f-g)/_,this.z=(h-c)/_,this.w=Math.acos((u+p+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};var iA=class extends Qa{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ni(0,0,e,t),this.scissorTest=!1,this.viewport=new ni(0,0,e,t);let n={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Qi,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let a=new eo(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);a.flipY=!1,a.generateMipmaps=i.generateMipmaps,a.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let s=0;s=0?1:-1,y=1-v*v;if(y>Number.EPSILON){let M=Math.sqrt(y),S=Math.atan2(M,v*_);m=Math.sin(m*S)/M,s=Math.sin(s*S)/M}let x=s*_;if(l=l*m+h*x,u=u*m+p*x,c=c*m+d*x,f=f*m+g*x,m===1-s){let M=1/Math.sqrt(l*l+u*u+c*c+f*f);l*=M,u*=M,c*=M,f*=M}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,n,a,o){let s=i[n],l=i[n+1],u=i[n+2],c=i[n+3],f=a[o],h=a[o+1],p=a[o+2],d=a[o+3];return e[t]=s*d+c*f+l*p-u*h,e[t+1]=l*d+c*h+u*f-s*p,e[t+2]=u*d+c*p+s*h-l*f,e[t+3]=c*d-s*f-l*h-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let i=e._x,n=e._y,a=e._z,o=e._order,s=Math.cos,l=Math.sin,u=s(i/2),c=s(n/2),f=s(a/2),h=l(i/2),p=l(n/2),d=l(a/2);switch(o){case"XYZ":this._x=h*c*f+u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f-h*p*d;break;case"YXZ":this._x=h*c*f+u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f+h*p*d;break;case"ZXY":this._x=h*c*f-u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f-h*p*d;break;case"ZYX":this._x=h*c*f-u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f+h*p*d;break;case"YZX":this._x=h*c*f+u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f-h*p*d;break;case"XZY":this._x=h*c*f-u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],a=t[8],o=t[1],s=t[5],l=t[9],u=t[2],c=t[6],f=t[10],h=i+s+f;if(h>0){let p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(c-l)*p,this._y=(a-u)*p,this._z=(o-n)*p}else if(i>s&&i>f){let p=2*Math.sqrt(1+i-s-f);this._w=(c-l)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(a+u)/p}else if(s>f){let p=2*Math.sqrt(1+s-i-f);this._w=(a-u)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(l+c)/p}else{let p=2*Math.sqrt(1+f-i-s);this._w=(o-n)/p,this._x=(a+u)/p,this._y=(l+c)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(en(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,a=e._z,o=e._w,s=t._x,l=t._y,u=t._z,c=t._w;return this._x=i*c+o*s+n*u-a*l,this._y=n*c+o*l+a*s-i*u,this._z=a*c+o*u+i*l-n*s,this._w=o*c-i*s-n*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,n=this._y,a=this._z,o=this._w,s=o*e._w+i*e._x+n*e._y+a*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=n,this._z=a,this;let l=1-s*s;if(l<=Number.EPSILON){let p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*a+t*this._z,this.normalize(),this}let u=Math.sqrt(l),c=Math.atan2(u,s),f=Math.sin((1-t)*c)/u,h=Math.sin(t*c)/u;return this._w=o*f+this._w*h,this._x=i*f+this._x*h,this._y=n*f+this._y*h,this._z=a*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};var be=class r{constructor(e=0,t=0,i=0){r.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(LQ.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(LQ.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*n,this.y=a[1]*t+a[4]*i+a[7]*n,this.z=a[2]*t+a[5]*i+a[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=e.elements,o=1/(a[3]*t+a[7]*i+a[11]*n+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*n+a[12])*o,this.y=(a[1]*t+a[5]*i+a[9]*n+a[13])*o,this.z=(a[2]*t+a[6]*i+a[10]*n+a[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,a=e.x,o=e.y,s=e.z,l=e.w,u=2*(o*n-s*i),c=2*(s*t-a*n),f=2*(a*i-o*t);return this.x=t+l*u+o*f-s*c,this.y=i+l*c+s*u-a*f,this.z=n+l*f+a*c-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n,this.y=a[1]*t+a[5]*i+a[9]*n,this.z=a[2]*t+a[6]*i+a[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,a=e.z,o=t.x,s=t.y,l=t.z;return this.x=n*l-a*s,this.y=a*o-i*l,this.z=i*s-n*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Pz.copy(this).projectOnVector(e),this.sub(Pz)}reflect(e){return this.sub(Pz.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(en(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Pz=new be,LQ=new nu;var ju=class{constructor(e=new be(1/0,1/0,1/0),t=new be(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}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&&this.min.z<=e.min.z&&e.max.z<=this.max.z}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),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ul),ul.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(pS),oA.subVectors(this.max,pS),bg.subVectors(e.a,pS),wg.subVectors(e.b,pS),Tg.subVectors(e.c,pS),ch.subVectors(wg,bg),fh.subVectors(Tg,wg),_d.subVectors(bg,Tg);let t=[0,-ch.z,ch.y,0,-fh.z,fh.y,0,-_d.z,_d.y,ch.z,0,-ch.x,fh.z,0,-fh.x,_d.z,0,-_d.x,-ch.y,ch.x,0,-fh.y,fh.x,0,-_d.y,_d.x,0];return!Dz(t,bg,wg,Tg,oA)||(t=[1,0,0,0,1,0,0,0,1],!Dz(t,bg,wg,Tg,oA))?!1:(sA.crossVectors(ch,fh),t=[sA.x,sA.y,sA.z],Dz(t,bg,wg,Tg,oA))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ul).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ul).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Zu[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Zu[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Zu[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Zu[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Zu[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Zu[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Zu[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Zu[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Zu),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)}},Zu=[new be,new be,new be,new be,new be,new be,new be,new be],ul=new be,aA=new ju,bg=new be,wg=new be,Tg=new be,ch=new be,fh=new be,_d=new be,pS=new be,oA=new be,sA=new be,xd=new be;function Dz(r,e,t,i,n){for(let a=0,o=r.length-3;a<=o;a+=3){xd.fromArray(r,a);let s=n.x*Math.abs(xd.x)+n.y*Math.abs(xd.y)+n.z*Math.abs(xd.z),l=e.dot(xd),u=t.dot(xd),c=i.dot(xd);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var J1e=new ju,dS=new be,Iz=new be,hh=class{constructor(e=new be,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):J1e.setFromPoints(e).getCenter(i);let n=0;for(let a=0,o=e.length;athis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;dS.subVectors(e,this.center);let t=dS.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector(dS,n/i),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Iz.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(dS.copy(e.center).add(Iz)),this.expandByPoint(dS.copy(e.center).sub(Iz))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};var Ku=new be,Nz=new be,lA=new be,ph=new be,Uz=new be,uA=new be,Oz=new be,cA=class{constructor(e=new be,t=new be(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ku)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Ku.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ku.copy(this.origin).addScaledVector(this.direction,t),Ku.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){Nz.copy(e).add(t).multiplyScalar(.5),lA.copy(t).sub(e).normalize(),ph.copy(this.origin).sub(Nz);let a=e.distanceTo(t)*.5,o=-this.direction.dot(lA),s=ph.dot(this.direction),l=-ph.dot(lA),u=ph.lengthSq(),c=Math.abs(1-o*o),f,h,p,d;if(c>0)if(f=o*l-s,h=o*s-l,d=a*c,f>=0)if(h>=-d)if(h<=d){let g=1/c;f*=g,h*=g,p=f*(f+o*h+2*s)+h*(o*f+h+2*l)+u}else h=a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;else h=-a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;else h<=-d?(f=Math.max(0,-(-o*a+s)),h=f>0?-a:Math.min(Math.max(-a,-l),a),p=-f*f+h*(h+2*l)+u):h<=d?(f=0,h=Math.min(Math.max(-a,-l),a),p=h*(h+2*l)+u):(f=Math.max(0,-(o*a+s)),h=f>0?a:Math.min(Math.max(-a,-l),a),p=-f*f+h*(h+2*l)+u);else h=o>0?-a:a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,f),n&&n.copy(Nz).addScaledVector(lA,h),p}intersectSphere(e,t){Ku.subVectors(e.center,this.origin);let i=Ku.dot(this.direction),n=Ku.dot(Ku)-i*i,a=e.radius*e.radius;if(n>a)return null;let o=Math.sqrt(a-n),s=i-o,l=i+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,a,o,s,l,u=1/this.direction.x,c=1/this.direction.y,f=1/this.direction.z,h=this.origin;return u>=0?(i=(e.min.x-h.x)*u,n=(e.max.x-h.x)*u):(i=(e.max.x-h.x)*u,n=(e.min.x-h.x)*u),c>=0?(a=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(a=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),i>o||a>n||((a>i||isNaN(i))&&(i=a),(o=0?(s=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(s=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||s>n)||((s>i||i!==i)&&(i=s),(l=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,Ku)!==null}intersectTriangle(e,t,i,n,a){Uz.subVectors(t,e),uA.subVectors(i,e),Oz.crossVectors(Uz,uA);let o=this.direction.dot(Oz),s;if(o>0){if(n)return null;s=1}else if(o<0)s=-1,o=-o;else return null;ph.subVectors(this.origin,e);let l=s*this.direction.dot(uA.crossVectors(ph,uA));if(l<0)return null;let u=s*this.direction.dot(Uz.cross(ph));if(u<0||l+u>o)return null;let c=-s*ph.dot(Oz);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};var Wr=class r{constructor(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m)}set(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m){let v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=a,v[5]=o,v[9]=s,v[13]=l,v[2]=u,v[6]=c,v[10]=f,v[14]=h,v[3]=p,v[7]=d,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/Eg.setFromMatrixColumn(e,0).length(),a=1/Eg.setFromMatrixColumn(e,1).length(),o=1/Eg.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,a=e.z,o=Math.cos(i),s=Math.sin(i),l=Math.cos(n),u=Math.sin(n),c=Math.cos(a),f=Math.sin(a);if(e.order==="XYZ"){let h=o*c,p=o*f,d=s*c,g=s*f;t[0]=l*c,t[4]=-l*f,t[8]=u,t[1]=p+d*u,t[5]=h-g*u,t[9]=-s*l,t[2]=g-h*u,t[6]=d+p*u,t[10]=o*l}else if(e.order==="YXZ"){let h=l*c,p=l*f,d=u*c,g=u*f;t[0]=h+g*s,t[4]=d*s-p,t[8]=o*u,t[1]=o*f,t[5]=o*c,t[9]=-s,t[2]=p*s-d,t[6]=g+h*s,t[10]=o*l}else if(e.order==="ZXY"){let h=l*c,p=l*f,d=u*c,g=u*f;t[0]=h-g*s,t[4]=-o*f,t[8]=d+p*s,t[1]=p+d*s,t[5]=o*c,t[9]=g-h*s,t[2]=-o*u,t[6]=s,t[10]=o*l}else if(e.order==="ZYX"){let h=o*c,p=o*f,d=s*c,g=s*f;t[0]=l*c,t[4]=d*u-p,t[8]=h*u+g,t[1]=l*f,t[5]=g*u+h,t[9]=p*u-d,t[2]=-u,t[6]=s*l,t[10]=o*l}else if(e.order==="YZX"){let h=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=g-h*f,t[8]=d*f+p,t[1]=f,t[5]=o*c,t[9]=-s*c,t[2]=-u*c,t[6]=p*f+d,t[10]=h-g*f}else if(e.order==="XZY"){let h=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=-f,t[8]=u*c,t[1]=h*f+g,t[5]=o*c,t[9]=p*f-d,t[2]=d*f-p,t[6]=s*c,t[10]=g*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose($1e,e,Q1e)}lookAt(e,t,i){let n=this.elements;return Po.subVectors(e,t),Po.lengthSq()===0&&(Po.z=1),Po.normalize(),dh.crossVectors(i,Po),dh.lengthSq()===0&&(Math.abs(i.z)===1?Po.x+=1e-4:Po.z+=1e-4,Po.normalize(),dh.crossVectors(i,Po)),dh.normalize(),fA.crossVectors(Po,dh),n[0]=dh.x,n[4]=fA.x,n[8]=Po.x,n[1]=dh.y,n[5]=fA.y,n[9]=Po.y,n[2]=dh.z,n[6]=fA.z,n[10]=Po.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[4],l=i[8],u=i[12],c=i[1],f=i[5],h=i[9],p=i[13],d=i[2],g=i[6],m=i[10],v=i[14],_=i[3],y=i[7],x=i[11],M=i[15],S=n[0],w=n[4],T=n[8],C=n[12],b=n[1],E=n[5],I=n[9],R=n[13],A=n[2],D=n[6],U=n[10],B=n[14],z=n[3],k=n[7],G=n[11],Y=n[15];return a[0]=o*S+s*b+l*A+u*z,a[4]=o*w+s*E+l*D+u*k,a[8]=o*T+s*I+l*U+u*G,a[12]=o*C+s*R+l*B+u*Y,a[1]=c*S+f*b+h*A+p*z,a[5]=c*w+f*E+h*D+p*k,a[9]=c*T+f*I+h*U+p*G,a[13]=c*C+f*R+h*B+p*Y,a[2]=d*S+g*b+m*A+v*z,a[6]=d*w+g*E+m*D+v*k,a[10]=d*T+g*I+m*U+v*G,a[14]=d*C+g*R+m*B+v*Y,a[3]=_*S+y*b+x*A+M*z,a[7]=_*w+y*E+x*D+M*k,a[11]=_*T+y*I+x*U+M*G,a[15]=_*C+y*R+x*B+M*Y,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],a=e[12],o=e[1],s=e[5],l=e[9],u=e[13],c=e[2],f=e[6],h=e[10],p=e[14],d=e[3],g=e[7],m=e[11],v=e[15];return d*(+a*l*f-n*u*f-a*s*h+i*u*h+n*s*p-i*l*p)+g*(+t*l*p-t*u*h+a*o*h-n*o*p+n*u*c-a*l*c)+m*(+t*u*f-t*s*p-a*o*f+i*o*p+a*s*c-i*u*c)+v*(-n*s*c-t*l*f+t*s*h+n*o*f-i*o*h+i*l*c)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],_=f*m*u-g*h*u+g*l*p-s*m*p-f*l*v+s*h*v,y=d*h*u-c*m*u-d*l*p+o*m*p+c*l*v-o*h*v,x=c*g*u-d*f*u+d*s*p-o*g*p-c*s*v+o*f*v,M=d*f*l-c*g*l-d*s*h+o*g*h+c*s*m-o*f*m,S=t*_+i*y+n*x+a*M;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/S;return e[0]=_*w,e[1]=(g*h*a-f*m*a-g*n*p+i*m*p+f*n*v-i*h*v)*w,e[2]=(s*m*a-g*l*a+g*n*u-i*m*u-s*n*v+i*l*v)*w,e[3]=(f*l*a-s*h*a-f*n*u+i*h*u+s*n*p-i*l*p)*w,e[4]=y*w,e[5]=(c*m*a-d*h*a+d*n*p-t*m*p-c*n*v+t*h*v)*w,e[6]=(d*l*a-o*m*a-d*n*u+t*m*u+o*n*v-t*l*v)*w,e[7]=(o*h*a-c*l*a+c*n*u-t*h*u-o*n*p+t*l*p)*w,e[8]=x*w,e[9]=(d*f*a-c*g*a-d*i*p+t*g*p+c*i*v-t*f*v)*w,e[10]=(o*g*a-d*s*a+d*i*u-t*g*u-o*i*v+t*s*v)*w,e[11]=(c*s*a-o*f*a-c*i*u+t*f*u+o*i*p-t*s*p)*w,e[12]=M*w,e[13]=(c*g*n-d*f*n+d*i*h-t*g*h-c*i*m+t*f*m)*w,e[14]=(d*s*n-o*g*n-d*i*l+t*g*l+o*i*m-t*s*m)*w,e[15]=(o*f*n-c*s*n+c*i*l-t*f*l-o*i*h+t*s*h)*w,this}scale(e){let t=this.elements,i=e.x,n=e.y,a=e.z;return t[0]*=i,t[4]*=n,t[8]*=a,t[1]*=i,t[5]*=n,t[9]*=a,t[2]*=i,t[6]*=n,t[10]*=a,t[3]*=i,t[7]*=n,t[11]*=a,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),a=1-i,o=e.x,s=e.y,l=e.z,u=a*o,c=a*s;return this.set(u*o+i,u*s-n*l,u*l+n*s,0,u*s+n*l,c*s+i,c*l-n*o,0,u*l-n*s,c*l+n*o,a*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,a,o){return this.set(1,i,a,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,a=t._x,o=t._y,s=t._z,l=t._w,u=a+a,c=o+o,f=s+s,h=a*u,p=a*c,d=a*f,g=o*c,m=o*f,v=s*f,_=l*u,y=l*c,x=l*f,M=i.x,S=i.y,w=i.z;return n[0]=(1-(g+v))*M,n[1]=(p+x)*M,n[2]=(d-y)*M,n[3]=0,n[4]=(p-x)*S,n[5]=(1-(h+v))*S,n[6]=(m+_)*S,n[7]=0,n[8]=(d+y)*w,n[9]=(m-_)*w,n[10]=(1-(h+g))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,a=Eg.set(n[0],n[1],n[2]).length(),o=Eg.set(n[4],n[5],n[6]).length(),s=Eg.set(n[8],n[9],n[10]).length();this.determinant()<0&&(a=-a),e.x=n[12],e.y=n[13],e.z=n[14],cl.copy(this);let u=1/a,c=1/o,f=1/s;return cl.elements[0]*=u,cl.elements[1]*=u,cl.elements[2]*=u,cl.elements[4]*=c,cl.elements[5]*=c,cl.elements[6]*=c,cl.elements[8]*=f,cl.elements[9]*=f,cl.elements[10]*=f,t.setFromRotationMatrix(cl),i.x=a,i.y=o,i.z=s,this}makePerspective(e,t,i,n,a,o,s=$a){let l=this.elements,u=2*a/(t-e),c=2*a/(i-n),f=(t+e)/(t-e),h=(i+n)/(i-n),p,d;if(s===$a)p=-(o+a)/(o-a),d=-2*o*a/(o-a);else if(s===yd)p=-o/(o-a),d=-o*a/(o-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=u,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=c,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=d,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,a,o,s=$a){let l=this.elements,u=1/(t-e),c=1/(i-n),f=1/(o-a),h=(t+e)*u,p=(i+n)*c,d,g;if(s===$a)d=(o+a)*f,g=-2*f;else if(s===yd)d=a*f,g=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=g,l[14]=-d,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},Eg=new be,cl=new Wr,$1e=new be(0,0,0),Q1e=new be(1,1,1),dh=new be,fA=new be,Po=new be;var PQ=new Wr,DQ=new nu,fl=(()=>{class r{constructor(t=0,i=0,n=0,a=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=a}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,n,a=this._order){return this._x=t,this._y=i,this._z=n,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,n=!0){let a=t.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],f=a[9],h=a[2],p=a[6],d=a[10];switch(i){case"XYZ":this._y=Math.asin(en(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,d),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-en(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(l,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(en(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-en(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(en(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(l,d));break;case"XZY":this._z=Math.asin(-en(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-f,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,n){return PQ.makeRotationFromQuaternion(t),this.setFromRotationMatrix(PQ,i,n)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return DQ.setFromEuler(this),this.setFromQuaternion(DQ,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return r.DEFAULT_ORDER="XYZ",r})();var Ag=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<{class r extends Qa{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:eTe++}),this.uuid=ru(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new be,i=new fl,n=new nu,a=new be(1,1,1);function o(){n.setFromEuler(i,!1)}function s(){i.setFromQuaternion(n,void 0,!1)}i._onChange(o),n._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new Wr},normalMatrix:{value:new Qt}}),this.matrix=new Wr,this.matrixWorld=new Wr,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Ag,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Cg.setFromAxisAngle(t,i),this.quaternion.multiply(Cg),this}rotateOnWorldAxis(t,i){return Cg.setFromAxisAngle(t,i),this.quaternion.premultiply(Cg),this}rotateX(t){return this.rotateOnAxis(NQ,t)}rotateY(t){return this.rotateOnAxis(UQ,t)}rotateZ(t){return this.rotateOnAxis(OQ,t)}translateOnAxis(t,i){return IQ.copy(t).applyQuaternion(this.quaternion),this.position.add(IQ.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(NQ,t)}translateY(t){return this.translateOnAxis(UQ,t)}translateZ(t){return this.translateOnAxis(OQ,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ju.copy(this.matrixWorld).invert())}lookAt(t,i,n){t.isVector3?hA.copy(t):hA.set(t,i,n);let a=this.parent;this.updateWorldMatrix(!0,!1),mS.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ju.lookAt(mS,hA,this.up):Ju.lookAt(hA,mS,this.up),this.quaternion.setFromRotationMatrix(Ju),a&&(Ju.extractRotation(a.matrixWorld),Cg.setFromRotationMatrix(Ju),this.quaternion.premultiply(Cg.invert()))}add(t){if(arguments.length>1){for(let i=0;i1){for(let n=0;n0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.visibility=this._visibility,a.active=this._active,a.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),a.maxGeometryCount=this._maxGeometryCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.geometryCount=this._geometryCount,a.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(a.boundingSphere={center:a.boundingSphere.center.toArray(),radius:a.boundingSphere.radius}),this.boundingBox!==null&&(a.boundingBox={min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}));function o(l,u){return l[u.uuid]===void 0&&(l[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=o(t.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let u=l.shapes;if(Array.isArray(u))for(let c=0,f=u.length;c0){a.children=[];for(let l=0;l0){a.animations=[];for(let l=0;l0&&(n.geometries=l),u.length>0&&(n.materials=u),c.length>0&&(n.textures=c),f.length>0&&(n.images=f),h.length>0&&(n.shapes=h),p.length>0&&(n.skeletons=p),d.length>0&&(n.animations=d),g.length>0&&(n.nodes=g)}return n.object=a,n;function s(l){let u=[];for(let c in l){let f=l[c];delete f.metadata,u.push(f)}return u}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let n=0;n0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(e,t,i,n,a){hl.subVectors(n,t),$u.subVectors(i,t),Bz.subVectors(e,t);let o=hl.dot(hl),s=hl.dot($u),l=hl.dot(Bz),u=$u.dot($u),c=$u.dot(Bz),f=o*u-s*s;if(f===0)return a.set(0,0,0),null;let h=1/f,p=(u*l-s*c)*h,d=(o*c-s*l)*h;return a.set(1-p-d,d,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Qu)===null?!1:Qu.x>=0&&Qu.y>=0&&Qu.x+Qu.y<=1}static getInterpolation(e,t,i,n,a,o,s,l){return this.getBarycoord(e,t,i,n,Qu)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,Qu.x),l.addScaledVector(o,Qu.y),l.addScaledVector(s,Qu.z),l)}static isFrontFacing(e,t,i,n){return hl.subVectors(i,t),$u.subVectors(e,t),hl.cross($u).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return hl.subVectors(this.c,this.b),$u.subVectors(this.a,this.b),hl.cross($u).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return r.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return r.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,a){return r.getInterpolation(e,this.a,this.b,this.c,t,i,n,a)}containsPoint(e){return r.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return r.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,n=this.b,a=this.c,o,s;Rg.subVectors(n,i),Lg.subVectors(a,i),kz.subVectors(e,i);let l=Rg.dot(kz),u=Lg.dot(kz);if(l<=0&&u<=0)return t.copy(i);Vz.subVectors(e,n);let c=Rg.dot(Vz),f=Lg.dot(Vz);if(c>=0&&f<=c)return t.copy(n);let h=l*f-c*u;if(h<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(i).addScaledVector(Rg,o);Gz.subVectors(e,a);let p=Rg.dot(Gz),d=Lg.dot(Gz);if(d>=0&&p<=d)return t.copy(a);let g=p*u-l*d;if(g<=0&&u>=0&&d<=0)return s=u/(u-d),t.copy(i).addScaledVector(Lg,s);let m=c*d-p*f;if(m<=0&&f-c>=0&&p-d>=0)return zQ.subVectors(a,n),s=(f-c)/(f-c+(p-d)),t.copy(n).addScaledVector(zQ,s);let v=1/(m+g+h);return o=g*v,s=h*v,t.copy(i).addScaledVector(Rg,o).addScaledVector(Lg,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};var FQ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},mh={h:0,s:0,l:0},pA={h:0,s:0,l:0};function Hz(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}var ir=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ka){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Tr.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=Tr.workingColorSpace){return this.r=e,this.g=t,this.b=i,Tr.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=Tr.workingColorSpace){if(e=wQ(e,1),t=en(t,0,1),i=en(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,o=2*i-a;this.r=Hz(o,a,e+1/3),this.g=Hz(o,a,e),this.b=Hz(o,a,e-1/3)}return Tr.toWorkingColorSpace(this,n),this}setStyle(e,t=Ka){function i(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let a,o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=n[1],o=a.length;if(o===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ka){let i=FQ[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=uh(e.r),this.g=uh(e.g),this.b=uh(e.b),this}copyLinearToSRGB(e){return this.r=rA(e.r),this.g=rA(e.g),this.b=rA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ka){return Tr.fromWorkingColorSpace(qn.copy(this),e),Math.round(en(qn.r*255,0,255))*65536+Math.round(en(qn.g*255,0,255))*256+Math.round(en(qn.b*255,0,255))}getHexString(e=Ka){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Tr.workingColorSpace){Tr.fromWorkingColorSpace(qn.copy(this),t);let i=qn.r,n=qn.g,a=qn.b,o=Math.max(i,n,a),s=Math.min(i,n,a),l,u,c=(s+o)/2;if(s===o)l=0,u=0;else{let f=o-s;switch(u=c<=.5?f/(o+s):f/(2-o-s),o){case i:l=(n-a)/f+(n0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let n=this[t];if(n===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Xu&&(i.blending=this.blending),this.side!==Ao&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==nS&&(i.blendSrc=this.blendSrc),this.blendDst!==aS&&(i.blendDst=this.blendDst),this.blendEquation!==Yu&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==cg&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Tz&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==gd&&(i.stencilFail=this.stencilFail),this.stencilZFail!==gd&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==gd&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function n(a){let o=[];for(let s in a){let l=a[s];delete l.metadata,o.push(l)}return o}if(t){let a=n(e.textures),o=n(e.images);a.length>0&&(i.textures=a),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let n=t.length;i=new Array(n);for(let a=0;a!==n;++a)i[a]=t[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};var ec=class extends au{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ir(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new fl,this.combine=zE,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}};var ki=new be,dA=new Kt,xa=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Ez,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ja,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return AQ("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,a=this.itemSize;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let l in i){let u=i[l];e.data.attributes[l]=u.toJSON(e.data)}let n={},a=!1;for(let l in this.morphAttributes){let u=this.morphAttributes[l],c=[];for(let f=0,h=u.length;f0&&(n[l]=c,a=!0)}a&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let n=e.attributes;for(let u in n){let c=n[u];this.setAttribute(u,c.clone(t))}let a=e.morphAttributes;for(let u in a){let c=[],f=a[u];for(let h=0,p=f.length;h0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a(e.far-e.near)**2))&&(BQ.copy(a).invert(),Md.copy(e.ray).applyMatrix4(BQ),!(i.boundingBox!==null&&Md.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Md)))}_computeIntersections(e,t,i){let n,a=this.geometry,o=this.material,s=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,f=a.attributes.normal,h=a.groups,p=a.drawRange;if(s!==null)if(Array.isArray(o))for(let d=0,g=h.length;dt.far?null:{distance:u,point:SA.clone(),object:r}}function MA(r,e,t,i,n,a,o,s,l,u){r.getVertexPosition(s,Ng),r.getVertexPosition(l,Ug),r.getVertexPosition(u,Og);let c=sTe(r,e,t,i,Ng,Ug,Og,xA);if(c){n&&(gA.fromBufferAttribute(n,s),yA.fromBufferAttribute(n,l),_A.fromBufferAttribute(n,u),c.uv=Sd.getInterpolation(xA,Ng,Ug,Og,gA,yA,_A,new Kt)),a&&(gA.fromBufferAttribute(a,s),yA.fromBufferAttribute(a,l),_A.fromBufferAttribute(a,u),c.uv1=Sd.getInterpolation(xA,Ng,Ug,Og,gA,yA,_A,new Kt)),o&&(VQ.fromBufferAttribute(o,s),GQ.fromBufferAttribute(o,l),HQ.fromBufferAttribute(o,u),c.normal=Sd.getInterpolation(xA,Ng,Ug,Og,VQ,GQ,HQ,new be),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let f={a:s,b:l,c:u,normal:new be,materialIndex:0};Sd.getNormal(Ng,Ug,Og,f.normal),c.face=f}return c}var vh=class r extends ro{constructor(e=1,t=1,i=1,n=1,a=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:a,depthSegments:o};let s=this;n=Math.floor(n),a=Math.floor(a),o=Math.floor(o);let l=[],u=[],c=[],f=[],h=0,p=0;d("z","y","x",-1,-1,i,t,e,o,a,0),d("z","y","x",1,-1,i,t,-e,o,a,1),d("x","z","y",1,1,e,i,t,n,o,2),d("x","z","y",1,-1,e,i,-t,n,o,3),d("x","y","z",1,-1,e,t,i,n,a,4),d("x","y","z",-1,-1,e,t,-i,n,a,5),this.setIndex(l),this.setAttribute("position",new Zn(u,3)),this.setAttribute("normal",new Zn(c,3)),this.setAttribute("uv",new Zn(f,2));function d(g,m,v,_,y,x,M,S,w,T,C){let b=x/w,E=M/T,I=x/2,R=M/2,A=S/2,D=w+1,U=T+1,B=0,z=0,k=new be;for(let G=0;G0?1:-1,c.push(k.x,k.y,k.z),f.push(J/w),f.push(1-G/T),B+=1}}for(let G=0;G0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}};var Ug=class extends tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Wr,this.projectionMatrix=new Wr,this.projectionMatrixInverse=new Wr,this.coordinateSystem=ja}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};var mh=new be,YQ=new Kt,qQ=new Kt,Gi=class extends Ug{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=cS*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(JE*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return cS*2*Math.atan(Math.tan(JE*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){mh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(mh.x,mh.y).multiplyScalar(-e/mh.z),mh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(mh.x,mh.y).multiplyScalar(-e/mh.z)}getViewSize(e,t){return this.getViewBounds(e,YQ,qQ),t.subVectors(qQ,YQ)}setViewOffset(e,t,i,n,a,o){this.aspect=e/t,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=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(JE*.5*this.fov)/this.zoom,i=2*t,n=this.aspect*i,a=-.5*n,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,u=o.fullHeight;a+=o.offsetX*n/l,t-=o.offsetY*i/u,n*=o.width/l,i*=o.height/u}let s=this.filmOffset;s!==0&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};var Og=-90,Fg=1,bA=class extends tn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new Gi(Og,Fg,e,t);n.layers=this.layers,this.add(n);let a=new Gi(Og,Fg,e,t);a.layers=this.layers,this.add(a);let o=new Gi(Og,Fg,e,t);o.layers=this.layers,this.add(o);let s=new Gi(Og,Fg,e,t);s.layers=this.layers,this.add(s);let l=new Gi(Og,Fg,e,t);l.layers=this.layers,this.add(l);let u=new Gi(Og,Fg,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,a,o,s,l]=t;for(let u of t)this.remove(u);if(e===ja)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===vd)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,o,s,l,u,c]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;let g=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,a),e.setRenderTarget(i,1,n),e.render(t,o),e.setRenderTarget(i,2,n),e.render(t,s),e.setRenderTarget(i,3,n),e.render(t,l),e.setRenderTarget(i,4,n),e.render(t,u),i.texture.generateMipmaps=g,e.setRenderTarget(i,5,n),e.render(t,c),e.setRenderTarget(f,h,p),e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}};var zg=class extends Ja{constructor(e,t,i,n,a,o,s,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:al,super(e,t,i,n,a,o,s,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};var wA=class extends $a{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];this.texture=new zg(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Qi}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` +`;var Sa=class extends au{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=YQ,this.fragmentShader=qQ,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=tc(e.uniforms),this.uniformsGroups=WQ(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let o=this.uniforms[n].value;o&&o.isTexture?t.uniforms[n]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[n]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[n]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[n]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[n]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[n]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[n]={type:"m4",value:o.toArray()}:t.uniforms[n]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}};var zg=class extends tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Wr,this.projectionMatrix=new Wr,this.projectionMatrixInverse=new Wr,this.coordinateSystem=$a}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};var gh=new be,ZQ=new Kt,jQ=new Kt,Vi=class extends zg{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=fS*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan($E*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return fS*2*Math.atan(Math.tan($E*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){gh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(gh.x,gh.y).multiplyScalar(-e/gh.z),gh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(gh.x,gh.y).multiplyScalar(-e/gh.z)}getViewSize(e,t){return this.getViewBounds(e,ZQ,jQ),t.subVectors(jQ,ZQ)}setViewOffset(e,t,i,n,a,o){this.aspect=e/t,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=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan($E*.5*this.fov)/this.zoom,i=2*t,n=this.aspect*i,a=-.5*n,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,u=o.fullHeight;a+=o.offsetX*n/l,t-=o.offsetY*i/u,n*=o.width/l,i*=o.height/u}let s=this.filmOffset;s!==0&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};var Fg=-90,Bg=1,wA=class extends tn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new Vi(Fg,Bg,e,t);n.layers=this.layers,this.add(n);let a=new Vi(Fg,Bg,e,t);a.layers=this.layers,this.add(a);let o=new Vi(Fg,Bg,e,t);o.layers=this.layers,this.add(o);let s=new Vi(Fg,Bg,e,t);s.layers=this.layers,this.add(s);let l=new Vi(Fg,Bg,e,t);l.layers=this.layers,this.add(l);let u=new Vi(Fg,Bg,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,a,o,s,l]=t;for(let u of t)this.remove(u);if(e===$a)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===yd)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,o,s,l,u,c]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;let g=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,a),e.setRenderTarget(i,1,n),e.render(t,o),e.setRenderTarget(i,2,n),e.render(t,s),e.setRenderTarget(i,3,n),e.render(t,l),e.setRenderTarget(i,4,n),e.render(t,u),i.texture.generateMipmaps=g,e.setRenderTarget(i,5,n),e.render(t,c),e.setRenderTarget(f,h,p),e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}};var kg=class extends eo{constructor(e,t,i,n,a,o,s,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:ol,super(e,t,i,n,a,o,s,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};var TA=class extends to{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];this.texture=new kg(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Qi}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -2283,13 +2283,13 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},n=new dh(5,5,5),a=new ya({name:"CubemapFromEquirect",uniforms:rc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:_i,blending:ms});a.uniforms.tEquirect.value=t;let o=new rn(n,a),s=t.minFilter;return t.minFilter===ol&&(t.minFilter=Qi),new bA(1,10,this).update(e,o),t.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,n){let a=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,n);e.setRenderTarget(a)}};var XF=new be,oTe=new be,sTe=new $t,hl=class{constructor(e=new be(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=XF.subVectors(i,t).cross(oTe.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let i=e.delta(XF),n=this.normal.dot(i);if(n===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/n;return a<0||a>1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||sTe.getNormalMatrix(e),n=this.coplanarPoint(XF).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};var Sd=new ch,TA=new be,vh=class{constructor(e=new hl,t=new hl,i=new hl,n=new hl,a=new hl,o=new hl){this.planes=[e,t,i,n,a,o]}set(e,t,i,n,a,o){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(a),s[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=ja){let i=this.planes,n=e.elements,a=n[0],o=n[1],s=n[2],l=n[3],u=n[4],c=n[5],f=n[6],h=n[7],p=n[8],d=n[9],g=n[10],m=n[11],v=n[12],_=n[13],y=n[14],x=n[15];if(i[0].setComponents(l-a,h-u,m-p,x-v).normalize(),i[1].setComponents(l+a,h+u,m+p,x+v).normalize(),i[2].setComponents(l+o,h+c,m+d,x+_).normalize(),i[3].setComponents(l-o,h-c,m-d,x-_).normalize(),i[4].setComponents(l-s,h-f,m-g,x-y).normalize(),t===ja)i[5].setComponents(l+s,h+f,m+g,x+y).normalize();else if(t===vd)i[5].setComponents(s,f,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Sd.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Sd.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Sd)}intersectsSprite(e){return Sd.center.set(0,0,0),Sd.radius=.7071067811865476,Sd.applyMatrix4(e.matrixWorld),this.intersectsSphere(Sd)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)0?e.max.x:e.min.x,TA.y=n.normal.y>0?e.max.y:e.min.y,TA.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(TA)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function EA(){let r=null,e=!1,t=null,i=null;function n(a,o){t(a,o),i=r.requestAnimationFrame(n)}return{start:function(){e!==!0&&t!==null&&(i=r.requestAnimationFrame(n),e=!0)},stop:function(){r.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){r=a}}}function ZQ(r,e){let t=e.isWebGL2,i=new WeakMap;function n(u,c){let f=u.array,h=u.usage,p=f.byteLength,d=r.createBuffer();r.bindBuffer(c,d),r.bufferData(c,f,h),u.onUploadCallback();let g;if(f instanceof Float32Array)g=r.FLOAT;else if(f instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=r.UNSIGNED_SHORT;else if(f instanceof Int16Array)g=r.SHORT;else if(f instanceof Uint32Array)g=r.UNSIGNED_INT;else if(f instanceof Int32Array)g=r.INT;else if(f instanceof Int8Array)g=r.BYTE;else if(f instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:d,type:g,bytesPerElement:f.BYTES_PER_ELEMENT,version:u.version,size:p}}function a(u,c,f){let h=c.array,p=c._updateRange,d=c.updateRanges;if(r.bindBuffer(f,u),p.count===-1&&d.length===0&&r.bufferSubData(f,0,h),d.length!==0){for(let g=0,m=d.length;g1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||uTe.getNormalMatrix(e),n=this.coplanarPoint(Yz).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};var bd=new hh,EA=new be,yh=class{constructor(e=new pl,t=new pl,i=new pl,n=new pl,a=new pl,o=new pl){this.planes=[e,t,i,n,a,o]}set(e,t,i,n,a,o){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(a),s[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=$a){let i=this.planes,n=e.elements,a=n[0],o=n[1],s=n[2],l=n[3],u=n[4],c=n[5],f=n[6],h=n[7],p=n[8],d=n[9],g=n[10],m=n[11],v=n[12],_=n[13],y=n[14],x=n[15];if(i[0].setComponents(l-a,h-u,m-p,x-v).normalize(),i[1].setComponents(l+a,h+u,m+p,x+v).normalize(),i[2].setComponents(l+o,h+c,m+d,x+_).normalize(),i[3].setComponents(l-o,h-c,m-d,x-_).normalize(),i[4].setComponents(l-s,h-f,m-g,x-y).normalize(),t===$a)i[5].setComponents(l+s,h+f,m+g,x+y).normalize();else if(t===yd)i[5].setComponents(s,f,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),bd.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),bd.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(bd)}intersectsSprite(e){return bd.center.set(0,0,0),bd.radius=.7071067811865476,bd.applyMatrix4(e.matrixWorld),this.intersectsSphere(bd)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)0?e.max.x:e.min.x,EA.y=n.normal.y>0?e.max.y:e.min.y,EA.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(EA)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function AA(){let r=null,e=!1,t=null,i=null;function n(a,o){t(a,o),i=r.requestAnimationFrame(n)}return{start:function(){e!==!0&&t!==null&&(i=r.requestAnimationFrame(n),e=!0)},stop:function(){r.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){r=a}}}function KQ(r,e){let t=e.isWebGL2,i=new WeakMap;function n(u,c){let f=u.array,h=u.usage,p=f.byteLength,d=r.createBuffer();r.bindBuffer(c,d),r.bufferData(c,f,h),u.onUploadCallback();let g;if(f instanceof Float32Array)g=r.FLOAT;else if(f instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=r.UNSIGNED_SHORT;else if(f instanceof Int16Array)g=r.SHORT;else if(f instanceof Uint32Array)g=r.UNSIGNED_INT;else if(f instanceof Int32Array)g=r.INT;else if(f instanceof Int8Array)g=r.BYTE;else if(f instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:d,type:g,bytesPerElement:f.BYTES_PER_ELEMENT,version:u.version,size:p}}function a(u,c,f){let h=c.array,p=c._updateRange,d=c.updateRanges;if(r.bindBuffer(f,u),p.count===-1&&d.length===0&&r.bufferSubData(f,0,h),d.length!==0){for(let g=0,m=d.length;g 0 vec4 plane; @@ -2727,7 +2727,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #endif #endif -`;var fee=` +`;var pee=` #if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; @@ -2735,19 +2735,19 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif -`;var hee=` +`;var dee=` #if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif -`;var pee=` +`;var mee=` #if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif -`;var dee=` +`;var vee=` #if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; @@ -2757,7 +2757,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve diffuseColor.rgb *= vColor; #endif -`;var mee=` +`;var gee=` #if defined( USE_COLOR_ALPHA ) varying vec4 vColor; @@ -2767,7 +2767,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve varying vec3 vColor; #endif -`;var vee=` +`;var yee=` #if defined( USE_COLOR_ALPHA ) varying vec4 vColor; @@ -2777,7 +2777,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve varying vec3 vColor; #endif -`;var gee=` +`;var _ee=` #if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); @@ -2799,7 +2799,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve vColor.xyz *= instanceColor.xyz; #endif -`;var yee=` +`;var xee=` #define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 @@ -2945,7 +2945,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } // validated -`;var _ee=` +`;var See=` #ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 @@ -3130,7 +3130,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { } #endif -`;var xee=` +`;var Mee=` vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT @@ -3192,7 +3192,7 @@ transformedNormal = normalMatrix * transformedNormal; #endif #endif -`;var See=` +`;var bee=` #ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; @@ -3200,13 +3200,13 @@ transformedNormal = normalMatrix * transformedNormal; uniform float displacementBias; #endif -`;var Mee=` +`;var wee=` #ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif -`;var bee=` +`;var Tee=` #ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); @@ -3214,15 +3214,15 @@ transformedNormal = normalMatrix * transformedNormal; totalEmissiveRadiance *= emissiveColor.rgb; #endif -`;var wee=` +`;var Eee=` #ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif -`;var Tee=` +`;var Aee=` gl_FragColor = linearToOutputTexel( gl_FragColor ); -`;var Eee=` +`;var Cee=` // http://www.russellcottrell.com/photo/matrixCalculator.htm @@ -3265,7 +3265,7 @@ vec4 LinearToLinear( in vec4 value ) { vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); } -`;var Aee=` +`;var Ree=` #ifdef USE_ENVMAP #ifdef ENV_WORLDPOS @@ -3326,7 +3326,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var Cee=` +`;var Lee=` #ifdef USE_ENVMAP uniform float envMapIntensity; @@ -3340,7 +3340,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var Ree=` +`;var Pee=` #ifdef USE_ENVMAP uniform float reflectivity; @@ -3360,7 +3360,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var Lee=` +`;var Dee=` #ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) @@ -3381,7 +3381,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var Pee=` +`;var Iee=` #ifdef USE_ENVMAP #ifdef ENV_WORLDPOS @@ -3417,19 +3417,19 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var Dee=` +`;var Nee=` #ifdef USE_FOG vFogDepth = - mvPosition.z; #endif -`;var Iee=` +`;var Uee=` #ifdef USE_FOG varying float vFogDepth; #endif -`;var Nee=` +`;var Oee=` #ifdef USE_FOG #ifdef FOG_EXP2 @@ -3445,7 +3445,7 @@ vec4 LinearTosRGB( in vec4 value ) { gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif -`;var Uee=` +`;var zee=` #ifdef USE_FOG uniform vec3 fogColor; @@ -3463,7 +3463,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var Oee=` +`;var Fee=` #ifdef USE_GRADIENTMAP @@ -3489,7 +3489,7 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { #endif } -`;var Fee=` +`;var Bee=` #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); @@ -3498,18 +3498,18 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { reflectedLight.indirectDiffuse += lightMapIrradiance; #endif -`;var zee=` +`;var kee=` #ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif -`;var Bee=` +`;var Vee=` LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength; -`;var kee=` +`;var Gee=` varying vec3 vViewPosition; struct LambertMaterial { @@ -3536,7 +3536,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert -`;var Vee=` +`;var Hee=` uniform bool receiveShadow; uniform vec3 ambientLightColor; @@ -3763,7 +3763,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi } #endif -`;var Gee=` +`;var Wee=` #ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { @@ -3831,10 +3831,10 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif #endif -`;var Hee=` +`;var Xee=` ToonMaterial material; material.diffuseColor = diffuseColor.rgb; -`;var Wee=` +`;var Yee=` varying vec3 vViewPosition; struct ToonMaterial { @@ -3859,13 +3859,13 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -`;var Xee=` +`;var qee=` BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength; -`;var Yee=` +`;var Zee=` varying vec3 vViewPosition; struct BlinnPhongMaterial { @@ -3896,7 +3896,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -`;var qee=` +`;var jee=` PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); @@ -4046,7 +4046,7 @@ material.roughness = min( material.roughness, 1.0 ); material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; #endif -`;var Zee=` +`;var Kee=` struct PhysicalMaterial { @@ -4607,7 +4607,7 @@ float computeSpecularOcclusion( const in float dotNV, const in float ambientOccl return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); } -`;var jee=` +`;var Jee=` /** * This is a template that can be used to light a material, it uses pluggable * RenderEquations (RE)for specific lighting scenarios. @@ -4808,7 +4808,7 @@ IncidentLight directLight; vec3 clearcoatRadiance = vec3( 0.0 ); #endif -`;var Kee=` +`;var $ee=` #if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP @@ -4847,7 +4847,7 @@ IncidentLight directLight; #endif #endif -`;var Jee=` +`;var Qee=` #if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); @@ -4859,7 +4859,7 @@ IncidentLight directLight; RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif -`;var $ee=` +`;var ete=` #if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) // Doing a strict comparison with == 1.0 can cause noise artifacts @@ -4867,7 +4867,7 @@ IncidentLight directLight; gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif -`;var Qee=` +`;var tte=` #if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; @@ -4875,7 +4875,7 @@ IncidentLight directLight; varying float vIsPerspective; #endif -`;var ete=` +`;var rte=` #ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT @@ -4890,7 +4890,7 @@ IncidentLight directLight; #endif #endif -`;var tte=` +`;var ite=` #ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT @@ -4911,7 +4911,7 @@ IncidentLight directLight; #endif #endif -`;var rte=` +`;var nte=` #ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); @@ -4927,13 +4927,13 @@ IncidentLight directLight; diffuseColor *= sampledDiffuseColor; #endif -`;var ite=` +`;var ate=` #ifdef USE_MAP uniform sampler2D map; #endif -`;var nte=` +`;var ote=` #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) @@ -4959,7 +4959,7 @@ IncidentLight directLight; diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif -`;var ate=` +`;var ste=` #if defined( USE_POINTS_UV ) varying vec2 vUv; @@ -4985,7 +4985,7 @@ IncidentLight directLight; uniform sampler2D alphaMap; #endif -`;var ote=` +`;var lte=` float metalnessFactor = metalness; #ifdef USE_METALNESSMAP @@ -4996,13 +4996,13 @@ float metalnessFactor = metalness; metalnessFactor *= texelMetalness.b; #endif -`;var ste=` +`;var ute=` #ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif -`;var lte=` +`;var cte=` #ifdef USE_INSTANCING_MORPH float morphTargetInfluences[MORPHTARGETS_COUNT]; @@ -5015,7 +5015,7 @@ float metalnessFactor = metalness; } #endif -`;var ute=` +`;var fte=` #if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) // morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value: @@ -5038,7 +5038,7 @@ float metalnessFactor = metalness; } #endif -`;var cte=` +`;var hte=` #ifdef USE_MORPHNORMALS // morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value: @@ -5064,7 +5064,7 @@ float metalnessFactor = metalness; #endif #endif -`;var fte=` +`;var pte=` #ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH @@ -5110,7 +5110,7 @@ float metalnessFactor = metalness; #endif #endif -`;var hte=` +`;var dte=` #ifdef USE_MORPHTARGETS // morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value: @@ -5145,7 +5145,7 @@ float metalnessFactor = metalness; #endif #endif -`;var pte=` +`;var mte=` float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED @@ -5220,7 +5220,7 @@ float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; vec3 nonPerturbedNormal = normal; -`;var dte=` +`;var vte=` #ifdef USE_NORMALMAP_OBJECTSPACE @@ -5252,7 +5252,7 @@ vec3 nonPerturbedNormal = normal; normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif -`;var mte=` +`;var gte=` #ifndef FLAT_SHADED varying vec3 vNormal; @@ -5265,7 +5265,7 @@ vec3 nonPerturbedNormal = normal; #endif #endif -`;var vte=` +`;var yte=` #ifndef FLAT_SHADED varying vec3 vNormal; @@ -5278,7 +5278,7 @@ vec3 nonPerturbedNormal = normal; #endif #endif -`;var gte=` +`;var _te=` #ifndef FLAT_SHADED // normal is computed with derivatives when FLAT_SHADED vNormal = normalize( transformedNormal ); @@ -5291,7 +5291,7 @@ vec3 nonPerturbedNormal = normal; #endif #endif -`;var yte=` +`;var xte=` #ifdef USE_NORMALMAP uniform sampler2D normalMap; @@ -5333,13 +5333,13 @@ vec3 nonPerturbedNormal = normal; } #endif -`;var _te=` +`;var Ste=` #ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif -`;var xte=` +`;var Mte=` #ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; @@ -5348,7 +5348,7 @@ vec3 nonPerturbedNormal = normal; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif -`;var Ste=` +`;var bte=` #ifdef USE_CLEARCOATMAP @@ -5368,7 +5368,7 @@ vec3 nonPerturbedNormal = normal; uniform sampler2D clearcoatRoughnessMap; #endif -`;var Mte=` +`;var wte=` #ifdef USE_IRIDESCENCEMAP @@ -5381,7 +5381,7 @@ vec3 nonPerturbedNormal = normal; uniform sampler2D iridescenceThicknessMap; #endif -`;var bte=` +`;var Tte=` #ifdef OPAQUE diffuseColor.a = 1.0; #endif @@ -5391,7 +5391,7 @@ diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a ); -`;var wte=` +`;var Ete=` vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } @@ -5458,14 +5458,14 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const // maps perspective depth in [ 0, 1 ] to viewZ return ( near * far ) / ( ( far - near ) * depth - far ); } -`;var Tte=` +`;var Ate=` #ifdef PREMULTIPLIED_ALPHA // Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation. gl_FragColor.rgb *= gl_FragColor.a; #endif -`;var Ete=` +`;var Cte=` vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING @@ -5483,13 +5483,13 @@ vec4 mvPosition = vec4( transformed, 1.0 ); mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition; -`;var Ate=` +`;var Rte=` #ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif -`;var Cte=` +`;var Lte=` #ifdef DITHERING // based on https://www.shadertoy.com/view/MslGR8 @@ -5508,7 +5508,7 @@ gl_Position = projectionMatrix * mvPosition; } #endif -`;var Rte=` +`;var Pte=` float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP @@ -5519,13 +5519,13 @@ float roughnessFactor = roughness; roughnessFactor *= texelRoughness.g; #endif -`;var Lte=` +`;var Dte=` #ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif -`;var Pte=` +`;var Ite=` #if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; @@ -5838,7 +5838,7 @@ float roughnessFactor = roughness; } #endif -`;var Dte=` +`;var Nte=` #if NUM_SPOT_LIGHT_COORDS > 0 @@ -5905,7 +5905,7 @@ float roughnessFactor = roughness; */ #endif -`;var Ite=` +`;var Ute=` #if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) @@ -5972,7 +5972,7 @@ float roughnessFactor = roughness; #endif -`;var Nte=` +`;var Ote=` float getShadowMask() { float shadow = 1.0; @@ -6037,7 +6037,7 @@ float getShadowMask() { return shadow; } -`;var Ute=` +`;var zte=` #ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); @@ -6046,7 +6046,7 @@ float getShadowMask() { mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif -`;var Ote=` +`;var Fte=` #ifdef USE_SKINNING uniform mat4 bindMatrix; @@ -6070,7 +6070,7 @@ float getShadowMask() { } #endif -`;var Fte=` +`;var Bte=` #ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); @@ -6084,7 +6084,7 @@ float getShadowMask() { transformed = ( bindMatrixInverse * skinned ).xyz; #endif -`;var zte=` +`;var kte=` #ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); @@ -6103,7 +6103,7 @@ float getShadowMask() { #endif #endif -`;var Bte=` +`;var Vte=` float specularStrength; #ifdef USE_SPECULARMAP @@ -6116,19 +6116,19 @@ float specularStrength; specularStrength = 1.0; #endif -`;var kte=` +`;var Gte=` #ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif -`;var Vte=` +`;var Hte=` #if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif -`;var Gte=` +`;var Wte=` #ifndef saturate // may have defined saturate() already #define saturate( a ) clamp( a, 0.0, 1.0 ) @@ -6319,7 +6319,7 @@ vec3 NeutralToneMapping( vec3 color ) { } vec3 CustomToneMapping( vec3 color ) { return color; } -`;var Hte=` +`;var Xte=` #ifdef USE_TRANSMISSION material.transmission = transmission; @@ -6354,7 +6354,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; } totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); #endif -`;var Wte=` +`;var Yte=` #ifdef USE_TRANSMISSION // Transmission code is based on glTF-Sampler-Viewer @@ -6554,7 +6554,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; } } #endif -`;var Xte=` +`;var qte=` #if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; @@ -6672,7 +6672,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; } varying vec2 vThicknessMapUv; #endif -`;var Yte=` +`;var Zte=` #if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; @@ -6816,7 +6816,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; } varying vec2 vThicknessMapUv; #endif -`;var qte=` +`;var jte=` #if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; @@ -6937,7 +6937,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; } vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; #endif -`;var Zte=` +`;var Kte=` #if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); @@ -6957,7 +6957,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; } worldPosition = modelMatrix * worldPosition; #endif -`;var jte=` +`;var Jte=` varying vec2 vUv; uniform mat3 uvTransform; @@ -6968,7 +6968,7 @@ void main() { gl_Position = vec4( position.xy, 1.0, 1.0 ); } -`,Kte=` +`,$te=` uniform sampler2D t2D; uniform float backgroundIntensity; @@ -6994,7 +6994,7 @@ void main() { #include } -`;var Jte=` +`;var Qte=` varying vec3 vWorldDirection; #include @@ -7009,7 +7009,7 @@ void main() { gl_Position.z = gl_Position.w; // set z to camera.far } -`,$te=` +`,ere=` #ifdef ENVMAP_TYPE_CUBE @@ -7054,7 +7054,7 @@ void main() { #include } -`;var Qte=` +`;var tre=` varying vec3 vWorldDirection; #include @@ -7069,7 +7069,7 @@ void main() { gl_Position.z = gl_Position.w; // set z to camera.far } -`,ere=` +`,rre=` uniform samplerCube tCube; uniform float tFlip; uniform float opacity; @@ -7087,7 +7087,7 @@ void main() { #include } -`;var tre=` +`;var ire=` #include #include #include @@ -7130,7 +7130,7 @@ void main() { vHighPrecisionZW = gl_Position.zw; } -`,rre=` +`,nre=` #if DEPTH_PACKING == 3200 uniform float opacity; @@ -7181,7 +7181,7 @@ void main() { #endif } -`;var ire=` +`;var are=` #define DISTANCE varying vec3 vWorldPosition; @@ -7222,7 +7222,7 @@ void main() { vWorldPosition = worldPosition.xyz; } -`,nre=` +`,ore=` #define DISTANCE uniform vec3 referencePosition; @@ -7256,7 +7256,7 @@ void main () { gl_FragColor = packDepthToRGBA( dist ); } -`;var are=` +`;var sre=` varying vec3 vWorldDirection; #include @@ -7269,7 +7269,7 @@ void main() { #include } -`,ore=` +`,lre=` uniform sampler2D tEquirect; varying vec3 vWorldDirection; @@ -7288,7 +7288,7 @@ void main() { #include } -`;var sre=` +`;var ure=` uniform float scale; attribute float lineDistance; @@ -7318,7 +7318,7 @@ void main() { #include } -`,lre=` +`,cre=` uniform vec3 diffuse; uniform float opacity; @@ -7361,7 +7361,7 @@ void main() { #include } -`;var ure=` +`;var fre=` #include #include #include @@ -7403,7 +7403,7 @@ void main() { #include } -`,cre=` +`,hre=` uniform vec3 diffuse; uniform float opacity; @@ -7474,7 +7474,7 @@ void main() { #include } -`;var fre=` +`;var pre=` #define LAMBERT varying vec3 vViewPosition; @@ -7524,7 +7524,7 @@ void main() { #include } -`,hre=` +`,dre=` #define LAMBERT uniform vec3 diffuse; @@ -7596,7 +7596,7 @@ void main() { #include } -`;var pre=` +`;var mre=` #define MATCAP varying vec3 vViewPosition; @@ -7642,7 +7642,7 @@ void main() { vViewPosition = - mvPosition.xyz; } -`,dre=` +`,vre=` #define MATCAP uniform vec3 diffuse; @@ -7705,7 +7705,7 @@ void main() { #include } -`;var mre=` +`;var gre=` #define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) @@ -7752,7 +7752,7 @@ void main() { #endif } -`,vre=` +`,yre=` #define NORMAL uniform float opacity; @@ -7789,7 +7789,7 @@ void main() { #endif } -`;var gre=` +`;var _re=` #define PHONG varying vec3 vViewPosition; @@ -7839,7 +7839,7 @@ void main() { #include } -`,yre=` +`,xre=` #define PHONG uniform vec3 diffuse; @@ -7913,7 +7913,7 @@ void main() { #include } -`;var _re=` +`;var Sre=` #define STANDARD varying vec3 vViewPosition; @@ -7972,7 +7972,7 @@ void main() { #endif } -`,xre=` +`,Mre=` #define STANDARD #ifdef PHYSICAL @@ -8135,7 +8135,7 @@ void main() { #include } -`;var Sre=` +`;var bre=` #define TOON varying vec3 vViewPosition; @@ -8183,7 +8183,7 @@ void main() { #include } -`,Mre=` +`,wre=` #define TOON uniform vec3 diffuse; @@ -8251,7 +8251,7 @@ void main() { #include } -`;var bre=` +`;var Tre=` uniform float size; uniform float scale; @@ -8300,7 +8300,7 @@ void main() { #include } -`,wre=` +`,Ere=` uniform vec3 diffuse; uniform float opacity; @@ -8335,7 +8335,7 @@ void main() { #include } -`;var Tre=` +`;var Are=` #include #include #include @@ -8366,7 +8366,7 @@ void main() { #include } -`,Ere=` +`,Cre=` uniform vec3 color; uniform float opacity; @@ -8390,7 +8390,7 @@ void main() { #include } -`;var Are=` +`;var Rre=` uniform float rotation; uniform vec2 center; @@ -8433,7 +8433,7 @@ void main() { #include } -`,Cre=` +`,Lre=` uniform vec3 diffuse; uniform float opacity; @@ -8468,7 +8468,7 @@ void main() { #include } -`;var pr={alphahash_fragment:jQ,alphahash_pars_fragment:KQ,alphamap_fragment:JQ,alphamap_pars_fragment:$Q,alphatest_fragment:QQ,alphatest_pars_fragment:eee,aomap_fragment:tee,aomap_pars_fragment:ree,batching_pars_vertex:iee,batching_vertex:nee,begin_vertex:aee,beginnormal_vertex:oee,bsdfs:see,iridescence_fragment:lee,bumpmap_pars_fragment:uee,clipping_planes_fragment:cee,clipping_planes_pars_fragment:fee,clipping_planes_pars_vertex:hee,clipping_planes_vertex:pee,color_fragment:dee,color_pars_fragment:mee,color_pars_vertex:vee,color_vertex:gee,common:yee,cube_uv_reflection_fragment:_ee,defaultnormal_vertex:xee,displacementmap_pars_vertex:See,displacementmap_vertex:Mee,emissivemap_fragment:bee,emissivemap_pars_fragment:wee,colorspace_fragment:Tee,colorspace_pars_fragment:Eee,envmap_fragment:Aee,envmap_common_pars_fragment:Cee,envmap_pars_fragment:Ree,envmap_pars_vertex:Lee,envmap_physical_pars_fragment:Gee,envmap_vertex:Pee,fog_vertex:Dee,fog_pars_vertex:Iee,fog_fragment:Nee,fog_pars_fragment:Uee,gradientmap_pars_fragment:Oee,lightmap_fragment:Fee,lightmap_pars_fragment:zee,lights_lambert_fragment:Bee,lights_lambert_pars_fragment:kee,lights_pars_begin:Vee,lights_toon_fragment:Hee,lights_toon_pars_fragment:Wee,lights_phong_fragment:Xee,lights_phong_pars_fragment:Yee,lights_physical_fragment:qee,lights_physical_pars_fragment:Zee,lights_fragment_begin:jee,lights_fragment_maps:Kee,lights_fragment_end:Jee,logdepthbuf_fragment:$ee,logdepthbuf_pars_fragment:Qee,logdepthbuf_pars_vertex:ete,logdepthbuf_vertex:tte,map_fragment:rte,map_pars_fragment:ite,map_particle_fragment:nte,map_particle_pars_fragment:ate,metalnessmap_fragment:ote,metalnessmap_pars_fragment:ste,morphinstance_vertex:lte,morphcolor_vertex:ute,morphnormal_vertex:cte,morphtarget_pars_vertex:fte,morphtarget_vertex:hte,normal_fragment_begin:pte,normal_fragment_maps:dte,normal_pars_fragment:mte,normal_pars_vertex:vte,normal_vertex:gte,normalmap_pars_fragment:yte,clearcoat_normal_fragment_begin:_te,clearcoat_normal_fragment_maps:xte,clearcoat_pars_fragment:Ste,iridescence_pars_fragment:Mte,opaque_fragment:bte,packing:wte,premultiplied_alpha_fragment:Tte,project_vertex:Ete,dithering_fragment:Ate,dithering_pars_fragment:Cte,roughnessmap_fragment:Rte,roughnessmap_pars_fragment:Lte,shadowmap_pars_fragment:Pte,shadowmap_pars_vertex:Dte,shadowmap_vertex:Ite,shadowmask_pars_fragment:Nte,skinbase_vertex:Ute,skinning_pars_vertex:Ote,skinning_vertex:Fte,skinnormal_vertex:zte,specularmap_fragment:Bte,specularmap_pars_fragment:kte,tonemapping_fragment:Vte,tonemapping_pars_fragment:Gte,transmission_fragment:Hte,transmission_pars_fragment:Wte,uv_pars_fragment:Xte,uv_pars_vertex:Yte,uv_vertex:qte,worldpos_vertex:Zte,background_vert:jte,background_frag:Kte,backgroundCube_vert:Jte,backgroundCube_frag:$te,cube_vert:Qte,cube_frag:ere,depth_vert:tre,depth_frag:rre,distanceRGBA_vert:ire,distanceRGBA_frag:nre,equirect_vert:are,equirect_frag:ore,linedashed_vert:sre,linedashed_frag:lre,meshbasic_vert:ure,meshbasic_frag:cre,meshlambert_vert:fre,meshlambert_frag:hre,meshmatcap_vert:pre,meshmatcap_frag:dre,meshnormal_vert:mre,meshnormal_frag:vre,meshphong_vert:gre,meshphong_frag:yre,meshphysical_vert:_re,meshphysical_frag:xre,meshtoon_vert:Sre,meshtoon_frag:Mre,points_vert:bre,points_frag:wre,shadow_vert:Tre,shadow_frag:Ere,sprite_vert:Are,sprite_frag:Cre};var ht={common:{diffuse:{value:new ir(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new $t},alphaMap:{value:null},alphaMapTransform:{value:new $t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new $t}},envmap:{envMap:{value:null},envMapRotation:{value:new $t},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new $t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new $t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new $t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new $t},normalScale:{value:new Kt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new $t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new $t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new $t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new $t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ir(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 ir(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new $t},alphaTest:{value:0},uvTransform:{value:new $t}},sprite:{diffuse:{value:new ir(16777215)},opacity:{value:1},center:{value:new Kt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new $t},alphaMap:{value:null},alphaMapTransform:{value:new $t},alphaTest:{value:0}}};var xs={basic:{uniforms:jn([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.fog]),vertexShader:pr.meshbasic_vert,fragmentShader:pr.meshbasic_frag},lambert:{uniforms:jn([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new ir(0)}}]),vertexShader:pr.meshlambert_vert,fragmentShader:pr.meshlambert_frag},phong:{uniforms:jn([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new ir(0)},specular:{value:new ir(1118481)},shininess:{value:30}}]),vertexShader:pr.meshphong_vert,fragmentShader:pr.meshphong_frag},standard:{uniforms:jn([ht.common,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.roughnessmap,ht.metalnessmap,ht.fog,ht.lights,{emissive:{value:new ir(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:pr.meshphysical_vert,fragmentShader:pr.meshphysical_frag},toon:{uniforms:jn([ht.common,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.gradientmap,ht.fog,ht.lights,{emissive:{value:new ir(0)}}]),vertexShader:pr.meshtoon_vert,fragmentShader:pr.meshtoon_frag},matcap:{uniforms:jn([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,{matcap:{value:null}}]),vertexShader:pr.meshmatcap_vert,fragmentShader:pr.meshmatcap_frag},points:{uniforms:jn([ht.points,ht.fog]),vertexShader:pr.points_vert,fragmentShader:pr.points_frag},dashed:{uniforms:jn([ht.common,ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:pr.linedashed_vert,fragmentShader:pr.linedashed_frag},depth:{uniforms:jn([ht.common,ht.displacementmap]),vertexShader:pr.depth_vert,fragmentShader:pr.depth_frag},normal:{uniforms:jn([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,{opacity:{value:1}}]),vertexShader:pr.meshnormal_vert,fragmentShader:pr.meshnormal_frag},sprite:{uniforms:jn([ht.sprite,ht.fog]),vertexShader:pr.sprite_vert,fragmentShader:pr.sprite_frag},background:{uniforms:{uvTransform:{value:new $t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:pr.background_vert,fragmentShader:pr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new $t}},vertexShader:pr.backgroundCube_vert,fragmentShader:pr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:pr.cube_vert,fragmentShader:pr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:pr.equirect_vert,fragmentShader:pr.equirect_frag},distanceRGBA:{uniforms:jn([ht.common,ht.displacementmap,{referencePosition:{value:new be},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:pr.distanceRGBA_vert,fragmentShader:pr.distanceRGBA_frag},shadow:{uniforms:jn([ht.lights,ht.fog,{color:{value:new ir(0)},opacity:{value:1}}]),vertexShader:pr.shadow_vert,fragmentShader:pr.shadow_frag}};xs.physical={uniforms:jn([xs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new $t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new $t},clearcoatNormalScale:{value:new Kt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new $t},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new $t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new $t},sheen:{value:0},sheenColor:{value:new ir(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new $t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new $t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new $t},transmissionSamplerSize:{value:new Kt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new $t},attenuationDistance:{value:0},attenuationColor:{value:new ir(0)},specularColor:{value:new ir(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new $t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new $t},anisotropyVector:{value:new Kt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new $t}}]),vertexShader:pr.meshphysical_vert,fragmentShader:pr.meshphysical_frag};var AA={r:0,b:0,g:0},Md=new cl,TTe=new Wr;function Rre(r,e,t,i,n,a,o){let s=new ir(0),l=a===!0?0:1,u,c,f=null,h=0,p=null;function d(m,v){let _=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y===null?g(s,l):y&&y.isColor&&(g(y,1),_=!0);let x=r.xr.getEnvironmentBlendMode();x==="additive"?i.buffers.color.setClear(0,0,0,1,o):x==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(r.autoClear||_)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===oh)?(c===void 0&&(c=new rn(new dh(1,1,1),new ya({name:"BackgroundCubeMaterial",uniforms:rc(xs.backgroundCube.uniforms),vertexShader:xs.backgroundCube.vertexShader,fragmentShader:xs.backgroundCube.fragmentShader,side:_i,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(M,S,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),Md.copy(v.backgroundRotation),Md.x*=-1,Md.y*=-1,Md.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Md.y*=-1,Md.z*=-1),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(TTe.makeRotationFromEuler(Md)),c.material.toneMapped=Er.getTransfer(y.colorSpace)!==Hr,(f!==y||h!==y.version||p!==r.toneMapping)&&(c.material.needsUpdate=!0,f=y,h=y.version,p=r.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new rn(new Bg(2,2),new ya({name:"BackgroundMaterial",uniforms:rc(xs.background.uniforms),vertexShader:xs.background.vertexShader,fragmentShader:xs.background.fragmentShader,side:Ao,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=Er.getTransfer(y.colorSpace)!==Hr,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(f!==y||h!==y.version||p!==r.toneMapping)&&(u.material.needsUpdate=!0,f=y,h=y.version,p=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function g(m,v){m.getRGB(AA,MA(r)),i.buffers.color.setClear(AA.r,AA.g,AA.b,v,o)}return{getClearColor:function(){return s},setClearColor:function(m,v=1){s.set(m),l=v,g(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,g(s,l)},render:d}}function Lre(r,e,t,i){let n=r.getParameter(r.MAX_VERTEX_ATTRIBS),a=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||a!==null,s={},l=m(null),u=l,c=!1;function f(A,D,U,B,F){let k=!1;if(o){let G=g(B,U,D);u!==G&&(u=G,p(u.object)),k=v(A,B,U,F),k&&_(A,B,U,F)}else{let G=D.wireframe===!0;(u.geometry!==B.id||u.program!==U.id||u.wireframe!==G)&&(u.geometry=B.id,u.program=U.id,u.wireframe=G,k=!0)}F!==null&&t.update(F,r.ELEMENT_ARRAY_BUFFER),(k||c)&&(c=!1,T(A,D,U,B),F!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(F).buffer))}function h(){return i.isWebGL2?r.createVertexArray():a.createVertexArrayOES()}function p(A){return i.isWebGL2?r.bindVertexArray(A):a.bindVertexArrayOES(A)}function d(A){return i.isWebGL2?r.deleteVertexArray(A):a.deleteVertexArrayOES(A)}function g(A,D,U){let B=U.wireframe===!0,F=s[A.id];F===void 0&&(F={},s[A.id]=F);let k=F[D.id];k===void 0&&(k={},F[D.id]=k);let G=k[B];return G===void 0&&(G=m(h()),k[B]=G),G}function m(A){let D=[],U=[],B=[];for(let F=0;F=0){let V=F[J],K=k[J];if(K===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(K=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(K=A.instanceColor)),V===void 0||V.attribute!==K||K&&V.data!==K.data)return!0;G++}return u.attributesNum!==G||u.index!==B}function _(A,D,U,B){let F={},k=D.attributes,G=0,Y=U.getAttributes();for(let J in Y)if(Y[J].location>=0){let V=k[J];V===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(V=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(V=A.instanceColor));let K={};K.attribute=V,V&&V.data&&(K.data=V.data),F[J]=K,G++}u.attributes=F,u.attributesNum=G,u.index=B}function y(){let A=u.newAttributes;for(let D=0,U=A.length;D=0){let Q=F[Y];if(Q===void 0&&(Y==="instanceMatrix"&&A.instanceMatrix&&(Q=A.instanceMatrix),Y==="instanceColor"&&A.instanceColor&&(Q=A.instanceColor)),Q!==void 0){let V=Q.normalized,K=Q.itemSize,ae=t.get(Q);if(ae===void 0)continue;let ve=ae.buffer,ue=ae.type,se=ae.bytesPerElement,Ee=i.isWebGL2===!0&&(ue===r.INT||ue===r.UNSIGNED_INT||Q.gpuType===zE);if(Q.isInterleavedBufferAttribute){let q=Q.data,H=q.stride,We=Q.offset;if(q.isInstancedInterleavedBuffer){for(let _e=0;_e0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext",s=t.precision!==void 0?t.precision:"highp",l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);let u=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),h=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=r.getParameter(r.MAX_TEXTURE_SIZE),d=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),_=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),y=h>0,x=o||e.has("OES_texture_float"),M=y&&x,S=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:n,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:c,maxTextures:f,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:M,maxSamples:S}}function Ire(r){let e=this,t=null,i=0,n=!1,a=!1,o=new hl,s=new $t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){let p=f.length!==0||h||i!==0||n;return n=h,i=f.length,p},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(f,h){t=c(f,h,0)},this.setState=function(f,h,p){let d=f.clippingPlanes,g=f.clipIntersection,m=f.clipShadows,v=r.get(f);if(!n||d===null||d.length===0||a&&!m)a?c(null):u();else{let _=a?0:i,y=_*4,x=v.clippingState||null;l.value=x,x=c(d,h,y,p);for(let M=0;M!==y;++M)x[M]=t[M];v.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(f,h,p,d){let g=f!==null?f.length:0,m=null;if(g!==0){if(m=l.value,d!==!0||m===null){let v=p+g*4,_=h.matrixWorldInverse;s.getNormalMatrix(_),(m===null||m.length0){let u=new wA(l.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",n),t(u.texture,o.mapping)}else return null}}return o}function n(o){let s=o.target;s.removeEventListener("dispose",n);let l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}var kg=class extends Ug{constructor(e=-1,t=1,i=1,n=-1,a=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=a,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,n,a,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=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,a=i-e,o=i+e,s=n+t,l=n-t;if(this.view!==null&&this.view.enabled){let u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,o=a+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(a,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let 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}};var Gg=4,Ure=[.125,.215,.35,.446,.526,.582],wd=20,YF=new kg,Ore=new ir,qF=null,ZF=0,jF=0,bd=(1+Math.sqrt(5))/2,Vg=1/bd,Fre=[new be(1,1,1),new be(-1,1,1),new be(1,1,-1),new be(-1,1,-1),new be(0,bd,Vg),new be(0,bd,-Vg),new be(Vg,0,bd),new be(-Vg,0,bd),new be(bd,Vg,0),new be(-bd,Vg,0)],vS=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){qF=this._renderer.getRenderTarget(),ZF=this._renderer.getActiveCubeFace(),jF=this._renderer.getActiveMipmapLevel(),this._setSize(256);let a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,i,n,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=kre(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Bre(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?y:0,y,y),c.setRenderTarget(n),g&&c.render(d,s),c.render(e,s)}d.geometry.dispose(),d.material.dispose(),c.toneMapping=h,c.autoClear=f,e.background=m}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===al||e.mapping===tu;n?(this._cubemapMaterial===null&&(this._cubemapMaterial=kre()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Bre());let a=n?this._cubemapMaterial:this._equirectMaterial,o=new rn(this._lodPlanes[0],a),s=a.uniforms;s.envMap.value=e;let l=this._cubeSize;CA(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,YF)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;nwd&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${wd}`);let v=[],_=0;for(let w=0;wy-Gg?n-y+Gg:0),S=4*(this._cubeSize-x);CA(t,M,S,3*x,2*x),l.setRenderTarget(t),l.render(f,YF)}};function ETe(r){let e=[],t=[],i=[],n=r,a=r-Gg+1+Ure.length;for(let o=0;or-Gg?l=Ure[o-r+Gg-1]:o===0&&(l=0),i.push(l);let u=1/(s-2),c=-u,f=1+u,h=[c,c,f,c,f,f,c,c,f,f,c,f],p=6,d=6,g=3,m=2,v=1,_=new Float32Array(g*d*p),y=new Float32Array(m*d*p),x=new Float32Array(v*d*p);for(let S=0;S2?0:-1,C=[w,T,0,w+2/3,T,0,w+2/3,T+1,0,w,T,0,w+2/3,T+1,0,w,T+1,0];_.set(C,g*d*S),y.set(h,m*d*S);let b=[S,S,S,S,S,S];x.set(b,v*d*S)}let M=new Qa;M.setAttribute("position",new ga(_,g)),M.setAttribute("uv",new ga(y,m)),M.setAttribute("faceIndex",new ga(x,v)),e.push(M),n>Gg&&n--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function zre(r,e,t){let i=new $a(r,e,t);return i.texture.mapping=oh,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function CA(r,e,t,i,n){r.viewport.set(e,t,i,n),r.scissor.set(e,t,i,n)}function ATe(r,e,t){let i=new Float32Array(wd),n=new be(0,1,0);return new ya({name:"SphericalGaussianBlur",defines:{n:wd,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:KF(),fragmentShader:` +`;var pr={alphahash_fragment:JQ,alphahash_pars_fragment:$Q,alphamap_fragment:QQ,alphamap_pars_fragment:eee,alphatest_fragment:tee,alphatest_pars_fragment:ree,aomap_fragment:iee,aomap_pars_fragment:nee,batching_pars_vertex:aee,batching_vertex:oee,begin_vertex:see,beginnormal_vertex:lee,bsdfs:uee,iridescence_fragment:cee,bumpmap_pars_fragment:fee,clipping_planes_fragment:hee,clipping_planes_pars_fragment:pee,clipping_planes_pars_vertex:dee,clipping_planes_vertex:mee,color_fragment:vee,color_pars_fragment:gee,color_pars_vertex:yee,color_vertex:_ee,common:xee,cube_uv_reflection_fragment:See,defaultnormal_vertex:Mee,displacementmap_pars_vertex:bee,displacementmap_vertex:wee,emissivemap_fragment:Tee,emissivemap_pars_fragment:Eee,colorspace_fragment:Aee,colorspace_pars_fragment:Cee,envmap_fragment:Ree,envmap_common_pars_fragment:Lee,envmap_pars_fragment:Pee,envmap_pars_vertex:Dee,envmap_physical_pars_fragment:Wee,envmap_vertex:Iee,fog_vertex:Nee,fog_pars_vertex:Uee,fog_fragment:Oee,fog_pars_fragment:zee,gradientmap_pars_fragment:Fee,lightmap_fragment:Bee,lightmap_pars_fragment:kee,lights_lambert_fragment:Vee,lights_lambert_pars_fragment:Gee,lights_pars_begin:Hee,lights_toon_fragment:Xee,lights_toon_pars_fragment:Yee,lights_phong_fragment:qee,lights_phong_pars_fragment:Zee,lights_physical_fragment:jee,lights_physical_pars_fragment:Kee,lights_fragment_begin:Jee,lights_fragment_maps:$ee,lights_fragment_end:Qee,logdepthbuf_fragment:ete,logdepthbuf_pars_fragment:tte,logdepthbuf_pars_vertex:rte,logdepthbuf_vertex:ite,map_fragment:nte,map_pars_fragment:ate,map_particle_fragment:ote,map_particle_pars_fragment:ste,metalnessmap_fragment:lte,metalnessmap_pars_fragment:ute,morphinstance_vertex:cte,morphcolor_vertex:fte,morphnormal_vertex:hte,morphtarget_pars_vertex:pte,morphtarget_vertex:dte,normal_fragment_begin:mte,normal_fragment_maps:vte,normal_pars_fragment:gte,normal_pars_vertex:yte,normal_vertex:_te,normalmap_pars_fragment:xte,clearcoat_normal_fragment_begin:Ste,clearcoat_normal_fragment_maps:Mte,clearcoat_pars_fragment:bte,iridescence_pars_fragment:wte,opaque_fragment:Tte,packing:Ete,premultiplied_alpha_fragment:Ate,project_vertex:Cte,dithering_fragment:Rte,dithering_pars_fragment:Lte,roughnessmap_fragment:Pte,roughnessmap_pars_fragment:Dte,shadowmap_pars_fragment:Ite,shadowmap_pars_vertex:Nte,shadowmap_vertex:Ute,shadowmask_pars_fragment:Ote,skinbase_vertex:zte,skinning_pars_vertex:Fte,skinning_vertex:Bte,skinnormal_vertex:kte,specularmap_fragment:Vte,specularmap_pars_fragment:Gte,tonemapping_fragment:Hte,tonemapping_pars_fragment:Wte,transmission_fragment:Xte,transmission_pars_fragment:Yte,uv_pars_fragment:qte,uv_pars_vertex:Zte,uv_vertex:jte,worldpos_vertex:Kte,background_vert:Jte,background_frag:$te,backgroundCube_vert:Qte,backgroundCube_frag:ere,cube_vert:tre,cube_frag:rre,depth_vert:ire,depth_frag:nre,distanceRGBA_vert:are,distanceRGBA_frag:ore,equirect_vert:sre,equirect_frag:lre,linedashed_vert:ure,linedashed_frag:cre,meshbasic_vert:fre,meshbasic_frag:hre,meshlambert_vert:pre,meshlambert_frag:dre,meshmatcap_vert:mre,meshmatcap_frag:vre,meshnormal_vert:gre,meshnormal_frag:yre,meshphong_vert:_re,meshphong_frag:xre,meshphysical_vert:Sre,meshphysical_frag:Mre,meshtoon_vert:bre,meshtoon_frag:wre,points_vert:Tre,points_frag:Ere,shadow_vert:Are,shadow_frag:Cre,sprite_vert:Rre,sprite_frag:Lre};var ht={common:{diffuse:{value:new ir(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Qt},alphaMap:{value:null},alphaMapTransform:{value:new Qt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Qt}},envmap:{envMap:{value:null},envMapRotation:{value:new Qt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Qt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Qt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Qt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Qt},normalScale:{value:new Kt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Qt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Qt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Qt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Qt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ir(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 ir(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Qt},alphaTest:{value:0},uvTransform:{value:new Qt}},sprite:{diffuse:{value:new ir(16777215)},opacity:{value:1},center:{value:new Kt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Qt},alphaMap:{value:null},alphaMapTransform:{value:new Qt},alphaTest:{value:0}}};var Ss={basic:{uniforms:jn([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.fog]),vertexShader:pr.meshbasic_vert,fragmentShader:pr.meshbasic_frag},lambert:{uniforms:jn([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new ir(0)}}]),vertexShader:pr.meshlambert_vert,fragmentShader:pr.meshlambert_frag},phong:{uniforms:jn([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new ir(0)},specular:{value:new ir(1118481)},shininess:{value:30}}]),vertexShader:pr.meshphong_vert,fragmentShader:pr.meshphong_frag},standard:{uniforms:jn([ht.common,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.roughnessmap,ht.metalnessmap,ht.fog,ht.lights,{emissive:{value:new ir(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:pr.meshphysical_vert,fragmentShader:pr.meshphysical_frag},toon:{uniforms:jn([ht.common,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.gradientmap,ht.fog,ht.lights,{emissive:{value:new ir(0)}}]),vertexShader:pr.meshtoon_vert,fragmentShader:pr.meshtoon_frag},matcap:{uniforms:jn([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,{matcap:{value:null}}]),vertexShader:pr.meshmatcap_vert,fragmentShader:pr.meshmatcap_frag},points:{uniforms:jn([ht.points,ht.fog]),vertexShader:pr.points_vert,fragmentShader:pr.points_frag},dashed:{uniforms:jn([ht.common,ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:pr.linedashed_vert,fragmentShader:pr.linedashed_frag},depth:{uniforms:jn([ht.common,ht.displacementmap]),vertexShader:pr.depth_vert,fragmentShader:pr.depth_frag},normal:{uniforms:jn([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,{opacity:{value:1}}]),vertexShader:pr.meshnormal_vert,fragmentShader:pr.meshnormal_frag},sprite:{uniforms:jn([ht.sprite,ht.fog]),vertexShader:pr.sprite_vert,fragmentShader:pr.sprite_frag},background:{uniforms:{uvTransform:{value:new Qt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:pr.background_vert,fragmentShader:pr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Qt}},vertexShader:pr.backgroundCube_vert,fragmentShader:pr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:pr.cube_vert,fragmentShader:pr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:pr.equirect_vert,fragmentShader:pr.equirect_frag},distanceRGBA:{uniforms:jn([ht.common,ht.displacementmap,{referencePosition:{value:new be},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:pr.distanceRGBA_vert,fragmentShader:pr.distanceRGBA_frag},shadow:{uniforms:jn([ht.lights,ht.fog,{color:{value:new ir(0)},opacity:{value:1}}]),vertexShader:pr.shadow_vert,fragmentShader:pr.shadow_frag}};Ss.physical={uniforms:jn([Ss.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Qt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Qt},clearcoatNormalScale:{value:new Kt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Qt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Qt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Qt},sheen:{value:0},sheenColor:{value:new ir(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Qt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Qt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Qt},transmissionSamplerSize:{value:new Kt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Qt},attenuationDistance:{value:0},attenuationColor:{value:new ir(0)},specularColor:{value:new ir(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Qt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Qt},anisotropyVector:{value:new Kt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Qt}}]),vertexShader:pr.meshphysical_vert,fragmentShader:pr.meshphysical_frag};var CA={r:0,b:0,g:0},wd=new fl,ATe=new Wr;function Pre(r,e,t,i,n,a,o){let s=new ir(0),l=a===!0?0:1,u,c,f=null,h=0,p=null;function d(m,v){let _=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y===null?g(s,l):y&&y.isColor&&(g(y,1),_=!0);let x=r.xr.getEnvironmentBlendMode();x==="additive"?i.buffers.color.setClear(0,0,0,1,o):x==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(r.autoClear||_)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===lh)?(c===void 0&&(c=new rn(new vh(1,1,1),new Sa({name:"BackgroundCubeMaterial",uniforms:tc(Ss.backgroundCube.uniforms),vertexShader:Ss.backgroundCube.vertexShader,fragmentShader:Ss.backgroundCube.fragmentShader,side:_i,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(M,S,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),wd.copy(v.backgroundRotation),wd.x*=-1,wd.y*=-1,wd.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(wd.y*=-1,wd.z*=-1),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(ATe.makeRotationFromEuler(wd)),c.material.toneMapped=Tr.getTransfer(y.colorSpace)!==Hr,(f!==y||h!==y.version||p!==r.toneMapping)&&(c.material.needsUpdate=!0,f=y,h=y.version,p=r.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new rn(new Vg(2,2),new Sa({name:"BackgroundMaterial",uniforms:tc(Ss.background.uniforms),vertexShader:Ss.background.vertexShader,fragmentShader:Ss.background.fragmentShader,side:Ao,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=Tr.getTransfer(y.colorSpace)!==Hr,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(f!==y||h!==y.version||p!==r.toneMapping)&&(u.material.needsUpdate=!0,f=y,h=y.version,p=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function g(m,v){m.getRGB(CA,bA(r)),i.buffers.color.setClear(CA.r,CA.g,CA.b,v,o)}return{getClearColor:function(){return s},setClearColor:function(m,v=1){s.set(m),l=v,g(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,g(s,l)},render:d}}function Dre(r,e,t,i){let n=r.getParameter(r.MAX_VERTEX_ATTRIBS),a=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||a!==null,s={},l=m(null),u=l,c=!1;function f(A,D,U,B,z){let k=!1;if(o){let G=g(B,U,D);u!==G&&(u=G,p(u.object)),k=v(A,B,U,z),k&&_(A,B,U,z)}else{let G=D.wireframe===!0;(u.geometry!==B.id||u.program!==U.id||u.wireframe!==G)&&(u.geometry=B.id,u.program=U.id,u.wireframe=G,k=!0)}z!==null&&t.update(z,r.ELEMENT_ARRAY_BUFFER),(k||c)&&(c=!1,T(A,D,U,B),z!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(z).buffer))}function h(){return i.isWebGL2?r.createVertexArray():a.createVertexArrayOES()}function p(A){return i.isWebGL2?r.bindVertexArray(A):a.bindVertexArrayOES(A)}function d(A){return i.isWebGL2?r.deleteVertexArray(A):a.deleteVertexArrayOES(A)}function g(A,D,U){let B=U.wireframe===!0,z=s[A.id];z===void 0&&(z={},s[A.id]=z);let k=z[D.id];k===void 0&&(k={},z[D.id]=k);let G=k[B];return G===void 0&&(G=m(h()),k[B]=G),G}function m(A){let D=[],U=[],B=[];for(let z=0;z=0){let V=z[J],K=k[J];if(K===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(K=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(K=A.instanceColor)),V===void 0||V.attribute!==K||K&&V.data!==K.data)return!0;G++}return u.attributesNum!==G||u.index!==B}function _(A,D,U,B){let z={},k=D.attributes,G=0,Y=U.getAttributes();for(let J in Y)if(Y[J].location>=0){let V=k[J];V===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(V=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(V=A.instanceColor));let K={};K.attribute=V,V&&V.data&&(K.data=V.data),z[J]=K,G++}u.attributes=z,u.attributesNum=G,u.index=B}function y(){let A=u.newAttributes;for(let D=0,U=A.length;D=0){let Q=z[Y];if(Q===void 0&&(Y==="instanceMatrix"&&A.instanceMatrix&&(Q=A.instanceMatrix),Y==="instanceColor"&&A.instanceColor&&(Q=A.instanceColor)),Q!==void 0){let V=Q.normalized,K=Q.itemSize,ae=t.get(Q);if(ae===void 0)continue;let ve=ae.buffer,ue=ae.type,se=ae.bytesPerElement,Ee=i.isWebGL2===!0&&(ue===r.INT||ue===r.UNSIGNED_INT||Q.gpuType===BE);if(Q.isInterleavedBufferAttribute){let q=Q.data,H=q.stride,We=Q.offset;if(q.isInstancedInterleavedBuffer){for(let _e=0;_e0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext",s=t.precision!==void 0?t.precision:"highp",l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);let u=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),h=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=r.getParameter(r.MAX_TEXTURE_SIZE),d=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),_=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),y=h>0,x=o||e.has("OES_texture_float"),M=y&&x,S=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:n,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:c,maxTextures:f,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:M,maxSamples:S}}function Ure(r){let e=this,t=null,i=0,n=!1,a=!1,o=new pl,s=new Qt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){let p=f.length!==0||h||i!==0||n;return n=h,i=f.length,p},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(f,h){t=c(f,h,0)},this.setState=function(f,h,p){let d=f.clippingPlanes,g=f.clipIntersection,m=f.clipShadows,v=r.get(f);if(!n||d===null||d.length===0||a&&!m)a?c(null):u();else{let _=a?0:i,y=_*4,x=v.clippingState||null;l.value=x,x=c(d,h,y,p);for(let M=0;M!==y;++M)x[M]=t[M];v.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(f,h,p,d){let g=f!==null?f.length:0,m=null;if(g!==0){if(m=l.value,d!==!0||m===null){let v=p+g*4,_=h.matrixWorldInverse;s.getNormalMatrix(_),(m===null||m.length0){let u=new TA(l.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",n),t(u.texture,o.mapping)}else return null}}return o}function n(o){let s=o.target;s.removeEventListener("dispose",n);let l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}var Gg=class extends zg{constructor(e=-1,t=1,i=1,n=-1,a=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=a,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,n,a,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=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,a=i-e,o=i+e,s=n+t,l=n-t;if(this.view!==null&&this.view.enabled){let u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,o=a+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(a,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let 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}};var Wg=4,zre=[.125,.215,.35,.446,.526,.582],Ed=20,qz=new Gg,Fre=new ir,Zz=null,jz=0,Kz=0,Td=(1+Math.sqrt(5))/2,Hg=1/Td,Bre=[new be(1,1,1),new be(-1,1,1),new be(1,1,-1),new be(-1,1,-1),new be(0,Td,Hg),new be(0,Td,-Hg),new be(Hg,0,Td),new be(-Hg,0,Td),new be(Td,Hg,0),new be(-Td,Hg,0)],gS=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){Zz=this._renderer.getRenderTarget(),jz=this._renderer.getActiveCubeFace(),Kz=this._renderer.getActiveMipmapLevel(),this._setSize(256);let a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,i,n,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Gre(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Vre(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?y:0,y,y),c.setRenderTarget(n),g&&c.render(d,s),c.render(e,s)}d.geometry.dispose(),d.material.dispose(),c.toneMapping=h,c.autoClear=f,e.background=m}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===ol||e.mapping===eu;n?(this._cubemapMaterial===null&&(this._cubemapMaterial=Gre()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Vre());let a=n?this._cubemapMaterial:this._equirectMaterial,o=new rn(this._lodPlanes[0],a),s=a.uniforms;s.envMap.value=e;let l=this._cubeSize;RA(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,qz)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;nEd&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Ed}`);let v=[],_=0;for(let w=0;wy-Wg?n-y+Wg:0),S=4*(this._cubeSize-x);RA(t,M,S,3*x,2*x),l.setRenderTarget(t),l.render(f,qz)}};function CTe(r){let e=[],t=[],i=[],n=r,a=r-Wg+1+zre.length;for(let o=0;or-Wg?l=zre[o-r+Wg-1]:o===0&&(l=0),i.push(l);let u=1/(s-2),c=-u,f=1+u,h=[c,c,f,c,f,f,c,c,f,f,c,f],p=6,d=6,g=3,m=2,v=1,_=new Float32Array(g*d*p),y=new Float32Array(m*d*p),x=new Float32Array(v*d*p);for(let S=0;S2?0:-1,C=[w,T,0,w+2/3,T,0,w+2/3,T+1,0,w,T,0,w+2/3,T+1,0,w,T+1,0];_.set(C,g*d*S),y.set(h,m*d*S);let b=[S,S,S,S,S,S];x.set(b,v*d*S)}let M=new ro;M.setAttribute("position",new xa(_,g)),M.setAttribute("uv",new xa(y,m)),M.setAttribute("faceIndex",new xa(x,v)),e.push(M),n>Wg&&n--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function kre(r,e,t){let i=new to(r,e,t);return i.texture.mapping=lh,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function RA(r,e,t,i,n){r.viewport.set(e,t,i,n),r.scissor.set(e,t,i,n)}function RTe(r,e,t){let i=new Float32Array(Ed),n=new be(0,1,0);return new Sa({name:"SphericalGaussianBlur",defines:{n:Ed,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:Jz(),fragmentShader:` precision mediump float; precision mediump int; @@ -8528,7 +8528,7 @@ void main() { } } - `,blending:ms,depthTest:!1,depthWrite:!1})}function Bre(){return new ya({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:KF(),fragmentShader:` + `,blending:vs,depthTest:!1,depthWrite:!1})}function Vre(){return new Sa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Jz(),fragmentShader:` precision mediump float; precision mediump int; @@ -8547,7 +8547,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:ms,depthTest:!1,depthWrite:!1})}function kre(){return new ya({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:KF(),fragmentShader:` + `,blending:vs,depthTest:!1,depthWrite:!1})}function Gre(){return new Sa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Jz(),fragmentShader:` precision mediump float; precision mediump int; @@ -8563,7 +8563,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:ms,depthTest:!1,depthWrite:!1})}function KF(){return` + `,blending:vs,depthTest:!1,depthWrite:!1})}function Jz(){return` precision mediump float; precision mediump int; @@ -8618,16 +8618,16 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function Vre(r){let e=new WeakMap,t=null;function i(s){if(s&&s.isTexture){let l=s.mapping,u=l===aS||l===oS,c=l===al||l===tu;if(u||c)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let f=e.get(s);return t===null&&(t=new vS(r)),f=u?t.fromEquirectangular(s,f):t.fromCubemap(s,f),e.set(s,f),f.texture}else{if(e.has(s))return e.get(s).texture;{let f=s.image;if(u&&f&&f.height>0||c&&f&&n(f)){t===null&&(t=new vS(r));let h=u?t.fromEquirectangular(s):t.fromCubemap(s);return e.set(s,h),s.addEventListener("dispose",a),h.texture}else return null}}}return s}function n(s){let l=0,u=6;for(let c=0;ce.maxTextureSize&&(C=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let b=new Float32Array(T*C*4*g),E=new xg(b,T,C,g);E.type=Ya,E.needsUpdate=!0;let I=w*4;for(let A=0;A0)return r;let n=e*t,a=Zre[n];if(a===void 0&&(a=new Float32Array(n),Zre[n]=a),e!==0){i.toArray(a,0);for(let o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function nn(r,e){if(r.length!==e.length)return!1;for(let t=0,i=r.length;t0||c&&f&&n(f)){t===null&&(t=new gS(r));let h=u?t.fromEquirectangular(s):t.fromCubemap(s);return e.set(s,h),s.addEventListener("dispose",a),h.texture}else return null}}}return s}function n(s){let l=0,u=6;for(let c=0;ce.maxTextureSize&&(C=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let b=new Float32Array(T*C*4*g),E=new Mg(b,T,C,g);E.type=ja,E.needsUpdate=!0;let I=w*4;for(let A=0;A0)return r;let n=e*t,a=Kre[n];if(a===void 0&&(a=new Float32Array(n),Kre[n]=a),e!==0){i.toArray(a,0);for(let o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function nn(r,e){if(r.length!==e.length)return!1;for(let t=0,i=r.length;t":" "} ${s}: ${t[o]}`)}return i.join(` -`)}function xEe(r){let e=Er.getPrimaries(Er.workingColorSpace),t=Er.getPrimaries(r),i;switch(e===t?i="":e===dg&&t===pg?i="LinearDisplayP3ToLinearSRGB":e===pg&&t===dg&&(i="LinearSRGBToLinearDisplayP3"),r){case Za:case dd:return[i,"LinearTransferOETF"];case qa:case fg:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[i,"LinearTransferOETF"]}}function aie(r,e,t){let i=r.getShaderParameter(e,r.COMPILE_STATUS),n=r.getShaderInfoLog(e).trim();if(i&&n==="")return"";let a=/ERROR: 0:(\d+)/.exec(n);if(a){let o=parseInt(a[1]);return t.toUpperCase()+` +`)}function MEe(r){let e=Tr.getPrimaries(Tr.workingColorSpace),t=Tr.getPrimaries(r),i;switch(e===t?i="":e===vg&&t===mg?i="LinearDisplayP3ToLinearSRGB":e===mg&&t===vg&&(i="LinearSRGBToLinearDisplayP3"),r){case Ja:case vd:return[i,"LinearTransferOETF"];case Ka:case pg:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[i,"LinearTransferOETF"]}}function sie(r,e,t){let i=r.getShaderParameter(e,r.COMPILE_STATUS),n=r.getShaderInfoLog(e).trim();if(i&&n==="")return"";let a=/ERROR: 0:(\d+)/.exec(n);if(a){let o=parseInt(a[1]);return t.toUpperCase()+` `+n+` -`+_Ee(r.getShaderSource(e),o)}else return n}function SEe(r,e){let t=xEe(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function MEe(r,e){let t;switch(e){case K$:t="Linear";break;case J$:t="Reinhard";break;case $$:t="OptimizedCineon";break;case Q$:t="ACESFilmic";break;case tQ:t="AgX";break;case rQ:t="Neutral";break;case eQ:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function bEe(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.normalMapTangentSpace||r.clearcoatNormalMap||r.flatShading||r.alphaToCoverage||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Xg).join(` -`)}function wEe(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Xg).join(` -`)}function TEe(r){let e=[];for(let t in r){let i=r[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function EEe(r,e){let t={},i=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let n=0;n/gm;function rz(r){return r.replace(AEe,REe)}var CEe=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function REe(r,e){let t=pr[e];if(t===void 0){let i=CEe.get(e);if(i!==void 0)t=pr[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return rz(t)}var LEe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function lie(r){return r.replace(LEe,PEe)}function PEe(r,e,t,i){let n="";for(let a=parseInt(e);a/gm;function iF(r){return r.replace(REe,PEe)}var LEe=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function PEe(r,e){let t=pr[e];if(t===void 0){let i=LEe.get(e);if(i!==void 0)t=pr[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return iF(t)}var DEe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function cie(r){return r.replace(DEe,IEe)}function IEe(r,e,t,i){let n="";for(let a=parseInt(e);a0&&(v+=` -`),_=[p,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Xg).join(` +`),_=[p,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(qg).join(` `),_.length>0&&(_+=` -`)):(v=[uie(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(Xg).join(` -`),_=[p,uie(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==vs?"#define TONE_MAPPING":"",t.toneMapping!==vs?pr.tonemapping_pars_fragment:"",t.toneMapping!==vs?MEe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",pr.colorspace_pars_fragment,SEe("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(Xg).join(` -`)),o=rz(o),o=oie(o,t),o=sie(o,t),s=rz(s),s=oie(s,t),s=sie(s,t),o=lie(o),s=lie(s),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es +`)):(v=[fie(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(qg).join(` +`),_=[p,fie(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==gs?"#define TONE_MAPPING":"",t.toneMapping!==gs?pr.tonemapping_pars_fragment:"",t.toneMapping!==gs?wEe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",pr.colorspace_pars_fragment,bEe("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(qg).join(` +`)),o=iF(o),o=lie(o,t),o=uie(o,t),s=iF(s),s=lie(s,t),s=uie(s,t),o=cie(o),s=cie(s),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es `,v=[d,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+v,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===EF?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===EF?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+v,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===Az?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Az?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+_);let x=y+v+o,M=y+_+s,S=tz(n,n.VERTEX_SHADER,x),w=tz(n,n.FRAGMENT_SHADER,M);n.attachShader(m,S),n.attachShader(m,w),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);function T(I){if(r.debug.checkShaderErrors){let R=n.getProgramInfoLog(m).trim(),A=n.getShaderInfoLog(S).trim(),D=n.getShaderInfoLog(w).trim(),U=!0,B=!0;if(n.getProgramParameter(m,n.LINK_STATUS)===!1)if(U=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(n,m,S,w);else{let F=aie(n,S,"vertex"),k=aie(n,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(m,n.VALIDATE_STATUS)+` +`+_);let x=y+v+o,M=y+_+s,S=rF(n,n.VERTEX_SHADER,x),w=rF(n,n.FRAGMENT_SHADER,M);n.attachShader(m,S),n.attachShader(m,w),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);function T(I){if(r.debug.checkShaderErrors){let R=n.getProgramInfoLog(m).trim(),A=n.getShaderInfoLog(S).trim(),D=n.getShaderInfoLog(w).trim(),U=!0,B=!0;if(n.getProgramParameter(m,n.LINK_STATUS)===!1)if(U=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(n,m,S,w);else{let z=sie(n,S,"vertex"),k=sie(n,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(m,n.VALIDATE_STATUS)+` Material Name: `+I.name+` Material Type: `+I.type+` Program Info Log: `+R+` -`+F+` -`+k)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(A===""||D==="")&&(B=!1);B&&(I.diagnostics={runnable:U,programLog:R,vertexShader:{log:A,prefix:v},fragmentShader:{log:D,prefix:_}})}n.deleteShader(S),n.deleteShader(w),C=new gh(n,m),b=EEe(n,m)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let E=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=n.getProgramParameter(m,gEe)),E},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(m),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=yEe++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=S,this.fragmentShader=w,this}var FEe=0,LA=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),a=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(n)===!1&&(o.add(n),n.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new iz(e),t.set(e,i)),i}},iz=class{constructor(e){this.id=FEe++,this.code=e,this.usedTimes=0}};function fie(r,e,t,i,n,a,o){let s=new Tg,l=new LA,u=new Set,c=[],f=n.isWebGL2,h=n.logarithmicDepthBuffer,p=n.vertexTextures,d=n.precision,g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(b){return u.add(b),b===0?"uv":`uv${b}`}function v(b,E,I,R,A){let D=R.fog,U=A.geometry,B=b.isMeshStandardMaterial?R.environment:null,F=(b.isMeshStandardMaterial?t:e).get(b.envMap||B),k=F&&F.mapping===oh?F.image.height:null,G=g[b.type];b.precision!==null&&(d=n.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));let Y=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,J=Y!==void 0?Y.length:0,Q=0;U.morphAttributes.position!==void 0&&(Q=1),U.morphAttributes.normal!==void 0&&(Q=2),U.morphAttributes.color!==void 0&&(Q=3);let V,K,ae,ve;if(G){let zt=xs[G];V=zt.vertexShader,K=zt.fragmentShader}else V=b.vertexShader,K=b.fragmentShader,l.update(b),ae=l.getVertexShaderID(b),ve=l.getFragmentShaderID(b);let ue=r.getRenderTarget(),se=A.isInstancedMesh===!0,Ee=A.isBatchedMesh===!0,q=!!b.map,H=!!b.matcap,We=!!F,_e=!!b.aoMap,xe=!!b.lightMap,Le=!!b.bumpMap,Ue=!!b.normalMap,Ne=!!b.displacementMap,Ve=!!b.emissiveMap,ct=!!b.metalnessMap,z=!!b.roughnessMap,L=b.anisotropy>0,ne=b.clearcoat>0,le=b.iridescence>0,me=b.sheen>0,he=b.transmission>0,et=L&&!!b.anisotropyMap,Ke=ne&&!!b.clearcoatMap,Se=ne&&!!b.clearcoatNormalMap,Ae=ne&&!!b.clearcoatRoughnessMap,nt=le&&!!b.iridescenceMap,$=le&&!!b.iridescenceThicknessMap,it=me&&!!b.sheenColorMap,Xe=me&&!!b.sheenRoughnessMap,ze=!!b.specularMap,we=!!b.specularColorMap,Ie=!!b.specularIntensityMap,st=he&&!!b.transmissionMap,Je=he&&!!b.thicknessMap,kt=!!b.gradientMap,X=!!b.alphaMap,Te=b.alphaTest>0,te=!!b.alphaHash,Me=!!b.extensions,Pe=vs;b.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(Pe=r.toneMapping);let xt={isWebGL2:f,shaderID:G,shaderType:b.type,shaderName:b.name,vertexShader:V,fragmentShader:K,defines:b.defines,customVertexShaderID:ae,customFragmentShaderID:ve,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:Ee,instancing:se,instancingColor:se&&A.instanceColor!==null,instancingMorph:se&&A.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:ue===null?r.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Za,alphaToCoverage:!!b.alphaToCoverage,map:q,matcap:H,envMap:We,envMapMode:We&&F.mapping,envMapCubeUVHeight:k,aoMap:_e,lightMap:xe,bumpMap:Le,normalMap:Ue,displacementMap:p&&Ne,emissiveMap:Ve,normalMapObjectSpace:Ue&&b.normalMapType===dQ,normalMapTangentSpace:Ue&&b.normalMapType===pQ,metalnessMap:ct,roughnessMap:z,anisotropy:L,anisotropyMap:et,clearcoat:ne,clearcoatMap:Ke,clearcoatNormalMap:Se,clearcoatRoughnessMap:Ae,iridescence:le,iridescenceMap:nt,iridescenceThicknessMap:$,sheen:me,sheenColorMap:it,sheenRoughnessMap:Xe,specularMap:ze,specularColorMap:we,specularIntensityMap:Ie,transmission:he,transmissionMap:st,thicknessMap:Je,gradientMap:kt,opaque:b.transparent===!1&&b.blending===Yu&&b.alphaToCoverage===!1,alphaMap:X,alphaTest:Te,alphaHash:te,combine:b.combine,mapUv:q&&m(b.map.channel),aoMapUv:_e&&m(b.aoMap.channel),lightMapUv:xe&&m(b.lightMap.channel),bumpMapUv:Le&&m(b.bumpMap.channel),normalMapUv:Ue&&m(b.normalMap.channel),displacementMapUv:Ne&&m(b.displacementMap.channel),emissiveMapUv:Ve&&m(b.emissiveMap.channel),metalnessMapUv:ct&&m(b.metalnessMap.channel),roughnessMapUv:z&&m(b.roughnessMap.channel),anisotropyMapUv:et&&m(b.anisotropyMap.channel),clearcoatMapUv:Ke&&m(b.clearcoatMap.channel),clearcoatNormalMapUv:Se&&m(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&m(b.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&m(b.iridescenceMap.channel),iridescenceThicknessMapUv:$&&m(b.iridescenceThicknessMap.channel),sheenColorMapUv:it&&m(b.sheenColorMap.channel),sheenRoughnessMapUv:Xe&&m(b.sheenRoughnessMap.channel),specularMapUv:ze&&m(b.specularMap.channel),specularColorMapUv:we&&m(b.specularColorMap.channel),specularIntensityMapUv:Ie&&m(b.specularIntensityMap.channel),transmissionMapUv:st&&m(b.transmissionMap.channel),thicknessMapUv:Je&&m(b.thicknessMap.channel),alphaMapUv:X&&m(b.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(Ue||L),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:A.isPoints===!0&&!!U.attributes.uv&&(q||X),fog:!!D,useFog:b.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:A.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:J,morphTextureStride:Q,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:Pe,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&b.map.isVideoTexture===!0&&Er.getTransfer(b.map.colorSpace)===Hr,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Co,flipSided:b.side===_i,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Me&&b.extensions.derivatives===!0,extensionFragDepth:Me&&b.extensions.fragDepth===!0,extensionDrawBuffers:Me&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Me&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Me&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Me&&b.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:f||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:f||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:f||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return xt.vertexUv1s=u.has(1),xt.vertexUv2s=u.has(2),xt.vertexUv3s=u.has(3),u.clear(),xt}function _(b){let E=[];if(b.shaderID?E.push(b.shaderID):(E.push(b.customVertexShaderID),E.push(b.customFragmentShaderID)),b.defines!==void 0)for(let I in b.defines)E.push(I),E.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(y(E,b),x(E,b),E.push(r.outputColorSpace)),E.push(b.customProgramCacheKey),E.join()}function y(b,E){b.push(E.precision),b.push(E.outputColorSpace),b.push(E.envMapMode),b.push(E.envMapCubeUVHeight),b.push(E.mapUv),b.push(E.alphaMapUv),b.push(E.lightMapUv),b.push(E.aoMapUv),b.push(E.bumpMapUv),b.push(E.normalMapUv),b.push(E.displacementMapUv),b.push(E.emissiveMapUv),b.push(E.metalnessMapUv),b.push(E.roughnessMapUv),b.push(E.anisotropyMapUv),b.push(E.clearcoatMapUv),b.push(E.clearcoatNormalMapUv),b.push(E.clearcoatRoughnessMapUv),b.push(E.iridescenceMapUv),b.push(E.iridescenceThicknessMapUv),b.push(E.sheenColorMapUv),b.push(E.sheenRoughnessMapUv),b.push(E.specularMapUv),b.push(E.specularColorMapUv),b.push(E.specularIntensityMapUv),b.push(E.transmissionMapUv),b.push(E.thicknessMapUv),b.push(E.combine),b.push(E.fogExp2),b.push(E.sizeAttenuation),b.push(E.morphTargetsCount),b.push(E.morphAttributeCount),b.push(E.numDirLights),b.push(E.numPointLights),b.push(E.numSpotLights),b.push(E.numSpotLightMaps),b.push(E.numHemiLights),b.push(E.numRectAreaLights),b.push(E.numDirLightShadows),b.push(E.numPointLightShadows),b.push(E.numSpotLightShadows),b.push(E.numSpotLightShadowsWithMaps),b.push(E.numLightProbes),b.push(E.shadowMapType),b.push(E.toneMapping),b.push(E.numClippingPlanes),b.push(E.numClipIntersection),b.push(E.depthPacking)}function x(b,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.instancingMorph&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.normalMapObjectSpace&&s.enable(7),E.normalMapTangentSpace&&s.enable(8),E.clearcoat&&s.enable(9),E.iridescence&&s.enable(10),E.alphaTest&&s.enable(11),E.vertexColors&&s.enable(12),E.vertexAlphas&&s.enable(13),E.vertexUv1s&&s.enable(14),E.vertexUv2s&&s.enable(15),E.vertexUv3s&&s.enable(16),E.vertexTangents&&s.enable(17),E.anisotropy&&s.enable(18),E.alphaHash&&s.enable(19),E.batching&&s.enable(20),b.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.useLegacyLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.transmission&&s.enable(15),E.sheen&&s.enable(16),E.opaque&&s.enable(17),E.pointsUvs&&s.enable(18),E.decodeVideoTexture&&s.enable(19),E.alphaToCoverage&&s.enable(20),b.push(s.mask)}function M(b){let E=g[b.type],I;if(E){let R=xs[E];I=HQ.clone(R.uniforms)}else I=b.uniforms;return I}function S(b,E){let I;for(let R=0,A=c.length;R0?i.push(v):p.transparent===!0?n.push(v):t.push(v)}function l(f,h,p,d,g,m){let v=o(f,h,p,d,g,m);p.transmission>0?i.unshift(v):p.transparent===!0?n.unshift(v):t.unshift(v)}function u(f,h){t.length>1&&t.sort(f||zEe),i.length>1&&i.sort(h||pie),n.length>1&&n.sort(h||pie)}function c(){for(let f=e,h=r.length;f=a.length?(o=new die,a.push(o)):o=a[n],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function BEe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new be,color:new ir};break;case"SpotLight":t={position:new be,direction:new be,color:new ir,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new be,color:new ir,distance:0,decay:0};break;case"HemisphereLight":t={direction:new be,skyColor:new ir,groundColor:new ir};break;case"RectAreaLight":t={color:new ir,position:new be,halfWidth:new be,halfHeight:new be};break}return r[e.id]=t,t}}}function kEe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var VEe=0;function GEe(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function vie(r,e){let t=new BEe,i=kEe(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new be);let a=new be,o=new Wr,s=new Wr;function l(c,f){let h=0,p=0,d=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let g=0,m=0,v=0,_=0,y=0,x=0,M=0,S=0,w=0,T=0,C=0;c.sort(GEe);let b=f===!0?Math.PI:1;for(let I=0,R=c.length;I0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=ht.LTC_FLOAT_1,n.rectAreaLTC2=ht.LTC_FLOAT_2):(n.rectAreaLTC1=ht.LTC_HALF_1,n.rectAreaLTC2=ht.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=ht.LTC_FLOAT_1,n.rectAreaLTC2=ht.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(n.rectAreaLTC1=ht.LTC_HALF_1,n.rectAreaLTC2=ht.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=h,n.ambient[1]=p,n.ambient[2]=d;let E=n.hash;(E.directionalLength!==g||E.pointLength!==m||E.spotLength!==v||E.rectAreaLength!==_||E.hemiLength!==y||E.numDirectionalShadows!==x||E.numPointShadows!==M||E.numSpotShadows!==S||E.numSpotMaps!==w||E.numLightProbes!==C)&&(n.directional.length=g,n.spot.length=v,n.rectArea.length=_,n.point.length=m,n.hemi.length=y,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=S+w-T,n.spotLightMap.length=w,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=C,E.directionalLength=g,E.pointLength=m,E.spotLength=v,E.rectAreaLength=_,E.hemiLength=y,E.numDirectionalShadows=x,E.numPointShadows=M,E.numSpotShadows=S,E.numSpotMaps=w,E.numLightProbes=C,n.version=VEe++)}function u(c,f){let h=0,p=0,d=0,g=0,m=0,v=f.matrixWorldInverse;for(let _=0,y=c.length;_=s.length?(l=new gie(r,e),s.push(l)):l=s[o],l}function n(){t=new WeakMap}return{get:i,dispose:n}}var PA=class extends ou{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=fQ,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};var DA=class extends ou{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};var _ie=` +`+z+` +`+k)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(A===""||D==="")&&(B=!1);B&&(I.diagnostics={runnable:U,programLog:R,vertexShader:{log:A,prefix:v},fragmentShader:{log:D,prefix:_}})}n.deleteShader(S),n.deleteShader(w),C=new _h(n,m),b=CEe(n,m)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let E=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=n.getProgramParameter(m,_Ee)),E},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(m),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=xEe++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=S,this.fragmentShader=w,this}var BEe=0,PA=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),a=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(n)===!1&&(o.add(n),n.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new nF(e),t.set(e,i)),i}},nF=class{constructor(e){this.id=BEe++,this.code=e,this.usedTimes=0}};function pie(r,e,t,i,n,a,o){let s=new Ag,l=new PA,u=new Set,c=[],f=n.isWebGL2,h=n.logarithmicDepthBuffer,p=n.vertexTextures,d=n.precision,g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(b){return u.add(b),b===0?"uv":`uv${b}`}function v(b,E,I,R,A){let D=R.fog,U=A.geometry,B=b.isMeshStandardMaterial?R.environment:null,z=(b.isMeshStandardMaterial?t:e).get(b.envMap||B),k=z&&z.mapping===lh?z.image.height:null,G=g[b.type];b.precision!==null&&(d=n.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));let Y=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,J=Y!==void 0?Y.length:0,Q=0;U.morphAttributes.position!==void 0&&(Q=1),U.morphAttributes.normal!==void 0&&(Q=2),U.morphAttributes.color!==void 0&&(Q=3);let V,K,ae,ve;if(G){let Ft=Ss[G];V=Ft.vertexShader,K=Ft.fragmentShader}else V=b.vertexShader,K=b.fragmentShader,l.update(b),ae=l.getVertexShaderID(b),ve=l.getFragmentShaderID(b);let ue=r.getRenderTarget(),se=A.isInstancedMesh===!0,Ee=A.isBatchedMesh===!0,q=!!b.map,H=!!b.matcap,We=!!z,_e=!!b.aoMap,xe=!!b.lightMap,Le=!!b.bumpMap,Ue=!!b.normalMap,Ne=!!b.displacementMap,Ve=!!b.emissiveMap,ct=!!b.metalnessMap,F=!!b.roughnessMap,L=b.anisotropy>0,ne=b.clearcoat>0,le=b.iridescence>0,me=b.sheen>0,he=b.transmission>0,et=L&&!!b.anisotropyMap,Ke=ne&&!!b.clearcoatMap,Se=ne&&!!b.clearcoatNormalMap,Ae=ne&&!!b.clearcoatRoughnessMap,nt=le&&!!b.iridescenceMap,$=le&&!!b.iridescenceThicknessMap,it=me&&!!b.sheenColorMap,Xe=me&&!!b.sheenRoughnessMap,Fe=!!b.specularMap,we=!!b.specularColorMap,Ie=!!b.specularIntensityMap,st=he&&!!b.transmissionMap,Je=he&&!!b.thicknessMap,kt=!!b.gradientMap,X=!!b.alphaMap,Te=b.alphaTest>0,te=!!b.alphaHash,Me=!!b.extensions,Pe=gs;b.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(Pe=r.toneMapping);let xt={isWebGL2:f,shaderID:G,shaderType:b.type,shaderName:b.name,vertexShader:V,fragmentShader:K,defines:b.defines,customVertexShaderID:ae,customFragmentShaderID:ve,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:Ee,instancing:se,instancingColor:se&&A.instanceColor!==null,instancingMorph:se&&A.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:ue===null?r.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Ja,alphaToCoverage:!!b.alphaToCoverage,map:q,matcap:H,envMap:We,envMapMode:We&&z.mapping,envMapCubeUVHeight:k,aoMap:_e,lightMap:xe,bumpMap:Le,normalMap:Ue,displacementMap:p&&Ne,emissiveMap:Ve,normalMapObjectSpace:Ue&&b.normalMapType===vQ,normalMapTangentSpace:Ue&&b.normalMapType===mQ,metalnessMap:ct,roughnessMap:F,anisotropy:L,anisotropyMap:et,clearcoat:ne,clearcoatMap:Ke,clearcoatNormalMap:Se,clearcoatRoughnessMap:Ae,iridescence:le,iridescenceMap:nt,iridescenceThicknessMap:$,sheen:me,sheenColorMap:it,sheenRoughnessMap:Xe,specularMap:Fe,specularColorMap:we,specularIntensityMap:Ie,transmission:he,transmissionMap:st,thicknessMap:Je,gradientMap:kt,opaque:b.transparent===!1&&b.blending===Xu&&b.alphaToCoverage===!1,alphaMap:X,alphaTest:Te,alphaHash:te,combine:b.combine,mapUv:q&&m(b.map.channel),aoMapUv:_e&&m(b.aoMap.channel),lightMapUv:xe&&m(b.lightMap.channel),bumpMapUv:Le&&m(b.bumpMap.channel),normalMapUv:Ue&&m(b.normalMap.channel),displacementMapUv:Ne&&m(b.displacementMap.channel),emissiveMapUv:Ve&&m(b.emissiveMap.channel),metalnessMapUv:ct&&m(b.metalnessMap.channel),roughnessMapUv:F&&m(b.roughnessMap.channel),anisotropyMapUv:et&&m(b.anisotropyMap.channel),clearcoatMapUv:Ke&&m(b.clearcoatMap.channel),clearcoatNormalMapUv:Se&&m(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&m(b.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&m(b.iridescenceMap.channel),iridescenceThicknessMapUv:$&&m(b.iridescenceThicknessMap.channel),sheenColorMapUv:it&&m(b.sheenColorMap.channel),sheenRoughnessMapUv:Xe&&m(b.sheenRoughnessMap.channel),specularMapUv:Fe&&m(b.specularMap.channel),specularColorMapUv:we&&m(b.specularColorMap.channel),specularIntensityMapUv:Ie&&m(b.specularIntensityMap.channel),transmissionMapUv:st&&m(b.transmissionMap.channel),thicknessMapUv:Je&&m(b.thicknessMap.channel),alphaMapUv:X&&m(b.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(Ue||L),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:A.isPoints===!0&&!!U.attributes.uv&&(q||X),fog:!!D,useFog:b.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:A.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:J,morphTextureStride:Q,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:Pe,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&b.map.isVideoTexture===!0&&Tr.getTransfer(b.map.colorSpace)===Hr,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Co,flipSided:b.side===_i,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Me&&b.extensions.derivatives===!0,extensionFragDepth:Me&&b.extensions.fragDepth===!0,extensionDrawBuffers:Me&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Me&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Me&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Me&&b.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:f||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:f||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:f||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return xt.vertexUv1s=u.has(1),xt.vertexUv2s=u.has(2),xt.vertexUv3s=u.has(3),u.clear(),xt}function _(b){let E=[];if(b.shaderID?E.push(b.shaderID):(E.push(b.customVertexShaderID),E.push(b.customFragmentShaderID)),b.defines!==void 0)for(let I in b.defines)E.push(I),E.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(y(E,b),x(E,b),E.push(r.outputColorSpace)),E.push(b.customProgramCacheKey),E.join()}function y(b,E){b.push(E.precision),b.push(E.outputColorSpace),b.push(E.envMapMode),b.push(E.envMapCubeUVHeight),b.push(E.mapUv),b.push(E.alphaMapUv),b.push(E.lightMapUv),b.push(E.aoMapUv),b.push(E.bumpMapUv),b.push(E.normalMapUv),b.push(E.displacementMapUv),b.push(E.emissiveMapUv),b.push(E.metalnessMapUv),b.push(E.roughnessMapUv),b.push(E.anisotropyMapUv),b.push(E.clearcoatMapUv),b.push(E.clearcoatNormalMapUv),b.push(E.clearcoatRoughnessMapUv),b.push(E.iridescenceMapUv),b.push(E.iridescenceThicknessMapUv),b.push(E.sheenColorMapUv),b.push(E.sheenRoughnessMapUv),b.push(E.specularMapUv),b.push(E.specularColorMapUv),b.push(E.specularIntensityMapUv),b.push(E.transmissionMapUv),b.push(E.thicknessMapUv),b.push(E.combine),b.push(E.fogExp2),b.push(E.sizeAttenuation),b.push(E.morphTargetsCount),b.push(E.morphAttributeCount),b.push(E.numDirLights),b.push(E.numPointLights),b.push(E.numSpotLights),b.push(E.numSpotLightMaps),b.push(E.numHemiLights),b.push(E.numRectAreaLights),b.push(E.numDirLightShadows),b.push(E.numPointLightShadows),b.push(E.numSpotLightShadows),b.push(E.numSpotLightShadowsWithMaps),b.push(E.numLightProbes),b.push(E.shadowMapType),b.push(E.toneMapping),b.push(E.numClippingPlanes),b.push(E.numClipIntersection),b.push(E.depthPacking)}function x(b,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.instancingMorph&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.normalMapObjectSpace&&s.enable(7),E.normalMapTangentSpace&&s.enable(8),E.clearcoat&&s.enable(9),E.iridescence&&s.enable(10),E.alphaTest&&s.enable(11),E.vertexColors&&s.enable(12),E.vertexAlphas&&s.enable(13),E.vertexUv1s&&s.enable(14),E.vertexUv2s&&s.enable(15),E.vertexUv3s&&s.enable(16),E.vertexTangents&&s.enable(17),E.anisotropy&&s.enable(18),E.alphaHash&&s.enable(19),E.batching&&s.enable(20),b.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.useLegacyLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.transmission&&s.enable(15),E.sheen&&s.enable(16),E.opaque&&s.enable(17),E.pointsUvs&&s.enable(18),E.decodeVideoTexture&&s.enable(19),E.alphaToCoverage&&s.enable(20),b.push(s.mask)}function M(b){let E=g[b.type],I;if(E){let R=Ss[E];I=XQ.clone(R.uniforms)}else I=b.uniforms;return I}function S(b,E){let I;for(let R=0,A=c.length;R0?i.push(v):p.transparent===!0?n.push(v):t.push(v)}function l(f,h,p,d,g,m){let v=o(f,h,p,d,g,m);p.transmission>0?i.unshift(v):p.transparent===!0?n.unshift(v):t.unshift(v)}function u(f,h){t.length>1&&t.sort(f||kEe),i.length>1&&i.sort(h||mie),n.length>1&&n.sort(h||mie)}function c(){for(let f=e,h=r.length;f=a.length?(o=new vie,a.push(o)):o=a[n],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function VEe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new be,color:new ir};break;case"SpotLight":t={position:new be,direction:new be,color:new ir,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new be,color:new ir,distance:0,decay:0};break;case"HemisphereLight":t={direction:new be,skyColor:new ir,groundColor:new ir};break;case"RectAreaLight":t={color:new ir,position:new be,halfWidth:new be,halfHeight:new be};break}return r[e.id]=t,t}}}function GEe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kt,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var HEe=0;function WEe(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function yie(r,e){let t=new VEe,i=GEe(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new be);let a=new be,o=new Wr,s=new Wr;function l(c,f){let h=0,p=0,d=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let g=0,m=0,v=0,_=0,y=0,x=0,M=0,S=0,w=0,T=0,C=0;c.sort(WEe);let b=f===!0?Math.PI:1;for(let I=0,R=c.length;I0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=ht.LTC_FLOAT_1,n.rectAreaLTC2=ht.LTC_FLOAT_2):(n.rectAreaLTC1=ht.LTC_HALF_1,n.rectAreaLTC2=ht.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=ht.LTC_FLOAT_1,n.rectAreaLTC2=ht.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(n.rectAreaLTC1=ht.LTC_HALF_1,n.rectAreaLTC2=ht.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=h,n.ambient[1]=p,n.ambient[2]=d;let E=n.hash;(E.directionalLength!==g||E.pointLength!==m||E.spotLength!==v||E.rectAreaLength!==_||E.hemiLength!==y||E.numDirectionalShadows!==x||E.numPointShadows!==M||E.numSpotShadows!==S||E.numSpotMaps!==w||E.numLightProbes!==C)&&(n.directional.length=g,n.spot.length=v,n.rectArea.length=_,n.point.length=m,n.hemi.length=y,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=S+w-T,n.spotLightMap.length=w,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=C,E.directionalLength=g,E.pointLength=m,E.spotLength=v,E.rectAreaLength=_,E.hemiLength=y,E.numDirectionalShadows=x,E.numPointShadows=M,E.numSpotShadows=S,E.numSpotMaps=w,E.numLightProbes=C,n.version=HEe++)}function u(c,f){let h=0,p=0,d=0,g=0,m=0,v=f.matrixWorldInverse;for(let _=0,y=c.length;_=s.length?(l=new _ie(r,e),s.push(l)):l=s[o],l}function n(){t=new WeakMap}return{get:i,dispose:n}}var DA=class extends au{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=pQ,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};var IA=class extends au{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};var Sie=` void main() { gl_Position = vec4( position, 1.0 ); } -`,xie=` +`,Mie=` uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; @@ -8718,12 +8718,12 @@ void main() { gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); } -`;function Sie(r,e,t){let i=new vh,n=new Kt,a=new Kt,o=new ii,s=new PA({depthPacking:hQ}),l=new DA,u={},c=t.maxTextureSize,f={[Ao]:_i,[_i]:Ao,[Co]:Co},h=new ya({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Kt},radius:{value:4}},vertexShader:_ie,fragmentShader:xie}),p=h.clone();p.defines.HORIZONTAL_PASS=1;let d=new Qa;d.setAttribute("position",new ga(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new rn(d,h),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=UE;let v=this.type;this.render=function(S,w,T){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;let C=r.getRenderTarget(),b=r.getActiveCubeFace(),E=r.getActiveMipmapLevel(),I=r.state;I.setBlending(ms),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);let R=v!==nl&&this.type===nl,A=v===nl&&this.type!==nl;for(let D=0,U=S.length;Dc||n.y>c)&&(n.x>c&&(a.x=Math.floor(c/k.x),n.x=a.x*k.x,F.mapSize.x=a.x),n.y>c&&(a.y=Math.floor(c/k.y),n.y=a.y*k.y,F.mapSize.y=a.y)),F.map===null||R===!0||A===!0){let Y=this.type!==nl?{minFilter:ki,magFilter:ki}:{};F.map!==null&&F.map.dispose(),F.map=new $a(n.x,n.y,Y),F.map.texture.name=B.name+".shadowMap",F.camera.updateProjectionMatrix()}r.setRenderTarget(F.map),r.clear();let G=F.getViewportCount();for(let Y=0;Y0||w.map&&w.alphaTest>0){let I=b.uuid,R=w.uuid,A=u[I];A===void 0&&(A={},u[I]=A);let D=A[R];D===void 0&&(D=b.clone(),A[R]=D,w.addEventListener("dispose",M)),b=D}if(b.visible=w.visible,b.wireframe=w.wireframe,C===nl?b.side=w.shadowSide!==null?w.shadowSide:w.side:b.side=w.shadowSide!==null?w.shadowSide:f[w.side],b.alphaMap=w.alphaMap,b.alphaTest=w.alphaTest,b.map=w.map,b.clipShadows=w.clipShadows,b.clippingPlanes=w.clippingPlanes,b.clipIntersection=w.clipIntersection,b.displacementMap=w.displacementMap,b.displacementScale=w.displacementScale,b.displacementBias=w.displacementBias,b.wireframeLinewidth=w.wireframeLinewidth,b.linewidth=w.linewidth,T.isPointLight===!0&&b.isMeshDistanceMaterial===!0){let I=r.properties.get(b);I.light=T}return b}function x(S,w,T,C,b){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&b===nl)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);let R=e.update(S),A=S.material;if(Array.isArray(A)){let D=R.groups;for(let U=0,B=D.length;U=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),F=k>=2);let Y=null,J={},Q=r.getParameter(r.SCISSOR_BOX),V=r.getParameter(r.VIEWPORT),K=new ii().fromArray(Q),ae=new ii().fromArray(V);function ve(X,Te,te,Me){let Pe=new Uint8Array(4),xt=r.createTexture();r.bindTexture(X,xt),r.texParameteri(X,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(X,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let zt=0;zt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Kt,f=new WeakMap,h,p=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(z,L){return d?new OffscreenCanvas(z,L):vg("canvas")}function m(z,L,ne,le){let me=1,he=ct(z);if((he.width>le||he.height>le)&&(me=le/Math.max(he.width,he.height)),me<1||L===!0)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap||typeof VideoFrame<"u"&&z instanceof VideoFrame){let et=L?fS:Math.floor,Ke=et(me*he.width),Se=et(me*he.height);h===void 0&&(h=g(Ke,Se));let Ae=ne?g(Ke,Se):h;return Ae.width=Ke,Ae.height=Se,Ae.getContext("2d").drawImage(z,0,0,Ke,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+he.width+"x"+he.height+") to ("+Ke+"x"+Se+")."),Ae}else return"data"in z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+he.width+"x"+he.height+")."),z;return z}function v(z){let L=ct(z);return AF(L.width)&&AF(L.height)}function _(z){return s?!1:z.wrapS!==ma||z.wrapT!==ma||z.minFilter!==ki&&z.minFilter!==Qi}function y(z,L){return z.generateMipmaps&&L&&z.minFilter!==ki&&z.minFilter!==Qi}function x(z){r.generateMipmap(z)}function M(z,L,ne,le,me=!1){if(s===!1)return L;if(z!==null){if(r[z]!==void 0)return r[z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let he=L;if(L===r.RED&&(ne===r.FLOAT&&(he=r.R32F),ne===r.HALF_FLOAT&&(he=r.R16F),ne===r.UNSIGNED_BYTE&&(he=r.R8)),L===r.RED_INTEGER&&(ne===r.UNSIGNED_BYTE&&(he=r.R8UI),ne===r.UNSIGNED_SHORT&&(he=r.R16UI),ne===r.UNSIGNED_INT&&(he=r.R32UI),ne===r.BYTE&&(he=r.R8I),ne===r.SHORT&&(he=r.R16I),ne===r.INT&&(he=r.R32I)),L===r.RG&&(ne===r.FLOAT&&(he=r.RG32F),ne===r.HALF_FLOAT&&(he=r.RG16F),ne===r.UNSIGNED_BYTE&&(he=r.RG8)),L===r.RG_INTEGER&&(ne===r.UNSIGNED_BYTE&&(he=r.RG8UI),ne===r.UNSIGNED_SHORT&&(he=r.RG16UI),ne===r.UNSIGNED_INT&&(he=r.RG32UI),ne===r.BYTE&&(he=r.RG8I),ne===r.SHORT&&(he=r.RG16I),ne===r.INT&&(he=r.RG32I)),L===r.RGBA){let et=me?hg:Er.getTransfer(le);ne===r.FLOAT&&(he=r.RGBA32F),ne===r.HALF_FLOAT&&(he=r.RGBA16F),ne===r.UNSIGNED_BYTE&&(he=et===Hr?r.SRGB8_ALPHA8:r.RGBA8),ne===r.UNSIGNED_SHORT_4_4_4_4&&(he=r.RGBA4),ne===r.UNSIGNED_SHORT_5_5_5_1&&(he=r.RGB5_A1)}return(he===r.R16F||he===r.R32F||he===r.RG16F||he===r.RG32F||he===r.RGBA16F||he===r.RGBA32F)&&e.get("EXT_color_buffer_float"),he}function S(z,L,ne){return y(z,ne)===!0||z.isFramebufferTexture&&z.minFilter!==ki&&z.minFilter!==Qi?Math.log2(Math.max(L.width,L.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?L.mipmaps.length:1}function w(z){return z===ki||z===$3||z===ug?r.NEAREST:r.LINEAR}function T(z){let L=z.target;L.removeEventListener("dispose",T),b(L),L.isVideoTexture&&f.delete(L)}function C(z){let L=z.target;L.removeEventListener("dispose",C),I(L)}function b(z){let L=i.get(z);if(L.__webglInit===void 0)return;let ne=z.source,le=p.get(ne);if(le){let me=le[L.__cacheKey];me.usedTimes--,me.usedTimes===0&&E(z),Object.keys(le).length===0&&p.delete(ne)}i.remove(z)}function E(z){let L=i.get(z);r.deleteTexture(L.__webglTexture);let ne=z.source,le=p.get(ne);delete le[L.__cacheKey],o.memory.textures--}function I(z){let L=i.get(z);if(z.depthTexture&&z.depthTexture.dispose(),z.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(L.__webglFramebuffer[le]))for(let me=0;me=n.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+n.maxTextures),R+=1,z}function U(z){let L=[];return L.push(z.wrapS),L.push(z.wrapT),L.push(z.wrapR||0),L.push(z.magFilter),L.push(z.minFilter),L.push(z.anisotropy),L.push(z.internalFormat),L.push(z.format),L.push(z.type),L.push(z.generateMipmaps),L.push(z.premultiplyAlpha),L.push(z.flipY),L.push(z.unpackAlignment),L.push(z.colorSpace),L.join()}function B(z,L){let ne=i.get(z);if(z.isVideoTexture&&Ne(z),z.isRenderTargetTexture===!1&&z.version>0&&ne.__version!==z.version){let le=z.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(ne,z,L);return}}t.bindTexture(r.TEXTURE_2D,ne.__webglTexture,r.TEXTURE0+L)}function F(z,L){let ne=i.get(z);if(z.version>0&&ne.__version!==z.version){ae(ne,z,L);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ne.__webglTexture,r.TEXTURE0+L)}function k(z,L){let ne=i.get(z);if(z.version>0&&ne.__version!==z.version){ae(ne,z,L);return}t.bindTexture(r.TEXTURE_3D,ne.__webglTexture,r.TEXTURE0+L)}function G(z,L){let ne=i.get(z);if(z.version>0&&ne.__version!==z.version){ve(ne,z,L);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ne.__webglTexture,r.TEXTURE0+L)}let Y={[sS]:r.REPEAT,[ma]:r.CLAMP_TO_EDGE,[lS]:r.MIRRORED_REPEAT},J={[ki]:r.NEAREST,[$3]:r.NEAREST_MIPMAP_NEAREST,[ug]:r.NEAREST_MIPMAP_LINEAR,[Qi]:r.LINEAR,[FE]:r.LINEAR_MIPMAP_NEAREST,[ol]:r.LINEAR_MIPMAP_LINEAR},Q={[mQ]:r.NEVER,[SQ]:r.ALWAYS,[vQ]:r.LESS,[KE]:r.LEQUAL,[gQ]:r.EQUAL,[xQ]:r.GEQUAL,[yQ]:r.GREATER,[_Q]:r.NOTEQUAL};function V(z,L,ne){if(L.type===Ya&&e.has("OES_texture_float_linear")===!1&&(L.magFilter===Qi||L.magFilter===FE||L.magFilter===ug||L.magFilter===ol||L.minFilter===Qi||L.minFilter===FE||L.minFilter===ug||L.minFilter===ol)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ne?(r.texParameteri(z,r.TEXTURE_WRAP_S,Y[L.wrapS]),r.texParameteri(z,r.TEXTURE_WRAP_T,Y[L.wrapT]),(z===r.TEXTURE_3D||z===r.TEXTURE_2D_ARRAY)&&r.texParameteri(z,r.TEXTURE_WRAP_R,Y[L.wrapR]),r.texParameteri(z,r.TEXTURE_MAG_FILTER,J[L.magFilter]),r.texParameteri(z,r.TEXTURE_MIN_FILTER,J[L.minFilter])):(r.texParameteri(z,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(z,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(z===r.TEXTURE_3D||z===r.TEXTURE_2D_ARRAY)&&r.texParameteri(z,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(L.wrapS!==ma||L.wrapT!==ma)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(z,r.TEXTURE_MAG_FILTER,w(L.magFilter)),r.texParameteri(z,r.TEXTURE_MIN_FILTER,w(L.minFilter)),L.minFilter!==ki&&L.minFilter!==Qi&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),L.compareFunction&&(r.texParameteri(z,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(z,r.TEXTURE_COMPARE_FUNC,Q[L.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(L.magFilter===ki||L.minFilter!==ug&&L.minFilter!==ol||L.type===Ya&&e.has("OES_texture_float_linear")===!1||s===!1&&L.type===Zu&&e.has("OES_texture_half_float_linear")===!1)return;if(L.anisotropy>1||i.get(L).__currentAnisotropy){let le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(z,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,n.getMaxAnisotropy())),i.get(L).__currentAnisotropy=L.anisotropy}}}function K(z,L){let ne=!1;z.__webglInit===void 0&&(z.__webglInit=!0,L.addEventListener("dispose",T));let le=L.source,me=p.get(le);me===void 0&&(me={},p.set(le,me));let he=U(L);if(he!==z.__cacheKey){me[he]===void 0&&(me[he]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ne=!0),me[he].usedTimes++;let et=me[z.__cacheKey];et!==void 0&&(me[z.__cacheKey].usedTimes--,et.usedTimes===0&&E(L)),z.__cacheKey=he,z.__webglTexture=me[he].texture}return ne}function ae(z,L,ne){let le=r.TEXTURE_2D;(L.isDataArrayTexture||L.isCompressedArrayTexture)&&(le=r.TEXTURE_2D_ARRAY),L.isData3DTexture&&(le=r.TEXTURE_3D);let me=K(z,L),he=L.source;t.bindTexture(le,z.__webglTexture,r.TEXTURE0+ne);let et=i.get(he);if(he.version!==et.__version||me===!0){t.activeTexture(r.TEXTURE0+ne);let Ke=Er.getPrimaries(Er.workingColorSpace),Se=L.colorSpace===ys?null:Er.getPrimaries(L.colorSpace),Ae=L.colorSpace===ys||Ke===Se?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,L.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,L.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ae);let nt=_(L)&&v(L.image)===!1,$=m(L.image,nt,!1,n.maxTextureSize);$=Ve(L,$);let it=v($)||s,Xe=a.convert(L.format,L.colorSpace),ze=a.convert(L.type),we=M(L.internalFormat,Xe,ze,L.colorSpace,L.isVideoTexture);V(le,L,it);let Ie,st=L.mipmaps,Je=s&&L.isVideoTexture!==!0&&we!==ZE,kt=et.__version===void 0||me===!0,X=he.dataReady,Te=S(L,$,it);if(L.isDepthTexture)we=r.DEPTH_COMPONENT,s?L.type===Ya?we=r.DEPTH_COMPONENT32F:L.type===Lo?we=r.DEPTH_COMPONENT24:L.type===gs?we=r.DEPTH24_STENCIL8:we=r.DEPTH_COMPONENT16:L.type===Ya&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===sl&&we===r.DEPTH_COMPONENT&&L.type!==cg&&L.type!==Lo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=Lo,ze=a.convert(L.type)),L.format===ru&&we===r.DEPTH_COMPONENT&&(we=r.DEPTH_STENCIL,L.type!==gs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=gs,ze=a.convert(L.type))),kt&&(Je?t.texStorage2D(r.TEXTURE_2D,1,we,$.width,$.height):t.texImage2D(r.TEXTURE_2D,0,we,$.width,$.height,0,Xe,ze,null));else if(L.isDataTexture)if(st.length>0&&it){Je&&kt&&t.texStorage2D(r.TEXTURE_2D,Te,we,st[0].width,st[0].height);for(let te=0,Me=st.length;te>=1,Me>>=1}}else if(st.length>0&&it){if(Je&&kt){let te=ct(st[0]);t.texStorage2D(r.TEXTURE_2D,Te,we,te.width,te.height)}for(let te=0,Me=st.length;te0&&X++;let te=ct($[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,X,Ie,te.width,te.height)}for(let te=0;te<6;te++)if(nt){st?kt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,$[te].width,$[te].height,ze,we,$[te].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,Ie,$[te].width,$[te].height,0,ze,we,$[te].data);for(let Me=0;Me>he),$=Math.max(1,L.height>>he);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,he,Se,nt,$,L.depth,0,et,Ke,null):t.texImage2D(me,he,Se,nt,$,0,et,Ke,null)}t.bindFramebuffer(r.FRAMEBUFFER,z),Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,0,Le(L)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,he),t.bindFramebuffer(r.FRAMEBUFFER,null)}function se(z,L,ne){if(r.bindRenderbuffer(r.RENDERBUFFER,z),L.depthBuffer&&!L.stencilBuffer){let le=s===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(ne||Ue(L)){let me=L.depthTexture;me&&me.isDepthTexture&&(me.type===Ya?le=r.DEPTH_COMPONENT32F:me.type===Lo&&(le=r.DEPTH_COMPONENT24));let he=Le(L);Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,he,le,L.width,L.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,he,le,L.width,L.height)}else r.renderbufferStorage(r.RENDERBUFFER,le,L.width,L.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,z)}else if(L.depthBuffer&&L.stencilBuffer){let le=Le(L);ne&&Ue(L)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,L.width,L.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,z)}else{let le=L.textures;for(let me=0;me1,Ke=v(z)||s;if(et||(le.__webglTexture===void 0&&(le.__webglTexture=r.createTexture()),le.__version=L.version,o.memory.textures++),he){ne.__webglFramebuffer=[];for(let Se=0;Se<6;Se++)if(s&&L.mipmaps&&L.mipmaps.length>0){ne.__webglFramebuffer[Se]=[];for(let Ae=0;Ae0){ne.__webglFramebuffer=[];for(let Se=0;Se0&&Ue(z)===!1){ne.__webglMultisampledFramebuffer=r.createFramebuffer(),ne.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ne.__webglMultisampledFramebuffer);for(let Se=0;Se0)for(let Ae=0;Ae0)for(let Ae=0;Ae0&&Ue(z)===!1){let L=z.textures,ne=z.width,le=z.height,me=r.COLOR_BUFFER_BIT,he=[],et=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ke=i.get(z),Se=L.length>1;if(Se)for(let Ae=0;Ae0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function Ne(z){let L=o.render.frame;f.get(z)!==L&&(f.set(z,L),z.update())}function Ve(z,L){let ne=z.colorSpace,le=z.format,me=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||z.format===uS||ne!==Za&&ne!==ys&&(Er.getTransfer(ne)===Hr?s===!1?e.has("EXT_sRGB")===!0&&le===Rn?(z.format=uS,z.minFilter=Qi,z.generateMipmaps=!1):L=yg.sRGBToLinear(L):(le!==Rn||me!==Ro)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ne)),L}function ct(z){return typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement?(c.width=z.naturalWidth||z.width,c.height=z.naturalHeight||z.height):typeof VideoFrame<"u"&&z instanceof VideoFrame?(c.width=z.displayWidth,c.height=z.displayHeight):(c.width=z.width,c.height=z.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=A,this.setTexture2D=B,this.setTexture2DArray=F,this.setTexture3D=k,this.setTextureCube=G,this.rebindTextures=H,this.setupRenderTarget=We,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=Ue}function wie(r,e,t){let i=t.isWebGL2;function n(a,o=ys){let s,l=Er.getTransfer(o);if(a===Ro)return r.UNSIGNED_BYTE;if(a===BE)return r.UNSIGNED_SHORT_4_4_4_4;if(a===kE)return r.UNSIGNED_SHORT_5_5_5_1;if(a===iQ)return r.BYTE;if(a===nQ)return r.SHORT;if(a===cg)return r.UNSIGNED_SHORT;if(a===zE)return r.INT;if(a===Lo)return r.UNSIGNED_INT;if(a===Ya)return r.FLOAT;if(a===Zu)return i?r.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(a===aQ)return r.ALPHA;if(a===Rn)return r.RGBA;if(a===oQ)return r.LUMINANCE;if(a===sQ)return r.LUMINANCE_ALPHA;if(a===sl)return r.DEPTH_COMPONENT;if(a===ru)return r.DEPTH_STENCIL;if(a===uS)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(a===lQ)return r.RED;if(a===VE)return r.RED_INTEGER;if(a===uQ)return r.RG;if(a===GE)return r.RG_INTEGER;if(a===HE)return r.RGBA_INTEGER;if(a===WE||a===XE||a===YE||a===qE)if(l===Hr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(a===WE)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===XE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===YE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===qE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(a===WE)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===XE)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===YE)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===qE)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===Q3||a===eF||a===tF||a===rF)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(a===Q3)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===eF)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===tF)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===rF)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===ZE)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===iF||a===nF)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(a===iF)return l===Hr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(a===nF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===aF||a===oF||a===sF||a===lF||a===uF||a===cF||a===fF||a===hF||a===pF||a===dF||a===mF||a===vF||a===gF||a===yF)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(a===aF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===oF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===sF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===lF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===uF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===cF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===fF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===hF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===pF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===dF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===mF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===vF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===gF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===yF)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===jE||a===_F||a===xF)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(a===jE)return l===Hr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===_F)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===xF)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===cQ||a===SF||a===MF||a===bF)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(a===jE)return s.COMPRESSED_RED_RGTC1_EXT;if(a===SF)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===MF)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===bF)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===gs?i?r.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):r[a]!==void 0?r[a]:null}return{convert:n}}var IA=class extends Gi{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}};var Td=class extends tn{constructor(){super(),this.isGroup=!0,this.type="Group"}};var WEe={type:"move"},Yg=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Td,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 Td,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new be,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new be),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Td,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new be,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new be),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}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data: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 n=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(let g of e.hand.values()){let m=t.getJointPose(g,i),v=this._getHandJoint(u,g);m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=m.radius),v.visible=m!==null}let c=u.joints["index-finger-tip"],f=u.joints["thumb-tip"],h=c.position.distanceTo(f.position),p=.02,d=.005;u.inputState.pinching&&h>p+d?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&h<=p-d&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&a!==null&&(n=a),n!==null&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(WEe)))}return s!==null&&(s.visible=n!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new Td;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}};var XEe=` +`;function bie(r,e,t){let i=new yh,n=new Kt,a=new Kt,o=new ni,s=new DA({depthPacking:dQ}),l=new IA,u={},c=t.maxTextureSize,f={[Ao]:_i,[_i]:Ao,[Co]:Co},h=new Sa({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Kt},radius:{value:4}},vertexShader:Sie,fragmentShader:Mie}),p=h.clone();p.defines.HORIZONTAL_PASS=1;let d=new ro;d.setAttribute("position",new xa(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new rn(d,h),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=OE;let v=this.type;this.render=function(S,w,T){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;let C=r.getRenderTarget(),b=r.getActiveCubeFace(),E=r.getActiveMipmapLevel(),I=r.state;I.setBlending(vs),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);let R=v!==al&&this.type===al,A=v===al&&this.type!==al;for(let D=0,U=S.length;Dc||n.y>c)&&(n.x>c&&(a.x=Math.floor(c/k.x),n.x=a.x*k.x,z.mapSize.x=a.x),n.y>c&&(a.y=Math.floor(c/k.y),n.y=a.y*k.y,z.mapSize.y=a.y)),z.map===null||R===!0||A===!0){let Y=this.type!==al?{minFilter:Bi,magFilter:Bi}:{};z.map!==null&&z.map.dispose(),z.map=new to(n.x,n.y,Y),z.map.texture.name=B.name+".shadowMap",z.camera.updateProjectionMatrix()}r.setRenderTarget(z.map),r.clear();let G=z.getViewportCount();for(let Y=0;Y0||w.map&&w.alphaTest>0){let I=b.uuid,R=w.uuid,A=u[I];A===void 0&&(A={},u[I]=A);let D=A[R];D===void 0&&(D=b.clone(),A[R]=D,w.addEventListener("dispose",M)),b=D}if(b.visible=w.visible,b.wireframe=w.wireframe,C===al?b.side=w.shadowSide!==null?w.shadowSide:w.side:b.side=w.shadowSide!==null?w.shadowSide:f[w.side],b.alphaMap=w.alphaMap,b.alphaTest=w.alphaTest,b.map=w.map,b.clipShadows=w.clipShadows,b.clippingPlanes=w.clippingPlanes,b.clipIntersection=w.clipIntersection,b.displacementMap=w.displacementMap,b.displacementScale=w.displacementScale,b.displacementBias=w.displacementBias,b.wireframeLinewidth=w.wireframeLinewidth,b.linewidth=w.linewidth,T.isPointLight===!0&&b.isMeshDistanceMaterial===!0){let I=r.properties.get(b);I.light=T}return b}function x(S,w,T,C,b){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&b===al)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);let R=e.update(S),A=S.material;if(Array.isArray(A)){let D=R.groups;for(let U=0,B=D.length;U=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),z=k>=2);let Y=null,J={},Q=r.getParameter(r.SCISSOR_BOX),V=r.getParameter(r.VIEWPORT),K=new ni().fromArray(Q),ae=new ni().fromArray(V);function ve(X,Te,te,Me){let Pe=new Uint8Array(4),xt=r.createTexture();r.bindTexture(X,xt),r.texParameteri(X,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(X,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Ft=0;Ft"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Kt,f=new WeakMap,h,p=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(F,L){return d?new OffscreenCanvas(F,L):yg("canvas")}function m(F,L,ne,le){let me=1,he=ct(F);if((he.width>le||he.height>le)&&(me=le/Math.max(he.width,he.height)),me<1||L===!0)if(typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&F instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&F instanceof ImageBitmap||typeof VideoFrame<"u"&&F instanceof VideoFrame){let et=L?hS:Math.floor,Ke=et(me*he.width),Se=et(me*he.height);h===void 0&&(h=g(Ke,Se));let Ae=ne?g(Ke,Se):h;return Ae.width=Ke,Ae.height=Se,Ae.getContext("2d").drawImage(F,0,0,Ke,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+he.width+"x"+he.height+") to ("+Ke+"x"+Se+")."),Ae}else return"data"in F&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+he.width+"x"+he.height+")."),F;return F}function v(F){let L=ct(F);return Cz(L.width)&&Cz(L.height)}function _(F){return s?!1:F.wrapS!==ya||F.wrapT!==ya||F.minFilter!==Bi&&F.minFilter!==Qi}function y(F,L){return F.generateMipmaps&&L&&F.minFilter!==Bi&&F.minFilter!==Qi}function x(F){r.generateMipmap(F)}function M(F,L,ne,le,me=!1){if(s===!1)return L;if(F!==null){if(r[F]!==void 0)return r[F];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+F+"'")}let he=L;if(L===r.RED&&(ne===r.FLOAT&&(he=r.R32F),ne===r.HALF_FLOAT&&(he=r.R16F),ne===r.UNSIGNED_BYTE&&(he=r.R8)),L===r.RED_INTEGER&&(ne===r.UNSIGNED_BYTE&&(he=r.R8UI),ne===r.UNSIGNED_SHORT&&(he=r.R16UI),ne===r.UNSIGNED_INT&&(he=r.R32UI),ne===r.BYTE&&(he=r.R8I),ne===r.SHORT&&(he=r.R16I),ne===r.INT&&(he=r.R32I)),L===r.RG&&(ne===r.FLOAT&&(he=r.RG32F),ne===r.HALF_FLOAT&&(he=r.RG16F),ne===r.UNSIGNED_BYTE&&(he=r.RG8)),L===r.RG_INTEGER&&(ne===r.UNSIGNED_BYTE&&(he=r.RG8UI),ne===r.UNSIGNED_SHORT&&(he=r.RG16UI),ne===r.UNSIGNED_INT&&(he=r.RG32UI),ne===r.BYTE&&(he=r.RG8I),ne===r.SHORT&&(he=r.RG16I),ne===r.INT&&(he=r.RG32I)),L===r.RGBA){let et=me?dg:Tr.getTransfer(le);ne===r.FLOAT&&(he=r.RGBA32F),ne===r.HALF_FLOAT&&(he=r.RGBA16F),ne===r.UNSIGNED_BYTE&&(he=et===Hr?r.SRGB8_ALPHA8:r.RGBA8),ne===r.UNSIGNED_SHORT_4_4_4_4&&(he=r.RGBA4),ne===r.UNSIGNED_SHORT_5_5_5_1&&(he=r.RGB5_A1)}return(he===r.R16F||he===r.R32F||he===r.RG16F||he===r.RG32F||he===r.RGBA16F||he===r.RGBA32F)&&e.get("EXT_color_buffer_float"),he}function S(F,L,ne){return y(F,ne)===!0||F.isFramebufferTexture&&F.minFilter!==Bi&&F.minFilter!==Qi?Math.log2(Math.max(L.width,L.height))+1:F.mipmaps!==void 0&&F.mipmaps.length>0?F.mipmaps.length:F.isCompressedTexture&&Array.isArray(F.image)?L.mipmaps.length:1}function w(F){return F===Bi||F===Q3||F===fg?r.NEAREST:r.LINEAR}function T(F){let L=F.target;L.removeEventListener("dispose",T),b(L),L.isVideoTexture&&f.delete(L)}function C(F){let L=F.target;L.removeEventListener("dispose",C),I(L)}function b(F){let L=i.get(F);if(L.__webglInit===void 0)return;let ne=F.source,le=p.get(ne);if(le){let me=le[L.__cacheKey];me.usedTimes--,me.usedTimes===0&&E(F),Object.keys(le).length===0&&p.delete(ne)}i.remove(F)}function E(F){let L=i.get(F);r.deleteTexture(L.__webglTexture);let ne=F.source,le=p.get(ne);delete le[L.__cacheKey],o.memory.textures--}function I(F){let L=i.get(F);if(F.depthTexture&&F.depthTexture.dispose(),F.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(L.__webglFramebuffer[le]))for(let me=0;me=n.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+F+" texture units while this GPU supports only "+n.maxTextures),R+=1,F}function U(F){let L=[];return L.push(F.wrapS),L.push(F.wrapT),L.push(F.wrapR||0),L.push(F.magFilter),L.push(F.minFilter),L.push(F.anisotropy),L.push(F.internalFormat),L.push(F.format),L.push(F.type),L.push(F.generateMipmaps),L.push(F.premultiplyAlpha),L.push(F.flipY),L.push(F.unpackAlignment),L.push(F.colorSpace),L.join()}function B(F,L){let ne=i.get(F);if(F.isVideoTexture&&Ne(F),F.isRenderTargetTexture===!1&&F.version>0&&ne.__version!==F.version){let le=F.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(ne,F,L);return}}t.bindTexture(r.TEXTURE_2D,ne.__webglTexture,r.TEXTURE0+L)}function z(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ae(ne,F,L);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ne.__webglTexture,r.TEXTURE0+L)}function k(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ae(ne,F,L);return}t.bindTexture(r.TEXTURE_3D,ne.__webglTexture,r.TEXTURE0+L)}function G(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ve(ne,F,L);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ne.__webglTexture,r.TEXTURE0+L)}let Y={[lS]:r.REPEAT,[ya]:r.CLAMP_TO_EDGE,[uS]:r.MIRRORED_REPEAT},J={[Bi]:r.NEAREST,[Q3]:r.NEAREST_MIPMAP_NEAREST,[fg]:r.NEAREST_MIPMAP_LINEAR,[Qi]:r.LINEAR,[FE]:r.LINEAR_MIPMAP_NEAREST,[sl]:r.LINEAR_MIPMAP_LINEAR},Q={[gQ]:r.NEVER,[bQ]:r.ALWAYS,[yQ]:r.LESS,[JE]:r.LEQUAL,[_Q]:r.EQUAL,[MQ]:r.GEQUAL,[xQ]:r.GREATER,[SQ]:r.NOTEQUAL};function V(F,L,ne){if(L.type===ja&&e.has("OES_texture_float_linear")===!1&&(L.magFilter===Qi||L.magFilter===FE||L.magFilter===fg||L.magFilter===sl||L.minFilter===Qi||L.minFilter===FE||L.minFilter===fg||L.minFilter===sl)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ne?(r.texParameteri(F,r.TEXTURE_WRAP_S,Y[L.wrapS]),r.texParameteri(F,r.TEXTURE_WRAP_T,Y[L.wrapT]),(F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY)&&r.texParameteri(F,r.TEXTURE_WRAP_R,Y[L.wrapR]),r.texParameteri(F,r.TEXTURE_MAG_FILTER,J[L.magFilter]),r.texParameteri(F,r.TEXTURE_MIN_FILTER,J[L.minFilter])):(r.texParameteri(F,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(F,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY)&&r.texParameteri(F,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(L.wrapS!==ya||L.wrapT!==ya)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(F,r.TEXTURE_MAG_FILTER,w(L.magFilter)),r.texParameteri(F,r.TEXTURE_MIN_FILTER,w(L.minFilter)),L.minFilter!==Bi&&L.minFilter!==Qi&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),L.compareFunction&&(r.texParameteri(F,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(F,r.TEXTURE_COMPARE_FUNC,Q[L.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(L.magFilter===Bi||L.minFilter!==fg&&L.minFilter!==sl||L.type===ja&&e.has("OES_texture_float_linear")===!1||s===!1&&L.type===qu&&e.has("OES_texture_half_float_linear")===!1)return;if(L.anisotropy>1||i.get(L).__currentAnisotropy){let le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(F,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,n.getMaxAnisotropy())),i.get(L).__currentAnisotropy=L.anisotropy}}}function K(F,L){let ne=!1;F.__webglInit===void 0&&(F.__webglInit=!0,L.addEventListener("dispose",T));let le=L.source,me=p.get(le);me===void 0&&(me={},p.set(le,me));let he=U(L);if(he!==F.__cacheKey){me[he]===void 0&&(me[he]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ne=!0),me[he].usedTimes++;let et=me[F.__cacheKey];et!==void 0&&(me[F.__cacheKey].usedTimes--,et.usedTimes===0&&E(L)),F.__cacheKey=he,F.__webglTexture=me[he].texture}return ne}function ae(F,L,ne){let le=r.TEXTURE_2D;(L.isDataArrayTexture||L.isCompressedArrayTexture)&&(le=r.TEXTURE_2D_ARRAY),L.isData3DTexture&&(le=r.TEXTURE_3D);let me=K(F,L),he=L.source;t.bindTexture(le,F.__webglTexture,r.TEXTURE0+ne);let et=i.get(he);if(he.version!==et.__version||me===!0){t.activeTexture(r.TEXTURE0+ne);let Ke=Tr.getPrimaries(Tr.workingColorSpace),Se=L.colorSpace===_s?null:Tr.getPrimaries(L.colorSpace),Ae=L.colorSpace===_s||Ke===Se?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,L.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,L.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ae);let nt=_(L)&&v(L.image)===!1,$=m(L.image,nt,!1,n.maxTextureSize);$=Ve(L,$);let it=v($)||s,Xe=a.convert(L.format,L.colorSpace),Fe=a.convert(L.type),we=M(L.internalFormat,Xe,Fe,L.colorSpace,L.isVideoTexture);V(le,L,it);let Ie,st=L.mipmaps,Je=s&&L.isVideoTexture!==!0&&we!==jE,kt=et.__version===void 0||me===!0,X=he.dataReady,Te=S(L,$,it);if(L.isDepthTexture)we=r.DEPTH_COMPONENT,s?L.type===ja?we=r.DEPTH_COMPONENT32F:L.type===Lo?we=r.DEPTH_COMPONENT24:L.type===ys?we=r.DEPTH24_STENCIL8:we=r.DEPTH_COMPONENT16:L.type===ja&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===ll&&we===r.DEPTH_COMPONENT&&L.type!==hg&&L.type!==Lo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=Lo,Fe=a.convert(L.type)),L.format===tu&&we===r.DEPTH_COMPONENT&&(we=r.DEPTH_STENCIL,L.type!==ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=ys,Fe=a.convert(L.type))),kt&&(Je?t.texStorage2D(r.TEXTURE_2D,1,we,$.width,$.height):t.texImage2D(r.TEXTURE_2D,0,we,$.width,$.height,0,Xe,Fe,null));else if(L.isDataTexture)if(st.length>0&&it){Je&&kt&&t.texStorage2D(r.TEXTURE_2D,Te,we,st[0].width,st[0].height);for(let te=0,Me=st.length;te>=1,Me>>=1}}else if(st.length>0&&it){if(Je&&kt){let te=ct(st[0]);t.texStorage2D(r.TEXTURE_2D,Te,we,te.width,te.height)}for(let te=0,Me=st.length;te0&&X++;let te=ct($[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,X,Ie,te.width,te.height)}for(let te=0;te<6;te++)if(nt){st?kt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,$[te].width,$[te].height,Fe,we,$[te].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,Ie,$[te].width,$[te].height,0,Fe,we,$[te].data);for(let Me=0;Me>he),$=Math.max(1,L.height>>he);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,he,Se,nt,$,L.depth,0,et,Ke,null):t.texImage2D(me,he,Se,nt,$,0,et,Ke,null)}t.bindFramebuffer(r.FRAMEBUFFER,F),Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,0,Le(L)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,he),t.bindFramebuffer(r.FRAMEBUFFER,null)}function se(F,L,ne){if(r.bindRenderbuffer(r.RENDERBUFFER,F),L.depthBuffer&&!L.stencilBuffer){let le=s===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(ne||Ue(L)){let me=L.depthTexture;me&&me.isDepthTexture&&(me.type===ja?le=r.DEPTH_COMPONENT32F:me.type===Lo&&(le=r.DEPTH_COMPONENT24));let he=Le(L);Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,he,le,L.width,L.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,he,le,L.width,L.height)}else r.renderbufferStorage(r.RENDERBUFFER,le,L.width,L.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,F)}else if(L.depthBuffer&&L.stencilBuffer){let le=Le(L);ne&&Ue(L)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,L.width,L.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,F)}else{let le=L.textures;for(let me=0;me1,Ke=v(F)||s;if(et||(le.__webglTexture===void 0&&(le.__webglTexture=r.createTexture()),le.__version=L.version,o.memory.textures++),he){ne.__webglFramebuffer=[];for(let Se=0;Se<6;Se++)if(s&&L.mipmaps&&L.mipmaps.length>0){ne.__webglFramebuffer[Se]=[];for(let Ae=0;Ae0){ne.__webglFramebuffer=[];for(let Se=0;Se0&&Ue(F)===!1){ne.__webglMultisampledFramebuffer=r.createFramebuffer(),ne.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ne.__webglMultisampledFramebuffer);for(let Se=0;Se0)for(let Ae=0;Ae0)for(let Ae=0;Ae0&&Ue(F)===!1){let L=F.textures,ne=F.width,le=F.height,me=r.COLOR_BUFFER_BIT,he=[],et=F.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ke=i.get(F),Se=L.length>1;if(Se)for(let Ae=0;Ae0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function Ne(F){let L=o.render.frame;f.get(F)!==L&&(f.set(F,L),F.update())}function Ve(F,L){let ne=F.colorSpace,le=F.format,me=F.type;return F.isCompressedTexture===!0||F.isVideoTexture===!0||F.format===cS||ne!==Ja&&ne!==_s&&(Tr.getTransfer(ne)===Hr?s===!1?e.has("EXT_sRGB")===!0&&le===Rn?(F.format=cS,F.minFilter=Qi,F.generateMipmaps=!1):L=xg.sRGBToLinear(L):(le!==Rn||me!==Ro)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ne)),L}function ct(F){return typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement?(c.width=F.naturalWidth||F.width,c.height=F.naturalHeight||F.height):typeof VideoFrame<"u"&&F instanceof VideoFrame?(c.width=F.displayWidth,c.height=F.displayHeight):(c.width=F.width,c.height=F.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=A,this.setTexture2D=B,this.setTexture2DArray=z,this.setTexture3D=k,this.setTextureCube=G,this.rebindTextures=H,this.setupRenderTarget=We,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=Ue}function Eie(r,e,t){let i=t.isWebGL2;function n(a,o=_s){let s,l=Tr.getTransfer(o);if(a===Ro)return r.UNSIGNED_BYTE;if(a===kE)return r.UNSIGNED_SHORT_4_4_4_4;if(a===VE)return r.UNSIGNED_SHORT_5_5_5_1;if(a===aQ)return r.BYTE;if(a===oQ)return r.SHORT;if(a===hg)return r.UNSIGNED_SHORT;if(a===BE)return r.INT;if(a===Lo)return r.UNSIGNED_INT;if(a===ja)return r.FLOAT;if(a===qu)return i?r.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(a===sQ)return r.ALPHA;if(a===Rn)return r.RGBA;if(a===lQ)return r.LUMINANCE;if(a===uQ)return r.LUMINANCE_ALPHA;if(a===ll)return r.DEPTH_COMPONENT;if(a===tu)return r.DEPTH_STENCIL;if(a===cS)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(a===cQ)return r.RED;if(a===GE)return r.RED_INTEGER;if(a===fQ)return r.RG;if(a===HE)return r.RG_INTEGER;if(a===WE)return r.RGBA_INTEGER;if(a===XE||a===YE||a===qE||a===ZE)if(l===Hr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(a===XE)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===YE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===qE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===ZE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(a===XE)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===YE)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===qE)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===ZE)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===ez||a===tz||a===rz||a===iz)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(a===ez)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===tz)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===rz)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===iz)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===jE)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===nz||a===az)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(a===nz)return l===Hr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(a===az)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===oz||a===sz||a===lz||a===uz||a===cz||a===fz||a===hz||a===pz||a===dz||a===mz||a===vz||a===gz||a===yz||a===_z)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(a===oz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===sz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===lz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===uz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===cz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===fz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===hz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===pz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===dz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===mz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===vz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===gz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===yz)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===_z)return l===Hr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===KE||a===xz||a===Sz)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(a===KE)return l===Hr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===xz)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===Sz)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===hQ||a===Mz||a===bz||a===wz)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(a===KE)return s.COMPRESSED_RED_RGTC1_EXT;if(a===Mz)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===bz)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===wz)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===ys?i?r.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):r[a]!==void 0?r[a]:null}return{convert:n}}var NA=class extends Vi{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}};var Ad=class extends tn{constructor(){super(),this.isGroup=!0,this.type="Group"}};var YEe={type:"move"},Zg=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ad,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 Ad,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new be,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new be),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ad,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new be,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new be),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}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data: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 n=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(let g of e.hand.values()){let m=t.getJointPose(g,i),v=this._getHandJoint(u,g);m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=m.radius),v.visible=m!==null}let c=u.joints["index-finger-tip"],f=u.joints["thumb-tip"],h=c.position.distanceTo(f.position),p=.02,d=.005;u.inputState.pinching&&h>p+d?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&h<=p-d&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&a!==null&&(n=a),n!==null&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(YEe)))}return s!==null&&(s.visible=n!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new Ad;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}};var qEe=` void main() { gl_Position = vec4( position, 1.0 ); -}`,YEe=` +}`,ZEe=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -8742,11 +8742,11 @@ void main() { } -}`,NA=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){let n=new Ja,a=e.properties.get(n);a.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}render(e,t){if(this.texture!==null){if(this.mesh===null){let i=t.cameras[0].viewport,n=new ya({extensions:{fragDepth:!0},vertexShader:XEe,fragmentShader:YEe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new rn(new Bg(20,20),n)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}};var UA=class extends Ka{constructor(e,t){super();let i=this,n=null,a=1,o=null,s="local-floor",l=1,u=null,c=null,f=null,h=null,p=null,d=null,g=new NA,m=t.getContextAttributes(),v=null,_=null,y=[],x=[],M=new Kt,S=null,w=new Gi;w.layers.enable(1),w.viewport=new ii;let T=new Gi;T.layers.enable(2),T.viewport=new ii;let C=[w,T],b=new IA;b.layers.enable(1),b.layers.enable(2);let E=null,I=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let K=y[V];return K===void 0&&(K=new Yg,y[V]=K),K.getTargetRaySpace()},this.getControllerGrip=function(V){let K=y[V];return K===void 0&&(K=new Yg,y[V]=K),K.getGripSpace()},this.getHand=function(V){let K=y[V];return K===void 0&&(K=new Yg,y[V]=K),K.getHandSpace()};function R(V){let K=x.indexOf(V.inputSource);if(K===-1)return;let ae=y[K];ae!==void 0&&(ae.update(V.inputSource,V.frame,u||o),ae.dispatchEvent({type:V.type,data:V.inputSource}))}function A(){n.removeEventListener("select",R),n.removeEventListener("selectstart",R),n.removeEventListener("selectend",R),n.removeEventListener("squeeze",R),n.removeEventListener("squeezestart",R),n.removeEventListener("squeezeend",R),n.removeEventListener("end",A),n.removeEventListener("inputsourceschange",D);for(let V=0;V=0&&(x[ve]=null,y[ve].disconnect(ae))}for(let K=0;K=x.length){x.push(ae),ve=se;break}else if(x[se]===null){x[se]=ae,ve=se;break}if(ve===-1)break}let ue=y[ve];ue&&ue.connect(ae)}}let U=new be,B=new be;function F(V,K,ae){U.setFromMatrixPosition(K.matrixWorld),B.setFromMatrixPosition(ae.matrixWorld);let ve=U.distanceTo(B),ue=K.projectionMatrix.elements,se=ae.projectionMatrix.elements,Ee=ue[14]/(ue[10]-1),q=ue[14]/(ue[10]+1),H=(ue[9]+1)/ue[5],We=(ue[9]-1)/ue[5],_e=(ue[8]-1)/ue[0],xe=(se[8]+1)/se[0],Le=Ee*_e,Ue=Ee*xe,Ne=ve/(-_e+xe),Ve=Ne*-_e;K.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ve),V.translateZ(Ne),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert();let ct=Ee+Ne,z=q+Ne,L=Le-Ve,ne=Ue+(ve-Ve),le=H*q/z*ct,me=We*q/z*ct;V.projectionMatrix.makePerspective(L,ne,le,me,ct,z),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}function k(V,K){K===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(K.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(n===null)return;g.texture!==null&&(V.near=g.depthNear,V.far=g.depthFar),b.near=T.near=w.near=V.near,b.far=T.far=w.far=V.far,(E!==b.near||I!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),E=b.near,I=b.far,w.near=E,w.far=I,T.near=E,T.far=I,w.updateProjectionMatrix(),T.updateProjectionMatrix(),V.updateProjectionMatrix());let K=V.parent,ae=b.cameras;k(b,K);for(let ve=0;ve0&&(m.alphaTest.value=v.alphaTest);let _=e.get(v),y=_.envMap,x=_.envMapRotation;if(y&&(m.envMap.value=y,Ed.copy(x),Ed.x*=-1,Ed.y*=-1,Ed.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Ed.y*=-1,Ed.z*=-1),m.envMapRotation.value.setFromMatrix4(qEe.makeRotationFromEuler(Ed)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=v.reflectivity,m.ior.value=v.ior,m.refractionRatio.value=v.refractionRatio),v.lightMap){m.lightMap.value=v.lightMap;let M=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=v.lightMapIntensity*M,t(v.lightMap,m.lightMapTransform)}v.aoMap&&(m.aoMap.value=v.aoMap,m.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,m.aoMapTransform))}function o(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform))}function s(m,v){m.dashSize.value=v.dashSize,m.totalSize.value=v.dashSize+v.gapSize,m.scale.value=v.scale}function l(m,v,_,y){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.size.value=v.size*_,m.scale.value=y*.5,v.map&&(m.map.value=v.map,t(v.map,m.uvTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function u(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.rotation.value=v.rotation,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function c(m,v){m.specular.value.copy(v.specular),m.shininess.value=Math.max(v.shininess,1e-4)}function f(m,v){v.gradientMap&&(m.gradientMap.value=v.gradientMap)}function h(m,v){m.metalness.value=v.metalness,v.metalnessMap&&(m.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,m.metalnessMapTransform)),m.roughness.value=v.roughness,v.roughnessMap&&(m.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,m.roughnessMapTransform)),e.get(v).envMap&&(m.envMapIntensity.value=v.envMapIntensity)}function p(m,v,_){m.ior.value=v.ior,v.sheen>0&&(m.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),m.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(m.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,m.sheenColorMapTransform)),v.sheenRoughnessMap&&(m.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,m.sheenRoughnessMapTransform))),v.clearcoat>0&&(m.clearcoat.value=v.clearcoat,m.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(m.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,m.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(m.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===_i&&m.clearcoatNormalScale.value.negate())),v.iridescence>0&&(m.iridescence.value=v.iridescence,m.iridescenceIOR.value=v.iridescenceIOR,m.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(m.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,m.iridescenceMapTransform)),v.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),v.transmission>0&&(m.transmission.value=v.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),v.transmissionMap&&(m.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,m.transmissionMapTransform)),m.thickness.value=v.thickness,v.thicknessMap&&(m.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=v.attenuationDistance,m.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(m.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(m.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=v.specularIntensity,m.specularColor.value.copy(v.specularColor),v.specularColorMap&&(m.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,m.specularColorMapTransform)),v.specularIntensityMap&&(m.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,m.specularIntensityMapTransform))}function d(m,v){v.matcap&&(m.matcap.value=v.matcap)}function g(m,v){let _=e.get(v).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function Eie(r,e,t,i){let n={},a={},o=[],s=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(_,y){let x=y.program;i.uniformBlockBinding(_,x)}function u(_,y){let x=n[_.id];x===void 0&&(d(_),x=c(_),n[_.id]=x,_.addEventListener("dispose",m));let M=y.program;i.updateUBOMapping(_,M);let S=e.render.frame;a[_.id]!==S&&(h(_),a[_.id]=S)}function c(_){let y=f();_.__bindingPointIndex=y;let x=r.createBuffer(),M=_.__size,S=_.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,M,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,x),x}function f(){for(let _=0;_0&&(x+=M-S),_.__size=x,_.__cache={},this}function g(_){let y={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),y}function m(_){let y=_.target;y.removeEventListener("dispose",m);let x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),r.deleteBuffer(n[y.id]),delete n[y.id],delete a[y.id]}function v(){for(let _ in n)r.deleteBuffer(n[_]);o=[],n={},a={}}return{bind:l,update:u,dispose:v}}var gS=class{constructor(e={}){let{canvas:t=wQ(),context:i=null,depth:n=!0,stencil:a=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let h;i!==null?h=i.getContextAttributes().alpha:h=o;let p=new Uint32Array(4),d=new Int32Array(4),g=null,m=null,v=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=qa,this._useLegacyLights=!1,this.toneMapping=vs,this.toneMappingExposure=1;let y=this,x=!1,M=0,S=0,w=null,T=-1,C=null,b=new ii,E=new ii,I=null,R=new ir(0),A=0,D=t.width,U=t.height,B=1,F=null,k=null,G=new ii(0,0,D,U),Y=new ii(0,0,D,U),J=!1,Q=new vh,V=!1,K=!1,ae=null,ve=new Wr,ue=new Kt,se=new be,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return w===null?B:1}let H=i;function We(O,j){for(let re=0;re{function W(){if(ie.forEach(function(ee){Ne.get(ee).currentProgram.isReady()&&ie.delete(ee)}),ie.size===0){P(O);return}setTimeout(W,10)}_e.get("KHR_parallel_shader_compile")!==null?W():setTimeout(W,10)})};let zt=null;function Mr(O){zt&&zt(O)}function Zr(){Dr.stop()}function Vt(){Dr.start()}let Dr=new EA;Dr.setAnimationLoop(Mr),typeof self<"u"&&Dr.setContext(self),this.setAnimationLoop=function(O){zt=O,Je.setAnimationLoop(O),O===null?Dr.stop():Dr.start()},Je.addEventListener("sessionstart",Zr),Je.addEventListener("sessionend",Vt),this.render=function(O,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Je.enabled===!0&&Je.isPresenting===!0&&(Je.cameraAutoUpdate===!0&&Je.updateCamera(j),j=Je.getCamera()),O.isScene===!0&&O.onBeforeRender(y,O,j,w),m=Ke.get(O,_.length),m.init(),_.push(m),ve.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),Q.setFromProjectionMatrix(ve),K=this.localClippingEnabled,V=Se.init(this.clippingPlanes,K),g=et.get(O,v.length),g.init(),v.push(g),oi(O,j,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(F,k),this.info.render.frame++,V===!0&&Se.beginShadows();let re=m.state.shadowsArray;if(Ae.render(re,O,j),V===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Je.enabled===!1||Je.isPresenting===!1||Je.hasDepthSensing()===!1)&&nt.render(g,O),m.setupLights(y._useLegacyLights),j.isArrayCamera){let ie=j.cameras;for(let P=0,W=ie.length;P0?m=_[_.length-1]:m=null,v.pop(),v.length>0?g=v[v.length-1]:g=null};function oi(O,j,re,ie){if(O.visible===!1)return;if(O.layers.test(j.layers)){if(O.isGroup)re=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(j);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||Q.intersectsSprite(O)){ie&&se.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ve);let ee=le.update(O),ge=O.material;ge.visible&&g.push(O,ee,ge,re,se.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||Q.intersectsObject(O))){let ee=le.update(O),ge=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),se.copy(O.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),se.copy(ee.boundingSphere.center)),se.applyMatrix4(O.matrixWorld).applyMatrix4(ve)),Array.isArray(ge)){let ce=ee.groups;for(let Oe=0,Ge=ce.length;Oe0&&M0(P,W,j,re),ie&&Le.viewport(b.copy(ie)),P.length>0&&Ds(P,j,re),W.length>0&&Ds(W,j,re),ee.length>0&&Ds(ee,j,re),Le.buffers.depth.setTest(!0),Le.buffers.depth.setMask(!0),Le.buffers.color.setMask(!0),Le.setPolygonOffset(!1)}function M0(O,j,re,ie){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;let W=xe.isWebGL2;ae===null&&(ae=new $a(1,1,{generateMipmaps:!0,type:_e.has("EXT_color_buffer_half_float")?Zu:Ro,minFilter:ol,samples:W?4:0})),y.getDrawingBufferSize(ue),W?ae.setSize(ue.x,ue.y):ae.setSize(fS(ue.x),fS(ue.y));let ee=y.getRenderTarget();y.setRenderTarget(ae),y.getClearColor(R),A=y.getClearAlpha(),A<1&&y.setClearColor(16777215,.5),y.clear();let ge=y.toneMapping;y.toneMapping=vs,Ds(O,re,ie),Ve.updateMultisampleRenderTarget(ae),Ve.updateRenderTargetMipmap(ae);let ce=!1;for(let Oe=0,Ge=j.length;Oe0),Re=!!re.morphAttributes.position,pt=!!re.morphAttributes.normal,mt=!!re.morphAttributes.color,$e=vs;ie.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&($e=y.toneMapping);let at=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,wt=at!==void 0?at.length:0,je=Ne.get(ie),mi=m.state.lights;if(V===!0&&(K===!0||O!==C)){let jr=O===C&&ie.id===T;Se.setState(ie,O,jr)}let Ut=!1;ie.version===je.__version?(je.needsLights&&je.lightsStateVersion!==mi.state.version||je.outputColorSpace!==ge||P.isBatchedMesh&&je.batching===!1||!P.isBatchedMesh&&je.batching===!0||P.isInstancedMesh&&je.instancing===!1||!P.isInstancedMesh&&je.instancing===!0||P.isSkinnedMesh&&je.skinning===!1||!P.isSkinnedMesh&&je.skinning===!0||P.isInstancedMesh&&je.instancingColor===!0&&P.instanceColor===null||P.isInstancedMesh&&je.instancingColor===!1&&P.instanceColor!==null||P.isInstancedMesh&&je.instancingMorph===!0&&P.morphTexture===null||P.isInstancedMesh&&je.instancingMorph===!1&&P.morphTexture!==null||je.envMap!==ce||ie.fog===!0&&je.fog!==W||je.numClippingPlanes!==void 0&&(je.numClippingPlanes!==Se.numPlanes||je.numIntersection!==Se.numIntersection)||je.vertexAlphas!==Oe||je.vertexTangents!==Ge||je.morphTargets!==Re||je.morphNormals!==pt||je.morphColors!==mt||je.toneMapping!==$e||xe.isWebGL2===!0&&je.morphTargetsCount!==wt)&&(Ut=!0):(Ut=!0,je.__version=ie.version);let Rr=je.currentProgram;Ut===!0&&(Rr=Go(ie,j,P));let Wi=!1,Mt=!1,Mi=!1,sr=Rr.getUniforms(),un=je.uniforms;if(Le.useProgram(Rr.program)&&(Wi=!0,Mt=!0,Mi=!0),ie.id!==T&&(T=ie.id,Mt=!0),Wi||C!==O){sr.setValue(H,"projectionMatrix",O.projectionMatrix),sr.setValue(H,"viewMatrix",O.matrixWorldInverse);let jr=sr.map.cameraPosition;jr!==void 0&&jr.setValue(H,se.setFromMatrixPosition(O.matrixWorld)),xe.logarithmicDepthBuffer&&sr.setValue(H,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&sr.setValue(H,"isOrthographic",O.isOrthographicCamera===!0),C!==O&&(C=O,Mt=!0,Mi=!0)}if(P.isSkinnedMesh){sr.setOptional(H,P,"bindMatrix"),sr.setOptional(H,P,"bindMatrixInverse");let jr=P.skeleton;jr&&(xe.floatVertexTextures?(jr.boneTexture===null&&jr.computeBoneTexture(),sr.setValue(H,"boneTexture",jr.boneTexture,Ve)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}P.isBatchedMesh&&(sr.setOptional(H,P,"batchingTexture"),sr.setValue(H,"batchingTexture",P._matricesTexture,Ve));let mu=re.morphAttributes;if((mu.position!==void 0||mu.normal!==void 0||mu.color!==void 0&&xe.isWebGL2===!0)&&$.update(P,re,Rr),(Mt||je.receiveShadow!==P.receiveShadow)&&(je.receiveShadow=P.receiveShadow,sr.setValue(H,"receiveShadow",P.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(un.envMap.value=ce,un.flipEnvMap.value=ce.isCubeTexture&&ce.isRenderTargetTexture===!1?-1:1),Mt&&(sr.setValue(H,"toneMappingExposure",y.toneMappingExposure),je.needsLights&&w0(un,Mi),W&&ie.fog===!0&&he.refreshFogUniforms(un,W),he.refreshMaterialUniforms(un,ie,B,U,ae),gh.upload(H,Zh(je),un,Ve)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(gh.upload(H,Zh(je),un,Ve),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&sr.setValue(H,"center",P.center),sr.setValue(H,"modelViewMatrix",P.modelViewMatrix),sr.setValue(H,"normalMatrix",P.normalMatrix),sr.setValue(H,"modelMatrix",P.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){let jr=ie.uniformsGroups;for(let vu=0,jh=jr.length;vu0&&Ve.useMultisampledRTT(O)===!1?P=Ne.get(O).__webglMultisampledFramebuffer:Array.isArray(Ge)?P=Ge[re]:P=Ge,b.copy(O.viewport),E.copy(O.scissor),I=O.scissorTest}else b.copy(G).multiplyScalar(B).floor(),E.copy(Y).multiplyScalar(B).floor(),I=J;if(Le.bindFramebuffer(H.FRAMEBUFFER,P)&&xe.drawBuffers&&ie&&Le.drawBuffers(O,P),Le.viewport(b),Le.scissor(E),Le.setScissorTest(I),W){let ce=Ne.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce.__webglTexture,re)}else if(ee){let ce=Ne.get(O.texture),Oe=j||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,ce.__webglTexture,re||0,Oe)}T=-1},this.readRenderTargetPixels=function(O,j,re,ie,P,W,ee){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Ne.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&ee!==void 0&&(ge=ge[ee]),ge){Le.bindFramebuffer(H.FRAMEBUFFER,ge);try{let ce=O.texture,Oe=ce.format,Ge=ce.type;if(Oe!==Rn&&ze.convert(Oe)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Re=Ge===Zu&&(_e.has("EXT_color_buffer_half_float")||xe.isWebGL2&&_e.has("EXT_color_buffer_float"));if(Ge!==Ro&&ze.convert(Ge)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ge===Ya&&(xe.isWebGL2||_e.has("OES_texture_float")||_e.has("WEBGL_color_buffer_float")))&&!Re){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=O.width-ie&&re>=0&&re<=O.height-P&&H.readPixels(j,re,ie,P,ze.convert(Oe),ze.convert(Ge),W)}finally{let ce=w!==null?Ne.get(w).__webglFramebuffer:null;Le.bindFramebuffer(H.FRAMEBUFFER,ce)}}},this.copyFramebufferToTexture=function(O,j,re=0){let ie=Math.pow(2,-re),P=Math.floor(j.image.width*ie),W=Math.floor(j.image.height*ie);Ve.setTexture2D(j,0),H.copyTexSubImage2D(H.TEXTURE_2D,re,0,0,O.x,O.y,P,W),Le.unbindTexture()},this.copyTextureToTexture=function(O,j,re,ie=0){let P=j.image.width,W=j.image.height,ee=ze.convert(re.format),ge=ze.convert(re.type);Ve.setTexture2D(re,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,re.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,re.unpackAlignment),j.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,P,W,ee,ge,j.image.data):j.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,j.mipmaps[0].width,j.mipmaps[0].height,ee,j.mipmaps[0].data):H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,ee,ge,j.image),ie===0&&re.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),Le.unbindTexture()},this.copyTextureToTexture3D=function(O,j,re,ie,P=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let W=Math.round(O.max.x-O.min.x),ee=Math.round(O.max.y-O.min.y),ge=O.max.z-O.min.z+1,ce=ze.convert(ie.format),Oe=ze.convert(ie.type),Ge;if(ie.isData3DTexture)Ve.setTexture3D(ie,0),Ge=H.TEXTURE_3D;else if(ie.isDataArrayTexture||ie.isCompressedArrayTexture)Ve.setTexture2DArray(ie,0),Ge=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,ie.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,ie.unpackAlignment);let Re=H.getParameter(H.UNPACK_ROW_LENGTH),pt=H.getParameter(H.UNPACK_IMAGE_HEIGHT),mt=H.getParameter(H.UNPACK_SKIP_PIXELS),$e=H.getParameter(H.UNPACK_SKIP_ROWS),at=H.getParameter(H.UNPACK_SKIP_IMAGES),wt=re.isCompressedTexture?re.mipmaps[P]:re.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,wt.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,wt.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,O.min.x),H.pixelStorei(H.UNPACK_SKIP_ROWS,O.min.y),H.pixelStorei(H.UNPACK_SKIP_IMAGES,O.min.z),re.isDataTexture||re.isData3DTexture?H.texSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,Oe,wt.data):ie.isCompressedArrayTexture?H.compressedTexSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,wt.data):H.texSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,Oe,wt),H.pixelStorei(H.UNPACK_ROW_LENGTH,Re),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,pt),H.pixelStorei(H.UNPACK_SKIP_PIXELS,mt),H.pixelStorei(H.UNPACK_SKIP_ROWS,$e),H.pixelStorei(H.UNPACK_SKIP_IMAGES,at),P===0&&ie.generateMipmaps&&H.generateMipmap(Ge),Le.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?Ve.setTextureCube(O,0):O.isData3DTexture?Ve.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?Ve.setTexture2DArray(O,0):Ve.setTexture2D(O,0),Le.unbindTexture()},this.resetState=function(){M=0,S=0,w=null,Le.reset(),we.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ja}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===fg?"display-p3":"srgb",t.unpackColorSpace=Er.workingColorSpace===dd?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}};var yS=class extends tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new cl,this.environmentRotation=new cl,this.overrideMaterial=null,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()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),t.object.environmentRotation=this.environmentRotation.toArray(),t}};var OA=class r extends Qa{constructor(e=1,t=32,i=0,n=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},t=Math.max(3,t);let a=[],o=[],s=[],l=[],u=new be,c=new Kt;o.push(0,0,0),s.push(0,0,1),l.push(.5,.5);for(let f=0,h=3;f<=t;f++,h+=3){let p=i+f/t*n;u.x=e*Math.cos(p),u.y=e*Math.sin(p),o.push(u.x,u.y,u.z),s.push(0,0,1),c.x=(o[h]/e+1)/2,c.y=(o[h+1]/e+1)/2,l.push(c.x,c.y)}for(let f=1;f<=t;f++)a.push(f,f+1,0);this.setIndex(a),this.setAttribute("position",new Zn(o,3)),this.setAttribute("normal",new Zn(s,3)),this.setAttribute("uv",new Zn(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new r(e.radius,e.segments,e.thetaStart,e.thetaLength)}};var qg=class extends tn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new ir(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let 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}};var _S=class extends qg{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(tn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ir(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}};var nz=new Wr,Aie=new be,Cie=new be,FA=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Kt(512,512),this.map=null,this.mapPass=null,this.matrix=new Wr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new vh,this._frameExtents=new Kt(1,1),this._viewportCount=1,this._viewports=[new ii(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;Aie.setFromMatrixPosition(e.matrixWorld),t.position.copy(Aie),Cie.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Cie),t.updateMatrixWorld(),nz.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(nz),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(nz)}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(){let 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}};var zA=class extends FA{constructor(){super(new kg(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}};var xS=class extends qg{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(tn.DEFAULT_UP),this.updateMatrix(),this.target=new tn,this.shadow=new zA}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}};var SS=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Rie(),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){let t=Rie();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function Rie(){return(typeof performance>"u"?Date:performance).now()}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:rS}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=rS);var Lse=Use(rae());var Nk="162";var OLe=0,iae=1,FLe=2;var Xoe=1,zLe=2,vc=3,Uh=0,lo=1,yc=2,Dh=0,a0=1,nae=2,aae=3,oae=4,BLe=5,um=100,kLe=101,VLe=102,sae=103,lae=104,GLe=200,HLe=201,WLe=202,XLe=203,JB=204,$B=205,YLe=206,qLe=207,ZLe=208,jLe=209,KLe=210,JLe=211,$Le=212,QLe=213,ePe=214,tPe=0,rPe=1,iPe=2,eR=3,nPe=4,aPe=5,oPe=6,sPe=7,NR=0,lPe=1,uPe=2,Ih=0,cPe=1,fPe=2,hPe=3,pPe=4,dPe=5,mPe=6,vPe=7,uae="attached",gPe="detached",cae=300,l0=301,u0=302,LM=303,QB=304,UR=306,c0=1e3,oo=1001,ek=1002,Dn=1003,fae=1004;var SM=1005;var ao=1006,mB=1007;var fm=1008;var Nh=1009,yPe=1010,_Pe=1011,Uk=1012,Yoe=1013,Ph=1014,hu=1015,PM=1016,qoe=1017,Zoe=1018,hm=1020,xPe=1021,As=1023,SPe=1024,MPe=1025,pm=1026,f0=1027,bPe=1028,joe=1029,wPe=1030,Koe=1031,Joe=1033,vB=33776,gB=33777,yB=33778,_B=33779,hae=35840,pae=35841,dae=35842,mae=35843,$oe=36196,vae=37492,gae=37496,yae=37808,_ae=37809,xae=37810,Sae=37811,Mae=37812,bae=37813,wae=37814,Tae=37815,Eae=37816,Aae=37817,Cae=37818,Rae=37819,Lae=37820,Pae=37821,xB=36492,Dae=36494,Iae=36495,TPe=36283,Nae=36284,Uae=36285,Oae=36286;var tR=2300,rR=2301,SB=2302,Fae=2400,zae=2401,Bae=2402,EPe=2500;var APe=3200,CPe=3201,Ok=0,RPe=1,Lh="",Ma="srgb",Hh="srgb-linear",Fk="display-p3",OR="display-p3-linear",iR="linear",ai="srgb",nR="rec709",aR="p3";var zy=7680;var kae=519,LPe=512,PPe=513,DPe=514,Qoe=515,IPe=516,NPe=517,UPe=518,OPe=519,Vae=35044;var Gae="300 es",tk=1035,_c=2e3,oR=2001,Oh=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let n=i.slice(0);for(let a=0,o=n.length;a>8&255]+ta[r>>16&255]+ta[r>>24&255]+"-"+ta[e&255]+ta[e>>8&255]+"-"+ta[e>>16&15|64]+ta[e>>24&255]+"-"+ta[t&63|128]+ta[t>>8&255]+"-"+ta[t>>16&255]+ta[t>>24&255]+ta[i&255]+ta[i>>8&255]+ta[i>>16&255]+ta[i>>24&255]).toLowerCase()}function In(r,e,t){return Math.max(e,Math.min(t,r))}function zk(r,e){return(r%e+e)%e}function FPe(r,e,t,i,n){return i+(r-e)*(n-i)/(t-e)}function zPe(r,e,t){return r!==e?(t-r)/(e-r):0}function CM(r,e,t){return(1-t)*r+t*e}function BPe(r,e,t,i){return CM(r,e,1-Math.exp(-t*i))}function kPe(r,e=1){return e-Math.abs(zk(r,e*2)-e)}function VPe(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function GPe(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function HPe(r,e){return r+Math.floor(Math.random()*(e-r+1))}function WPe(r,e){return r+Math.random()*(e-r)}function XPe(r){return r*(.5-Math.random())}function YPe(r){r!==void 0&&(Hae=r);let e=Hae+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function qPe(r){return r*AM}function ZPe(r){return r*h0}function rk(r){return(r&r-1)===0&&r!==0}function jPe(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function sR(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function KPe(r,e,t,i,n){let a=Math.cos,o=Math.sin,s=a(t/2),l=o(t/2),u=a((e+i)/2),c=o((e+i)/2),f=a((e-i)/2),h=o((e-i)/2),p=a((i-e)/2),d=o((i-e)/2);switch(n){case"XYX":r.set(s*c,l*f,l*h,s*u);break;case"YZY":r.set(l*h,s*c,l*f,s*u);break;case"ZXZ":r.set(l*f,l*h,s*c,s*u);break;case"XZX":r.set(s*c,l*d,l*p,s*u);break;case"YXY":r.set(l*p,s*c,l*d,s*u);break;case"ZYZ":r.set(l*d,l*p,s*c,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function e0(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function xa(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var na={DEG2RAD:AM,RAD2DEG:h0,generateUUID:Wh,clamp:In,euclideanModulo:zk,mapLinear:FPe,inverseLerp:zPe,lerp:CM,damp:BPe,pingpong:kPe,smoothstep:VPe,smootherstep:GPe,randInt:HPe,randFloat:WPe,randFloatSpread:XPe,seededRandom:YPe,degToRad:qPe,radToDeg:ZPe,isPowerOfTwo:rk,ceilPowerOfTwo:jPe,floorPowerOfTwo:sR,setQuaternionFromProperEuler:KPe,normalize:xa,denormalize:e0},yr=class r{constructor(e=0,t=0){r.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(In(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),a=this.x-e.x,o=this.y-e.y;return this.x=a*i-o*n+e.x,this.y=a*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},dr=class r{constructor(e,t,i,n,a,o,s,l,u){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u)}set(e,t,i,n,a,o,s,l,u){let c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=a,c[5]=l,c[6]=i,c[7]=o,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[3],l=i[6],u=i[1],c=i[4],f=i[7],h=i[2],p=i[5],d=i[8],g=n[0],m=n[3],v=n[6],_=n[1],y=n[4],x=n[7],M=n[2],S=n[5],w=n[8];return a[0]=o*g+s*_+l*M,a[3]=o*m+s*y+l*S,a[6]=o*v+s*x+l*w,a[1]=u*g+c*_+f*M,a[4]=u*m+c*y+f*S,a[7]=u*v+c*x+f*w,a[2]=h*g+p*_+d*M,a[5]=h*m+p*y+d*S,a[8]=h*v+p*x+d*w,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t*o*c-t*s*u-i*a*c+i*s*l+n*a*u-n*o*l}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=c*o-s*u,h=s*l-c*a,p=u*a-o*l,d=t*f+i*h+n*p;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/d;return e[0]=f*g,e[1]=(n*u-c*i)*g,e[2]=(s*i-n*o)*g,e[3]=h*g,e[4]=(c*t-n*l)*g,e[5]=(n*a-s*t)*g,e[6]=p*g,e[7]=(i*l-u*t)*g,e[8]=(o*t-i*a)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,a,o,s){let l=Math.cos(a),u=Math.sin(a);return this.set(i*l,i*u,-i*(l*o+u*s)+o+e,-n*u,n*l,-n*(-u*o+l*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(MB.makeScale(e,t)),this}rotate(e){return this.premultiply(MB.makeRotation(-e)),this}translate(e,t){return this.premultiply(MB.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},MB=new dr;function ese(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function DM(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function JPe(){let r=DM("canvas");return r.style.display="block",r}var Wae={};function $Pe(r){r in Wae||(Wae[r]=!0,console.warn(r))}var Xae=new dr().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Yae=new dr().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),CC={[Hh]:{transfer:iR,primaries:nR,toReference:r=>r,fromReference:r=>r},[Ma]:{transfer:ai,primaries:nR,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[OR]:{transfer:iR,primaries:aR,toReference:r=>r.applyMatrix3(Yae),fromReference:r=>r.applyMatrix3(Xae)},[Fk]:{transfer:ai,primaries:aR,toReference:r=>r.convertSRGBToLinear().applyMatrix3(Yae),fromReference:r=>r.applyMatrix3(Xae).convertLinearToSRGB()}},QPe=new Set([Hh,OR]),Jr={enabled:!0,_workingColorSpace:Hh,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!QPe.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;let i=CC[e].toReference,n=CC[t].fromReference;return n(i(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return CC[r].primaries},getTransfer:function(r){return r===Lh?iR:CC[r].transfer}};function o0(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function bB(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var By,lR=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{By===void 0&&(By=DM("canvas")),By.width=e.width,By.height=e.height;let i=By.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=By}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=DM("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),a=n.data;for(let o=0;o{class r extends Oh{constructor(t=r.DEFAULT_IMAGE,i=r.DEFAULT_MAPPING,n=oo,a=oo,o=ao,s=fm,l=As,u=Nh,c=r.DEFAULT_ANISOTROPY,f=Lh){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:tDe++}),this.uuid=Wh(),this.name="",this.source=new uR(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=n,this.wrapT=a,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=u,this.offset=new yr(0,0),this.repeat=new yr(1,1),this.center=new yr(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new dr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=f,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),i||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==cae)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case c0:t.x=t.x-Math.floor(t.x);break;case oo:t.x=t.x<0?0:1;break;case ek:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case c0:t.y=t.y-Math.floor(t.y);break;case oo:t.y=t.y<0?0:1;break;case ek:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}}return r.DEFAULT_IMAGE=null,r.DEFAULT_MAPPING=cae,r.DEFAULT_ANISOTROPY=1,r})(),Pr=class r{constructor(e=0,t=0,i=0,n=1){r.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*a,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*a,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*a,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,a,l=e.elements,u=l[0],c=l[4],f=l[8],h=l[1],p=l[5],d=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(c-h)<.01&&Math.abs(f-g)<.01&&Math.abs(d-m)<.01){if(Math.abs(c+h)<.1&&Math.abs(f+g)<.1&&Math.abs(d+m)<.1&&Math.abs(u+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let y=(u+1)/2,x=(p+1)/2,M=(v+1)/2,S=(c+h)/4,w=(f+g)/4,T=(d+m)/4;return y>x&&y>M?y<.01?(i=0,n=.707106781,a=.707106781):(i=Math.sqrt(y),n=S/i,a=w/i):x>M?x<.01?(i=.707106781,n=0,a=.707106781):(n=Math.sqrt(x),i=S/n,a=T/n):M<.01?(i=.707106781,n=.707106781,a=0):(a=Math.sqrt(M),i=w/a,n=T/a),this.set(i,n,a,t),this}let _=Math.sqrt((m-d)*(m-d)+(f-g)*(f-g)+(h-c)*(h-c));return Math.abs(_)<.001&&(_=1),this.x=(m-d)/_,this.y=(f-g)/_,this.z=(h-c)/_,this.w=Math.acos((u+p+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},ik=class extends Oh{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Pr(0,0,e,t),this.scissorTest=!1,this.viewport=new Pr(0,0,e,t);let n={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ao,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let a=new Vo(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);a.flipY=!1,a.generateMipmaps=i.generateMipmaps,a.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let s=0;s=0?1:-1,y=1-v*v;if(y>Number.EPSILON){let M=Math.sqrt(y),S=Math.atan2(M,v*_);m=Math.sin(m*S)/M,s=Math.sin(s*S)/M}let x=s*_;if(l=l*m+h*x,u=u*m+p*x,c=c*m+d*x,f=f*m+g*x,m===1-s){let M=1/Math.sqrt(l*l+u*u+c*c+f*f);l*=M,u*=M,c*=M,f*=M}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,n,a,o){let s=i[n],l=i[n+1],u=i[n+2],c=i[n+3],f=a[o],h=a[o+1],p=a[o+2],d=a[o+3];return e[t]=s*d+c*f+l*p-u*h,e[t+1]=l*d+c*h+u*f-s*p,e[t+2]=u*d+c*p+s*h-l*f,e[t+3]=c*d-s*f-l*h-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let i=e._x,n=e._y,a=e._z,o=e._order,s=Math.cos,l=Math.sin,u=s(i/2),c=s(n/2),f=s(a/2),h=l(i/2),p=l(n/2),d=l(a/2);switch(o){case"XYZ":this._x=h*c*f+u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f-h*p*d;break;case"YXZ":this._x=h*c*f+u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f+h*p*d;break;case"ZXY":this._x=h*c*f-u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f-h*p*d;break;case"ZYX":this._x=h*c*f-u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f+h*p*d;break;case"YZX":this._x=h*c*f+u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f-h*p*d;break;case"XZY":this._x=h*c*f-u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],a=t[8],o=t[1],s=t[5],l=t[9],u=t[2],c=t[6],f=t[10],h=i+s+f;if(h>0){let p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(c-l)*p,this._y=(a-u)*p,this._z=(o-n)*p}else if(i>s&&i>f){let p=2*Math.sqrt(1+i-s-f);this._w=(c-l)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(a+u)/p}else if(s>f){let p=2*Math.sqrt(1+s-i-f);this._w=(a-u)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(l+c)/p}else{let p=2*Math.sqrt(1+f-i-s);this._w=(o-n)/p,this._x=(a+u)/p,this._y=(l+c)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(In(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,a=e._z,o=e._w,s=t._x,l=t._y,u=t._z,c=t._w;return this._x=i*c+o*s+n*u-a*l,this._y=n*c+o*l+a*s-i*u,this._z=a*c+o*u+i*l-n*s,this._w=o*c-i*s-n*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,n=this._y,a=this._z,o=this._w,s=o*e._w+i*e._x+n*e._y+a*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=n,this._z=a,this;let l=1-s*s;if(l<=Number.EPSILON){let p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*a+t*this._z,this.normalize(),this}let u=Math.sqrt(l),c=Math.atan2(u,s),f=Math.sin((1-t)*c)/u,h=Math.sin(t*c)/u;return this._w=o*f+this._w*h,this._x=i*f+this._x*h,this._y=n*f+this._y*h,this._z=a*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},ye=class r{constructor(e=0,t=0,i=0){r.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(qae.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(qae.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*n,this.y=a[1]*t+a[4]*i+a[7]*n,this.z=a[2]*t+a[5]*i+a[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=e.elements,o=1/(a[3]*t+a[7]*i+a[11]*n+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*n+a[12])*o,this.y=(a[1]*t+a[5]*i+a[9]*n+a[13])*o,this.z=(a[2]*t+a[6]*i+a[10]*n+a[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,a=e.x,o=e.y,s=e.z,l=e.w,u=2*(o*n-s*i),c=2*(s*t-a*n),f=2*(a*i-o*t);return this.x=t+l*u+o*f-s*c,this.y=i+l*c+s*u-a*f,this.z=n+l*f+a*c-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n,this.y=a[1]*t+a[5]*i+a[9]*n,this.z=a[2]*t+a[6]*i+a[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,a=e.z,o=t.x,s=t.y,l=t.z;return this.x=n*l-a*s,this.y=a*o-i*l,this.z=i*s-n*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return TB.copy(this).projectOnVector(e),this.sub(TB)}reflect(e){return this.sub(TB.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(In(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},TB=new ye,qae=new On,Fh=class{constructor(e=new ye(1/0,1/0,1/0),t=new ye(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}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&&this.min.z<=e.min.z&&e.max.z<=this.max.z}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),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,vl),vl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(MM),LC.subVectors(this.max,MM),ky.subVectors(e.a,MM),Vy.subVectors(e.b,MM),Gy.subVectors(e.c,MM),wh.subVectors(Vy,ky),Th.subVectors(Gy,Vy),rm.subVectors(ky,Gy);let t=[0,-wh.z,wh.y,0,-Th.z,Th.y,0,-rm.z,rm.y,wh.z,0,-wh.x,Th.z,0,-Th.x,rm.z,0,-rm.x,-wh.y,wh.x,0,-Th.y,Th.x,0,-rm.y,rm.x,0];return!EB(t,ky,Vy,Gy,LC)||(t=[1,0,0,0,1,0,0,0,1],!EB(t,ky,Vy,Gy,LC))?!1:(PC.crossVectors(wh,Th),t=[PC.x,PC.y,PC.z],EB(t,ky,Vy,Gy,LC))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vl).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(vl).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(cc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),cc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),cc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),cc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),cc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),cc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),cc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),cc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(cc),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)}},cc=[new ye,new ye,new ye,new ye,new ye,new ye,new ye,new ye],vl=new ye,RC=new Fh,ky=new ye,Vy=new ye,Gy=new ye,wh=new ye,Th=new ye,rm=new ye,MM=new ye,LC=new ye,PC=new ye,im=new ye;function EB(r,e,t,i,n){for(let a=0,o=r.length-3;a<=o;a+=3){im.fromArray(r,a);let s=n.x*Math.abs(im.x)+n.y*Math.abs(im.y)+n.z*Math.abs(im.z),l=e.dot(im),u=t.dot(im),c=i.dot(im);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var rDe=new Fh,bM=new ye,AB=new ye,zh=class{constructor(e=new ye,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):rDe.setFromPoints(e).getCenter(i);let n=0;for(let a=0,o=e.length;athis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;bM.subVectors(e,this.center);let t=bM.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector(bM,n/i),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(AB.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(bM.copy(e.center).add(AB)),this.expandByPoint(bM.copy(e.center).sub(AB))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},fc=new ye,CB=new ye,DC=new ye,Eh=new ye,RB=new ye,IC=new ye,LB=new ye,IM=class{constructor(e=new ye,t=new ye(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,fc)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=fc.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(fc.copy(this.origin).addScaledVector(this.direction,t),fc.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){CB.copy(e).add(t).multiplyScalar(.5),DC.copy(t).sub(e).normalize(),Eh.copy(this.origin).sub(CB);let a=e.distanceTo(t)*.5,o=-this.direction.dot(DC),s=Eh.dot(this.direction),l=-Eh.dot(DC),u=Eh.lengthSq(),c=Math.abs(1-o*o),f,h,p,d;if(c>0)if(f=o*l-s,h=o*s-l,d=a*c,f>=0)if(h>=-d)if(h<=d){let g=1/c;f*=g,h*=g,p=f*(f+o*h+2*s)+h*(o*f+h+2*l)+u}else h=a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;else h=-a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;else h<=-d?(f=Math.max(0,-(-o*a+s)),h=f>0?-a:Math.min(Math.max(-a,-l),a),p=-f*f+h*(h+2*l)+u):h<=d?(f=0,h=Math.min(Math.max(-a,-l),a),p=h*(h+2*l)+u):(f=Math.max(0,-(o*a+s)),h=f>0?a:Math.min(Math.max(-a,-l),a),p=-f*f+h*(h+2*l)+u);else h=o>0?-a:a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,f),n&&n.copy(CB).addScaledVector(DC,h),p}intersectSphere(e,t){fc.subVectors(e.center,this.origin);let i=fc.dot(this.direction),n=fc.dot(fc)-i*i,a=e.radius*e.radius;if(n>a)return null;let o=Math.sqrt(a-n),s=i-o,l=i+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,a,o,s,l,u=1/this.direction.x,c=1/this.direction.y,f=1/this.direction.z,h=this.origin;return u>=0?(i=(e.min.x-h.x)*u,n=(e.max.x-h.x)*u):(i=(e.max.x-h.x)*u,n=(e.min.x-h.x)*u),c>=0?(a=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(a=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),i>o||a>n||((a>i||isNaN(i))&&(i=a),(o=0?(s=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(s=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||s>n)||((s>i||i!==i)&&(i=s),(l=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,fc)!==null}intersectTriangle(e,t,i,n,a){RB.subVectors(t,e),IC.subVectors(i,e),LB.crossVectors(RB,IC);let o=this.direction.dot(LB),s;if(o>0){if(n)return null;s=1}else if(o<0)s=-1,o=-o;else return null;Eh.subVectors(this.origin,e);let l=s*this.direction.dot(IC.crossVectors(Eh,IC));if(l<0)return null;let u=s*this.direction.dot(RB.cross(Eh));if(u<0||l+u>o)return null;let c=-s*Eh.dot(LB);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Ht=class r{constructor(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m)}set(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m){let v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=a,v[5]=o,v[9]=s,v[13]=l,v[2]=u,v[6]=c,v[10]=f,v[14]=h,v[3]=p,v[7]=d,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/Hy.setFromMatrixColumn(e,0).length(),a=1/Hy.setFromMatrixColumn(e,1).length(),o=1/Hy.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,a=e.z,o=Math.cos(i),s=Math.sin(i),l=Math.cos(n),u=Math.sin(n),c=Math.cos(a),f=Math.sin(a);if(e.order==="XYZ"){let h=o*c,p=o*f,d=s*c,g=s*f;t[0]=l*c,t[4]=-l*f,t[8]=u,t[1]=p+d*u,t[5]=h-g*u,t[9]=-s*l,t[2]=g-h*u,t[6]=d+p*u,t[10]=o*l}else if(e.order==="YXZ"){let h=l*c,p=l*f,d=u*c,g=u*f;t[0]=h+g*s,t[4]=d*s-p,t[8]=o*u,t[1]=o*f,t[5]=o*c,t[9]=-s,t[2]=p*s-d,t[6]=g+h*s,t[10]=o*l}else if(e.order==="ZXY"){let h=l*c,p=l*f,d=u*c,g=u*f;t[0]=h-g*s,t[4]=-o*f,t[8]=d+p*s,t[1]=p+d*s,t[5]=o*c,t[9]=g-h*s,t[2]=-o*u,t[6]=s,t[10]=o*l}else if(e.order==="ZYX"){let h=o*c,p=o*f,d=s*c,g=s*f;t[0]=l*c,t[4]=d*u-p,t[8]=h*u+g,t[1]=l*f,t[5]=g*u+h,t[9]=p*u-d,t[2]=-u,t[6]=s*l,t[10]=o*l}else if(e.order==="YZX"){let h=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=g-h*f,t[8]=d*f+p,t[1]=f,t[5]=o*c,t[9]=-s*c,t[2]=-u*c,t[6]=p*f+d,t[10]=h-g*f}else if(e.order==="XZY"){let h=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=-f,t[8]=u*c,t[1]=h*f+g,t[5]=o*c,t[9]=p*f-d,t[2]=d*f-p,t[6]=s*c,t[10]=g*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(iDe,e,nDe)}lookAt(e,t,i){let n=this.elements;return Bo.subVectors(e,t),Bo.lengthSq()===0&&(Bo.z=1),Bo.normalize(),Ah.crossVectors(i,Bo),Ah.lengthSq()===0&&(Math.abs(i.z)===1?Bo.x+=1e-4:Bo.z+=1e-4,Bo.normalize(),Ah.crossVectors(i,Bo)),Ah.normalize(),NC.crossVectors(Bo,Ah),n[0]=Ah.x,n[4]=NC.x,n[8]=Bo.x,n[1]=Ah.y,n[5]=NC.y,n[9]=Bo.y,n[2]=Ah.z,n[6]=NC.z,n[10]=Bo.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[4],l=i[8],u=i[12],c=i[1],f=i[5],h=i[9],p=i[13],d=i[2],g=i[6],m=i[10],v=i[14],_=i[3],y=i[7],x=i[11],M=i[15],S=n[0],w=n[4],T=n[8],C=n[12],b=n[1],E=n[5],I=n[9],R=n[13],A=n[2],D=n[6],U=n[10],B=n[14],F=n[3],k=n[7],G=n[11],Y=n[15];return a[0]=o*S+s*b+l*A+u*F,a[4]=o*w+s*E+l*D+u*k,a[8]=o*T+s*I+l*U+u*G,a[12]=o*C+s*R+l*B+u*Y,a[1]=c*S+f*b+h*A+p*F,a[5]=c*w+f*E+h*D+p*k,a[9]=c*T+f*I+h*U+p*G,a[13]=c*C+f*R+h*B+p*Y,a[2]=d*S+g*b+m*A+v*F,a[6]=d*w+g*E+m*D+v*k,a[10]=d*T+g*I+m*U+v*G,a[14]=d*C+g*R+m*B+v*Y,a[3]=_*S+y*b+x*A+M*F,a[7]=_*w+y*E+x*D+M*k,a[11]=_*T+y*I+x*U+M*G,a[15]=_*C+y*R+x*B+M*Y,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],a=e[12],o=e[1],s=e[5],l=e[9],u=e[13],c=e[2],f=e[6],h=e[10],p=e[14],d=e[3],g=e[7],m=e[11],v=e[15];return d*(+a*l*f-n*u*f-a*s*h+i*u*h+n*s*p-i*l*p)+g*(+t*l*p-t*u*h+a*o*h-n*o*p+n*u*c-a*l*c)+m*(+t*u*f-t*s*p-a*o*f+i*o*p+a*s*c-i*u*c)+v*(-n*s*c-t*l*f+t*s*h+n*o*f-i*o*h+i*l*c)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],_=f*m*u-g*h*u+g*l*p-s*m*p-f*l*v+s*h*v,y=d*h*u-c*m*u-d*l*p+o*m*p+c*l*v-o*h*v,x=c*g*u-d*f*u+d*s*p-o*g*p-c*s*v+o*f*v,M=d*f*l-c*g*l-d*s*h+o*g*h+c*s*m-o*f*m,S=t*_+i*y+n*x+a*M;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/S;return e[0]=_*w,e[1]=(g*h*a-f*m*a-g*n*p+i*m*p+f*n*v-i*h*v)*w,e[2]=(s*m*a-g*l*a+g*n*u-i*m*u-s*n*v+i*l*v)*w,e[3]=(f*l*a-s*h*a-f*n*u+i*h*u+s*n*p-i*l*p)*w,e[4]=y*w,e[5]=(c*m*a-d*h*a+d*n*p-t*m*p-c*n*v+t*h*v)*w,e[6]=(d*l*a-o*m*a-d*n*u+t*m*u+o*n*v-t*l*v)*w,e[7]=(o*h*a-c*l*a+c*n*u-t*h*u-o*n*p+t*l*p)*w,e[8]=x*w,e[9]=(d*f*a-c*g*a-d*i*p+t*g*p+c*i*v-t*f*v)*w,e[10]=(o*g*a-d*s*a+d*i*u-t*g*u-o*i*v+t*s*v)*w,e[11]=(c*s*a-o*f*a-c*i*u+t*f*u+o*i*p-t*s*p)*w,e[12]=M*w,e[13]=(c*g*n-d*f*n+d*i*h-t*g*h-c*i*m+t*f*m)*w,e[14]=(d*s*n-o*g*n-d*i*l+t*g*l+o*i*m-t*s*m)*w,e[15]=(o*f*n-c*s*n+c*i*l-t*f*l-o*i*h+t*s*h)*w,this}scale(e){let t=this.elements,i=e.x,n=e.y,a=e.z;return t[0]*=i,t[4]*=n,t[8]*=a,t[1]*=i,t[5]*=n,t[9]*=a,t[2]*=i,t[6]*=n,t[10]*=a,t[3]*=i,t[7]*=n,t[11]*=a,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),a=1-i,o=e.x,s=e.y,l=e.z,u=a*o,c=a*s;return this.set(u*o+i,u*s-n*l,u*l+n*s,0,u*s+n*l,c*s+i,c*l-n*o,0,u*l-n*s,c*l+n*o,a*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,a,o){return this.set(1,i,a,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,a=t._x,o=t._y,s=t._z,l=t._w,u=a+a,c=o+o,f=s+s,h=a*u,p=a*c,d=a*f,g=o*c,m=o*f,v=s*f,_=l*u,y=l*c,x=l*f,M=i.x,S=i.y,w=i.z;return n[0]=(1-(g+v))*M,n[1]=(p+x)*M,n[2]=(d-y)*M,n[3]=0,n[4]=(p-x)*S,n[5]=(1-(h+v))*S,n[6]=(m+_)*S,n[7]=0,n[8]=(d+y)*w,n[9]=(m-_)*w,n[10]=(1-(h+g))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,a=Hy.set(n[0],n[1],n[2]).length(),o=Hy.set(n[4],n[5],n[6]).length(),s=Hy.set(n[8],n[9],n[10]).length();this.determinant()<0&&(a=-a),e.x=n[12],e.y=n[13],e.z=n[14],gl.copy(this);let u=1/a,c=1/o,f=1/s;return gl.elements[0]*=u,gl.elements[1]*=u,gl.elements[2]*=u,gl.elements[4]*=c,gl.elements[5]*=c,gl.elements[6]*=c,gl.elements[8]*=f,gl.elements[9]*=f,gl.elements[10]*=f,t.setFromRotationMatrix(gl),i.x=a,i.y=o,i.z=s,this}makePerspective(e,t,i,n,a,o,s=_c){let l=this.elements,u=2*a/(t-e),c=2*a/(i-n),f=(t+e)/(t-e),h=(i+n)/(i-n),p,d;if(s===_c)p=-(o+a)/(o-a),d=-2*o*a/(o-a);else if(s===oR)p=-o/(o-a),d=-o*a/(o-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=u,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=c,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=d,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,a,o,s=_c){let l=this.elements,u=1/(t-e),c=1/(i-n),f=1/(o-a),h=(t+e)*u,p=(i+n)*c,d,g;if(s===_c)d=(o+a)*f,g=-2*f;else if(s===oR)d=a*f,g=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=g,l[14]=-d,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},Hy=new ye,gl=new Ht,iDe=new ye(0,0,0),nDe=new ye(1,1,1),Ah=new ye,NC=new ye,Bo=new ye,Zae=new Ht,jae=new On,Fn=(()=>{class r{constructor(t=0,i=0,n=0,a=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=a}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,n,a=this._order){return this._x=t,this._y=i,this._z=n,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,n=!0){let a=t.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],f=a[9],h=a[2],p=a[6],d=a[10];switch(i){case"XYZ":this._y=Math.asin(In(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,d),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-In(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(l,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(In(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-In(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(In(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(l,d));break;case"XZY":this._z=Math.asin(-In(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-f,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,n){return Zae.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Zae,i,n)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return jae.setFromEuler(this),this.setFromQuaternion(jae,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return r.DEFAULT_ORDER="XYZ",r})(),fR=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<{class r extends Oh{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:aDe++}),this.uuid=Wh(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new ye,i=new Fn,n=new On,a=new ye(1,1,1);function o(){n.setFromEuler(i,!1)}function s(){i.setFromQuaternion(n,void 0,!1)}i._onChange(o),n._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new Ht},normalMatrix:{value:new dr}}),this.matrix=new Ht,this.matrixWorld=new Ht,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new fR,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Wy.setFromAxisAngle(t,i),this.quaternion.multiply(Wy),this}rotateOnWorldAxis(t,i){return Wy.setFromAxisAngle(t,i),this.quaternion.premultiply(Wy),this}rotateX(t){return this.rotateOnAxis(Jae,t)}rotateY(t){return this.rotateOnAxis($ae,t)}rotateZ(t){return this.rotateOnAxis(Qae,t)}translateOnAxis(t,i){return Kae.copy(t).applyQuaternion(this.quaternion),this.position.add(Kae.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(Jae,t)}translateY(t){return this.translateOnAxis($ae,t)}translateZ(t){return this.translateOnAxis(Qae,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(hc.copy(this.matrixWorld).invert())}lookAt(t,i,n){t.isVector3?UC.copy(t):UC.set(t,i,n);let a=this.parent;this.updateWorldMatrix(!0,!1),wM.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?hc.lookAt(wM,UC,this.up):hc.lookAt(UC,wM,this.up),this.quaternion.setFromRotationMatrix(hc),a&&(hc.extractRotation(a.matrixWorld),Wy.setFromRotationMatrix(hc),this.quaternion.premultiply(Wy.invert()))}add(t){if(arguments.length>1){for(let i=0;i1){for(let n=0;n0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.visibility=this._visibility,a.active=this._active,a.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),a.maxGeometryCount=this._maxGeometryCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.geometryCount=this._geometryCount,a.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(a.boundingSphere={center:a.boundingSphere.center.toArray(),radius:a.boundingSphere.radius}),this.boundingBox!==null&&(a.boundingBox={min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}));function o(l,u){return l[u.uuid]===void 0&&(l[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=o(t.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let u=l.shapes;if(Array.isArray(u))for(let c=0,f=u.length;c0){a.children=[];for(let l=0;l0){a.animations=[];for(let l=0;l0&&(n.geometries=l),u.length>0&&(n.materials=u),c.length>0&&(n.textures=c),f.length>0&&(n.images=f),h.length>0&&(n.shapes=h),p.length>0&&(n.skeletons=p),d.length>0&&(n.animations=d),g.length>0&&(n.nodes=g)}return n.object=a,n;function s(l){let u=[];for(let c in l){let f=l[c];delete f.metadata,u.push(f)}return u}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let n=0;n0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(e,t,i,n,a){yl.subVectors(n,t),pc.subVectors(i,t),IB.subVectors(e,t);let o=yl.dot(yl),s=yl.dot(pc),l=yl.dot(IB),u=pc.dot(pc),c=pc.dot(IB),f=o*u-s*s;if(f===0)return a.set(0,0,0),null;let h=1/f,p=(u*l-s*c)*h,d=(o*c-s*l)*h;return a.set(1-p-d,d,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,dc)===null?!1:dc.x>=0&&dc.y>=0&&dc.x+dc.y<=1}static getInterpolation(e,t,i,n,a,o,s,l){return this.getBarycoord(e,t,i,n,dc)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,dc.x),l.addScaledVector(o,dc.y),l.addScaledVector(s,dc.z),l)}static isFrontFacing(e,t,i,n){return yl.subVectors(i,t),pc.subVectors(e,t),yl.cross(pc).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return yl.subVectors(this.c,this.b),pc.subVectors(this.a,this.b),yl.cross(pc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return r.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return r.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,a){return r.getInterpolation(e,this.a,this.b,this.c,t,i,n,a)}containsPoint(e){return r.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return r.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,n=this.b,a=this.c,o,s;Xy.subVectors(n,i),Yy.subVectors(a,i),NB.subVectors(e,i);let l=Xy.dot(NB),u=Yy.dot(NB);if(l<=0&&u<=0)return t.copy(i);UB.subVectors(e,n);let c=Xy.dot(UB),f=Yy.dot(UB);if(c>=0&&f<=c)return t.copy(n);let h=l*f-c*u;if(h<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(i).addScaledVector(Xy,o);OB.subVectors(e,a);let p=Xy.dot(OB),d=Yy.dot(OB);if(d>=0&&p<=d)return t.copy(a);let g=p*u-l*d;if(g<=0&&u>=0&&d<=0)return s=u/(u-d),t.copy(i).addScaledVector(Yy,s);let m=c*d-p*f;if(m<=0&&f-c>=0&&p-d>=0)return eoe.subVectors(a,n),s=(f-c)/(f-c+(p-d)),t.copy(n).addScaledVector(eoe,s);let v=1/(m+g+h);return o=g*v,s=h*v,t.copy(i).addScaledVector(Xy,o).addScaledVector(Yy,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},tse={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ch={h:0,s:0,l:0},OC={h:0,s:0,l:0};function FB(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}var er=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ma){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Jr.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=Jr.workingColorSpace){return this.r=e,this.g=t,this.b=i,Jr.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=Jr.workingColorSpace){if(e=zk(e,1),t=In(t,0,1),i=In(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,o=2*i-a;this.r=FB(o,a,e+1/3),this.g=FB(o,a,e),this.b=FB(o,a,e-1/3)}return Jr.toWorkingColorSpace(this,n),this}setStyle(e,t=Ma){function i(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let a,o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=n[1],o=a.length;if(o===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ma){let i=tse[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=o0(e.r),this.g=o0(e.g),this.b=o0(e.b),this}copyLinearToSRGB(e){return this.r=bB(e.r),this.g=bB(e.g),this.b=bB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ma){return Jr.fromWorkingColorSpace(ra.copy(this),e),Math.round(In(ra.r*255,0,255))*65536+Math.round(In(ra.g*255,0,255))*256+Math.round(In(ra.b*255,0,255))}getHexString(e=Ma){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Jr.workingColorSpace){Jr.fromWorkingColorSpace(ra.copy(this),t);let i=ra.r,n=ra.g,a=ra.b,o=Math.max(i,n,a),s=Math.min(i,n,a),l,u,c=(s+o)/2;if(s===o)l=0,u=0;else{let f=o-s;switch(u=c<=.5?f/(o+s):f/(2-o-s),o){case i:l=(n-a)/f+(n0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let n=this[t];if(n===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==a0&&(i.blending=this.blending),this.side!==Uh&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==JB&&(i.blendSrc=this.blendSrc),this.blendDst!==$B&&(i.blendDst=this.blendDst),this.blendEquation!==um&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==eR&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==kae&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==zy&&(i.stencilFail=this.stencilFail),this.stencilZFail!==zy&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==zy&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function n(a){let o=[];for(let s in a){let l=a[s];delete l.metadata,o.push(l)}return o}if(t){let a=n(e.textures),o=n(e.images);a.length>0&&(i.textures=a),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let n=t.length;i=new Array(n);for(let a=0;a!==n;++a)i[a]=t[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},hR=class extends Mc{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new er(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Fn,this.combine=NR,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}};var Hi=new ye,FC=new yr,Cs=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Vae,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=hu,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return $Pe("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,a=this.itemSize;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let l in i){let u=i[l];e.data.attributes[l]=u.toJSON(e.data)}let n={},a=!1;for(let l in this.morphAttributes){let u=this.morphAttributes[l],c=[];for(let f=0,h=u.length;f0&&(n[l]=c,a=!0)}a&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let n=e.attributes;for(let u in n){let c=n[u];this.setAttribute(u,c.clone(t))}let a=e.morphAttributes;for(let u in a){let c=[],f=a[u];for(let h=0,p=f.length;h0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a(e.far-e.near)**2))&&(toe.copy(a).invert(),nm.copy(e.ray).applyMatrix4(toe),!(i.boundingBox!==null&&nm.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,nm)))}_computeIntersections(e,t,i){let n,a=this.geometry,o=this.material,s=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,f=a.attributes.normal,h=a.groups,p=a.drawRange;if(s!==null)if(Array.isArray(o))for(let d=0,g=h.length;dt.far?null:{distance:u,point:WC.clone(),object:r}}function XC(r,e,t,i,n,a,o,s,l,u){r.getVertexPosition(s,Zy),r.getVertexPosition(l,jy),r.getVertexPosition(u,Ky);let c=hDe(r,e,t,i,Zy,jy,Ky,HC);if(c){n&&(kC.fromBufferAttribute(n,s),VC.fromBufferAttribute(n,l),GC.fromBufferAttribute(n,u),c.uv=t0.getInterpolation(HC,Zy,jy,Ky,kC,VC,GC,new yr)),a&&(kC.fromBufferAttribute(a,s),VC.fromBufferAttribute(a,l),GC.fromBufferAttribute(a,u),c.uv1=t0.getInterpolation(HC,Zy,jy,Ky,kC,VC,GC,new yr)),o&&(ioe.fromBufferAttribute(o,s),noe.fromBufferAttribute(o,l),aoe.fromBufferAttribute(o,u),c.normal=t0.getInterpolation(HC,Zy,jy,Ky,ioe,noe,aoe,new ye),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let f={a:s,b:l,c:u,normal:new ye,materialIndex:0};t0.getNormal(Zy,jy,Ky,f.normal),c.face=f}return c}var NM=class r extends Rs{constructor(e=1,t=1,i=1,n=1,a=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:a,depthSegments:o};let s=this;n=Math.floor(n),a=Math.floor(a),o=Math.floor(o);let l=[],u=[],c=[],f=[],h=0,p=0;d("z","y","x",-1,-1,i,t,e,o,a,0),d("z","y","x",1,-1,i,t,-e,o,a,1),d("x","z","y",1,1,e,i,t,n,o,2),d("x","z","y",1,-1,e,i,-t,n,o,3),d("x","y","z",1,-1,e,t,i,n,a,4),d("x","y","z",-1,-1,e,t,-i,n,a,5),this.setIndex(l),this.setAttribute("position",new Un(u,3)),this.setAttribute("normal",new Un(c,3)),this.setAttribute("uv",new Un(f,2));function d(g,m,v,_,y,x,M,S,w,T,C){let b=x/w,E=M/T,I=x/2,R=M/2,A=S/2,D=w+1,U=T+1,B=0,F=0,k=new ye;for(let G=0;G0?1:-1,c.push(k.x,k.y,k.z),f.push(J/w),f.push(1-G/T),B+=1}}for(let G=0;G=0&&(x[ve]=null,y[ve].disconnect(ae))}for(let K=0;K=x.length){x.push(ae),ve=se;break}else if(x[se]===null){x[se]=ae,ve=se;break}if(ve===-1)break}let ue=y[ve];ue&&ue.connect(ae)}}let U=new be,B=new be;function z(V,K,ae){U.setFromMatrixPosition(K.matrixWorld),B.setFromMatrixPosition(ae.matrixWorld);let ve=U.distanceTo(B),ue=K.projectionMatrix.elements,se=ae.projectionMatrix.elements,Ee=ue[14]/(ue[10]-1),q=ue[14]/(ue[10]+1),H=(ue[9]+1)/ue[5],We=(ue[9]-1)/ue[5],_e=(ue[8]-1)/ue[0],xe=(se[8]+1)/se[0],Le=Ee*_e,Ue=Ee*xe,Ne=ve/(-_e+xe),Ve=Ne*-_e;K.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ve),V.translateZ(Ne),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert();let ct=Ee+Ne,F=q+Ne,L=Le-Ve,ne=Ue+(ve-Ve),le=H*q/F*ct,me=We*q/F*ct;V.projectionMatrix.makePerspective(L,ne,le,me,ct,F),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}function k(V,K){K===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(K.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(n===null)return;g.texture!==null&&(V.near=g.depthNear,V.far=g.depthFar),b.near=T.near=w.near=V.near,b.far=T.far=w.far=V.far,(E!==b.near||I!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),E=b.near,I=b.far,w.near=E,w.far=I,T.near=E,T.far=I,w.updateProjectionMatrix(),T.updateProjectionMatrix(),V.updateProjectionMatrix());let K=V.parent,ae=b.cameras;k(b,K);for(let ve=0;ve0&&(m.alphaTest.value=v.alphaTest);let _=e.get(v),y=_.envMap,x=_.envMapRotation;if(y&&(m.envMap.value=y,Cd.copy(x),Cd.x*=-1,Cd.y*=-1,Cd.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Cd.y*=-1,Cd.z*=-1),m.envMapRotation.value.setFromMatrix4(jEe.makeRotationFromEuler(Cd)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=v.reflectivity,m.ior.value=v.ior,m.refractionRatio.value=v.refractionRatio),v.lightMap){m.lightMap.value=v.lightMap;let M=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=v.lightMapIntensity*M,t(v.lightMap,m.lightMapTransform)}v.aoMap&&(m.aoMap.value=v.aoMap,m.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,m.aoMapTransform))}function o(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform))}function s(m,v){m.dashSize.value=v.dashSize,m.totalSize.value=v.dashSize+v.gapSize,m.scale.value=v.scale}function l(m,v,_,y){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.size.value=v.size*_,m.scale.value=y*.5,v.map&&(m.map.value=v.map,t(v.map,m.uvTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function u(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.rotation.value=v.rotation,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function c(m,v){m.specular.value.copy(v.specular),m.shininess.value=Math.max(v.shininess,1e-4)}function f(m,v){v.gradientMap&&(m.gradientMap.value=v.gradientMap)}function h(m,v){m.metalness.value=v.metalness,v.metalnessMap&&(m.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,m.metalnessMapTransform)),m.roughness.value=v.roughness,v.roughnessMap&&(m.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,m.roughnessMapTransform)),e.get(v).envMap&&(m.envMapIntensity.value=v.envMapIntensity)}function p(m,v,_){m.ior.value=v.ior,v.sheen>0&&(m.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),m.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(m.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,m.sheenColorMapTransform)),v.sheenRoughnessMap&&(m.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,m.sheenRoughnessMapTransform))),v.clearcoat>0&&(m.clearcoat.value=v.clearcoat,m.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(m.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,m.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(m.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===_i&&m.clearcoatNormalScale.value.negate())),v.iridescence>0&&(m.iridescence.value=v.iridescence,m.iridescenceIOR.value=v.iridescenceIOR,m.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(m.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,m.iridescenceMapTransform)),v.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),v.transmission>0&&(m.transmission.value=v.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),v.transmissionMap&&(m.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,m.transmissionMapTransform)),m.thickness.value=v.thickness,v.thicknessMap&&(m.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=v.attenuationDistance,m.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(m.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(m.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=v.specularIntensity,m.specularColor.value.copy(v.specularColor),v.specularColorMap&&(m.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,m.specularColorMapTransform)),v.specularIntensityMap&&(m.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,m.specularIntensityMapTransform))}function d(m,v){v.matcap&&(m.matcap.value=v.matcap)}function g(m,v){let _=e.get(v).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function Cie(r,e,t,i){let n={},a={},o=[],s=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(_,y){let x=y.program;i.uniformBlockBinding(_,x)}function u(_,y){let x=n[_.id];x===void 0&&(d(_),x=c(_),n[_.id]=x,_.addEventListener("dispose",m));let M=y.program;i.updateUBOMapping(_,M);let S=e.render.frame;a[_.id]!==S&&(h(_),a[_.id]=S)}function c(_){let y=f();_.__bindingPointIndex=y;let x=r.createBuffer(),M=_.__size,S=_.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,M,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,x),x}function f(){for(let _=0;_0&&(x+=M-S),_.__size=x,_.__cache={},this}function g(_){let y={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),y}function m(_){let y=_.target;y.removeEventListener("dispose",m);let x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),r.deleteBuffer(n[y.id]),delete n[y.id],delete a[y.id]}function v(){for(let _ in n)r.deleteBuffer(n[_]);o=[],n={},a={}}return{bind:l,update:u,dispose:v}}var yS=class{constructor(e={}){let{canvas:t=EQ(),context:i=null,depth:n=!0,stencil:a=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let h;i!==null?h=i.getContextAttributes().alpha:h=o;let p=new Uint32Array(4),d=new Int32Array(4),g=null,m=null,v=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ka,this._useLegacyLights=!1,this.toneMapping=gs,this.toneMappingExposure=1;let y=this,x=!1,M=0,S=0,w=null,T=-1,C=null,b=new ni,E=new ni,I=null,R=new ir(0),A=0,D=t.width,U=t.height,B=1,z=null,k=null,G=new ni(0,0,D,U),Y=new ni(0,0,D,U),J=!1,Q=new yh,V=!1,K=!1,ae=null,ve=new Wr,ue=new Kt,se=new be,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return w===null?B:1}let H=i;function We(O,j){for(let re=0;re{function W(){if(ie.forEach(function(ee){Ne.get(ee).currentProgram.isReady()&&ie.delete(ee)}),ie.size===0){P(O);return}setTimeout(W,10)}_e.get("KHR_parallel_shader_compile")!==null?W():setTimeout(W,10)})};let Ft=null;function Mr(O){Ft&&Ft(O)}function jr(){Lr.stop()}function Vt(){Lr.start()}let Lr=new AA;Lr.setAnimationLoop(Mr),typeof self<"u"&&Lr.setContext(self),this.setAnimationLoop=function(O){Ft=O,Je.setAnimationLoop(O),O===null?Lr.stop():Lr.start()},Je.addEventListener("sessionstart",jr),Je.addEventListener("sessionend",Vt),this.render=function(O,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Je.enabled===!0&&Je.isPresenting===!0&&(Je.cameraAutoUpdate===!0&&Je.updateCamera(j),j=Je.getCamera()),O.isScene===!0&&O.onBeforeRender(y,O,j,w),m=Ke.get(O,_.length),m.init(),_.push(m),ve.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),Q.setFromProjectionMatrix(ve),K=this.localClippingEnabled,V=Se.init(this.clippingPlanes,K),g=et.get(O,v.length),g.init(),v.push(g),si(O,j,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(z,k),this.info.render.frame++,V===!0&&Se.beginShadows();let re=m.state.shadowsArray;if(Ae.render(re,O,j),V===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Je.enabled===!1||Je.isPresenting===!1||Je.hasDepthSensing()===!1)&&nt.render(g,O),m.setupLights(y._useLegacyLights),j.isArrayCamera){let ie=j.cameras;for(let P=0,W=ie.length;P0?m=_[_.length-1]:m=null,v.pop(),v.length>0?g=v[v.length-1]:g=null};function si(O,j,re,ie){if(O.visible===!1)return;if(O.layers.test(j.layers)){if(O.isGroup)re=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(j);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||Q.intersectsSprite(O)){ie&&se.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ve);let ee=le.update(O),ge=O.material;ge.visible&&g.push(O,ee,ge,re,se.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||Q.intersectsObject(O))){let ee=le.update(O),ge=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),se.copy(O.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),se.copy(ee.boundingSphere.center)),se.applyMatrix4(O.matrixWorld).applyMatrix4(ve)),Array.isArray(ge)){let ce=ee.groups;for(let Oe=0,Ge=ce.length;Oe0&&w0(P,W,j,re),ie&&Le.viewport(b.copy(ie)),P.length>0&&Is(P,j,re),W.length>0&&Is(W,j,re),ee.length>0&&Is(ee,j,re),Le.buffers.depth.setTest(!0),Le.buffers.depth.setMask(!0),Le.buffers.color.setMask(!0),Le.setPolygonOffset(!1)}function w0(O,j,re,ie){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;let W=xe.isWebGL2;ae===null&&(ae=new to(1,1,{generateMipmaps:!0,type:_e.has("EXT_color_buffer_half_float")?qu:Ro,minFilter:sl,samples:W?4:0})),y.getDrawingBufferSize(ue),W?ae.setSize(ue.x,ue.y):ae.setSize(hS(ue.x),hS(ue.y));let ee=y.getRenderTarget();y.setRenderTarget(ae),y.getClearColor(R),A=y.getClearAlpha(),A<1&&y.setClearColor(16777215,.5),y.clear();let ge=y.toneMapping;y.toneMapping=gs,Is(O,re,ie),Ve.updateMultisampleRenderTarget(ae),Ve.updateRenderTargetMipmap(ae);let ce=!1;for(let Oe=0,Ge=j.length;Oe0),Re=!!re.morphAttributes.position,pt=!!re.morphAttributes.normal,mt=!!re.morphAttributes.color,$e=gs;ie.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&($e=y.toneMapping);let at=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,wt=at!==void 0?at.length:0,je=Ne.get(ie),mi=m.state.lights;if(V===!0&&(K===!0||O!==C)){let Kr=O===C&&ie.id===T;Se.setState(ie,O,Kr)}let Ut=!1;ie.version===je.__version?(je.needsLights&&je.lightsStateVersion!==mi.state.version||je.outputColorSpace!==ge||P.isBatchedMesh&&je.batching===!1||!P.isBatchedMesh&&je.batching===!0||P.isInstancedMesh&&je.instancing===!1||!P.isInstancedMesh&&je.instancing===!0||P.isSkinnedMesh&&je.skinning===!1||!P.isSkinnedMesh&&je.skinning===!0||P.isInstancedMesh&&je.instancingColor===!0&&P.instanceColor===null||P.isInstancedMesh&&je.instancingColor===!1&&P.instanceColor!==null||P.isInstancedMesh&&je.instancingMorph===!0&&P.morphTexture===null||P.isInstancedMesh&&je.instancingMorph===!1&&P.morphTexture!==null||je.envMap!==ce||ie.fog===!0&&je.fog!==W||je.numClippingPlanes!==void 0&&(je.numClippingPlanes!==Se.numPlanes||je.numIntersection!==Se.numIntersection)||je.vertexAlphas!==Oe||je.vertexTangents!==Ge||je.morphTargets!==Re||je.morphNormals!==pt||je.morphColors!==mt||je.toneMapping!==$e||xe.isWebGL2===!0&&je.morphTargetsCount!==wt)&&(Ut=!0):(Ut=!0,je.__version=ie.version);let Cr=je.currentProgram;Ut===!0&&(Cr=Go(ie,j,P));let Hi=!1,Mt=!1,Mi=!1,lr=Cr.getUniforms(),un=je.uniforms;if(Le.useProgram(Cr.program)&&(Hi=!0,Mt=!0,Mi=!0),ie.id!==T&&(T=ie.id,Mt=!0),Hi||C!==O){lr.setValue(H,"projectionMatrix",O.projectionMatrix),lr.setValue(H,"viewMatrix",O.matrixWorldInverse);let Kr=lr.map.cameraPosition;Kr!==void 0&&Kr.setValue(H,se.setFromMatrixPosition(O.matrixWorld)),xe.logarithmicDepthBuffer&&lr.setValue(H,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&lr.setValue(H,"isOrthographic",O.isOrthographicCamera===!0),C!==O&&(C=O,Mt=!0,Mi=!0)}if(P.isSkinnedMesh){lr.setOptional(H,P,"bindMatrix"),lr.setOptional(H,P,"bindMatrixInverse");let Kr=P.skeleton;Kr&&(xe.floatVertexTextures?(Kr.boneTexture===null&&Kr.computeBoneTexture(),lr.setValue(H,"boneTexture",Kr.boneTexture,Ve)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}P.isBatchedMesh&&(lr.setOptional(H,P,"batchingTexture"),lr.setValue(H,"batchingTexture",P._matricesTexture,Ve));let du=re.morphAttributes;if((du.position!==void 0||du.normal!==void 0||du.color!==void 0&&xe.isWebGL2===!0)&&$.update(P,re,Cr),(Mt||je.receiveShadow!==P.receiveShadow)&&(je.receiveShadow=P.receiveShadow,lr.setValue(H,"receiveShadow",P.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(un.envMap.value=ce,un.flipEnvMap.value=ce.isCubeTexture&&ce.isRenderTargetTexture===!1?-1:1),Mt&&(lr.setValue(H,"toneMappingExposure",y.toneMappingExposure),je.needsLights&&E0(un,Mi),W&&ie.fog===!0&&he.refreshFogUniforms(un,W),he.refreshMaterialUniforms(un,ie,B,U,ae),_h.upload(H,Kh(je),un,Ve)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(_h.upload(H,Kh(je),un,Ve),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&lr.setValue(H,"center",P.center),lr.setValue(H,"modelViewMatrix",P.modelViewMatrix),lr.setValue(H,"normalMatrix",P.normalMatrix),lr.setValue(H,"modelMatrix",P.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){let Kr=ie.uniformsGroups;for(let mu=0,Jh=Kr.length;mu0&&Ve.useMultisampledRTT(O)===!1?P=Ne.get(O).__webglMultisampledFramebuffer:Array.isArray(Ge)?P=Ge[re]:P=Ge,b.copy(O.viewport),E.copy(O.scissor),I=O.scissorTest}else b.copy(G).multiplyScalar(B).floor(),E.copy(Y).multiplyScalar(B).floor(),I=J;if(Le.bindFramebuffer(H.FRAMEBUFFER,P)&&xe.drawBuffers&&ie&&Le.drawBuffers(O,P),Le.viewport(b),Le.scissor(E),Le.setScissorTest(I),W){let ce=Ne.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce.__webglTexture,re)}else if(ee){let ce=Ne.get(O.texture),Oe=j||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,ce.__webglTexture,re||0,Oe)}T=-1},this.readRenderTargetPixels=function(O,j,re,ie,P,W,ee){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Ne.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&ee!==void 0&&(ge=ge[ee]),ge){Le.bindFramebuffer(H.FRAMEBUFFER,ge);try{let ce=O.texture,Oe=ce.format,Ge=ce.type;if(Oe!==Rn&&Fe.convert(Oe)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Re=Ge===qu&&(_e.has("EXT_color_buffer_half_float")||xe.isWebGL2&&_e.has("EXT_color_buffer_float"));if(Ge!==Ro&&Fe.convert(Ge)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ge===ja&&(xe.isWebGL2||_e.has("OES_texture_float")||_e.has("WEBGL_color_buffer_float")))&&!Re){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=O.width-ie&&re>=0&&re<=O.height-P&&H.readPixels(j,re,ie,P,Fe.convert(Oe),Fe.convert(Ge),W)}finally{let ce=w!==null?Ne.get(w).__webglFramebuffer:null;Le.bindFramebuffer(H.FRAMEBUFFER,ce)}}},this.copyFramebufferToTexture=function(O,j,re=0){let ie=Math.pow(2,-re),P=Math.floor(j.image.width*ie),W=Math.floor(j.image.height*ie);Ve.setTexture2D(j,0),H.copyTexSubImage2D(H.TEXTURE_2D,re,0,0,O.x,O.y,P,W),Le.unbindTexture()},this.copyTextureToTexture=function(O,j,re,ie=0){let P=j.image.width,W=j.image.height,ee=Fe.convert(re.format),ge=Fe.convert(re.type);Ve.setTexture2D(re,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,re.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,re.unpackAlignment),j.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,P,W,ee,ge,j.image.data):j.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,j.mipmaps[0].width,j.mipmaps[0].height,ee,j.mipmaps[0].data):H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,ee,ge,j.image),ie===0&&re.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),Le.unbindTexture()},this.copyTextureToTexture3D=function(O,j,re,ie,P=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let W=Math.round(O.max.x-O.min.x),ee=Math.round(O.max.y-O.min.y),ge=O.max.z-O.min.z+1,ce=Fe.convert(ie.format),Oe=Fe.convert(ie.type),Ge;if(ie.isData3DTexture)Ve.setTexture3D(ie,0),Ge=H.TEXTURE_3D;else if(ie.isDataArrayTexture||ie.isCompressedArrayTexture)Ve.setTexture2DArray(ie,0),Ge=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,ie.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,ie.unpackAlignment);let Re=H.getParameter(H.UNPACK_ROW_LENGTH),pt=H.getParameter(H.UNPACK_IMAGE_HEIGHT),mt=H.getParameter(H.UNPACK_SKIP_PIXELS),$e=H.getParameter(H.UNPACK_SKIP_ROWS),at=H.getParameter(H.UNPACK_SKIP_IMAGES),wt=re.isCompressedTexture?re.mipmaps[P]:re.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,wt.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,wt.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,O.min.x),H.pixelStorei(H.UNPACK_SKIP_ROWS,O.min.y),H.pixelStorei(H.UNPACK_SKIP_IMAGES,O.min.z),re.isDataTexture||re.isData3DTexture?H.texSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,Oe,wt.data):ie.isCompressedArrayTexture?H.compressedTexSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,wt.data):H.texSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,Oe,wt),H.pixelStorei(H.UNPACK_ROW_LENGTH,Re),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,pt),H.pixelStorei(H.UNPACK_SKIP_PIXELS,mt),H.pixelStorei(H.UNPACK_SKIP_ROWS,$e),H.pixelStorei(H.UNPACK_SKIP_IMAGES,at),P===0&&ie.generateMipmaps&&H.generateMipmap(Ge),Le.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?Ve.setTextureCube(O,0):O.isData3DTexture?Ve.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?Ve.setTexture2DArray(O,0):Ve.setTexture2D(O,0),Le.unbindTexture()},this.resetState=function(){M=0,S=0,w=null,Le.reset(),we.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return $a}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===pg?"display-p3":"srgb",t.unpackColorSpace=Tr.workingColorSpace===vd?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}};var _S=class extends tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new fl,this.environmentRotation=new fl,this.overrideMaterial=null,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()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),t.object.environmentRotation=this.environmentRotation.toArray(),t}};var zA=class r extends ro{constructor(e=1,t=32,i=0,n=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},t=Math.max(3,t);let a=[],o=[],s=[],l=[],u=new be,c=new Kt;o.push(0,0,0),s.push(0,0,1),l.push(.5,.5);for(let f=0,h=3;f<=t;f++,h+=3){let p=i+f/t*n;u.x=e*Math.cos(p),u.y=e*Math.sin(p),o.push(u.x,u.y,u.z),s.push(0,0,1),c.x=(o[h]/e+1)/2,c.y=(o[h+1]/e+1)/2,l.push(c.x,c.y)}for(let f=1;f<=t;f++)a.push(f,f+1,0);this.setIndex(a),this.setAttribute("position",new Zn(o,3)),this.setAttribute("normal",new Zn(s,3)),this.setAttribute("uv",new Zn(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new r(e.radius,e.segments,e.thetaStart,e.thetaLength)}};var jg=class extends tn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new ir(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let 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}};var xS=class extends jg{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(tn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ir(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}};var aF=new Wr,Rie=new be,Lie=new be,FA=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Kt(512,512),this.map=null,this.mapPass=null,this.matrix=new Wr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new yh,this._frameExtents=new Kt(1,1),this._viewportCount=1,this._viewports=[new ni(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;Rie.setFromMatrixPosition(e.matrixWorld),t.position.copy(Rie),Lie.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Lie),t.updateMatrixWorld(),aF.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(aF),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(aF)}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(){let 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}};var BA=class extends FA{constructor(){super(new Gg(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}};var SS=class extends jg{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(tn.DEFAULT_UP),this.updateMatrix(),this.target=new tn,this.shadow=new BA}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}};var MS=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Pie(),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){let t=Pie();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function Pie(){return(typeof performance>"u"?Date:performance).now()}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:iS}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=iS);var Dse=zse(nae());var Uk="162";var FLe=0,aae=1,BLe=2;var qoe=1,kLe=2,mc=3,zh=0,fo=1,gc=2,Nh=0,s0=1,oae=2,sae=3,lae=4,VLe=5,fm=100,GLe=101,HLe=102,uae=103,cae=104,WLe=200,XLe=201,YLe=202,qLe=203,$B=204,QB=205,ZLe=206,jLe=207,KLe=208,JLe=209,$Le=210,QLe=211,ePe=212,tPe=213,rPe=214,iPe=0,nPe=1,aPe=2,tR=3,oPe=4,sPe=5,lPe=6,uPe=7,UR=0,cPe=1,fPe=2,Uh=0,hPe=1,pPe=2,dPe=3,mPe=4,vPe=5,gPe=6,yPe=7,fae="attached",_Pe="detached",hae=300,c0=301,f0=302,PM=303,ek=304,OR=306,h0=1e3,uo=1001,tk=1002,Dn=1003,pae=1004;var MM=1005;var lo=1006,vB=1007;var pm=1008;var Oh=1009,xPe=1010,SPe=1011,Ok=1012,Zoe=1013,Ih=1014,fu=1015,DM=1016,joe=1017,Koe=1018,dm=1020,MPe=1021,Cs=1023,bPe=1024,wPe=1025,mm=1026,p0=1027,TPe=1028,Joe=1029,EPe=1030,$oe=1031,Qoe=1033,gB=33776,yB=33777,_B=33778,xB=33779,dae=35840,mae=35841,vae=35842,gae=35843,ese=36196,yae=37492,_ae=37496,xae=37808,Sae=37809,Mae=37810,bae=37811,wae=37812,Tae=37813,Eae=37814,Aae=37815,Cae=37816,Rae=37817,Lae=37818,Pae=37819,Dae=37820,Iae=37821,SB=36492,Nae=36494,Uae=36495,APe=36283,Oae=36284,zae=36285,Fae=36286;var rR=2300,iR=2301,MB=2302,Bae=2400,kae=2401,Vae=2402,CPe=2500;var RPe=3200,LPe=3201,zk=0,PPe=1,Dh="",Ta="srgb",Xh="srgb-linear",Fk="display-p3",zR="display-p3-linear",nR="linear",oi="srgb",aR="rec709",oR="p3";var ky=7680;var Gae=519,DPe=512,IPe=513,NPe=514,tse=515,UPe=516,OPe=517,zPe=518,FPe=519,Hae=35044;var Wae="300 es",rk=1035,yc=2e3,sR=2001,Fh=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let n=i.slice(0);for(let a=0,o=n.length;a>8&255]+ta[r>>16&255]+ta[r>>24&255]+"-"+ta[e&255]+ta[e>>8&255]+"-"+ta[e>>16&15|64]+ta[e>>24&255]+"-"+ta[t&63|128]+ta[t>>8&255]+"-"+ta[t>>16&255]+ta[t>>24&255]+ta[i&255]+ta[i>>8&255]+ta[i>>16&255]+ta[i>>24&255]).toLowerCase()}function In(r,e,t){return Math.max(e,Math.min(t,r))}function Bk(r,e){return(r%e+e)%e}function BPe(r,e,t,i,n){return i+(r-e)*(n-i)/(t-e)}function kPe(r,e,t){return r!==e?(t-r)/(e-r):0}function RM(r,e,t){return(1-t)*r+t*e}function VPe(r,e,t,i){return RM(r,e,1-Math.exp(-t*i))}function GPe(r,e=1){return e-Math.abs(Bk(r,e*2)-e)}function HPe(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function WPe(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function XPe(r,e){return r+Math.floor(Math.random()*(e-r+1))}function YPe(r,e){return r+Math.random()*(e-r)}function qPe(r){return r*(.5-Math.random())}function ZPe(r){r!==void 0&&(Xae=r);let e=Xae+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function jPe(r){return r*CM}function KPe(r){return r*d0}function ik(r){return(r&r-1)===0&&r!==0}function JPe(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function lR(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $Pe(r,e,t,i,n){let a=Math.cos,o=Math.sin,s=a(t/2),l=o(t/2),u=a((e+i)/2),c=o((e+i)/2),f=a((e-i)/2),h=o((e-i)/2),p=a((i-e)/2),d=o((i-e)/2);switch(n){case"XYX":r.set(s*c,l*f,l*h,s*u);break;case"YZY":r.set(l*h,s*c,l*f,s*u);break;case"ZXZ":r.set(l*f,l*h,s*c,s*u);break;case"XZX":r.set(s*c,l*d,l*p,s*u);break;case"YXY":r.set(l*p,s*c,l*d,s*u);break;case"ZYZ":r.set(l*d,l*p,s*c,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function r0(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function ba(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var na={DEG2RAD:CM,RAD2DEG:d0,generateUUID:Yh,clamp:In,euclideanModulo:Bk,mapLinear:BPe,inverseLerp:kPe,lerp:RM,damp:VPe,pingpong:GPe,smoothstep:HPe,smootherstep:WPe,randInt:XPe,randFloat:YPe,randFloatSpread:qPe,seededRandom:ZPe,degToRad:jPe,radToDeg:KPe,isPowerOfTwo:ik,ceilPowerOfTwo:JPe,floorPowerOfTwo:lR,setQuaternionFromProperEuler:$Pe,normalize:ba,denormalize:r0},yr=class r{constructor(e=0,t=0){r.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(In(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),a=this.x-e.x,o=this.y-e.y;return this.x=a*i-o*n+e.x,this.y=a*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},dr=class r{constructor(e,t,i,n,a,o,s,l,u){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u)}set(e,t,i,n,a,o,s,l,u){let c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=a,c[5]=l,c[6]=i,c[7]=o,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[3],l=i[6],u=i[1],c=i[4],f=i[7],h=i[2],p=i[5],d=i[8],g=n[0],m=n[3],v=n[6],_=n[1],y=n[4],x=n[7],M=n[2],S=n[5],w=n[8];return a[0]=o*g+s*_+l*M,a[3]=o*m+s*y+l*S,a[6]=o*v+s*x+l*w,a[1]=u*g+c*_+f*M,a[4]=u*m+c*y+f*S,a[7]=u*v+c*x+f*w,a[2]=h*g+p*_+d*M,a[5]=h*m+p*y+d*S,a[8]=h*v+p*x+d*w,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t*o*c-t*s*u-i*a*c+i*s*l+n*a*u-n*o*l}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=c*o-s*u,h=s*l-c*a,p=u*a-o*l,d=t*f+i*h+n*p;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/d;return e[0]=f*g,e[1]=(n*u-c*i)*g,e[2]=(s*i-n*o)*g,e[3]=h*g,e[4]=(c*t-n*l)*g,e[5]=(n*a-s*t)*g,e[6]=p*g,e[7]=(i*l-u*t)*g,e[8]=(o*t-i*a)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,a,o,s){let l=Math.cos(a),u=Math.sin(a);return this.set(i*l,i*u,-i*(l*o+u*s)+o+e,-n*u,n*l,-n*(-u*o+l*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(bB.makeScale(e,t)),this}rotate(e){return this.premultiply(bB.makeRotation(-e)),this}translate(e,t){return this.premultiply(bB.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},bB=new dr;function rse(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function IM(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function QPe(){let r=IM("canvas");return r.style.display="block",r}var Yae={};function eDe(r){r in Yae||(Yae[r]=!0,console.warn(r))}var qae=new dr().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Zae=new dr().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),RC={[Xh]:{transfer:nR,primaries:aR,toReference:r=>r,fromReference:r=>r},[Ta]:{transfer:oi,primaries:aR,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[zR]:{transfer:nR,primaries:oR,toReference:r=>r.applyMatrix3(Zae),fromReference:r=>r.applyMatrix3(qae)},[Fk]:{transfer:oi,primaries:oR,toReference:r=>r.convertSRGBToLinear().applyMatrix3(Zae),fromReference:r=>r.applyMatrix3(qae).convertLinearToSRGB()}},tDe=new Set([Xh,zR]),$r={enabled:!0,_workingColorSpace:Xh,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!tDe.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;let i=RC[e].toReference,n=RC[t].fromReference;return n(i(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return RC[r].primaries},getTransfer:function(r){return r===Dh?nR:RC[r].transfer}};function l0(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wB(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var Vy,uR=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Vy===void 0&&(Vy=IM("canvas")),Vy.width=e.width,Vy.height=e.height;let i=Vy.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Vy}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=IM("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),a=n.data;for(let o=0;o{class r extends Fh{constructor(t=r.DEFAULT_IMAGE,i=r.DEFAULT_MAPPING,n=uo,a=uo,o=lo,s=pm,l=Cs,u=Oh,c=r.DEFAULT_ANISOTROPY,f=Dh){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:iDe++}),this.uuid=Yh(),this.name="",this.source=new cR(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=n,this.wrapT=a,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=u,this.offset=new yr(0,0),this.repeat=new yr(1,1),this.center=new yr(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new dr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=f,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),i||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==hae)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case h0:t.x=t.x-Math.floor(t.x);break;case uo:t.x=t.x<0?0:1;break;case tk:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case h0:t.y=t.y-Math.floor(t.y);break;case uo:t.y=t.y<0?0:1;break;case tk:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}}return r.DEFAULT_IMAGE=null,r.DEFAULT_MAPPING=hae,r.DEFAULT_ANISOTROPY=1,r})(),Rr=class r{constructor(e=0,t=0,i=0,n=1){r.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*a,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*a,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*a,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,a,l=e.elements,u=l[0],c=l[4],f=l[8],h=l[1],p=l[5],d=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(c-h)<.01&&Math.abs(f-g)<.01&&Math.abs(d-m)<.01){if(Math.abs(c+h)<.1&&Math.abs(f+g)<.1&&Math.abs(d+m)<.1&&Math.abs(u+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let y=(u+1)/2,x=(p+1)/2,M=(v+1)/2,S=(c+h)/4,w=(f+g)/4,T=(d+m)/4;return y>x&&y>M?y<.01?(i=0,n=.707106781,a=.707106781):(i=Math.sqrt(y),n=S/i,a=w/i):x>M?x<.01?(i=.707106781,n=0,a=.707106781):(n=Math.sqrt(x),i=S/n,a=T/n):M<.01?(i=.707106781,n=.707106781,a=0):(a=Math.sqrt(M),i=w/a,n=T/a),this.set(i,n,a,t),this}let _=Math.sqrt((m-d)*(m-d)+(f-g)*(f-g)+(h-c)*(h-c));return Math.abs(_)<.001&&(_=1),this.x=(m-d)/_,this.y=(f-g)/_,this.z=(h-c)/_,this.w=Math.acos((u+p+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},nk=class extends Fh{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Rr(0,0,e,t),this.scissorTest=!1,this.viewport=new Rr(0,0,e,t);let n={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:lo,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let a=new Vo(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);a.flipY=!1,a.generateMipmaps=i.generateMipmaps,a.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let s=0;s=0?1:-1,y=1-v*v;if(y>Number.EPSILON){let M=Math.sqrt(y),S=Math.atan2(M,v*_);m=Math.sin(m*S)/M,s=Math.sin(s*S)/M}let x=s*_;if(l=l*m+h*x,u=u*m+p*x,c=c*m+d*x,f=f*m+g*x,m===1-s){let M=1/Math.sqrt(l*l+u*u+c*c+f*f);l*=M,u*=M,c*=M,f*=M}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,n,a,o){let s=i[n],l=i[n+1],u=i[n+2],c=i[n+3],f=a[o],h=a[o+1],p=a[o+2],d=a[o+3];return e[t]=s*d+c*f+l*p-u*h,e[t+1]=l*d+c*h+u*f-s*p,e[t+2]=u*d+c*p+s*h-l*f,e[t+3]=c*d-s*f-l*h-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let i=e._x,n=e._y,a=e._z,o=e._order,s=Math.cos,l=Math.sin,u=s(i/2),c=s(n/2),f=s(a/2),h=l(i/2),p=l(n/2),d=l(a/2);switch(o){case"XYZ":this._x=h*c*f+u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f-h*p*d;break;case"YXZ":this._x=h*c*f+u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f+h*p*d;break;case"ZXY":this._x=h*c*f-u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f-h*p*d;break;case"ZYX":this._x=h*c*f-u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f+h*p*d;break;case"YZX":this._x=h*c*f+u*p*d,this._y=u*p*f+h*c*d,this._z=u*c*d-h*p*f,this._w=u*c*f-h*p*d;break;case"XZY":this._x=h*c*f-u*p*d,this._y=u*p*f-h*c*d,this._z=u*c*d+h*p*f,this._w=u*c*f+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],a=t[8],o=t[1],s=t[5],l=t[9],u=t[2],c=t[6],f=t[10],h=i+s+f;if(h>0){let p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(c-l)*p,this._y=(a-u)*p,this._z=(o-n)*p}else if(i>s&&i>f){let p=2*Math.sqrt(1+i-s-f);this._w=(c-l)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(a+u)/p}else if(s>f){let p=2*Math.sqrt(1+s-i-f);this._w=(a-u)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(l+c)/p}else{let p=2*Math.sqrt(1+f-i-s);this._w=(o-n)/p,this._x=(a+u)/p,this._y=(l+c)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(In(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,a=e._z,o=e._w,s=t._x,l=t._y,u=t._z,c=t._w;return this._x=i*c+o*s+n*u-a*l,this._y=n*c+o*l+a*s-i*u,this._z=a*c+o*u+i*l-n*s,this._w=o*c-i*s-n*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,n=this._y,a=this._z,o=this._w,s=o*e._w+i*e._x+n*e._y+a*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=n,this._z=a,this;let l=1-s*s;if(l<=Number.EPSILON){let p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*a+t*this._z,this.normalize(),this}let u=Math.sqrt(l),c=Math.atan2(u,s),f=Math.sin((1-t)*c)/u,h=Math.sin(t*c)/u;return this._w=o*f+this._w*h,this._x=i*f+this._x*h,this._y=n*f+this._y*h,this._z=a*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},ye=class r{constructor(e=0,t=0,i=0){r.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(jae.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(jae.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*n,this.y=a[1]*t+a[4]*i+a[7]*n,this.z=a[2]*t+a[5]*i+a[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=e.elements,o=1/(a[3]*t+a[7]*i+a[11]*n+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*n+a[12])*o,this.y=(a[1]*t+a[5]*i+a[9]*n+a[13])*o,this.z=(a[2]*t+a[6]*i+a[10]*n+a[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,a=e.x,o=e.y,s=e.z,l=e.w,u=2*(o*n-s*i),c=2*(s*t-a*n),f=2*(a*i-o*t);return this.x=t+l*u+o*f-s*c,this.y=i+l*c+s*u-a*f,this.z=n+l*f+a*c-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n,this.y=a[1]*t+a[5]*i+a[9]*n,this.z=a[2]*t+a[6]*i+a[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,a=e.z,o=t.x,s=t.y,l=t.z;return this.x=n*l-a*s,this.y=a*o-i*l,this.z=i*s-n*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return EB.copy(this).projectOnVector(e),this.sub(EB)}reflect(e){return this.sub(EB.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(In(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},EB=new ye,jae=new On,Bh=class{constructor(e=new ye(1/0,1/0,1/0),t=new ye(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}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&&this.min.z<=e.min.z&&e.max.z<=this.max.z}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),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,gl),gl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(bM),PC.subVectors(this.max,bM),Gy.subVectors(e.a,bM),Hy.subVectors(e.b,bM),Wy.subVectors(e.c,bM),Eh.subVectors(Hy,Gy),Ah.subVectors(Wy,Hy),nm.subVectors(Gy,Wy);let t=[0,-Eh.z,Eh.y,0,-Ah.z,Ah.y,0,-nm.z,nm.y,Eh.z,0,-Eh.x,Ah.z,0,-Ah.x,nm.z,0,-nm.x,-Eh.y,Eh.x,0,-Ah.y,Ah.x,0,-nm.y,nm.x,0];return!AB(t,Gy,Hy,Wy,PC)||(t=[1,0,0,0,1,0,0,0,1],!AB(t,Gy,Hy,Wy,PC))?!1:(DC.crossVectors(Eh,Ah),t=[DC.x,DC.y,DC.z],AB(t,Gy,Hy,Wy,PC))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,gl).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(gl).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(uc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),uc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),uc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),uc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),uc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),uc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),uc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),uc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(uc),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)}},uc=[new ye,new ye,new ye,new ye,new ye,new ye,new ye,new ye],gl=new ye,LC=new Bh,Gy=new ye,Hy=new ye,Wy=new ye,Eh=new ye,Ah=new ye,nm=new ye,bM=new ye,PC=new ye,DC=new ye,am=new ye;function AB(r,e,t,i,n){for(let a=0,o=r.length-3;a<=o;a+=3){am.fromArray(r,a);let s=n.x*Math.abs(am.x)+n.y*Math.abs(am.y)+n.z*Math.abs(am.z),l=e.dot(am),u=t.dot(am),c=i.dot(am);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var nDe=new Bh,wM=new ye,CB=new ye,kh=class{constructor(e=new ye,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):nDe.setFromPoints(e).getCenter(i);let n=0;for(let a=0,o=e.length;athis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;wM.subVectors(e,this.center);let t=wM.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector(wM,n/i),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(CB.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(wM.copy(e.center).add(CB)),this.expandByPoint(wM.copy(e.center).sub(CB))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},cc=new ye,RB=new ye,IC=new ye,Ch=new ye,LB=new ye,NC=new ye,PB=new ye,NM=class{constructor(e=new ye,t=new ye(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,cc)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=cc.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(cc.copy(this.origin).addScaledVector(this.direction,t),cc.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){RB.copy(e).add(t).multiplyScalar(.5),IC.copy(t).sub(e).normalize(),Ch.copy(this.origin).sub(RB);let a=e.distanceTo(t)*.5,o=-this.direction.dot(IC),s=Ch.dot(this.direction),l=-Ch.dot(IC),u=Ch.lengthSq(),c=Math.abs(1-o*o),f,h,p,d;if(c>0)if(f=o*l-s,h=o*s-l,d=a*c,f>=0)if(h>=-d)if(h<=d){let g=1/c;f*=g,h*=g,p=f*(f+o*h+2*s)+h*(o*f+h+2*l)+u}else h=a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;else h=-a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;else h<=-d?(f=Math.max(0,-(-o*a+s)),h=f>0?-a:Math.min(Math.max(-a,-l),a),p=-f*f+h*(h+2*l)+u):h<=d?(f=0,h=Math.min(Math.max(-a,-l),a),p=h*(h+2*l)+u):(f=Math.max(0,-(o*a+s)),h=f>0?a:Math.min(Math.max(-a,-l),a),p=-f*f+h*(h+2*l)+u);else h=o>0?-a:a,f=Math.max(0,-(o*h+s)),p=-f*f+h*(h+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,f),n&&n.copy(RB).addScaledVector(IC,h),p}intersectSphere(e,t){cc.subVectors(e.center,this.origin);let i=cc.dot(this.direction),n=cc.dot(cc)-i*i,a=e.radius*e.radius;if(n>a)return null;let o=Math.sqrt(a-n),s=i-o,l=i+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,a,o,s,l,u=1/this.direction.x,c=1/this.direction.y,f=1/this.direction.z,h=this.origin;return u>=0?(i=(e.min.x-h.x)*u,n=(e.max.x-h.x)*u):(i=(e.max.x-h.x)*u,n=(e.min.x-h.x)*u),c>=0?(a=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(a=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),i>o||a>n||((a>i||isNaN(i))&&(i=a),(o=0?(s=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(s=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||s>n)||((s>i||i!==i)&&(i=s),(l=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,cc)!==null}intersectTriangle(e,t,i,n,a){LB.subVectors(t,e),NC.subVectors(i,e),PB.crossVectors(LB,NC);let o=this.direction.dot(PB),s;if(o>0){if(n)return null;s=1}else if(o<0)s=-1,o=-o;else return null;Ch.subVectors(this.origin,e);let l=s*this.direction.dot(NC.crossVectors(Ch,NC));if(l<0)return null;let u=s*this.direction.dot(LB.cross(Ch));if(u<0||l+u>o)return null;let c=-s*Ch.dot(PB);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Ht=class r{constructor(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m)}set(e,t,i,n,a,o,s,l,u,c,f,h,p,d,g,m){let v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=a,v[5]=o,v[9]=s,v[13]=l,v[2]=u,v[6]=c,v[10]=f,v[14]=h,v[3]=p,v[7]=d,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/Xy.setFromMatrixColumn(e,0).length(),a=1/Xy.setFromMatrixColumn(e,1).length(),o=1/Xy.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,a=e.z,o=Math.cos(i),s=Math.sin(i),l=Math.cos(n),u=Math.sin(n),c=Math.cos(a),f=Math.sin(a);if(e.order==="XYZ"){let h=o*c,p=o*f,d=s*c,g=s*f;t[0]=l*c,t[4]=-l*f,t[8]=u,t[1]=p+d*u,t[5]=h-g*u,t[9]=-s*l,t[2]=g-h*u,t[6]=d+p*u,t[10]=o*l}else if(e.order==="YXZ"){let h=l*c,p=l*f,d=u*c,g=u*f;t[0]=h+g*s,t[4]=d*s-p,t[8]=o*u,t[1]=o*f,t[5]=o*c,t[9]=-s,t[2]=p*s-d,t[6]=g+h*s,t[10]=o*l}else if(e.order==="ZXY"){let h=l*c,p=l*f,d=u*c,g=u*f;t[0]=h-g*s,t[4]=-o*f,t[8]=d+p*s,t[1]=p+d*s,t[5]=o*c,t[9]=g-h*s,t[2]=-o*u,t[6]=s,t[10]=o*l}else if(e.order==="ZYX"){let h=o*c,p=o*f,d=s*c,g=s*f;t[0]=l*c,t[4]=d*u-p,t[8]=h*u+g,t[1]=l*f,t[5]=g*u+h,t[9]=p*u-d,t[2]=-u,t[6]=s*l,t[10]=o*l}else if(e.order==="YZX"){let h=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=g-h*f,t[8]=d*f+p,t[1]=f,t[5]=o*c,t[9]=-s*c,t[2]=-u*c,t[6]=p*f+d,t[10]=h-g*f}else if(e.order==="XZY"){let h=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=-f,t[8]=u*c,t[1]=h*f+g,t[5]=o*c,t[9]=p*f-d,t[2]=d*f-p,t[6]=s*c,t[10]=g*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(aDe,e,oDe)}lookAt(e,t,i){let n=this.elements;return Bo.subVectors(e,t),Bo.lengthSq()===0&&(Bo.z=1),Bo.normalize(),Rh.crossVectors(i,Bo),Rh.lengthSq()===0&&(Math.abs(i.z)===1?Bo.x+=1e-4:Bo.z+=1e-4,Bo.normalize(),Rh.crossVectors(i,Bo)),Rh.normalize(),UC.crossVectors(Bo,Rh),n[0]=Rh.x,n[4]=UC.x,n[8]=Bo.x,n[1]=Rh.y,n[5]=UC.y,n[9]=Bo.y,n[2]=Rh.z,n[6]=UC.z,n[10]=Bo.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[4],l=i[8],u=i[12],c=i[1],f=i[5],h=i[9],p=i[13],d=i[2],g=i[6],m=i[10],v=i[14],_=i[3],y=i[7],x=i[11],M=i[15],S=n[0],w=n[4],T=n[8],C=n[12],b=n[1],E=n[5],I=n[9],R=n[13],A=n[2],D=n[6],U=n[10],B=n[14],z=n[3],k=n[7],G=n[11],Y=n[15];return a[0]=o*S+s*b+l*A+u*z,a[4]=o*w+s*E+l*D+u*k,a[8]=o*T+s*I+l*U+u*G,a[12]=o*C+s*R+l*B+u*Y,a[1]=c*S+f*b+h*A+p*z,a[5]=c*w+f*E+h*D+p*k,a[9]=c*T+f*I+h*U+p*G,a[13]=c*C+f*R+h*B+p*Y,a[2]=d*S+g*b+m*A+v*z,a[6]=d*w+g*E+m*D+v*k,a[10]=d*T+g*I+m*U+v*G,a[14]=d*C+g*R+m*B+v*Y,a[3]=_*S+y*b+x*A+M*z,a[7]=_*w+y*E+x*D+M*k,a[11]=_*T+y*I+x*U+M*G,a[15]=_*C+y*R+x*B+M*Y,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],a=e[12],o=e[1],s=e[5],l=e[9],u=e[13],c=e[2],f=e[6],h=e[10],p=e[14],d=e[3],g=e[7],m=e[11],v=e[15];return d*(+a*l*f-n*u*f-a*s*h+i*u*h+n*s*p-i*l*p)+g*(+t*l*p-t*u*h+a*o*h-n*o*p+n*u*c-a*l*c)+m*(+t*u*f-t*s*p-a*o*f+i*o*p+a*s*c-i*u*c)+v*(-n*s*c-t*l*f+t*s*h+n*o*f-i*o*h+i*l*c)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],_=f*m*u-g*h*u+g*l*p-s*m*p-f*l*v+s*h*v,y=d*h*u-c*m*u-d*l*p+o*m*p+c*l*v-o*h*v,x=c*g*u-d*f*u+d*s*p-o*g*p-c*s*v+o*f*v,M=d*f*l-c*g*l-d*s*h+o*g*h+c*s*m-o*f*m,S=t*_+i*y+n*x+a*M;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/S;return e[0]=_*w,e[1]=(g*h*a-f*m*a-g*n*p+i*m*p+f*n*v-i*h*v)*w,e[2]=(s*m*a-g*l*a+g*n*u-i*m*u-s*n*v+i*l*v)*w,e[3]=(f*l*a-s*h*a-f*n*u+i*h*u+s*n*p-i*l*p)*w,e[4]=y*w,e[5]=(c*m*a-d*h*a+d*n*p-t*m*p-c*n*v+t*h*v)*w,e[6]=(d*l*a-o*m*a-d*n*u+t*m*u+o*n*v-t*l*v)*w,e[7]=(o*h*a-c*l*a+c*n*u-t*h*u-o*n*p+t*l*p)*w,e[8]=x*w,e[9]=(d*f*a-c*g*a-d*i*p+t*g*p+c*i*v-t*f*v)*w,e[10]=(o*g*a-d*s*a+d*i*u-t*g*u-o*i*v+t*s*v)*w,e[11]=(c*s*a-o*f*a-c*i*u+t*f*u+o*i*p-t*s*p)*w,e[12]=M*w,e[13]=(c*g*n-d*f*n+d*i*h-t*g*h-c*i*m+t*f*m)*w,e[14]=(d*s*n-o*g*n-d*i*l+t*g*l+o*i*m-t*s*m)*w,e[15]=(o*f*n-c*s*n+c*i*l-t*f*l-o*i*h+t*s*h)*w,this}scale(e){let t=this.elements,i=e.x,n=e.y,a=e.z;return t[0]*=i,t[4]*=n,t[8]*=a,t[1]*=i,t[5]*=n,t[9]*=a,t[2]*=i,t[6]*=n,t[10]*=a,t[3]*=i,t[7]*=n,t[11]*=a,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),a=1-i,o=e.x,s=e.y,l=e.z,u=a*o,c=a*s;return this.set(u*o+i,u*s-n*l,u*l+n*s,0,u*s+n*l,c*s+i,c*l-n*o,0,u*l-n*s,c*l+n*o,a*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,a,o){return this.set(1,i,a,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,a=t._x,o=t._y,s=t._z,l=t._w,u=a+a,c=o+o,f=s+s,h=a*u,p=a*c,d=a*f,g=o*c,m=o*f,v=s*f,_=l*u,y=l*c,x=l*f,M=i.x,S=i.y,w=i.z;return n[0]=(1-(g+v))*M,n[1]=(p+x)*M,n[2]=(d-y)*M,n[3]=0,n[4]=(p-x)*S,n[5]=(1-(h+v))*S,n[6]=(m+_)*S,n[7]=0,n[8]=(d+y)*w,n[9]=(m-_)*w,n[10]=(1-(h+g))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,a=Xy.set(n[0],n[1],n[2]).length(),o=Xy.set(n[4],n[5],n[6]).length(),s=Xy.set(n[8],n[9],n[10]).length();this.determinant()<0&&(a=-a),e.x=n[12],e.y=n[13],e.z=n[14],yl.copy(this);let u=1/a,c=1/o,f=1/s;return yl.elements[0]*=u,yl.elements[1]*=u,yl.elements[2]*=u,yl.elements[4]*=c,yl.elements[5]*=c,yl.elements[6]*=c,yl.elements[8]*=f,yl.elements[9]*=f,yl.elements[10]*=f,t.setFromRotationMatrix(yl),i.x=a,i.y=o,i.z=s,this}makePerspective(e,t,i,n,a,o,s=yc){let l=this.elements,u=2*a/(t-e),c=2*a/(i-n),f=(t+e)/(t-e),h=(i+n)/(i-n),p,d;if(s===yc)p=-(o+a)/(o-a),d=-2*o*a/(o-a);else if(s===sR)p=-o/(o-a),d=-o*a/(o-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=u,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=c,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=d,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,a,o,s=yc){let l=this.elements,u=1/(t-e),c=1/(i-n),f=1/(o-a),h=(t+e)*u,p=(i+n)*c,d,g;if(s===yc)d=(o+a)*f,g=-2*f;else if(s===sR)d=a*f,g=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=g,l[14]=-d,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},Xy=new ye,yl=new Ht,aDe=new ye(0,0,0),oDe=new ye(1,1,1),Rh=new ye,UC=new ye,Bo=new ye,Kae=new Ht,Jae=new On,zn=(()=>{class r{constructor(t=0,i=0,n=0,a=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=a}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,n,a=this._order){return this._x=t,this._y=i,this._z=n,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,n=!0){let a=t.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],f=a[9],h=a[2],p=a[6],d=a[10];switch(i){case"XYZ":this._y=Math.asin(In(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,d),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-In(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(l,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(In(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-In(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(In(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(l,d));break;case"XZY":this._z=Math.asin(-In(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-f,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,n){return Kae.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Kae,i,n)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return Jae.setFromEuler(this),this.setFromQuaternion(Jae,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return r.DEFAULT_ORDER="XYZ",r})(),hR=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<{class r extends Fh{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:sDe++}),this.uuid=Yh(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new ye,i=new zn,n=new On,a=new ye(1,1,1);function o(){n.setFromEuler(i,!1)}function s(){i.setFromQuaternion(n,void 0,!1)}i._onChange(o),n._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new Ht},normalMatrix:{value:new dr}}),this.matrix=new Ht,this.matrixWorld=new Ht,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new hR,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Yy.setFromAxisAngle(t,i),this.quaternion.multiply(Yy),this}rotateOnWorldAxis(t,i){return Yy.setFromAxisAngle(t,i),this.quaternion.premultiply(Yy),this}rotateX(t){return this.rotateOnAxis(Qae,t)}rotateY(t){return this.rotateOnAxis(eoe,t)}rotateZ(t){return this.rotateOnAxis(toe,t)}translateOnAxis(t,i){return $ae.copy(t).applyQuaternion(this.quaternion),this.position.add($ae.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(Qae,t)}translateY(t){return this.translateOnAxis(eoe,t)}translateZ(t){return this.translateOnAxis(toe,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(fc.copy(this.matrixWorld).invert())}lookAt(t,i,n){t.isVector3?OC.copy(t):OC.set(t,i,n);let a=this.parent;this.updateWorldMatrix(!0,!1),TM.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?fc.lookAt(TM,OC,this.up):fc.lookAt(OC,TM,this.up),this.quaternion.setFromRotationMatrix(fc),a&&(fc.extractRotation(a.matrixWorld),Yy.setFromRotationMatrix(fc),this.quaternion.premultiply(Yy.invert()))}add(t){if(arguments.length>1){for(let i=0;i1){for(let n=0;n0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.visibility=this._visibility,a.active=this._active,a.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),a.maxGeometryCount=this._maxGeometryCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.geometryCount=this._geometryCount,a.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(a.boundingSphere={center:a.boundingSphere.center.toArray(),radius:a.boundingSphere.radius}),this.boundingBox!==null&&(a.boundingBox={min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}));function o(l,u){return l[u.uuid]===void 0&&(l[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=o(t.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let u=l.shapes;if(Array.isArray(u))for(let c=0,f=u.length;c0){a.children=[];for(let l=0;l0){a.animations=[];for(let l=0;l0&&(n.geometries=l),u.length>0&&(n.materials=u),c.length>0&&(n.textures=c),f.length>0&&(n.images=f),h.length>0&&(n.shapes=h),p.length>0&&(n.skeletons=p),d.length>0&&(n.animations=d),g.length>0&&(n.nodes=g)}return n.object=a,n;function s(l){let u=[];for(let c in l){let f=l[c];delete f.metadata,u.push(f)}return u}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let n=0;n0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(e,t,i,n,a){_l.subVectors(n,t),hc.subVectors(i,t),NB.subVectors(e,t);let o=_l.dot(_l),s=_l.dot(hc),l=_l.dot(NB),u=hc.dot(hc),c=hc.dot(NB),f=o*u-s*s;if(f===0)return a.set(0,0,0),null;let h=1/f,p=(u*l-s*c)*h,d=(o*c-s*l)*h;return a.set(1-p-d,d,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,pc)===null?!1:pc.x>=0&&pc.y>=0&&pc.x+pc.y<=1}static getInterpolation(e,t,i,n,a,o,s,l){return this.getBarycoord(e,t,i,n,pc)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,pc.x),l.addScaledVector(o,pc.y),l.addScaledVector(s,pc.z),l)}static isFrontFacing(e,t,i,n){return _l.subVectors(i,t),hc.subVectors(e,t),_l.cross(hc).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return _l.subVectors(this.c,this.b),hc.subVectors(this.a,this.b),_l.cross(hc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return r.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return r.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,a){return r.getInterpolation(e,this.a,this.b,this.c,t,i,n,a)}containsPoint(e){return r.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return r.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,n=this.b,a=this.c,o,s;qy.subVectors(n,i),Zy.subVectors(a,i),UB.subVectors(e,i);let l=qy.dot(UB),u=Zy.dot(UB);if(l<=0&&u<=0)return t.copy(i);OB.subVectors(e,n);let c=qy.dot(OB),f=Zy.dot(OB);if(c>=0&&f<=c)return t.copy(n);let h=l*f-c*u;if(h<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(i).addScaledVector(qy,o);zB.subVectors(e,a);let p=qy.dot(zB),d=Zy.dot(zB);if(d>=0&&p<=d)return t.copy(a);let g=p*u-l*d;if(g<=0&&u>=0&&d<=0)return s=u/(u-d),t.copy(i).addScaledVector(Zy,s);let m=c*d-p*f;if(m<=0&&f-c>=0&&p-d>=0)return roe.subVectors(a,n),s=(f-c)/(f-c+(p-d)),t.copy(n).addScaledVector(roe,s);let v=1/(m+g+h);return o=g*v,s=h*v,t.copy(i).addScaledVector(qy,o).addScaledVector(Zy,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},ise={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Lh={h:0,s:0,l:0},zC={h:0,s:0,l:0};function FB(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}var tr=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ta){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,$r.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=$r.workingColorSpace){return this.r=e,this.g=t,this.b=i,$r.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=$r.workingColorSpace){if(e=Bk(e,1),t=In(t,0,1),i=In(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,o=2*i-a;this.r=FB(o,a,e+1/3),this.g=FB(o,a,e),this.b=FB(o,a,e-1/3)}return $r.toWorkingColorSpace(this,n),this}setStyle(e,t=Ta){function i(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let a,o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=n[1],o=a.length;if(o===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ta){let i=ise[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=l0(e.r),this.g=l0(e.g),this.b=l0(e.b),this}copyLinearToSRGB(e){return this.r=wB(e.r),this.g=wB(e.g),this.b=wB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ta){return $r.fromWorkingColorSpace(ra.copy(this),e),Math.round(In(ra.r*255,0,255))*65536+Math.round(In(ra.g*255,0,255))*256+Math.round(In(ra.b*255,0,255))}getHexString(e=Ta){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=$r.workingColorSpace){$r.fromWorkingColorSpace(ra.copy(this),t);let i=ra.r,n=ra.g,a=ra.b,o=Math.max(i,n,a),s=Math.min(i,n,a),l,u,c=(s+o)/2;if(s===o)l=0,u=0;else{let f=o-s;switch(u=c<=.5?f/(o+s):f/(2-o-s),o){case i:l=(n-a)/f+(n0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let n=this[t];if(n===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==s0&&(i.blending=this.blending),this.side!==zh&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==$B&&(i.blendSrc=this.blendSrc),this.blendDst!==QB&&(i.blendDst=this.blendDst),this.blendEquation!==fm&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==tR&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Gae&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ky&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ky&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ky&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function n(a){let o=[];for(let s in a){let l=a[s];delete l.metadata,o.push(l)}return o}if(t){let a=n(e.textures),o=n(e.images);a.length>0&&(i.textures=a),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let n=t.length;i=new Array(n);for(let a=0;a!==n;++a)i[a]=t[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},pR=class extends Sc{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new zn,this.combine=UR,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}};var Gi=new ye,FC=new yr,Rs=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Hae,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=fu,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return eDe("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,a=this.itemSize;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let l in i){let u=i[l];e.data.attributes[l]=u.toJSON(e.data)}let n={},a=!1;for(let l in this.morphAttributes){let u=this.morphAttributes[l],c=[];for(let f=0,h=u.length;f0&&(n[l]=c,a=!0)}a&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let n=e.attributes;for(let u in n){let c=n[u];this.setAttribute(u,c.clone(t))}let a=e.morphAttributes;for(let u in a){let c=[],f=a[u];for(let h=0,p=f.length;h0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a(e.far-e.near)**2))&&(ioe.copy(a).invert(),om.copy(e.ray).applyMatrix4(ioe),!(i.boundingBox!==null&&om.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,om)))}_computeIntersections(e,t,i){let n,a=this.geometry,o=this.material,s=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,f=a.attributes.normal,h=a.groups,p=a.drawRange;if(s!==null)if(Array.isArray(o))for(let d=0,g=h.length;dt.far?null:{distance:u,point:XC.clone(),object:r}}function YC(r,e,t,i,n,a,o,s,l,u){r.getVertexPosition(s,Ky),r.getVertexPosition(l,Jy),r.getVertexPosition(u,$y);let c=dDe(r,e,t,i,Ky,Jy,$y,WC);if(c){n&&(VC.fromBufferAttribute(n,s),GC.fromBufferAttribute(n,l),HC.fromBufferAttribute(n,u),c.uv=i0.getInterpolation(WC,Ky,Jy,$y,VC,GC,HC,new yr)),a&&(VC.fromBufferAttribute(a,s),GC.fromBufferAttribute(a,l),HC.fromBufferAttribute(a,u),c.uv1=i0.getInterpolation(WC,Ky,Jy,$y,VC,GC,HC,new yr)),o&&(aoe.fromBufferAttribute(o,s),ooe.fromBufferAttribute(o,l),soe.fromBufferAttribute(o,u),c.normal=i0.getInterpolation(WC,Ky,Jy,$y,aoe,ooe,soe,new ye),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let f={a:s,b:l,c:u,normal:new ye,materialIndex:0};i0.getNormal(Ky,Jy,$y,f.normal),c.face=f}return c}var UM=class r extends Ls{constructor(e=1,t=1,i=1,n=1,a=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:a,depthSegments:o};let s=this;n=Math.floor(n),a=Math.floor(a),o=Math.floor(o);let l=[],u=[],c=[],f=[],h=0,p=0;d("z","y","x",-1,-1,i,t,e,o,a,0),d("z","y","x",1,-1,i,t,-e,o,a,1),d("x","z","y",1,1,e,i,t,n,o,2),d("x","z","y",1,-1,e,i,-t,n,o,3),d("x","y","z",1,-1,e,t,i,n,a,4),d("x","y","z",-1,-1,e,t,-i,n,a,5),this.setIndex(l),this.setAttribute("position",new Un(u,3)),this.setAttribute("normal",new Un(c,3)),this.setAttribute("uv",new Un(f,2));function d(g,m,v,_,y,x,M,S,w,T,C){let b=x/w,E=M/T,I=x/2,R=M/2,A=S/2,D=w+1,U=T+1,B=0,z=0,k=new ye;for(let G=0;G0?1:-1,c.push(k.x,k.y,k.z),f.push(J/w),f.push(1-G/T),B+=1}}for(let G=0;G0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},dR=class extends ia{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ht,this.projectionMatrix=new Ht,this.projectionMatrixInverse=new Ht,this.coordinateSystem=_c}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Rh=new ye,ooe=new yr,soe=new yr,Nn=class extends dR{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=h0*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(AM*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return h0*2*Math.atan(Math.tan(AM*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Rh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Rh.x,Rh.y).multiplyScalar(-e/Rh.z),Rh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Rh.x,Rh.y).multiplyScalar(-e/Rh.z)}getViewSize(e,t){return this.getViewBounds(e,ooe,soe),t.subVectors(soe,ooe)}setViewOffset(e,t,i,n,a,o){this.aspect=e/t,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=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(AM*.5*this.fov)/this.zoom,i=2*t,n=this.aspect*i,a=-.5*n,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,u=o.fullHeight;a+=o.offsetX*n/l,t-=o.offsetY*i/u,n*=o.width/l,i*=o.height/u}let s=this.filmOffset;s!==0&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Jy=-90,$y=1,ak=class extends ia{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new Nn(Jy,$y,e,t);n.layers=this.layers,this.add(n);let a=new Nn(Jy,$y,e,t);a.layers=this.layers,this.add(a);let o=new Nn(Jy,$y,e,t);o.layers=this.layers,this.add(o);let s=new Nn(Jy,$y,e,t);s.layers=this.layers,this.add(s);let l=new Nn(Jy,$y,e,t);l.layers=this.layers,this.add(l);let u=new Nn(Jy,$y,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,a,o,s,l]=t;for(let u of t)this.remove(u);if(e===_c)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===oR)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,o,s,l,u,c]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;let g=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,a),e.setRenderTarget(i,1,n),e.render(t,o),e.setRenderTarget(i,2,n),e.render(t,s),e.setRenderTarget(i,3,n),e.render(t,l),e.setRenderTarget(i,4,n),e.render(t,u),i.texture.generateMipmaps=g,e.setRenderTarget(i,5,n),e.render(t,c),e.setRenderTarget(f,h,p),e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}},mR=class extends Vo{constructor(e,t,i,n,a,o,s,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:l0,super(e,t,i,n,a,o,s,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},ok=class extends Sc{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];this.texture=new mR(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:ao}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`,hu=class extends Sc{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=gDe,this.fragmentShader=yDe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=v0(e.uniforms),this.uniformsGroups=mDe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let o=this.uniforms[n].value;o&&o.isTexture?t.uniforms[n]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[n]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[n]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[n]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[n]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[n]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[n]={type:"m4",value:o.toArray()}:t.uniforms[n]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},mR=class extends ia{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ht,this.projectionMatrix=new Ht,this.projectionMatrixInverse=new Ht,this.coordinateSystem=yc}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Ph=new ye,loe=new yr,uoe=new yr,Nn=class extends mR{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=d0*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(CM*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return d0*2*Math.atan(Math.tan(CM*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Ph.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ph.x,Ph.y).multiplyScalar(-e/Ph.z),Ph.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Ph.x,Ph.y).multiplyScalar(-e/Ph.z)}getViewSize(e,t){return this.getViewBounds(e,loe,uoe),t.subVectors(uoe,loe)}setViewOffset(e,t,i,n,a,o){this.aspect=e/t,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=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(CM*.5*this.fov)/this.zoom,i=2*t,n=this.aspect*i,a=-.5*n,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,u=o.fullHeight;a+=o.offsetX*n/l,t-=o.offsetY*i/u,n*=o.width/l,i*=o.height/u}let s=this.filmOffset;s!==0&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Qy=-90,e0=1,ok=class extends ia{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new Nn(Qy,e0,e,t);n.layers=this.layers,this.add(n);let a=new Nn(Qy,e0,e,t);a.layers=this.layers,this.add(a);let o=new Nn(Qy,e0,e,t);o.layers=this.layers,this.add(o);let s=new Nn(Qy,e0,e,t);s.layers=this.layers,this.add(s);let l=new Nn(Qy,e0,e,t);l.layers=this.layers,this.add(l);let u=new Nn(Qy,e0,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,a,o,s,l]=t;for(let u of t)this.remove(u);if(e===yc)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===sR)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,o,s,l,u,c]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;let g=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,a),e.setRenderTarget(i,1,n),e.render(t,o),e.setRenderTarget(i,2,n),e.render(t,s),e.setRenderTarget(i,3,n),e.render(t,l),e.setRenderTarget(i,4,n),e.render(t,u),i.texture.generateMipmaps=g,e.setRenderTarget(i,5,n),e.render(t,c),e.setRenderTarget(f,h,p),e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}},vR=class extends Vo{constructor(e,t,i,n,a,o,s,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:c0,super(e,t,i,n,a,o,s,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},sk=class extends xc{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];this.texture=new vR(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:lo}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -8781,9 +8781,9 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},n=new NM(5,5,5),a=new pu({name:"CubemapFromEquirect",uniforms:d0(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:lo,blending:Dh});a.uniforms.tEquirect.value=t;let o=new so(n,a),s=t.minFilter;return t.minFilter===fm&&(t.minFilter=ao),new ak(1,10,this).update(e,o),t.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,n){let a=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,n);e.setRenderTarget(a)}},kB=new ye,gDe=new ye,yDe=new dr,gc=class{constructor(e=new ye(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=kB.subVectors(i,t).cross(gDe.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let i=e.delta(kB),n=this.normal.dot(i);if(n===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/n;return a<0||a>1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||yDe.getNormalMatrix(e),n=this.coplanarPoint(kB).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},am=new zh,YC=new ye,UM=class{constructor(e=new gc,t=new gc,i=new gc,n=new gc,a=new gc,o=new gc){this.planes=[e,t,i,n,a,o]}set(e,t,i,n,a,o){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(a),s[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=_c){let i=this.planes,n=e.elements,a=n[0],o=n[1],s=n[2],l=n[3],u=n[4],c=n[5],f=n[6],h=n[7],p=n[8],d=n[9],g=n[10],m=n[11],v=n[12],_=n[13],y=n[14],x=n[15];if(i[0].setComponents(l-a,h-u,m-p,x-v).normalize(),i[1].setComponents(l+a,h+u,m+p,x+v).normalize(),i[2].setComponents(l+o,h+c,m+d,x+_).normalize(),i[3].setComponents(l-o,h-c,m-d,x-_).normalize(),i[4].setComponents(l-s,h-f,m-g,x-y).normalize(),t===_c)i[5].setComponents(l+s,h+f,m+g,x+y).normalize();else if(t===oR)i[5].setComponents(s,f,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),am.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),am.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(am)}intersectsSprite(e){return am.center.set(0,0,0),am.radius=.7071067811865476,am.applyMatrix4(e.matrixWorld),this.intersectsSphere(am)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)0?e.max.x:e.min.x,YC.y=n.normal.y>0?e.max.y:e.min.y,YC.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(YC)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function ise(){let r=null,e=!1,t=null,i=null;function n(a,o){t(a,o),i=r.requestAnimationFrame(n)}return{start:function(){e!==!0&&t!==null&&(i=r.requestAnimationFrame(n),e=!0)},stop:function(){r.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){r=a}}}function _De(r,e){let t=e.isWebGL2,i=new WeakMap;function n(u,c){let f=u.array,h=u.usage,p=f.byteLength,d=r.createBuffer();r.bindBuffer(c,d),r.bufferData(c,f,h),u.onUploadCallback();let g;if(f instanceof Float32Array)g=r.FLOAT;else if(f instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=r.UNSIGNED_SHORT;else if(f instanceof Int16Array)g=r.SHORT;else if(f instanceof Uint32Array)g=r.UNSIGNED_INT;else if(f instanceof Int32Array)g=r.INT;else if(f instanceof Int8Array)g=r.BYTE;else if(f instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:d,type:g,bytesPerElement:f.BYTES_PER_ELEMENT,version:u.version,size:p}}function a(u,c,f){let h=c.array,p=c._updateRange,d=c.updateRanges;if(r.bindBuffer(f,u),p.count===-1&&d.length===0&&r.bufferSubData(f,0,h),d.length!==0){for(let g=0,m=d.length;g1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||xDe.getNormalMatrix(e),n=this.coplanarPoint(VB).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},sm=new kh,qC=new ye,OM=class{constructor(e=new vc,t=new vc,i=new vc,n=new vc,a=new vc,o=new vc){this.planes=[e,t,i,n,a,o]}set(e,t,i,n,a,o){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(a),s[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=yc){let i=this.planes,n=e.elements,a=n[0],o=n[1],s=n[2],l=n[3],u=n[4],c=n[5],f=n[6],h=n[7],p=n[8],d=n[9],g=n[10],m=n[11],v=n[12],_=n[13],y=n[14],x=n[15];if(i[0].setComponents(l-a,h-u,m-p,x-v).normalize(),i[1].setComponents(l+a,h+u,m+p,x+v).normalize(),i[2].setComponents(l+o,h+c,m+d,x+_).normalize(),i[3].setComponents(l-o,h-c,m-d,x-_).normalize(),i[4].setComponents(l-s,h-f,m-g,x-y).normalize(),t===yc)i[5].setComponents(l+s,h+f,m+g,x+y).normalize();else if(t===sR)i[5].setComponents(s,f,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),sm.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),sm.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(sm)}intersectsSprite(e){return sm.center.set(0,0,0),sm.radius=.7071067811865476,sm.applyMatrix4(e.matrixWorld),this.intersectsSphere(sm)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)0?e.max.x:e.min.x,qC.y=n.normal.y>0?e.max.y:e.min.y,qC.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(qC)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function ase(){let r=null,e=!1,t=null,i=null;function n(a,o){t(a,o),i=r.requestAnimationFrame(n)}return{start:function(){e!==!0&&t!==null&&(i=r.requestAnimationFrame(n),e=!0)},stop:function(){r.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){r=a}}}function SDe(r,e){let t=e.isWebGL2,i=new WeakMap;function n(u,c){let f=u.array,h=u.usage,p=f.byteLength,d=r.createBuffer();r.bindBuffer(c,d),r.bufferData(c,f,h),u.onUploadCallback();let g;if(f instanceof Float32Array)g=r.FLOAT;else if(f instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=r.UNSIGNED_SHORT;else if(f instanceof Int16Array)g=r.SHORT;else if(f instanceof Uint32Array)g=r.UNSIGNED_INT;else if(f instanceof Int32Array)g=r.INT;else if(f instanceof Int8Array)g=r.BYTE;else if(f instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:d,type:g,bytesPerElement:f.BYTES_PER_ELEMENT,version:u.version,size:p}}function a(u,c,f){let h=c.array,p=c._updateRange,d=c.updateRanges;if(r.bindBuffer(f,u),p.count===-1&&d.length===0&&r.bufferSubData(f,0,h),d.length!==0){for(let g=0,m=d.length;g 0 +#endif`,zDe=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -9013,26 +9013,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,ODe=`#if NUM_CLIPPING_PLANES > 0 +#endif`,FDe=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,FDe=`#if NUM_CLIPPING_PLANES > 0 +#endif`,BDe=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,zDe=`#if NUM_CLIPPING_PLANES > 0 +#endif`,kDe=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,BDe=`#if defined( USE_COLOR_ALPHA ) +#endif`,VDe=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,kDe=`#if defined( USE_COLOR_ALPHA ) +#endif`,GDe=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,VDe=`#if defined( USE_COLOR_ALPHA ) +#endif`,HDe=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,GDe=`#if defined( USE_COLOR_ALPHA ) +#endif`,WDe=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -9042,7 +9042,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,HDe=`#define PI 3.141592653589793 +#endif`,XDe=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -9120,7 +9120,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,WDe=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,YDe=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -9213,7 +9213,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,XDe=`vec3 transformedNormal = objectNormal; +#endif`,qDe=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -9242,18 +9242,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,YDe=`#ifdef USE_DISPLACEMENTMAP +#endif`,ZDe=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,qDe=`#ifdef USE_DISPLACEMENTMAP +#endif`,jDe=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,ZDe=`#ifdef USE_EMISSIVEMAP +#endif`,KDe=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,jDe=`#ifdef USE_EMISSIVEMAP +#endif`,JDe=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,KDe="gl_FragColor = linearToOutputTexel( gl_FragColor );",JDe=` +#endif`,$De="gl_FragColor = linearToOutputTexel( gl_FragColor );",QDe=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -9281,7 +9281,7 @@ vec4 LinearToLinear( in vec4 value ) { } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); -}`,$De=`#ifdef USE_ENVMAP +}`,e2e=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -9310,7 +9310,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,QDe=`#ifdef USE_ENVMAP +#endif`,t2e=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -9320,7 +9320,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,e2e=`#ifdef USE_ENVMAP +#endif`,r2e=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -9331,7 +9331,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,t2e=`#ifdef USE_ENVMAP +#endif`,i2e=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -9342,7 +9342,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,r2e=`#ifdef USE_ENVMAP +#endif`,n2e=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -9359,18 +9359,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,i2e=`#ifdef USE_FOG +#endif`,a2e=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,n2e=`#ifdef USE_FOG +#endif`,o2e=`#ifdef USE_FOG varying float vFogDepth; -#endif`,a2e=`#ifdef USE_FOG +#endif`,s2e=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,o2e=`#ifdef USE_FOG +#endif`,l2e=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -9379,7 +9379,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,s2e=`#ifdef USE_GRADIENTMAP +#endif`,u2e=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -9391,16 +9391,16 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,l2e=`#ifdef USE_LIGHTMAP +}`,c2e=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,u2e=`#ifdef USE_LIGHTMAP +#endif`,f2e=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,c2e=`LambertMaterial material; +#endif`,h2e=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,f2e=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,p2e=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -9414,7 +9414,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,h2e=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,d2e=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -9537,7 +9537,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,p2e=`#ifdef USE_ENVMAP +#endif`,m2e=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -9570,8 +9570,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,d2e=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,m2e=`varying vec3 vViewPosition; +#endif`,v2e=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,g2e=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -9583,11 +9583,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,v2e=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,y2e=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,g2e=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,_2e=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -9604,7 +9604,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,y2e=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,x2e=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -9687,7 +9687,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,_2e=`struct PhysicalMaterial { +#endif`,S2e=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -9987,7 +9987,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,x2e=` +}`,M2e=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -10102,7 +10102,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,S2e=`#if defined( RE_IndirectDiffuse ) +#endif`,b2e=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -10121,25 +10121,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,M2e=`#if defined( RE_IndirectDiffuse ) +#endif`,w2e=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,b2e=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,T2e=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,w2e=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,E2e=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,T2e=`#ifdef USE_LOGDEPTHBUF +#endif`,A2e=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,E2e=`#ifdef USE_LOGDEPTHBUF +#endif`,C2e=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -10149,16 +10149,16 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,A2e=`#ifdef USE_MAP +#endif`,R2e=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,C2e=`#ifdef USE_MAP +#endif`,L2e=`#ifdef USE_MAP uniform sampler2D map; -#endif`,R2e=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,P2e=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -10170,7 +10170,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,L2e=`#if defined( USE_POINTS_UV ) +#endif`,D2e=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -10182,19 +10182,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,P2e=`float metalnessFactor = metalness; +#endif`,I2e=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,D2e=`#ifdef USE_METALNESSMAP +#endif`,N2e=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,I2e=`#ifdef USE_INSTANCING_MORPH +#endif`,U2e=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[MORPHTARGETS_COUNT]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,N2e=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,O2e=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -10203,7 +10203,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,U2e=`#ifdef USE_MORPHNORMALS +#endif`,z2e=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -10215,7 +10215,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,O2e=`#ifdef USE_MORPHTARGETS +#endif`,F2e=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; #endif @@ -10239,7 +10239,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,F2e=`#ifdef USE_MORPHTARGETS +#endif`,B2e=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -10257,7 +10257,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,z2e=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,k2e=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -10298,7 +10298,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,B2e=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,V2e=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -10313,25 +10313,25 @@ vec3 nonPerturbedNormal = normal;`,B2e=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,k2e=`#ifndef FLAT_SHADED +#endif`,G2e=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,V2e=`#ifndef FLAT_SHADED +#endif`,H2e=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,G2e=`#ifndef FLAT_SHADED +#endif`,W2e=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,H2e=`#ifdef USE_NORMALMAP +#endif`,X2e=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -10353,13 +10353,13 @@ vec3 nonPerturbedNormal = normal;`,B2e=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,W2e=`#ifdef USE_CLEARCOAT +#endif`,Y2e=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,X2e=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,q2e=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Y2e=`#ifdef USE_CLEARCOATMAP +#endif`,Z2e=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -10368,18 +10368,18 @@ vec3 nonPerturbedNormal = normal;`,B2e=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,q2e=`#ifdef USE_IRIDESCENCEMAP +#endif`,j2e=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,Z2e=`#ifdef OPAQUE +#endif`,K2e=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,j2e=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,J2e=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -10420,9 +10420,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,K2e=`#ifdef PREMULTIPLIED_ALPHA +}`,$2e=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,J2e=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,Q2e=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -10430,22 +10430,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,$2e=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,eIe=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,Q2e=`#ifdef DITHERING +#endif`,tIe=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,eIe=`float roughnessFactor = roughness; +#endif`,rIe=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,tIe=`#ifdef USE_ROUGHNESSMAP +#endif`,iIe=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,rIe=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,nIe=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -10622,7 +10622,7 @@ gl_Position = projectionMatrix * mvPosition;`,$2e=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,iIe=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,aIe=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -10660,7 +10660,7 @@ gl_Position = projectionMatrix * mvPosition;`,$2e=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,nIe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,oIe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -10692,7 +10692,7 @@ gl_Position = projectionMatrix * mvPosition;`,$2e=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,aIe=`float getShadowMask() { +#endif`,sIe=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -10724,12 +10724,12 @@ gl_Position = projectionMatrix * mvPosition;`,$2e=`#ifdef DITHERING #endif #endif return shadow; -}`,oIe=`#ifdef USE_SKINNING +}`,lIe=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,sIe=`#ifdef USE_SKINNING +#endif`,uIe=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -10744,7 +10744,7 @@ gl_Position = projectionMatrix * mvPosition;`,$2e=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,lIe=`#ifdef USE_SKINNING +#endif`,cIe=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -10752,7 +10752,7 @@ gl_Position = projectionMatrix * mvPosition;`,$2e=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,uIe=`#ifdef USE_SKINNING +#endif`,fIe=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -10763,17 +10763,17 @@ gl_Position = projectionMatrix * mvPosition;`,$2e=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,cIe=`float specularStrength; +#endif`,hIe=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,fIe=`#ifdef USE_SPECULARMAP +#endif`,pIe=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,hIe=`#if defined( TONE_MAPPING ) +#endif`,dIe=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,pIe=`#ifndef saturate +#endif`,mIe=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -10870,7 +10870,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / (desaturation * (peak - newPeak) + 1.); return mix(color, vec3(1, 1, 1), g); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,dIe=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,vIe=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -10891,7 +10891,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,dIe=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,mIe=`#ifdef USE_TRANSMISSION +#endif`,gIe=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -10997,7 +10997,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,dIe=`#ifdef USE_TRANSMIS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,vIe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,yIe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -11067,7 +11067,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,dIe=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,gIe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,_Ie=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -11161,7 +11161,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,dIe=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,yIe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,xIe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -11232,7 +11232,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,dIe=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,_Ie=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,SIe=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -11241,12 +11241,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,dIe=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`,xIe=`varying vec2 vUv; +#endif`,MIe=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,SIe=`uniform sampler2D t2D; +}`,bIe=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -11258,14 +11258,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,MIe=`varying vec3 vWorldDirection; +}`,wIe=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,bIe=`#ifdef ENVMAP_TYPE_CUBE +}`,TIe=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -11288,14 +11288,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,wIe=`varying vec3 vWorldDirection; +}`,EIe=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,TIe=`uniform samplerCube tCube; +}`,AIe=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -11305,7 +11305,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,EIe=`#include +}`,CIe=`#include #include #include #include @@ -11332,7 +11332,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,AIe=`#if DEPTH_PACKING == 3200 +}`,RIe=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -11362,7 +11362,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,CIe=`#define DISTANCE +}`,LIe=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -11389,7 +11389,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,RIe=`#define DISTANCE +}`,PIe=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -11413,13 +11413,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,LIe=`varying vec3 vWorldDirection; +}`,DIe=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,PIe=`uniform sampler2D tEquirect; +}`,IIe=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -11428,7 +11428,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,DIe=`uniform float scale; +}`,NIe=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -11450,7 +11450,7 @@ void main() { #include #include #include -}`,IIe=`uniform vec3 diffuse; +}`,UIe=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -11478,7 +11478,7 @@ void main() { #include #include #include -}`,NIe=`#include +}`,OIe=`#include #include #include #include @@ -11510,7 +11510,7 @@ void main() { #include #include #include -}`,UIe=`uniform vec3 diffuse; +}`,zIe=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -11558,7 +11558,7 @@ void main() { #include #include #include -}`,OIe=`#define LAMBERT +}`,FIe=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -11597,7 +11597,7 @@ void main() { #include #include #include -}`,FIe=`#define LAMBERT +}`,BIe=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -11654,7 +11654,7 @@ void main() { #include #include #include -}`,zIe=`#define MATCAP +}`,kIe=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -11688,7 +11688,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,BIe=`#define MATCAP +}`,VIe=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -11734,7 +11734,7 @@ void main() { #include #include #include -}`,kIe=`#define NORMAL +}`,GIe=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -11767,7 +11767,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,VIe=`#define NORMAL +}`,HIe=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -11789,7 +11789,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,GIe=`#define PHONG +}`,WIe=`#define PHONG varying vec3 vViewPosition; #include #include @@ -11828,7 +11828,7 @@ void main() { #include #include #include -}`,HIe=`#define PHONG +}`,XIe=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -11887,7 +11887,7 @@ void main() { #include #include #include -}`,WIe=`#define STANDARD +}`,YIe=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -11930,7 +11930,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,XIe=`#define STANDARD +}`,qIe=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -12052,7 +12052,7 @@ void main() { #include #include #include -}`,YIe=`#define TOON +}`,ZIe=`#define TOON varying vec3 vViewPosition; #include #include @@ -12089,7 +12089,7 @@ void main() { #include #include #include -}`,qIe=`#define TOON +}`,jIe=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -12142,7 +12142,7 @@ void main() { #include #include #include -}`,ZIe=`uniform float size; +}`,KIe=`uniform float size; uniform float scale; #include #include @@ -12173,7 +12173,7 @@ void main() { #include #include #include -}`,jIe=`uniform vec3 diffuse; +}`,JIe=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -12198,7 +12198,7 @@ void main() { #include #include #include -}`,KIe=`#include +}`,$Ie=`#include #include #include #include @@ -12221,7 +12221,7 @@ void main() { #include #include #include -}`,JIe=`uniform vec3 color; +}`,QIe=`uniform vec3 color; uniform float opacity; #include #include @@ -12237,7 +12237,7 @@ void main() { #include #include #include -}`,$Ie=`uniform float rotation; +}`,eNe=`uniform float rotation; uniform vec2 center; #include #include @@ -12263,7 +12263,7 @@ void main() { #include #include #include -}`,QIe=`uniform vec3 diffuse; +}`,tNe=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -12288,7 +12288,7 @@ void main() { #include #include #include -}`,vr={alphahash_fragment:xDe,alphahash_pars_fragment:SDe,alphamap_fragment:MDe,alphamap_pars_fragment:bDe,alphatest_fragment:wDe,alphatest_pars_fragment:TDe,aomap_fragment:EDe,aomap_pars_fragment:ADe,batching_pars_vertex:CDe,batching_vertex:RDe,begin_vertex:LDe,beginnormal_vertex:PDe,bsdfs:DDe,iridescence_fragment:IDe,bumpmap_pars_fragment:NDe,clipping_planes_fragment:UDe,clipping_planes_pars_fragment:ODe,clipping_planes_pars_vertex:FDe,clipping_planes_vertex:zDe,color_fragment:BDe,color_pars_fragment:kDe,color_pars_vertex:VDe,color_vertex:GDe,common:HDe,cube_uv_reflection_fragment:WDe,defaultnormal_vertex:XDe,displacementmap_pars_vertex:YDe,displacementmap_vertex:qDe,emissivemap_fragment:ZDe,emissivemap_pars_fragment:jDe,colorspace_fragment:KDe,colorspace_pars_fragment:JDe,envmap_fragment:$De,envmap_common_pars_fragment:QDe,envmap_pars_fragment:e2e,envmap_pars_vertex:t2e,envmap_physical_pars_fragment:p2e,envmap_vertex:r2e,fog_vertex:i2e,fog_pars_vertex:n2e,fog_fragment:a2e,fog_pars_fragment:o2e,gradientmap_pars_fragment:s2e,lightmap_fragment:l2e,lightmap_pars_fragment:u2e,lights_lambert_fragment:c2e,lights_lambert_pars_fragment:f2e,lights_pars_begin:h2e,lights_toon_fragment:d2e,lights_toon_pars_fragment:m2e,lights_phong_fragment:v2e,lights_phong_pars_fragment:g2e,lights_physical_fragment:y2e,lights_physical_pars_fragment:_2e,lights_fragment_begin:x2e,lights_fragment_maps:S2e,lights_fragment_end:M2e,logdepthbuf_fragment:b2e,logdepthbuf_pars_fragment:w2e,logdepthbuf_pars_vertex:T2e,logdepthbuf_vertex:E2e,map_fragment:A2e,map_pars_fragment:C2e,map_particle_fragment:R2e,map_particle_pars_fragment:L2e,metalnessmap_fragment:P2e,metalnessmap_pars_fragment:D2e,morphinstance_vertex:I2e,morphcolor_vertex:N2e,morphnormal_vertex:U2e,morphtarget_pars_vertex:O2e,morphtarget_vertex:F2e,normal_fragment_begin:z2e,normal_fragment_maps:B2e,normal_pars_fragment:k2e,normal_pars_vertex:V2e,normal_vertex:G2e,normalmap_pars_fragment:H2e,clearcoat_normal_fragment_begin:W2e,clearcoat_normal_fragment_maps:X2e,clearcoat_pars_fragment:Y2e,iridescence_pars_fragment:q2e,opaque_fragment:Z2e,packing:j2e,premultiplied_alpha_fragment:K2e,project_vertex:J2e,dithering_fragment:$2e,dithering_pars_fragment:Q2e,roughnessmap_fragment:eIe,roughnessmap_pars_fragment:tIe,shadowmap_pars_fragment:rIe,shadowmap_pars_vertex:iIe,shadowmap_vertex:nIe,shadowmask_pars_fragment:aIe,skinbase_vertex:oIe,skinning_pars_vertex:sIe,skinning_vertex:lIe,skinnormal_vertex:uIe,specularmap_fragment:cIe,specularmap_pars_fragment:fIe,tonemapping_fragment:hIe,tonemapping_pars_fragment:pIe,transmission_fragment:dIe,transmission_pars_fragment:mIe,uv_pars_fragment:vIe,uv_pars_vertex:gIe,uv_vertex:yIe,worldpos_vertex:_Ie,background_vert:xIe,background_frag:SIe,backgroundCube_vert:MIe,backgroundCube_frag:bIe,cube_vert:wIe,cube_frag:TIe,depth_vert:EIe,depth_frag:AIe,distanceRGBA_vert:CIe,distanceRGBA_frag:RIe,equirect_vert:LIe,equirect_frag:PIe,linedashed_vert:DIe,linedashed_frag:IIe,meshbasic_vert:NIe,meshbasic_frag:UIe,meshlambert_vert:OIe,meshlambert_frag:FIe,meshmatcap_vert:zIe,meshmatcap_frag:BIe,meshnormal_vert:kIe,meshnormal_frag:VIe,meshphong_vert:GIe,meshphong_frag:HIe,meshphysical_vert:WIe,meshphysical_frag:XIe,meshtoon_vert:YIe,meshtoon_frag:qIe,points_vert:ZIe,points_frag:jIe,shadow_vert:KIe,shadow_frag:JIe,sprite_vert:$Ie,sprite_frag:QIe},yt={common:{diffuse:{value:new er(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new dr},alphaMap:{value:null},alphaMapTransform:{value:new dr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new dr}},envmap:{envMap:{value:null},envMapRotation:{value:new dr},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new dr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new dr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new dr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new dr},normalScale:{value:new yr(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new dr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new dr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new dr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new dr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new er(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 er(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new dr},alphaTest:{value:0},uvTransform:{value:new dr}},sprite:{diffuse:{value:new er(16777215)},opacity:{value:1},center:{value:new yr(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new dr},alphaMap:{value:null},alphaMapTransform:{value:new dr},alphaTest:{value:0}}},fu={basic:{uniforms:Sa([yt.common,yt.specularmap,yt.envmap,yt.aomap,yt.lightmap,yt.fog]),vertexShader:vr.meshbasic_vert,fragmentShader:vr.meshbasic_frag},lambert:{uniforms:Sa([yt.common,yt.specularmap,yt.envmap,yt.aomap,yt.lightmap,yt.emissivemap,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.fog,yt.lights,{emissive:{value:new er(0)}}]),vertexShader:vr.meshlambert_vert,fragmentShader:vr.meshlambert_frag},phong:{uniforms:Sa([yt.common,yt.specularmap,yt.envmap,yt.aomap,yt.lightmap,yt.emissivemap,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.fog,yt.lights,{emissive:{value:new er(0)},specular:{value:new er(1118481)},shininess:{value:30}}]),vertexShader:vr.meshphong_vert,fragmentShader:vr.meshphong_frag},standard:{uniforms:Sa([yt.common,yt.envmap,yt.aomap,yt.lightmap,yt.emissivemap,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.roughnessmap,yt.metalnessmap,yt.fog,yt.lights,{emissive:{value:new er(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:vr.meshphysical_vert,fragmentShader:vr.meshphysical_frag},toon:{uniforms:Sa([yt.common,yt.aomap,yt.lightmap,yt.emissivemap,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.gradientmap,yt.fog,yt.lights,{emissive:{value:new er(0)}}]),vertexShader:vr.meshtoon_vert,fragmentShader:vr.meshtoon_frag},matcap:{uniforms:Sa([yt.common,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.fog,{matcap:{value:null}}]),vertexShader:vr.meshmatcap_vert,fragmentShader:vr.meshmatcap_frag},points:{uniforms:Sa([yt.points,yt.fog]),vertexShader:vr.points_vert,fragmentShader:vr.points_frag},dashed:{uniforms:Sa([yt.common,yt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:vr.linedashed_vert,fragmentShader:vr.linedashed_frag},depth:{uniforms:Sa([yt.common,yt.displacementmap]),vertexShader:vr.depth_vert,fragmentShader:vr.depth_frag},normal:{uniforms:Sa([yt.common,yt.bumpmap,yt.normalmap,yt.displacementmap,{opacity:{value:1}}]),vertexShader:vr.meshnormal_vert,fragmentShader:vr.meshnormal_frag},sprite:{uniforms:Sa([yt.sprite,yt.fog]),vertexShader:vr.sprite_vert,fragmentShader:vr.sprite_frag},background:{uniforms:{uvTransform:{value:new dr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:vr.background_vert,fragmentShader:vr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new dr}},vertexShader:vr.backgroundCube_vert,fragmentShader:vr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:vr.cube_vert,fragmentShader:vr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:vr.equirect_vert,fragmentShader:vr.equirect_frag},distanceRGBA:{uniforms:Sa([yt.common,yt.displacementmap,{referencePosition:{value:new ye},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:vr.distanceRGBA_vert,fragmentShader:vr.distanceRGBA_frag},shadow:{uniforms:Sa([yt.lights,yt.fog,{color:{value:new er(0)},opacity:{value:1}}]),vertexShader:vr.shadow_vert,fragmentShader:vr.shadow_frag}};fu.physical={uniforms:Sa([fu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new dr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new dr},clearcoatNormalScale:{value:new yr(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new dr},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new dr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new dr},sheen:{value:0},sheenColor:{value:new er(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new dr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new dr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new dr},transmissionSamplerSize:{value:new yr},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new dr},attenuationDistance:{value:0},attenuationColor:{value:new er(0)},specularColor:{value:new er(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new dr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new dr},anisotropyVector:{value:new yr},anisotropyMap:{value:null},anisotropyMapTransform:{value:new dr}}]),vertexShader:vr.meshphysical_vert,fragmentShader:vr.meshphysical_frag};var qC={r:0,b:0,g:0},om=new Fn,eNe=new Ht;function tNe(r,e,t,i,n,a,o){let s=new er(0),l=a===!0?0:1,u,c,f=null,h=0,p=null;function d(m,v){let _=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y===null?g(s,l):y&&y.isColor&&(g(y,1),_=!0);let x=r.xr.getEnvironmentBlendMode();x==="additive"?i.buffers.color.setClear(0,0,0,1,o):x==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(r.autoClear||_)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===UR)?(c===void 0&&(c=new so(new NM(1,1,1),new pu({name:"BackgroundCubeMaterial",uniforms:d0(fu.backgroundCube.uniforms),vertexShader:fu.backgroundCube.vertexShader,fragmentShader:fu.backgroundCube.fragmentShader,side:lo,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(M,S,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),om.copy(v.backgroundRotation),om.x*=-1,om.y*=-1,om.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(om.y*=-1,om.z*=-1),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(eNe.makeRotationFromEuler(om)),c.material.toneMapped=Jr.getTransfer(y.colorSpace)!==ai,(f!==y||h!==y.version||p!==r.toneMapping)&&(c.material.needsUpdate=!0,f=y,h=y.version,p=r.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new so(new vR(2,2),new pu({name:"BackgroundMaterial",uniforms:d0(fu.background.uniforms),vertexShader:fu.background.vertexShader,fragmentShader:fu.background.fragmentShader,side:Uh,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=Jr.getTransfer(y.colorSpace)!==ai,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(f!==y||h!==y.version||p!==r.toneMapping)&&(u.material.needsUpdate=!0,f=y,h=y.version,p=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function g(m,v){m.getRGB(qC,rse(r)),i.buffers.color.setClear(qC.r,qC.g,qC.b,v,o)}return{getClearColor:function(){return s},setClearColor:function(m,v=1){s.set(m),l=v,g(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,g(s,l)},render:d}}function rNe(r,e,t,i){let n=r.getParameter(r.MAX_VERTEX_ATTRIBS),a=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||a!==null,s={},l=m(null),u=l,c=!1;function f(A,D,U,B,F){let k=!1;if(o){let G=g(B,U,D);u!==G&&(u=G,p(u.object)),k=v(A,B,U,F),k&&_(A,B,U,F)}else{let G=D.wireframe===!0;(u.geometry!==B.id||u.program!==U.id||u.wireframe!==G)&&(u.geometry=B.id,u.program=U.id,u.wireframe=G,k=!0)}F!==null&&t.update(F,r.ELEMENT_ARRAY_BUFFER),(k||c)&&(c=!1,T(A,D,U,B),F!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(F).buffer))}function h(){return i.isWebGL2?r.createVertexArray():a.createVertexArrayOES()}function p(A){return i.isWebGL2?r.bindVertexArray(A):a.bindVertexArrayOES(A)}function d(A){return i.isWebGL2?r.deleteVertexArray(A):a.deleteVertexArrayOES(A)}function g(A,D,U){let B=U.wireframe===!0,F=s[A.id];F===void 0&&(F={},s[A.id]=F);let k=F[D.id];k===void 0&&(k={},F[D.id]=k);let G=k[B];return G===void 0&&(G=m(h()),k[B]=G),G}function m(A){let D=[],U=[],B=[];for(let F=0;F=0){let V=F[J],K=k[J];if(K===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(K=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(K=A.instanceColor)),V===void 0||V.attribute!==K||K&&V.data!==K.data)return!0;G++}return u.attributesNum!==G||u.index!==B}function _(A,D,U,B){let F={},k=D.attributes,G=0,Y=U.getAttributes();for(let J in Y)if(Y[J].location>=0){let V=k[J];V===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(V=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(V=A.instanceColor));let K={};K.attribute=V,V&&V.data&&(K.data=V.data),F[J]=K,G++}u.attributes=F,u.attributesNum=G,u.index=B}function y(){let A=u.newAttributes;for(let D=0,U=A.length;D=0){let Q=F[Y];if(Q===void 0&&(Y==="instanceMatrix"&&A.instanceMatrix&&(Q=A.instanceMatrix),Y==="instanceColor"&&A.instanceColor&&(Q=A.instanceColor)),Q!==void 0){let V=Q.normalized,K=Q.itemSize,ae=t.get(Q);if(ae===void 0)continue;let ve=ae.buffer,ue=ae.type,se=ae.bytesPerElement,Ee=i.isWebGL2===!0&&(ue===r.INT||ue===r.UNSIGNED_INT||Q.gpuType===Yoe);if(Q.isInterleavedBufferAttribute){let q=Q.data,H=q.stride,We=Q.offset;if(q.isInstancedInterleavedBuffer){for(let _e=0;_e0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext",s=t.precision!==void 0?t.precision:"highp",l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);let u=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),h=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=r.getParameter(r.MAX_TEXTURE_SIZE),d=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),_=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),y=h>0,x=o||e.has("OES_texture_float"),M=y&&x,S=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:n,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:c,maxTextures:f,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:M,maxSamples:S}}function aNe(r){let e=this,t=null,i=0,n=!1,a=!1,o=new gc,s=new dr,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){let p=f.length!==0||h||i!==0||n;return n=h,i=f.length,p},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(f,h){t=c(f,h,0)},this.setState=function(f,h,p){let d=f.clippingPlanes,g=f.clipIntersection,m=f.clipShadows,v=r.get(f);if(!n||d===null||d.length===0||a&&!m)a?c(null):u();else{let _=a?0:i,y=_*4,x=v.clippingState||null;l.value=x,x=c(d,h,y,p);for(let M=0;M!==y;++M)x[M]=t[M];v.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(f,h,p,d){let g=f!==null?f.length:0,m=null;if(g!==0){if(m=l.value,d!==!0||m===null){let v=p+g*4,_=h.matrixWorldInverse;s.getNormalMatrix(_),(m===null||m.length0){let u=new ok(l.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",n),t(u.texture,o.mapping)}else return null}}return o}function n(o){let s=o.target;s.removeEventListener("dispose",n);let l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}var m0=class extends dR{constructor(e=-1,t=1,i=1,n=-1,a=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=a,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,n,a,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=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,a=i-e,o=i+e,s=n+t,l=n-t;if(this.view!==null&&this.view.enabled){let u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,o=a+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(a,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let 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}},r0=4,loe=[.125,.215,.35,.446,.526,.582],cm=20,VB=new m0,uoe=new er,GB=null,HB=0,WB=0,lm=(1+Math.sqrt(5))/2,Qy=1/lm,coe=[new ye(1,1,1),new ye(-1,1,1),new ye(1,1,-1),new ye(-1,1,-1),new ye(0,lm,Qy),new ye(0,lm,-Qy),new ye(Qy,0,lm),new ye(-Qy,0,lm),new ye(lm,Qy,0),new ye(-lm,Qy,0)],gR=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){GB=this._renderer.getRenderTarget(),HB=this._renderer.getActiveCubeFace(),WB=this._renderer.getActiveMipmapLevel(),this._setSize(256);let a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,i,n,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=poe(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=hoe(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?y:0,y,y),c.setRenderTarget(n),g&&c.render(d,s),c.render(e,s)}d.geometry.dispose(),d.material.dispose(),c.toneMapping=h,c.autoClear=f,e.background=m}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===l0||e.mapping===u0;n?(this._cubemapMaterial===null&&(this._cubemapMaterial=poe()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=hoe());let a=n?this._cubemapMaterial:this._equirectMaterial,o=new so(this._lodPlanes[0],a),s=a.uniforms;s.envMap.value=e;let l=this._cubeSize;ZC(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,VB)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;ncm&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${cm}`);let v=[],_=0;for(let w=0;wy-r0?n-y+r0:0),S=4*(this._cubeSize-x);ZC(t,M,S,3*x,2*x),l.setRenderTarget(t),l.render(f,VB)}};function sNe(r){let e=[],t=[],i=[],n=r,a=r-r0+1+loe.length;for(let o=0;or-r0?l=loe[o-r+r0-1]:o===0&&(l=0),i.push(l);let u=1/(s-2),c=-u,f=1+u,h=[c,c,f,c,f,f,c,c,f,f,c,f],p=6,d=6,g=3,m=2,v=1,_=new Float32Array(g*d*p),y=new Float32Array(m*d*p),x=new Float32Array(v*d*p);for(let S=0;S2?0:-1,C=[w,T,0,w+2/3,T,0,w+2/3,T+1,0,w,T,0,w+2/3,T+1,0,w,T+1,0];_.set(C,g*d*S),y.set(h,m*d*S);let b=[S,S,S,S,S,S];x.set(b,v*d*S)}let M=new Rs;M.setAttribute("position",new Cs(_,g)),M.setAttribute("uv",new Cs(y,m)),M.setAttribute("faceIndex",new Cs(x,v)),e.push(M),n>r0&&n--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function foe(r,e,t){let i=new Sc(r,e,t);return i.texture.mapping=UR,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ZC(r,e,t,i,n){r.viewport.set(e,t,i,n),r.scissor.set(e,t,i,n)}function lNe(r,e,t){let i=new Float32Array(cm),n=new ye(0,1,0);return new pu({name:"SphericalGaussianBlur",defines:{n:cm,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:Bk(),fragmentShader:` +}`,vr={alphahash_fragment:MDe,alphahash_pars_fragment:bDe,alphamap_fragment:wDe,alphamap_pars_fragment:TDe,alphatest_fragment:EDe,alphatest_pars_fragment:ADe,aomap_fragment:CDe,aomap_pars_fragment:RDe,batching_pars_vertex:LDe,batching_vertex:PDe,begin_vertex:DDe,beginnormal_vertex:IDe,bsdfs:NDe,iridescence_fragment:UDe,bumpmap_pars_fragment:ODe,clipping_planes_fragment:zDe,clipping_planes_pars_fragment:FDe,clipping_planes_pars_vertex:BDe,clipping_planes_vertex:kDe,color_fragment:VDe,color_pars_fragment:GDe,color_pars_vertex:HDe,color_vertex:WDe,common:XDe,cube_uv_reflection_fragment:YDe,defaultnormal_vertex:qDe,displacementmap_pars_vertex:ZDe,displacementmap_vertex:jDe,emissivemap_fragment:KDe,emissivemap_pars_fragment:JDe,colorspace_fragment:$De,colorspace_pars_fragment:QDe,envmap_fragment:e2e,envmap_common_pars_fragment:t2e,envmap_pars_fragment:r2e,envmap_pars_vertex:i2e,envmap_physical_pars_fragment:m2e,envmap_vertex:n2e,fog_vertex:a2e,fog_pars_vertex:o2e,fog_fragment:s2e,fog_pars_fragment:l2e,gradientmap_pars_fragment:u2e,lightmap_fragment:c2e,lightmap_pars_fragment:f2e,lights_lambert_fragment:h2e,lights_lambert_pars_fragment:p2e,lights_pars_begin:d2e,lights_toon_fragment:v2e,lights_toon_pars_fragment:g2e,lights_phong_fragment:y2e,lights_phong_pars_fragment:_2e,lights_physical_fragment:x2e,lights_physical_pars_fragment:S2e,lights_fragment_begin:M2e,lights_fragment_maps:b2e,lights_fragment_end:w2e,logdepthbuf_fragment:T2e,logdepthbuf_pars_fragment:E2e,logdepthbuf_pars_vertex:A2e,logdepthbuf_vertex:C2e,map_fragment:R2e,map_pars_fragment:L2e,map_particle_fragment:P2e,map_particle_pars_fragment:D2e,metalnessmap_fragment:I2e,metalnessmap_pars_fragment:N2e,morphinstance_vertex:U2e,morphcolor_vertex:O2e,morphnormal_vertex:z2e,morphtarget_pars_vertex:F2e,morphtarget_vertex:B2e,normal_fragment_begin:k2e,normal_fragment_maps:V2e,normal_pars_fragment:G2e,normal_pars_vertex:H2e,normal_vertex:W2e,normalmap_pars_fragment:X2e,clearcoat_normal_fragment_begin:Y2e,clearcoat_normal_fragment_maps:q2e,clearcoat_pars_fragment:Z2e,iridescence_pars_fragment:j2e,opaque_fragment:K2e,packing:J2e,premultiplied_alpha_fragment:$2e,project_vertex:Q2e,dithering_fragment:eIe,dithering_pars_fragment:tIe,roughnessmap_fragment:rIe,roughnessmap_pars_fragment:iIe,shadowmap_pars_fragment:nIe,shadowmap_pars_vertex:aIe,shadowmap_vertex:oIe,shadowmask_pars_fragment:sIe,skinbase_vertex:lIe,skinning_pars_vertex:uIe,skinning_vertex:cIe,skinnormal_vertex:fIe,specularmap_fragment:hIe,specularmap_pars_fragment:pIe,tonemapping_fragment:dIe,tonemapping_pars_fragment:mIe,transmission_fragment:vIe,transmission_pars_fragment:gIe,uv_pars_fragment:yIe,uv_pars_vertex:_Ie,uv_vertex:xIe,worldpos_vertex:SIe,background_vert:MIe,background_frag:bIe,backgroundCube_vert:wIe,backgroundCube_frag:TIe,cube_vert:EIe,cube_frag:AIe,depth_vert:CIe,depth_frag:RIe,distanceRGBA_vert:LIe,distanceRGBA_frag:PIe,equirect_vert:DIe,equirect_frag:IIe,linedashed_vert:NIe,linedashed_frag:UIe,meshbasic_vert:OIe,meshbasic_frag:zIe,meshlambert_vert:FIe,meshlambert_frag:BIe,meshmatcap_vert:kIe,meshmatcap_frag:VIe,meshnormal_vert:GIe,meshnormal_frag:HIe,meshphong_vert:WIe,meshphong_frag:XIe,meshphysical_vert:YIe,meshphysical_frag:qIe,meshtoon_vert:ZIe,meshtoon_frag:jIe,points_vert:KIe,points_frag:JIe,shadow_vert:$Ie,shadow_frag:QIe,sprite_vert:eNe,sprite_frag:tNe},yt={common:{diffuse:{value:new tr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new dr},alphaMap:{value:null},alphaMapTransform:{value:new dr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new dr}},envmap:{envMap:{value:null},envMapRotation:{value:new dr},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new dr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new dr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new dr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new dr},normalScale:{value:new yr(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new dr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new dr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new dr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new dr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tr(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 tr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new dr},alphaTest:{value:0},uvTransform:{value:new dr}},sprite:{diffuse:{value:new tr(16777215)},opacity:{value:1},center:{value:new yr(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new dr},alphaMap:{value:null},alphaMapTransform:{value:new dr},alphaTest:{value:0}}},cu={basic:{uniforms:wa([yt.common,yt.specularmap,yt.envmap,yt.aomap,yt.lightmap,yt.fog]),vertexShader:vr.meshbasic_vert,fragmentShader:vr.meshbasic_frag},lambert:{uniforms:wa([yt.common,yt.specularmap,yt.envmap,yt.aomap,yt.lightmap,yt.emissivemap,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.fog,yt.lights,{emissive:{value:new tr(0)}}]),vertexShader:vr.meshlambert_vert,fragmentShader:vr.meshlambert_frag},phong:{uniforms:wa([yt.common,yt.specularmap,yt.envmap,yt.aomap,yt.lightmap,yt.emissivemap,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.fog,yt.lights,{emissive:{value:new tr(0)},specular:{value:new tr(1118481)},shininess:{value:30}}]),vertexShader:vr.meshphong_vert,fragmentShader:vr.meshphong_frag},standard:{uniforms:wa([yt.common,yt.envmap,yt.aomap,yt.lightmap,yt.emissivemap,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.roughnessmap,yt.metalnessmap,yt.fog,yt.lights,{emissive:{value:new tr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:vr.meshphysical_vert,fragmentShader:vr.meshphysical_frag},toon:{uniforms:wa([yt.common,yt.aomap,yt.lightmap,yt.emissivemap,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.gradientmap,yt.fog,yt.lights,{emissive:{value:new tr(0)}}]),vertexShader:vr.meshtoon_vert,fragmentShader:vr.meshtoon_frag},matcap:{uniforms:wa([yt.common,yt.bumpmap,yt.normalmap,yt.displacementmap,yt.fog,{matcap:{value:null}}]),vertexShader:vr.meshmatcap_vert,fragmentShader:vr.meshmatcap_frag},points:{uniforms:wa([yt.points,yt.fog]),vertexShader:vr.points_vert,fragmentShader:vr.points_frag},dashed:{uniforms:wa([yt.common,yt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:vr.linedashed_vert,fragmentShader:vr.linedashed_frag},depth:{uniforms:wa([yt.common,yt.displacementmap]),vertexShader:vr.depth_vert,fragmentShader:vr.depth_frag},normal:{uniforms:wa([yt.common,yt.bumpmap,yt.normalmap,yt.displacementmap,{opacity:{value:1}}]),vertexShader:vr.meshnormal_vert,fragmentShader:vr.meshnormal_frag},sprite:{uniforms:wa([yt.sprite,yt.fog]),vertexShader:vr.sprite_vert,fragmentShader:vr.sprite_frag},background:{uniforms:{uvTransform:{value:new dr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:vr.background_vert,fragmentShader:vr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new dr}},vertexShader:vr.backgroundCube_vert,fragmentShader:vr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:vr.cube_vert,fragmentShader:vr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:vr.equirect_vert,fragmentShader:vr.equirect_frag},distanceRGBA:{uniforms:wa([yt.common,yt.displacementmap,{referencePosition:{value:new ye},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:vr.distanceRGBA_vert,fragmentShader:vr.distanceRGBA_frag},shadow:{uniforms:wa([yt.lights,yt.fog,{color:{value:new tr(0)},opacity:{value:1}}]),vertexShader:vr.shadow_vert,fragmentShader:vr.shadow_frag}};cu.physical={uniforms:wa([cu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new dr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new dr},clearcoatNormalScale:{value:new yr(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new dr},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new dr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new dr},sheen:{value:0},sheenColor:{value:new tr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new dr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new dr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new dr},transmissionSamplerSize:{value:new yr},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new dr},attenuationDistance:{value:0},attenuationColor:{value:new tr(0)},specularColor:{value:new tr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new dr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new dr},anisotropyVector:{value:new yr},anisotropyMap:{value:null},anisotropyMapTransform:{value:new dr}}]),vertexShader:vr.meshphysical_vert,fragmentShader:vr.meshphysical_frag};var ZC={r:0,b:0,g:0},lm=new zn,rNe=new Ht;function iNe(r,e,t,i,n,a,o){let s=new tr(0),l=a===!0?0:1,u,c,f=null,h=0,p=null;function d(m,v){let _=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y===null?g(s,l):y&&y.isColor&&(g(y,1),_=!0);let x=r.xr.getEnvironmentBlendMode();x==="additive"?i.buffers.color.setClear(0,0,0,1,o):x==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(r.autoClear||_)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===OR)?(c===void 0&&(c=new co(new UM(1,1,1),new hu({name:"BackgroundCubeMaterial",uniforms:v0(cu.backgroundCube.uniforms),vertexShader:cu.backgroundCube.vertexShader,fragmentShader:cu.backgroundCube.fragmentShader,side:fo,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(M,S,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),lm.copy(v.backgroundRotation),lm.x*=-1,lm.y*=-1,lm.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(lm.y*=-1,lm.z*=-1),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(rNe.makeRotationFromEuler(lm)),c.material.toneMapped=$r.getTransfer(y.colorSpace)!==oi,(f!==y||h!==y.version||p!==r.toneMapping)&&(c.material.needsUpdate=!0,f=y,h=y.version,p=r.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new co(new gR(2,2),new hu({name:"BackgroundMaterial",uniforms:v0(cu.background.uniforms),vertexShader:cu.background.vertexShader,fragmentShader:cu.background.fragmentShader,side:zh,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=$r.getTransfer(y.colorSpace)!==oi,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(f!==y||h!==y.version||p!==r.toneMapping)&&(u.material.needsUpdate=!0,f=y,h=y.version,p=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function g(m,v){m.getRGB(ZC,nse(r)),i.buffers.color.setClear(ZC.r,ZC.g,ZC.b,v,o)}return{getClearColor:function(){return s},setClearColor:function(m,v=1){s.set(m),l=v,g(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,g(s,l)},render:d}}function nNe(r,e,t,i){let n=r.getParameter(r.MAX_VERTEX_ATTRIBS),a=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||a!==null,s={},l=m(null),u=l,c=!1;function f(A,D,U,B,z){let k=!1;if(o){let G=g(B,U,D);u!==G&&(u=G,p(u.object)),k=v(A,B,U,z),k&&_(A,B,U,z)}else{let G=D.wireframe===!0;(u.geometry!==B.id||u.program!==U.id||u.wireframe!==G)&&(u.geometry=B.id,u.program=U.id,u.wireframe=G,k=!0)}z!==null&&t.update(z,r.ELEMENT_ARRAY_BUFFER),(k||c)&&(c=!1,T(A,D,U,B),z!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(z).buffer))}function h(){return i.isWebGL2?r.createVertexArray():a.createVertexArrayOES()}function p(A){return i.isWebGL2?r.bindVertexArray(A):a.bindVertexArrayOES(A)}function d(A){return i.isWebGL2?r.deleteVertexArray(A):a.deleteVertexArrayOES(A)}function g(A,D,U){let B=U.wireframe===!0,z=s[A.id];z===void 0&&(z={},s[A.id]=z);let k=z[D.id];k===void 0&&(k={},z[D.id]=k);let G=k[B];return G===void 0&&(G=m(h()),k[B]=G),G}function m(A){let D=[],U=[],B=[];for(let z=0;z=0){let V=z[J],K=k[J];if(K===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(K=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(K=A.instanceColor)),V===void 0||V.attribute!==K||K&&V.data!==K.data)return!0;G++}return u.attributesNum!==G||u.index!==B}function _(A,D,U,B){let z={},k=D.attributes,G=0,Y=U.getAttributes();for(let J in Y)if(Y[J].location>=0){let V=k[J];V===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(V=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(V=A.instanceColor));let K={};K.attribute=V,V&&V.data&&(K.data=V.data),z[J]=K,G++}u.attributes=z,u.attributesNum=G,u.index=B}function y(){let A=u.newAttributes;for(let D=0,U=A.length;D=0){let Q=z[Y];if(Q===void 0&&(Y==="instanceMatrix"&&A.instanceMatrix&&(Q=A.instanceMatrix),Y==="instanceColor"&&A.instanceColor&&(Q=A.instanceColor)),Q!==void 0){let V=Q.normalized,K=Q.itemSize,ae=t.get(Q);if(ae===void 0)continue;let ve=ae.buffer,ue=ae.type,se=ae.bytesPerElement,Ee=i.isWebGL2===!0&&(ue===r.INT||ue===r.UNSIGNED_INT||Q.gpuType===Zoe);if(Q.isInterleavedBufferAttribute){let q=Q.data,H=q.stride,We=Q.offset;if(q.isInstancedInterleavedBuffer){for(let _e=0;_e0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext",s=t.precision!==void 0?t.precision:"highp",l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);let u=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),h=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=r.getParameter(r.MAX_TEXTURE_SIZE),d=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),_=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),y=h>0,x=o||e.has("OES_texture_float"),M=y&&x,S=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:n,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:c,maxTextures:f,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:M,maxSamples:S}}function sNe(r){let e=this,t=null,i=0,n=!1,a=!1,o=new vc,s=new dr,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){let p=f.length!==0||h||i!==0||n;return n=h,i=f.length,p},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(f,h){t=c(f,h,0)},this.setState=function(f,h,p){let d=f.clippingPlanes,g=f.clipIntersection,m=f.clipShadows,v=r.get(f);if(!n||d===null||d.length===0||a&&!m)a?c(null):u();else{let _=a?0:i,y=_*4,x=v.clippingState||null;l.value=x,x=c(d,h,y,p);for(let M=0;M!==y;++M)x[M]=t[M];v.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(f,h,p,d){let g=f!==null?f.length:0,m=null;if(g!==0){if(m=l.value,d!==!0||m===null){let v=p+g*4,_=h.matrixWorldInverse;s.getNormalMatrix(_),(m===null||m.length0){let u=new sk(l.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",n),t(u.texture,o.mapping)}else return null}}return o}function n(o){let s=o.target;s.removeEventListener("dispose",n);let l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}var g0=class extends mR{constructor(e=-1,t=1,i=1,n=-1,a=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=a,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,n,a,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=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,a=i-e,o=i+e,s=n+t,l=n-t;if(this.view!==null&&this.view.enabled){let u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,o=a+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(a,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let 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}},n0=4,coe=[.125,.215,.35,.446,.526,.582],hm=20,GB=new g0,foe=new tr,HB=null,WB=0,XB=0,cm=(1+Math.sqrt(5))/2,t0=1/cm,hoe=[new ye(1,1,1),new ye(-1,1,1),new ye(1,1,-1),new ye(-1,1,-1),new ye(0,cm,t0),new ye(0,cm,-t0),new ye(t0,0,cm),new ye(-t0,0,cm),new ye(cm,t0,0),new ye(-cm,t0,0)],yR=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){HB=this._renderer.getRenderTarget(),WB=this._renderer.getActiveCubeFace(),XB=this._renderer.getActiveMipmapLevel(),this._setSize(256);let a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,i,n,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=moe(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=doe(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?y:0,y,y),c.setRenderTarget(n),g&&c.render(d,s),c.render(e,s)}d.geometry.dispose(),d.material.dispose(),c.toneMapping=h,c.autoClear=f,e.background=m}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===c0||e.mapping===f0;n?(this._cubemapMaterial===null&&(this._cubemapMaterial=moe()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=doe());let a=n?this._cubemapMaterial:this._equirectMaterial,o=new co(this._lodPlanes[0],a),s=a.uniforms;s.envMap.value=e;let l=this._cubeSize;jC(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,GB)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;nhm&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${hm}`);let v=[],_=0;for(let w=0;wy-n0?n-y+n0:0),S=4*(this._cubeSize-x);jC(t,M,S,3*x,2*x),l.setRenderTarget(t),l.render(f,GB)}};function uNe(r){let e=[],t=[],i=[],n=r,a=r-n0+1+coe.length;for(let o=0;or-n0?l=coe[o-r+n0-1]:o===0&&(l=0),i.push(l);let u=1/(s-2),c=-u,f=1+u,h=[c,c,f,c,f,f,c,c,f,f,c,f],p=6,d=6,g=3,m=2,v=1,_=new Float32Array(g*d*p),y=new Float32Array(m*d*p),x=new Float32Array(v*d*p);for(let S=0;S2?0:-1,C=[w,T,0,w+2/3,T,0,w+2/3,T+1,0,w,T,0,w+2/3,T+1,0,w,T+1,0];_.set(C,g*d*S),y.set(h,m*d*S);let b=[S,S,S,S,S,S];x.set(b,v*d*S)}let M=new Ls;M.setAttribute("position",new Rs(_,g)),M.setAttribute("uv",new Rs(y,m)),M.setAttribute("faceIndex",new Rs(x,v)),e.push(M),n>n0&&n--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function poe(r,e,t){let i=new xc(r,e,t);return i.texture.mapping=OR,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function jC(r,e,t,i,n){r.viewport.set(e,t,i,n),r.scissor.set(e,t,i,n)}function cNe(r,e,t){let i=new Float32Array(hm),n=new ye(0,1,0);return new hu({name:"SphericalGaussianBlur",defines:{n:hm,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:kk(),fragmentShader:` precision mediump float; precision mediump int; @@ -12348,7 +12348,7 @@ void main() { } } - `,blending:Dh,depthTest:!1,depthWrite:!1})}function hoe(){return new pu({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Bk(),fragmentShader:` + `,blending:Nh,depthTest:!1,depthWrite:!1})}function doe(){return new hu({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:kk(),fragmentShader:` precision mediump float; precision mediump int; @@ -12367,7 +12367,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:Dh,depthTest:!1,depthWrite:!1})}function poe(){return new pu({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Bk(),fragmentShader:` + `,blending:Nh,depthTest:!1,depthWrite:!1})}function moe(){return new hu({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:kk(),fragmentShader:` precision mediump float; precision mediump int; @@ -12383,7 +12383,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:Dh,depthTest:!1,depthWrite:!1})}function Bk(){return` + `,blending:Nh,depthTest:!1,depthWrite:!1})}function kk(){return` precision mediump float; precision mediump int; @@ -12438,16 +12438,16 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function uNe(r){let e=new WeakMap,t=null;function i(s){if(s&&s.isTexture){let l=s.mapping,u=l===LM||l===QB,c=l===l0||l===u0;if(u||c)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let f=e.get(s);return t===null&&(t=new gR(r)),f=u?t.fromEquirectangular(s,f):t.fromCubemap(s,f),e.set(s,f),f.texture}else{if(e.has(s))return e.get(s).texture;{let f=s.image;if(u&&f&&f.height>0||c&&f&&n(f)){t===null&&(t=new gR(r));let h=u?t.fromEquirectangular(s):t.fromCubemap(s);return e.set(s,h),s.addEventListener("dispose",a),h.texture}else return null}}}return s}function n(s){let l=0,u=6;for(let c=0;ce.maxTextureSize&&(C=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let b=new Float32Array(T*C*4*g),E=new cR(b,T,C,g);E.type=hu,E.needsUpdate=!0;let I=w*4;for(let A=0;A0)return r;let n=e*t,a=doe[n];if(a===void 0&&(a=new Float32Array(n),doe[n]=a),e!==0){i.toArray(a,0);for(let o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function sn(r,e){if(r.length!==e.length)return!1;for(let t=0,i=r.length;t0||c&&f&&n(f)){t===null&&(t=new yR(r));let h=u?t.fromEquirectangular(s):t.fromCubemap(s);return e.set(s,h),s.addEventListener("dispose",a),h.texture}else return null}}}return s}function n(s){let l=0,u=6;for(let c=0;ce.maxTextureSize&&(C=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let b=new Float32Array(T*C*4*g),E=new fR(b,T,C,g);E.type=fu,E.needsUpdate=!0;let I=w*4;for(let A=0;A0)return r;let n=e*t,a=voe[n];if(a===void 0&&(a=new Float32Array(n),voe[n]=a),e!==0){i.toArray(a,0);for(let o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function sn(r,e){if(r.length!==e.length)return!1;for(let t=0,i=r.length;t":" "} ${s}: ${t[o]}`)}return i.join(` -`)}function lUe(r){let e=Jr.getPrimaries(Jr.workingColorSpace),t=Jr.getPrimaries(r),i;switch(e===t?i="":e===aR&&t===nR?i="LinearDisplayP3ToLinearSRGB":e===nR&&t===aR&&(i="LinearSRGBToLinearDisplayP3"),r){case Hh:case OR:return[i,"LinearTransferOETF"];case Ma:case Fk:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[i,"LinearTransferOETF"]}}function Soe(r,e,t){let i=r.getShaderParameter(e,r.COMPILE_STATUS),n=r.getShaderInfoLog(e).trim();if(i&&n==="")return"";let a=/ERROR: 0:(\d+)/.exec(n);if(a){let o=parseInt(a[1]);return t.toUpperCase()+` +`)}function cUe(r){let e=$r.getPrimaries($r.workingColorSpace),t=$r.getPrimaries(r),i;switch(e===t?i="":e===oR&&t===aR?i="LinearDisplayP3ToLinearSRGB":e===aR&&t===oR&&(i="LinearSRGBToLinearDisplayP3"),r){case Xh:case zR:return[i,"LinearTransferOETF"];case Ta:case Fk:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[i,"LinearTransferOETF"]}}function boe(r,e,t){let i=r.getShaderParameter(e,r.COMPILE_STATUS),n=r.getShaderInfoLog(e).trim();if(i&&n==="")return"";let a=/ERROR: 0:(\d+)/.exec(n);if(a){let o=parseInt(a[1]);return t.toUpperCase()+` `+n+` -`+sUe(r.getShaderSource(e),o)}else return n}function uUe(r,e){let t=lUe(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function cUe(r,e){let t;switch(e){case cPe:t="Linear";break;case fPe:t="Reinhard";break;case hPe:t="OptimizedCineon";break;case pPe:t="ACESFilmic";break;case mPe:t="AgX";break;case vPe:t="Neutral";break;case dPe:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function fUe(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.normalMapTangentSpace||r.clearcoatNormalMap||r.flatShading||r.alphaToCoverage||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(i0).join(` -`)}function hUe(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(i0).join(` -`)}function pUe(r){let e=[];for(let t in r){let i=r[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function dUe(r,e){let t={},i=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let n=0;n/gm;function ck(r){return r.replace(mUe,gUe)}var vUe=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function gUe(r,e){let t=vr[e];if(t===void 0){let i=vUe.get(e);if(i!==void 0)t=vr[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return ck(t)}var yUe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function woe(r){return r.replace(yUe,_Ue)}function _Ue(r,e,t,i){let n="";for(let a=parseInt(e);a/gm;function fk(r){return r.replace(gUe,_Ue)}var yUe=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function _Ue(r,e){let t=vr[e];if(t===void 0){let i=yUe.get(e);if(i!==void 0)t=vr[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return fk(t)}var xUe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Eoe(r){return r.replace(xUe,SUe)}function SUe(r,e,t,i){let n="";for(let a=parseInt(e);a0&&(v+=` -`),_=[p,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(i0).join(` +`),_=[p,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(a0).join(` `),_.length>0&&(_+=` -`)):(v=[Toe(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(i0).join(` -`),_=[p,Toe(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ih?"#define TONE_MAPPING":"",t.toneMapping!==Ih?vr.tonemapping_pars_fragment:"",t.toneMapping!==Ih?cUe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",vr.colorspace_pars_fragment,uUe("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(i0).join(` -`)),o=ck(o),o=Moe(o,t),o=boe(o,t),s=ck(s),s=Moe(s,t),s=boe(s,t),o=woe(o),s=woe(s),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es +`)):(v=[Aoe(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(a0).join(` +`),_=[p,Aoe(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Uh?"#define TONE_MAPPING":"",t.toneMapping!==Uh?vr.tonemapping_pars_fragment:"",t.toneMapping!==Uh?hUe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",vr.colorspace_pars_fragment,fUe("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(a0).join(` +`)),o=fk(o),o=woe(o,t),o=Toe(o,t),s=fk(s),s=woe(s,t),s=Toe(s,t),o=Eoe(o),s=Eoe(s),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es `,v=[d,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+v,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===Gae?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Gae?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+v,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===Wae?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Wae?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+_);let x=y+v+o,M=y+_+s,S=xoe(n,n.VERTEX_SHADER,x),w=xoe(n,n.FRAGMENT_SHADER,M);n.attachShader(m,S),n.attachShader(m,w),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);function T(I){if(r.debug.checkShaderErrors){let R=n.getProgramInfoLog(m).trim(),A=n.getShaderInfoLog(S).trim(),D=n.getShaderInfoLog(w).trim(),U=!0,B=!0;if(n.getProgramParameter(m,n.LINK_STATUS)===!1)if(U=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(n,m,S,w);else{let F=Soe(n,S,"vertex"),k=Soe(n,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(m,n.VALIDATE_STATUS)+` +`+_);let x=y+v+o,M=y+_+s,S=Moe(n,n.VERTEX_SHADER,x),w=Moe(n,n.FRAGMENT_SHADER,M);n.attachShader(m,S),n.attachShader(m,w),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);function T(I){if(r.debug.checkShaderErrors){let R=n.getProgramInfoLog(m).trim(),A=n.getShaderInfoLog(S).trim(),D=n.getShaderInfoLog(w).trim(),U=!0,B=!0;if(n.getProgramParameter(m,n.LINK_STATUS)===!1)if(U=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(n,m,S,w);else{let z=boe(n,S,"vertex"),k=boe(n,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(m,n.VALIDATE_STATUS)+` Material Name: `+I.name+` Material Type: `+I.type+` Program Info Log: `+R+` -`+F+` -`+k)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(A===""||D==="")&&(B=!1);B&&(I.diagnostics={runnable:U,programLog:R,vertexShader:{log:A,prefix:v},fragmentShader:{log:D,prefix:_}})}n.deleteShader(S),n.deleteShader(w),C=new s0(n,m),b=dUe(n,m)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let E=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=n.getProgramParameter(m,aUe)),E},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(m),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=oUe++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=S,this.fragmentShader=w,this}var EUe=0,fk=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),a=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(n)===!1&&(o.add(n),n.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new hk(e),t.set(e,i)),i}},hk=class{constructor(e){this.id=EUe++,this.code=e,this.usedTimes=0}};function AUe(r,e,t,i,n,a,o){let s=new fR,l=new fk,u=new Set,c=[],f=n.isWebGL2,h=n.logarithmicDepthBuffer,p=n.vertexTextures,d=n.precision,g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(b){return u.add(b),b===0?"uv":`uv${b}`}function v(b,E,I,R,A){let D=R.fog,U=A.geometry,B=b.isMeshStandardMaterial?R.environment:null,F=(b.isMeshStandardMaterial?t:e).get(b.envMap||B),k=F&&F.mapping===UR?F.image.height:null,G=g[b.type];b.precision!==null&&(d=n.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));let Y=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,J=Y!==void 0?Y.length:0,Q=0;U.morphAttributes.position!==void 0&&(Q=1),U.morphAttributes.normal!==void 0&&(Q=2),U.morphAttributes.color!==void 0&&(Q=3);let V,K,ae,ve;if(G){let zt=fu[G];V=zt.vertexShader,K=zt.fragmentShader}else V=b.vertexShader,K=b.fragmentShader,l.update(b),ae=l.getVertexShaderID(b),ve=l.getFragmentShaderID(b);let ue=r.getRenderTarget(),se=A.isInstancedMesh===!0,Ee=A.isBatchedMesh===!0,q=!!b.map,H=!!b.matcap,We=!!F,_e=!!b.aoMap,xe=!!b.lightMap,Le=!!b.bumpMap,Ue=!!b.normalMap,Ne=!!b.displacementMap,Ve=!!b.emissiveMap,ct=!!b.metalnessMap,z=!!b.roughnessMap,L=b.anisotropy>0,ne=b.clearcoat>0,le=b.iridescence>0,me=b.sheen>0,he=b.transmission>0,et=L&&!!b.anisotropyMap,Ke=ne&&!!b.clearcoatMap,Se=ne&&!!b.clearcoatNormalMap,Ae=ne&&!!b.clearcoatRoughnessMap,nt=le&&!!b.iridescenceMap,$=le&&!!b.iridescenceThicknessMap,it=me&&!!b.sheenColorMap,Xe=me&&!!b.sheenRoughnessMap,ze=!!b.specularMap,we=!!b.specularColorMap,Ie=!!b.specularIntensityMap,st=he&&!!b.transmissionMap,Je=he&&!!b.thicknessMap,kt=!!b.gradientMap,X=!!b.alphaMap,Te=b.alphaTest>0,te=!!b.alphaHash,Me=!!b.extensions,Pe=Ih;b.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(Pe=r.toneMapping);let xt={isWebGL2:f,shaderID:G,shaderType:b.type,shaderName:b.name,vertexShader:V,fragmentShader:K,defines:b.defines,customVertexShaderID:ae,customFragmentShaderID:ve,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:Ee,instancing:se,instancingColor:se&&A.instanceColor!==null,instancingMorph:se&&A.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:ue===null?r.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Hh,alphaToCoverage:!!b.alphaToCoverage,map:q,matcap:H,envMap:We,envMapMode:We&&F.mapping,envMapCubeUVHeight:k,aoMap:_e,lightMap:xe,bumpMap:Le,normalMap:Ue,displacementMap:p&&Ne,emissiveMap:Ve,normalMapObjectSpace:Ue&&b.normalMapType===RPe,normalMapTangentSpace:Ue&&b.normalMapType===Ok,metalnessMap:ct,roughnessMap:z,anisotropy:L,anisotropyMap:et,clearcoat:ne,clearcoatMap:Ke,clearcoatNormalMap:Se,clearcoatRoughnessMap:Ae,iridescence:le,iridescenceMap:nt,iridescenceThicknessMap:$,sheen:me,sheenColorMap:it,sheenRoughnessMap:Xe,specularMap:ze,specularColorMap:we,specularIntensityMap:Ie,transmission:he,transmissionMap:st,thicknessMap:Je,gradientMap:kt,opaque:b.transparent===!1&&b.blending===a0&&b.alphaToCoverage===!1,alphaMap:X,alphaTest:Te,alphaHash:te,combine:b.combine,mapUv:q&&m(b.map.channel),aoMapUv:_e&&m(b.aoMap.channel),lightMapUv:xe&&m(b.lightMap.channel),bumpMapUv:Le&&m(b.bumpMap.channel),normalMapUv:Ue&&m(b.normalMap.channel),displacementMapUv:Ne&&m(b.displacementMap.channel),emissiveMapUv:Ve&&m(b.emissiveMap.channel),metalnessMapUv:ct&&m(b.metalnessMap.channel),roughnessMapUv:z&&m(b.roughnessMap.channel),anisotropyMapUv:et&&m(b.anisotropyMap.channel),clearcoatMapUv:Ke&&m(b.clearcoatMap.channel),clearcoatNormalMapUv:Se&&m(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&m(b.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&m(b.iridescenceMap.channel),iridescenceThicknessMapUv:$&&m(b.iridescenceThicknessMap.channel),sheenColorMapUv:it&&m(b.sheenColorMap.channel),sheenRoughnessMapUv:Xe&&m(b.sheenRoughnessMap.channel),specularMapUv:ze&&m(b.specularMap.channel),specularColorMapUv:we&&m(b.specularColorMap.channel),specularIntensityMapUv:Ie&&m(b.specularIntensityMap.channel),transmissionMapUv:st&&m(b.transmissionMap.channel),thicknessMapUv:Je&&m(b.thicknessMap.channel),alphaMapUv:X&&m(b.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(Ue||L),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:A.isPoints===!0&&!!U.attributes.uv&&(q||X),fog:!!D,useFog:b.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:A.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:J,morphTextureStride:Q,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:Pe,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&b.map.isVideoTexture===!0&&Jr.getTransfer(b.map.colorSpace)===ai,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===yc,flipSided:b.side===lo,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Me&&b.extensions.derivatives===!0,extensionFragDepth:Me&&b.extensions.fragDepth===!0,extensionDrawBuffers:Me&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Me&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Me&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Me&&b.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:f||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:f||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:f||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return xt.vertexUv1s=u.has(1),xt.vertexUv2s=u.has(2),xt.vertexUv3s=u.has(3),u.clear(),xt}function _(b){let E=[];if(b.shaderID?E.push(b.shaderID):(E.push(b.customVertexShaderID),E.push(b.customFragmentShaderID)),b.defines!==void 0)for(let I in b.defines)E.push(I),E.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(y(E,b),x(E,b),E.push(r.outputColorSpace)),E.push(b.customProgramCacheKey),E.join()}function y(b,E){b.push(E.precision),b.push(E.outputColorSpace),b.push(E.envMapMode),b.push(E.envMapCubeUVHeight),b.push(E.mapUv),b.push(E.alphaMapUv),b.push(E.lightMapUv),b.push(E.aoMapUv),b.push(E.bumpMapUv),b.push(E.normalMapUv),b.push(E.displacementMapUv),b.push(E.emissiveMapUv),b.push(E.metalnessMapUv),b.push(E.roughnessMapUv),b.push(E.anisotropyMapUv),b.push(E.clearcoatMapUv),b.push(E.clearcoatNormalMapUv),b.push(E.clearcoatRoughnessMapUv),b.push(E.iridescenceMapUv),b.push(E.iridescenceThicknessMapUv),b.push(E.sheenColorMapUv),b.push(E.sheenRoughnessMapUv),b.push(E.specularMapUv),b.push(E.specularColorMapUv),b.push(E.specularIntensityMapUv),b.push(E.transmissionMapUv),b.push(E.thicknessMapUv),b.push(E.combine),b.push(E.fogExp2),b.push(E.sizeAttenuation),b.push(E.morphTargetsCount),b.push(E.morphAttributeCount),b.push(E.numDirLights),b.push(E.numPointLights),b.push(E.numSpotLights),b.push(E.numSpotLightMaps),b.push(E.numHemiLights),b.push(E.numRectAreaLights),b.push(E.numDirLightShadows),b.push(E.numPointLightShadows),b.push(E.numSpotLightShadows),b.push(E.numSpotLightShadowsWithMaps),b.push(E.numLightProbes),b.push(E.shadowMapType),b.push(E.toneMapping),b.push(E.numClippingPlanes),b.push(E.numClipIntersection),b.push(E.depthPacking)}function x(b,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.instancingMorph&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.normalMapObjectSpace&&s.enable(7),E.normalMapTangentSpace&&s.enable(8),E.clearcoat&&s.enable(9),E.iridescence&&s.enable(10),E.alphaTest&&s.enable(11),E.vertexColors&&s.enable(12),E.vertexAlphas&&s.enable(13),E.vertexUv1s&&s.enable(14),E.vertexUv2s&&s.enable(15),E.vertexUv3s&&s.enable(16),E.vertexTangents&&s.enable(17),E.anisotropy&&s.enable(18),E.alphaHash&&s.enable(19),E.batching&&s.enable(20),b.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.useLegacyLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.transmission&&s.enable(15),E.sheen&&s.enable(16),E.opaque&&s.enable(17),E.pointsUvs&&s.enable(18),E.decodeVideoTexture&&s.enable(19),E.alphaToCoverage&&s.enable(20),b.push(s.mask)}function M(b){let E=g[b.type],I;if(E){let R=fu[E];I=dDe.clone(R.uniforms)}else I=b.uniforms;return I}function S(b,E){let I;for(let R=0,A=c.length;R0?i.push(v):p.transparent===!0?n.push(v):t.push(v)}function l(f,h,p,d,g,m){let v=o(f,h,p,d,g,m);p.transmission>0?i.unshift(v):p.transparent===!0?n.unshift(v):t.unshift(v)}function u(f,h){t.length>1&&t.sort(f||RUe),i.length>1&&i.sort(h||Eoe),n.length>1&&n.sort(h||Eoe)}function c(){for(let f=e,h=r.length;f=a.length?(o=new Aoe,a.push(o)):o=a[n],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function PUe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ye,color:new er};break;case"SpotLight":t={position:new ye,direction:new ye,color:new er,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ye,color:new er,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ye,skyColor:new er,groundColor:new er};break;case"RectAreaLight":t={color:new er,position:new ye,halfWidth:new ye,halfHeight:new ye};break}return r[e.id]=t,t}}}function DUe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yr};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yr};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yr,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var IUe=0;function NUe(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function UUe(r,e){let t=new PUe,i=DUe(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new ye);let a=new ye,o=new Ht,s=new Ht;function l(c,f){let h=0,p=0,d=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let g=0,m=0,v=0,_=0,y=0,x=0,M=0,S=0,w=0,T=0,C=0;c.sort(NUe);let b=f===!0?Math.PI:1;for(let I=0,R=c.length;I0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=yt.LTC_FLOAT_1,n.rectAreaLTC2=yt.LTC_FLOAT_2):(n.rectAreaLTC1=yt.LTC_HALF_1,n.rectAreaLTC2=yt.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=yt.LTC_FLOAT_1,n.rectAreaLTC2=yt.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(n.rectAreaLTC1=yt.LTC_HALF_1,n.rectAreaLTC2=yt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=h,n.ambient[1]=p,n.ambient[2]=d;let E=n.hash;(E.directionalLength!==g||E.pointLength!==m||E.spotLength!==v||E.rectAreaLength!==_||E.hemiLength!==y||E.numDirectionalShadows!==x||E.numPointShadows!==M||E.numSpotShadows!==S||E.numSpotMaps!==w||E.numLightProbes!==C)&&(n.directional.length=g,n.spot.length=v,n.rectArea.length=_,n.point.length=m,n.hemi.length=y,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=S+w-T,n.spotLightMap.length=w,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=C,E.directionalLength=g,E.pointLength=m,E.spotLength=v,E.rectAreaLength=_,E.hemiLength=y,E.numDirectionalShadows=x,E.numPointShadows=M,E.numSpotShadows=S,E.numSpotMaps=w,E.numLightProbes=C,n.version=IUe++)}function u(c,f){let h=0,p=0,d=0,g=0,m=0,v=f.matrixWorldInverse;for(let _=0,y=c.length;_=s.length?(l=new Coe(r,e),s.push(l)):l=s[o],l}function n(){t=new WeakMap}return{get:i,dispose:n}}var pk=class extends Mc{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=APe,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},dk=class extends Mc{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},FUe=`void main() { +`+z+` +`+k)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(A===""||D==="")&&(B=!1);B&&(I.diagnostics={runnable:U,programLog:R,vertexShader:{log:A,prefix:v},fragmentShader:{log:D,prefix:_}})}n.deleteShader(S),n.deleteShader(w),C=new u0(n,m),b=vUe(n,m)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let E=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=n.getProgramParameter(m,sUe)),E},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(m),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=lUe++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=S,this.fragmentShader=w,this}var CUe=0,hk=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),a=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(n)===!1&&(o.add(n),n.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new pk(e),t.set(e,i)),i}},pk=class{constructor(e){this.id=CUe++,this.code=e,this.usedTimes=0}};function RUe(r,e,t,i,n,a,o){let s=new hR,l=new hk,u=new Set,c=[],f=n.isWebGL2,h=n.logarithmicDepthBuffer,p=n.vertexTextures,d=n.precision,g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(b){return u.add(b),b===0?"uv":`uv${b}`}function v(b,E,I,R,A){let D=R.fog,U=A.geometry,B=b.isMeshStandardMaterial?R.environment:null,z=(b.isMeshStandardMaterial?t:e).get(b.envMap||B),k=z&&z.mapping===OR?z.image.height:null,G=g[b.type];b.precision!==null&&(d=n.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));let Y=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,J=Y!==void 0?Y.length:0,Q=0;U.morphAttributes.position!==void 0&&(Q=1),U.morphAttributes.normal!==void 0&&(Q=2),U.morphAttributes.color!==void 0&&(Q=3);let V,K,ae,ve;if(G){let Ft=cu[G];V=Ft.vertexShader,K=Ft.fragmentShader}else V=b.vertexShader,K=b.fragmentShader,l.update(b),ae=l.getVertexShaderID(b),ve=l.getFragmentShaderID(b);let ue=r.getRenderTarget(),se=A.isInstancedMesh===!0,Ee=A.isBatchedMesh===!0,q=!!b.map,H=!!b.matcap,We=!!z,_e=!!b.aoMap,xe=!!b.lightMap,Le=!!b.bumpMap,Ue=!!b.normalMap,Ne=!!b.displacementMap,Ve=!!b.emissiveMap,ct=!!b.metalnessMap,F=!!b.roughnessMap,L=b.anisotropy>0,ne=b.clearcoat>0,le=b.iridescence>0,me=b.sheen>0,he=b.transmission>0,et=L&&!!b.anisotropyMap,Ke=ne&&!!b.clearcoatMap,Se=ne&&!!b.clearcoatNormalMap,Ae=ne&&!!b.clearcoatRoughnessMap,nt=le&&!!b.iridescenceMap,$=le&&!!b.iridescenceThicknessMap,it=me&&!!b.sheenColorMap,Xe=me&&!!b.sheenRoughnessMap,Fe=!!b.specularMap,we=!!b.specularColorMap,Ie=!!b.specularIntensityMap,st=he&&!!b.transmissionMap,Je=he&&!!b.thicknessMap,kt=!!b.gradientMap,X=!!b.alphaMap,Te=b.alphaTest>0,te=!!b.alphaHash,Me=!!b.extensions,Pe=Uh;b.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(Pe=r.toneMapping);let xt={isWebGL2:f,shaderID:G,shaderType:b.type,shaderName:b.name,vertexShader:V,fragmentShader:K,defines:b.defines,customVertexShaderID:ae,customFragmentShaderID:ve,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:Ee,instancing:se,instancingColor:se&&A.instanceColor!==null,instancingMorph:se&&A.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:ue===null?r.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Xh,alphaToCoverage:!!b.alphaToCoverage,map:q,matcap:H,envMap:We,envMapMode:We&&z.mapping,envMapCubeUVHeight:k,aoMap:_e,lightMap:xe,bumpMap:Le,normalMap:Ue,displacementMap:p&&Ne,emissiveMap:Ve,normalMapObjectSpace:Ue&&b.normalMapType===PPe,normalMapTangentSpace:Ue&&b.normalMapType===zk,metalnessMap:ct,roughnessMap:F,anisotropy:L,anisotropyMap:et,clearcoat:ne,clearcoatMap:Ke,clearcoatNormalMap:Se,clearcoatRoughnessMap:Ae,iridescence:le,iridescenceMap:nt,iridescenceThicknessMap:$,sheen:me,sheenColorMap:it,sheenRoughnessMap:Xe,specularMap:Fe,specularColorMap:we,specularIntensityMap:Ie,transmission:he,transmissionMap:st,thicknessMap:Je,gradientMap:kt,opaque:b.transparent===!1&&b.blending===s0&&b.alphaToCoverage===!1,alphaMap:X,alphaTest:Te,alphaHash:te,combine:b.combine,mapUv:q&&m(b.map.channel),aoMapUv:_e&&m(b.aoMap.channel),lightMapUv:xe&&m(b.lightMap.channel),bumpMapUv:Le&&m(b.bumpMap.channel),normalMapUv:Ue&&m(b.normalMap.channel),displacementMapUv:Ne&&m(b.displacementMap.channel),emissiveMapUv:Ve&&m(b.emissiveMap.channel),metalnessMapUv:ct&&m(b.metalnessMap.channel),roughnessMapUv:F&&m(b.roughnessMap.channel),anisotropyMapUv:et&&m(b.anisotropyMap.channel),clearcoatMapUv:Ke&&m(b.clearcoatMap.channel),clearcoatNormalMapUv:Se&&m(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&m(b.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&m(b.iridescenceMap.channel),iridescenceThicknessMapUv:$&&m(b.iridescenceThicknessMap.channel),sheenColorMapUv:it&&m(b.sheenColorMap.channel),sheenRoughnessMapUv:Xe&&m(b.sheenRoughnessMap.channel),specularMapUv:Fe&&m(b.specularMap.channel),specularColorMapUv:we&&m(b.specularColorMap.channel),specularIntensityMapUv:Ie&&m(b.specularIntensityMap.channel),transmissionMapUv:st&&m(b.transmissionMap.channel),thicknessMapUv:Je&&m(b.thicknessMap.channel),alphaMapUv:X&&m(b.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(Ue||L),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:A.isPoints===!0&&!!U.attributes.uv&&(q||X),fog:!!D,useFog:b.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:A.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:J,morphTextureStride:Q,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:Pe,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&b.map.isVideoTexture===!0&&$r.getTransfer(b.map.colorSpace)===oi,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===gc,flipSided:b.side===fo,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Me&&b.extensions.derivatives===!0,extensionFragDepth:Me&&b.extensions.fragDepth===!0,extensionDrawBuffers:Me&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Me&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Me&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Me&&b.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:f||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:f||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:f||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return xt.vertexUv1s=u.has(1),xt.vertexUv2s=u.has(2),xt.vertexUv3s=u.has(3),u.clear(),xt}function _(b){let E=[];if(b.shaderID?E.push(b.shaderID):(E.push(b.customVertexShaderID),E.push(b.customFragmentShaderID)),b.defines!==void 0)for(let I in b.defines)E.push(I),E.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(y(E,b),x(E,b),E.push(r.outputColorSpace)),E.push(b.customProgramCacheKey),E.join()}function y(b,E){b.push(E.precision),b.push(E.outputColorSpace),b.push(E.envMapMode),b.push(E.envMapCubeUVHeight),b.push(E.mapUv),b.push(E.alphaMapUv),b.push(E.lightMapUv),b.push(E.aoMapUv),b.push(E.bumpMapUv),b.push(E.normalMapUv),b.push(E.displacementMapUv),b.push(E.emissiveMapUv),b.push(E.metalnessMapUv),b.push(E.roughnessMapUv),b.push(E.anisotropyMapUv),b.push(E.clearcoatMapUv),b.push(E.clearcoatNormalMapUv),b.push(E.clearcoatRoughnessMapUv),b.push(E.iridescenceMapUv),b.push(E.iridescenceThicknessMapUv),b.push(E.sheenColorMapUv),b.push(E.sheenRoughnessMapUv),b.push(E.specularMapUv),b.push(E.specularColorMapUv),b.push(E.specularIntensityMapUv),b.push(E.transmissionMapUv),b.push(E.thicknessMapUv),b.push(E.combine),b.push(E.fogExp2),b.push(E.sizeAttenuation),b.push(E.morphTargetsCount),b.push(E.morphAttributeCount),b.push(E.numDirLights),b.push(E.numPointLights),b.push(E.numSpotLights),b.push(E.numSpotLightMaps),b.push(E.numHemiLights),b.push(E.numRectAreaLights),b.push(E.numDirLightShadows),b.push(E.numPointLightShadows),b.push(E.numSpotLightShadows),b.push(E.numSpotLightShadowsWithMaps),b.push(E.numLightProbes),b.push(E.shadowMapType),b.push(E.toneMapping),b.push(E.numClippingPlanes),b.push(E.numClipIntersection),b.push(E.depthPacking)}function x(b,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.instancingMorph&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.normalMapObjectSpace&&s.enable(7),E.normalMapTangentSpace&&s.enable(8),E.clearcoat&&s.enable(9),E.iridescence&&s.enable(10),E.alphaTest&&s.enable(11),E.vertexColors&&s.enable(12),E.vertexAlphas&&s.enable(13),E.vertexUv1s&&s.enable(14),E.vertexUv2s&&s.enable(15),E.vertexUv3s&&s.enable(16),E.vertexTangents&&s.enable(17),E.anisotropy&&s.enable(18),E.alphaHash&&s.enable(19),E.batching&&s.enable(20),b.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.useLegacyLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.transmission&&s.enable(15),E.sheen&&s.enable(16),E.opaque&&s.enable(17),E.pointsUvs&&s.enable(18),E.decodeVideoTexture&&s.enable(19),E.alphaToCoverage&&s.enable(20),b.push(s.mask)}function M(b){let E=g[b.type],I;if(E){let R=cu[E];I=vDe.clone(R.uniforms)}else I=b.uniforms;return I}function S(b,E){let I;for(let R=0,A=c.length;R0?i.push(v):p.transparent===!0?n.push(v):t.push(v)}function l(f,h,p,d,g,m){let v=o(f,h,p,d,g,m);p.transmission>0?i.unshift(v):p.transparent===!0?n.unshift(v):t.unshift(v)}function u(f,h){t.length>1&&t.sort(f||PUe),i.length>1&&i.sort(h||Coe),n.length>1&&n.sort(h||Coe)}function c(){for(let f=e,h=r.length;f=a.length?(o=new Roe,a.push(o)):o=a[n],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function IUe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ye,color:new tr};break;case"SpotLight":t={position:new ye,direction:new ye,color:new tr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ye,color:new tr,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ye,skyColor:new tr,groundColor:new tr};break;case"RectAreaLight":t={color:new tr,position:new ye,halfWidth:new ye,halfHeight:new ye};break}return r[e.id]=t,t}}}function NUe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yr};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yr};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yr,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var UUe=0;function OUe(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function zUe(r,e){let t=new IUe,i=NUe(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new ye);let a=new ye,o=new Ht,s=new Ht;function l(c,f){let h=0,p=0,d=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let g=0,m=0,v=0,_=0,y=0,x=0,M=0,S=0,w=0,T=0,C=0;c.sort(OUe);let b=f===!0?Math.PI:1;for(let I=0,R=c.length;I0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=yt.LTC_FLOAT_1,n.rectAreaLTC2=yt.LTC_FLOAT_2):(n.rectAreaLTC1=yt.LTC_HALF_1,n.rectAreaLTC2=yt.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=yt.LTC_FLOAT_1,n.rectAreaLTC2=yt.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(n.rectAreaLTC1=yt.LTC_HALF_1,n.rectAreaLTC2=yt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=h,n.ambient[1]=p,n.ambient[2]=d;let E=n.hash;(E.directionalLength!==g||E.pointLength!==m||E.spotLength!==v||E.rectAreaLength!==_||E.hemiLength!==y||E.numDirectionalShadows!==x||E.numPointShadows!==M||E.numSpotShadows!==S||E.numSpotMaps!==w||E.numLightProbes!==C)&&(n.directional.length=g,n.spot.length=v,n.rectArea.length=_,n.point.length=m,n.hemi.length=y,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=S+w-T,n.spotLightMap.length=w,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=C,E.directionalLength=g,E.pointLength=m,E.spotLength=v,E.rectAreaLength=_,E.hemiLength=y,E.numDirectionalShadows=x,E.numPointShadows=M,E.numSpotShadows=S,E.numSpotMaps=w,E.numLightProbes=C,n.version=UUe++)}function u(c,f){let h=0,p=0,d=0,g=0,m=0,v=f.matrixWorldInverse;for(let _=0,y=c.length;_=s.length?(l=new Loe(r,e),s.push(l)):l=s[o],l}function n(){t=new WeakMap}return{get:i,dispose:n}}var dk=class extends Sc{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=RPe,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},mk=class extends Sc{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},BUe=`void main() { gl_Position = vec4( position, 1.0 ); -}`,zUe=`uniform sampler2D shadow_pass; +}`,kUe=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -12516,12 +12516,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function BUe(r,e,t){let i=new UM,n=new yr,a=new yr,o=new Pr,s=new pk({depthPacking:CPe}),l=new dk,u={},c=t.maxTextureSize,f={[Uh]:lo,[lo]:Uh,[yc]:yc},h=new pu({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new yr},radius:{value:4}},vertexShader:FUe,fragmentShader:zUe}),p=h.clone();p.defines.HORIZONTAL_PASS=1;let d=new Rs;d.setAttribute("position",new Cs(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new so(d,h),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Xoe;let v=this.type;this.render=function(S,w,T){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;let C=r.getRenderTarget(),b=r.getActiveCubeFace(),E=r.getActiveMipmapLevel(),I=r.state;I.setBlending(Dh),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);let R=v!==vc&&this.type===vc,A=v===vc&&this.type!==vc;for(let D=0,U=S.length;Dc||n.y>c)&&(n.x>c&&(a.x=Math.floor(c/k.x),n.x=a.x*k.x,F.mapSize.x=a.x),n.y>c&&(a.y=Math.floor(c/k.y),n.y=a.y*k.y,F.mapSize.y=a.y)),F.map===null||R===!0||A===!0){let Y=this.type!==vc?{minFilter:Dn,magFilter:Dn}:{};F.map!==null&&F.map.dispose(),F.map=new Sc(n.x,n.y,Y),F.map.texture.name=B.name+".shadowMap",F.camera.updateProjectionMatrix()}r.setRenderTarget(F.map),r.clear();let G=F.getViewportCount();for(let Y=0;Y0||w.map&&w.alphaTest>0){let I=b.uuid,R=w.uuid,A=u[I];A===void 0&&(A={},u[I]=A);let D=A[R];D===void 0&&(D=b.clone(),A[R]=D,w.addEventListener("dispose",M)),b=D}if(b.visible=w.visible,b.wireframe=w.wireframe,C===vc?b.side=w.shadowSide!==null?w.shadowSide:w.side:b.side=w.shadowSide!==null?w.shadowSide:f[w.side],b.alphaMap=w.alphaMap,b.alphaTest=w.alphaTest,b.map=w.map,b.clipShadows=w.clipShadows,b.clippingPlanes=w.clippingPlanes,b.clipIntersection=w.clipIntersection,b.displacementMap=w.displacementMap,b.displacementScale=w.displacementScale,b.displacementBias=w.displacementBias,b.wireframeLinewidth=w.wireframeLinewidth,b.linewidth=w.linewidth,T.isPointLight===!0&&b.isMeshDistanceMaterial===!0){let I=r.properties.get(b);I.light=T}return b}function x(S,w,T,C,b){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&b===vc)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);let R=e.update(S),A=S.material;if(Array.isArray(A)){let D=R.groups;for(let U=0,B=D.length;U=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),F=k>=2);let Y=null,J={},Q=r.getParameter(r.SCISSOR_BOX),V=r.getParameter(r.VIEWPORT),K=new Pr().fromArray(Q),ae=new Pr().fromArray(V);function ve(X,Te,te,Me){let Pe=new Uint8Array(4),xt=r.createTexture();r.bindTexture(X,xt),r.texParameteri(X,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(X,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let zt=0;zt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new yr,f=new WeakMap,h,p=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(z,L){return d?new OffscreenCanvas(z,L):DM("canvas")}function m(z,L,ne,le){let me=1,he=ct(z);if((he.width>le||he.height>le)&&(me=le/Math.max(he.width,he.height)),me<1||L===!0)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap||typeof VideoFrame<"u"&&z instanceof VideoFrame){let et=L?sR:Math.floor,Ke=et(me*he.width),Se=et(me*he.height);h===void 0&&(h=g(Ke,Se));let Ae=ne?g(Ke,Se):h;return Ae.width=Ke,Ae.height=Se,Ae.getContext("2d").drawImage(z,0,0,Ke,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+he.width+"x"+he.height+") to ("+Ke+"x"+Se+")."),Ae}else return"data"in z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+he.width+"x"+he.height+")."),z;return z}function v(z){let L=ct(z);return rk(L.width)&&rk(L.height)}function _(z){return s?!1:z.wrapS!==oo||z.wrapT!==oo||z.minFilter!==Dn&&z.minFilter!==ao}function y(z,L){return z.generateMipmaps&&L&&z.minFilter!==Dn&&z.minFilter!==ao}function x(z){r.generateMipmap(z)}function M(z,L,ne,le,me=!1){if(s===!1)return L;if(z!==null){if(r[z]!==void 0)return r[z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let he=L;if(L===r.RED&&(ne===r.FLOAT&&(he=r.R32F),ne===r.HALF_FLOAT&&(he=r.R16F),ne===r.UNSIGNED_BYTE&&(he=r.R8)),L===r.RED_INTEGER&&(ne===r.UNSIGNED_BYTE&&(he=r.R8UI),ne===r.UNSIGNED_SHORT&&(he=r.R16UI),ne===r.UNSIGNED_INT&&(he=r.R32UI),ne===r.BYTE&&(he=r.R8I),ne===r.SHORT&&(he=r.R16I),ne===r.INT&&(he=r.R32I)),L===r.RG&&(ne===r.FLOAT&&(he=r.RG32F),ne===r.HALF_FLOAT&&(he=r.RG16F),ne===r.UNSIGNED_BYTE&&(he=r.RG8)),L===r.RG_INTEGER&&(ne===r.UNSIGNED_BYTE&&(he=r.RG8UI),ne===r.UNSIGNED_SHORT&&(he=r.RG16UI),ne===r.UNSIGNED_INT&&(he=r.RG32UI),ne===r.BYTE&&(he=r.RG8I),ne===r.SHORT&&(he=r.RG16I),ne===r.INT&&(he=r.RG32I)),L===r.RGBA){let et=me?iR:Jr.getTransfer(le);ne===r.FLOAT&&(he=r.RGBA32F),ne===r.HALF_FLOAT&&(he=r.RGBA16F),ne===r.UNSIGNED_BYTE&&(he=et===ai?r.SRGB8_ALPHA8:r.RGBA8),ne===r.UNSIGNED_SHORT_4_4_4_4&&(he=r.RGBA4),ne===r.UNSIGNED_SHORT_5_5_5_1&&(he=r.RGB5_A1)}return(he===r.R16F||he===r.R32F||he===r.RG16F||he===r.RG32F||he===r.RGBA16F||he===r.RGBA32F)&&e.get("EXT_color_buffer_float"),he}function S(z,L,ne){return y(z,ne)===!0||z.isFramebufferTexture&&z.minFilter!==Dn&&z.minFilter!==ao?Math.log2(Math.max(L.width,L.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?L.mipmaps.length:1}function w(z){return z===Dn||z===fae||z===SM?r.NEAREST:r.LINEAR}function T(z){let L=z.target;L.removeEventListener("dispose",T),b(L),L.isVideoTexture&&f.delete(L)}function C(z){let L=z.target;L.removeEventListener("dispose",C),I(L)}function b(z){let L=i.get(z);if(L.__webglInit===void 0)return;let ne=z.source,le=p.get(ne);if(le){let me=le[L.__cacheKey];me.usedTimes--,me.usedTimes===0&&E(z),Object.keys(le).length===0&&p.delete(ne)}i.remove(z)}function E(z){let L=i.get(z);r.deleteTexture(L.__webglTexture);let ne=z.source,le=p.get(ne);delete le[L.__cacheKey],o.memory.textures--}function I(z){let L=i.get(z);if(z.depthTexture&&z.depthTexture.dispose(),z.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(L.__webglFramebuffer[le]))for(let me=0;me=n.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+n.maxTextures),R+=1,z}function U(z){let L=[];return L.push(z.wrapS),L.push(z.wrapT),L.push(z.wrapR||0),L.push(z.magFilter),L.push(z.minFilter),L.push(z.anisotropy),L.push(z.internalFormat),L.push(z.format),L.push(z.type),L.push(z.generateMipmaps),L.push(z.premultiplyAlpha),L.push(z.flipY),L.push(z.unpackAlignment),L.push(z.colorSpace),L.join()}function B(z,L){let ne=i.get(z);if(z.isVideoTexture&&Ne(z),z.isRenderTargetTexture===!1&&z.version>0&&ne.__version!==z.version){let le=z.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(ne,z,L);return}}t.bindTexture(r.TEXTURE_2D,ne.__webglTexture,r.TEXTURE0+L)}function F(z,L){let ne=i.get(z);if(z.version>0&&ne.__version!==z.version){ae(ne,z,L);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ne.__webglTexture,r.TEXTURE0+L)}function k(z,L){let ne=i.get(z);if(z.version>0&&ne.__version!==z.version){ae(ne,z,L);return}t.bindTexture(r.TEXTURE_3D,ne.__webglTexture,r.TEXTURE0+L)}function G(z,L){let ne=i.get(z);if(z.version>0&&ne.__version!==z.version){ve(ne,z,L);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ne.__webglTexture,r.TEXTURE0+L)}let Y={[c0]:r.REPEAT,[oo]:r.CLAMP_TO_EDGE,[ek]:r.MIRRORED_REPEAT},J={[Dn]:r.NEAREST,[fae]:r.NEAREST_MIPMAP_NEAREST,[SM]:r.NEAREST_MIPMAP_LINEAR,[ao]:r.LINEAR,[mB]:r.LINEAR_MIPMAP_NEAREST,[fm]:r.LINEAR_MIPMAP_LINEAR},Q={[LPe]:r.NEVER,[OPe]:r.ALWAYS,[PPe]:r.LESS,[Qoe]:r.LEQUAL,[DPe]:r.EQUAL,[UPe]:r.GEQUAL,[IPe]:r.GREATER,[NPe]:r.NOTEQUAL};function V(z,L,ne){if(L.type===hu&&e.has("OES_texture_float_linear")===!1&&(L.magFilter===ao||L.magFilter===mB||L.magFilter===SM||L.magFilter===fm||L.minFilter===ao||L.minFilter===mB||L.minFilter===SM||L.minFilter===fm)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ne?(r.texParameteri(z,r.TEXTURE_WRAP_S,Y[L.wrapS]),r.texParameteri(z,r.TEXTURE_WRAP_T,Y[L.wrapT]),(z===r.TEXTURE_3D||z===r.TEXTURE_2D_ARRAY)&&r.texParameteri(z,r.TEXTURE_WRAP_R,Y[L.wrapR]),r.texParameteri(z,r.TEXTURE_MAG_FILTER,J[L.magFilter]),r.texParameteri(z,r.TEXTURE_MIN_FILTER,J[L.minFilter])):(r.texParameteri(z,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(z,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(z===r.TEXTURE_3D||z===r.TEXTURE_2D_ARRAY)&&r.texParameteri(z,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(L.wrapS!==oo||L.wrapT!==oo)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(z,r.TEXTURE_MAG_FILTER,w(L.magFilter)),r.texParameteri(z,r.TEXTURE_MIN_FILTER,w(L.minFilter)),L.minFilter!==Dn&&L.minFilter!==ao&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),L.compareFunction&&(r.texParameteri(z,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(z,r.TEXTURE_COMPARE_FUNC,Q[L.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(L.magFilter===Dn||L.minFilter!==SM&&L.minFilter!==fm||L.type===hu&&e.has("OES_texture_float_linear")===!1||s===!1&&L.type===PM&&e.has("OES_texture_half_float_linear")===!1)return;if(L.anisotropy>1||i.get(L).__currentAnisotropy){let le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(z,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,n.getMaxAnisotropy())),i.get(L).__currentAnisotropy=L.anisotropy}}}function K(z,L){let ne=!1;z.__webglInit===void 0&&(z.__webglInit=!0,L.addEventListener("dispose",T));let le=L.source,me=p.get(le);me===void 0&&(me={},p.set(le,me));let he=U(L);if(he!==z.__cacheKey){me[he]===void 0&&(me[he]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ne=!0),me[he].usedTimes++;let et=me[z.__cacheKey];et!==void 0&&(me[z.__cacheKey].usedTimes--,et.usedTimes===0&&E(L)),z.__cacheKey=he,z.__webglTexture=me[he].texture}return ne}function ae(z,L,ne){let le=r.TEXTURE_2D;(L.isDataArrayTexture||L.isCompressedArrayTexture)&&(le=r.TEXTURE_2D_ARRAY),L.isData3DTexture&&(le=r.TEXTURE_3D);let me=K(z,L),he=L.source;t.bindTexture(le,z.__webglTexture,r.TEXTURE0+ne);let et=i.get(he);if(he.version!==et.__version||me===!0){t.activeTexture(r.TEXTURE0+ne);let Ke=Jr.getPrimaries(Jr.workingColorSpace),Se=L.colorSpace===Lh?null:Jr.getPrimaries(L.colorSpace),Ae=L.colorSpace===Lh||Ke===Se?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,L.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,L.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ae);let nt=_(L)&&v(L.image)===!1,$=m(L.image,nt,!1,n.maxTextureSize);$=Ve(L,$);let it=v($)||s,Xe=a.convert(L.format,L.colorSpace),ze=a.convert(L.type),we=M(L.internalFormat,Xe,ze,L.colorSpace,L.isVideoTexture);V(le,L,it);let Ie,st=L.mipmaps,Je=s&&L.isVideoTexture!==!0&&we!==$oe,kt=et.__version===void 0||me===!0,X=he.dataReady,Te=S(L,$,it);if(L.isDepthTexture)we=r.DEPTH_COMPONENT,s?L.type===hu?we=r.DEPTH_COMPONENT32F:L.type===Ph?we=r.DEPTH_COMPONENT24:L.type===hm?we=r.DEPTH24_STENCIL8:we=r.DEPTH_COMPONENT16:L.type===hu&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===pm&&we===r.DEPTH_COMPONENT&&L.type!==Uk&&L.type!==Ph&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=Ph,ze=a.convert(L.type)),L.format===f0&&we===r.DEPTH_COMPONENT&&(we=r.DEPTH_STENCIL,L.type!==hm&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=hm,ze=a.convert(L.type))),kt&&(Je?t.texStorage2D(r.TEXTURE_2D,1,we,$.width,$.height):t.texImage2D(r.TEXTURE_2D,0,we,$.width,$.height,0,Xe,ze,null));else if(L.isDataTexture)if(st.length>0&&it){Je&&kt&&t.texStorage2D(r.TEXTURE_2D,Te,we,st[0].width,st[0].height);for(let te=0,Me=st.length;te>=1,Me>>=1}}else if(st.length>0&&it){if(Je&&kt){let te=ct(st[0]);t.texStorage2D(r.TEXTURE_2D,Te,we,te.width,te.height)}for(let te=0,Me=st.length;te0&&X++;let te=ct($[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,X,Ie,te.width,te.height)}for(let te=0;te<6;te++)if(nt){st?kt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,$[te].width,$[te].height,ze,we,$[te].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,Ie,$[te].width,$[te].height,0,ze,we,$[te].data);for(let Me=0;Me>he),$=Math.max(1,L.height>>he);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,he,Se,nt,$,L.depth,0,et,Ke,null):t.texImage2D(me,he,Se,nt,$,0,et,Ke,null)}t.bindFramebuffer(r.FRAMEBUFFER,z),Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,0,Le(L)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,he),t.bindFramebuffer(r.FRAMEBUFFER,null)}function se(z,L,ne){if(r.bindRenderbuffer(r.RENDERBUFFER,z),L.depthBuffer&&!L.stencilBuffer){let le=s===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(ne||Ue(L)){let me=L.depthTexture;me&&me.isDepthTexture&&(me.type===hu?le=r.DEPTH_COMPONENT32F:me.type===Ph&&(le=r.DEPTH_COMPONENT24));let he=Le(L);Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,he,le,L.width,L.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,he,le,L.width,L.height)}else r.renderbufferStorage(r.RENDERBUFFER,le,L.width,L.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,z)}else if(L.depthBuffer&&L.stencilBuffer){let le=Le(L);ne&&Ue(L)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,L.width,L.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,z)}else{let le=L.textures;for(let me=0;me1,Ke=v(z)||s;if(et||(le.__webglTexture===void 0&&(le.__webglTexture=r.createTexture()),le.__version=L.version,o.memory.textures++),he){ne.__webglFramebuffer=[];for(let Se=0;Se<6;Se++)if(s&&L.mipmaps&&L.mipmaps.length>0){ne.__webglFramebuffer[Se]=[];for(let Ae=0;Ae0){ne.__webglFramebuffer=[];for(let Se=0;Se0&&Ue(z)===!1){ne.__webglMultisampledFramebuffer=r.createFramebuffer(),ne.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ne.__webglMultisampledFramebuffer);for(let Se=0;Se0)for(let Ae=0;Ae0)for(let Ae=0;Ae0&&Ue(z)===!1){let L=z.textures,ne=z.width,le=z.height,me=r.COLOR_BUFFER_BIT,he=[],et=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ke=i.get(z),Se=L.length>1;if(Se)for(let Ae=0;Ae0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function Ne(z){let L=o.render.frame;f.get(z)!==L&&(f.set(z,L),z.update())}function Ve(z,L){let ne=z.colorSpace,le=z.format,me=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||z.format===tk||ne!==Hh&&ne!==Lh&&(Jr.getTransfer(ne)===ai?s===!1?e.has("EXT_sRGB")===!0&&le===As?(z.format=tk,z.minFilter=ao,z.generateMipmaps=!1):L=lR.sRGBToLinear(L):(le!==As||me!==Nh)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ne)),L}function ct(z){return typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement?(c.width=z.naturalWidth||z.width,c.height=z.naturalHeight||z.height):typeof VideoFrame<"u"&&z instanceof VideoFrame?(c.width=z.displayWidth,c.height=z.displayHeight):(c.width=z.width,c.height=z.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=A,this.setTexture2D=B,this.setTexture2DArray=F,this.setTexture3D=k,this.setTextureCube=G,this.rebindTextures=H,this.setupRenderTarget=We,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=Ue}function GUe(r,e,t){let i=t.isWebGL2;function n(a,o=Lh){let s,l=Jr.getTransfer(o);if(a===Nh)return r.UNSIGNED_BYTE;if(a===qoe)return r.UNSIGNED_SHORT_4_4_4_4;if(a===Zoe)return r.UNSIGNED_SHORT_5_5_5_1;if(a===yPe)return r.BYTE;if(a===_Pe)return r.SHORT;if(a===Uk)return r.UNSIGNED_SHORT;if(a===Yoe)return r.INT;if(a===Ph)return r.UNSIGNED_INT;if(a===hu)return r.FLOAT;if(a===PM)return i?r.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(a===xPe)return r.ALPHA;if(a===As)return r.RGBA;if(a===SPe)return r.LUMINANCE;if(a===MPe)return r.LUMINANCE_ALPHA;if(a===pm)return r.DEPTH_COMPONENT;if(a===f0)return r.DEPTH_STENCIL;if(a===tk)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(a===bPe)return r.RED;if(a===joe)return r.RED_INTEGER;if(a===wPe)return r.RG;if(a===Koe)return r.RG_INTEGER;if(a===Joe)return r.RGBA_INTEGER;if(a===vB||a===gB||a===yB||a===_B)if(l===ai)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(a===vB)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===gB)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===yB)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===_B)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(a===vB)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===gB)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===yB)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===_B)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===hae||a===pae||a===dae||a===mae)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(a===hae)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===pae)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===dae)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===mae)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===$oe)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===vae||a===gae)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(a===vae)return l===ai?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(a===gae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===yae||a===_ae||a===xae||a===Sae||a===Mae||a===bae||a===wae||a===Tae||a===Eae||a===Aae||a===Cae||a===Rae||a===Lae||a===Pae)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(a===yae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===_ae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===xae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===Sae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===Mae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===bae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===wae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===Tae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===Eae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===Aae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===Cae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===Rae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===Lae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===Pae)return l===ai?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===xB||a===Dae||a===Iae)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(a===xB)return l===ai?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===Dae)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===Iae)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===TPe||a===Nae||a===Uae||a===Oae)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(a===xB)return s.COMPRESSED_RED_RGTC1_EXT;if(a===Nae)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===Uae)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===Oae)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===hm?i?r.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):r[a]!==void 0?r[a]:null}return{convert:n}}var mk=class extends Nn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},xc=class extends ia{constructor(){super(),this.isGroup=!0,this.type="Group"}},HUe={type:"move"},RM=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new xc,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 xc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ye,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ye),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new xc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ye,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ye),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}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data: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 n=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(let g of e.hand.values()){let m=t.getJointPose(g,i),v=this._getHandJoint(u,g);m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=m.radius),v.visible=m!==null}let c=u.joints["index-finger-tip"],f=u.joints["thumb-tip"],h=c.position.distanceTo(f.position),p=.02,d=.005;u.inputState.pinching&&h>p+d?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&h<=p-d&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&a!==null&&(n=a),n!==null&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(HUe)))}return s!==null&&(s.visible=n!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new xc;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}},WUe=` +}`;function VUe(r,e,t){let i=new OM,n=new yr,a=new yr,o=new Rr,s=new dk({depthPacking:LPe}),l=new mk,u={},c=t.maxTextureSize,f={[zh]:fo,[fo]:zh,[gc]:gc},h=new hu({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new yr},radius:{value:4}},vertexShader:BUe,fragmentShader:kUe}),p=h.clone();p.defines.HORIZONTAL_PASS=1;let d=new Ls;d.setAttribute("position",new Rs(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new co(d,h),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=qoe;let v=this.type;this.render=function(S,w,T){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;let C=r.getRenderTarget(),b=r.getActiveCubeFace(),E=r.getActiveMipmapLevel(),I=r.state;I.setBlending(Nh),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);let R=v!==mc&&this.type===mc,A=v===mc&&this.type!==mc;for(let D=0,U=S.length;Dc||n.y>c)&&(n.x>c&&(a.x=Math.floor(c/k.x),n.x=a.x*k.x,z.mapSize.x=a.x),n.y>c&&(a.y=Math.floor(c/k.y),n.y=a.y*k.y,z.mapSize.y=a.y)),z.map===null||R===!0||A===!0){let Y=this.type!==mc?{minFilter:Dn,magFilter:Dn}:{};z.map!==null&&z.map.dispose(),z.map=new xc(n.x,n.y,Y),z.map.texture.name=B.name+".shadowMap",z.camera.updateProjectionMatrix()}r.setRenderTarget(z.map),r.clear();let G=z.getViewportCount();for(let Y=0;Y0||w.map&&w.alphaTest>0){let I=b.uuid,R=w.uuid,A=u[I];A===void 0&&(A={},u[I]=A);let D=A[R];D===void 0&&(D=b.clone(),A[R]=D,w.addEventListener("dispose",M)),b=D}if(b.visible=w.visible,b.wireframe=w.wireframe,C===mc?b.side=w.shadowSide!==null?w.shadowSide:w.side:b.side=w.shadowSide!==null?w.shadowSide:f[w.side],b.alphaMap=w.alphaMap,b.alphaTest=w.alphaTest,b.map=w.map,b.clipShadows=w.clipShadows,b.clippingPlanes=w.clippingPlanes,b.clipIntersection=w.clipIntersection,b.displacementMap=w.displacementMap,b.displacementScale=w.displacementScale,b.displacementBias=w.displacementBias,b.wireframeLinewidth=w.wireframeLinewidth,b.linewidth=w.linewidth,T.isPointLight===!0&&b.isMeshDistanceMaterial===!0){let I=r.properties.get(b);I.light=T}return b}function x(S,w,T,C,b){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&b===mc)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);let R=e.update(S),A=S.material;if(Array.isArray(A)){let D=R.groups;for(let U=0,B=D.length;U=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),z=k>=2);let Y=null,J={},Q=r.getParameter(r.SCISSOR_BOX),V=r.getParameter(r.VIEWPORT),K=new Rr().fromArray(Q),ae=new Rr().fromArray(V);function ve(X,Te,te,Me){let Pe=new Uint8Array(4),xt=r.createTexture();r.bindTexture(X,xt),r.texParameteri(X,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(X,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Ft=0;Ft"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new yr,f=new WeakMap,h,p=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(F,L){return d?new OffscreenCanvas(F,L):IM("canvas")}function m(F,L,ne,le){let me=1,he=ct(F);if((he.width>le||he.height>le)&&(me=le/Math.max(he.width,he.height)),me<1||L===!0)if(typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&F instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&F instanceof ImageBitmap||typeof VideoFrame<"u"&&F instanceof VideoFrame){let et=L?lR:Math.floor,Ke=et(me*he.width),Se=et(me*he.height);h===void 0&&(h=g(Ke,Se));let Ae=ne?g(Ke,Se):h;return Ae.width=Ke,Ae.height=Se,Ae.getContext("2d").drawImage(F,0,0,Ke,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+he.width+"x"+he.height+") to ("+Ke+"x"+Se+")."),Ae}else return"data"in F&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+he.width+"x"+he.height+")."),F;return F}function v(F){let L=ct(F);return ik(L.width)&&ik(L.height)}function _(F){return s?!1:F.wrapS!==uo||F.wrapT!==uo||F.minFilter!==Dn&&F.minFilter!==lo}function y(F,L){return F.generateMipmaps&&L&&F.minFilter!==Dn&&F.minFilter!==lo}function x(F){r.generateMipmap(F)}function M(F,L,ne,le,me=!1){if(s===!1)return L;if(F!==null){if(r[F]!==void 0)return r[F];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+F+"'")}let he=L;if(L===r.RED&&(ne===r.FLOAT&&(he=r.R32F),ne===r.HALF_FLOAT&&(he=r.R16F),ne===r.UNSIGNED_BYTE&&(he=r.R8)),L===r.RED_INTEGER&&(ne===r.UNSIGNED_BYTE&&(he=r.R8UI),ne===r.UNSIGNED_SHORT&&(he=r.R16UI),ne===r.UNSIGNED_INT&&(he=r.R32UI),ne===r.BYTE&&(he=r.R8I),ne===r.SHORT&&(he=r.R16I),ne===r.INT&&(he=r.R32I)),L===r.RG&&(ne===r.FLOAT&&(he=r.RG32F),ne===r.HALF_FLOAT&&(he=r.RG16F),ne===r.UNSIGNED_BYTE&&(he=r.RG8)),L===r.RG_INTEGER&&(ne===r.UNSIGNED_BYTE&&(he=r.RG8UI),ne===r.UNSIGNED_SHORT&&(he=r.RG16UI),ne===r.UNSIGNED_INT&&(he=r.RG32UI),ne===r.BYTE&&(he=r.RG8I),ne===r.SHORT&&(he=r.RG16I),ne===r.INT&&(he=r.RG32I)),L===r.RGBA){let et=me?nR:$r.getTransfer(le);ne===r.FLOAT&&(he=r.RGBA32F),ne===r.HALF_FLOAT&&(he=r.RGBA16F),ne===r.UNSIGNED_BYTE&&(he=et===oi?r.SRGB8_ALPHA8:r.RGBA8),ne===r.UNSIGNED_SHORT_4_4_4_4&&(he=r.RGBA4),ne===r.UNSIGNED_SHORT_5_5_5_1&&(he=r.RGB5_A1)}return(he===r.R16F||he===r.R32F||he===r.RG16F||he===r.RG32F||he===r.RGBA16F||he===r.RGBA32F)&&e.get("EXT_color_buffer_float"),he}function S(F,L,ne){return y(F,ne)===!0||F.isFramebufferTexture&&F.minFilter!==Dn&&F.minFilter!==lo?Math.log2(Math.max(L.width,L.height))+1:F.mipmaps!==void 0&&F.mipmaps.length>0?F.mipmaps.length:F.isCompressedTexture&&Array.isArray(F.image)?L.mipmaps.length:1}function w(F){return F===Dn||F===pae||F===MM?r.NEAREST:r.LINEAR}function T(F){let L=F.target;L.removeEventListener("dispose",T),b(L),L.isVideoTexture&&f.delete(L)}function C(F){let L=F.target;L.removeEventListener("dispose",C),I(L)}function b(F){let L=i.get(F);if(L.__webglInit===void 0)return;let ne=F.source,le=p.get(ne);if(le){let me=le[L.__cacheKey];me.usedTimes--,me.usedTimes===0&&E(F),Object.keys(le).length===0&&p.delete(ne)}i.remove(F)}function E(F){let L=i.get(F);r.deleteTexture(L.__webglTexture);let ne=F.source,le=p.get(ne);delete le[L.__cacheKey],o.memory.textures--}function I(F){let L=i.get(F);if(F.depthTexture&&F.depthTexture.dispose(),F.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(L.__webglFramebuffer[le]))for(let me=0;me=n.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+F+" texture units while this GPU supports only "+n.maxTextures),R+=1,F}function U(F){let L=[];return L.push(F.wrapS),L.push(F.wrapT),L.push(F.wrapR||0),L.push(F.magFilter),L.push(F.minFilter),L.push(F.anisotropy),L.push(F.internalFormat),L.push(F.format),L.push(F.type),L.push(F.generateMipmaps),L.push(F.premultiplyAlpha),L.push(F.flipY),L.push(F.unpackAlignment),L.push(F.colorSpace),L.join()}function B(F,L){let ne=i.get(F);if(F.isVideoTexture&&Ne(F),F.isRenderTargetTexture===!1&&F.version>0&&ne.__version!==F.version){let le=F.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(ne,F,L);return}}t.bindTexture(r.TEXTURE_2D,ne.__webglTexture,r.TEXTURE0+L)}function z(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ae(ne,F,L);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ne.__webglTexture,r.TEXTURE0+L)}function k(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ae(ne,F,L);return}t.bindTexture(r.TEXTURE_3D,ne.__webglTexture,r.TEXTURE0+L)}function G(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ve(ne,F,L);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ne.__webglTexture,r.TEXTURE0+L)}let Y={[h0]:r.REPEAT,[uo]:r.CLAMP_TO_EDGE,[tk]:r.MIRRORED_REPEAT},J={[Dn]:r.NEAREST,[pae]:r.NEAREST_MIPMAP_NEAREST,[MM]:r.NEAREST_MIPMAP_LINEAR,[lo]:r.LINEAR,[vB]:r.LINEAR_MIPMAP_NEAREST,[pm]:r.LINEAR_MIPMAP_LINEAR},Q={[DPe]:r.NEVER,[FPe]:r.ALWAYS,[IPe]:r.LESS,[tse]:r.LEQUAL,[NPe]:r.EQUAL,[zPe]:r.GEQUAL,[UPe]:r.GREATER,[OPe]:r.NOTEQUAL};function V(F,L,ne){if(L.type===fu&&e.has("OES_texture_float_linear")===!1&&(L.magFilter===lo||L.magFilter===vB||L.magFilter===MM||L.magFilter===pm||L.minFilter===lo||L.minFilter===vB||L.minFilter===MM||L.minFilter===pm)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ne?(r.texParameteri(F,r.TEXTURE_WRAP_S,Y[L.wrapS]),r.texParameteri(F,r.TEXTURE_WRAP_T,Y[L.wrapT]),(F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY)&&r.texParameteri(F,r.TEXTURE_WRAP_R,Y[L.wrapR]),r.texParameteri(F,r.TEXTURE_MAG_FILTER,J[L.magFilter]),r.texParameteri(F,r.TEXTURE_MIN_FILTER,J[L.minFilter])):(r.texParameteri(F,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(F,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY)&&r.texParameteri(F,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(L.wrapS!==uo||L.wrapT!==uo)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(F,r.TEXTURE_MAG_FILTER,w(L.magFilter)),r.texParameteri(F,r.TEXTURE_MIN_FILTER,w(L.minFilter)),L.minFilter!==Dn&&L.minFilter!==lo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),L.compareFunction&&(r.texParameteri(F,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(F,r.TEXTURE_COMPARE_FUNC,Q[L.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(L.magFilter===Dn||L.minFilter!==MM&&L.minFilter!==pm||L.type===fu&&e.has("OES_texture_float_linear")===!1||s===!1&&L.type===DM&&e.has("OES_texture_half_float_linear")===!1)return;if(L.anisotropy>1||i.get(L).__currentAnisotropy){let le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(F,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,n.getMaxAnisotropy())),i.get(L).__currentAnisotropy=L.anisotropy}}}function K(F,L){let ne=!1;F.__webglInit===void 0&&(F.__webglInit=!0,L.addEventListener("dispose",T));let le=L.source,me=p.get(le);me===void 0&&(me={},p.set(le,me));let he=U(L);if(he!==F.__cacheKey){me[he]===void 0&&(me[he]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ne=!0),me[he].usedTimes++;let et=me[F.__cacheKey];et!==void 0&&(me[F.__cacheKey].usedTimes--,et.usedTimes===0&&E(L)),F.__cacheKey=he,F.__webglTexture=me[he].texture}return ne}function ae(F,L,ne){let le=r.TEXTURE_2D;(L.isDataArrayTexture||L.isCompressedArrayTexture)&&(le=r.TEXTURE_2D_ARRAY),L.isData3DTexture&&(le=r.TEXTURE_3D);let me=K(F,L),he=L.source;t.bindTexture(le,F.__webglTexture,r.TEXTURE0+ne);let et=i.get(he);if(he.version!==et.__version||me===!0){t.activeTexture(r.TEXTURE0+ne);let Ke=$r.getPrimaries($r.workingColorSpace),Se=L.colorSpace===Dh?null:$r.getPrimaries(L.colorSpace),Ae=L.colorSpace===Dh||Ke===Se?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,L.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,L.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ae);let nt=_(L)&&v(L.image)===!1,$=m(L.image,nt,!1,n.maxTextureSize);$=Ve(L,$);let it=v($)||s,Xe=a.convert(L.format,L.colorSpace),Fe=a.convert(L.type),we=M(L.internalFormat,Xe,Fe,L.colorSpace,L.isVideoTexture);V(le,L,it);let Ie,st=L.mipmaps,Je=s&&L.isVideoTexture!==!0&&we!==ese,kt=et.__version===void 0||me===!0,X=he.dataReady,Te=S(L,$,it);if(L.isDepthTexture)we=r.DEPTH_COMPONENT,s?L.type===fu?we=r.DEPTH_COMPONENT32F:L.type===Ih?we=r.DEPTH_COMPONENT24:L.type===dm?we=r.DEPTH24_STENCIL8:we=r.DEPTH_COMPONENT16:L.type===fu&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===mm&&we===r.DEPTH_COMPONENT&&L.type!==Ok&&L.type!==Ih&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=Ih,Fe=a.convert(L.type)),L.format===p0&&we===r.DEPTH_COMPONENT&&(we=r.DEPTH_STENCIL,L.type!==dm&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=dm,Fe=a.convert(L.type))),kt&&(Je?t.texStorage2D(r.TEXTURE_2D,1,we,$.width,$.height):t.texImage2D(r.TEXTURE_2D,0,we,$.width,$.height,0,Xe,Fe,null));else if(L.isDataTexture)if(st.length>0&&it){Je&&kt&&t.texStorage2D(r.TEXTURE_2D,Te,we,st[0].width,st[0].height);for(let te=0,Me=st.length;te>=1,Me>>=1}}else if(st.length>0&&it){if(Je&&kt){let te=ct(st[0]);t.texStorage2D(r.TEXTURE_2D,Te,we,te.width,te.height)}for(let te=0,Me=st.length;te0&&X++;let te=ct($[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,X,Ie,te.width,te.height)}for(let te=0;te<6;te++)if(nt){st?kt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,$[te].width,$[te].height,Fe,we,$[te].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,Ie,$[te].width,$[te].height,0,Fe,we,$[te].data);for(let Me=0;Me>he),$=Math.max(1,L.height>>he);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,he,Se,nt,$,L.depth,0,et,Ke,null):t.texImage2D(me,he,Se,nt,$,0,et,Ke,null)}t.bindFramebuffer(r.FRAMEBUFFER,F),Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,0,Le(L)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,he),t.bindFramebuffer(r.FRAMEBUFFER,null)}function se(F,L,ne){if(r.bindRenderbuffer(r.RENDERBUFFER,F),L.depthBuffer&&!L.stencilBuffer){let le=s===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(ne||Ue(L)){let me=L.depthTexture;me&&me.isDepthTexture&&(me.type===fu?le=r.DEPTH_COMPONENT32F:me.type===Ih&&(le=r.DEPTH_COMPONENT24));let he=Le(L);Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,he,le,L.width,L.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,he,le,L.width,L.height)}else r.renderbufferStorage(r.RENDERBUFFER,le,L.width,L.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,F)}else if(L.depthBuffer&&L.stencilBuffer){let le=Le(L);ne&&Ue(L)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,L.width,L.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,F)}else{let le=L.textures;for(let me=0;me1,Ke=v(F)||s;if(et||(le.__webglTexture===void 0&&(le.__webglTexture=r.createTexture()),le.__version=L.version,o.memory.textures++),he){ne.__webglFramebuffer=[];for(let Se=0;Se<6;Se++)if(s&&L.mipmaps&&L.mipmaps.length>0){ne.__webglFramebuffer[Se]=[];for(let Ae=0;Ae0){ne.__webglFramebuffer=[];for(let Se=0;Se0&&Ue(F)===!1){ne.__webglMultisampledFramebuffer=r.createFramebuffer(),ne.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ne.__webglMultisampledFramebuffer);for(let Se=0;Se0)for(let Ae=0;Ae0)for(let Ae=0;Ae0&&Ue(F)===!1){let L=F.textures,ne=F.width,le=F.height,me=r.COLOR_BUFFER_BIT,he=[],et=F.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ke=i.get(F),Se=L.length>1;if(Se)for(let Ae=0;Ae0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function Ne(F){let L=o.render.frame;f.get(F)!==L&&(f.set(F,L),F.update())}function Ve(F,L){let ne=F.colorSpace,le=F.format,me=F.type;return F.isCompressedTexture===!0||F.isVideoTexture===!0||F.format===rk||ne!==Xh&&ne!==Dh&&($r.getTransfer(ne)===oi?s===!1?e.has("EXT_sRGB")===!0&&le===Cs?(F.format=rk,F.minFilter=lo,F.generateMipmaps=!1):L=uR.sRGBToLinear(L):(le!==Cs||me!==Oh)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ne)),L}function ct(F){return typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement?(c.width=F.naturalWidth||F.width,c.height=F.naturalHeight||F.height):typeof VideoFrame<"u"&&F instanceof VideoFrame?(c.width=F.displayWidth,c.height=F.displayHeight):(c.width=F.width,c.height=F.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=A,this.setTexture2D=B,this.setTexture2DArray=z,this.setTexture3D=k,this.setTextureCube=G,this.rebindTextures=H,this.setupRenderTarget=We,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=Ue}function WUe(r,e,t){let i=t.isWebGL2;function n(a,o=Dh){let s,l=$r.getTransfer(o);if(a===Oh)return r.UNSIGNED_BYTE;if(a===joe)return r.UNSIGNED_SHORT_4_4_4_4;if(a===Koe)return r.UNSIGNED_SHORT_5_5_5_1;if(a===xPe)return r.BYTE;if(a===SPe)return r.SHORT;if(a===Ok)return r.UNSIGNED_SHORT;if(a===Zoe)return r.INT;if(a===Ih)return r.UNSIGNED_INT;if(a===fu)return r.FLOAT;if(a===DM)return i?r.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(a===MPe)return r.ALPHA;if(a===Cs)return r.RGBA;if(a===bPe)return r.LUMINANCE;if(a===wPe)return r.LUMINANCE_ALPHA;if(a===mm)return r.DEPTH_COMPONENT;if(a===p0)return r.DEPTH_STENCIL;if(a===rk)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(a===TPe)return r.RED;if(a===Joe)return r.RED_INTEGER;if(a===EPe)return r.RG;if(a===$oe)return r.RG_INTEGER;if(a===Qoe)return r.RGBA_INTEGER;if(a===gB||a===yB||a===_B||a===xB)if(l===oi)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(a===gB)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===yB)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===_B)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===xB)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(a===gB)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===yB)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===_B)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===xB)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===dae||a===mae||a===vae||a===gae)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(a===dae)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===mae)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===vae)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===gae)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===ese)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===yae||a===_ae)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(a===yae)return l===oi?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(a===_ae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===xae||a===Sae||a===Mae||a===bae||a===wae||a===Tae||a===Eae||a===Aae||a===Cae||a===Rae||a===Lae||a===Pae||a===Dae||a===Iae)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(a===xae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===Sae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===Mae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===bae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===wae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===Tae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===Eae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===Aae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===Cae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===Rae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===Lae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===Pae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===Dae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===Iae)return l===oi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===SB||a===Nae||a===Uae)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(a===SB)return l===oi?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===Nae)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===Uae)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===APe||a===Oae||a===zae||a===Fae)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(a===SB)return s.COMPRESSED_RED_RGTC1_EXT;if(a===Oae)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===zae)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===Fae)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===dm?i?r.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):r[a]!==void 0?r[a]:null}return{convert:n}}var vk=class extends Nn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},_c=class extends ia{constructor(){super(),this.isGroup=!0,this.type="Group"}},XUe={type:"move"},LM=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new _c,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 _c,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ye,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ye),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new _c,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ye,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ye),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}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data: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 n=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(let g of e.hand.values()){let m=t.getJointPose(g,i),v=this._getHandJoint(u,g);m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=m.radius),v.visible=m!==null}let c=u.joints["index-finger-tip"],f=u.joints["thumb-tip"],h=c.position.distanceTo(f.position),p=.02,d=.005;u.inputState.pinching&&h>p+d?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&h<=p-d&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&a!==null&&(n=a),n!==null&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(XUe)))}return s!==null&&(s.visible=n!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new _c;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}},YUe=` void main() { gl_Position = vec4( position, 1.0 ); -}`,XUe=` +}`,qUe=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -12540,4 +12540,4 @@ void main() { } -}`,vk=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){let n=new Vo,a=e.properties.get(n);a.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}render(e,t){if(this.texture!==null){if(this.mesh===null){let i=t.cameras[0].viewport,n=new pu({extensions:{fragDepth:!0},vertexShader:WUe,fragmentShader:XUe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new so(new vR(20,20),n)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}},gk=class extends Oh{constructor(e,t){super();let i=this,n=null,a=1,o=null,s="local-floor",l=1,u=null,c=null,f=null,h=null,p=null,d=null,g=new vk,m=t.getContextAttributes(),v=null,_=null,y=[],x=[],M=new yr,S=null,w=new Nn;w.layers.enable(1),w.viewport=new Pr;let T=new Nn;T.layers.enable(2),T.viewport=new Pr;let C=[w,T],b=new mk;b.layers.enable(1),b.layers.enable(2);let E=null,I=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let K=y[V];return K===void 0&&(K=new RM,y[V]=K),K.getTargetRaySpace()},this.getControllerGrip=function(V){let K=y[V];return K===void 0&&(K=new RM,y[V]=K),K.getGripSpace()},this.getHand=function(V){let K=y[V];return K===void 0&&(K=new RM,y[V]=K),K.getHandSpace()};function R(V){let K=x.indexOf(V.inputSource);if(K===-1)return;let ae=y[K];ae!==void 0&&(ae.update(V.inputSource,V.frame,u||o),ae.dispatchEvent({type:V.type,data:V.inputSource}))}function A(){n.removeEventListener("select",R),n.removeEventListener("selectstart",R),n.removeEventListener("selectend",R),n.removeEventListener("squeeze",R),n.removeEventListener("squeezestart",R),n.removeEventListener("squeezeend",R),n.removeEventListener("end",A),n.removeEventListener("inputsourceschange",D);for(let V=0;V=0&&(x[ve]=null,y[ve].disconnect(ae))}for(let K=0;K=x.length){x.push(ae),ve=se;break}else if(x[se]===null){x[se]=ae,ve=se;break}if(ve===-1)break}let ue=y[ve];ue&&ue.connect(ae)}}let U=new ye,B=new ye;function F(V,K,ae){U.setFromMatrixPosition(K.matrixWorld),B.setFromMatrixPosition(ae.matrixWorld);let ve=U.distanceTo(B),ue=K.projectionMatrix.elements,se=ae.projectionMatrix.elements,Ee=ue[14]/(ue[10]-1),q=ue[14]/(ue[10]+1),H=(ue[9]+1)/ue[5],We=(ue[9]-1)/ue[5],_e=(ue[8]-1)/ue[0],xe=(se[8]+1)/se[0],Le=Ee*_e,Ue=Ee*xe,Ne=ve/(-_e+xe),Ve=Ne*-_e;K.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ve),V.translateZ(Ne),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert();let ct=Ee+Ne,z=q+Ne,L=Le-Ve,ne=Ue+(ve-Ve),le=H*q/z*ct,me=We*q/z*ct;V.projectionMatrix.makePerspective(L,ne,le,me,ct,z),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}function k(V,K){K===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(K.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(n===null)return;g.texture!==null&&(V.near=g.depthNear,V.far=g.depthFar),b.near=T.near=w.near=V.near,b.far=T.far=w.far=V.far,(E!==b.near||I!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),E=b.near,I=b.far,w.near=E,w.far=I,T.near=E,T.far=I,w.updateProjectionMatrix(),T.updateProjectionMatrix(),V.updateProjectionMatrix());let K=V.parent,ae=b.cameras;k(b,K);for(let ve=0;ve0&&(m.alphaTest.value=v.alphaTest);let _=e.get(v),y=_.envMap,x=_.envMapRotation;if(y&&(m.envMap.value=y,sm.copy(x),sm.x*=-1,sm.y*=-1,sm.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(sm.y*=-1,sm.z*=-1),m.envMapRotation.value.setFromMatrix4(YUe.makeRotationFromEuler(sm)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=v.reflectivity,m.ior.value=v.ior,m.refractionRatio.value=v.refractionRatio),v.lightMap){m.lightMap.value=v.lightMap;let M=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=v.lightMapIntensity*M,t(v.lightMap,m.lightMapTransform)}v.aoMap&&(m.aoMap.value=v.aoMap,m.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,m.aoMapTransform))}function o(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform))}function s(m,v){m.dashSize.value=v.dashSize,m.totalSize.value=v.dashSize+v.gapSize,m.scale.value=v.scale}function l(m,v,_,y){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.size.value=v.size*_,m.scale.value=y*.5,v.map&&(m.map.value=v.map,t(v.map,m.uvTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function u(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.rotation.value=v.rotation,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function c(m,v){m.specular.value.copy(v.specular),m.shininess.value=Math.max(v.shininess,1e-4)}function f(m,v){v.gradientMap&&(m.gradientMap.value=v.gradientMap)}function h(m,v){m.metalness.value=v.metalness,v.metalnessMap&&(m.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,m.metalnessMapTransform)),m.roughness.value=v.roughness,v.roughnessMap&&(m.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,m.roughnessMapTransform)),e.get(v).envMap&&(m.envMapIntensity.value=v.envMapIntensity)}function p(m,v,_){m.ior.value=v.ior,v.sheen>0&&(m.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),m.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(m.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,m.sheenColorMapTransform)),v.sheenRoughnessMap&&(m.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,m.sheenRoughnessMapTransform))),v.clearcoat>0&&(m.clearcoat.value=v.clearcoat,m.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(m.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,m.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(m.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===lo&&m.clearcoatNormalScale.value.negate())),v.iridescence>0&&(m.iridescence.value=v.iridescence,m.iridescenceIOR.value=v.iridescenceIOR,m.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(m.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,m.iridescenceMapTransform)),v.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),v.transmission>0&&(m.transmission.value=v.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),v.transmissionMap&&(m.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,m.transmissionMapTransform)),m.thickness.value=v.thickness,v.thicknessMap&&(m.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=v.attenuationDistance,m.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(m.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(m.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=v.specularIntensity,m.specularColor.value.copy(v.specularColor),v.specularColorMap&&(m.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,m.specularColorMapTransform)),v.specularIntensityMap&&(m.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,m.specularIntensityMapTransform))}function d(m,v){v.matcap&&(m.matcap.value=v.matcap)}function g(m,v){let _=e.get(v).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function ZUe(r,e,t,i){let n={},a={},o=[],s=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(_,y){let x=y.program;i.uniformBlockBinding(_,x)}function u(_,y){let x=n[_.id];x===void 0&&(d(_),x=c(_),n[_.id]=x,_.addEventListener("dispose",m));let M=y.program;i.updateUBOMapping(_,M);let S=e.render.frame;a[_.id]!==S&&(h(_),a[_.id]=S)}function c(_){let y=f();_.__bindingPointIndex=y;let x=r.createBuffer(),M=_.__size,S=_.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,M,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,x),x}function f(){for(let _=0;_0&&(x+=M-S),_.__size=x,_.__cache={},this}function g(_){let y={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),y}function m(_){let y=_.target;y.removeEventListener("dispose",m);let x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),r.deleteBuffer(n[y.id]),delete n[y.id],delete a[y.id]}function v(){for(let _ in n)r.deleteBuffer(n[_]);o=[],n={},a={}}return{bind:l,update:u,dispose:v}}var yk=class{constructor(e={}){let{canvas:t=JPe(),context:i=null,depth:n=!0,stencil:a=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let h;i!==null?h=i.getContextAttributes().alpha:h=o;let p=new Uint32Array(4),d=new Int32Array(4),g=null,m=null,v=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ma,this._useLegacyLights=!1,this.toneMapping=Ih,this.toneMappingExposure=1;let y=this,x=!1,M=0,S=0,w=null,T=-1,C=null,b=new Pr,E=new Pr,I=null,R=new er(0),A=0,D=t.width,U=t.height,B=1,F=null,k=null,G=new Pr(0,0,D,U),Y=new Pr(0,0,D,U),J=!1,Q=new UM,V=!1,K=!1,ae=null,ve=new Ht,ue=new yr,se=new ye,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return w===null?B:1}let H=i;function We(O,j){for(let re=0;re{function W(){if(ie.forEach(function(ee){Ne.get(ee).currentProgram.isReady()&&ie.delete(ee)}),ie.size===0){P(O);return}setTimeout(W,10)}_e.get("KHR_parallel_shader_compile")!==null?W():setTimeout(W,10)})};let zt=null;function Mr(O){zt&&zt(O)}function Zr(){Dr.stop()}function Vt(){Dr.start()}let Dr=new ise;Dr.setAnimationLoop(Mr),typeof self<"u"&&Dr.setContext(self),this.setAnimationLoop=function(O){zt=O,Je.setAnimationLoop(O),O===null?Dr.stop():Dr.start()},Je.addEventListener("sessionstart",Zr),Je.addEventListener("sessionend",Vt),this.render=function(O,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Je.enabled===!0&&Je.isPresenting===!0&&(Je.cameraAutoUpdate===!0&&Je.updateCamera(j),j=Je.getCamera()),O.isScene===!0&&O.onBeforeRender(y,O,j,w),m=Ke.get(O,_.length),m.init(),_.push(m),ve.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),Q.setFromProjectionMatrix(ve),K=this.localClippingEnabled,V=Se.init(this.clippingPlanes,K),g=et.get(O,v.length),g.init(),v.push(g),oi(O,j,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(F,k),this.info.render.frame++,V===!0&&Se.beginShadows();let re=m.state.shadowsArray;if(Ae.render(re,O,j),V===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Je.enabled===!1||Je.isPresenting===!1||Je.hasDepthSensing()===!1)&&nt.render(g,O),m.setupLights(y._useLegacyLights),j.isArrayCamera){let ie=j.cameras;for(let P=0,W=ie.length;P0?m=_[_.length-1]:m=null,v.pop(),v.length>0?g=v[v.length-1]:g=null};function oi(O,j,re,ie){if(O.visible===!1)return;if(O.layers.test(j.layers)){if(O.isGroup)re=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(j);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||Q.intersectsSprite(O)){ie&&se.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ve);let ee=le.update(O),ge=O.material;ge.visible&&g.push(O,ee,ge,re,se.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||Q.intersectsObject(O))){let ee=le.update(O),ge=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),se.copy(O.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),se.copy(ee.boundingSphere.center)),se.applyMatrix4(O.matrixWorld).applyMatrix4(ve)),Array.isArray(ge)){let ce=ee.groups;for(let Oe=0,Ge=ce.length;Oe0&&M0(P,W,j,re),ie&&Le.viewport(b.copy(ie)),P.length>0&&Ds(P,j,re),W.length>0&&Ds(W,j,re),ee.length>0&&Ds(ee,j,re),Le.buffers.depth.setTest(!0),Le.buffers.depth.setMask(!0),Le.buffers.color.setMask(!0),Le.setPolygonOffset(!1)}function M0(O,j,re,ie){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;let W=xe.isWebGL2;ae===null&&(ae=new Sc(1,1,{generateMipmaps:!0,type:_e.has("EXT_color_buffer_half_float")?PM:Nh,minFilter:fm,samples:W?4:0})),y.getDrawingBufferSize(ue),W?ae.setSize(ue.x,ue.y):ae.setSize(sR(ue.x),sR(ue.y));let ee=y.getRenderTarget();y.setRenderTarget(ae),y.getClearColor(R),A=y.getClearAlpha(),A<1&&y.setClearColor(16777215,.5),y.clear();let ge=y.toneMapping;y.toneMapping=Ih,Ds(O,re,ie),Ve.updateMultisampleRenderTarget(ae),Ve.updateRenderTargetMipmap(ae);let ce=!1;for(let Oe=0,Ge=j.length;Oe0),Re=!!re.morphAttributes.position,pt=!!re.morphAttributes.normal,mt=!!re.morphAttributes.color,$e=Ih;ie.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&($e=y.toneMapping);let at=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,wt=at!==void 0?at.length:0,je=Ne.get(ie),mi=m.state.lights;if(V===!0&&(K===!0||O!==C)){let jr=O===C&&ie.id===T;Se.setState(ie,O,jr)}let Ut=!1;ie.version===je.__version?(je.needsLights&&je.lightsStateVersion!==mi.state.version||je.outputColorSpace!==ge||P.isBatchedMesh&&je.batching===!1||!P.isBatchedMesh&&je.batching===!0||P.isInstancedMesh&&je.instancing===!1||!P.isInstancedMesh&&je.instancing===!0||P.isSkinnedMesh&&je.skinning===!1||!P.isSkinnedMesh&&je.skinning===!0||P.isInstancedMesh&&je.instancingColor===!0&&P.instanceColor===null||P.isInstancedMesh&&je.instancingColor===!1&&P.instanceColor!==null||P.isInstancedMesh&&je.instancingMorph===!0&&P.morphTexture===null||P.isInstancedMesh&&je.instancingMorph===!1&&P.morphTexture!==null||je.envMap!==ce||ie.fog===!0&&je.fog!==W||je.numClippingPlanes!==void 0&&(je.numClippingPlanes!==Se.numPlanes||je.numIntersection!==Se.numIntersection)||je.vertexAlphas!==Oe||je.vertexTangents!==Ge||je.morphTargets!==Re||je.morphNormals!==pt||je.morphColors!==mt||je.toneMapping!==$e||xe.isWebGL2===!0&&je.morphTargetsCount!==wt)&&(Ut=!0):(Ut=!0,je.__version=ie.version);let Rr=je.currentProgram;Ut===!0&&(Rr=Go(ie,j,P));let Wi=!1,Mt=!1,Mi=!1,sr=Rr.getUniforms(),un=je.uniforms;if(Le.useProgram(Rr.program)&&(Wi=!0,Mt=!0,Mi=!0),ie.id!==T&&(T=ie.id,Mt=!0),Wi||C!==O){sr.setValue(H,"projectionMatrix",O.projectionMatrix),sr.setValue(H,"viewMatrix",O.matrixWorldInverse);let jr=sr.map.cameraPosition;jr!==void 0&&jr.setValue(H,se.setFromMatrixPosition(O.matrixWorld)),xe.logarithmicDepthBuffer&&sr.setValue(H,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&sr.setValue(H,"isOrthographic",O.isOrthographicCamera===!0),C!==O&&(C=O,Mt=!0,Mi=!0)}if(P.isSkinnedMesh){sr.setOptional(H,P,"bindMatrix"),sr.setOptional(H,P,"bindMatrixInverse");let jr=P.skeleton;jr&&(xe.floatVertexTextures?(jr.boneTexture===null&&jr.computeBoneTexture(),sr.setValue(H,"boneTexture",jr.boneTexture,Ve)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}P.isBatchedMesh&&(sr.setOptional(H,P,"batchingTexture"),sr.setValue(H,"batchingTexture",P._matricesTexture,Ve));let mu=re.morphAttributes;if((mu.position!==void 0||mu.normal!==void 0||mu.color!==void 0&&xe.isWebGL2===!0)&&$.update(P,re,Rr),(Mt||je.receiveShadow!==P.receiveShadow)&&(je.receiveShadow=P.receiveShadow,sr.setValue(H,"receiveShadow",P.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(un.envMap.value=ce,un.flipEnvMap.value=ce.isCubeTexture&&ce.isRenderTargetTexture===!1?-1:1),Mt&&(sr.setValue(H,"toneMappingExposure",y.toneMappingExposure),je.needsLights&&w0(un,Mi),W&&ie.fog===!0&&he.refreshFogUniforms(un,W),he.refreshMaterialUniforms(un,ie,B,U,ae),s0.upload(H,Zh(je),un,Ve)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(s0.upload(H,Zh(je),un,Ve),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&sr.setValue(H,"center",P.center),sr.setValue(H,"modelViewMatrix",P.modelViewMatrix),sr.setValue(H,"normalMatrix",P.normalMatrix),sr.setValue(H,"modelMatrix",P.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){let jr=ie.uniformsGroups;for(let vu=0,jh=jr.length;vu0&&Ve.useMultisampledRTT(O)===!1?P=Ne.get(O).__webglMultisampledFramebuffer:Array.isArray(Ge)?P=Ge[re]:P=Ge,b.copy(O.viewport),E.copy(O.scissor),I=O.scissorTest}else b.copy(G).multiplyScalar(B).floor(),E.copy(Y).multiplyScalar(B).floor(),I=J;if(Le.bindFramebuffer(H.FRAMEBUFFER,P)&&xe.drawBuffers&&ie&&Le.drawBuffers(O,P),Le.viewport(b),Le.scissor(E),Le.setScissorTest(I),W){let ce=Ne.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce.__webglTexture,re)}else if(ee){let ce=Ne.get(O.texture),Oe=j||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,ce.__webglTexture,re||0,Oe)}T=-1},this.readRenderTargetPixels=function(O,j,re,ie,P,W,ee){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Ne.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&ee!==void 0&&(ge=ge[ee]),ge){Le.bindFramebuffer(H.FRAMEBUFFER,ge);try{let ce=O.texture,Oe=ce.format,Ge=ce.type;if(Oe!==As&&ze.convert(Oe)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Re=Ge===PM&&(_e.has("EXT_color_buffer_half_float")||xe.isWebGL2&&_e.has("EXT_color_buffer_float"));if(Ge!==Nh&&ze.convert(Ge)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ge===hu&&(xe.isWebGL2||_e.has("OES_texture_float")||_e.has("WEBGL_color_buffer_float")))&&!Re){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=O.width-ie&&re>=0&&re<=O.height-P&&H.readPixels(j,re,ie,P,ze.convert(Oe),ze.convert(Ge),W)}finally{let ce=w!==null?Ne.get(w).__webglFramebuffer:null;Le.bindFramebuffer(H.FRAMEBUFFER,ce)}}},this.copyFramebufferToTexture=function(O,j,re=0){let ie=Math.pow(2,-re),P=Math.floor(j.image.width*ie),W=Math.floor(j.image.height*ie);Ve.setTexture2D(j,0),H.copyTexSubImage2D(H.TEXTURE_2D,re,0,0,O.x,O.y,P,W),Le.unbindTexture()},this.copyTextureToTexture=function(O,j,re,ie=0){let P=j.image.width,W=j.image.height,ee=ze.convert(re.format),ge=ze.convert(re.type);Ve.setTexture2D(re,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,re.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,re.unpackAlignment),j.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,P,W,ee,ge,j.image.data):j.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,j.mipmaps[0].width,j.mipmaps[0].height,ee,j.mipmaps[0].data):H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,ee,ge,j.image),ie===0&&re.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),Le.unbindTexture()},this.copyTextureToTexture3D=function(O,j,re,ie,P=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let W=Math.round(O.max.x-O.min.x),ee=Math.round(O.max.y-O.min.y),ge=O.max.z-O.min.z+1,ce=ze.convert(ie.format),Oe=ze.convert(ie.type),Ge;if(ie.isData3DTexture)Ve.setTexture3D(ie,0),Ge=H.TEXTURE_3D;else if(ie.isDataArrayTexture||ie.isCompressedArrayTexture)Ve.setTexture2DArray(ie,0),Ge=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,ie.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,ie.unpackAlignment);let Re=H.getParameter(H.UNPACK_ROW_LENGTH),pt=H.getParameter(H.UNPACK_IMAGE_HEIGHT),mt=H.getParameter(H.UNPACK_SKIP_PIXELS),$e=H.getParameter(H.UNPACK_SKIP_ROWS),at=H.getParameter(H.UNPACK_SKIP_IMAGES),wt=re.isCompressedTexture?re.mipmaps[P]:re.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,wt.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,wt.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,O.min.x),H.pixelStorei(H.UNPACK_SKIP_ROWS,O.min.y),H.pixelStorei(H.UNPACK_SKIP_IMAGES,O.min.z),re.isDataTexture||re.isData3DTexture?H.texSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,Oe,wt.data):ie.isCompressedArrayTexture?H.compressedTexSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,wt.data):H.texSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,Oe,wt),H.pixelStorei(H.UNPACK_ROW_LENGTH,Re),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,pt),H.pixelStorei(H.UNPACK_SKIP_PIXELS,mt),H.pixelStorei(H.UNPACK_SKIP_ROWS,$e),H.pixelStorei(H.UNPACK_SKIP_IMAGES,at),P===0&&ie.generateMipmaps&&H.generateMipmap(Ge),Le.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?Ve.setTextureCube(O,0):O.isData3DTexture?Ve.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?Ve.setTexture2DArray(O,0):Ve.setTexture2D(O,0),Le.unbindTexture()},this.resetState=function(){M=0,S=0,w=null,Le.reset(),we.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return _c}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===Fk?"display-p3":"srgb",t.unpackColorSpace=Jr.workingColorSpace===OR?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}},_k=class extends yk{};_k.prototype.isWebGL1Renderer=!0;var Roe=new ye,Loe=new Pr,Poe=new Pr,jUe=new ye,Doe=new Ht,jC=new ye,YB=new zh,Ioe=new Ht,qB=new IM,_R=class extends so{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=uae,this.bindMatrix=new Ht,this.bindMatrixInverse=new Ht,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Fh),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let i=0;il)continue;h.applyMatrix4(this.matrixWorld);let T=e.ray.origin.distanceTo(h);Te.far||t.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{let v=Math.max(0,o.start),_=Math.min(m.count,o.start+o.count);for(let y=v,x=_-1;yl)continue;h.applyMatrix4(this.matrixWorld);let S=e.ray.origin.distanceTo(h);Se.far||t.push({distance:S,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a0)l=n-1;else{l=n;break}if(n=l,i[n]===o)return n/(a-1);let c=i[n],h=i[n+1]-c,p=(o-c)/h;return(n+p)/(a-1)}getTangent(e,t){let n=e-1e-4,a=e+1e-4;n<0&&(n=0),a>1&&(a=1);let o=this.getPoint(n),s=this.getPoint(a),l=t||(o.isVector2?new yr:new ye);return l.copy(s).sub(o).normalize(),l}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new ye,n=[],a=[],o=[],s=new ye,l=new Ht;for(let p=0;p<=e;p++){let d=p/e;n[p]=this.getTangentAt(d,new ye)}a[0]=new ye,o[0]=new ye;let u=Number.MAX_VALUE,c=Math.abs(n[0].x),f=Math.abs(n[0].y),h=Math.abs(n[0].z);c<=u&&(u=c,i.set(1,0,0)),f<=u&&(u=f,i.set(0,1,0)),h<=u&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),a[0].crossVectors(n[0],s),o[0].crossVectors(n[0],a[0]);for(let p=1;p<=e;p++){if(a[p]=a[p-1].clone(),o[p]=o[p-1].clone(),s.crossVectors(n[p-1],n[p]),s.length()>Number.EPSILON){s.normalize();let d=Math.acos(In(n[p-1].dot(n[p]),-1,1));a[p].applyMatrix4(l.makeRotationAxis(s,d))}o[p].crossVectors(n[p],a[p])}if(t===!0){let p=Math.acos(In(a[0].dot(a[e]),-1,1));p/=e,n[0].dot(s.crossVectors(a[0],a[e]))>0&&(p=-p);for(let d=1;d<=e;d++)a[d].applyMatrix4(l.makeRotationAxis(n[d],p*d)),o[d].crossVectors(n[d],a[d])}return{tangents:n,normals:a,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}};var JUe={triangulate:function(r,e,t=2){let i=e&&e.length,n=i?e[0]*t:r.length,a=use(r,0,n,t,!0),o=[];if(!a||a.next===a.prev)return o;let s,l,u,c,f,h,p;if(i&&(a=rOe(r,e,a,t)),r.length>80*t){s=u=r[0],l=c=r[1];for(let d=t;du&&(u=f),h>c&&(c=h);p=Math.max(u-s,c-l),p=p!==0?32767/p:0}return FM(a,o,t,s,l,p,0),o}};function use(r,e,t,i,n){let a,o;if(n===pOe(r,e,t,i)>0)for(a=e;a=e;a-=i)o=zoe(a,r[a],r[a+1],o);return o&&zR(o,o.next)&&(BM(o),o=o.next),o}function dm(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=!1,!t.steiner&&(zR(t,t.next)||Si(t.prev,t,t.next)===0)){if(BM(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function FM(r,e,t,i,n,a,o){if(!r)return;!o&&a&&sOe(r,i,n,a);let s=r,l,u;for(;r.prev!==r.next;){if(l=r.prev,u=r.next,a?QUe(r,i,n,a):$Ue(r)){e.push(l.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),BM(r),r=u.next,s=u.next;continue}if(r=u,r===s){o?o===1?(r=eOe(dm(r),e,t),FM(r,e,t,i,n,a,2)):o===2&&tOe(r,e,t,i,n,a):FM(dm(r),e,t,i,n,a,1);break}}}function $Ue(r){let e=r.prev,t=r,i=r.next;if(Si(e,t,i)>=0)return!1;let n=e.x,a=t.x,o=i.x,s=e.y,l=t.y,u=i.y,c=na?n>o?n:o:a>o?a:o,p=s>l?s>u?s:u:l>u?l:u,d=i.next;for(;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=f&&d.y<=p&&n0(n,s,a,l,o,u,d.x,d.y)&&Si(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function QUe(r,e,t,i){let n=r.prev,a=r,o=r.next;if(Si(n,a,o)>=0)return!1;let s=n.x,l=a.x,u=o.x,c=n.y,f=a.y,h=o.y,p=sl?s>u?s:u:l>u?l:u,m=c>f?c>h?c:h:f>h?f:h,v=Sk(p,d,e,t,i),_=Sk(g,m,e,t,i),y=r.prevZ,x=r.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=g&&y.y>=d&&y.y<=m&&y!==n&&y!==o&&n0(s,c,l,f,u,h,y.x,y.y)&&Si(y.prev,y,y.next)>=0||(y=y.prevZ,x.x>=p&&x.x<=g&&x.y>=d&&x.y<=m&&x!==n&&x!==o&&n0(s,c,l,f,u,h,x.x,x.y)&&Si(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=g&&y.y>=d&&y.y<=m&&y!==n&&y!==o&&n0(s,c,l,f,u,h,y.x,y.y)&&Si(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=g&&x.y>=d&&x.y<=m&&x!==n&&x!==o&&n0(s,c,l,f,u,h,x.x,x.y)&&Si(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function eOe(r,e,t){let i=r;do{let n=i.prev,a=i.next.next;!zR(n,a)&&cse(n,i,i.next,a)&&zM(n,a)&&zM(a,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(a.i/t|0),BM(i),BM(i.next),i=r=a),i=i.next}while(i!==r);return dm(i)}function tOe(r,e,t,i,n,a){let o=r;do{let s=o.next.next;for(;s!==o.prev;){if(o.i!==s.i&&cOe(o,s)){let l=fse(o,s);o=dm(o,o.next),l=dm(l,l.next),FM(o,e,t,i,n,a,0),FM(l,e,t,i,n,a,0);return}s=s.next}o=o.next}while(o!==r)}function rOe(r,e,t,i){let n=[],a,o,s,l,u;for(a=0,o=e.length;a=t.next.y&&t.next.y!==t.y){let h=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=a&&h>i&&(i=h,n=t.x=t.x&&t.x>=l&&a!==t.x&&n0(on.x||t.x===n.x&&oOe(n,t)))&&(n=t,c=f)),t=t.next;while(t!==s);return n}function oOe(r,e){return Si(r.prev,r,e.prev)<0&&Si(e.next,r,r.next)<0}function sOe(r,e,t,i){let n=r;do n.z===0&&(n.z=Sk(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,lOe(n)}function lOe(r){let e,t,i,n,a,o,s,l,u=1;do{for(t=r,r=null,a=null,o=0;t;){for(o++,i=t,s=0,e=0;e0||l>0&&i;)s!==0&&(l===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,s--):(n=i,i=i.nextZ,l--),a?a.nextZ=n:r=n,n.prevZ=a,a=n;t=i}a.nextZ=null,u*=2}while(o>1);return r}function Sk(r,e,t,i,n){return r=(r-t)*n|0,e=(e-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function uOe(r){let e=r,t=r;do(e.x=(r-o)*(a-s)&&(r-o)*(i-s)>=(t-o)*(e-s)&&(t-o)*(a-s)>=(n-o)*(i-s)}function cOe(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!fOe(r,e)&&(zM(r,e)&&zM(e,r)&&hOe(r,e)&&(Si(r.prev,r,e.prev)||Si(r,e.prev,e))||zR(r,e)&&Si(r.prev,r,r.next)>0&&Si(e.prev,e,e.next)>0)}function Si(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function zR(r,e){return r.x===e.x&&r.y===e.y}function cse(r,e,t,i){let n=$C(Si(r,e,t)),a=$C(Si(r,e,i)),o=$C(Si(t,i,r)),s=$C(Si(t,i,e));return!!(n!==a&&o!==s||n===0&&JC(r,t,e)||a===0&&JC(r,i,e)||o===0&&JC(t,r,i)||s===0&&JC(t,e,i))}function JC(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function $C(r){return r>0?1:r<0?-1:0}function fOe(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&cse(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function zM(r,e){return Si(r.prev,r,r.next)<0?Si(r,e,r.next)>=0&&Si(r,r.prev,e)>=0:Si(r,e,r.prev)<0||Si(r,r.next,e)<0}function hOe(r,e){let t=r,i=!1,n=(r.x+e.x)/2,a=(r.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&n<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function fse(r,e){let t=new Mk(r.i,r.x,r.y),i=new Mk(e.i,e.x,e.y),n=r.next,a=e.prev;return r.next=e,e.prev=r,t.next=n,n.prev=t,i.next=t,t.prev=i,a.next=i,i.prev=a,i}function zoe(r,e,t,i){let n=new Mk(r,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function BM(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Mk(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function pOe(r,e,t,i){let n=0;for(let a=e,o=t-i;a2&&r[e-1].equals(r[0])&&r.pop()}function koe(r,e){for(let t=0;t=a)){let s=t[1];e=a)break t}o=i,i=0;break r}break e}for(;i>>1;et;)--o;if(++o,a!==0||o!==n){a>=o&&(o=Math.max(o,1),a=o-1);let s=this.getValueSize();this.times=i.slice(a,o),this.values=this.values.slice(a*s,o*s)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,n=this.values,a=i.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let s=0;s!==a;s++){let l=i[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,o),e=!1;break}o=l}if(n!==void 0&&dOe(n))for(let s=0,l=n.length;s!==l;++s){let u=n[s];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,u),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),n=this.getInterpolation()===SB,a=e.length-1,o=1;for(let s=1;s0){e[o]=e[a];for(let s=a*i,l=o*i,u=0;u!==i;++u)t[l+u]=t[s+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),i=this.constructor,n=new i(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}};Ls.prototype.TimeBufferType=Float32Array;Ls.prototype.ValueBufferType=Float32Array;Ls.prototype.DefaultInterpolation=rR;var Bh=class extends Ls{};Bh.prototype.ValueTypeName="bool";Bh.prototype.ValueBufferType=Array;Bh.prototype.DefaultInterpolation=tR;Bh.prototype.InterpolantFactoryMethodLinear=void 0;Bh.prototype.InterpolantFactoryMethodSmooth=void 0;var TR=class extends Ls{};TR.prototype.ValueTypeName="color";var kh=class extends Ls{};kh.prototype.ValueTypeName="number";var Ek=class extends y0{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=(i-t)/(n-t),u=e*s;for(let c=u+s;u!==c;u+=4)On.slerpFlat(a,0,o,u-s,o,u,l);return a}},du=class extends Ls{InterpolantFactoryMethodLinear(e){return new Ek(this.times,this.values,this.getValueSize(),e)}};du.prototype.ValueTypeName="quaternion";du.prototype.DefaultInterpolation=rR;du.prototype.InterpolantFactoryMethodSmooth=void 0;var Vh=class extends Ls{};Vh.prototype.ValueTypeName="string";Vh.prototype.ValueBufferType=Array;Vh.prototype.DefaultInterpolation=tR;Vh.prototype.InterpolantFactoryMethodLinear=void 0;Vh.prototype.InterpolantFactoryMethodSmooth=void 0;var Gh=class extends Ls{};Gh.prototype.ValueTypeName="vector";var ER=class{constructor(e,t=-1,i,n=EPe){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=Wh(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,n=1/(e.fps||1);for(let o=0,s=i.length;o!==s;++o)t.push(gOe(i[o]).scale(n));let a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){let t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,o=i.length;a!==o;++a)t.push(Ls.toJSON(i[a]));return n}static CreateFromMorphTargetSequence(e,t,i,n){let a=t.length,o=[];for(let s=0;s1){let f=c[1],h=n[f];h||(n[f]=h=[]),h.push(u)}}let o=[];for(let s in n)o.push(this.CreateFromMorphTargetSequence(s,n[s],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(f,h,p,d,g){if(p.length!==0){let m=[],v=[];hse(p,m,v,d),m.length!==0&&g.push(new f(h,m,v))}},n=[],a=e.name||"default",o=e.fps||30,s=e.blendMode,l=e.length||-1,u=e.hierarchy||[];for(let f=0;f{class r{constructor(t){this.manager=t!==void 0?t:yOe,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,i){let n=this;return new Promise(function(a,o){n.load(t,a,i,o)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}return r.DEFAULT_MATERIAL_NAME="__DEFAULT",r})(),mc={},Ck=class extends Error{constructor(e,t){super(e),this.response=t}},CR=class extends mm{constructor(e){super(e)}load(e,t,i,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let a=AR.get(e);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0),a;if(mc[e]!==void 0){mc[e].push({onLoad:t,onProgress:i,onError:n});return}mc[e]=[],mc[e].push({onLoad:t,onProgress:i,onError:n});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;let c=mc[e],f=u.body.getReader(),h=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),p=h?parseInt(h):0,d=p!==0,g=0,m=new ReadableStream({start(v){_();function _(){f.read().then(({done:y,value:x})=>{if(y)v.close();else{g+=x.byteLength;let M=new ProgressEvent("progress",{lengthComputable:d,loaded:g,total:p});for(let S=0,w=c.length;S{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,s));case"json":return u.json();default:if(s===void 0)return u.text();{let f=/charset="?([^;"\s]*)"?/i.exec(s),h=f&&f[1]?f[1].toLowerCase():void 0,p=new TextDecoder(h);return u.arrayBuffer().then(d=>p.decode(d))}}}).then(u=>{AR.add(e,u);let c=mc[e];delete mc[e];for(let f=0,h=c.length;f{let c=mc[e];if(c===void 0)throw this.manager.itemError(e),u;delete mc[e];for(let f=0,h=c.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}};var Rk=class extends mm{constructor(e){super(e)}load(e,t,i,n){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let a=this,o=AR.get(e);if(o!==void 0)return a.manager.itemStart(e),setTimeout(function(){t&&t(o),a.manager.itemEnd(e)},0),o;let s=DM("img");function l(){c(),AR.add(e,this),t&&t(this),a.manager.itemEnd(e)}function u(f){c(),n&&n(f),a.manager.itemError(e),a.manager.itemEnd(e)}function c(){s.removeEventListener("load",l,!1),s.removeEventListener("error",u,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),a.manager.itemStart(e),s.src=e,s}};var RR=class extends mm{constructor(e){super(e)}load(e,t,i,n){let a=new Vo,o=new Rk(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(s){a.image=s,a.needsUpdate=!0,t!==void 0&&t(a)},i,n),a}},_0=class extends ia{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new er(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let 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}};var jB=new Ht,Goe=new ye,Hoe=new ye,kM=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new yr(512,512),this.map=null,this.mapPass=null,this.matrix=new Ht,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new UM,this._frameExtents=new yr(1,1),this._viewportCount=1,this._viewports=[new Pr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;Goe.setFromMatrixPosition(e.matrixWorld),t.position.copy(Goe),Hoe.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Hoe),t.updateMatrixWorld(),jB.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(jB),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(jB)}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(){let 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}},Lk=class extends kM{constructor(){super(new Nn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,i=h0*2*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,a=e.distance||t.far;(i!==t.fov||n!==t.aspect||a!==t.far)&&(t.fov=i,t.aspect=n,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},LR=class extends _0{constructor(e,t,i=0,n=Math.PI/3,a=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(ia.DEFAULT_UP),this.updateMatrix(),this.target=new ia,this.distance=i,this.angle=n,this.penumbra=a,this.decay=o,this.map=null,this.shadow=new Lk}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),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}},Woe=new Ht,EM=new ye,KB=new ye,Pk=class extends kM{constructor(){super(new Nn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new yr(4,2),this._viewportCount=6,this._viewports=[new Pr(2,1,1,1),new Pr(0,1,1,1),new Pr(3,1,1,1),new Pr(1,1,1,1),new Pr(3,0,1,1),new Pr(1,0,1,1)],this._cubeDirections=[new ye(1,0,0),new ye(-1,0,0),new ye(0,0,1),new ye(0,0,-1),new ye(0,1,0),new ye(0,-1,0)],this._cubeUps=[new ye(0,1,0),new ye(0,1,0),new ye(0,1,0),new ye(0,1,0),new ye(0,0,1),new ye(0,0,-1)]}updateMatrices(e,t=0){let i=this.camera,n=this.matrix,a=e.distance||i.far;a!==i.far&&(i.far=a,i.updateProjectionMatrix()),EM.setFromMatrixPosition(e.matrixWorld),i.position.copy(EM),KB.copy(i.position),KB.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(KB),i.updateMatrixWorld(),n.makeTranslation(-EM.x,-EM.y,-EM.z),Woe.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Woe)}},VM=class extends _0{constructor(e,t,i=0,n=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new Pk}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},Dk=class extends kM{constructor(){super(new m0(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},PR=class extends _0{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ia.DEFAULT_UP),this.updateMatrix(),this.target=new ia,this.shadow=new Dk}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},DR=class extends _0{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}};var IR=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,n=e.length;i{class r{constructor(t,i,n){this.path=i,this.parsedPath=n||r.parseTrackName(i),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,i,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,i,n):new r(t,i,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(_Oe,"")}static parseTrackName(t){let i=TOe.exec(t);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},a=n.nodeName&&n.nodeName.lastIndexOf(".");if(a!==void 0&&a!==-1){let o=n.nodeName.substring(a+1);EOe.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,a),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,i){if(i===void 0||i===""||i==="."||i===-1||i===t.name||i===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(i);if(n!==void 0)return n}if(t.children){let n=function(o){for(let s=0;s>>1|(zr&21845)<<1,bc=(bc&52428)>>>2|(bc&13107)<<2,bc=(bc&61680)>>>4|(bc&3855)<<4,Xk[zr]=((bc&65280)>>>8|(bc&255)<<8)>>>1;var bc,zr,GM=function(r,e,t){for(var i=r.length,n=0,a=new Xh(e);n>>l]=u}else for(s=new Xh(i),n=0;n>>15-r[n]);return s},HM=new Ps(288);for(zr=0;zr<144;++zr)HM[zr]=8;var zr;for(zr=144;zr<256;++zr)HM[zr]=9;var zr;for(zr=256;zr<280;++zr)HM[zr]=7;var zr;for(zr=280;zr<288;++zr)HM[zr]=8;var zr,xse=new Ps(32);for(zr=0;zr<32;++zr)xse[zr]=5;var zr;var POe=GM(HM,9,1);var DOe=GM(xse,5,1),Gk=function(r){for(var e=r[0],t=1;te&&(e=r[t]);return e},_l=function(r,e,t){var i=e/8|0;return(r[i]|r[i+1]<<8)>>(e&7)&t},Hk=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},IOe=function(r){return(r/8|0)+(r&7&&1)},NOe=function(r,e,t){(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof Xh?Xh:r instanceof Wk?Wk:Ps)(t-e);return i.set(r.subarray(e,t)),i},UOe=function(r,e,t){var i=r.length;if(!i||t&&!t.l&&i<5)return e||new Ps(0);var n=!e||t,a=!t||t.i;t||(t={}),e||(e=new Ps(i*3));var o=function(ae){var ve=e.length;if(ae>ve){var ue=new Ps(Math.max(ve*2,ae));ue.set(e),e=ue}},s=t.f||0,l=t.p||0,u=t.b||0,c=t.l,f=t.d,h=t.m,p=t.n,d=i*8;do{if(!c){t.f=s=_l(r,l,1);var g=_l(r,l+1,3);if(l+=3,g)if(g==1)c=POe,f=DOe,h=9,p=5;else if(g==2){var y=_l(r,l,31)+257,x=_l(r,l+10,15)+4,M=y+_l(r,l+5,31)+1;l+=14;for(var S=new Ps(M),w=new Ps(19),T=0;T>>4;if(m<16)S[T++]=m;else{var R=0,A=0;for(m==16?(A=3+_l(r,l,3),l+=2,R=S[T-1]):m==17?(A=3+_l(r,l,7),l+=3):m==18&&(A=11+_l(r,l,127),l+=7);A--;)S[T++]=R}}var D=S.subarray(0,y),U=S.subarray(y);h=Gk(D),p=Gk(U),c=GM(D,h,1),f=GM(U,p,1)}else throw"invalid block type";else{var m=IOe(l)+4,v=r[m-4]|r[m-3]<<8,_=m+v;if(_>i){if(a)throw"unexpected EOF";break}n&&o(u+v),e.set(r.subarray(m,_),u),t.b=u+=v,t.p=l=_*8;continue}if(l>d){if(a)throw"unexpected EOF";break}}n&&o(u+131072);for(var B=(1<>>4;if(l+=R&15,l>d){if(a)throw"unexpected EOF";break}if(!R)throw"invalid length/literal";if(G<256)e[u++]=G;else if(G==256){k=l,c=null;break}else{var Y=G-254;if(G>264){var T=G-257,J=dse[T];Y=_l(r,l,(1<>>4;if(!Q)throw"invalid distance";l+=Q&15;var U=LOe[V];if(V>3){var J=mse[V];U+=Hk(r,l)&(1<d){if(a)throw"unexpected EOF";break}n&&o(u+131072);for(var K=u+Y;u>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Sse(r,e){return UOe((FOe(r),r.subarray(2,-4)),e)}var zOe=typeof TextDecoder<"u"&&new TextDecoder,BOe=0;try{zOe.decode(OOe,{stream:!0}),BOe=1}catch{}function Mse(r,e,t){let i=t.length-r-1;if(e>=t[i])return i-1;if(e<=t[r])return r;let n=r,a=i,o=Math.floor((n+a)/2);for(;e=t[o+1];)e=g&&(d[p][0]=d[h][0]/s[_+1][v],m=d[p][0]*s[v][_]);let y=v>=-1?1:-v,x=f-1<=_?g-1:t-f;for(let S=y;S<=x;++S)d[p][S]=(d[h][S]-d[h][S-1])/s[_+1][v+S],m+=d[p][S]*s[v+S][_];f<=_&&(d[p][g]=-d[h][g-1]/s[_+1][f],m+=d[p][g]*s[f][_]),o[g][f]=m;let M=h;h=p,p=M}}let c=t;for(let f=1;f<=i;++f){for(let h=0;h<=t;++h)o[f][h]*=c;c*=t-f}return o}function HOe(r,e,t,i,n){let a=n0,l=typeof a.Content=="string"&&a.Content!=="";if(s||l){let u=this.parseImage(i[n]);t[a.RelativeFilename||a.Filename]=u}}}}for(let i in e){let n=e[i];t[n]!==void 0?e[i]=t[n]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){let t=e.Content,i=e.RelativeFilename||e.Filename,n=i.slice(i.lastIndexOf(".")+1).toLowerCase(),a;switch(n){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",i),a="image/tga";break;default:console.warn('FBXLoader: Image type "'+n+'" is not supported.');return}if(typeof t=="string")return"data:"+a+";base64,"+t;{let o=new Uint8Array(t);return window.URL.createObjectURL(new Blob([o],{type:a}))}}parseTextures(e){let t=new Map;if("Texture"in _r.Objects){let i=_r.Objects.Texture;for(let n in i){let a=this.parseTexture(i[n],e);t.set(parseInt(n),a)}}return t}parseTexture(e,t){let i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;let n=e.WrapModeU,a=e.WrapModeV,o=n!==void 0?n.value:0,s=a!==void 0?a.value:0;if(i.wrapS=o===0?c0:oo,i.wrapT=s===0?c0:oo,"Scaling"in e){let l=e.Scaling.value;i.repeat.x=l[0],i.repeat.y=l[1]}if("Translation"in e){let l=e.Translation.value;i.offset.x=l[0],i.offset.y=l[1]}return i}loadTexture(e,t){let i,n=this.textureLoader.path,a=Fi.get(e.id).children;a!==void 0&&a.length>0&&t[a[0].ID]!==void 0&&(i=t[a[0].ID],(i.indexOf("blob:")===0||i.indexOf("data:")===0)&&this.textureLoader.setPath(void 0));let o,s=e.FileName.slice(-3).toLowerCase();if(s==="tga"){let l=this.manager.getHandler(".tga");l===null?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),o=new Vo):(l.setPath(this.textureLoader.path),o=l.load(i))}else if(s==="dds"){let l=this.manager.getHandler(".dds");l===null?(console.warn("FBXLoader: DDS loader not found, creating placeholder texture for",e.RelativeFilename),o=new Vo):(l.setPath(this.textureLoader.path),o=l.load(i))}else s==="psd"?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),o=new Vo):o=this.textureLoader.load(i);return this.textureLoader.setPath(n),o}parseMaterials(e){let t=new Map;if("Material"in _r.Objects){let i=_r.Objects.Material;for(let n in i){let a=this.parseMaterial(i[n],e);a!==null&&t.set(parseInt(n),a)}}return t}parseMaterial(e,t){let i=e.id,n=e.attrName,a=e.ShadingModel;if(typeof a=="object"&&(a=a.value),!Fi.has(i))return null;let o=this.parseParameters(e,t,i),s;switch(a.toLowerCase()){case"phong":s=new g0;break;case"lambert":s=new wR;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',a),s=new g0;break}return s.setValues(o),s.name=n,s}parseParameters(e,t,i){let n={};e.BumpFactor&&(n.bumpScale=e.BumpFactor.value),e.Diffuse?n.color=new er().fromArray(e.Diffuse.value).convertSRGBToLinear():e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(n.color=new er().fromArray(e.DiffuseColor.value).convertSRGBToLinear()),e.DisplacementFactor&&(n.displacementScale=e.DisplacementFactor.value),e.Emissive?n.emissive=new er().fromArray(e.Emissive.value).convertSRGBToLinear():e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(n.emissive=new er().fromArray(e.EmissiveColor.value).convertSRGBToLinear()),e.EmissiveFactor&&(n.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(n.opacity=parseFloat(e.Opacity.value)),n.opacity<1&&(n.transparent=!0),e.ReflectionFactor&&(n.reflectivity=e.ReflectionFactor.value),e.Shininess&&(n.shininess=e.Shininess.value),e.Specular?n.specular=new er().fromArray(e.Specular.value).convertSRGBToLinear():e.SpecularColor&&e.SpecularColor.type==="Color"&&(n.specular=new er().fromArray(e.SpecularColor.value).convertSRGBToLinear());let a=this;return Fi.get(i).children.forEach(function(o){let s=o.relationship;switch(s){case"Bump":n.bumpMap=a.getTexture(t,o.ID);break;case"Maya|TEX_ao_map":n.aoMap=a.getTexture(t,o.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":n.map=a.getTexture(t,o.ID),n.map!==void 0&&(n.map.colorSpace=Ma);break;case"DisplacementColor":n.displacementMap=a.getTexture(t,o.ID);break;case"EmissiveColor":n.emissiveMap=a.getTexture(t,o.ID),n.emissiveMap!==void 0&&(n.emissiveMap.colorSpace=Ma);break;case"NormalMap":case"Maya|TEX_normal_map":n.normalMap=a.getTexture(t,o.ID);break;case"ReflectionColor":n.envMap=a.getTexture(t,o.ID),n.envMap!==void 0&&(n.envMap.mapping=LM,n.envMap.colorSpace=Ma);break;case"SpecularColor":n.specularMap=a.getTexture(t,o.ID),n.specularMap!==void 0&&(n.specularMap.colorSpace=Ma);break;case"TransparentColor":case"TransparencyFactor":n.alphaMap=a.getTexture(t,o.ID),n.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",s);break}}),n}getTexture(e,t){return"LayeredTexture"in _r.Objects&&t in _r.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=Fi.get(t).children[0].ID),e.get(t)}parseDeformers(){let e={},t={};if("Deformer"in _r.Objects){let i=_r.Objects.Deformer;for(let n in i){let a=i[n],o=Fi.get(parseInt(n));if(a.attrType==="Skin"){let s=this.parseSkeleton(o,i);s.ID=n,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),s.geometryID=o.parents[0].ID,e[n]=s}else if(a.attrType==="BlendShape"){let s={id:n};s.rawTargets=this.parseMorphTargets(o,i),s.id=n,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[n]=s}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){let i=[];return e.children.forEach(function(n){let a=t[n.ID];if(a.attrType!=="Cluster")return;let o={ID:n.ID,indices:[],weights:[],transformLink:new Ht().fromArray(a.TransformLink.a)};"Indexes"in a&&(o.indices=a.Indexes.a,o.weights=a.Weights.a),i.push(o)}),{rawBones:i,bones:[]}}parseMorphTargets(e,t){let i=[];for(let n=0;n1?o=s:s.length>0?o=s[0]:(o=new g0({name:mm.DEFAULT_MATERIAL_NAME,color:13421772}),s.push(o)),"color"in a.attributes&&s.forEach(function(l){l.vertexColors=!0}),a.FBX_Deformer?(n=new _R(a,o),n.normalizeSkinWeights()):n=new so(a,o),n}createCurve(e,t){let i=e.children.reduce(function(a,o){return t.has(o.ID)&&(a=t.get(o.ID)),a},null),n=new OM({name:mm.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new SR(i,n)}getTransformData(e,t){let i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?i.eulerOrder=Ase(t.RotationOrder.value):i.eulerOrder="ZYX","Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&Fi.get(e.ID).children.forEach(function(n){if(n.relationship==="LookAtProperty"){let a=_r.Objects.Model[n.ID];if("Lcl_Translation"in a){let o=a.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(o),ba.add(e.target)):e.lookAt(new ye().fromArray(o))}}})}bindSkeleton(e,t,i){let n=this.parsePoseNodes();for(let a in e){let o=e[a];Fi.get(parseInt(o.ID)).parents.forEach(function(l){if(t.has(l.ID)){let u=l.ID;Fi.get(u).parents.forEach(function(f){i.has(f.ID)&&i.get(f.ID).bind(new xR(o.bones),n[f.ID])})}})}}parsePoseNodes(){let e={};if("Pose"in _r.Objects){let t=_r.Objects.Pose;for(let i in t)if(t[i].attrType==="BindPose"&&t[i].NbPoseNodes>0){let n=t[i].PoseNode;Array.isArray(n)?n.forEach(function(a){e[a.Node]=new Ht().fromArray(a.Matrix.a)}):e[n.Node]=new Ht().fromArray(n.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in _r){if("AmbientColor"in _r.GlobalSettings){let e=_r.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],n=e[2];if(t!==0||i!==0||n!==0){let a=new er(t,i,n).convertSRGBToLinear();ba.add(new DR(a,1))}}"UnitScaleFactor"in _r.GlobalSettings&&(ba.userData.unitScaleFactor=_r.GlobalSettings.UnitScaleFactor.value)}}},jk=class{constructor(){this.negativeMaterialIndices=!1}parse(e){let t=new Map;if("Geometry"in _r.Objects){let i=_r.Objects.Geometry;for(let n in i){let a=Fi.get(parseInt(n)),o=this.parseGeometry(a,i[n],e);t.set(parseInt(n),o)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){let n=i.skeletons,a=[],o=e.parents.map(function(f){return _r.Objects.Model[f.ID]});if(o.length===0)return;let s=e.children.reduce(function(f,h){return n[h.ID]!==void 0&&(f=n[h.ID]),f},null);e.children.forEach(function(f){i.morphTargets[f.ID]!==void 0&&a.push(i.morphTargets[f.ID])});let l=o[0],u={};"RotationOrder"in l&&(u.eulerOrder=Ase(l.RotationOrder.value)),"InheritType"in l&&(u.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(u.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(u.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(u.scale=l.GeometricScaling.value);let c=Ese(u);return this.genGeometry(t,s,a,c)}genGeometry(e,t,i,n){let a=new Rs;e.attrName&&(a.name=e.attrName);let o=this.parseGeoNode(e,t),s=this.genBuffers(o),l=new Un(s.vertex,3);if(l.applyMatrix4(n),a.setAttribute("position",l),s.colors.length>0&&a.setAttribute("color",new Un(s.colors,3)),t&&(a.setAttribute("skinIndex",new p0(s.weightsIndices,4)),a.setAttribute("skinWeight",new Un(s.vertexWeights,4)),a.FBX_Deformer=t),s.normal.length>0){let u=new dr().getNormalMatrix(n),c=new Un(s.normal,3);c.applyNormalMatrix(u),a.setAttribute("normal",c)}if(s.uvs.forEach(function(u,c){let f=c===0?"uv":`uv${c}`;a.setAttribute(f,new Un(s.uvs[c],2))}),o.material&&o.material.mappingType!=="AllSame"){let u=s.materialIndex[0],c=0;if(s.materialIndex.forEach(function(f,h){f!==u&&(a.addGroup(c,h-c,u),u=f,c=h)}),a.groups.length>0){let f=a.groups[a.groups.length-1],h=f.start+f.count;h!==s.materialIndex.length&&a.addGroup(h,s.materialIndex.length-h,u)}a.groups.length===0&&a.addGroup(0,s.materialIndex.length,s.materialIndex[0])}return this.addMorphTargets(a,e,i,n),a}parseGeoNode(e,t){let i={};if(i.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],i.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let n=0;for(;e.LayerElementUV[n];)e.LayerElementUV[n].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[n])),n++}return i.weightTable={},t!==null&&(i.skeleton=t,t.rawBones.forEach(function(n,a){n.indices.forEach(function(o,s){i.weightTable[o]===void 0&&(i.weightTable[o]=[]),i.weightTable[o].push({id:a,weight:n.weights[s]})})})),i}genBuffers(e){let t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},i=0,n=0,a=!1,o=[],s=[],l=[],u=[],c=[],f=[],h=this;return e.vertexIndices.forEach(function(p,d){let g,m=!1;p<0&&(p=p^-1,m=!0);let v=[],_=[];if(o.push(p*3,p*3+1,p*3+2),e.color){let y=kR(d,i,p,e.color);l.push(y[0],y[1],y[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(y){_.push(y.weight),v.push(y.id)}),_.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);let y=[0,0,0,0],x=[0,0,0,0];_.forEach(function(M,S){let w=M,T=v[S];x.forEach(function(C,b,E){if(w>C){E[b]=w,w=C;let I=y[b];y[b]=T,T=I}})}),v=y,_=x}for(;_.length<4;)_.push(0),v.push(0);for(let y=0;y<4;++y)c.push(_[y]),f.push(v[y])}if(e.normal){let y=kR(d,i,p,e.normal);s.push(y[0],y[1],y[2])}e.material&&e.material.mappingType!=="AllSame"&&(g=kR(d,i,p,e.material)[0],g<0&&(h.negativeMaterialIndices=!0,g=0)),e.uv&&e.uv.forEach(function(y,x){let M=kR(d,i,p,y);u[x]===void 0&&(u[x]=[]),u[x].push(M[0]),u[x].push(M[1])}),n++,m&&(h.genFace(t,e,o,g,s,l,u,c,f,n),i++,n=0,o=[],s=[],l=[],u=[],c=[],f=[])}),t}getNormalNewell(e){let t=new ye(0,0,0);for(let i=0;i.5?new ye(0,1,0):new ye(0,0,1)).cross(t).normalize(),a=t.clone().cross(n).normalize();return{normal:t,tangent:n,bitangent:a}}flattenVertex(e,t,i){return new yr(e.dot(t),e.dot(i))}genFace(e,t,i,n,a,o,s,l,u,c){let f;if(c>3){let h=[];for(let m=0;m1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");let o=e.get(a[0].ID);i[n]={name:t[n].attrName,layer:o}}return i}addClip(e){let t=[],i=this;return e.layer.forEach(function(n){t=t.concat(i.generateTracks(n))}),new ER(e.name,-1,t)}generateTracks(e){let t=[],i=new ye,n=new ye;if(e.transform&&e.transform.decompose(i,new On,n),i=i.toArray(),n=n.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){let a=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");a!==void 0&&t.push(a)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){let a=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);a!==void 0&&t.push(a)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){let a=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");a!==void 0&&t.push(a)}if(e.DeformPercent!==void 0){let a=this.generateMorphTrack(e);a!==void 0&&t.push(a)}return t}generateVectorTrack(e,t,i,n){let a=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(a,t,i);return new Gh(e+"."+n,a,o)}generateRotationTrack(e,t,i,n,a){let o,s;if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){let f=this.interpolateRotations(t.x,t.y,t.z,a);o=f[0],s=f[1]}i!==void 0&&(i=i.map(na.degToRad),i.push(a),i=new Fn().fromArray(i),i=new On().setFromEuler(i)),n!==void 0&&(n=n.map(na.degToRad),n.push(a),n=new Fn().fromArray(n),n=new On().setFromEuler(n).invert());let l=new On,u=new Fn,c=[];if(!s||!o)return new du(e+".quaternion",[],[]);for(let f=0;f2&&new On().fromArray(c,(f-3)/3*4).dot(l)<0&&l.set(-l.x,-l.y,-l.z,-l.w),l.toArray(c,f/3*4);return new du(e+".quaternion",o,c)}generateMorphTrack(e){let t=e.DeformPercent.curves.morph,i=t.values.map(function(a){return a/100}),n=ba.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new kh(e.modelName+".morphTargetInfluences["+n+"]",t.times,i)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(i,n){return i-n}),t.length>1){let i=1,n=t[0];for(let a=1;a=180||p[1]>=180||p[2]>=180){let g=Math.max(...p)/180,m=new Fn(...u,n),v=new Fn(...f,n),_=new On().setFromEuler(m),y=new On().setFromEuler(v);_.dot(y)&&y.set(-y.x,-y.y,-y.z,-y.w);let x=e.times[s-1],M=e.times[s]-x,S=new On,w=new Fn;for(let T=0;T<1;T+=1/g)S.copy(_.clone().slerp(y.clone(),T)),a.push(x+T*M),w.setFromQuaternion(S,n),o.push(w.x),o.push(w.y),o.push(w.z)}else a.push(e.times[s]),o.push(na.degToRad(e.values[s])),o.push(na.degToRad(t.values[s])),o.push(na.degToRad(i.values[s]))}return[a,o]}},Jk=class{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new HR,this.nodeStack=[],this.currentProp=[],this.currentPropName="";let t=this,i=e.split(/[\r\n]+/);return i.forEach(function(n,a){let o=n.match(/^[\s\t]*;/),s=n.match(/^[\s\t]*$/);if(o||s)return;let l=n.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),u=n.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=n.match("^\\t{"+(t.currentIndent-1)+"}}");l?t.parseNodeBegin(n,l):u?t.parseNodeProperty(n,u,i[++a]):c?t.popStack():n.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(n)}),this.allNodes}parseNodeBegin(e,t){let i=t[1].trim().replace(/^"/,"").replace(/"$/,""),n=t[2].split(",").map(function(l){return l.trim().replace(/^"/,"").replace(/"$/,"")}),a={name:i},o=this.parseNodeAttr(n),s=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(i,a):i in s?(i==="PoseNode"?s.PoseNode.push(a):s[i].id!==void 0&&(s[i]={},s[i][s[i].id]=s[i]),o.id!==""&&(s[i][o.id]=a)):typeof o.id=="number"?(s[i]={},s[i][o.id]=a):i!=="Properties70"&&(i==="PoseNode"?s[i]=[a]:s[i]=a),typeof o.id=="number"&&(a.id=o.id),o.name!==""&&(a.attrName=o.name),o.type!==""&&(a.attrType=o.type),this.pushStack(a)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",n="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),n=e[2]),{id:t,name:i,type:n}}parseNodeProperty(e,t,i){let n=t[1].replace(/^"/,"").replace(/"$/,"").trim(),a=t[2].replace(/^"/,"").replace(/"$/,"").trim();n==="Content"&&a===","&&(a=i.replace(/"/g,"").replace(/,$/,"").trim());let o=this.getCurrentNode();if(o.name==="Properties70"){this.parseNodeSpecialProperty(e,n,a);return}if(n==="C"){let l=a.split(",").slice(1),u=parseInt(l[0]),c=parseInt(l[1]),f=a.split(",").slice(3);f=f.map(function(h){return h.trim().replace(/^"/,"")}),n="connections",a=[u,c],JOe(a,f),o[n]===void 0&&(o[n]=[])}n==="Node"&&(o.id=a),n in o&&Array.isArray(o[n])?o[n].push(a):n!=="a"?o[n]=a:o.a=a,this.setCurrentProp(o,n),n==="a"&&a.slice(-1)!==","&&(o.a=qk(a))}parseNodePropertyContinued(e){let t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=qk(t.a))}parseNodeSpecialProperty(e,t,i){let n=i.split('",').map(function(c){return c.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=n[0],o=n[1],s=n[2],l=n[3],u=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":u=parseFloat(u);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":u=qk(u);break}this.getPrevNode()[a]={type:o,type2:s,flag:l,value:u},this.setCurrentProp(this.getPrevNode(),a)}},$k=class{parse(e){let t=new GR(e);t.skip(23);let i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);let n=new HR;for(;!this.endOfContent(t);){let a=this.parseNode(t,i);a!==null&&n.add(a.name,a)}return n}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){let i={},n=t>=7500?e.getUint64():e.getUint32(),a=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();let o=e.getUint8(),s=e.getString(o);if(n===0)return null;let l=[];for(let h=0;h0?l[0]:"",c=l.length>1?l[1]:"",f=l.length>2?l[2]:"";for(i.singleProperty=a===1&&e.getOffset()===n;n>e.getOffset();){let h=this.parseNode(e,t);h!==null&&this.parseSubNode(s,i,h)}return i.propertyList=l,typeof u=="number"&&(i.id=u),c!==""&&(i.attrName=c),f!==""&&(i.attrType=f),s!==""&&(i.name=s),i}parseSubNode(e,t,i){if(i.singleProperty===!0){let n=i.propertyList[0];Array.isArray(n)?(t[i.name]=i,i.a=n):t[i.name]=n}else if(e==="Connections"&&i.name==="C"){let n=[];i.propertyList.forEach(function(a,o){o!==0&&n.push(a)}),t.connections===void 0&&(t.connections=[]),t.connections.push(n)}else if(i.name==="Properties70")Object.keys(i).forEach(function(a){t[a]=i[a]});else if(e==="Properties70"&&i.name==="P"){let n=i.propertyList[0],a=i.propertyList[1],o=i.propertyList[2],s=i.propertyList[3],l;n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),a.indexOf("Lcl ")===0&&(a=a.replace("Lcl ","Lcl_")),a==="Color"||a==="ColorRGB"||a==="Vector"||a==="Vector3D"||a.indexOf("Lcl_")===0?l=[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:l=i.propertyList[4],t[n]={type:a,type2:o,flag:s,value:l}}else t[i.name]===void 0?typeof i.id=="number"?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:i.name==="PoseNode"?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):t[i.name][i.id]===void 0&&(t[i.name][i.id]=i)}parseProperty(e){let t=e.getString(1),i;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return i=e.getUint32(),e.getArrayBuffer(i);case"S":return i=e.getUint32(),e.getString(i);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":let n=e.getUint32(),a=e.getUint32(),o=e.getUint32();if(a===0)switch(t){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}let s=Sse(new Uint8Array(e.getArrayBuffer(o))),l=new GR(s.buffer);switch(t){case"b":case"c":return l.getBooleanArray(n);case"d":return l.getFloat64Array(n);case"f":return l.getFloat32Array(n);case"i":return l.getInt32Array(n);case"l":return l.getInt64Array(n)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}},GR=class{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){let t=[];for(let i=0;i=0&&(i=new Uint8Array(this.dv.buffer,t,n)),this._textDecoder.decode(i)}},HR=class{add(e,t){this[e]=t}};function qOe(r){let e="Kaydara FBX Binary \0";return r.byteLength>=e.length&&e===Cse(r,0,e.length)}function ZOe(r){let e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],t=0;function i(n){let a=r[n-1];return r=r.slice(t+n),t++,a}for(let n=0;n{let e=class e{constructor(){this.http=xl(_m),this.modal=xl(ym),this.titleService=xl(MV),this.animate=()=>{requestAnimationFrame(this.animate);let i=e3e.getDelta();Rse&&Rse.update(i),this.renderer.render(this.scene,this.camera)}}ngOnInit(){this.titleService.setTitle("\u91CD\u78C53D"),this.initThreeJs(),this.animate()}initThreeJs(){this.camera=new Gi(40,window.innerWidth/window.innerHeight,1,2e4),this.camera.position.set(2200,300,-3100),this.scene=new yS,this.scene.background=new ir(263446);let i=new _S(16777215,4473924,5);i.position.set(0,200,0),this.scene.add(i);let n=new xS(16777215,5);n.position.set(0,200,100),n.castShadow=!0,n.shadow.camera.top=180,n.shadow.camera.bottom=-100,n.shadow.camera.left=-120,n.shadow.camera.right=120,this.scene.add(n);let a=this;new VR().load("assets/fbx/bb.fbx",function(p){p.traverse(function(d){}),a.scene.add(p)},p=>{},p=>{console.error("An error happened",p)}),this.renderer=new gS({antialias:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.shadowMap.enabled=!0,this.container.nativeElement.appendChild(this.renderer.domElement);let s=5,l=32,u=new OA(s,l),c=new tc({color:16711680}),f=new rn(u,c);f.position.set(850,100,-2e3),this.scene.add(f);let h=new Lse.OrbitControls(this.camera,this.renderer.domElement);h.target.set(850,100,-2e3),h.update(),window.addEventListener("resize",this.onWindowResize)}render(){this.cube.rotation.x+=.01,this.cube.rotation.y+=.01,this.renderer.render(this.scene,this.camera)}onWindowResize(){this.camera.aspect=window.innerWidth/window.innerHeight,this.camera.updateProjectionMatrix(),this.renderer.setSize(window.innerWidth,window.innerHeight)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["app-data-v-t1"]],viewQuery:function(n,a){if(n&1&&vm(QOe,7),n&2){let o;co(o=fo())&&(a.container=o.first)}},standalone:!0,features:[ui],decls:3,vars:0,consts:[[2,"display","flex","flex-direction","column","height","100vh"],[2,"flex-grow","1"],["Three",""]],template:function(n,a){n&1&&(tr(0,"div",0),li(1,"div",1,2),lr())},dependencies:[Dc,Ic,Kc,Wc,$c,Qc,Jc,Zc,Pc,Vc,Hc,nf,qc,Xc,Tl,Cc,Bc,kc,ef,rf,Fc,El,Yc,Oc,Gc,zc,tf,Lc,Rc,jc,Uc,Ac,Nc,wl],encapsulation:2});let r=e;return r})();var Dse=(()=>{let e=class e{constructor(){this.http=xl(_m),this.modal=xl(ym)}ngOnInit(){}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=si({type:e,selectors:[["app-data-v-threejs"]],standalone:!0,features:[ui],decls:1,vars:0,consts:[["src","http://112.33.111.160:8083/","width","100%","height","650px",2,"border","0"]],template:function(n,a){n&1&&li(0,"iframe",0)},dependencies:[Dc,Ic,Kc,Wc,$c,Qc,Jc,Zc,Pc,Vc,Hc,nf,qc,Xc,Tl,Cc,Bc,kc,ef,rf,Fc,El,Yc,Oc,Gc,zc,tf,Lc,Rc,jc,Uc,Ac,Nc,wl]});let r=e;return r})();var NDt=[{path:"s1/:id",component:x$,data:{menu:null}},{path:"second1/:id",component:S$,data:{menu:null}},{path:"threejs/:id",component:Dse},{path:"t1/:id",component:Pse},{path:"lj-table",component:rL},{path:"lj-table",component:rL}];export{NDt as routes}; +}`,gk=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){let n=new Vo,a=e.properties.get(n);a.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}render(e,t){if(this.texture!==null){if(this.mesh===null){let i=t.cameras[0].viewport,n=new hu({extensions:{fragDepth:!0},vertexShader:YUe,fragmentShader:qUe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new co(new gR(20,20),n)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}},yk=class extends Fh{constructor(e,t){super();let i=this,n=null,a=1,o=null,s="local-floor",l=1,u=null,c=null,f=null,h=null,p=null,d=null,g=new gk,m=t.getContextAttributes(),v=null,_=null,y=[],x=[],M=new yr,S=null,w=new Nn;w.layers.enable(1),w.viewport=new Rr;let T=new Nn;T.layers.enable(2),T.viewport=new Rr;let C=[w,T],b=new vk;b.layers.enable(1),b.layers.enable(2);let E=null,I=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let K=y[V];return K===void 0&&(K=new LM,y[V]=K),K.getTargetRaySpace()},this.getControllerGrip=function(V){let K=y[V];return K===void 0&&(K=new LM,y[V]=K),K.getGripSpace()},this.getHand=function(V){let K=y[V];return K===void 0&&(K=new LM,y[V]=K),K.getHandSpace()};function R(V){let K=x.indexOf(V.inputSource);if(K===-1)return;let ae=y[K];ae!==void 0&&(ae.update(V.inputSource,V.frame,u||o),ae.dispatchEvent({type:V.type,data:V.inputSource}))}function A(){n.removeEventListener("select",R),n.removeEventListener("selectstart",R),n.removeEventListener("selectend",R),n.removeEventListener("squeeze",R),n.removeEventListener("squeezestart",R),n.removeEventListener("squeezeend",R),n.removeEventListener("end",A),n.removeEventListener("inputsourceschange",D);for(let V=0;V=0&&(x[ve]=null,y[ve].disconnect(ae))}for(let K=0;K=x.length){x.push(ae),ve=se;break}else if(x[se]===null){x[se]=ae,ve=se;break}if(ve===-1)break}let ue=y[ve];ue&&ue.connect(ae)}}let U=new ye,B=new ye;function z(V,K,ae){U.setFromMatrixPosition(K.matrixWorld),B.setFromMatrixPosition(ae.matrixWorld);let ve=U.distanceTo(B),ue=K.projectionMatrix.elements,se=ae.projectionMatrix.elements,Ee=ue[14]/(ue[10]-1),q=ue[14]/(ue[10]+1),H=(ue[9]+1)/ue[5],We=(ue[9]-1)/ue[5],_e=(ue[8]-1)/ue[0],xe=(se[8]+1)/se[0],Le=Ee*_e,Ue=Ee*xe,Ne=ve/(-_e+xe),Ve=Ne*-_e;K.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ve),V.translateZ(Ne),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert();let ct=Ee+Ne,F=q+Ne,L=Le-Ve,ne=Ue+(ve-Ve),le=H*q/F*ct,me=We*q/F*ct;V.projectionMatrix.makePerspective(L,ne,le,me,ct,F),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}function k(V,K){K===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(K.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(n===null)return;g.texture!==null&&(V.near=g.depthNear,V.far=g.depthFar),b.near=T.near=w.near=V.near,b.far=T.far=w.far=V.far,(E!==b.near||I!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),E=b.near,I=b.far,w.near=E,w.far=I,T.near=E,T.far=I,w.updateProjectionMatrix(),T.updateProjectionMatrix(),V.updateProjectionMatrix());let K=V.parent,ae=b.cameras;k(b,K);for(let ve=0;ve0&&(m.alphaTest.value=v.alphaTest);let _=e.get(v),y=_.envMap,x=_.envMapRotation;if(y&&(m.envMap.value=y,um.copy(x),um.x*=-1,um.y*=-1,um.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(um.y*=-1,um.z*=-1),m.envMapRotation.value.setFromMatrix4(ZUe.makeRotationFromEuler(um)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=v.reflectivity,m.ior.value=v.ior,m.refractionRatio.value=v.refractionRatio),v.lightMap){m.lightMap.value=v.lightMap;let M=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=v.lightMapIntensity*M,t(v.lightMap,m.lightMapTransform)}v.aoMap&&(m.aoMap.value=v.aoMap,m.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,m.aoMapTransform))}function o(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform))}function s(m,v){m.dashSize.value=v.dashSize,m.totalSize.value=v.dashSize+v.gapSize,m.scale.value=v.scale}function l(m,v,_,y){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.size.value=v.size*_,m.scale.value=y*.5,v.map&&(m.map.value=v.map,t(v.map,m.uvTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function u(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.rotation.value=v.rotation,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function c(m,v){m.specular.value.copy(v.specular),m.shininess.value=Math.max(v.shininess,1e-4)}function f(m,v){v.gradientMap&&(m.gradientMap.value=v.gradientMap)}function h(m,v){m.metalness.value=v.metalness,v.metalnessMap&&(m.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,m.metalnessMapTransform)),m.roughness.value=v.roughness,v.roughnessMap&&(m.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,m.roughnessMapTransform)),e.get(v).envMap&&(m.envMapIntensity.value=v.envMapIntensity)}function p(m,v,_){m.ior.value=v.ior,v.sheen>0&&(m.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),m.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(m.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,m.sheenColorMapTransform)),v.sheenRoughnessMap&&(m.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,m.sheenRoughnessMapTransform))),v.clearcoat>0&&(m.clearcoat.value=v.clearcoat,m.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(m.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,m.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(m.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===fo&&m.clearcoatNormalScale.value.negate())),v.iridescence>0&&(m.iridescence.value=v.iridescence,m.iridescenceIOR.value=v.iridescenceIOR,m.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(m.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,m.iridescenceMapTransform)),v.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),v.transmission>0&&(m.transmission.value=v.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),v.transmissionMap&&(m.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,m.transmissionMapTransform)),m.thickness.value=v.thickness,v.thicknessMap&&(m.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=v.attenuationDistance,m.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(m.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(m.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=v.specularIntensity,m.specularColor.value.copy(v.specularColor),v.specularColorMap&&(m.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,m.specularColorMapTransform)),v.specularIntensityMap&&(m.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,m.specularIntensityMapTransform))}function d(m,v){v.matcap&&(m.matcap.value=v.matcap)}function g(m,v){let _=e.get(v).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function KUe(r,e,t,i){let n={},a={},o=[],s=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(_,y){let x=y.program;i.uniformBlockBinding(_,x)}function u(_,y){let x=n[_.id];x===void 0&&(d(_),x=c(_),n[_.id]=x,_.addEventListener("dispose",m));let M=y.program;i.updateUBOMapping(_,M);let S=e.render.frame;a[_.id]!==S&&(h(_),a[_.id]=S)}function c(_){let y=f();_.__bindingPointIndex=y;let x=r.createBuffer(),M=_.__size,S=_.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,M,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,x),x}function f(){for(let _=0;_0&&(x+=M-S),_.__size=x,_.__cache={},this}function g(_){let y={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),y}function m(_){let y=_.target;y.removeEventListener("dispose",m);let x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),r.deleteBuffer(n[y.id]),delete n[y.id],delete a[y.id]}function v(){for(let _ in n)r.deleteBuffer(n[_]);o=[],n={},a={}}return{bind:l,update:u,dispose:v}}var _k=class{constructor(e={}){let{canvas:t=QPe(),context:i=null,depth:n=!0,stencil:a=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let h;i!==null?h=i.getContextAttributes().alpha:h=o;let p=new Uint32Array(4),d=new Int32Array(4),g=null,m=null,v=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ta,this._useLegacyLights=!1,this.toneMapping=Uh,this.toneMappingExposure=1;let y=this,x=!1,M=0,S=0,w=null,T=-1,C=null,b=new Rr,E=new Rr,I=null,R=new tr(0),A=0,D=t.width,U=t.height,B=1,z=null,k=null,G=new Rr(0,0,D,U),Y=new Rr(0,0,D,U),J=!1,Q=new OM,V=!1,K=!1,ae=null,ve=new Ht,ue=new yr,se=new ye,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return w===null?B:1}let H=i;function We(O,j){for(let re=0;re{function W(){if(ie.forEach(function(ee){Ne.get(ee).currentProgram.isReady()&&ie.delete(ee)}),ie.size===0){P(O);return}setTimeout(W,10)}_e.get("KHR_parallel_shader_compile")!==null?W():setTimeout(W,10)})};let Ft=null;function Mr(O){Ft&&Ft(O)}function jr(){Lr.stop()}function Vt(){Lr.start()}let Lr=new ase;Lr.setAnimationLoop(Mr),typeof self<"u"&&Lr.setContext(self),this.setAnimationLoop=function(O){Ft=O,Je.setAnimationLoop(O),O===null?Lr.stop():Lr.start()},Je.addEventListener("sessionstart",jr),Je.addEventListener("sessionend",Vt),this.render=function(O,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Je.enabled===!0&&Je.isPresenting===!0&&(Je.cameraAutoUpdate===!0&&Je.updateCamera(j),j=Je.getCamera()),O.isScene===!0&&O.onBeforeRender(y,O,j,w),m=Ke.get(O,_.length),m.init(),_.push(m),ve.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),Q.setFromProjectionMatrix(ve),K=this.localClippingEnabled,V=Se.init(this.clippingPlanes,K),g=et.get(O,v.length),g.init(),v.push(g),si(O,j,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(z,k),this.info.render.frame++,V===!0&&Se.beginShadows();let re=m.state.shadowsArray;if(Ae.render(re,O,j),V===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Je.enabled===!1||Je.isPresenting===!1||Je.hasDepthSensing()===!1)&&nt.render(g,O),m.setupLights(y._useLegacyLights),j.isArrayCamera){let ie=j.cameras;for(let P=0,W=ie.length;P0?m=_[_.length-1]:m=null,v.pop(),v.length>0?g=v[v.length-1]:g=null};function si(O,j,re,ie){if(O.visible===!1)return;if(O.layers.test(j.layers)){if(O.isGroup)re=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(j);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||Q.intersectsSprite(O)){ie&&se.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ve);let ee=le.update(O),ge=O.material;ge.visible&&g.push(O,ee,ge,re,se.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||Q.intersectsObject(O))){let ee=le.update(O),ge=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),se.copy(O.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),se.copy(ee.boundingSphere.center)),se.applyMatrix4(O.matrixWorld).applyMatrix4(ve)),Array.isArray(ge)){let ce=ee.groups;for(let Oe=0,Ge=ce.length;Oe0&&w0(P,W,j,re),ie&&Le.viewport(b.copy(ie)),P.length>0&&Is(P,j,re),W.length>0&&Is(W,j,re),ee.length>0&&Is(ee,j,re),Le.buffers.depth.setTest(!0),Le.buffers.depth.setMask(!0),Le.buffers.color.setMask(!0),Le.setPolygonOffset(!1)}function w0(O,j,re,ie){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;let W=xe.isWebGL2;ae===null&&(ae=new xc(1,1,{generateMipmaps:!0,type:_e.has("EXT_color_buffer_half_float")?DM:Oh,minFilter:pm,samples:W?4:0})),y.getDrawingBufferSize(ue),W?ae.setSize(ue.x,ue.y):ae.setSize(lR(ue.x),lR(ue.y));let ee=y.getRenderTarget();y.setRenderTarget(ae),y.getClearColor(R),A=y.getClearAlpha(),A<1&&y.setClearColor(16777215,.5),y.clear();let ge=y.toneMapping;y.toneMapping=Uh,Is(O,re,ie),Ve.updateMultisampleRenderTarget(ae),Ve.updateRenderTargetMipmap(ae);let ce=!1;for(let Oe=0,Ge=j.length;Oe0),Re=!!re.morphAttributes.position,pt=!!re.morphAttributes.normal,mt=!!re.morphAttributes.color,$e=Uh;ie.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&($e=y.toneMapping);let at=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,wt=at!==void 0?at.length:0,je=Ne.get(ie),mi=m.state.lights;if(V===!0&&(K===!0||O!==C)){let Kr=O===C&&ie.id===T;Se.setState(ie,O,Kr)}let Ut=!1;ie.version===je.__version?(je.needsLights&&je.lightsStateVersion!==mi.state.version||je.outputColorSpace!==ge||P.isBatchedMesh&&je.batching===!1||!P.isBatchedMesh&&je.batching===!0||P.isInstancedMesh&&je.instancing===!1||!P.isInstancedMesh&&je.instancing===!0||P.isSkinnedMesh&&je.skinning===!1||!P.isSkinnedMesh&&je.skinning===!0||P.isInstancedMesh&&je.instancingColor===!0&&P.instanceColor===null||P.isInstancedMesh&&je.instancingColor===!1&&P.instanceColor!==null||P.isInstancedMesh&&je.instancingMorph===!0&&P.morphTexture===null||P.isInstancedMesh&&je.instancingMorph===!1&&P.morphTexture!==null||je.envMap!==ce||ie.fog===!0&&je.fog!==W||je.numClippingPlanes!==void 0&&(je.numClippingPlanes!==Se.numPlanes||je.numIntersection!==Se.numIntersection)||je.vertexAlphas!==Oe||je.vertexTangents!==Ge||je.morphTargets!==Re||je.morphNormals!==pt||je.morphColors!==mt||je.toneMapping!==$e||xe.isWebGL2===!0&&je.morphTargetsCount!==wt)&&(Ut=!0):(Ut=!0,je.__version=ie.version);let Cr=je.currentProgram;Ut===!0&&(Cr=Go(ie,j,P));let Hi=!1,Mt=!1,Mi=!1,lr=Cr.getUniforms(),un=je.uniforms;if(Le.useProgram(Cr.program)&&(Hi=!0,Mt=!0,Mi=!0),ie.id!==T&&(T=ie.id,Mt=!0),Hi||C!==O){lr.setValue(H,"projectionMatrix",O.projectionMatrix),lr.setValue(H,"viewMatrix",O.matrixWorldInverse);let Kr=lr.map.cameraPosition;Kr!==void 0&&Kr.setValue(H,se.setFromMatrixPosition(O.matrixWorld)),xe.logarithmicDepthBuffer&&lr.setValue(H,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&lr.setValue(H,"isOrthographic",O.isOrthographicCamera===!0),C!==O&&(C=O,Mt=!0,Mi=!0)}if(P.isSkinnedMesh){lr.setOptional(H,P,"bindMatrix"),lr.setOptional(H,P,"bindMatrixInverse");let Kr=P.skeleton;Kr&&(xe.floatVertexTextures?(Kr.boneTexture===null&&Kr.computeBoneTexture(),lr.setValue(H,"boneTexture",Kr.boneTexture,Ve)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}P.isBatchedMesh&&(lr.setOptional(H,P,"batchingTexture"),lr.setValue(H,"batchingTexture",P._matricesTexture,Ve));let du=re.morphAttributes;if((du.position!==void 0||du.normal!==void 0||du.color!==void 0&&xe.isWebGL2===!0)&&$.update(P,re,Cr),(Mt||je.receiveShadow!==P.receiveShadow)&&(je.receiveShadow=P.receiveShadow,lr.setValue(H,"receiveShadow",P.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(un.envMap.value=ce,un.flipEnvMap.value=ce.isCubeTexture&&ce.isRenderTargetTexture===!1?-1:1),Mt&&(lr.setValue(H,"toneMappingExposure",y.toneMappingExposure),je.needsLights&&E0(un,Mi),W&&ie.fog===!0&&he.refreshFogUniforms(un,W),he.refreshMaterialUniforms(un,ie,B,U,ae),u0.upload(H,Kh(je),un,Ve)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(u0.upload(H,Kh(je),un,Ve),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&lr.setValue(H,"center",P.center),lr.setValue(H,"modelViewMatrix",P.modelViewMatrix),lr.setValue(H,"normalMatrix",P.normalMatrix),lr.setValue(H,"modelMatrix",P.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){let Kr=ie.uniformsGroups;for(let mu=0,Jh=Kr.length;mu0&&Ve.useMultisampledRTT(O)===!1?P=Ne.get(O).__webglMultisampledFramebuffer:Array.isArray(Ge)?P=Ge[re]:P=Ge,b.copy(O.viewport),E.copy(O.scissor),I=O.scissorTest}else b.copy(G).multiplyScalar(B).floor(),E.copy(Y).multiplyScalar(B).floor(),I=J;if(Le.bindFramebuffer(H.FRAMEBUFFER,P)&&xe.drawBuffers&&ie&&Le.drawBuffers(O,P),Le.viewport(b),Le.scissor(E),Le.setScissorTest(I),W){let ce=Ne.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce.__webglTexture,re)}else if(ee){let ce=Ne.get(O.texture),Oe=j||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,ce.__webglTexture,re||0,Oe)}T=-1},this.readRenderTargetPixels=function(O,j,re,ie,P,W,ee){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Ne.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&ee!==void 0&&(ge=ge[ee]),ge){Le.bindFramebuffer(H.FRAMEBUFFER,ge);try{let ce=O.texture,Oe=ce.format,Ge=ce.type;if(Oe!==Cs&&Fe.convert(Oe)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Re=Ge===DM&&(_e.has("EXT_color_buffer_half_float")||xe.isWebGL2&&_e.has("EXT_color_buffer_float"));if(Ge!==Oh&&Fe.convert(Ge)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ge===fu&&(xe.isWebGL2||_e.has("OES_texture_float")||_e.has("WEBGL_color_buffer_float")))&&!Re){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=O.width-ie&&re>=0&&re<=O.height-P&&H.readPixels(j,re,ie,P,Fe.convert(Oe),Fe.convert(Ge),W)}finally{let ce=w!==null?Ne.get(w).__webglFramebuffer:null;Le.bindFramebuffer(H.FRAMEBUFFER,ce)}}},this.copyFramebufferToTexture=function(O,j,re=0){let ie=Math.pow(2,-re),P=Math.floor(j.image.width*ie),W=Math.floor(j.image.height*ie);Ve.setTexture2D(j,0),H.copyTexSubImage2D(H.TEXTURE_2D,re,0,0,O.x,O.y,P,W),Le.unbindTexture()},this.copyTextureToTexture=function(O,j,re,ie=0){let P=j.image.width,W=j.image.height,ee=Fe.convert(re.format),ge=Fe.convert(re.type);Ve.setTexture2D(re,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,re.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,re.unpackAlignment),j.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,P,W,ee,ge,j.image.data):j.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,j.mipmaps[0].width,j.mipmaps[0].height,ee,j.mipmaps[0].data):H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,ee,ge,j.image),ie===0&&re.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),Le.unbindTexture()},this.copyTextureToTexture3D=function(O,j,re,ie,P=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let W=Math.round(O.max.x-O.min.x),ee=Math.round(O.max.y-O.min.y),ge=O.max.z-O.min.z+1,ce=Fe.convert(ie.format),Oe=Fe.convert(ie.type),Ge;if(ie.isData3DTexture)Ve.setTexture3D(ie,0),Ge=H.TEXTURE_3D;else if(ie.isDataArrayTexture||ie.isCompressedArrayTexture)Ve.setTexture2DArray(ie,0),Ge=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,ie.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,ie.unpackAlignment);let Re=H.getParameter(H.UNPACK_ROW_LENGTH),pt=H.getParameter(H.UNPACK_IMAGE_HEIGHT),mt=H.getParameter(H.UNPACK_SKIP_PIXELS),$e=H.getParameter(H.UNPACK_SKIP_ROWS),at=H.getParameter(H.UNPACK_SKIP_IMAGES),wt=re.isCompressedTexture?re.mipmaps[P]:re.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,wt.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,wt.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,O.min.x),H.pixelStorei(H.UNPACK_SKIP_ROWS,O.min.y),H.pixelStorei(H.UNPACK_SKIP_IMAGES,O.min.z),re.isDataTexture||re.isData3DTexture?H.texSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,Oe,wt.data):ie.isCompressedArrayTexture?H.compressedTexSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,wt.data):H.texSubImage3D(Ge,P,j.x,j.y,j.z,W,ee,ge,ce,Oe,wt),H.pixelStorei(H.UNPACK_ROW_LENGTH,Re),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,pt),H.pixelStorei(H.UNPACK_SKIP_PIXELS,mt),H.pixelStorei(H.UNPACK_SKIP_ROWS,$e),H.pixelStorei(H.UNPACK_SKIP_IMAGES,at),P===0&&ie.generateMipmaps&&H.generateMipmap(Ge),Le.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?Ve.setTextureCube(O,0):O.isData3DTexture?Ve.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?Ve.setTexture2DArray(O,0):Ve.setTexture2D(O,0),Le.unbindTexture()},this.resetState=function(){M=0,S=0,w=null,Le.reset(),we.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return yc}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===Fk?"display-p3":"srgb",t.unpackColorSpace=$r.workingColorSpace===zR?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}},xk=class extends _k{};xk.prototype.isWebGL1Renderer=!0;var Poe=new ye,Doe=new Rr,Ioe=new Rr,JUe=new ye,Noe=new Ht,KC=new ye,qB=new kh,Uoe=new Ht,ZB=new NM,xR=class extends co{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=fae,this.bindMatrix=new Ht,this.bindMatrixInverse=new Ht,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Bh),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let i=0;il)continue;h.applyMatrix4(this.matrixWorld);let T=e.ray.origin.distanceTo(h);Te.far||t.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{let v=Math.max(0,o.start),_=Math.min(m.count,o.start+o.count);for(let y=v,x=_-1;yl)continue;h.applyMatrix4(this.matrixWorld);let S=e.ray.origin.distanceTo(h);Se.far||t.push({distance:S,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a0)l=n-1;else{l=n;break}if(n=l,i[n]===o)return n/(a-1);let c=i[n],h=i[n+1]-c,p=(o-c)/h;return(n+p)/(a-1)}getTangent(e,t){let n=e-1e-4,a=e+1e-4;n<0&&(n=0),a>1&&(a=1);let o=this.getPoint(n),s=this.getPoint(a),l=t||(o.isVector2?new yr:new ye);return l.copy(s).sub(o).normalize(),l}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new ye,n=[],a=[],o=[],s=new ye,l=new Ht;for(let p=0;p<=e;p++){let d=p/e;n[p]=this.getTangentAt(d,new ye)}a[0]=new ye,o[0]=new ye;let u=Number.MAX_VALUE,c=Math.abs(n[0].x),f=Math.abs(n[0].y),h=Math.abs(n[0].z);c<=u&&(u=c,i.set(1,0,0)),f<=u&&(u=f,i.set(0,1,0)),h<=u&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),a[0].crossVectors(n[0],s),o[0].crossVectors(n[0],a[0]);for(let p=1;p<=e;p++){if(a[p]=a[p-1].clone(),o[p]=o[p-1].clone(),s.crossVectors(n[p-1],n[p]),s.length()>Number.EPSILON){s.normalize();let d=Math.acos(In(n[p-1].dot(n[p]),-1,1));a[p].applyMatrix4(l.makeRotationAxis(s,d))}o[p].crossVectors(n[p],a[p])}if(t===!0){let p=Math.acos(In(a[0].dot(a[e]),-1,1));p/=e,n[0].dot(s.crossVectors(a[0],a[e]))>0&&(p=-p);for(let d=1;d<=e;d++)a[d].applyMatrix4(l.makeRotationAxis(n[d],p*d)),o[d].crossVectors(n[d],a[d])}return{tangents:n,normals:a,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}};var QUe={triangulate:function(r,e,t=2){let i=e&&e.length,n=i?e[0]*t:r.length,a=fse(r,0,n,t,!0),o=[];if(!a||a.next===a.prev)return o;let s,l,u,c,f,h,p;if(i&&(a=nOe(r,e,a,t)),r.length>80*t){s=u=r[0],l=c=r[1];for(let d=t;du&&(u=f),h>c&&(c=h);p=Math.max(u-s,c-l),p=p!==0?32767/p:0}return FM(a,o,t,s,l,p,0),o}};function fse(r,e,t,i,n){let a,o;if(n===mOe(r,e,t,i)>0)for(a=e;a=e;a-=i)o=koe(a,r[a],r[a+1],o);return o&&BR(o,o.next)&&(kM(o),o=o.next),o}function vm(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=!1,!t.steiner&&(BR(t,t.next)||Si(t.prev,t,t.next)===0)){if(kM(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function FM(r,e,t,i,n,a,o){if(!r)return;!o&&a&&uOe(r,i,n,a);let s=r,l,u;for(;r.prev!==r.next;){if(l=r.prev,u=r.next,a?tOe(r,i,n,a):eOe(r)){e.push(l.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),kM(r),r=u.next,s=u.next;continue}if(r=u,r===s){o?o===1?(r=rOe(vm(r),e,t),FM(r,e,t,i,n,a,2)):o===2&&iOe(r,e,t,i,n,a):FM(vm(r),e,t,i,n,a,1);break}}}function eOe(r){let e=r.prev,t=r,i=r.next;if(Si(e,t,i)>=0)return!1;let n=e.x,a=t.x,o=i.x,s=e.y,l=t.y,u=i.y,c=na?n>o?n:o:a>o?a:o,p=s>l?s>u?s:u:l>u?l:u,d=i.next;for(;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=f&&d.y<=p&&o0(n,s,a,l,o,u,d.x,d.y)&&Si(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function tOe(r,e,t,i){let n=r.prev,a=r,o=r.next;if(Si(n,a,o)>=0)return!1;let s=n.x,l=a.x,u=o.x,c=n.y,f=a.y,h=o.y,p=sl?s>u?s:u:l>u?l:u,m=c>f?c>h?c:h:f>h?f:h,v=Mk(p,d,e,t,i),_=Mk(g,m,e,t,i),y=r.prevZ,x=r.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=g&&y.y>=d&&y.y<=m&&y!==n&&y!==o&&o0(s,c,l,f,u,h,y.x,y.y)&&Si(y.prev,y,y.next)>=0||(y=y.prevZ,x.x>=p&&x.x<=g&&x.y>=d&&x.y<=m&&x!==n&&x!==o&&o0(s,c,l,f,u,h,x.x,x.y)&&Si(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=g&&y.y>=d&&y.y<=m&&y!==n&&y!==o&&o0(s,c,l,f,u,h,y.x,y.y)&&Si(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=g&&x.y>=d&&x.y<=m&&x!==n&&x!==o&&o0(s,c,l,f,u,h,x.x,x.y)&&Si(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function rOe(r,e,t){let i=r;do{let n=i.prev,a=i.next.next;!BR(n,a)&&hse(n,i,i.next,a)&&BM(n,a)&&BM(a,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(a.i/t|0),kM(i),kM(i.next),i=r=a),i=i.next}while(i!==r);return vm(i)}function iOe(r,e,t,i,n,a){let o=r;do{let s=o.next.next;for(;s!==o.prev;){if(o.i!==s.i&&hOe(o,s)){let l=pse(o,s);o=vm(o,o.next),l=vm(l,l.next),FM(o,e,t,i,n,a,0),FM(l,e,t,i,n,a,0);return}s=s.next}o=o.next}while(o!==r)}function nOe(r,e,t,i){let n=[],a,o,s,l,u;for(a=0,o=e.length;a=t.next.y&&t.next.y!==t.y){let h=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=a&&h>i&&(i=h,n=t.x=t.x&&t.x>=l&&a!==t.x&&o0(on.x||t.x===n.x&&lOe(n,t)))&&(n=t,c=f)),t=t.next;while(t!==s);return n}function lOe(r,e){return Si(r.prev,r,e.prev)<0&&Si(e.next,r,r.next)<0}function uOe(r,e,t,i){let n=r;do n.z===0&&(n.z=Mk(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,cOe(n)}function cOe(r){let e,t,i,n,a,o,s,l,u=1;do{for(t=r,r=null,a=null,o=0;t;){for(o++,i=t,s=0,e=0;e0||l>0&&i;)s!==0&&(l===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,s--):(n=i,i=i.nextZ,l--),a?a.nextZ=n:r=n,n.prevZ=a,a=n;t=i}a.nextZ=null,u*=2}while(o>1);return r}function Mk(r,e,t,i,n){return r=(r-t)*n|0,e=(e-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function fOe(r){let e=r,t=r;do(e.x=(r-o)*(a-s)&&(r-o)*(i-s)>=(t-o)*(e-s)&&(t-o)*(a-s)>=(n-o)*(i-s)}function hOe(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!pOe(r,e)&&(BM(r,e)&&BM(e,r)&&dOe(r,e)&&(Si(r.prev,r,e.prev)||Si(r,e.prev,e))||BR(r,e)&&Si(r.prev,r,r.next)>0&&Si(e.prev,e,e.next)>0)}function Si(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function BR(r,e){return r.x===e.x&&r.y===e.y}function hse(r,e,t,i){let n=QC(Si(r,e,t)),a=QC(Si(r,e,i)),o=QC(Si(t,i,r)),s=QC(Si(t,i,e));return!!(n!==a&&o!==s||n===0&&$C(r,t,e)||a===0&&$C(r,i,e)||o===0&&$C(t,r,i)||s===0&&$C(t,e,i))}function $C(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function QC(r){return r>0?1:r<0?-1:0}function pOe(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&hse(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function BM(r,e){return Si(r.prev,r,r.next)<0?Si(r,e,r.next)>=0&&Si(r,r.prev,e)>=0:Si(r,e,r.prev)<0||Si(r,r.next,e)<0}function dOe(r,e){let t=r,i=!1,n=(r.x+e.x)/2,a=(r.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&n<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function pse(r,e){let t=new bk(r.i,r.x,r.y),i=new bk(e.i,e.x,e.y),n=r.next,a=e.prev;return r.next=e,e.prev=r,t.next=n,n.prev=t,i.next=t,t.prev=i,a.next=i,i.prev=a,i}function koe(r,e,t,i){let n=new bk(r,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function kM(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function bk(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function mOe(r,e,t,i){let n=0;for(let a=e,o=t-i;a2&&r[e-1].equals(r[0])&&r.pop()}function Goe(r,e){for(let t=0;t=a)){let s=t[1];e=a)break t}o=i,i=0;break r}break e}for(;i>>1;et;)--o;if(++o,a!==0||o!==n){a>=o&&(o=Math.max(o,1),a=o-1);let s=this.getValueSize();this.times=i.slice(a,o),this.values=this.values.slice(a*s,o*s)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,n=this.values,a=i.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let s=0;s!==a;s++){let l=i[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,o),e=!1;break}o=l}if(n!==void 0&&vOe(n))for(let s=0,l=n.length;s!==l;++s){let u=n[s];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,u),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),n=this.getInterpolation()===MB,a=e.length-1,o=1;for(let s=1;s0){e[o]=e[a];for(let s=a*i,l=o*i,u=0;u!==i;++u)t[l+u]=t[s+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),i=this.constructor,n=new i(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}};Ps.prototype.TimeBufferType=Float32Array;Ps.prototype.ValueBufferType=Float32Array;Ps.prototype.DefaultInterpolation=iR;var Vh=class extends Ps{};Vh.prototype.ValueTypeName="bool";Vh.prototype.ValueBufferType=Array;Vh.prototype.DefaultInterpolation=rR;Vh.prototype.InterpolantFactoryMethodLinear=void 0;Vh.prototype.InterpolantFactoryMethodSmooth=void 0;var ER=class extends Ps{};ER.prototype.ValueTypeName="color";var Gh=class extends Ps{};Gh.prototype.ValueTypeName="number";var Ak=class extends x0{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=(i-t)/(n-t),u=e*s;for(let c=u+s;u!==c;u+=4)On.slerpFlat(a,0,o,u-s,o,u,l);return a}},pu=class extends Ps{InterpolantFactoryMethodLinear(e){return new Ak(this.times,this.values,this.getValueSize(),e)}};pu.prototype.ValueTypeName="quaternion";pu.prototype.DefaultInterpolation=iR;pu.prototype.InterpolantFactoryMethodSmooth=void 0;var Hh=class extends Ps{};Hh.prototype.ValueTypeName="string";Hh.prototype.ValueBufferType=Array;Hh.prototype.DefaultInterpolation=rR;Hh.prototype.InterpolantFactoryMethodLinear=void 0;Hh.prototype.InterpolantFactoryMethodSmooth=void 0;var Wh=class extends Ps{};Wh.prototype.ValueTypeName="vector";var AR=class{constructor(e,t=-1,i,n=CPe){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=Yh(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,n=1/(e.fps||1);for(let o=0,s=i.length;o!==s;++o)t.push(_Oe(i[o]).scale(n));let a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){let t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,o=i.length;a!==o;++a)t.push(Ps.toJSON(i[a]));return n}static CreateFromMorphTargetSequence(e,t,i,n){let a=t.length,o=[];for(let s=0;s1){let f=c[1],h=n[f];h||(n[f]=h=[]),h.push(u)}}let o=[];for(let s in n)o.push(this.CreateFromMorphTargetSequence(s,n[s],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(f,h,p,d,g){if(p.length!==0){let m=[],v=[];dse(p,m,v,d),m.length!==0&&g.push(new f(h,m,v))}},n=[],a=e.name||"default",o=e.fps||30,s=e.blendMode,l=e.length||-1,u=e.hierarchy||[];for(let f=0;f{class r{constructor(t){this.manager=t!==void 0?t:xOe,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,i){let n=this;return new Promise(function(a,o){n.load(t,a,i,o)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}return r.DEFAULT_MATERIAL_NAME="__DEFAULT",r})(),dc={},Rk=class extends Error{constructor(e,t){super(e),this.response=t}},RR=class extends gm{constructor(e){super(e)}load(e,t,i,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let a=CR.get(e);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0),a;if(dc[e]!==void 0){dc[e].push({onLoad:t,onProgress:i,onError:n});return}dc[e]=[],dc[e].push({onLoad:t,onProgress:i,onError:n});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;let c=dc[e],f=u.body.getReader(),h=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),p=h?parseInt(h):0,d=p!==0,g=0,m=new ReadableStream({start(v){_();function _(){f.read().then(({done:y,value:x})=>{if(y)v.close();else{g+=x.byteLength;let M=new ProgressEvent("progress",{lengthComputable:d,loaded:g,total:p});for(let S=0,w=c.length;S{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,s));case"json":return u.json();default:if(s===void 0)return u.text();{let f=/charset="?([^;"\s]*)"?/i.exec(s),h=f&&f[1]?f[1].toLowerCase():void 0,p=new TextDecoder(h);return u.arrayBuffer().then(d=>p.decode(d))}}}).then(u=>{CR.add(e,u);let c=dc[e];delete dc[e];for(let f=0,h=c.length;f{let c=dc[e];if(c===void 0)throw this.manager.itemError(e),u;delete dc[e];for(let f=0,h=c.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}};var Lk=class extends gm{constructor(e){super(e)}load(e,t,i,n){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let a=this,o=CR.get(e);if(o!==void 0)return a.manager.itemStart(e),setTimeout(function(){t&&t(o),a.manager.itemEnd(e)},0),o;let s=IM("img");function l(){c(),CR.add(e,this),t&&t(this),a.manager.itemEnd(e)}function u(f){c(),n&&n(f),a.manager.itemError(e),a.manager.itemEnd(e)}function c(){s.removeEventListener("load",l,!1),s.removeEventListener("error",u,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),a.manager.itemStart(e),s.src=e,s}};var LR=class extends gm{constructor(e){super(e)}load(e,t,i,n){let a=new Vo,o=new Lk(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(s){a.image=s,a.needsUpdate=!0,t!==void 0&&t(a)},i,n),a}},S0=class extends ia{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new tr(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let 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}};var KB=new Ht,Woe=new ye,Xoe=new ye,VM=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new yr(512,512),this.map=null,this.mapPass=null,this.matrix=new Ht,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new OM,this._frameExtents=new yr(1,1),this._viewportCount=1,this._viewports=[new Rr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;Woe.setFromMatrixPosition(e.matrixWorld),t.position.copy(Woe),Xoe.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Xoe),t.updateMatrixWorld(),KB.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(KB),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(KB)}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(){let 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}},Pk=class extends VM{constructor(){super(new Nn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,i=d0*2*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,a=e.distance||t.far;(i!==t.fov||n!==t.aspect||a!==t.far)&&(t.fov=i,t.aspect=n,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},PR=class extends S0{constructor(e,t,i=0,n=Math.PI/3,a=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(ia.DEFAULT_UP),this.updateMatrix(),this.target=new ia,this.distance=i,this.angle=n,this.penumbra=a,this.decay=o,this.map=null,this.shadow=new Pk}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),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}},Yoe=new Ht,AM=new ye,JB=new ye,Dk=class extends VM{constructor(){super(new Nn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new yr(4,2),this._viewportCount=6,this._viewports=[new Rr(2,1,1,1),new Rr(0,1,1,1),new Rr(3,1,1,1),new Rr(1,1,1,1),new Rr(3,0,1,1),new Rr(1,0,1,1)],this._cubeDirections=[new ye(1,0,0),new ye(-1,0,0),new ye(0,0,1),new ye(0,0,-1),new ye(0,1,0),new ye(0,-1,0)],this._cubeUps=[new ye(0,1,0),new ye(0,1,0),new ye(0,1,0),new ye(0,1,0),new ye(0,0,1),new ye(0,0,-1)]}updateMatrices(e,t=0){let i=this.camera,n=this.matrix,a=e.distance||i.far;a!==i.far&&(i.far=a,i.updateProjectionMatrix()),AM.setFromMatrixPosition(e.matrixWorld),i.position.copy(AM),JB.copy(i.position),JB.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(JB),i.updateMatrixWorld(),n.makeTranslation(-AM.x,-AM.y,-AM.z),Yoe.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yoe)}},GM=class extends S0{constructor(e,t,i=0,n=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new Dk}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},Ik=class extends VM{constructor(){super(new g0(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},DR=class extends S0{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ia.DEFAULT_UP),this.updateMatrix(),this.target=new ia,this.shadow=new Ik}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},IR=class extends S0{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}};var NR=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,n=e.length;i{class r{constructor(t,i,n){this.path=i,this.parsedPath=n||r.parseTrackName(i),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,i,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,i,n):new r(t,i,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(SOe,"")}static parseTrackName(t){let i=AOe.exec(t);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},a=n.nodeName&&n.nodeName.lastIndexOf(".");if(a!==void 0&&a!==-1){let o=n.nodeName.substring(a+1);COe.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,a),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,i){if(i===void 0||i===""||i==="."||i===-1||i===t.name||i===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(i);if(n!==void 0)return n}if(t.children){let n=function(o){for(let s=0;s>>1|(Fr&21845)<<1,Mc=(Mc&52428)>>>2|(Mc&13107)<<2,Mc=(Mc&61680)>>>4|(Mc&3855)<<4,Yk[Fr]=((Mc&65280)>>>8|(Mc&255)<<8)>>>1;var Mc,Fr,HM=function(r,e,t){for(var i=r.length,n=0,a=new qh(e);n>>l]=u}else for(s=new qh(i),n=0;n>>15-r[n]);return s},WM=new Ds(288);for(Fr=0;Fr<144;++Fr)WM[Fr]=8;var Fr;for(Fr=144;Fr<256;++Fr)WM[Fr]=9;var Fr;for(Fr=256;Fr<280;++Fr)WM[Fr]=7;var Fr;for(Fr=280;Fr<288;++Fr)WM[Fr]=8;var Fr,Mse=new Ds(32);for(Fr=0;Fr<32;++Fr)Mse[Fr]=5;var Fr;var IOe=HM(WM,9,1);var NOe=HM(Mse,5,1),Hk=function(r){for(var e=r[0],t=1;te&&(e=r[t]);return e},xl=function(r,e,t){var i=e/8|0;return(r[i]|r[i+1]<<8)>>(e&7)&t},Wk=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},UOe=function(r){return(r/8|0)+(r&7&&1)},OOe=function(r,e,t){(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof qh?qh:r instanceof Xk?Xk:Ds)(t-e);return i.set(r.subarray(e,t)),i},zOe=function(r,e,t){var i=r.length;if(!i||t&&!t.l&&i<5)return e||new Ds(0);var n=!e||t,a=!t||t.i;t||(t={}),e||(e=new Ds(i*3));var o=function(ae){var ve=e.length;if(ae>ve){var ue=new Ds(Math.max(ve*2,ae));ue.set(e),e=ue}},s=t.f||0,l=t.p||0,u=t.b||0,c=t.l,f=t.d,h=t.m,p=t.n,d=i*8;do{if(!c){t.f=s=xl(r,l,1);var g=xl(r,l+1,3);if(l+=3,g)if(g==1)c=IOe,f=NOe,h=9,p=5;else if(g==2){var y=xl(r,l,31)+257,x=xl(r,l+10,15)+4,M=y+xl(r,l+5,31)+1;l+=14;for(var S=new Ds(M),w=new Ds(19),T=0;T>>4;if(m<16)S[T++]=m;else{var R=0,A=0;for(m==16?(A=3+xl(r,l,3),l+=2,R=S[T-1]):m==17?(A=3+xl(r,l,7),l+=3):m==18&&(A=11+xl(r,l,127),l+=7);A--;)S[T++]=R}}var D=S.subarray(0,y),U=S.subarray(y);h=Hk(D),p=Hk(U),c=HM(D,h,1),f=HM(U,p,1)}else throw"invalid block type";else{var m=UOe(l)+4,v=r[m-4]|r[m-3]<<8,_=m+v;if(_>i){if(a)throw"unexpected EOF";break}n&&o(u+v),e.set(r.subarray(m,_),u),t.b=u+=v,t.p=l=_*8;continue}if(l>d){if(a)throw"unexpected EOF";break}}n&&o(u+131072);for(var B=(1<>>4;if(l+=R&15,l>d){if(a)throw"unexpected EOF";break}if(!R)throw"invalid length/literal";if(G<256)e[u++]=G;else if(G==256){k=l,c=null;break}else{var Y=G-254;if(G>264){var T=G-257,J=vse[T];Y=xl(r,l,(1<>>4;if(!Q)throw"invalid distance";l+=Q&15;var U=DOe[V];if(V>3){var J=gse[V];U+=Wk(r,l)&(1<d){if(a)throw"unexpected EOF";break}n&&o(u+131072);for(var K=u+Y;u>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function bse(r,e){return zOe((BOe(r),r.subarray(2,-4)),e)}var kOe=typeof TextDecoder<"u"&&new TextDecoder,VOe=0;try{kOe.decode(FOe,{stream:!0}),VOe=1}catch{}function wse(r,e,t){let i=t.length-r-1;if(e>=t[i])return i-1;if(e<=t[r])return r;let n=r,a=i,o=Math.floor((n+a)/2);for(;e=t[o+1];)e=g&&(d[p][0]=d[h][0]/s[_+1][v],m=d[p][0]*s[v][_]);let y=v>=-1?1:-v,x=f-1<=_?g-1:t-f;for(let S=y;S<=x;++S)d[p][S]=(d[h][S]-d[h][S-1])/s[_+1][v+S],m+=d[p][S]*s[v+S][_];f<=_&&(d[p][g]=-d[h][g-1]/s[_+1][f],m+=d[p][g]*s[f][_]),o[g][f]=m;let M=h;h=p,p=M}}let c=t;for(let f=1;f<=i;++f){for(let h=0;h<=t;++h)o[f][h]*=c;c*=t-f}return o}function XOe(r,e,t,i,n){let a=n0,l=typeof a.Content=="string"&&a.Content!=="";if(s||l){let u=this.parseImage(i[n]);t[a.RelativeFilename||a.Filename]=u}}}}for(let i in e){let n=e[i];t[n]!==void 0?e[i]=t[n]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){let t=e.Content,i=e.RelativeFilename||e.Filename,n=i.slice(i.lastIndexOf(".")+1).toLowerCase(),a;switch(n){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",i),a="image/tga";break;default:console.warn('FBXLoader: Image type "'+n+'" is not supported.');return}if(typeof t=="string")return"data:"+a+";base64,"+t;{let o=new Uint8Array(t);return window.URL.createObjectURL(new Blob([o],{type:a}))}}parseTextures(e){let t=new Map;if("Texture"in _r.Objects){let i=_r.Objects.Texture;for(let n in i){let a=this.parseTexture(i[n],e);t.set(parseInt(n),a)}}return t}parseTexture(e,t){let i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;let n=e.WrapModeU,a=e.WrapModeV,o=n!==void 0?n.value:0,s=a!==void 0?a.value:0;if(i.wrapS=o===0?h0:uo,i.wrapT=s===0?h0:uo,"Scaling"in e){let l=e.Scaling.value;i.repeat.x=l[0],i.repeat.y=l[1]}if("Translation"in e){let l=e.Translation.value;i.offset.x=l[0],i.offset.y=l[1]}return i}loadTexture(e,t){let i,n=this.textureLoader.path,a=Oi.get(e.id).children;a!==void 0&&a.length>0&&t[a[0].ID]!==void 0&&(i=t[a[0].ID],(i.indexOf("blob:")===0||i.indexOf("data:")===0)&&this.textureLoader.setPath(void 0));let o,s=e.FileName.slice(-3).toLowerCase();if(s==="tga"){let l=this.manager.getHandler(".tga");l===null?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),o=new Vo):(l.setPath(this.textureLoader.path),o=l.load(i))}else if(s==="dds"){let l=this.manager.getHandler(".dds");l===null?(console.warn("FBXLoader: DDS loader not found, creating placeholder texture for",e.RelativeFilename),o=new Vo):(l.setPath(this.textureLoader.path),o=l.load(i))}else s==="psd"?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),o=new Vo):o=this.textureLoader.load(i);return this.textureLoader.setPath(n),o}parseMaterials(e){let t=new Map;if("Material"in _r.Objects){let i=_r.Objects.Material;for(let n in i){let a=this.parseMaterial(i[n],e);a!==null&&t.set(parseInt(n),a)}}return t}parseMaterial(e,t){let i=e.id,n=e.attrName,a=e.ShadingModel;if(typeof a=="object"&&(a=a.value),!Oi.has(i))return null;let o=this.parseParameters(e,t,i),s;switch(a.toLowerCase()){case"phong":s=new _0;break;case"lambert":s=new TR;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',a),s=new _0;break}return s.setValues(o),s.name=n,s}parseParameters(e,t,i){let n={};e.BumpFactor&&(n.bumpScale=e.BumpFactor.value),e.Diffuse?n.color=new tr().fromArray(e.Diffuse.value).convertSRGBToLinear():e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(n.color=new tr().fromArray(e.DiffuseColor.value).convertSRGBToLinear()),e.DisplacementFactor&&(n.displacementScale=e.DisplacementFactor.value),e.Emissive?n.emissive=new tr().fromArray(e.Emissive.value).convertSRGBToLinear():e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(n.emissive=new tr().fromArray(e.EmissiveColor.value).convertSRGBToLinear()),e.EmissiveFactor&&(n.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(n.opacity=parseFloat(e.Opacity.value)),n.opacity<1&&(n.transparent=!0),e.ReflectionFactor&&(n.reflectivity=e.ReflectionFactor.value),e.Shininess&&(n.shininess=e.Shininess.value),e.Specular?n.specular=new tr().fromArray(e.Specular.value).convertSRGBToLinear():e.SpecularColor&&e.SpecularColor.type==="Color"&&(n.specular=new tr().fromArray(e.SpecularColor.value).convertSRGBToLinear());let a=this;return Oi.get(i).children.forEach(function(o){let s=o.relationship;switch(s){case"Bump":n.bumpMap=a.getTexture(t,o.ID);break;case"Maya|TEX_ao_map":n.aoMap=a.getTexture(t,o.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":n.map=a.getTexture(t,o.ID),n.map!==void 0&&(n.map.colorSpace=Ta);break;case"DisplacementColor":n.displacementMap=a.getTexture(t,o.ID);break;case"EmissiveColor":n.emissiveMap=a.getTexture(t,o.ID),n.emissiveMap!==void 0&&(n.emissiveMap.colorSpace=Ta);break;case"NormalMap":case"Maya|TEX_normal_map":n.normalMap=a.getTexture(t,o.ID);break;case"ReflectionColor":n.envMap=a.getTexture(t,o.ID),n.envMap!==void 0&&(n.envMap.mapping=PM,n.envMap.colorSpace=Ta);break;case"SpecularColor":n.specularMap=a.getTexture(t,o.ID),n.specularMap!==void 0&&(n.specularMap.colorSpace=Ta);break;case"TransparentColor":case"TransparencyFactor":n.alphaMap=a.getTexture(t,o.ID),n.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",s);break}}),n}getTexture(e,t){return"LayeredTexture"in _r.Objects&&t in _r.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=Oi.get(t).children[0].ID),e.get(t)}parseDeformers(){let e={},t={};if("Deformer"in _r.Objects){let i=_r.Objects.Deformer;for(let n in i){let a=i[n],o=Oi.get(parseInt(n));if(a.attrType==="Skin"){let s=this.parseSkeleton(o,i);s.ID=n,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),s.geometryID=o.parents[0].ID,e[n]=s}else if(a.attrType==="BlendShape"){let s={id:n};s.rawTargets=this.parseMorphTargets(o,i),s.id=n,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[n]=s}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){let i=[];return e.children.forEach(function(n){let a=t[n.ID];if(a.attrType!=="Cluster")return;let o={ID:n.ID,indices:[],weights:[],transformLink:new Ht().fromArray(a.TransformLink.a)};"Indexes"in a&&(o.indices=a.Indexes.a,o.weights=a.Weights.a),i.push(o)}),{rawBones:i,bones:[]}}parseMorphTargets(e,t){let i=[];for(let n=0;n1?o=s:s.length>0?o=s[0]:(o=new _0({name:gm.DEFAULT_MATERIAL_NAME,color:13421772}),s.push(o)),"color"in a.attributes&&s.forEach(function(l){l.vertexColors=!0}),a.FBX_Deformer?(n=new xR(a,o),n.normalizeSkinWeights()):n=new co(a,o),n}createCurve(e,t){let i=e.children.reduce(function(a,o){return t.has(o.ID)&&(a=t.get(o.ID)),a},null),n=new zM({name:gm.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new MR(i,n)}getTransformData(e,t){let i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?i.eulerOrder=Rse(t.RotationOrder.value):i.eulerOrder="ZYX","Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&Oi.get(e.ID).children.forEach(function(n){if(n.relationship==="LookAtProperty"){let a=_r.Objects.Model[n.ID];if("Lcl_Translation"in a){let o=a.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(o),Ea.add(e.target)):e.lookAt(new ye().fromArray(o))}}})}bindSkeleton(e,t,i){let n=this.parsePoseNodes();for(let a in e){let o=e[a];Oi.get(parseInt(o.ID)).parents.forEach(function(l){if(t.has(l.ID)){let u=l.ID;Oi.get(u).parents.forEach(function(f){i.has(f.ID)&&i.get(f.ID).bind(new SR(o.bones),n[f.ID])})}})}}parsePoseNodes(){let e={};if("Pose"in _r.Objects){let t=_r.Objects.Pose;for(let i in t)if(t[i].attrType==="BindPose"&&t[i].NbPoseNodes>0){let n=t[i].PoseNode;Array.isArray(n)?n.forEach(function(a){e[a.Node]=new Ht().fromArray(a.Matrix.a)}):e[n.Node]=new Ht().fromArray(n.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in _r){if("AmbientColor"in _r.GlobalSettings){let e=_r.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],n=e[2];if(t!==0||i!==0||n!==0){let a=new tr(t,i,n).convertSRGBToLinear();Ea.add(new IR(a,1))}}"UnitScaleFactor"in _r.GlobalSettings&&(Ea.userData.unitScaleFactor=_r.GlobalSettings.UnitScaleFactor.value)}}},Kk=class{constructor(){this.negativeMaterialIndices=!1}parse(e){let t=new Map;if("Geometry"in _r.Objects){let i=_r.Objects.Geometry;for(let n in i){let a=Oi.get(parseInt(n)),o=this.parseGeometry(a,i[n],e);t.set(parseInt(n),o)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){let n=i.skeletons,a=[],o=e.parents.map(function(f){return _r.Objects.Model[f.ID]});if(o.length===0)return;let s=e.children.reduce(function(f,h){return n[h.ID]!==void 0&&(f=n[h.ID]),f},null);e.children.forEach(function(f){i.morphTargets[f.ID]!==void 0&&a.push(i.morphTargets[f.ID])});let l=o[0],u={};"RotationOrder"in l&&(u.eulerOrder=Rse(l.RotationOrder.value)),"InheritType"in l&&(u.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(u.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(u.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(u.scale=l.GeometricScaling.value);let c=Cse(u);return this.genGeometry(t,s,a,c)}genGeometry(e,t,i,n){let a=new Ls;e.attrName&&(a.name=e.attrName);let o=this.parseGeoNode(e,t),s=this.genBuffers(o),l=new Un(s.vertex,3);if(l.applyMatrix4(n),a.setAttribute("position",l),s.colors.length>0&&a.setAttribute("color",new Un(s.colors,3)),t&&(a.setAttribute("skinIndex",new m0(s.weightsIndices,4)),a.setAttribute("skinWeight",new Un(s.vertexWeights,4)),a.FBX_Deformer=t),s.normal.length>0){let u=new dr().getNormalMatrix(n),c=new Un(s.normal,3);c.applyNormalMatrix(u),a.setAttribute("normal",c)}if(s.uvs.forEach(function(u,c){let f=c===0?"uv":`uv${c}`;a.setAttribute(f,new Un(s.uvs[c],2))}),o.material&&o.material.mappingType!=="AllSame"){let u=s.materialIndex[0],c=0;if(s.materialIndex.forEach(function(f,h){f!==u&&(a.addGroup(c,h-c,u),u=f,c=h)}),a.groups.length>0){let f=a.groups[a.groups.length-1],h=f.start+f.count;h!==s.materialIndex.length&&a.addGroup(h,s.materialIndex.length-h,u)}a.groups.length===0&&a.addGroup(0,s.materialIndex.length,s.materialIndex[0])}return this.addMorphTargets(a,e,i,n),a}parseGeoNode(e,t){let i={};if(i.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],i.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let n=0;for(;e.LayerElementUV[n];)e.LayerElementUV[n].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[n])),n++}return i.weightTable={},t!==null&&(i.skeleton=t,t.rawBones.forEach(function(n,a){n.indices.forEach(function(o,s){i.weightTable[o]===void 0&&(i.weightTable[o]=[]),i.weightTable[o].push({id:a,weight:n.weights[s]})})})),i}genBuffers(e){let t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},i=0,n=0,a=!1,o=[],s=[],l=[],u=[],c=[],f=[],h=this;return e.vertexIndices.forEach(function(p,d){let g,m=!1;p<0&&(p=p^-1,m=!0);let v=[],_=[];if(o.push(p*3,p*3+1,p*3+2),e.color){let y=VR(d,i,p,e.color);l.push(y[0],y[1],y[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(y){_.push(y.weight),v.push(y.id)}),_.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);let y=[0,0,0,0],x=[0,0,0,0];_.forEach(function(M,S){let w=M,T=v[S];x.forEach(function(C,b,E){if(w>C){E[b]=w,w=C;let I=y[b];y[b]=T,T=I}})}),v=y,_=x}for(;_.length<4;)_.push(0),v.push(0);for(let y=0;y<4;++y)c.push(_[y]),f.push(v[y])}if(e.normal){let y=VR(d,i,p,e.normal);s.push(y[0],y[1],y[2])}e.material&&e.material.mappingType!=="AllSame"&&(g=VR(d,i,p,e.material)[0],g<0&&(h.negativeMaterialIndices=!0,g=0)),e.uv&&e.uv.forEach(function(y,x){let M=VR(d,i,p,y);u[x]===void 0&&(u[x]=[]),u[x].push(M[0]),u[x].push(M[1])}),n++,m&&(h.genFace(t,e,o,g,s,l,u,c,f,n),i++,n=0,o=[],s=[],l=[],u=[],c=[],f=[])}),t}getNormalNewell(e){let t=new ye(0,0,0);for(let i=0;i.5?new ye(0,1,0):new ye(0,0,1)).cross(t).normalize(),a=t.clone().cross(n).normalize();return{normal:t,tangent:n,bitangent:a}}flattenVertex(e,t,i){return new yr(e.dot(t),e.dot(i))}genFace(e,t,i,n,a,o,s,l,u,c){let f;if(c>3){let h=[];for(let m=0;m1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");let o=e.get(a[0].ID);i[n]={name:t[n].attrName,layer:o}}return i}addClip(e){let t=[],i=this;return e.layer.forEach(function(n){t=t.concat(i.generateTracks(n))}),new AR(e.name,-1,t)}generateTracks(e){let t=[],i=new ye,n=new ye;if(e.transform&&e.transform.decompose(i,new On,n),i=i.toArray(),n=n.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){let a=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");a!==void 0&&t.push(a)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){let a=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);a!==void 0&&t.push(a)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){let a=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");a!==void 0&&t.push(a)}if(e.DeformPercent!==void 0){let a=this.generateMorphTrack(e);a!==void 0&&t.push(a)}return t}generateVectorTrack(e,t,i,n){let a=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(a,t,i);return new Wh(e+"."+n,a,o)}generateRotationTrack(e,t,i,n,a){let o,s;if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){let f=this.interpolateRotations(t.x,t.y,t.z,a);o=f[0],s=f[1]}i!==void 0&&(i=i.map(na.degToRad),i.push(a),i=new zn().fromArray(i),i=new On().setFromEuler(i)),n!==void 0&&(n=n.map(na.degToRad),n.push(a),n=new zn().fromArray(n),n=new On().setFromEuler(n).invert());let l=new On,u=new zn,c=[];if(!s||!o)return new pu(e+".quaternion",[],[]);for(let f=0;f2&&new On().fromArray(c,(f-3)/3*4).dot(l)<0&&l.set(-l.x,-l.y,-l.z,-l.w),l.toArray(c,f/3*4);return new pu(e+".quaternion",o,c)}generateMorphTrack(e){let t=e.DeformPercent.curves.morph,i=t.values.map(function(a){return a/100}),n=Ea.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new Gh(e.modelName+".morphTargetInfluences["+n+"]",t.times,i)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(i,n){return i-n}),t.length>1){let i=1,n=t[0];for(let a=1;a=180||p[1]>=180||p[2]>=180){let g=Math.max(...p)/180,m=new zn(...u,n),v=new zn(...f,n),_=new On().setFromEuler(m),y=new On().setFromEuler(v);_.dot(y)&&y.set(-y.x,-y.y,-y.z,-y.w);let x=e.times[s-1],M=e.times[s]-x,S=new On,w=new zn;for(let T=0;T<1;T+=1/g)S.copy(_.clone().slerp(y.clone(),T)),a.push(x+T*M),w.setFromQuaternion(S,n),o.push(w.x),o.push(w.y),o.push(w.z)}else a.push(e.times[s]),o.push(na.degToRad(e.values[s])),o.push(na.degToRad(t.values[s])),o.push(na.degToRad(i.values[s]))}return[a,o]}},$k=class{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new WR,this.nodeStack=[],this.currentProp=[],this.currentPropName="";let t=this,i=e.split(/[\r\n]+/);return i.forEach(function(n,a){let o=n.match(/^[\s\t]*;/),s=n.match(/^[\s\t]*$/);if(o||s)return;let l=n.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),u=n.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=n.match("^\\t{"+(t.currentIndent-1)+"}}");l?t.parseNodeBegin(n,l):u?t.parseNodeProperty(n,u,i[++a]):c?t.popStack():n.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(n)}),this.allNodes}parseNodeBegin(e,t){let i=t[1].trim().replace(/^"/,"").replace(/"$/,""),n=t[2].split(",").map(function(l){return l.trim().replace(/^"/,"").replace(/"$/,"")}),a={name:i},o=this.parseNodeAttr(n),s=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(i,a):i in s?(i==="PoseNode"?s.PoseNode.push(a):s[i].id!==void 0&&(s[i]={},s[i][s[i].id]=s[i]),o.id!==""&&(s[i][o.id]=a)):typeof o.id=="number"?(s[i]={},s[i][o.id]=a):i!=="Properties70"&&(i==="PoseNode"?s[i]=[a]:s[i]=a),typeof o.id=="number"&&(a.id=o.id),o.name!==""&&(a.attrName=o.name),o.type!==""&&(a.attrType=o.type),this.pushStack(a)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",n="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),n=e[2]),{id:t,name:i,type:n}}parseNodeProperty(e,t,i){let n=t[1].replace(/^"/,"").replace(/"$/,"").trim(),a=t[2].replace(/^"/,"").replace(/"$/,"").trim();n==="Content"&&a===","&&(a=i.replace(/"/g,"").replace(/,$/,"").trim());let o=this.getCurrentNode();if(o.name==="Properties70"){this.parseNodeSpecialProperty(e,n,a);return}if(n==="C"){let l=a.split(",").slice(1),u=parseInt(l[0]),c=parseInt(l[1]),f=a.split(",").slice(3);f=f.map(function(h){return h.trim().replace(/^"/,"")}),n="connections",a=[u,c],QOe(a,f),o[n]===void 0&&(o[n]=[])}n==="Node"&&(o.id=a),n in o&&Array.isArray(o[n])?o[n].push(a):n!=="a"?o[n]=a:o.a=a,this.setCurrentProp(o,n),n==="a"&&a.slice(-1)!==","&&(o.a=Zk(a))}parseNodePropertyContinued(e){let t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=Zk(t.a))}parseNodeSpecialProperty(e,t,i){let n=i.split('",').map(function(c){return c.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=n[0],o=n[1],s=n[2],l=n[3],u=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":u=parseFloat(u);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":u=Zk(u);break}this.getPrevNode()[a]={type:o,type2:s,flag:l,value:u},this.setCurrentProp(this.getPrevNode(),a)}},Qk=class{parse(e){let t=new HR(e);t.skip(23);let i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);let n=new WR;for(;!this.endOfContent(t);){let a=this.parseNode(t,i);a!==null&&n.add(a.name,a)}return n}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){let i={},n=t>=7500?e.getUint64():e.getUint32(),a=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();let o=e.getUint8(),s=e.getString(o);if(n===0)return null;let l=[];for(let h=0;h0?l[0]:"",c=l.length>1?l[1]:"",f=l.length>2?l[2]:"";for(i.singleProperty=a===1&&e.getOffset()===n;n>e.getOffset();){let h=this.parseNode(e,t);h!==null&&this.parseSubNode(s,i,h)}return i.propertyList=l,typeof u=="number"&&(i.id=u),c!==""&&(i.attrName=c),f!==""&&(i.attrType=f),s!==""&&(i.name=s),i}parseSubNode(e,t,i){if(i.singleProperty===!0){let n=i.propertyList[0];Array.isArray(n)?(t[i.name]=i,i.a=n):t[i.name]=n}else if(e==="Connections"&&i.name==="C"){let n=[];i.propertyList.forEach(function(a,o){o!==0&&n.push(a)}),t.connections===void 0&&(t.connections=[]),t.connections.push(n)}else if(i.name==="Properties70")Object.keys(i).forEach(function(a){t[a]=i[a]});else if(e==="Properties70"&&i.name==="P"){let n=i.propertyList[0],a=i.propertyList[1],o=i.propertyList[2],s=i.propertyList[3],l;n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),a.indexOf("Lcl ")===0&&(a=a.replace("Lcl ","Lcl_")),a==="Color"||a==="ColorRGB"||a==="Vector"||a==="Vector3D"||a.indexOf("Lcl_")===0?l=[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:l=i.propertyList[4],t[n]={type:a,type2:o,flag:s,value:l}}else t[i.name]===void 0?typeof i.id=="number"?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:i.name==="PoseNode"?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):t[i.name][i.id]===void 0&&(t[i.name][i.id]=i)}parseProperty(e){let t=e.getString(1),i;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return i=e.getUint32(),e.getArrayBuffer(i);case"S":return i=e.getUint32(),e.getString(i);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":let n=e.getUint32(),a=e.getUint32(),o=e.getUint32();if(a===0)switch(t){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}let s=bse(new Uint8Array(e.getArrayBuffer(o))),l=new HR(s.buffer);switch(t){case"b":case"c":return l.getBooleanArray(n);case"d":return l.getFloat64Array(n);case"f":return l.getFloat32Array(n);case"i":return l.getInt32Array(n);case"l":return l.getInt64Array(n)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}},HR=class{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){let t=[];for(let i=0;i=0&&(i=new Uint8Array(this.dv.buffer,t,n)),this._textDecoder.decode(i)}},WR=class{add(e,t){this[e]=t}};function jOe(r){let e="Kaydara FBX Binary \0";return r.byteLength>=e.length&&e===Lse(r,0,e.length)}function KOe(r){let e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],t=0;function i(n){let a=r[n-1];return r=r.slice(t+n),t++,a}for(let n=0;n{let e=class e{constructor(){this.http=aa(Dc),this.modal=aa(Pc),this.titleService=aa(KM),this.animate=()=>{requestAnimationFrame(this.animate);let i=r3e.getDelta();Pse&&Pse.update(i),this.renderer.render(this.scene,this.camera)}}ngOnInit(){this.titleService.setTitle("\u91CD\u78C53D"),this.initThreeJs(),this.animate()}initThreeJs(){this.camera=new Vi(40,window.innerWidth/window.innerHeight,1,2e4),this.camera.position.set(2200,300,-3100),this.scene=new _S,this.scene.background=new ir(263446);let i=new xS(16777215,4473924,5);i.position.set(0,200,0),this.scene.add(i);let n=new SS(16777215,5);n.position.set(0,200,100),n.castShadow=!0,n.shadow.camera.top=180,n.shadow.camera.bottom=-100,n.shadow.camera.left=-120,n.shadow.camera.right=120,this.scene.add(n);let a=this;new GR().load("assets/fbx/bb.fbx",function(p){p.traverse(function(d){}),a.scene.add(p)},p=>{},p=>{console.error("An error happened",p)}),this.renderer=new yS({antialias:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.shadowMap.enabled=!0,this.container.nativeElement.appendChild(this.renderer.domElement);let s=5,l=32,u=new zA(s,l),c=new ec({color:16711680}),f=new rn(u,c);f.position.set(850,100,-2e3),this.scene.add(f);let h=new Dse.OrbitControls(this.camera,this.renderer.domElement);h.target.set(850,100,-2e3),h.update(),window.addEventListener("resize",this.onWindowResize)}render(){this.cube.rotation.x+=.01,this.cube.rotation.y+=.01,this.renderer.render(this.scene,this.camera)}onWindowResize(){this.camera.aspect=window.innerWidth/window.innerHeight,this.camera.updateProjectionMatrix(),this.renderer.setSize(window.innerWidth,window.innerHeight)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["app-data-v-t1"]],viewQuery:function(n,a){if(n&1&&Tc(t3e,7),n&2){let o;oa(o=sa())&&(a.container=o.first)}},standalone:!0,features:[ui],decls:3,vars:0,consts:[[2,"display","flex","flex-direction","column","height","100vh"],[2,"flex-grow","1"],["Three",""]],template:function(n,a){n&1&&(Jt(0,"div",0),Yr(1,"div",1,2),nr())},dependencies:[Nc,Uc,$c,Yc,ef,tf,Qc,Kc,Ic,Hc,Xc,of,jc,qc,wl,Cc,Vc,Gc,rf,af,Bc,Tl,Zc,Fc,Wc,kc,nf,Lc,Rc,Jc,zc,Ac,Oc,bl],encapsulation:2});let r=e;return r})();var Nse=(()=>{let e=class e{constructor(){this.http=aa(Dc),this.modal=aa(Pc)}ngOnInit(){}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=li({type:e,selectors:[["app-data-v-threejs"]],standalone:!0,features:[ui],decls:1,vars:0,consts:[["src","http://112.33.111.160:8083/","width","100%","height","650px",2,"border","0"]],template:function(n,a){n&1&&Yr(0,"iframe",0)},dependencies:[Nc,Uc,$c,Yc,ef,tf,Qc,Kc,Ic,Hc,Xc,of,jc,qc,wl,Cc,Vc,Gc,rf,af,Bc,Tl,Zc,Fc,Wc,kc,nf,Lc,Rc,Jc,zc,Ac,Oc,bl]});let r=e;return r})();var NDt=[{path:"s1/:id",component:M$,data:{menu:null}},{path:"second1/:id",component:b$,data:{menu:null}},{path:"threejs/:id",component:Nse},{path:"t1/:id",component:Ise},{path:"lj-table",component:nL},{path:"lj-table",component:nL}];export{NDt as routes}; diff --git a/dist/himp.platform.angular/browser/index.html b/dist/himp.platform.angular/browser/index.html index d4d2d90..bceed97 100644 --- a/dist/himp.platform.angular/browser/index.html +++ b/dist/himp.platform.angular/browser/index.html @@ -103,7 +103,7 @@ } + @@ -113,6 +113,6 @@ ● - + \ No newline at end of file diff --git a/dist/himp.platform.angular/browser/main-324G7F3R.js b/dist/himp.platform.angular/browser/main-324G7F3R.js new file mode 100644 index 0000000..ab50236 --- /dev/null +++ b/dist/himp.platform.angular/browser/main-324G7F3R.js @@ -0,0 +1,2 @@ +import{b as be,d as Ro,f as le}from"./chunk-DNECFSH6.js";import{a as ie,b as ct,c as _o,d as wo,f as bo,g as lt,h as st,i as Ho}from"./chunk-MRNYEB3J.js";import{$a as X,A as y,Aa as Oo,C as P,Ca as H,Ga as j,Ia as W,La as B,M as Do,Ma as ko,O as fe,P as ce,Pa as $,Q as So,R as yo,S as ge,Sa as G,T as Po,U as he,Ua as U,V as v,Xa as q,_ as T,aa as To,bb as Y,ca as I,cb as Fo,db as z,e as b,fb as Q,hb as Z,jb as K,la as O,nb as Eo,ob as Ao,pa as k,pb as Vo,ra as F,ta as E,u as D,ua as A,v as S,wa as V,ya as R,za as Io}from"./chunk-WD6SV3WH.js";import{a as vo,d as zo,e as No,f as Co,g as xo}from"./chunk-4FFPI7ZP.js";import{Ab as Ct,Ae as ro,Bb as xt,Bc as Vt,Be as io,Cb as _t,Ce as no,Da as zt,Db as me,Dc as Rt,De as ao,Eb as M,Ec as Ht,Ee as mo,Fe as re,Ga as dt,Gb as J,Gd as Gt,Ge as g,Gf as ho,Ha as ot,Hb as wt,Hc as it,He as nt,Hf as Mo,Ja as Nt,Jb as f,Jc as de,Ka as m,Kb as rt,La as ne,Lc as jt,Le as N,Mc as Lt,Nc as Wt,Nf as L,Ob as bt,Oc as Bt,Pc as $t,Qb as Dt,Qe as lo,Sb as St,Se as ft,Ta as ae,Tb as yt,Te as at,Ue as ue,Va as u,Ve as pe,We as so,Xa as Ce,af as uo,cc as Pt,dc as Tt,gb as l,gf as po,ha as Mt,hb as s,hc as It,hf as C,ib as d,jb as xe,ka as vt,kb as _e,kc as Ot,la as a,lf as x,mb as we,na as p,nc as oe,of as fo,pe as Ut,qb as ee,qe as qt,re as Xt,rf as co,sa as ze,sb as h,se as Yt,ta as Ne,te as Qt,tf as mt,uc as kt,ue as Zt,vb as ut,vc as Ft,ve as Kt,vf as _,wb as pt,wc as Et,we as Jt,xc as At,xe as eo,xf as w,ye as to,ze as oo,zf as go}from"./chunk-VDRVUQCF.js";var jo=new yt("17.1.0");var Lo=(()=>{let t=class t{constructor(e,o){this.router=a(de),this.titleSrv=a(mt),this.modalSrv=a(po),this.donePreloader=fo(),o.setAttribute(e.nativeElement,"ng-alain-version",Mo.full),o.setAttribute(e.nativeElement,"ng-zorro-version",jo.full)}ngOnInit(){let e=!1;this.router.events.subscribe(o=>{o instanceof Ht&&(e=!0),e&&o instanceof Rt&&this.modalSrv.confirm({nzTitle:"\u63D0\u9192",nzContent:ie.production?"\u5E94\u7528\u53EF\u80FD\u5DF2\u53D1\u5E03\u65B0\u7248\u672C\uFF0C\u8BF7\u70B9\u51FB\u5237\u65B0\u624D\u80FD\u751F\u6548\u3002":`\u65E0\u6CD5\u52A0\u8F7D\u8DEF\u7531\uFF1A${o.url}`,nzCancelDisabled:!1,nzOkText:"\u5237\u65B0",nzCancelText:"\u5FFD\u7565",nzOnOk:()=>location.reload()}),o instanceof Vt&&(this.donePreloader(),this.titleSrv.setTitle(),this.modalSrv.closeAll())})}};t.\u0275fac=function(o){return new(o||t)(ne(ot),ne(Nt))},t.\u0275cmp=p({type:t,selectors:[["app-root"]],standalone:!0,features:[f],decls:1,vars:0,template:function(o,i){o&1&&d(0,"router-outlet")},dependencies:[it],encapsulation:2});let r=t;return r})();function cr(r){let t=r;return 5}var Wo=["zh",[["\u4E0A\u5348","\u4E0B\u5348"],void 0,void 0],void 0,[["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"],["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"]],void 0,[["1","2","3","4","5","6","7","8","9","10","11","12"],["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"]],void 0,[["\u516C\u5143\u524D","\u516C\u5143"],void 0,void 0],0,[6,0],["y/M/d","y\u5E74M\u6708d\u65E5",void 0,"y\u5E74M\u6708d\u65E5EEEE"],["HH:mm","HH:mm:ss","z HH:mm:ss","zzzz HH:mm:ss"],["{1} {0}",void 0,void 0,void 0],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"CNY","\xA5","\u4EBA\u6C11\u5E01",{AUD:["AU$","$"],BYN:[void 0,"\u0440."],CNY:["\xA5"],ILR:["ILS"],JPY:["JP\xA5","\xA5"],KRW:["\uFFE6","\u20A9"],PHP:[void 0,"\u20B1"],RUR:[void 0,"\u0440."],TWD:["NT$"],USD:["US$","$"],XXX:[]},"ltr",cr];function gt(r,t,n){lo(2,arguments);var e=ft(r,n),o=ft(t,n);return e.getTime()===o.getTime()}var gr={lessThanXSeconds:{one:"\u4E0D\u5230 1 \u79D2",other:"\u4E0D\u5230 {{count}} \u79D2"},xSeconds:{one:"1 \u79D2",other:"{{count}} \u79D2"},halfAMinute:"\u534A\u5206\u949F",lessThanXMinutes:{one:"\u4E0D\u5230 1 \u5206\u949F",other:"\u4E0D\u5230 {{count}} \u5206\u949F"},xMinutes:{one:"1 \u5206\u949F",other:"{{count}} \u5206\u949F"},xHours:{one:"1 \u5C0F\u65F6",other:"{{count}} \u5C0F\u65F6"},aboutXHours:{one:"\u5927\u7EA6 1 \u5C0F\u65F6",other:"\u5927\u7EA6 {{count}} \u5C0F\u65F6"},xDays:{one:"1 \u5929",other:"{{count}} \u5929"},aboutXWeeks:{one:"\u5927\u7EA6 1 \u4E2A\u661F\u671F",other:"\u5927\u7EA6 {{count}} \u4E2A\u661F\u671F"},xWeeks:{one:"1 \u4E2A\u661F\u671F",other:"{{count}} \u4E2A\u661F\u671F"},aboutXMonths:{one:"\u5927\u7EA6 1 \u4E2A\u6708",other:"\u5927\u7EA6 {{count}} \u4E2A\u6708"},xMonths:{one:"1 \u4E2A\u6708",other:"{{count}} \u4E2A\u6708"},aboutXYears:{one:"\u5927\u7EA6 1 \u5E74",other:"\u5927\u7EA6 {{count}} \u5E74"},xYears:{one:"1 \u5E74",other:"{{count}} \u5E74"},overXYears:{one:"\u8D85\u8FC7 1 \u5E74",other:"\u8D85\u8FC7 {{count}} \u5E74"},almostXYears:{one:"\u5C06\u8FD1 1 \u5E74",other:"\u5C06\u8FD1 {{count}} \u5E74"}},hr=function(t,n,e){var o,i=gr[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",String(n)),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?o+"\u5185":o+"\u524D":o},Bo=hr;var Mr={full:"y'\u5E74'M'\u6708'd'\u65E5' EEEE",long:"y'\u5E74'M'\u6708'd'\u65E5'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},vr={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},zr={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Nr={date:at({formats:Mr,defaultWidth:"full"}),time:at({formats:vr,defaultWidth:"full"}),dateTime:at({formats:zr,defaultWidth:"full"})},$o=Nr;function Go(r,t,n){var e="eeee p";return gt(r,t,n)?e:r.getTime()>t.getTime()?"'\u4E0B\u4E2A'"+e:"'\u4E0A\u4E2A'"+e}var Cr={lastWeek:Go,yesterday:"'\u6628\u5929' p",today:"'\u4ECA\u5929' p",tomorrow:"'\u660E\u5929' p",nextWeek:Go,other:"PP p"},xr=function(t,n,e,o){var i=Cr[t];return typeof i=="function"?i(n,e,o):i},Uo=xr;var _r={narrow:["\u524D","\u516C\u5143"],abbreviated:["\u524D","\u516C\u5143"],wide:["\u516C\u5143\u524D","\u516C\u5143"]},wr={narrow:["1","2","3","4"],abbreviated:["\u7B2C\u4E00\u5B63","\u7B2C\u4E8C\u5B63","\u7B2C\u4E09\u5B63","\u7B2C\u56DB\u5B63"],wide:["\u7B2C\u4E00\u5B63\u5EA6","\u7B2C\u4E8C\u5B63\u5EA6","\u7B2C\u4E09\u5B63\u5EA6","\u7B2C\u56DB\u5B63\u5EA6"]},br={narrow:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"],abbreviated:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],wide:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"]},Dr={narrow:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],short:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],abbreviated:["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"],wide:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"]},Sr={narrow:{am:"\u4E0A",pm:"\u4E0B",midnight:"\u51CC\u6668",noon:"\u5348",morning:"\u65E9",afternoon:"\u4E0B\u5348",evening:"\u665A",night:"\u591C"},abbreviated:{am:"\u4E0A\u5348",pm:"\u4E0B\u5348",midnight:"\u51CC\u6668",noon:"\u4E2D\u5348",morning:"\u65E9\u6668",afternoon:"\u4E2D\u5348",evening:"\u665A\u4E0A",night:"\u591C\u95F4"},wide:{am:"\u4E0A\u5348",pm:"\u4E0B\u5348",midnight:"\u51CC\u6668",noon:"\u4E2D\u5348",morning:"\u65E9\u6668",afternoon:"\u4E2D\u5348",evening:"\u665A\u4E0A",night:"\u591C\u95F4"}},yr={narrow:{am:"\u4E0A",pm:"\u4E0B",midnight:"\u51CC\u6668",noon:"\u5348",morning:"\u65E9",afternoon:"\u4E0B\u5348",evening:"\u665A",night:"\u591C"},abbreviated:{am:"\u4E0A\u5348",pm:"\u4E0B\u5348",midnight:"\u51CC\u6668",noon:"\u4E2D\u5348",morning:"\u65E9\u6668",afternoon:"\u4E2D\u5348",evening:"\u665A\u4E0A",night:"\u591C\u95F4"},wide:{am:"\u4E0A\u5348",pm:"\u4E0B\u5348",midnight:"\u51CC\u6668",noon:"\u4E2D\u5348",morning:"\u65E9\u6668",afternoon:"\u4E2D\u5348",evening:"\u665A\u4E0A",night:"\u591C\u95F4"}},Pr=function(t,n){var e=Number(t);switch(n?.unit){case"date":return e.toString()+"\u65E5";case"hour":return e.toString()+"\u65F6";case"minute":return e.toString()+"\u5206";case"second":return e.toString()+"\u79D2";default:return"\u7B2C "+e.toString()}},Tr={ordinalNumber:Pr,era:ue({values:_r,defaultWidth:"wide"}),quarter:ue({values:wr,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ue({values:br,defaultWidth:"wide"}),day:ue({values:Dr,defaultWidth:"wide"}),dayPeriod:ue({values:Sr,defaultWidth:"wide",formattingValues:yr,defaultFormattingWidth:"wide"})},qo=Tr;var Ir=/^(第\s*)?\d+(日|时|分|秒)?/i,Or=/\d+/i,kr={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Fr={any:[/^(前)/i,/^(公元)/i]},Er={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Ar={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Vr={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Rr={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Hr={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},jr={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Lr={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Wr={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Br={ordinalNumber:so({matchPattern:Ir,parsePattern:Or,valueCallback:function(t){return parseInt(t,10)}}),era:pe({matchPatterns:kr,defaultMatchWidth:"wide",parsePatterns:Fr,defaultParseWidth:"any"}),quarter:pe({matchPatterns:Er,defaultMatchWidth:"wide",parsePatterns:Ar,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:pe({matchPatterns:Vr,defaultMatchWidth:"wide",parsePatterns:Rr,defaultParseWidth:"any"}),day:pe({matchPatterns:Hr,defaultMatchWidth:"wide",parsePatterns:jr,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:Lr,defaultMatchWidth:"any",parsePatterns:Wr,defaultParseWidth:"any"})},Xo=Br;var $r={code:"zh-CN",formatDistance:Bo,formatLong:$o,formatRelative:Uo,localize:qo,match:Xo,options:{weekStartsOn:1,firstWeekContainsDate:4}},ht=$r;var Qo=(()=>{let t=class t{constructor(){this.http=a(w),this.modal=a(_)}ngOnInit(){this.updateCurrentTime(),setInterval(()=>{this.updateCurrentTime()},1e3)}add(){}updateCurrentTime(){this.currentTime=new Date}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=p({type:t,selectors:[["data-v-date"]],standalone:!0,features:[f],decls:3,vars:4,consts:[[1,"data-container"]],template:function(o,i){o&1&&(l(0,"div",0),M(1),bt(2,"date"),s()),o&2&&(m(),J(" ",Dt(2,1,i.currentTime,"yyyy-MM-dd HH:mm:ss")," "))},dependencies:[oe,Ot,D,S,G,R,q,X,U,B,b,E,V,K,W,j,H,N,k,F,Y,Z,T,z,L,v,A,O,Q,x,C,$,P,g,y,I],styles:[".data-container[_ngcontent-%COMP%]{align-items:center;color:#fff}"]});let r=t;return r})();var Zo=(()=>{let t=class t{constructor(){this.status=!1}_resize(){this.status=st.isFullscreen}_click(){st.isEnabled&&st.toggle()}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=p({type:t,selectors:[["data-v-fullscreen"]],hostVars:2,hostBindings:function(o,i){o&1&&ee("resize",function(){return i._resize()},!1,zt)("click",function(){return i._click()}),o&2&&Ce("flex-1",!0)},standalone:!0,features:[f],decls:2,vars:2,consts:[["nz-icon","",3,"nzType"]],template:function(o,i){o&1&&(d(0,"i",0),M(1)),o&2&&(u("nzType",i.status?"fullscreen-exit":"fullscreen"),m(),J(" ",i.status?"\u9000\u51FA\u5168\u5C4F":"\u8FDB\u5165\u5168\u5C4F"," "))},dependencies:[oe,g,re],encapsulation:2,changeDetection:0});let r=t;return r})();var Ko=(()=>{let t=class t{constructor(e){this.http=e}getMenus(){return this.http.get("/api/main/menu?ClientId=Platform_Datav")}};t.\u0275fac=function(o){return new(o||t)(vt(kt))},t.\u0275prov=Mt({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();function qr(r,t){if(r&1&&d(0,"img",7),r&2){let n=h(2).$implicit;pt("src","assets/",n.icon.includes("svg")?n.icon:n.icon+".svg","",dt),ut("alt",n.text)}}function Xr(r,t){if(r&1){let n=we();xe(0),l(1,"a",5),ee("click",function(){ze(n);let o=h().$implicit,i=h();return Ne(i.navigate(o))}),ae(2,qr,1,2,"img",6),M(3),s(),_e()}if(r&2){let n=h().$implicit,e=h();m(),Ce("active",e.isActive(!0)),m(),u("ngIf",n.icon),m(),wt(" ",n.menuCode=="Home"&&e.selectedParentMenu&&e.selectedParentMenu.menuCode!="Home"?"/ "+e.selectedParentMenu.text:""," ",n.menuCode!="Home"?n.text:""," ")}}function Yr(r,t){if(r&1){let n=we();l(0,"li",15),ee("click",function(){let i=ze(n).$implicit,c=h(4);return Ne(c.navigate(i))}),M(1),s()}if(r&2){let n=t.$implicit;m(),J(" ",n.text," ")}}function Qr(r,t){if(r&1&&(xe(0),l(1,"a",10),M(2),d(3,"span",11),s(),l(4,"nz-dropdown-menu",null,12)(6,"ul",13),ae(7,Yr,2,1,"li",14),s()(),_e()),r&2){let n=me(5),e=h(2).$implicit;m(),u("nzDropdownMenu",n),m(),J(" ",e.text," "),m(5),u("ngForOf",e.children)}}function Zr(r,t){if(r&1&&d(0,"img",7),r&2){let n=h(3).$implicit;pt("src","assets/",n.icon.includes("svg")?n.icon:n.icon+".svg","",dt),ut("alt",n.text)}}function Kr(r,t){if(r&1){let n=we();l(0,"a",5),ee("click",function(){ze(n);let o=h(2).$implicit,i=h();return Ne(i.navigate(o))}),ae(1,Zr,1,2,"img",6),M(2),s()}if(r&2){let n=h(2).$implicit,e=h();Ce("active",e.isActive(!0)),m(),u("ngIf",n.icon),m(),J(" ",n.menuCode!="Home"?n.text:""," ")}}function Jr(r,t){if(r&1&&(xe(0),ae(1,Qr,8,3,"ng-container",8)(2,Kr,3,4,"ng-template",null,9,St),_e()),r&2){let n=me(3),e=h().$implicit;m(),u("ngIf",e.children&&e.children.length>0)("ngIfElse",n)}}function ei(r,t){if(r&1){let n=we();xe(0,2),l(1,"li",3),ee("mouseover",function(o){let c=ze(n).$implicit,fr=h();return Ne(fr.menuOver(c,o))}),ae(2,Xr,4,5,"ng-container",4)(3,Jr,4,2,"ng-container",4),s(),_e()}if(r&2){let n=t.$implicit;m(2),u("ngIf",n.childShowType=="menu"),m(),u("ngIf",n.childShowType=="drop-down")}}var er=(()=>{let t=class t{constructor(e){this.menuService=e,this.http=a(w),this.modal=a(_),this.router=a(de),this.menuNetDataList=[],this.visibleMenuList=[],this.imageUrl="assets/dashboard/menu_btn_l.png",this.title="Label",this.context="2024-02-29 10:00"}ngOnInit(){this.menuNetDataList=[{menuCode:"Home",text:"\u6211\u7684\u5DE5\u4F5C\u7AD9",i18n:null,icon:"home.svg",grp:!0,leafFlag:!1,rootFlag:!0,hideInBreadcrumbFlag:!0,link:"/",srtno:0,valiFlag:!1,menuType:0,parentId:null,clientId:"Platform_Datav",acl:null,childShowType:"menu",id:"3a1167f1-a86c-194d-eabf-258993a337ac"}],this.menuService.getMenus().subscribe(e=>{for(let o of e)if(o.children&&o.children.length>0)for(let i of o.children){if(i.childShowType="menu",i.children)for(let c of i.children)c.childShowType="drop-down",console.log(c.text),console.log(c.children);this.menuNetDataList.push(i)}console.log("this.menuNetDataList"),this.updateVisibleMenuList(),console.log(this.menuNetDataList)})}add(){}updateVisibleMenuList(){this.visibleMenuList=this.menuNetDataList.filter(e=>!this.selectedParentMenu||e.menuCode=="Home"||this.selectedParentMenu&&this.selectedParentMenu.menuCode=="Home"),this.menuNetDataList.forEach(e=>{e.childShowType=="menu"&&this.selectedParentMenu&&e.menuCode==this.selectedParentMenu.menuCode&&e.menuCode!=="Home"&&(this.visibleMenuList=this.visibleMenuList.concat(e.children||[]))}),console.log("visibleMenuList"),console.log(this.visibleMenuList)}menuOver(e,o){}isActive(e){}navigate(e){console.log("\u70B9\u51FBmenu"),console.log(e),this.menuNetDataList.forEach(o=>o.selected=!1),e.link&&e.childShowType=="menu"&&e.children&&e.children.length>0?(console.log("\u6765\u65F6\u8DF3\u8F6C2\u7EA7"),console.log(e.link),console.log(e.children),e.selected=!0,this.selectedParentMenu=e,this.router.navigate([e.link??"/404",e.id],{state:{menu:e.children}})):e.menuCode=="Home"?(e.selected=!0,this.selectedParentMenu=e,this.router.navigateByUrl(e.link??"/404")):(e.selected=!0,console.log("\u8DEF\u7531"),console.log(e.link),this.router.navigate([e.link??"/404",e.id],{state:{menu:e.children}})),this.updateVisibleMenuList()}};t.\u0275fac=function(o){return new(o||t)(ne(Ko))},t.\u0275cmp=p({type:t,selectors:[["data-v-navigation"]],standalone:!0,features:[f],decls:3,vars:1,consts:[[1,"navigation-container"],["id","parent-menu",4,"ngFor","ngForOf"],["id","parent-menu"],[1,"dropdown-submenu",3,"mouseover"],[4,"ngIf"],["href","javascript:void(0);",1,"menu-group",3,"click"],["width","20",3,"src","alt",4,"ngIf"],["width","20",3,"src","alt"],[4,"ngIf","ngIfElse"],["noChildren",""],["nz-dropdown","",1,"menu-group",3,"nzDropdownMenu"],["nz-icon","","nzType","down"],["childMenu","nzDropdownMenu"],["nz-menu","","nzSelectable",""],["nz-menu-item","",3,"click",4,"ngFor","ngForOf"],["nz-menu-item","",3,"click"]],template:function(o,i){o&1&&(l(0,"div",0)(1,"ul"),ae(2,ei,4,2,"ng-container",1),s()()),o&2&&(m(2),u("ngForOf",i.visibleMenuList))},dependencies:[oe,Pt,Tt,D,S,G,R,q,X,U,B,b,E,V,K,W,j,H,N,nt,k,F,Y,Z,T,z,L,v,ce,fe,ge,Po,he,A,O,Q,x,C,$,P,g,re,y,I],styles:['.navigation-container[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;margin-top:10px;padding-left:2rem;white-space:nowrap}[nz-button][_ngcontent-%COMP%]{margin-right:8px;margin-bottom:12px}.nz-button-group[_ngcontent-%COMP%] [nz-button][_ngcontent-%COMP%]{margin-right:0}ul[_ngcontent-%COMP%]{display:inline-flex;flex-wrap:wrap;margin-bottom:10px;padding-top:0;padding-left:0;list-style-type:none}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{flex-wrap:wrap;margin-right:10px;margin-bottom:30px}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{clear:both;min-width:4rem;margin-right:1rem;padding:.5rem 1.5rem;font-weight:600;color:#74fafb;text-align:inherit;white-space:nowrap;background-color:#054254;border:0 solid red;border-color:#74fafb}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:active, ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{color:#000;text-decoration:none;background-color:#fff}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{display:inline-flex;flex-wrap:nowrap;margin-right:10px;margin-bottom:10px;color:#fff;background-color:#337ab7}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%]{position:relative}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{position:absolute;top:2rem;margin-top:0;margin-left:0}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%]:hover > .dropdown-menu[_ngcontent-%COMP%]{display:block}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%]{position:relative}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{display:block}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:after{content:"\\f054";position:absolute;right:.5rem}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%] > .dropdown-menu[_ngcontent-%COMP%]{top:0;bottom:unset;left:100%;margin-top:0;margin-left:0}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%]:hover > .dropdown-menu[_ngcontent-%COMP%]{display:block}ul.dev-mode[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, ul.dev-mode[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:active, ul.dev-mode[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{color:#fff;background-color:#dc3545}']});let r=t;return r})();var ti=()=>({color:"white"}),tr=(()=>{let t=class t{constructor(){this.http=a(w),this.modal=a(_)}ngOnInit(){this.updateCurrentTime(),setInterval(()=>{this.updateCurrentTime()},1e3)}add(){}updateCurrentTime(){this.currentTime=new Date}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=p({type:t,selectors:[["data-v-setting"]],standalone:!0,features:[f],decls:7,vars:3,consts:[["layout-default-header-item-trigger","","nz-dropdown","","nzTrigger","click","nzPlacement","bottomRight",3,"nzDropdownMenu"],["nz-icon","","nzType","setting",3,"ngStyle"],["settingsMenu","nzDropdownMenu"],["nz-menu","",2,"width","8rem"],["nz-menu-item",""]],template:function(o,i){if(o&1&&(l(0,"div",0),d(1,"i",1),s(),l(2,"nz-dropdown-menu",null,2)(4,"div",3)(5,"div",4),d(6,"data-v-fullscreen"),s()()()),o&2){let c=me(3);u("nzDropdownMenu",c),m(),u("ngStyle",rt(2,ti))}},dependencies:[Zo,oe,It,D,S,G,R,q,X,U,B,b,E,V,K,W,j,H,N,nt,k,F,Y,Z,T,z,L,v,ce,fe,ge,he,A,O,Q,x,C,$,P,g,re,y,I],encapsulation:2});let r=t;return r})();var or=(()=>{let t=class t{constructor(){this.settings=a(co),this.router=a(de),this.tokenService=a(vo)}get user(){return this.settings.user}logout(){this.tokenService.clear(),this.router.navigateByUrl(this.tokenService.login_url)}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=p({type:t,selectors:[["data-v-user"]],standalone:!0,features:[f],decls:19,vars:3,consts:[["nz-dropdown","","nzPlacement","bottomRight",1,"alain-default__nav-item","d-flex","align-items-center","px-sm",3,"nzDropdownMenu"],["nzSize","small",1,"mr-sm",3,"nzSrc"],["userMenu","nzDropdownMenu"],["nz-menu","",1,"width-sm"],["nz-menu-item","","routerLink","/pro/account/center"],["nz-icon","","nzType","user",1,"mr-sm"],["nz-menu-item","","routerLink","/pro/account/settings"],["nz-icon","","nzType","setting",1,"mr-sm"],["nz-menu-item","","routerLink","/exception/trigger"],["nz-icon","","nzType","close-circle",1,"mr-sm"],["nz-menu-divider",""],["nz-menu-item","",3,"click"],["nz-icon","","nzType","logout",1,"mr-sm"]],template:function(o,i){if(o&1&&(l(0,"div",0),d(1,"nz-avatar",1),M(2),s(),l(3,"nz-dropdown-menu",null,2)(5,"div",3)(6,"div",4),d(7,"i",5),M(8," \u4E2A\u4EBA\u4E2D\u5FC3 "),s(),l(9,"div",6),d(10,"i",7),M(11," \u4E2A\u4EBA\u8BBE\u7F6E "),s(),l(12,"div",8),d(13,"i",9),M(14," \u89E6\u53D1\u9519\u8BEF "),s(),d(15,"li",10),l(16,"div",11),ee("click",function(){return i.logout()}),d(17,"i",12),M(18," \u9000\u51FA\u767B\u5F55 "),s()()()),o&2){let c=me(4);u("nzDropdownMenu",c),m(),u("nzSrc",i.user.avatar),m(),J(" ",i.user.name,` +`)}},dependencies:[v,ce,fe,So,ge,he,yo,g,re,z,Fo],encapsulation:2});let r=t;return r})();var rr=(()=>{let t=class t{constructor(){this.http=a(w),this.modal=a(_)}ngOnInit(){}add(){}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=p({type:t,selectors:[["app-data-v-header"]],standalone:!0,features:[f],decls:5,vars:0,consts:[[1,"header-container"],[1,"data-v-sysinfo","mr-sm"],[1,"mr-sm"]],template:function(o,i){o&1&&(l(0,"div",0)(1,"div",1),d(2,"data-v-setting",2)(3,"data-v-user",2)(4,"data-v-date",2),s()())},dependencies:[tr,or,Qo,lt,D,S,G,R,q,X,U,B,b,E,V,K,W,j,H,N,k,F,Y,Z,T,z,L,v,A,O,Q,x,C,$,P,g,y,I],styles:['.header-container[_ngcontent-%COMP%]{width:100vw;min-width:1280px;height:10%;background-image:url("./media/screen_header2-ZZHBGFUS.png");background-position:top;background-size:cover}.data-v-sysinfo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:right;text-align:right}']});let r=t;return r})();var ir=(()=>{let t=class t{constructor(){this.http=a(w),this.modal=a(_)}ngOnInit(){}add(){}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=p({type:t,selectors:[["app-data-v-home"]],standalone:!0,features:[f],decls:6,vars:0,consts:[[1,"home-container"],["src","assets/dashboard/dashboard_menu.jpg",2,"width","100%","height","1.8rem"],[1,"router-outlet-container"]],template:function(o,i){o&1&&(l(0,"div",0),d(1,"app-data-v-header")(2,"data-v-navigation")(3,"img",1),l(4,"div",2),d(5,"router-outlet"),s()())},dependencies:[rr,er,lt,it,D,S,G,R,q,X,U,B,b,E,V,K,W,j,H,N,k,F,Y,Z,T,z,L,v,A,O,Q,x,C,$,P,g,y,I],styles:[".home-container[_ngcontent-%COMP%]{width:100vw;min-width:1280px;height:100%;min-height:768px;background-color:#040516}.data-v-sysinfo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:right;text-align:right}.router-outlet-container[_ngcontent-%COMP%]{padding:1rem;background-color:#040516}"]});let r=t;return r})();var oi=["myGrid"],ri=()=>[12,12],nr=(()=>{let t=class t{constructor(e){this._mqttService=e,this.http=a(w),this.modal=a(_),this.elementRef=a(ot),this.titleService=a(mt),this.defaultColDef={width:170,editable:!1},this.gridThemedClass="ag-theme-quartz ag-theme-datav",this.rowData=[],this.colDefs1=[{headerName:"\u5E8F\u53F7",valueGetter:function(o){return parseInt(o.node.id)+1},sortable:!0,unSortIcon:!0,field:"xh"},{headerName:"\u4EFB\u52A1\u540D\u79F0",unSortIcon:!0,field:"rwmc"},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",unSortIcon:!0,field:"rwms"},{headerName:"\u5F00\u59CB\u65F6\u95F4",headerClass:"ag-header-center",unSortIcon:!0,field:"kssj"},{headerName:"\u8BA1\u5212\u5B8C\u6210\u65F6\u95F4",unSortIcon:!0,field:"jhwcsj"},{headerName:"\u8D85\u671F",field:"sfcq"},{headerName:"\u64CD\u4F5C",autoHeaderHeight:!0,field:"cz",cellRenderer:be}],this.colDefs2=[{headerName:"\u5E8F\u53F7",valueGetter:function(o){return parseInt(o.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u4EFB\u52A1\u540D\u79F0",unSortIcon:!0,field:"rwmc"},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",unSortIcon:!0,field:"rwms",minWidth:170,flex:1},{headerName:"\u5F00\u59CB\u65F6\u95F4",unSortIcon:!0,field:"kssj",minWidth:170,flex:1},{headerName:"\u5F53\u524D\u72B6\u6001",field:"dqzt"},{headerName:"\u5F53\u524D\u8282\u70B9",field:"dqjd"},{headerName:"\u5B9E\u9645\u5B8C\u6210\u65F6\u95F4",field:"sjwcsj",minWidth:170,flex:1},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:be}],this.colDefs3=[{headerName:"\u5E8F\u53F7",valueGetter:function(o){return parseInt(o.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u62A5\u8B66\u540D\u79F0",unSortIcon:!0,field:"bjmc"},{headerName:"\u62A5\u8B66\u7B49\u7EA7",unSortIcon:!0,field:"bjdg"},{headerName:"\u62A5\u8B66\u63CF\u8FF0",unSortIcon:!0,field:"bjms",minWidth:170,flex:1},{headerName:"\u62A5\u8B66\u65F6\u95F4",unSortIcon:!0,field:"bjsj",minWidth:170,flex:1},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:be},{headerName:"\u6545\u969C\u539F\u56E0",field:"gzyy"},{headerName:"\u5904\u7406\u65B9\u6CD5",field:"clff"},{headerName:"\u6CE8\u610F\u4E8B\u9879",field:"clff"}],this.colDefs4=[{headerName:"\u5E8F\u53F7",valueGetter:function(o){return parseInt(o.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u901A\u77E5\u65F6\u95F4",unSortIcon:!0,field:"tzsj",minWidth:170,flex:1},{headerName:"\u91CD\u8981\u7A0B\u5EA6",unSortIcon:!0,field:"zycd"},{headerName:"\u901A\u77E5\u540D\u79F0",unSortIcon:!0,field:"tzmc"},{headerName:"\u901A\u77E5\u5185\u5BB9",unSortIcon:!0,field:"tznr",minWidth:170,flex:1},{headerName:"\u9644\u4EF6",field:"fj"},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:be}],this.client=e}ngOnInit(){this.titleService.setTitle("\u6211\u7684\u5DE5\u4F5C\u7AD9");for(var e=1;e<30;e++)this.rowData.push({rwmc:`\u4EFB\u52A1${e}`,rwms:`\u4EFB\u52A1\u63CF\u8FF0${e}`,kssj:`2024-1-${e} 13:38:${e*11}`,jhwcsj:`2024-1-${e} 13:38:${e*10}`,sfcq:"\u5426",dqzt:"\u6B63\u5E38",dqjd:`\u8282\u70B9${e}`,sjwcsj:`2024-1-${e} 13:38:${e*27}`,bjmc:"\u62A5\u8B665",bjms:"\u62A5\u8B66\u63CF\u8FF05",bjsj:`2024-1-${e} 13:38:${e*12}`,gzyy:"-",clff:"-",tzsj:`2024-1-${e} 13:38:${e*19}`,zycd:"\u4E00\u822C",tzmc:"\u7CFB\u7EDF\u63D0\u793A",tznr:"\u8D26\u6237\u767B\u5F55",fj:"-",cz:"\u64CD\u4F5C"})}ngAfterViewInit(){let e=this.elementRef.nativeElement.querySelector(".ag-theme-datav"),o=e.querySelector(".ag-body-viewport"),i=e.querySelector(".ag-scroller")}add(){}};t.\u0275fac=function(o){return new(o||t)(ne(le))},t.\u0275cmp=p({type:t,selectors:[["app-data-v-workstation"]],viewQuery:function(o,i){if(o&1&&Ct(oi,5),o&2){let c;xt(c=_t())&&(i.grid=c.first)}},standalone:!0,features:[f],decls:5,vars:22,consts:[["nz-row","",3,"nzGutter"],[2,"width","50%",3,"title","defaultColDef","rowData","columnDefs","gridThemeClass"]],template:function(o,i){o&1&&(l(0,"div",0),d(1,"lj-app-ag-grid-component",1)(2,"lj-app-ag-grid-component",1)(3,"lj-app-ag-grid-component",1)(4,"lj-app-ag-grid-component",1),s()),o&2&&(u("nzGutter",rt(21,ri)),m(),u("title","\u5F85\u529E\u4EFB\u52A1")("defaultColDef",i.defaultColDef)("rowData",i.rowData)("columnDefs",i.colDefs1)("gridThemeClass",i.gridThemedClass),m(),u("title","\u5DF2\u529E\u4EFB\u52A1")("defaultColDef",i.defaultColDef)("rowData",i.rowData)("columnDefs",i.colDefs2)("gridThemeClass",i.gridThemedClass),m(),u("title","\u62A5\u8B66\u4FE1\u606F")("defaultColDef",i.defaultColDef)("rowData",i.rowData)("columnDefs",i.colDefs3)("gridThemeClass",i.gridThemedClass),m(),u("title","\u901A\u77E5")("defaultColDef",i.defaultColDef)("rowData",i.rowData)("columnDefs",i.colDefs4)("gridThemeClass",i.gridThemedClass))},dependencies:[Ro,To,D,S,G,R,q,X,U,B,b,E,V,K,W,j,Oo,H,N,k,F,Y,Z,T,z,L,v,A,O,Q,x,C,$,P,g,y,I],styles:[".ag-header-center[_ngcontent-%COMP%] .ag-header-group-cell-label[_ngcontent-%COMP%], .ag-header-center[_ngcontent-%COMP%] .ag-header-cell-label[_ngcontent-%COMP%]{display:grid;justify-content:center;color:#000;text-align:center;background:#000} .ag-theme-datav .ag-row-selected .ag-ltr .ag-cell{color:red!important} .ag-theme-datav .ag-ltr .ag-row-focus{font-weight:600;color:red} .ag-theme-datav .ag-ltr .ag-row-focus .ag-cell-focus{border:#74FAFB} .ag-theme-datav .ag-ltr .ag-row-focus .ag-grid-button-style{color:red;border-color:red} .ag-theme-datav{--ag-border-color: #74FAFB;--ag-foreground-color: #74FAFB;--ag-background-color: #0A1632;--ag-header-foreground-color: #74FAFB;--ag-header-background-color: #0A1632;--ag-odd-row-background-color: #0A1632;--ag-header-column-resize-handle-color: #7e2e84;--ag-font-size: 12px;--ag-font-family: monospace;height:17rem;font-weight:700;border-width:3px} .ag-theme-datav .ag-header-cell-resize{--ag-header-column-resize-handle-color: #00eff8} .ag-theme-datav .ag-header-row{font-size:14px;font-weight:700} .ag-theme-datav .ag-root-wrapper{border-radius:0} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar{width:12em} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb{margin-left:40px;background-color:#00eff8;border:2px solid #00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-track{background-color:transparent;border-color:#00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover{margin-left:40px;background-color:#00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:active{background-color:#00eff8} .ag-body-vertical-scroll-viewport{scrollbar-color:auto} .ag-body-horizontal-scroll-viewport{scrollbar-color:auto} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar{height:14em;color:#000} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-track{background-color:transparent;border-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:hover{background-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:active{background-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb{background-color:#00eff8}"]});let r=t;return r})();var ar=[{path:"home",component:Ho,canActivate:[bo,zo],canActivateChild:[No],data:{},children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"sys",loadChildren:()=>import("./chunk-MU3AQSF6.js").then(r=>r.routes)}]},{path:"",component:ir,children:[{path:"",component:nr},{path:"data-v",loadChildren:()=>import("./chunk-OVXKTENR.js").then(r=>r.routes)}]},{path:"",loadChildren:()=>import("./chunk-TZPPFKXI.js").then(r=>r.routes)},{path:"exception",loadChildren:()=>import("./chunk-MUTNAUEH.js").then(r=>r.routes)},{path:"**",redirectTo:"exception/404"}];var mr=[Xt];var lr=[qt,Yt,Qt,Kt,Zt,Jt,to,eo,oo,no,ro,io,ao,mo];var sr={hostname:"127.0.0.1",port:1883,path:"/mqtt",protocol:"ws"},ii={abbr:"zh-CN",ng:Wo,zorro:uo,date:ht,delon:go},ni={auth:{login_url:"/passport/login"}},ai={},dr=[Bt(),$t(),Lt({scrollPositionRestoration:"top"})];ie.useHash&&dr.push(Wt());var ur=[Ft(Et([...ie.interceptorFns??[],Co,_o])),Ut(),jt(ar,...dr),ho({config:ni,defaultLang:ii,icons:[...lr,...mr]}),Gt(ai),xo(),Do(...Vo),Io(...Ao),ko({widgets:[...Eo]}),{provide:le,useFactory:()=>new le(sr)},wo(),{provide:le,useFactory:()=>new le(sr)},...ie.providers||[]];ie.api?.refreshTokenEnabled&&ie.api.refreshTokenType==="auth-refresh"&&ur.push(ct());var pr={providers:ur};At(Lo,pr).catch(r=>console.error(r)); diff --git a/dist/himp.platform.angular/browser/main-RNIBGAQI.js b/dist/himp.platform.angular/browser/main-RNIBGAQI.js deleted file mode 100644 index c8ebb30..0000000 --- a/dist/himp.platform.angular/browser/main-RNIBGAQI.js +++ /dev/null @@ -1,2 +0,0 @@ -import{b as qo,c as se}from"./chunk-M4HTTI2X.js";import{a as re,b as wt,c as To,d as ko,f as Io,g as Mt,h as vt,i as Uo}from"./chunk-MRNYEB3J.js";import{$ as Ro,$a as X,A as x,Aa as jo,Ba as Lo,C as P,Ca as V,Ga as R,Ia as j,La as L,M as Fo,Ma as Wo,O as ve,P as ze,Pa as W,Q as Eo,R as Ao,S as Ce,Sa as B,T as Vo,U as Ne,Ua as G,V as M,Xa as $,_ as y,aa as we,bb as q,ca as S,cb as Bo,db as v,e as _,fb as U,hb as Q,jb as Y,kb as ht,la as O,nb as Go,ob as $o,pa as T,pb as Xo,ra as k,ta as I,u as b,ua as F,v as D,wa as E,ya as A,za as Ho}from"./chunk-WD6SV3WH.js";import{a as xo,d as Po,e as yo,f as So,g as Oo}from"./chunk-4FFPI7ZP.js";import{Ab as pe,Ae as uo,Bb as ue,Bc as $t,Be as co,Cb as ce,Ce as fo,Da as Pt,Db as me,Dc as Xt,De as go,Eb as g,Ec as qt,Ee as ho,Fb as pt,Fe as ie,Ga as zt,Gb as K,Gd as Kt,Ge as h,Gf as bo,Ha as st,Hb as kt,Hc as ct,He as ge,Hf as Do,Ja as yt,Jb as f,Jc as fe,Ka as m,Kb as ut,La as ae,Lc as Ut,Le as C,Mc as Qt,Nc as Yt,Nf as H,Oa as St,Ob as It,Oc as Zt,Pc as Jt,Qb as Ft,Qe as Mo,Sb as Et,Se as Nt,Ta as le,Tb as At,Te as ft,Ue as he,Va as p,Ve as Me,We as vo,Xa as it,Za as dt,af as zo,cc as Vt,dc as Rt,gb as a,gf as Co,ha as Dt,hb as l,hc as Ht,hf as N,ib as s,jb as rt,ka as xt,kb as nt,kc as jt,la as d,lf as w,mb as at,na as c,nc as oe,of as No,pe as eo,qb as Z,qe as to,re as oo,rf as wo,sa as tt,sb as z,se as io,ta as ot,tb as Ot,te as ro,tf as gt,ub as Tt,uc as Lt,ue as no,vb as lt,vc as Wt,ve as ao,vf as ee,wb as Ct,wc as Bt,we as lo,xc as Gt,xe as mo,xf as te,ye as so,ze as po,zf as _o}from"./chunk-VDRVUQCF.js";var Qo=new At("17.1.0");var Yo=(()=>{let t=class t{constructor(e,o){this.router=d(fe),this.titleSrv=d(gt),this.modalSrv=d(Co),this.donePreloader=No(),o.setAttribute(e.nativeElement,"ng-alain-version",Do.full),o.setAttribute(e.nativeElement,"ng-zorro-version",Qo.full)}ngOnInit(){let e=!1;this.router.events.subscribe(o=>{o instanceof qt&&(e=!0),e&&o instanceof Xt&&this.modalSrv.confirm({nzTitle:"\u63D0\u9192",nzContent:re.production?"\u5E94\u7528\u53EF\u80FD\u5DF2\u53D1\u5E03\u65B0\u7248\u672C\uFF0C\u8BF7\u70B9\u51FB\u5237\u65B0\u624D\u80FD\u751F\u6548\u3002":`\u65E0\u6CD5\u52A0\u8F7D\u8DEF\u7531\uFF1A${o.url}`,nzCancelDisabled:!1,nzOkText:"\u5237\u65B0",nzCancelText:"\u5FFD\u7565",nzOnOk:()=>location.reload()}),o instanceof $t&&(this.donePreloader(),this.titleSrv.setTitle(),this.modalSrv.closeAll())})}};t.\u0275fac=function(o){return new(o||t)(ae(st),ae(yt))},t.\u0275cmp=c({type:t,selectors:[["app-root"]],standalone:!0,features:[f],decls:1,vars:0,template:function(o,r){o&1&&s(0,"router-outlet")},dependencies:[ct],encapsulation:2});let i=t;return i})();function xi(i){let t=i;return 5}var Zo=["zh",[["\u4E0A\u5348","\u4E0B\u5348"],void 0,void 0],void 0,[["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"],["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"]],void 0,[["1","2","3","4","5","6","7","8","9","10","11","12"],["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"]],void 0,[["\u516C\u5143\u524D","\u516C\u5143"],void 0,void 0],0,[6,0],["y/M/d","y\u5E74M\u6708d\u65E5",void 0,"y\u5E74M\u6708d\u65E5EEEE"],["HH:mm","HH:mm:ss","z HH:mm:ss","zzzz HH:mm:ss"],["{1} {0}",void 0,void 0,void 0],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"CNY","\xA5","\u4EBA\u6C11\u5E01",{AUD:["AU$","$"],BYN:[void 0,"\u0440."],CNY:["\xA5"],ILR:["ILS"],JPY:["JP\xA5","\xA5"],KRW:["\uFFE6","\u20A9"],PHP:[void 0,"\u20B1"],RUR:[void 0,"\u0440."],TWD:["NT$"],USD:["US$","$"],XXX:[]},"ltr",xi];function _t(i,t,n){Mo(2,arguments);var e=Nt(i,n),o=Nt(t,n);return e.getTime()===o.getTime()}var Pi={lessThanXSeconds:{one:"\u4E0D\u5230 1 \u79D2",other:"\u4E0D\u5230 {{count}} \u79D2"},xSeconds:{one:"1 \u79D2",other:"{{count}} \u79D2"},halfAMinute:"\u534A\u5206\u949F",lessThanXMinutes:{one:"\u4E0D\u5230 1 \u5206\u949F",other:"\u4E0D\u5230 {{count}} \u5206\u949F"},xMinutes:{one:"1 \u5206\u949F",other:"{{count}} \u5206\u949F"},xHours:{one:"1 \u5C0F\u65F6",other:"{{count}} \u5C0F\u65F6"},aboutXHours:{one:"\u5927\u7EA6 1 \u5C0F\u65F6",other:"\u5927\u7EA6 {{count}} \u5C0F\u65F6"},xDays:{one:"1 \u5929",other:"{{count}} \u5929"},aboutXWeeks:{one:"\u5927\u7EA6 1 \u4E2A\u661F\u671F",other:"\u5927\u7EA6 {{count}} \u4E2A\u661F\u671F"},xWeeks:{one:"1 \u4E2A\u661F\u671F",other:"{{count}} \u4E2A\u661F\u671F"},aboutXMonths:{one:"\u5927\u7EA6 1 \u4E2A\u6708",other:"\u5927\u7EA6 {{count}} \u4E2A\u6708"},xMonths:{one:"1 \u4E2A\u6708",other:"{{count}} \u4E2A\u6708"},aboutXYears:{one:"\u5927\u7EA6 1 \u5E74",other:"\u5927\u7EA6 {{count}} \u5E74"},xYears:{one:"1 \u5E74",other:"{{count}} \u5E74"},overXYears:{one:"\u8D85\u8FC7 1 \u5E74",other:"\u8D85\u8FC7 {{count}} \u5E74"},almostXYears:{one:"\u5C06\u8FD1 1 \u5E74",other:"\u5C06\u8FD1 {{count}} \u5E74"}},yi=function(t,n,e){var o,r=Pi[t];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",String(n)),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?o+"\u5185":o+"\u524D":o},Jo=yi;var Si={full:"y'\u5E74'M'\u6708'd'\u65E5' EEEE",long:"y'\u5E74'M'\u6708'd'\u65E5'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},Oi={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},Ti={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},ki={date:ft({formats:Si,defaultWidth:"full"}),time:ft({formats:Oi,defaultWidth:"full"}),dateTime:ft({formats:Ti,defaultWidth:"full"})},Ko=ki;function ei(i,t,n){var e="eeee p";return _t(i,t,n)?e:i.getTime()>t.getTime()?"'\u4E0B\u4E2A'"+e:"'\u4E0A\u4E2A'"+e}var Ii={lastWeek:ei,yesterday:"'\u6628\u5929' p",today:"'\u4ECA\u5929' p",tomorrow:"'\u660E\u5929' p",nextWeek:ei,other:"PP p"},Fi=function(t,n,e,o){var r=Ii[t];return typeof r=="function"?r(n,e,o):r},ti=Fi;var Ei={narrow:["\u524D","\u516C\u5143"],abbreviated:["\u524D","\u516C\u5143"],wide:["\u516C\u5143\u524D","\u516C\u5143"]},Ai={narrow:["1","2","3","4"],abbreviated:["\u7B2C\u4E00\u5B63","\u7B2C\u4E8C\u5B63","\u7B2C\u4E09\u5B63","\u7B2C\u56DB\u5B63"],wide:["\u7B2C\u4E00\u5B63\u5EA6","\u7B2C\u4E8C\u5B63\u5EA6","\u7B2C\u4E09\u5B63\u5EA6","\u7B2C\u56DB\u5B63\u5EA6"]},Vi={narrow:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"],abbreviated:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],wide:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"]},Ri={narrow:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],short:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],abbreviated:["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"],wide:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"]},Hi={narrow:{am:"\u4E0A",pm:"\u4E0B",midnight:"\u51CC\u6668",noon:"\u5348",morning:"\u65E9",afternoon:"\u4E0B\u5348",evening:"\u665A",night:"\u591C"},abbreviated:{am:"\u4E0A\u5348",pm:"\u4E0B\u5348",midnight:"\u51CC\u6668",noon:"\u4E2D\u5348",morning:"\u65E9\u6668",afternoon:"\u4E2D\u5348",evening:"\u665A\u4E0A",night:"\u591C\u95F4"},wide:{am:"\u4E0A\u5348",pm:"\u4E0B\u5348",midnight:"\u51CC\u6668",noon:"\u4E2D\u5348",morning:"\u65E9\u6668",afternoon:"\u4E2D\u5348",evening:"\u665A\u4E0A",night:"\u591C\u95F4"}},ji={narrow:{am:"\u4E0A",pm:"\u4E0B",midnight:"\u51CC\u6668",noon:"\u5348",morning:"\u65E9",afternoon:"\u4E0B\u5348",evening:"\u665A",night:"\u591C"},abbreviated:{am:"\u4E0A\u5348",pm:"\u4E0B\u5348",midnight:"\u51CC\u6668",noon:"\u4E2D\u5348",morning:"\u65E9\u6668",afternoon:"\u4E2D\u5348",evening:"\u665A\u4E0A",night:"\u591C\u95F4"},wide:{am:"\u4E0A\u5348",pm:"\u4E0B\u5348",midnight:"\u51CC\u6668",noon:"\u4E2D\u5348",morning:"\u65E9\u6668",afternoon:"\u4E2D\u5348",evening:"\u665A\u4E0A",night:"\u591C\u95F4"}},Li=function(t,n){var e=Number(t);switch(n?.unit){case"date":return e.toString()+"\u65E5";case"hour":return e.toString()+"\u65F6";case"minute":return e.toString()+"\u5206";case"second":return e.toString()+"\u79D2";default:return"\u7B2C "+e.toString()}},Wi={ordinalNumber:Li,era:he({values:Ei,defaultWidth:"wide"}),quarter:he({values:Ai,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:he({values:Vi,defaultWidth:"wide"}),day:he({values:Ri,defaultWidth:"wide"}),dayPeriod:he({values:Hi,defaultWidth:"wide",formattingValues:ji,defaultFormattingWidth:"wide"})},oi=Wi;var Bi=/^(第\s*)?\d+(日|时|分|秒)?/i,Gi=/\d+/i,$i={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Xi={any:[/^(前)/i,/^(公元)/i]},qi={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Ui={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Qi={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Yi={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Zi={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Ji={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Ki={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},er={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},tr={ordinalNumber:vo({matchPattern:Bi,parsePattern:Gi,valueCallback:function(t){return parseInt(t,10)}}),era:Me({matchPatterns:$i,defaultMatchWidth:"wide",parsePatterns:Xi,defaultParseWidth:"any"}),quarter:Me({matchPatterns:qi,defaultMatchWidth:"wide",parsePatterns:Ui,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Me({matchPatterns:Qi,defaultMatchWidth:"wide",parsePatterns:Yi,defaultParseWidth:"any"}),day:Me({matchPatterns:Zi,defaultMatchWidth:"wide",parsePatterns:Ji,defaultParseWidth:"any"}),dayPeriod:Me({matchPatterns:Ki,defaultMatchWidth:"any",parsePatterns:er,defaultParseWidth:"any"})},ii=tr;var or={code:"zh-CN",formatDistance:Jo,formatLong:Ko,formatRelative:ti,localize:oi,match:ii,options:{weekStartsOn:1,firstWeekContainsDate:4}},bt=or;var ni=(()=>{let t=class t{constructor(){this.http=d(te),this.modal=d(ee)}ngOnInit(){this.updateCurrentTime(),setInterval(()=>{this.updateCurrentTime()},1e3)}add(){}updateCurrentTime(){this.currentTime=new Date}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["data-v-date"]],standalone:!0,features:[f],decls:3,vars:4,consts:[[1,"data-container"]],template:function(o,r){o&1&&(a(0,"div",0),g(1),It(2,"date"),l()),o&2&&(m(),K(" ",Ft(2,1,r.currentTime,"yyyy-MM-dd HH:mm:ss")," "))},dependencies:[oe,jt,b,D,B,A,$,X,G,L,_,I,E,Y,j,R,V,C,T,k,q,Q,y,v,H,M,F,O,U,w,N,W,P,h,x,S],styles:[".data-container[_ngcontent-%COMP%]{align-items:center;color:#fff}"]});let i=t;return i})();var ai=(()=>{let t=class t{constructor(){this.status=!1}_resize(){this.status=vt.isFullscreen}_click(){vt.isEnabled&&vt.toggle()}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["data-v-fullscreen"]],hostVars:2,hostBindings:function(o,r){o&1&&Z("resize",function(){return r._resize()},!1,Pt)("click",function(){return r._click()}),o&2&&it("flex-1",!0)},standalone:!0,features:[f],decls:2,vars:2,consts:[["nz-icon","",3,"nzType"]],template:function(o,r){o&1&&(s(0,"i",0),g(1)),o&2&&(p("nzType",r.status?"fullscreen-exit":"fullscreen"),m(),K(" ",r.status?"\u9000\u51FA\u5168\u5C4F":"\u8FDB\u5165\u5168\u5C4F"," "))},dependencies:[oe,h,ie],encapsulation:2,changeDetection:0});let i=t;return i})();var li=(()=>{let t=class t{constructor(e){this.http=e}getMenus(){return this.http.get("/api/main/menu?ClientId=Platform_Datav")}};t.\u0275fac=function(o){return new(o||t)(xt(Lt))},t.\u0275prov=Dt({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})();function rr(i,t){if(i&1&&s(0,"img",7),i&2){let n=z(2).$implicit;Ct("src","assets/",n.icon.includes("svg")?n.icon:n.icon+".svg","",zt),lt("alt",n.text)}}function nr(i,t){if(i&1){let n=at();rt(0),a(1,"a",5),Z("click",function(){tt(n);let o=z().$implicit,r=z();return ot(r.navigate(o))}),le(2,rr,1,2,"img",6),g(3),l(),nt()}if(i&2){let n=z().$implicit,e=z();m(),it("active",e.isActive(!0)),m(),p("ngIf",n.icon),m(),kt(" ",n.menuCode=="Home"&&e.selectedParentMenu&&e.selectedParentMenu.menuCode!="Home"?"/ "+e.selectedParentMenu.text:""," ",n.menuCode!="Home"?n.text:""," ")}}function ar(i,t){if(i&1){let n=at();a(0,"li",15),Z("click",function(){let r=tt(n).$implicit,u=z(4);return ot(u.navigate(r))}),g(1),l()}if(i&2){let n=t.$implicit;m(),K(" ",n.text," ")}}function lr(i,t){if(i&1&&(rt(0),a(1,"a",10),g(2),s(3,"span",11),l(),a(4,"nz-dropdown-menu",null,12)(6,"ul",13),le(7,ar,2,1,"li",14),l()(),nt()),i&2){let n=me(5),e=z(2).$implicit;m(),p("nzDropdownMenu",n),m(),K(" ",e.text," "),m(5),p("ngForOf",e.children)}}function mr(i,t){if(i&1&&s(0,"img",7),i&2){let n=z(3).$implicit;Ct("src","assets/",n.icon.includes("svg")?n.icon:n.icon+".svg","",zt),lt("alt",n.text)}}function sr(i,t){if(i&1){let n=at();a(0,"a",5),Z("click",function(){tt(n);let o=z(2).$implicit,r=z();return ot(r.navigate(o))}),le(1,mr,1,2,"img",6),g(2),l()}if(i&2){let n=z(2).$implicit,e=z();it("active",e.isActive(!0)),m(),p("ngIf",n.icon),m(),K(" ",n.menuCode!="Home"?n.text:""," ")}}function dr(i,t){if(i&1&&(rt(0),le(1,lr,8,3,"ng-container",8)(2,sr,3,4,"ng-template",null,9,Et),nt()),i&2){let n=me(3),e=z().$implicit;m(),p("ngIf",e.children&&e.children.length>0)("ngIfElse",n)}}function pr(i,t){if(i&1){let n=at();rt(0,2),a(1,"li",3),Z("mouseover",function(o){let u=tt(n).$implicit,et=z();return ot(et.menuOver(u,o))}),le(2,nr,4,5,"ng-container",4)(3,dr,4,2,"ng-container",4),l(),nt()}if(i&2){let n=t.$implicit;m(2),p("ngIf",n.childShowType=="menu"),m(),p("ngIf",n.childShowType=="drop-down")}}var di=(()=>{let t=class t{constructor(e){this.menuService=e,this.http=d(te),this.modal=d(ee),this.router=d(fe),this.menuNetDataList=[],this.visibleMenuList=[],this.imageUrl="assets/dashboard/menu_btn_l.png",this.title="Label",this.context="2024-02-29 10:00"}ngOnInit(){this.menuNetDataList=[{menuCode:"Home",text:"\u6211\u7684\u5DE5\u4F5C\u7AD9",i18n:null,icon:"home.svg",grp:!0,leafFlag:!1,rootFlag:!0,hideInBreadcrumbFlag:!0,link:"/",srtno:0,valiFlag:!1,menuType:0,parentId:null,clientId:"Platform_Datav",acl:null,childShowType:"menu",id:"3a1167f1-a86c-194d-eabf-258993a337ac"}],this.menuService.getMenus().subscribe(e=>{for(let o of e)if(o.children&&o.children.length>0)for(let r of o.children){if(r.childShowType="menu",r.children)for(let u of r.children)u.childShowType="drop-down",console.log(u.text),console.log(u.children);this.menuNetDataList.push(r)}console.log("this.menuNetDataList"),this.updateVisibleMenuList(),console.log(this.menuNetDataList)})}add(){}updateVisibleMenuList(){this.visibleMenuList=this.menuNetDataList.filter(e=>!this.selectedParentMenu||e.menuCode=="Home"||this.selectedParentMenu&&this.selectedParentMenu.menuCode=="Home"),this.menuNetDataList.forEach(e=>{e.childShowType=="menu"&&this.selectedParentMenu&&e.menuCode==this.selectedParentMenu.menuCode&&e.menuCode!=="Home"&&(this.visibleMenuList=this.visibleMenuList.concat(e.children||[]))}),console.log("visibleMenuList"),console.log(this.visibleMenuList)}menuOver(e,o){}isActive(e){}navigate(e){console.log("\u70B9\u51FBmenu"),console.log(e),this.menuNetDataList.forEach(o=>o.selected=!1),e.link&&e.childShowType=="menu"&&e.children&&e.children.length>0?(console.log("\u6765\u65F6\u8DF3\u8F6C2\u7EA7"),console.log(e.link),console.log(e.children),e.selected=!0,this.selectedParentMenu=e,this.router.navigate([e.link??"/404",e.id],{state:{menu:e.children}})):e.menuCode=="Home"?(e.selected=!0,this.selectedParentMenu=e,this.router.navigateByUrl(e.link??"/404")):(e.selected=!0,console.log("\u8DEF\u7531"),console.log(e.link),this.router.navigate([e.link??"/404",e.id],{state:{menu:e.children}})),this.updateVisibleMenuList()}};t.\u0275fac=function(o){return new(o||t)(ae(li))},t.\u0275cmp=c({type:t,selectors:[["data-v-navigation"]],standalone:!0,features:[f],decls:3,vars:1,consts:[[1,"navigation-container"],["id","parent-menu",4,"ngFor","ngForOf"],["id","parent-menu"],[1,"dropdown-submenu",3,"mouseover"],[4,"ngIf"],["href","javascript:void(0);",1,"menu-group",3,"click"],["width","20",3,"src","alt",4,"ngIf"],["width","20",3,"src","alt"],[4,"ngIf","ngIfElse"],["noChildren",""],["nz-dropdown","",1,"menu-group",3,"nzDropdownMenu"],["nz-icon","","nzType","down"],["childMenu","nzDropdownMenu"],["nz-menu","","nzSelectable",""],["nz-menu-item","",3,"click",4,"ngFor","ngForOf"],["nz-menu-item","",3,"click"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"ul"),le(2,pr,4,2,"ng-container",1),l()()),o&2&&(m(2),p("ngForOf",r.visibleMenuList))},dependencies:[oe,Vt,Rt,b,D,B,A,$,X,G,L,_,I,E,Y,j,R,V,C,ge,T,k,q,Q,y,v,H,M,ze,ve,Ce,Vo,Ne,F,O,U,w,N,W,P,h,ie,x,S],styles:['.navigation-container[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;margin-top:10px;padding-left:2rem;white-space:nowrap}[nz-button][_ngcontent-%COMP%]{margin-right:8px;margin-bottom:12px}.nz-button-group[_ngcontent-%COMP%] [nz-button][_ngcontent-%COMP%]{margin-right:0}ul[_ngcontent-%COMP%]{display:inline-flex;flex-wrap:wrap;margin-bottom:10px;padding-top:0;padding-left:0;list-style-type:none}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{flex-wrap:wrap;margin-right:10px;margin-bottom:30px}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{clear:both;min-width:4rem;margin-right:1rem;padding:.5rem 1.5rem;font-weight:600;color:#74fafb;text-align:inherit;white-space:nowrap;background-color:#054254;border:0 solid red;border-color:#74fafb}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:active, ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{color:#000;text-decoration:none;background-color:#fff}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{display:inline-flex;flex-wrap:nowrap;margin-right:10px;margin-bottom:10px;color:#fff;background-color:#337ab7}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%]{position:relative}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{position:absolute;top:2rem;margin-top:0;margin-left:0}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%]:hover > .dropdown-menu[_ngcontent-%COMP%]{display:block}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%]{position:relative}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{display:block}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:after{content:"\\f054";position:absolute;right:.5rem}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%] > .dropdown-menu[_ngcontent-%COMP%]{top:0;bottom:unset;left:100%;margin-top:0;margin-left:0}ul[_ngcontent-%COMP%] > .dropdown-submenu[_ngcontent-%COMP%] .dropdown-submenu[_ngcontent-%COMP%]:hover > .dropdown-menu[_ngcontent-%COMP%]{display:block}ul.dev-mode[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, ul.dev-mode[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:active, ul.dev-mode[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{color:#fff;background-color:#dc3545}']});let i=t;return i})();var ur=()=>({color:"white"}),pi=(()=>{let t=class t{constructor(){this.http=d(te),this.modal=d(ee)}ngOnInit(){this.updateCurrentTime(),setInterval(()=>{this.updateCurrentTime()},1e3)}add(){}updateCurrentTime(){this.currentTime=new Date}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["data-v-setting"]],standalone:!0,features:[f],decls:7,vars:3,consts:[["layout-default-header-item-trigger","","nz-dropdown","","nzTrigger","click","nzPlacement","bottomRight",3,"nzDropdownMenu"],["nz-icon","","nzType","setting",3,"ngStyle"],["settingsMenu","nzDropdownMenu"],["nz-menu","",2,"width","8rem"],["nz-menu-item",""]],template:function(o,r){if(o&1&&(a(0,"div",0),s(1,"i",1),l(),a(2,"nz-dropdown-menu",null,2)(4,"div",3)(5,"div",4),s(6,"data-v-fullscreen"),l()()()),o&2){let u=me(3);p("nzDropdownMenu",u),m(),p("ngStyle",ut(2,ur))}},dependencies:[ai,oe,Ht,b,D,B,A,$,X,G,L,_,I,E,Y,j,R,V,C,ge,T,k,q,Q,y,v,H,M,ze,ve,Ce,Ne,F,O,U,w,N,W,P,h,ie,x,S],encapsulation:2});let i=t;return i})();var ui=(()=>{let t=class t{constructor(){this.settings=d(wo),this.router=d(fe),this.tokenService=d(xo)}get user(){return this.settings.user}logout(){this.tokenService.clear(),this.router.navigateByUrl(this.tokenService.login_url)}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["data-v-user"]],standalone:!0,features:[f],decls:19,vars:3,consts:[["nz-dropdown","","nzPlacement","bottomRight",1,"alain-default__nav-item","d-flex","align-items-center","px-sm",3,"nzDropdownMenu"],["nzSize","small",1,"mr-sm",3,"nzSrc"],["userMenu","nzDropdownMenu"],["nz-menu","",1,"width-sm"],["nz-menu-item","","routerLink","/pro/account/center"],["nz-icon","","nzType","user",1,"mr-sm"],["nz-menu-item","","routerLink","/pro/account/settings"],["nz-icon","","nzType","setting",1,"mr-sm"],["nz-menu-item","","routerLink","/exception/trigger"],["nz-icon","","nzType","close-circle",1,"mr-sm"],["nz-menu-divider",""],["nz-menu-item","",3,"click"],["nz-icon","","nzType","logout",1,"mr-sm"]],template:function(o,r){if(o&1&&(a(0,"div",0),s(1,"nz-avatar",1),g(2),l(),a(3,"nz-dropdown-menu",null,2)(5,"div",3)(6,"div",4),s(7,"i",5),g(8," \u4E2A\u4EBA\u4E2D\u5FC3 "),l(),a(9,"div",6),s(10,"i",7),g(11," \u4E2A\u4EBA\u8BBE\u7F6E "),l(),a(12,"div",8),s(13,"i",9),g(14," \u89E6\u53D1\u9519\u8BEF "),l(),s(15,"li",10),a(16,"div",11),Z("click",function(){return r.logout()}),s(17,"i",12),g(18," \u9000\u51FA\u767B\u5F55 "),l()()()),o&2){let u=me(4);p("nzDropdownMenu",u),m(),p("nzSrc",r.user.avatar),m(),K(" ",r.user.name,` -`)}},dependencies:[M,ze,ve,Eo,Ce,Ne,Ao,h,ie,v,Bo],encapsulation:2});let i=t;return i})();var ci=(()=>{let t=class t{constructor(){this.http=d(te),this.modal=d(ee)}ngOnInit(){}add(){}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["app-data-v-header"]],standalone:!0,features:[f],decls:5,vars:0,consts:[[1,"header-container"],[1,"data-v-sysinfo","mr-sm"],[1,"mr-sm"]],template:function(o,r){o&1&&(a(0,"div",0)(1,"div",1),s(2,"data-v-setting",2)(3,"data-v-user",2)(4,"data-v-date",2),l()())},dependencies:[pi,ui,ni,Mt,b,D,B,A,$,X,G,L,_,I,E,Y,j,R,V,C,T,k,q,Q,y,v,H,M,F,O,U,w,N,W,P,h,x,S],styles:['.header-container[_ngcontent-%COMP%]{width:100vw;min-width:1280px;height:10%;background-image:url("./media/screen_header2-ZZHBGFUS.png");background-position:top;background-size:cover}.data-v-sysinfo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:right;text-align:right}']});let i=t;return i})();var fi=(()=>{let t=class t{constructor(){this.http=d(te),this.modal=d(ee)}ngOnInit(){}add(){}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["app-data-v-home"]],standalone:!0,features:[f],decls:6,vars:0,consts:[[1,"home-container"],["src","assets/dashboard/dashboard_menu.jpg",2,"width","100%","height","1.8rem"],[1,"router-outlet-container"]],template:function(o,r){o&1&&(a(0,"div",0),s(1,"app-data-v-header")(2,"data-v-navigation")(3,"img",1),a(4,"div",2),s(5,"router-outlet"),l()())},dependencies:[ci,di,Mt,ct,b,D,B,A,$,X,G,L,_,I,E,Y,j,R,V,C,T,k,q,Q,y,v,H,M,F,O,U,w,N,W,P,h,x,S],styles:[".home-container[_ngcontent-%COMP%]{width:100vw;min-width:1280px;height:100%;min-height:768px;background-color:#040516}.data-v-sysinfo[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:right;text-align:right}.router-outlet-container[_ngcontent-%COMP%]{padding:1rem;background-color:#040516}"]});let i=t;return i})();var cr=["myGrid"],gi=(()=>{let t=class t{constructor(){this.defaultColDef={width:130,editable:!1},this.columnDefs=[],this.rowData=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz"}ngOnInit(){console.log("-----\u8868\u683C\u521D\u59CB\u5316-----"),this.pageSize=10,this.pageIndex=1,this.pageRowTotal=this.rowData.length}nzPageSizeChange(e){this.pageSize=e}nzPageIndexChange(e){console.log(`nzPageIndexChange${e}`),this.grid.api&&(e==1?this.grid.api.paginationGoToFirstPage():this.grid.api.paginationGoToPage(e))}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["app-ag-grid-component"]],viewQuery:function(o,r){if(o&1&&pe(cr,5),o&2){let u;ue(u=ce())&&(r.grid=u.first)}},inputs:{defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData:"rowData",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[f],decls:7,vars:15,consts:[[3,"pagination","suppressPaginationPanel","suppressScrollOnNewData","paginationPageSize","defaultColDef","rowData","columnDefs"],["myGrid",""],[1,"grid-pagination"],[1,"page-total-style"],["nzShowSizeChanger","",3,"nzPageIndex","nzPageSize","nzTotal","className","nzPageSizeChange","nzPageIndexChange"]],template:function(o,r){o&1&&(s(0,"ag-grid-angular",0,1)(2,"br"),a(3,"div",2)(4,"div",3),g(5),l(),a(6,"nz-pagination",4),Z("nzPageSizeChange",function(et){return r.nzPageSizeChange(et)})("nzPageIndexChange",function(et){return r.nzPageIndexChange(et)}),l()()),o&2&&(dt(r.gridThemeClass),p("pagination",!0)("suppressPaginationPanel",!0)("suppressPaginationPanel",!0)("suppressScrollOnNewData",!0)("paginationPageSize",r.pageSize)("defaultColDef",r.defaultColDef)("rowData",r.rowData)("columnDefs",r.columnDefs),m(5),K("\u5171 ",r.pageRowTotal," \u9879\u6570\u636E"),m(),p("nzPageIndex",r.pageIndex)("nzPageSize",r.pageSize)("nzTotal",r.pageRowTotal)("className",r.paginationThemeClass))},dependencies:[ht,we,Ro],styles:[".grid-pagination[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:32px}.grid-pagination[_ngcontent-%COMP%] .ant-select-selection-item, .ant-select-selector[_ngcontent-%COMP%]{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .page-total-style{font-size:medium;font-weight:700;color:#00eff8} .ant-select-item-option{color:#00eff8!important} .ant-select-item-option-active div{font-weight:800!important;color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .anticon{color:#00eff8}.grid-pagination[_ngcontent-%COMP%] .ant-select-selector{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-prev .ant-pagination-item-link{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item a{color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active a{color:#000!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-next button, .ant-pagination-prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active:focus-visible, .ant-pagination-item-active[_ngcontent-%COMP%]:hover, .ant-pagination-next[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%], .ant-pagination-prev[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%]{border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active{font-weight:500;background-color:#00eff8;border-color:#00eff8;border-width:2px}"]});let i=t;return i})();var mt=(()=>{let t=class t{agInit(e){this.cellValue=this.getValueToDisplay(e)}refresh(e){return this.cellValue=this.getValueToDisplay(e),!0}buttonClicked(){alert(`\u70B9\u51FB\u4E86 ${this.cellValue}`)}getValueToDisplay(e){return e.valueFormatted?e.valueFormatted:e.value}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["ng-component"]],standalone:!0,features:[f],decls:3,vars:1,consts:[[2,"display","flex","justify-content","center","align-items","center","height","100%"],[1,"ag-grid-button-style",3,"click"]],template:function(o,r){o&1&&(a(0,"span",0)(1,"button",1),Z("click",function(){return r.buttonClicked()}),g(2),l()()),o&2&&(m(2),pt(r.cellValue))},styles:[".ag-grid-button-style[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;width:90px;margin:4px;padding:8px 12px;font-weight:800;color:#e0e0e0;text-align:center;text-decoration:none;background-color:#1e4d6b;border:none;transition:background-color .3s,color .3s}.ag-grid-button-style[_ngcontent-%COMP%]:hover{color:#fff;text-decoration:underline;background-color:#3a6d8c}"]});let i=t;return i})();var fr=["*"],hi=(()=>{let t=class t{constructor(){this.showSetting=!1,this.optionsList=[],this.onCheckedItemsChange=new St,this.title=""}getCheckedItems(){return this.optionsList.filter(e=>e.checked)}onCheckChange(){let e=this.getCheckedItems();this.onCheckedItemsChange.emit(e)}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["lj-data-v-card"]],inputs:{showSetting:"showSetting",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[f],ngContentSelectors:fr,decls:7,vars:1,consts:[[1,"card-content"],[1,"card-top-content"],[1,"card-content-title"],[1,"card-content-l"],["nz-icon","","nzType","setting","nzTheme","outline"]],template:function(o,r){o&1&&(Ot(),a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),g(4),l()(),s(5,"span",4),l(),Tt(6),l()),o&2&&(m(4),pt(r.title))},dependencies:[h,ie,oe,M,b,D,B,A,$,X,G,L,_,I,E,Y,j,R,V,C,ge,T,k,q,Q,y,v,H,F,O,U,w,N,W,P,x,S],styles:['.card-content-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:fit-content;height:fit-content;padding:5px 20px 0;font-size:16px;color:#29b6f6;text-align:center;background-color:#19426e;border:1px solid #1f6f97;border-radius:10px 10px 0 0;box-shadow:inset 0 0 10px #1f6f97}.card-top-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto;align-items:center;justify-content:space-between}.card-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:.5rem;padding:1rem 1.5rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-repeat:no-repeat;background-position:center;background-size:100% 100%}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;margin-bottom:.5rem;font-size:18px;font-weight:600;color:#74fafb}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{flex:1;align-self:flex-start}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let i=t;return i})();var gr=["myGrid"],Mi=(()=>{let t=class t{constructor(){this.title="",this.showSetting=!0,this.defaultColDef={width:130,editable:!1,headerClass:"ag-header-center",cellStyle:{"font-weight":"bold",textAlign:"center","justify-content":"center","line-height":"38px"}},this.columnDefs=[],this.rowData=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz",this.tableColumns=[{key:"sort",title:"\u5E8F\u53F7"},{key:"time",title:"\u65F6\u95F4"},{key:"option",title:"\u64CD\u4F5C"},{key:"optionDesc",title:"\u64CD\u4F5C\u63CF\u8FF0"},{key:"optionMan",title:"\u64CD\u4F5C\u4EBA\u5458"},{key:"mark",title:"\u5907\u6CE8"},{key:"edit",title:"\u7F16\u8F91"}],this.tableData=[{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"}]}ngOnInit(){console.log("-----\u8868\u683C\u521D\u59CB\u5316-----"),this.title="\u5F85\u529E\u4EFB\u52A1",this.pageSize=10,this.pageIndex=1,this.pageRowTotal=this.rowData.length}nzPageSizeChange(e){this.pageSize=e}nzPageIndexChange(e){console.log(`nzPageIndexChange${e}`),this.grid.api&&(e==1?this.grid.api.paginationGoToFirstPage():this.grid.api.paginationGoToPage(e))}};t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=c({type:t,selectors:[["lj-app-ag-grid-component"]],viewQuery:function(o,r){if(o&1&&pe(gr,5),o&2){let u;ue(u=ce())&&(r.grid=u.first)}},inputs:{defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData:"rowData",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[f],decls:4,vars:12,consts:[["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12",3,"title"],[3,"pagination","suppressPaginationPanel","suppressScrollOnNewData","paginationPageSize","defaultColDef","rowData","columnDefs","rowHeight"],["myGrid",""]],template:function(o,r){o&1&&(a(0,"lj-data-v-card",0),s(1,"ag-grid-angular",1,2)(3,"br"),l()),o&2&&(lt("title",r.title),m(),dt(r.gridThemeClass),p("pagination",!0)("suppressPaginationPanel",!0)("suppressPaginationPanel",!0)("suppressScrollOnNewData",!0)("paginationPageSize",r.pageSize)("defaultColDef",r.defaultColDef)("rowData",r.rowData)("columnDefs",r.columnDefs)("rowHeight",38))},dependencies:[ht,we,hi],styles:[".grid-pagination[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:32px}.grid-pagination[_ngcontent-%COMP%] .ant-select-selection-item, .ant-select-selector[_ngcontent-%COMP%]{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .page-total-style{font-size:medium;font-weight:700;color:#00eff8} .ant-select-item-option{color:#00eff8!important} .ant-select-item-option-active div{font-weight:800!important;color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .anticon{color:#00eff8}.grid-pagination[_ngcontent-%COMP%] .ant-select-selector{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-prev .ant-pagination-item-link{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item a{color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active a{color:#000!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-next button, .ant-pagination-prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active:focus-visible, .ant-pagination-item-active[_ngcontent-%COMP%]:hover, .ant-pagination-next[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%], .ant-pagination-prev[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%]{border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active{font-weight:500;background-color:#00eff8;border-color:#00eff8;border-width:2px}"]});let i=t;return i})();var hr=["myGrid"],Mr=()=>[12,12],vi=(()=>{let t=class t{constructor(e){this._mqttService=e,this.http=d(te),this.modal=d(ee),this.elementRef=d(st),this.titleService=d(gt),this.defaultColDef={width:170,editable:!1},this.gridThemedClass="ag-theme-quartz ag-theme-datav",this.rowData=[],this.colDefs1=[{headerName:"\u5E8F\u53F7",valueGetter:function(o){return parseInt(o.node.id)+1},width:90,sortable:!0,unSortIcon:!0,field:"xh"},{headerName:"\u4EFB\u52A1\u540D\u79F0",unSortIcon:!0,width:120,field:"rwmc"},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",unSortIcon:!0,field:"rwms",width:120},{headerName:"\u5F00\u59CB\u65F6\u95F4",headerClass:"ag-header-center",unSortIcon:!0,field:"kssj",width:180},{headerName:"\u8BA1\u5212\u5B8C\u6210\u65F6\u95F4",unSortIcon:!0,field:"jhwcsj",width:180},{headerName:"\u8D85\u671F",width:70,field:"sfcq"},{headerName:"\u64CD\u4F5C",width:90,autoHeaderHeight:!0,field:"cz",cellRenderer:mt}],this.colDefs2=[{headerName:"\u5E8F\u53F7",valueGetter:function(o){return parseInt(o.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u4EFB\u52A1\u540D\u79F0",unSortIcon:!0,field:"rwmc"},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",unSortIcon:!0,field:"rwms",minWidth:170,flex:1},{headerName:"\u5F00\u59CB\u65F6\u95F4",unSortIcon:!0,field:"kssj",minWidth:170,flex:1},{headerName:"\u5F53\u524D\u72B6\u6001",field:"dqzt"},{headerName:"\u5F53\u524D\u8282\u70B9",field:"dqjd"},{headerName:"\u5B9E\u9645\u5B8C\u6210\u65F6\u95F4",field:"sjwcsj",minWidth:170,flex:1},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:mt}],this.colDefs3=[{headerName:"\u5E8F\u53F7",valueGetter:function(o){return parseInt(o.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u62A5\u8B66\u540D\u79F0",unSortIcon:!0,field:"bjmc"},{headerName:"\u62A5\u8B66\u7B49\u7EA7",unSortIcon:!0,field:"bjdg"},{headerName:"\u62A5\u8B66\u63CF\u8FF0",unSortIcon:!0,field:"bjms",minWidth:170,flex:1},{headerName:"\u62A5\u8B66\u65F6\u95F4",unSortIcon:!0,field:"bjsj",minWidth:170,flex:1},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:mt},{headerName:"\u6545\u969C\u539F\u56E0",field:"gzyy"},{headerName:"\u5904\u7406\u65B9\u6CD5",field:"clff"},{headerName:"\u6CE8\u610F\u4E8B\u9879",field:"clff"}],this.colDefs4=[{headerName:"\u5E8F\u53F7",valueGetter:function(o){return parseInt(o.node.id)+1},width:90,unSortIcon:!0,field:"xh"},{headerName:"\u901A\u77E5\u65F6\u95F4",unSortIcon:!0,field:"tzsj",minWidth:170,flex:1},{headerName:"\u91CD\u8981\u7A0B\u5EA6",unSortIcon:!0,field:"zycd"},{headerName:"\u901A\u77E5\u540D\u79F0",unSortIcon:!0,field:"tzmc"},{headerName:"\u901A\u77E5\u5185\u5BB9",unSortIcon:!0,field:"tznr",minWidth:170,flex:1},{headerName:"\u9644\u4EF6",field:"fj"},{headerName:"\u64CD\u4F5C",autoHeight:!0,width:110,field:"cz",cellRenderer:mt}],this.client=e}ngOnInit(){this.titleService.setTitle("\u6211\u7684\u5DE5\u4F5C\u7AD9");for(var e=1;e<30;e++)this.rowData.push({rwmc:`\u4EFB\u52A1${e}`,rwms:`\u4EFB\u52A1\u63CF\u8FF0${e}`,kssj:`2024-1-${e} 13:38:${e*11}`,jhwcsj:`2024-1-${e} 13:38:${e*10}`,sfcq:"\u5426",dqzt:"\u6B63\u5E38",dqjd:`\u8282\u70B9${e}`,sjwcsj:`2024-1-${e} 13:38:${e*27}`,bjmc:"\u62A5\u8B665",bjms:"\u62A5\u8B66\u63CF\u8FF05",bjsj:`2024-1-${e} 13:38:${e*12}`,gzyy:"-",clff:"-",tzsj:`2024-1-${e} 13:38:${e*19}`,zycd:"\u4E00\u822C",tzmc:"\u7CFB\u7EDF\u63D0\u793A",tznr:"\u8D26\u6237\u767B\u5F55",fj:"-",cz:"\u64CD\u4F5C"})}ngAfterViewInit(){let e=this.elementRef.nativeElement.querySelector(".ag-theme-datav"),o=e.querySelector(".ag-body-viewport"),r=e.querySelector(".ag-scroller")}add(){}};t.\u0275fac=function(o){return new(o||t)(ae(se))},t.\u0275cmp=c({type:t,selectors:[["app-data-v-workstation"]],viewQuery:function(o,r){if(o&1&&pe(hr,5),o&2){let u;ue(u=ce())&&(r.grid=u.first)}},standalone:!0,features:[f],decls:8,vars:15,consts:[["nz-row","",3,"nzGutter"],[2,"width","50%",3,"defaultColDef","rowData","columnDefs","gridThemeClass"],["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12","title","\u5DF2\u529E\u4EFB\u52A1"],["gridThemeClass","ag-theme-quartz ag-theme-datav",2,"width","100%",3,"defaultColDef","rowData","columnDefs"],["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12","title","\u62A5\u8B66\u4FE1\u606F"],["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12","title","\u901A\u77E5"]],template:function(o,r){o&1&&(a(0,"div",0),s(1,"lj-app-ag-grid-component",1),a(2,"data-v-card",2),s(3,"app-ag-grid-component",3),l(),a(4,"data-v-card",4),s(5,"app-ag-grid-component",3),l(),a(6,"data-v-card",5),s(7,"app-ag-grid-component",3),l()()),o&2&&(p("nzGutter",ut(14,Mr)),m(),p("defaultColDef",r.defaultColDef)("rowData",r.rowData)("columnDefs",r.colDefs1)("gridThemeClass",r.gridThemedClass),m(2),p("defaultColDef",r.defaultColDef)("rowData",r.rowData)("columnDefs",r.colDefs2),m(2),p("defaultColDef",r.defaultColDef)("rowData",r.rowData)("columnDefs",r.colDefs3),m(2),p("defaultColDef",r.defaultColDef)("rowData",r.rowData)("columnDefs",r.colDefs4))},dependencies:[gi,Mi,we,qo,b,D,B,A,$,X,G,L,_,I,E,Y,j,R,Lo,jo,V,C,T,k,q,Q,y,v,H,M,F,O,U,w,N,W,P,h,x,S],styles:[".ag-header-center[_ngcontent-%COMP%] .ag-header-group-cell-label[_ngcontent-%COMP%], .ag-header-center[_ngcontent-%COMP%] .ag-header-cell-label[_ngcontent-%COMP%]{display:grid;justify-content:center;color:#000;text-align:center;background:#000} .ag-theme-datav .ag-row-selected .ag-ltr .ag-cell{color:red!important} .ag-theme-datav .ag-ltr .ag-row-focus{font-weight:600;color:red} .ag-theme-datav .ag-ltr .ag-row-focus .ag-cell-focus{border:#74FAFB} .ag-theme-datav .ag-ltr .ag-row-focus .ag-grid-button-style{color:red;border-color:red} .ag-theme-datav{--ag-border-color: #74FAFB;--ag-foreground-color: #74FAFB;--ag-background-color: #0A1632;--ag-header-foreground-color: #74FAFB;--ag-header-background-color: #0A1632;--ag-odd-row-background-color: #0A1632;--ag-header-column-resize-handle-color: #7e2e84;--ag-font-size: 12px;--ag-font-family: monospace;height:17rem;font-weight:700;border-width:3px} .ag-theme-datav .ag-header-cell-resize{--ag-header-column-resize-handle-color: #00eff8} .ag-theme-datav .ag-header-row{font-size:14px;font-weight:700} .ag-theme-datav .ag-root-wrapper{border-radius:0} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar{width:12em} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb{margin-left:40px;background-color:#00eff8;border:2px solid #00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-track{background-color:transparent;border-color:#00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover{margin-left:40px;background-color:#00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:active{background-color:#00eff8} .ag-body-vertical-scroll-viewport{scrollbar-color:auto} .ag-body-horizontal-scroll-viewport{scrollbar-color:auto} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar{height:14em;color:#000} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-track{background-color:transparent;border-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:hover{background-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:active{background-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb{background-color:#00eff8}"]});let i=t;return i})();var zi=[{path:"home",component:Uo,canActivate:[Io,Po],canActivateChild:[yo],data:{},children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"sys",loadChildren:()=>import("./chunk-MU3AQSF6.js").then(i=>i.routes)}]},{path:"",component:fi,children:[{path:"",component:vi},{path:"data-v",loadChildren:()=>import("./chunk-U3NGNWYP.js").then(i=>i.routes)}]},{path:"",loadChildren:()=>import("./chunk-TZPPFKXI.js").then(i=>i.routes)},{path:"exception",loadChildren:()=>import("./chunk-MUTNAUEH.js").then(i=>i.routes)},{path:"**",redirectTo:"exception/404"}];var Ci=[oo];var Ni=[to,io,ro,ao,no,lo,so,mo,po,fo,uo,co,go,ho];var wi={hostname:"127.0.0.1",port:1883,path:"/mqtt",protocol:"ws"},vr={abbr:"zh-CN",ng:Zo,zorro:zo,date:bt,delon:_o},zr={auth:{login_url:"/passport/login"}},Cr={},_i=[Zt(),Jt(),Qt({scrollPositionRestoration:"top"})];re.useHash&&_i.push(Yt());var bi=[Wt(Bt([...re.interceptorFns??[],So,To])),eo(),Ut(zi,..._i),bo({config:zr,defaultLang:vr,icons:[...Ni,...Ci]}),Kt(Cr),Oo(),Fo(...Xo),Ho(...$o),Wo({widgets:[...Go]}),{provide:se,useFactory:()=>new se(wi)},ko(),{provide:se,useFactory:()=>new se(wi)},...re.providers||[]];re.api?.refreshTokenEnabled&&re.api.refreshTokenType==="auth-refresh"&&bi.push(wt());var Di={providers:bi};Gt(Yo,Di).catch(i=>console.error(i));