@avs/go 0.12.71730

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ /*! For license information please see avs-go.min.js.LICENSE.txt */
2
+ (()=>{var e={25:(e,t,n)=>{var r=n(5161),i=n(609),a=n(6094),o=(n(2228).Reflect||{}).apply,s=Function.apply;r(r.S+r.F*!n(110)((function(){o((function(){}))})),"Reflect",{apply:function(e,t,n){var r=i(e),l=a(n);return o?o(r,t,l):s.call(r,t,l)}})},69:(e,t,n)=>{var r=n(5161);r(r.S,"Object",{is:n(5289)})},101:(e,t,n)=>{"use strict";var r=n(4397),i=n(9142);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},110:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},163:(e,t,n)=>{var r=n(5161),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},230:(e,t,n)=>{var r=n(5161),i=n(2381),a=n(6094);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(a(e))}})},238:(e,t,n)=>{var r=n(4397),i=n(5161),a=n(6094),o=n(4142);i(i.S+i.F*n(110)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(e,t,n){a(e),t=o(t,!0),a(n);try{return r.f(e,t,n),!0}catch(e){return!1}}})},262:(e,t,n)=>{"use strict";n(4221),n(1846),n(9279),n(6707),n(2174),n(4242),n(4287),n(3485),n(2099),n(6115),n(9289),n(1980),n(7385),n(7098)},272:(e,t,n)=>{for(var r=n(4683),i=n(7029),a=n(9337),o=n(2228),s=n(6271),l=n(8360),u=n(5440),c=u("iterator"),h=u("toStringTag"),d=l.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(f),v=0;v<p.length;v++){var m,y=p[v],g=f[y],_=o[y],b=_&&_.prototype;if(b&&(b[c]||s(b,c,d),b[h]||s(b,h,y),l[y]=d,g))for(m in r)b[m]||a(b,m,r[m],!0)}},285:(e,t,n)=>{var r=n(5161),i=n(5881);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},307:(e,t,n)=>{"use strict";var r,i,a,o,s=n(2864),l=n(2228),u=n(7102),c=n(5602),h=n(5161),d=n(7947),f=n(609),p=n(2490),v=n(940),m=n(6816),y=n(3342).set,g=n(8818)(),_=n(5979),b=n(998),x=n(9940),S=n(1079),w="Promise",E=l.TypeError,M=l.process,T=M&&M.versions,C=T&&T.v8||"",A=l[w],P="process"==c(M),k=function(){},O=i=_.f,R=!!function(){try{var e=A.resolve(1),t=(e.constructor={})[n(5440)("species")]=function(e){e(k,k)};return(P||"function"==typeof PromiseRejectionEvent)&&e.then(k)instanceof t&&0!==C.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(e){}}(),I=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},N=function(e,t){if(!e._n){e._n=!0;var n=e._c;g((function(){for(var r=e._v,i=1==e._s,a=0,o=function(t){var n,a,o,s=i?t.ok:t.fail,l=t.resolve,u=t.reject,c=t.domain;try{s?(i||(2==e._h&&U(e),e._h=1),!0===s?n=r:(c&&c.enter(),n=s(r),c&&(c.exit(),o=!0)),n===t.promise?u(E("Promise-chain cycle")):(a=I(n))?a.call(n,l,u):l(n)):u(r)}catch(e){c&&!o&&c.exit(),u(e)}};n.length>a;)o(n[a++]);e._c=[],e._n=!1,t&&!e._h&&L(e)}))}},L=function(e){y.call(l,(function(){var t,n,r,i=e._v,a=D(e);if(a&&(t=b((function(){P?M.emit("unhandledRejection",i,e):(n=l.onunhandledrejection)?n({promise:e,reason:i}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=P||D(e)?2:1),e._a=void 0,a&&t.e)throw t.v}))},D=function(e){return 1!==e._h&&0===(e._a||e._c).length},U=function(e){y.call(l,(function(){var t;P?M.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},F=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),N(t,!0))},B=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=I(e))?g((function(){var r={_w:n,_d:!1};try{t.call(e,u(B,r,1),u(F,r,1))}catch(e){F.call(r,e)}})):(n._v=e,n._s=1,N(n,!1))}catch(e){F.call({_w:n,_d:!1},e)}}};R||(A=function(e){p(this,A,w,"_h"),f(e),r.call(this);try{e(u(B,this,1),u(F,this,1))}catch(e){F.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(2119)(A.prototype,{then:function(e,t){var n=O(m(this,A));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=P?M.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&N(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new r;this.promise=e,this.resolve=u(B,e,1),this.reject=u(F,e,1)},_.f=O=function(e){return e===A||e===o?new a(e):i(e)}),h(h.G+h.W+h.F*!R,{Promise:A}),n(5462)(A,w),n(8544)(w),o=n(1212)[w],h(h.S+h.F*!R,w,{reject:function(e){var t=O(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!R),w,{resolve:function(e){return S(s&&this===o?A:this,e)}}),h(h.S+h.F*!(R&&n(8113)((function(e){A.all(e).catch(k)}))),w,{all:function(e){var t=this,n=O(t),r=n.resolve,i=n.reject,a=b((function(){var n=[],a=0,o=1;v(e,!1,(function(e){var s=a++,l=!1;n.push(void 0),o++,t.resolve(e).then((function(e){l||(l=!0,n[s]=e,--o||r(n))}),i)})),--o||r(n)}));return a.e&&i(a.v),n.promise},race:function(e){var t=this,n=O(t),r=n.reject,i=b((function(){v(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},342:(e,t,n)=>{var r=n(5161);r(r.S+r.F*!n(9417),"Object",{defineProperty:n(4397).f})},355:(e,t,n)=>{"use strict";var r,i=n(2228),a=n(9705)(0),o=n(9337),s=n(4286),l=n(9324),u=n(5652),c=n(7947),h=n(2454),d=n(2454),f=!i.ActiveXObject&&"ActiveXObject"in i,p="WeakMap",v=s.getWeak,m=Object.isExtensible,y=u.ufstore,g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},_={get:function(e){if(c(e)){var t=v(e);return!0===t?y(h(this,p)).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(h(this,p),e,t)}},b=e.exports=n(859)(p,g,_,u,!0,!0);d&&f&&(l((r=u.getConstructor(g,p)).prototype,_),s.NEED=!0,a(["delete","has","get","set"],(function(e){var t=b.prototype,n=t[e];o(t,e,(function(t,i){if(c(t)&&!m(t)){this._f||(this._f=new r);var a=this._f[e](t,i);return"set"==e?this:a}return n.call(this,t,i)}))})))},375:(e,t,n)=>{"use strict";n(1794)("fontsize",(function(e){return function(t){return e(this,"font","size",t)}}))},380:(e,t,n)=>{"use strict";var r,i=n(5971),a=(n(4414),n(491)),o=n(939);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=d(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,o=[{key:"_assembleModel",value:function(){if(void 0!==this.dynamicHtmlName){var e={dynamicHtmlProperties:{}};return e.dynamicHtmlProperties.name=this.dynamicHtmlName,void 0!==this.dynamicHtmlUserProperties&&(e.dynamicHtmlProperties.userProperties=this.dynamicHtmlUserProperties),this._addDataSourceProperties(e),e}this._logError(JSON.stringify({GoType:1,error:"'dynamic-html-name' property must be set to the name of the dynamic html registered in the library map on the server."}))}},{key:"_handleHttpError",value:function(e){}},{key:"_handleHttpResponse",value:function(e){void 0!==e.html&&(this.$.htmlDiv.innerHTML=decodeURIComponent(e.html.replace(/\+/g,"%20")))}},{key:"connectedCallback",value:function(){var e,n,r;(e=t,n=this,"function"==typeof(r=h(d(1&3?e.prototype:e),"connectedCallback",n))?function(e){return r.apply(n,e)}:r)([]),(0,a.m)(this,(function(){1!=this.__initialized&&(this._httpRequest(this.url,this._handleHttpResponse.bind(this),void 0,this._handleHttpError.bind(this),this._assembleModel()),this.__initialized=!0)}))}}],u=[{key:"template",get:function(){return(0,i.qy)(r||(e=['\n <template is="dom-repeat" items="{{linkCss}}">\n <link rel="stylesheet" href="[[item]]">\n </template>\n <style>\n #htmlDiv {\n width: 100%;\n height: 100%;\n position: relative;\n } \n </style>\n <div id="htmlDiv"></div>\n '],t||(t=e.slice(0)),r=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))));var e,t}},{key:"properties",get:function(){return{url:{type:String},linkCss:{type:Array,value:function(){return[]}},dynamicHtmlName:{type:String},dynamicHtmlUserProperties:{type:Object,value:{}}}}}],o&&l(n.prototype,o),u&&l(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,u}((0,n(606).B)((0,o.u)(i.Pu)));window.customElements.define("avs-go-dynamic-html",p)},438:(e,t,n)=>{var r=n(7947),i=n(4286).onFreeze;n(7265)("freeze",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},448:(e,t,n)=>{var r=n(3367),i=Math.pow,a=i(2,-52),o=i(2,-23),s=i(2,127)*(2-o),l=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),u=r(e);return i<l?u*(i/l/o+1/a-1/a)*l*o:(n=(t=(1+o/a)*i)-(t-i))>s||n!=n?u*(1/0):u*n}},491:(e,t,n)=>{"use strict";n.d(t,{m:()=>l}),n(9032);var r=!1,i=[],a=[];function o(){r=!0,requestAnimationFrame((function(){r=!1,function(e){for(;e.length;)s(e.shift())}(i),setTimeout((function(){!function(e){for(var t=0,n=e.length;t<n;t++)s(e.shift())}(a)}))}))}function s(e){var t=e[0],n=e[1],r=e[2];try{n.apply(t,r)}catch(e){setTimeout((function(){throw e}))}}function l(e,t,n){r||o(),a.push([e,t,n])}},532:(e,t,n)=>{"use strict";n(1794)("bold",(function(e){return function(){return e(this,"b","","")}}))},544:(e,t,n)=>{"use strict";n.d(t,{O:()=>r.Oy,b:()=>i}),n(9032);var r=n(1475),i=function(){var e,t;do{e=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),t=(0,r.pg)()}while(e||t)}},570:(e,t,n)=>{"use strict";var r=n(5560),i=n(1167),a=n(3991);e.exports=function(e){for(var t=r(this),n=a(t.length),o=arguments.length,s=i(o>1?arguments[1]:void 0,n),l=o>2?arguments[2]:void 0,u=void 0===l?n:i(l,n);u>s;)t[s++]=e;return t}},594:(e,t,n)=>{"use strict";var r=n(5161),i=n(7108),a="includes";r(r.P+r.F*n(4709)(a),"String",{includes:function(e){return!!~i(this,e,a).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},606:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o=function(){return!!e})()}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}n.d(t,{B:()=>u});var u=(0,n(9259).y)((function(e){return function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=s(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,u=[{key:"properties",get:function(){return{dataSourceName:{type:String},dataSourceUserProperties:{type:Object,value:{}}}}}],(a=[{key:"_addDataSourceProperties",value:function(e){void 0!==this.dataSourceName&&(e.dataSourceProperties={name:this.dataSourceName},void 0!==this.dataSourceUserProperties&&(e.dataSourceProperties.userProperties=this.dataSourceUserProperties))}}])&&i(n.prototype,a),u&&i(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,u}(e)}))},609:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},652:(e,t,n)=>{"use strict";var r=n(5323),i=n(2454),a="Map";e.exports=n(859)(a,(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(e){var t=r.getEntry(i(this,a),e);return t&&t.v},set:function(e,t){return r.def(i(this,a),0===e?0:e,t)}},r,!0)},702:(e,t,n)=>{var r=n(5560),i=n(2381);n(7265)("getPrototypeOf",(function(){return function(e){return i(r(e))}}))},735:(e,t,n)=>{"use strict";var r=n(5161),i=n(9705)(6),a="findIndex",o=!0;a in[]&&Array(1)[a]((function(){o=!1})),r(r.P+r.F*o,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(2846)(a)},775:(e,t,n)=>{"use strict";var r=n(5161),i=n(9705)(2);r(r.P+r.F*!n(938)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},803:(e,t,n)=>{n(7495)("Uint8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}),!0)},825:(e,t,n)=>{"use strict";n(1794)("fixed",(function(e){return function(){return e(this,"tt","","")}}))},859:(e,t,n)=>{"use strict";var r=n(2228),i=n(5161),a=n(9337),o=n(2119),s=n(4286),l=n(940),u=n(2490),c=n(7947),h=n(110),d=n(8113),f=n(5462),p=n(1282);e.exports=function(e,t,n,v,m,y){var g=r[e],_=g,b=m?"set":"add",x=_&&_.prototype,S={},w=function(e){var t=x[e];a(x,e,"delete"==e||"has"==e?function(e){return!(y&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return y&&!c(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof _&&(y||x.forEach&&!h((function(){(new _).entries().next()})))){var E=new _,M=E[b](y?{}:-0,1)!=E,T=h((function(){E.has(1)})),C=d((function(e){new _(e)})),A=!y&&h((function(){for(var e=new _,t=5;t--;)e[b](t,t);return!e.has(-0)}));C||((_=t((function(t,n){u(t,_,e);var r=p(new g,t,_);return null!=n&&l(n,m,r[b],r),r}))).prototype=x,x.constructor=_),(T||A)&&(w("delete"),w("has"),m&&w("get")),(A||M)&&w(b),y&&x.clear&&delete x.clear}else _=v.getConstructor(t,e,m,b),o(_.prototype,n),s.NEED=!0;return f(_,e),S[e]=_,i(i.G+i.W+i.F*(_!=g),S),y||v.setStrong(_,e,m),_}},928:(e,t,n)=>{var r=n(7947),i=n(2228).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},938:(e,t,n)=>{"use strict";var r=n(110);e.exports=function(e,t){return!!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},939:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o=function(){return!!e})()}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}n.d(t,{u:()=>u});var u=(0,n(9259).y)((function(e){return function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=s(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(a=[{key:"_httpRequest",value:function(e,t,n,r,i){if(void 0!==e){void 0!==this.xhr&&(this.xhr.cancel=!0);var a=new XMLHttpRequest,o=this;if(a.onload=function(e){if(200===a.status){var n=JSON.parse(a.responseText);null==n||null==n?(o.dispatchEvent(new CustomEvent("avs-error",{detail:"Empty response received from AVS/Go server."})),void 0!==r&&r(e)):void 0!==n.error?(o._logError(n.error),void 0!==r&&r(e)):void 0===a.cancel&&void 0!==t&&t(n)}else o.dispatchEvent(new CustomEvent("avs-error",{detail:"Network error connecting to AVS/Go server, status code "+a.status})),void 0!==r&&r(e)},a.onprogress=n,a.onerror=function(e){o.dispatchEvent(new CustomEvent("avs-error",{detail:"Network error connecting to AVS/Go server."})),void 0!==r&&r(e)},void 0===i)a.open("GET",e,!0),a.send();else{var s="0.12.71730".split("."),l=[parseInt(s[0]),parseInt(s[1]),parseInt(s[2])],u={source:this.localName,model:i,version:l};a.open("POST",e,!0),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(u))}this.xhr=a}else this.dispatchEvent(new CustomEvent("avs-error",{detail:"'url' property must point to an instance of AVS/Go server."}))}},{key:"_logError",value:function(e){if(null==e||null==e)n="An unknown error occurred on the AVS/Go server.";else{var t=JSON.parse(decodeURIComponent(e.replace(/\+/g,"%20"))),n="An error occurred on the AVS/Go server";for(var r in t)if(t.hasOwnProperty(r)){""!=n&&(n+="\n "),n=n+r+" : ";var i=t[r];i===Object(i)?n+=JSON.stringify(i):n+=t[r]}}this.dispatchEvent(new CustomEvent("avs-error",{detail:n}))}}])&&i(n.prototype,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a}(e)}))},940:(e,t,n)=>{var r=n(7102),i=n(5678),a=n(2730),o=n(6094),s=n(3991),l=n(8424),u={},c={},h=e.exports=function(e,t,n,h,d){var f,p,v,m,y=d?function(){return e}:l(e),g=r(n,h,t?2:1),_=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(a(y)){for(f=s(e.length);f>_;_++)if((m=t?g(o(p=e[_])[0],p[1]):g(e[_]))===u||m===c)return m}else for(v=y.call(e);!(p=v.next()).done;)if((m=i(v,g,p.value,t))===u||m===c)return m};h.BREAK=u,h.RETURN=c},947:(e,t,n)=>{"use strict";n.d(t,{$k:()=>S,lH:()=>P,sm:()=>A}),n(9032);var r=n(3764),i=n(7550),a=n(7925),o=n(5572);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t,n){return t=h(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],h(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},c.apply(null,arguments)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,m(r.key),r)}}function v(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function m(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var g=null;function _(){return g}_.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:_,writable:!0}});var b=(0,r.s)(_),x=(0,i.H)(b);function S(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(Boolean(e)!=Boolean(r.__hideTemplateChildren__))if(r.nodeType===Node.TEXT_NODE)e?(r.__polymerTextContent__=r.textContent,r.textContent=""):r.textContent=r.__polymerTextContent__;else if("slot"===r.localName)if(e)r.__polymerReplaced__=document.createComment("hidden-slot"),(0,o.L)((0,o.L)(r).parentNode).replaceChild(r.__polymerReplaced__,r);else{var i=r.__polymerReplaced__;i&&(0,o.L)((0,o.L)(i).parentNode).replaceChild(r,i)}else r.style&&(e?(r.__polymerDisplay__=r.style.display,r.style.display="none"):r.style.display=r.__polymerDisplay__);r.__hideTemplateChildren__=e,r._showHideChildren&&r._showHideChildren(e)}}var w=function(e){function t(e){var n;y(this,t),(n=l(this,t))._configureProperties(e),n.root=n._stampTemplate(n.__dataHost);var r=[];n.children=r;for(var i=n.root.firstChild;i;i=i.nextSibling)r.push(i),i.__templatizeInstance=n;n.__templatizeOwner&&n.__templatizeOwner.__hideTemplateChildren__&&n._showHideChildren(!0);var a=n.__templatizeOptions;return(e&&a.instanceProps||!a.instanceProps)&&n._enableProperties(),n}return d(t,e),v(t,[{key:"_configureProperties",value:function(e){if(this.__templatizeOptions.forwardHostProp)for(var t in this.__hostProps)this._setPendingProperty(t,this.__dataHost["_host_"+t]);for(var n in e)this._setPendingProperty(n,e[n])}},{key:"forwardHostProp",value:function(e,t){this._setPendingPropertyOrPath(e,t,!1,!0)&&this.__dataHost._enqueueClient(this)}},{key:"_addEventListenerToNode",value:function(e,t,n){var r=this;if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(e,t,(function(e){e.model=r,n(e)}));else{var i=this.__dataHost.__dataHost;i&&i._addEventListenerToNode(e,t,n)}}},{key:"_showHideChildren",value:function(e){S(e,this.children)}},{key:"_setUnmanagedPropertyToNode",value:function(e,n,r){var i,a,o;e.__hideTemplateChildren__&&e.nodeType==Node.TEXT_NODE&&"textContent"==n?e.__polymerTextContent__=r:(i=t,a=this,"function"==typeof(o=c(h(1&3?i.prototype:i),"_setUnmanagedPropertyToNode",a))?function(e){return o.apply(a,e)}:o)([e,n,r])}},{key:"parentModel",get:function(){var e=this.__parentModel;if(!e){var t;e=this;do{e=e.__dataHost.__dataHost}while((t=e.__templatizeOptions)&&!t.parentModel);this.__parentModel=e}return e}},{key:"dispatchEvent",value:function(e){return!0}}])}((0,r.s)(v((function e(){y(this,e)}))));w.prototype.__dataHost,w.prototype.__templatizeOptions,w.prototype._methodHost,w.prototype.__templatizeOwner,w.prototype.__hostProps;var E=(0,i.H)(w);function M(e){var t=e.__dataHost;return t&&t._methodHost||t}function T(e,t){return function(e,n,r){t.call(e.__templatizeOwner,n.substring(6),r[n])}}function C(e,t){return function(e,n,r){t.call(e.__templatizeOwner,e,n,r[n])}}function A(e,t,n){if(a.yu&&!M(e))throw new Error("strictTemplatePolicy: template owner not trusted");if(n=n||{},e.__templatizeOwner)throw new Error("A <template> can only be templatized once");e.__templatizeOwner=t;var r=(t?t.constructor:w)._parseTemplate(e),i=r.templatizeInstanceClass;i||(i=function(e,t,n){var r=n.mutableData?E:w;A.mixin&&(r=A.mixin(r));var i=function(e){function t(){return y(this,t),l(this,t,arguments)}return d(t,e),v(t)}(r);return i.prototype.__templatizeOptions=n,i.prototype._bindTemplate(e),function(e,t,n,r){var i=n.hostProps||{};for(var a in r.instanceProps){delete i[a];var o=r.notifyInstanceProp;o&&e.prototype._addPropertyEffect(a,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:C(0,o)})}if(r.forwardHostProp&&t.__dataHost)for(var s in i)n.hasHostProps||(n.hasHostProps=!0),e.prototype._addPropertyEffect(s,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(e,t,n){e.__dataHost._setPendingPropertyOrPath("_host_"+t,n[t],!0,!0)}})}(i,e,t,n),i}(e,r,n),r.templatizeInstanceClass=i);var o=M(e);!function(e,t,n,r){var i,o,s=n.forwardHostProp;if(s&&t.hasHostProps){var u="template"==e.localName,c=t.templatizeTemplateClass;if(!c){if(u){var h=function(e){function t(){return y(this,t),l(this,t,arguments)}return d(t,e),v(t)}(n.mutableData?x:b);c=t.templatizeTemplateClass=h}else{var f=function(e){function t(){return y(this,t),l(this,t,arguments)}return d(t,e),v(t)}(e.constructor);c=t.templatizeTemplateClass=f}var p=t.hostProps;for(var m in p)c.prototype._addPropertyEffect("_host_"+m,c.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:T(0,s)}),c.prototype._createNotifyingProperty("_host_"+m);a.F3&&r&&function(e,t,n){var r=n.constructor._properties,i=e.propertyEffects,a=t.instanceProps;for(var o in i)if(!(r[o]||a&&a[o]))for(var s=i[o],l=0;l<s.length;l++){var u=s[l].info.part;if(!u.signature||!u.signature.static){console.warn("Property '".concat(o,"' used in template but not ")+"declared in 'properties'; attribute will not be observed.");break}}}(t,n,r)}if(e.__dataProto&&Object.assign(e.__data,e.__dataProto),u)o=c,g=i=e,Object.setPrototypeOf(i,o.prototype),new o,g=null,e.__dataTemp={},e.__dataPending=null,e.__dataOld=null,e._enableProperties();else{Object.setPrototypeOf(e,c.prototype);var _=t.hostProps;for(var S in _)if((S="_host_"+S)in e){var w=e[S];delete e[S],e.__data[S]=w}}}}(e,r,n,o);var s=function(e){function t(){return y(this,t),l(this,t,arguments)}return d(t,e),v(t)}(i);return s.prototype._methodHost=o,s.prototype.__dataHost=e,s.prototype.__templatizeOwner=t,s.prototype.__hostProps=r.hostProps,s}function P(e,t){for(var n;t;)if(n=t.__dataHost?t:t.__templatizeInstance){if(n.__dataHost==e)return n;t=n.__dataHost}else t=(0,o.L)(t).parentNode;return null}},976:(e,t,n)=>{"use strict";var r=n(5161),i=n(4547),a=n(2497),o=n(3991),s=[].lastIndexOf,l=!!s&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(l||!n(938)(s)),"Array",{lastIndexOf:function(e){if(l)return s.apply(this,arguments)||0;var t=i(this),n=o(t.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,a(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},998:e=>{e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},1079:(e,t,n)=>{var r=n(6094),i=n(7947),a=n(5979);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},1084:(e,t,n)=>{var r=n(7753),i=n(7598),a=n(6094),o=n(2228).Reflect;e.exports=o&&o.ownKeys||function(e){var t=r.f(a(e)),n=i.f;return n?t.concat(n(e)):t}},1167:(e,t,n)=>{var r=n(2497),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):a(e,t)}},1212:e=>{var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},1271:e=>{var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},1282:(e,t,n)=>{var r=n(7947),i=n(9584).set;e.exports=function(e,t,n){var a,o=t.constructor;return o!==n&&"function"==typeof o&&(a=o.prototype)!==n.prototype&&r(a)&&i&&i(e,a),e}},1343:(e,t,n)=>{var r=n(8319),i=n(4547),a=n(3814)(!1),o=n(9788)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),l=0,u=[];for(n in s)n!=o&&r(s,n)&&u.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~a(u,n)||u.push(n));return u}},1386:(e,t,n)=>{var r=n(5161),i=n(1167),a=String.fromCharCode,o=String.fromCodePoint;r(r.S+r.F*(!!o&&1!=o.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,o=0;r>o;){if(t=+arguments[o++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?a(t):a(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},1399:(e,t,n)=>{var r=n(2497),i=n(3991);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},1412:(e,t,n)=>{"use strict";var r=n(5161),i=n(9841);r(r.P+r.F*!n(938)([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},1416:(e,t,n)=>{var r=n(7947),i=n(2395),a=n(5440)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},1475:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{Oy:()=>l,aq:()=>o,pg:()=>u}),n(9032),n(9259),n(8834);var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._asyncModule=null,this._callback=null,this._timer=null}return t=e,r=[{key:"debounce",value:function(t,n,r){return t instanceof e?t._cancelAsync():t=new e,t.setConfig(n,r),t}}],(n=[{key:"setConfig",value:function(e,t){var n=this;this._asyncModule=e,this._callback=t,this._timer=this._asyncModule.run((function(){n._timer=null,s.delete(n),n._callback()}))}},{key:"cancel",value:function(){this.isActive()&&(this._cancelAsync(),s.delete(this))}},{key:"_cancelAsync",value:function(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}},{key:"flush",value:function(){this.isActive()&&(this.cancel(),this._callback())}},{key:"isActive",value:function(){return null!=this._timer}}])&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r}(),s=new Set,l=function(e){s.add(e)},u=function(){var e=Boolean(s.size);return s.forEach((function(e){try{e.flush()}catch(e){setTimeout((function(){throw e}))}})),e}},1572:(e,t,n)=>{var r=n(4547),i=n(5935).f;n(7265)("getOwnPropertyDescriptor",(function(){return function(e,t){return i(r(e),t)}}))},1590:(e,t,n)=>{var r=n(5161),i=n(5787);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},1606:(e,t,n)=>{"use strict";n.d(t,{O2:()=>s,c0:()=>l,rG:()=>u}),n(9032);var r,i,a=/(url\()([^)]*)(\))/g,o=/(^\/[^\/])|(^#)|(^[\w-\d]*:)/;function s(e,t){if(e&&o.test(e))return e;if("//"===e)return e;if(void 0===r){r=!1;try{var n=new URL("b","http://a");n.pathname="c%20d",r="http://a/c%20d"===n.href}catch(e){}}if(t||(t=document.baseURI||window.location.href),r)try{return new URL(e,t).href}catch(t){return e}return i||((i=document.implementation.createHTMLDocument("temp")).base=i.createElement("base"),i.head.appendChild(i.base),i.anchor=i.createElement("a"),i.body.appendChild(i.anchor)),i.base.href=t,i.anchor.href=e,i.anchor.href||e}function l(e,t){return e.replace(a,(function(e,n,r,i){return n+"'"+s(r.replace(/["']/g,""),t)+"'"+i}))}function u(e){return e.substring(0,e.lastIndexOf("/")+1)}},1655:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(4547),a=n(7753).f,o={}.toString,s="object"==("undefined"==typeof window?"undefined":r(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==o.call(e)?function(e){try{return a(e)}catch(e){return s.slice()}}(e):a(i(e))}},1674:(e,t,n)=>{var r=n(2228),i=n(5161),a=n(9940),o=[].slice,s=/MSIE .\./.test(a),l=function(e){return function(t,n){var r=arguments.length>2,i=!!r&&o.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*s,{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)})},1690:(e,t,n)=>{e.exports=!n(8529)&&!n(1734)((function(){return 7!=Object.defineProperty(n(4168)("div"),"a",{get:function(){return 7}}).a}))},1727:(e,t,n)=>{var r=n(5161),i=n(2228).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},1734:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},1794:(e,t,n)=>{var r=n(5161),i=n(110),a=n(7462),o=/"/g,s=function(e,t,n,r){var i=String(a(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(o,"&quot;")+'"'),s+">"+i+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},1822:(e,t,n)=>{"use strict";var r=n(5161),i=n(9746),a=n(9940),o=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(a);r(r.P+r.F*o,"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},1846:(e,t,n)=>{n(9173),e.exports=n(1212).Array.includes},1871:(e,t,n)=>{"use strict";n(2671)("trim",(function(e){return function(){return e(this,3)}}))},1911:(e,t,n)=>{"use strict";var r=n(110),i=Date.prototype.getTime,a=Date.prototype.toISOString,o=function(e){return e>9?e:"0"+e};e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=a.call(new Date(-50000000000001))}))||!r((function(){a.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+o(e.getUTCMonth()+1)+"-"+o(e.getUTCDate())+"T"+o(e.getUTCHours())+":"+o(e.getUTCMinutes())+":"+o(e.getUTCSeconds())+"."+(n>99?n:"0"+o(n))+"Z"}:a},1978:(e,t,n)=>{"use strict";var r,i,a=n(3944),o=RegExp.prototype.exec,s=String.prototype.replace,l=o,u="lastIndex",c=(r=/a/,i=/b*/g,o.call(r,"a"),o.call(i,"a"),0!==r[u]||0!==i[u]),h=void 0!==/()??/.exec("")[1];(c||h)&&(l=function(e){var t,n,r,i,l=this;return h&&(n=new RegExp("^"+l.source+"$(?!\\s)",a.call(l))),c&&(t=l[u]),r=o.call(l,e),c&&r&&(l[u]=l.global?r.index+r[0].length:t),h&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),e.exports=l},1980:(e,t,n)=>{"use strict";n(307),n(8289),e.exports=n(1212).Promise.finally},2015:(e,t,n)=>{"use strict";n.d(t,{W:()=>_}),n(9032);var r=n(9259),i=n(6552),a=n(7555);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function l(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function c(e,t,n,r){var i=h(d(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}for(var p={},v=HTMLElement.prototype;v;){for(var m=Object.getOwnPropertyNames(v),y=0;y<m.length;y++)p[m[y]]=!0;v=Object.getPrototypeOf(v)}var g=window.trustedTypes?function(e){return trustedTypes.isHTML(e)||trustedTypes.isScript(e)||trustedTypes.isScriptURL(e)}:function(){return!1},_=(0,r.y)((function(e){var t=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=d(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,r=[{key:"_initializeProperties",value:function(){this.__dataProto&&(this._initializeProtoProperties(this.__dataProto),this.__dataProto=null),c(t,"_initializeProperties",this,3)([])}},{key:"_initializeProtoProperties",value:function(e){for(var t in e)this._setProperty(t,e[t])}},{key:"_ensureAttribute",value:function(e,t){this.hasAttribute(e)||this._valueToNodeAttribute(this,t,e)}},{key:"_serializeValue",value:function(e){if("object"===o(e)){if(e instanceof Date)return e.toString();if(e){if(g(e))return e;try{return JSON.stringify(e)}catch(e){return""}}}return c(t,"_serializeValue",this,3)([e])}},{key:"_deserializeValue",value:function(e,n){var r;switch(n){case Object:try{r=JSON.parse(e)}catch(t){r=e}break;case Array:try{r=JSON.parse(e)}catch(t){r=null,console.warn("Polymer::Attributes: couldn't decode Array as JSON: ".concat(e))}break;case Date:r=isNaN(e)?String(e):Number(e),r=new Date(r);break;default:r=c(t,"_deserializeValue",this,3)([e,n])}return r}},{key:"_definePropertyAccessor",value:function(e,n){!function(e,t){if(!p[t]){var n=e[t];void 0!==n&&(e.__data?e._setPendingProperty(t,n):(e.__dataProto?e.hasOwnProperty(JSCompiler_renameProperty("__dataProto",e))||(e.__dataProto=Object.create(e.__dataProto)):e.__dataProto={},e.__dataProto[t]=n))}}(this,e),c(t,"_definePropertyAccessor",this,3)([e,n])}},{key:"_hasAccessor",value:function(e){return this.__dataHasAccessor&&this.__dataHasAccessor[e]}},{key:"_isPropertyPending",value:function(e){return Boolean(this.__dataPending&&e in this.__dataPending)}}],a=[{key:"createPropertiesForAttributes",value:function(){for(var e=this.observedAttributes,t=0;t<e.length;t++)this.prototype._createPropertyAccessor((0,i.I)(e[t]))}},{key:"attributeNameForProperty",value:function(e){return(0,i.e)(e)}}],r&&s(n.prototype,r),a&&s(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,a}((0,a.e)(e));return t}))},2018:(e,t,n)=>{e.exports=!n(9417)&&!n(110)((function(){return 7!=Object.defineProperty(n(928)("div"),"a",{get:function(){return 7}}).a}))},2032:(e,t,n)=>{var r=n(5161),i=n(1084),a=n(4547),o=n(5935),s=n(101);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=a(e),l=o.f,u=i(r),c={},h=0;u.length>h;)void 0!==(n=l(r,t=u[h++]))&&s(c,t,n);return c}})},2098:(e,t,n)=>{var r=n(5161);r(r.P,"Array",{copyWithin:n(2204)}),n(2846)("copyWithin")},2099:(e,t,n)=>{n(2032),e.exports=n(1212).Object.getOwnPropertyDescriptors},2105:(e,t,n)=>{"use strict";var r=n(5971),i=n(939);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=u(t),function(e,t){if(t&&("object"==a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),n=t,i=[{key:"properties",get:function(){return{url:{type:String},infoName:{type:String},infoUserProperties:{type:Object,value:{}}}}}],(r=[{key:"updateInfo",value:function(){var e=this._assembleModel();void 0!==e&&this._httpRequest(this.url,this._handleHttpResponse.bind(this),void 0,this._handleHttpError.bind(this),e)}},{key:"_assembleModel",value:function(){if(void 0!==this.infoName){var e={infoProperties:{}};return e.infoProperties.name=this.infoName,void 0!==this.infoUserProperties&&(e.infoProperties.userProperties=this.infoUserProperties),this._addDataSourceProperties(e),e}this._logError(JSON.stringify({GoType:1,error:"'info-name' property must be set to the name of the info registered in the library map on the server."}))}},{key:"_handleHttpError",value:function(e){}},{key:"_handleHttpResponse",value:function(e){if(void 0!==e.info){var t={detail:JSON.parse(decodeURIComponent(e.info.replace(/\+/g,"%20")))};this.dispatchEvent(new CustomEvent("avs-go-info-response",t))}}}])&&o(n.prototype,r),i&&o(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}((0,n(606).B)((0,i.u)(r.Pu)));window.customElements.define("avs-go-info",h)},2119:(e,t,n)=>{var r=n(9337);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},2174:(e,t,n)=>{n(8115),e.exports=n(1212).String.padEnd},2204:(e,t,n)=>{"use strict";var r=n(5560),i=n(1167),a=n(3991);e.exports=[].copyWithin||function(e,t){var n=r(this),o=a(n.length),s=i(e,o),l=i(t,o),u=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===u?o:i(u,o))-l,o-s),h=1;for(l<s&&s<l+c&&(h=-1,l+=c-1,s+=c-1);c-- >0;)l in n?n[s]=n[l]:delete n[s],s+=h,l+=h;return n}},2228:e=>{var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},2236:(e,t,n)=>{var r=n(2228).parseInt,i=n(2671).trim,a=n(8129),o=/^[-+]?0[xX]/;e.exports=8!==r(a+"08")||22!==r(a+"0x16")?function(e,t){var n=i(String(e),3);return r(n,t>>>0||(o.test(n)?16:10))}:r},2268:(e,t,n)=>{var r=n(5161),i=n(3821),a=n(609),o=n(6094),s=n(7947),l=n(110),u=n(4996),c=(n(2228).Reflect||{}).construct,h=l((function(){function e(){}return!(c((function(){}),[],e)instanceof e)})),d=!l((function(){c((function(){}))}));r(r.S+r.F*(h||d),"Reflect",{construct:function(e,t){a(e),o(t);var n=arguments.length<3?e:a(arguments[2]);if(d&&!h)return c(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(u.apply(e,r))}var l=n.prototype,f=i(s(l)?l:Object.prototype),p=Function.apply.call(e,f,t);return s(p)?p:f}})},2293:(e,t,n)=>{var r=n(5161),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},2330:(e,t,n)=>{"use strict";var r=n(2228),i=n(9417),a=n(2864),o=n(7064),s=n(6271),l=n(2119),u=n(110),c=n(2490),h=n(2497),d=n(3991),f=n(1399),p=n(7753).f,v=n(4397).f,m=n(570),y=n(5462),g="ArrayBuffer",_="DataView",b="prototype",x="Wrong index!",S=r[g],w=r[_],E=r.Math,M=r.RangeError,T=r.Infinity,C=S,A=E.abs,P=E.pow,k=E.floor,O=E.log,R=E.LN2,I="buffer",N="byteLength",L="byteOffset",D=i?"_b":I,U=i?"_l":N,F=i?"_o":L;function B(e,t,n){var r,i,a,o=new Array(n),s=8*n-t-1,l=(1<<s)-1,u=l>>1,c=23===t?P(2,-24)-P(2,-77):0,h=0,d=e<0||0===e&&1/e<0?1:0;for((e=A(e))!=e||e===T?(i=e!=e?1:0,r=l):(r=k(O(e)/R),e*(a=P(2,-r))<1&&(r--,a*=2),(e+=r+u>=1?c/a:c*P(2,1-u))*a>=2&&(r++,a/=2),r+u>=l?(i=0,r=l):r+u>=1?(i=(e*a-1)*P(2,t),r+=u):(i=e*P(2,u-1)*P(2,t),r=0));t>=8;o[h++]=255&i,i/=256,t-=8);for(r=r<<t|i,s+=t;s>0;o[h++]=255&r,r/=256,s-=8);return o[--h]|=128*d,o}function z(e,t,n){var r,i=8*n-t-1,a=(1<<i)-1,o=a>>1,s=i-7,l=n-1,u=e[l--],c=127&u;for(u>>=7;s>0;c=256*c+e[l],l--,s-=8);for(r=c&(1<<-s)-1,c>>=-s,s+=t;s>0;r=256*r+e[l],l--,s-=8);if(0===c)c=1-o;else{if(c===a)return r?NaN:u?-T:T;r+=P(2,t),c-=o}return(u?-1:1)*r*P(2,c-t)}function j(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function H(e){return[255&e]}function V(e){return[255&e,e>>8&255]}function G(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function W(e){return B(e,52,8)}function X(e){return B(e,23,4)}function q(e,t,n){v(e[b],t,{get:function(){return this[n]}})}function Y(e,t,n,r){var i=f(+n);if(i+t>e[U])throw M(x);var a=e[D]._b,o=i+e[F],s=a.slice(o,o+t);return r?s:s.reverse()}function J(e,t,n,r,i,a){var o=f(+n);if(o+t>e[U])throw M(x);for(var s=e[D]._b,l=o+e[F],u=r(+i),c=0;c<t;c++)s[l+c]=u[a?c:t-c-1]}if(o.ABV){if(!u((function(){S(1)}))||!u((function(){new S(-1)}))||u((function(){return new S,new S(1.5),new S(NaN),S.name!=g}))){for(var Z,K=(S=function(e){return c(this,S),new C(f(e))})[b]=C[b],$=p(C),Q=0;$.length>Q;)(Z=$[Q++])in S||s(S,Z,C[Z]);a||(K.constructor=S)}var ee=new w(new S(2)),te=w[b].setInt8;ee.setInt8(0,2147483648),ee.setInt8(1,2147483649),!ee.getInt8(0)&&ee.getInt8(1)||l(w[b],{setInt8:function(e,t){te.call(this,e,t<<24>>24)},setUint8:function(e,t){te.call(this,e,t<<24>>24)}},!0)}else S=function(e){c(this,S,g);var t=f(e);this._b=m.call(new Array(t),0),this[U]=t},w=function(e,t,n){c(this,w,_),c(e,S,_);var r=e[U],i=h(t);if(i<0||i>r)throw M("Wrong offset!");if(i+(n=void 0===n?r-i:d(n))>r)throw M("Wrong length!");this[D]=e,this[F]=i,this[U]=n},i&&(q(S,N,"_l"),q(w,I,"_b"),q(w,N,"_l"),q(w,L,"_o")),l(w[b],{getInt8:function(e){return Y(this,1,e)[0]<<24>>24},getUint8:function(e){return Y(this,1,e)[0]},getInt16:function(e){var t=Y(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Y(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return j(Y(this,4,e,arguments[1]))},getUint32:function(e){return j(Y(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return z(Y(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return z(Y(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){J(this,1,e,H,t)},setUint8:function(e,t){J(this,1,e,H,t)},setInt16:function(e,t){J(this,2,e,V,t,arguments[2])},setUint16:function(e,t){J(this,2,e,V,t,arguments[2])},setInt32:function(e,t){J(this,4,e,G,t,arguments[2])},setUint32:function(e,t){J(this,4,e,G,t,arguments[2])},setFloat32:function(e,t){J(this,4,e,X,t,arguments[2])},setFloat64:function(e,t){J(this,8,e,W,t,arguments[2])}});y(S,g),y(w,_),s(w[b],o.VIEW,!0),t[g]=S,t[_]=w},2352:(e,t,n)=>{"use strict";var r=n(5161),i=n(5560),a=n(4142);r(r.P+r.F*n(110)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(e){var t=i(this),n=a(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},2381:(e,t,n)=>{var r=n(8319),i=n(5560),a=n(9788)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},2395:(e,t,n)=>{var r=n(4171);e.exports=Array.isArray||function(e){return"Array"==r(e)}},2406:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},2454:(e,t,n)=>{var r=n(7947);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},2490:e=>{e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},2497:e=>{var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},2613:(e,t,n)=>{"use strict";n(1794)("blink",(function(e){return function(){return e(this,"blink","","")}}))},2636:(e,t,n)=>{"use strict";var r=n(5161),i=n(7064),a=n(2330),o=n(6094),s=n(1167),l=n(3991),u=n(7947),c=n(2228).ArrayBuffer,h=n(6816),d=a.ArrayBuffer,f=a.DataView,p=i.ABV&&c.isView,v=d.prototype.slice,m=i.VIEW,y="ArrayBuffer";r(r.G+r.W+r.F*(c!==d),{ArrayBuffer:d}),r(r.S+r.F*!i.CONSTR,y,{isView:function(e){return p&&p(e)||u(e)&&m in e}}),r(r.P+r.U+r.F*n(110)((function(){return!new d(2).slice(1,void 0).byteLength})),y,{slice:function(e,t){if(void 0!==v&&void 0===t)return v.call(o(this),e);for(var n=o(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),a=new(h(this,d))(l(i-r)),u=new f(this),c=new f(a),p=0;r<i;)c.setUint8(p++,u.getUint8(r++));return a}}),n(8544)(y)},2659:(e,t,n)=>{var r=n(5161);r(r.P,"Function",{bind:n(4996)})},2670:(e,t,n)=>{"use strict";var r=n(5161),i=n(9705)(4);r(r.P+r.F*!n(938)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},2671:(e,t,n)=>{var r=n(5161),i=n(7462),a=n(110),o=n(8129),s="["+o+"]",l=RegExp("^"+s+s+"*"),u=RegExp(s+s+"*$"),c=function(e,t,n){var i={},s=a((function(){return!!o[e]()||"​…"!="​…"[e]()})),l=i[e]=s?t(h):o[e];n&&(i[n]=l),r(r.P+r.F*s,"String",i)},h=c.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(l,"")),2&t&&(e=e.replace(u,"")),e};e.exports=c},2690:(e,t,n)=>{var r=n(7947),i=n(4286).onFreeze;n(7265)("preventExtensions",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},2730:(e,t,n)=>{var r=n(8360),i=n(5440)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[i]===e)}},2793:(e,t,n)=>{var r=n(5161),i=n(2236);r(r.G+r.F*(parseInt!=i),{parseInt:i})},2846:(e,t,n)=>{var r=n(5440)("unscopables"),i=Array.prototype;null==i[r]&&n(6271)(i,r,{}),e.exports=function(e){i[r][e]=!0}},2864:e=>{e.exports=!1},2880:(e,t,n)=>{"use strict";var r=n(5602),i={};i[n(5440)("toStringTag")]="z",i+""!="[object z]"&&n(9337)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},2960:(e,t,n)=>{var r=n(5161);r(r.P,"Array",{fill:n(570)}),n(2846)("fill")},2980:(e,t,n)=>{var r=n(5161);r(r.S+r.F,"Object",{assign:n(9324)})},2988:(e,t,n)=>{n(7495)("Int32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},3039:(e,t,n)=>{"use strict";var r=n(5161),i=n(3814)(!1),a=[].indexOf,o=!!a&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(o||!n(938)(a)),"Array",{indexOf:function(e){return o?a.apply(this,arguments)||0:i(this,e,arguments[1])}})},3100:(e,t,n)=>{var r=n(5161),i=n(2236);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},3116:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(2228),a=n(8319),o=n(9417),s=n(5161),l=n(9337),u=n(4286).KEY,c=n(110),h=n(3134),d=n(5462),f=n(4317),p=n(5440),v=n(5002),m=n(9318),y=n(5619),g=n(2395),_=n(6094),b=n(7947),x=n(5560),S=n(4547),w=n(4142),E=n(9142),M=n(3821),T=n(1655),C=n(5935),A=n(7598),P=n(4397),k=n(7029),O=C.f,R=P.f,I=T.f,N=i.Symbol,L=i.JSON,D=L&&L.stringify,U="prototype",F=p("_hidden"),B=p("toPrimitive"),z={}.propertyIsEnumerable,j=h("symbol-registry"),H=h("symbols"),V=h("op-symbols"),G=Object[U],W="function"==typeof N&&!!A.f,X=i.QObject,q=!X||!X[U]||!X[U].findChild,Y=o&&c((function(){return 7!=M(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=O(G,t);r&&delete G[t],R(e,t,n),r&&e!==G&&R(G,t,r)}:R,J=function(e){var t=H[e]=M(N[U]);return t._k=e,t},Z=W&&"symbol"==r(N.iterator)?function(e){return"symbol"==r(e)}:function(e){return e instanceof N},K=function(e,t,n){return e===G&&K(V,t,n),_(e),t=w(t,!0),_(n),a(H,t)?(n.enumerable?(a(e,F)&&e[F][t]&&(e[F][t]=!1),n=M(n,{enumerable:E(0,!1)})):(a(e,F)||R(e,F,E(1,{})),e[F][t]=!0),Y(e,t,n)):R(e,t,n)},$=function(e,t){_(e);for(var n,r=y(t=S(t)),i=0,a=r.length;a>i;)K(e,n=r[i++],t[n]);return e},Q=function(e){var t=z.call(this,e=w(e,!0));return!(this===G&&a(H,e)&&!a(V,e))&&(!(t||!a(this,e)||!a(H,e)||a(this,F)&&this[F][e])||t)},ee=function(e,t){if(e=S(e),t=w(t,!0),e!==G||!a(H,t)||a(V,t)){var n=O(e,t);return!n||!a(H,t)||a(e,F)&&e[F][t]||(n.enumerable=!0),n}},te=function(e){for(var t,n=I(S(e)),r=[],i=0;n.length>i;)a(H,t=n[i++])||t==F||t==u||r.push(t);return r},ne=function(e){for(var t,n=e===G,r=I(n?V:S(e)),i=[],o=0;r.length>o;)!a(H,t=r[o++])||n&&!a(G,t)||i.push(H[t]);return i};W||(l((N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===G&&t.call(V,n),a(this,F)&&a(this[F],e)&&(this[F][e]=!1),Y(this,e,E(1,n))};return o&&q&&Y(G,e,{configurable:!0,set:t}),J(e)})[U],"toString",(function(){return this._k})),C.f=ee,P.f=K,n(7753).f=T.f=te,n(4195).f=Q,A.f=ne,o&&!n(2864)&&l(G,"propertyIsEnumerable",Q,!0),v.f=function(e){return J(p(e))}),s(s.G+s.W+s.F*!W,{Symbol:N});for(var re="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ie=0;re.length>ie;)p(re[ie++]);for(var ae=k(p.store),oe=0;ae.length>oe;)m(ae[oe++]);s(s.S+s.F*!W,"Symbol",{for:function(e){return a(j,e+="")?j[e]:j[e]=N(e)},keyFor:function(e){if(!Z(e))throw TypeError(e+" is not a symbol!");for(var t in j)if(j[t]===e)return t},useSetter:function(){q=!0},useSimple:function(){q=!1}}),s(s.S+s.F*!W,"Object",{create:function(e,t){return void 0===t?M(e):$(M(e),t)},defineProperty:K,defineProperties:$,getOwnPropertyDescriptor:ee,getOwnPropertyNames:te,getOwnPropertySymbols:ne});var se=c((function(){A.f(1)}));s(s.S+s.F*se,"Object",{getOwnPropertySymbols:function(e){return A.f(x(e))}}),L&&s(s.S+s.F*(!W||c((function(){var e=N();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(b(t)||void 0!==e)&&!Z(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Z(t))return t}),r[1]=t,D.apply(L,r)}}),N[U][B]||n(6271)(N[U],B,N[U].valueOf),d(N,"Symbol"),d(Math,"Math",!0),d(i.JSON,"JSON",!0)},3118:(e,t,n)=>{var r=n(5161),i=n(5935).f,a=n(6094);r(r.S,"Reflect",{deleteProperty:function(e,t){var n=i(a(e),t);return!(n&&!n.configurable)&&delete e[t]}})},3129:(e,t,n)=>{var r=n(5161);r(r.S,"Reflect",{has:function(e,t){return t in e}})},3134:(e,t,n)=>{var r=n(1212),i=n(2228),a="__core-js_shared__",o=i[a]||(i[a]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(2864)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},3210:(e,t,n)=>{var r=n(5161);r(r.S,"Object",{setPrototypeOf:n(9584).set})},3217:(e,t,n)=>{"use strict";n(1794)("sub",(function(e){return function(){return e(this,"sub","","")}}))},3226:(e,t,n)=>{"use strict";n(8948);var r=n(6094),i=n(3944),a=n(9417),o="toString",s=/./[o],l=function(e){n(9337)(RegExp.prototype,o,e,!0)};n(110)((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?l((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!a&&e instanceof RegExp?i.call(e):void 0)})):s.name!=o&&l((function(){return s.call(this)}))},3261:(e,t,n)=>{"use strict";function r(){}n.d(t,{cn:()=>r,kz:()=>a});var i=[];function a(e){i.push(e)}},3262:(e,t,n)=>{"use strict";var r=n(5323),i=n(2454);e.exports=n(859)("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},3342:(e,t,n)=>{var r,i,a,o=n(7102),s=n(8719),l=n(5086),u=n(928),c=n(2228),h=c.process,d=c.setImmediate,f=c.clearImmediate,p=c.MessageChannel,v=c.Dispatch,m=0,y={},g="onreadystatechange",_=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},b=function(e){_.call(e.data)};d&&f||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return y[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},f=function(e){delete y[e]},"process"==n(4171)(h)?r=function(e){h.nextTick(o(_,e,1))}:v&&v.now?r=function(e){v.now(o(_,e,1))}:p?(a=(i=new p).port2,i.port1.onmessage=b,r=o(a.postMessage,a,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r=g in u("script")?function(e){l.appendChild(u("script"))[g]=function(){l.removeChild(this),_.call(e)}}:function(e){setTimeout(o(_,e,1),0)}),e.exports={set:d,clear:f}},3367:e=>{e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},3381:(e,t,n)=>{"use strict";n(1794)("big",(function(e){return function(){return e(this,"big","","")}}))},3425:(e,t,n)=>{"use strict";var r=n(5161),i=n(2497),a=n(7964),o=n(6424),s=1..toFixed,l=Math.floor,u=[0,0,0,0,0,0],c="Number.toFixed: incorrect invocation!",h="0",d=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*u[n],u[n]=r%1e7,r=l(r/1e7)},f=function(e){for(var t=6,n=0;--t>=0;)n+=u[t],u[t]=l(n/e),n=n%e*1e7},p=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==u[e]){var n=String(u[e]);t=""===t?n:t+o.call(h,7-n.length)+n}return t},v=function(e,t,n){return 0===t?n:t%2==1?v(e,t-1,n*e):v(e*e,t/2,n)};r(r.P+r.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(110)((function(){s.call({})}))),"Number",{toFixed:function(e){var t,n,r,s,l=a(this,c),u=i(e),m="",y=h;if(u<0||u>20)throw RangeError(c);if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(m="-",l=-l),l>1e-21)if(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(l*v(2,69,1))-69,n=t<0?l*v(2,-t,1):l/v(2,t,1),n*=4503599627370496,(t=52-t)>0){for(d(0,n),r=u;r>=7;)d(1e7,0),r-=7;for(d(v(10,r,1),0),r=t-1;r>=23;)f(1<<23),r-=23;f(1<<r),d(1,1),f(2),y=p()}else d(0,n),d(1<<-t,0),y=p()+o.call(h,u);return u>0?m+((s=y.length)<=u?"0."+o.call(h,u-s)+y:y.slice(0,s-u)+"."+y.slice(s-u)):m+y}})},3438:(e,t,n)=>{"use strict";n.d(t,{q2:()=>k,IS:()=>P}),n(9032);var r=n(7925),i=n(9259),a=n(9507),o=n(1606),s=n(6705),l=n(3764),u=n(3261),c=n(7555);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function v(e,t,n,r){var i=m(y(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},m.apply(null,arguments)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}var _=(0,i.y)((function(e){function t(e){var t=Object.getPrototypeOf(e);return t.prototype instanceof r?t:null}function n(e){if(!e.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",e))){var t=null;if(e.hasOwnProperty(JSCompiler_renameProperty("properties",e))){var n=e.properties;n&&(t=function(e){var t={};for(var n in e){var r=e[n];t[n]="function"==typeof r?{type:r}:r}return t}(n))}e.__ownProperties=t}return e.__ownProperties}var r=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),function(e,t,n){return t=y(t),function(e,t){if(t&&("object"==h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(r,e),i=r,o=[{key:"observedAttributes",get:function(){var e=this;if(!this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))){(0,u.kz)(this.prototype);var t=this._properties;this.__observedAttributes=t?Object.keys(t).map((function(t){return e.prototype._addPropertyToAttributeMap(t)})):[]}return this.__observedAttributes}},{key:"finalize",value:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__finalized",this))){var e=t(this);e&&e.finalize(),this.__finalized=!0,this._finalizeClass()}}},{key:"_finalizeClass",value:function(){var e=n(this);e&&this.createProperties(e)}},{key:"_properties",get:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__properties",this))){var e=t(this);this.__properties=Object.assign({},e&&e._properties,n(this))}return this.__properties}},{key:"typeForProperty",value:function(e){var t=this._properties[e];return t&&t.type}}],(a=[{key:"_initializeProperties",value:function(){(0,u.cn)(),this.constructor.finalize(),v(r,"_initializeProperties",this,3)([])}},{key:"connectedCallback",value:function(){v(r,"connectedCallback",this,1)&&v(r,"connectedCallback",this,3)([]),this._enableProperties()}},{key:"disconnectedCallback",value:function(){v(r,"disconnectedCallback",this,1)&&v(r,"disconnectedCallback",this,3)([])}}])&&d(i.prototype,a),o&&d(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,a,o}((0,c.e)(e));return r})),b=n(5572);function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function S(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w(r.key),r)}}function w(e){var t=function(e){if("object"!=x(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==x(t)?t:t+""}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(E=function(){return!!e})()}function M(e,t,n,r){var i=T(C(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function T(){return T="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=C(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},T.apply(null,arguments)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}var P=window.ShadyCSS&&window.ShadyCSS.cssBuild,k=(0,i.y)((function(e){var t=_((0,l.s)(e)),n=function(e){function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=function(e,t,n){return t=C(t),function(e,t){if(t&&("object"==x(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,E()?Reflect.construct(t,n||[],C(e).constructor):t.apply(e,n))}(this,n))._template,e._importPath,e.rootPath,e.importPath,e.root,e.$,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(n,e),i=n,l=[{key:"_initializeProperties",value:function(){this.constructor.finalize(),this.constructor._finalizeTemplate(this.localName),M(n,"_initializeProperties",this,3)([]),this.rootPath=r.wA,this.importPath=this.constructor.importPath;var e=function(e){if(!e.hasOwnProperty(JSCompiler_renameProperty("__propertyDefaults",e))){e.__propertyDefaults=null;var t=e._properties;for(var n in t){var r=t[n];"value"in r&&(e.__propertyDefaults=e.__propertyDefaults||{},e.__propertyDefaults[n]=r)}}return e.__propertyDefaults}(this.constructor);if(e)for(var t in e){var i=e[t];if(this._canApplyPropertyDefault(t)){var a="function"==typeof i.value?i.value.call(this):i.value;this._hasAccessor(t)?this._setPendingProperty(t,a,!0):this[t]=a}}}},{key:"_canApplyPropertyDefault",value:function(e){return!this.hasOwnProperty(e)}},{key:"connectedCallback",value:function(){window.ShadyCSS&&this._template&&window.ShadyCSS.styleElement(this),M(n,"connectedCallback",this,3)([])}},{key:"ready",value:function(){this._template&&(this.root=this._stampTemplate(this._template),this.$=this.root.$),M(n,"ready",this,3)([])}},{key:"_readyClients",value:function(){this._template&&(this.root=this._attachDom(this.root)),M(n,"_readyClients",this,3)([])}},{key:"_attachDom",value:function(e){var t=(0,b.L)(this);if(t.attachShadow)return e?(t.shadowRoot||(t.attachShadow({mode:"open",shadyUpgradeFragment:e}),t.shadowRoot.appendChild(e),this.constructor._styleSheet&&(t.shadowRoot.adoptedStyleSheets=[this.constructor._styleSheet])),r.Kp&&window.ShadyDOM&&window.ShadyDOM.flushInitial(t.shadowRoot),t.shadowRoot):null;throw new Error("ShadowDOM not available. PolymerElement can create dom as children instead of in ShadowDOM by setting `this.root = this;` before `ready`.")}},{key:"updateStyles",value:function(e){window.ShadyCSS&&window.ShadyCSS.styleSubtree(this,e)}},{key:"resolveUrl",value:function(e,t){return!t&&this.importPath&&(t=(0,o.O2)(this.importPath)),(0,o.O2)(e,t)}}],u=[{key:"polymerElementVersion",get:function(){return"3.5.2"}},{key:"_finalizeClass",value:function(){t._finalizeClass.call(this);var e,n=((e=this).hasOwnProperty(JSCompiler_renameProperty("__ownObservers",e))||(e.__ownObservers=e.hasOwnProperty(JSCompiler_renameProperty("observers",e))?e.observers:null),e.__ownObservers);n&&this.createObservers(n,this._properties),this._prepareTemplate()}},{key:"_prepareTemplate",value:function(){var e=this.template;e&&("string"==typeof e?(console.error("template getter must return HTMLTemplateElement"),e=null):r.IP||(e=e.cloneNode(!0))),this.prototype._template=e}},{key:"createProperties",value:function(e){for(var t in e)n=this.prototype,r=t,a=e,(i=e[t]).computed&&(i.readOnly=!0),i.computed&&(n._hasReadOnlyEffect(r)?console.warn("Cannot redefine computed property '".concat(r,"'.")):n._createComputedProperty(r,i.computed,a)),i.readOnly&&!n._hasReadOnlyEffect(r)?n._createReadOnlyProperty(r,!i.computed):!1===i.readOnly&&n._hasReadOnlyEffect(r)&&console.warn("Cannot make readOnly property '".concat(r,"' non-readOnly.")),i.reflectToAttribute&&!n._hasReflectEffect(r)?n._createReflectedProperty(r):!1===i.reflectToAttribute&&n._hasReflectEffect(r)&&console.warn("Cannot make reflected property '".concat(r,"' non-reflected.")),i.notify&&!n._hasNotifyEffect(r)?n._createNotifyingProperty(r):!1===i.notify&&n._hasNotifyEffect(r)&&console.warn("Cannot make notify property '".concat(r,"' non-notify.")),i.observer&&n._createPropertyObserver(r,i.observer,a[i.observer]),n._addPropertyToAttributeMap(r);var n,r,i,a}},{key:"createObservers",value:function(e,t){for(var n=this.prototype,r=0;r<e.length;r++)n._createMethodObserver(e[r],t)}},{key:"template",get:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_template",this))){var e=this.prototype.hasOwnProperty(JSCompiler_renameProperty("_template",this.prototype))?this.prototype._template:void 0;"function"==typeof e&&(e=e()),this._template=void 0!==e?e:this.hasOwnProperty(JSCompiler_renameProperty("is",this))&&function(e){var t=null;if(e&&(!r.yu||r.ek)&&(t=s.$.import(e,"template"),r.yu&&!t))throw new Error("strictTemplatePolicy: expecting dom-module or null template for ".concat(e));return t}(this.is)||Object.getPrototypeOf(this.prototype).constructor.template}return this._template},set:function(e){this._template=e}},{key:"importPath",get:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_importPath",this))){var e=this.importMeta;if(e)this._importPath=(0,o.rG)(e.url);else{var t=s.$.import(this.is);this._importPath=t&&t.assetpath||Object.getPrototypeOf(this.prototype).constructor.importPath}}return this._importPath}},{key:"_processStyleText",value:function(e,t){return(0,o.c0)(e,t)}},{key:"_finalizeTemplate",value:function(e){var t=this.prototype._template;if(t&&!t.__polymerFinalized){t.__polymerFinalized=!0;var n=this.importPath;!function(e,t,n,i){if(!P){for(var o=t.content.querySelectorAll("style"),s=(0,a.nX)(t),l=(0,a.Ho)(n),u=t.content.firstElementChild,c=0;c<l.length;c++){var h=l[c];h.textContent=e._processStyleText(h.textContent,i),t.content.insertBefore(h,u)}for(var d=0,f=0;f<s.length;f++){var p=s[f],v=o[d];v!==p?(p=p.cloneNode(!0),v.parentNode.insertBefore(p,v)):d++,p.textContent=e._processStyleText(p.textContent,i)}}if(window.ShadyCSS&&window.ShadyCSS.prepareTemplate(t,n),r.vK&&P&&r.qM){var m=t.content.querySelectorAll("style");if(m){var y="";Array.from(m).forEach((function(e){y+=e.textContent,e.parentNode.removeChild(e)})),e._styleSheet=new CSSStyleSheet,e._styleSheet.replaceSync(y)}}}(this,t,e,n?(0,o.O2)(n):""),this.prototype._bindTemplate(t)}}},{key:"_parseTemplateContent",value:function(e,n,r){return n.dynamicFns=n.dynamicFns||this._properties,t._parseTemplateContent.call(this,e,n,r)}},{key:"_addTemplatePropertyEffect",value:function(e,n,i){return!r.F3||n in this._properties||i.info.part.signature&&i.info.part.signature.static||i.info.part.hostProp||e.nestedTemplate||console.warn("Property '".concat(n,"' used in template but not declared in 'properties'; ")+"attribute will not be observed."),t._addTemplatePropertyEffect.call(this,e,n,i)}}],l&&S(i.prototype,l),u&&S(i,u),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,l,u}(t);return n}))},3439:(e,t,n)=>{var r=n(4397).f,i=Function.prototype,a=/^\s*function ([^ (]*)/,o="name";o in i||n(9417)&&r(i,o,{configurable:!0,get:function(){try{return(""+this).match(a)[1]}catch(e){return""}}})},3485:(e,t,n)=>{n(9502),e.exports=n(5002).f("asyncIterator")},3596:(e,t,n)=>{var r=n(5161),i=n(5881),a=Math.exp;r(r.S+r.F*n(110)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(a(e-1)-a(-e-1))*(Math.E/2)}})},3666:(e,t,n)=>{var r=n(7947);n(7265)("isSealed",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},3718:(e,t,n)=>{var r=n(5161),i=n(8252),a=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&a(e)<=9007199254740991}})},3754:(e,t,n)=>{var r=n(5161);r(r.S+r.F*!n(9417),"Object",{defineProperties:n(8840)})},3764:(e,t,n)=>{"use strict";n.d(t,{s:()=>pe}),n(9032);var r=n(5572),i=n(9259),a=n(8023),o=n(6552),s=n(2015);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var p={"dom-if":!0,"dom-repeat":!0},v=!1,m=!1;var y,g=(y=window.trustedTypes&&window.trustedTypes.createPolicy("polymer-template-event-attribute-policy",{createScript:function(e){return e}}),function(e,t,n){var r=t.getAttribute(n);y&&n.startsWith("on-")?e.setAttribute(n,y.createScript(r,n)):e.setAttribute(n,r)});function _(e){var t=e.getAttribute("is");if(t&&p[t]){var n=e;for(n.removeAttribute("is"),e=n.ownerDocument.createElement(t),n.parentNode.replaceChild(e,n),e.appendChild(n);n.attributes.length;){var r=n.attributes[0].name;g(e,n,r),n.removeAttribute(r)}}return e}function b(e,t){var n=t.parentInfo&&b(e,t.parentInfo);if(!n)return e;for(var r=n.firstChild,i=0;r;r=r.nextSibling)if(t.parentIndex===i++)return r}function x(e,t,n,r){r.id&&(t[r.id]=n)}function S(e,t,n){if(n.events&&n.events.length)for(var r,i=0,a=n.events;i<a.length&&(r=a[i]);i++)e._addMethodEventListenerToNode(t,r.name,r.value,e)}function w(e,t,n,r){n.templateInfo&&(t._templateInfo=n.templateInfo,t._parentTemplateInfo=r)}var E=(0,i.y)((function(e){var t=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=d(t),function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,r=[{key:"_stampTemplate",value:function(e,t){e&&!e.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(e);var n=(t=t||this.constructor._parseTemplate(e)).nodeInfoList,r=t.content||e.content,i=document.importNode(r,!0);i.__noInsertionPoint=!t.hasInsertionPoint;var a=i.nodeList=new Array(n.length);i.$={};for(var o,s=0,l=n.length;s<l&&(o=n[s]);s++){var u=a[s]=b(i,o);x(0,i.$,u,o),w(0,u,o,t),S(this,u,o)}return i}},{key:"_addMethodEventListenerToNode",value:function(e,t,n,r){var i=function(e,t,n){return e=e._methodHost||e,function(t){e[n]?e[n](t,t.detail):console.warn("listener method `"+n+"` not defined")}}(r=r||e,0,n);return this._addEventListenerToNode(e,t,i),i}},{key:"_addEventListenerToNode",value:function(e,t,n){e.addEventListener(t,n)}},{key:"_removeEventListenerFromNode",value:function(e,t,n){e.removeEventListener(t,n)}}],i=[{key:"_parseTemplate",value:function(e,t){if(!e._templateInfo){var n=e._templateInfo={};n.nodeInfoList=[],n.nestedTemplate=Boolean(t),n.stripWhiteSpace=t&&t.stripWhiteSpace||e.hasAttribute&&e.hasAttribute("strip-whitespace"),this._parseTemplateContent(e,n,{parent:null})}return e._templateInfo}},{key:"_parseTemplateContent",value:function(e,t,n){return this._parseTemplateNode(e.content,t,n)}},{key:"_parseTemplateNode",value:function(e,t,n){var r=!1,i=e;return"template"!=i.localName||i.hasAttribute("preserve-content")?"slot"===i.localName&&(t.hasInsertionPoint=!0):r=this._parseTemplateNestedTemplate(i,t,n)||r,function(e){(function(){if(!v){v=!0;var e=document.createElement("textarea");e.placeholder="a",m=e.placeholder===e.textContent}return m})()&&"textarea"===e.localName&&e.placeholder&&e.placeholder===e.textContent&&(e.textContent=null)}(i),i.firstChild&&this._parseTemplateChildNodes(i,t,n),i.hasAttributes&&i.hasAttributes()&&(r=this._parseTemplateNodeAttributes(i,t,n)||r),r||n.noted}},{key:"_parseTemplateChildNodes",value:function(e,t,n){if("script"!==e.localName&&"style"!==e.localName)for(var r,i=e.firstChild,a=0;i;i=r){if("template"==i.localName&&(i=_(i)),r=i.nextSibling,i.nodeType===Node.TEXT_NODE){for(var o=r;o&&o.nodeType===Node.TEXT_NODE;)i.textContent+=o.textContent,r=o.nextSibling,e.removeChild(o),o=r;if(t.stripWhiteSpace&&!i.textContent.trim()){e.removeChild(i);continue}}var s={parentIndex:a,parentInfo:n};this._parseTemplateNode(i,t,s)&&(s.infoIndex=t.nodeInfoList.push(s)-1),i.parentNode&&a++}}},{key:"_parseTemplateNestedTemplate",value:function(e,t,n){var r=e,i=this._parseTemplate(r,t);return(i.content=r.content.ownerDocument.createDocumentFragment()).appendChild(r.content),n.templateInfo=i,!0}},{key:"_parseTemplateNodeAttributes",value:function(e,t,n){for(var r,i=!1,a=Array.from(e.attributes),o=a.length-1;r=a[o];o--)i=this._parseTemplateNodeAttribute(e,t,n,r.name,r.value)||i;return i}},{key:"_parseTemplateNodeAttribute",value:function(e,t,n,r,i){return"on-"===r.slice(0,3)?(e.removeAttribute(r),n.events=n.events||[],n.events.push({name:r.slice(3),value:i}),!0):"id"===r&&(n.id=i,!0)}},{key:"_contentForTemplate",value:function(e){var t=e._templateInfo;return t&&t.content||e.content}}],r&&u(n.prototype,r),i&&u(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(e);return t})),M=n(7925);function T(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C(r.key),r)}}function C(e){var t=function(e){if("object"!=I(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==I(t)?t:t+""}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(A=function(){return!!e})()}function P(e,t,n,r){var i=k(O(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},k.apply(null,arguments)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}var N=0,L=[],D={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},U="__computeInfo",F=/[A-Z]/;function B(e,t,n){var r=e[t];if(r){if(!e.hasOwnProperty(t)&&(r=e[t]=Object.create(e[t]),n))for(var i in r)for(var a=r[i],o=r[i]=Array(a.length),s=0;s<a.length;s++)o[s]=a[s]}else r=e[t]={};return r}function z(e,t,n,r,i,o){if(t){var s=!1,l=N++;for(var u in n){var c=t[i?(0,a.zr)(u):u];if(c)for(var h,d=0,f=c.length;d<f&&(h=c[d]);d++)h.info&&h.info.lastRun===l||i&&!H(u,h.trigger)||(h.info&&(h.info.lastRun=l),h.fn(e,u,n,r,h.info,i,o),s=!0)}return s}return!1}function j(e,t,n,r,i,o,s,l){var u=!1,c=t[s?(0,a.zr)(r):r];if(c)for(var h,d=0,f=c.length;d<f&&(h=c[d]);d++)h.info&&h.info.lastRun===n||s&&!H(r,h.trigger)||(h.info&&(h.info.lastRun=n),h.fn(e,r,i,o,h.info,s,l),u=!0);return u}function H(e,t){if(t){var n=t.name;return n==e||!(!t.structured||!(0,a.QX)(n,e))||!(!t.wildcard||!(0,a.K9)(n,e))}return!0}function V(e,t,n,r,i){var a="string"==typeof i.method?e[i.method]:i.method,o=i.property;a?a.call(e,e.__data[o],r[o]):i.dynamicFn||console.warn("observer method `"+i.method+"` not defined")}function G(e,t,n){var r=(0,a.zr)(t);return r!==t&&(W(e,(0,o.e)(r)+"-changed",n[t],t),!0)}function W(e,t,n,i){var a={value:n,queueProperty:!0};i&&(a.path=i),(0,r.L)(e).dispatchEvent(new CustomEvent(t,{detail:a}))}function X(e,t,n,r,i,o){var s=(o?(0,a.zr)(t):t)!=t?t:null,l=s?(0,a.Jt)(e,s):e.__data[t];s&&void 0===l&&(l=n[t]),W(e,i.eventName,l,s)}function q(e,t,n,r,i){var a=e.__data[t];M.dV&&(a=(0,M.dV)(a,i.attrName,"attribute",e)),e._propertyToAttribute(t,i.attrName,a)}var Y=function(e,t,n){for(var r=0,i=t.length-1,a=-1;r<=i;){var o=r+i>>1,s=n.get(t[o].methodInfo)-n.get(e.methodInfo);if(s<0)r=o+1;else{if(!(s>0)){a=o;break}i=o-1}}a<0&&(a=i+1),t.splice(a,0,e)},J=function(e,t,n,r,i){var o=t[i?(0,a.zr)(e):e];if(o)for(var s=0;s<o.length;s++){var l=o[s];l.info.lastRun===N||i&&!H(e,l.trigger)||(l.info.lastRun=N,Y(l.info,n,r))}};function Z(e,t,n,r,i){var a=re(e,t,n,0,i);if(a===L)return!1;var o=i.methodInfo;return e.__dataHasAccessor&&e.__dataHasAccessor[o]?e._setPendingProperty(o,a,!0):(e[o]=a,!1)}function K(e,t,n,r,i,a,s){n.bindings=n.bindings||[];var l={kind:r,target:i,parts:a,literal:s,isCompound:1!==a.length};if(n.bindings.push(l),function(e){return Boolean(e.target)&&"attribute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode}(l)){var u=l.parts[0],c=u.event,h=u.negate;l.listenerEvent=c||(0,o.e)(i)+"-changed",l.listenerNegate=h}for(var d=t.nodeInfoList.length,f=0;f<l.parts.length;f++){var p=l.parts[f];p.compoundIndex=f,$(e,t,l,p,d)}}function $(e,t,n,r,i){if(!r.literal)if("attribute"===n.kind&&"-"===n.target[0])console.warn("Cannot set attribute "+n.target+' because "-" is not a valid attribute starting character');else for(var a=r.dependencies,o={index:i,binding:n,part:r,evaluator:e},s=0;s<a.length;s++){var l=a[s];"string"==typeof l&&((l=ce(l)).wildcard=!0),e._addTemplatePropertyEffect(t,l.rootProperty,{fn:Q,info:o,trigger:l})}}function Q(e,t,n,r,i,o,s){var l=s[i.index],u=i.binding,c=i.part;if(o&&c.source&&t.length>c.source.length&&"property"==u.kind&&!u.isCompound&&l.__isPropertyEffectsClient&&l.__dataHasAccessor&&l.__dataHasAccessor[u.target]){var h=n[t];t=(0,a.Tl)(c.source,u.target,t),l._setPendingPropertyOrPath(t,h,!1,!0)&&e._enqueueClient(l)}else{var d=i.evaluator._evaluateBinding(e,c,t,n,r,o);d!==L&&function(e,t,n,r,i){if(i=function(e,t,n,r){if(n.isCompound){var i=e.__dataCompoundStorage[n.target];i[r.compoundIndex]=t,t=i.join("")}return"attribute"!==n.kind&&("textContent"!==n.target&&("value"!==n.target||"input"!==e.localName&&"textarea"!==e.localName)||(t=null==t?"":t)),t}(t,i,n,r),M.dV&&(i=(0,M.dV)(i,n.target,n.kind,t)),"attribute"==n.kind)e._valueToNodeAttribute(t,i,n.target);else{var a=n.target;t.__isPropertyEffectsClient&&t.__dataHasAccessor&&t.__dataHasAccessor[a]?t[D.READ_ONLY]&&t[D.READ_ONLY][a]||t._setPendingProperty(a,i)&&e._enqueueClient(t):e._setUnmanagedPropertyToNode(t,a,i)}}(e,l,u,c,d)}}function ee(e,t){if(t.isCompound){for(var n=e.__dataCompoundStorage||(e.__dataCompoundStorage={}),i=t.parts,a=new Array(i.length),o=0;o<i.length;o++)a[o]=i[o].literal;var s=t.target;n[s]=a,t.literal&&"property"==t.kind&&("className"===s&&(e=(0,r.L)(e)),e[s]=t.literal)}}function te(e,t,n){if(n.listenerEvent){var r=n.parts[0];e.addEventListener(n.listenerEvent,(function(e){!function(e,t,n,r,i){var o,s=e.detail,l=s&&s.path;l?(r=(0,a.Tl)(n,r,l),o=s&&s.value):o=e.currentTarget[n],o=i?!o:o,t[D.READ_ONLY]&&t[D.READ_ONLY][r]||!t._setPendingPropertyOrPath(r,o,!0,Boolean(l))||s&&s.queueProperty||t._invalidateProperties()}(e,t,n.target,r.source,r.negate)}))}}function ne(e,t,n,r,i,a){a=t.static||a&&("object"!==I(a)||a[t.methodName]);for(var o,s={methodName:t.methodName,args:t.args,methodInfo:i,dynamicFn:a},l=0;l<t.args.length&&(o=t.args[l]);l++)o.literal||e._addPropertyEffect(o.rootProperty,n,{fn:r,info:s,trigger:o});return a&&e._addPropertyEffect(t.methodName,n,{fn:r,info:s}),s}function re(e,t,n,r,i){var a=e._methodHost||e,o=a[i.methodName];if(o){var s=e._marshalArgs(i.args,t,n);return s===L?L:o.apply(a,s)}i.dynamicFn||console.warn("method `"+i.methodName+"` not defined")}var ie=[],ae="(?:[a-zA-Z_$][\\w.:$\\-*]*)",oe="(?:("+ae+"|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*)",se=new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?("+ae+"\\s*(?:\\(\\s*(?:(?:"+oe+"(?:,\\s*"+oe+")*)?)\\)\\s*)?)(?:]]|}})","g");function le(e){for(var t="",n=0;n<e.length;n++)t+=e[n].literal||"";return t}function ue(e){var t=e.match(/([^\s]+?)\(([\s\S]*)\)/);if(t){var n={methodName:t[1],static:!0,args:ie};return t[2].trim()?function(e,t){return t.args=e.map((function(e){var n=ce(e);return n.literal||(t.static=!1),n}),this),t}(t[2].replace(/\\,/g,"&comma;").split(","),n):n}return null}function ce(e){var t=e.trim().replace(/&comma;/g,",").replace(/\\(.)/g,"$1"),n={name:t,value:"",literal:!1},r=t[0];switch("-"===r&&(r=t[1]),r>="0"&&r<="9"&&(r="#"),r){case"'":case'"':n.value=t.slice(1,-1),n.literal=!0;break;case"#":n.value=Number(t),n.literal=!0}return n.literal||(n.rootProperty=(0,a.zr)(t),n.structured=(0,a.uf)(t),n.structured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2)))),n}function he(e,t,n){var r=(0,a.Jt)(e,n);return void 0===r&&(r=t[n]),r}function de(e,t,n,r){var i={indexSplices:r};M.oO&&!e._overrideLegacyUndefined&&(t.splices=i),e.notifyPath(n+".splices",i),e.notifyPath(n+".length",t.length),M.oO&&!e._overrideLegacyUndefined&&(i.indexSplices=[])}function fe(e,t,n,r,i,a){de(e,t,n,[{index:r,addedCount:i,removed:a,object:t,type:"splice"}])}var pe=(0,i.y)((function(e){var t=E((0,s.W)(e)),n=function(e){function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=function(e,t,n){return t=O(t),function(e,t){if(t&&("object"==I(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,A()?Reflect.construct(t,n||[],O(e).constructor):t.apply(e,n))}(this,n)).__isPropertyEffectsClient=!0,e.__dataClientsReady,e.__dataPendingClients,e.__dataToNotify,e.__dataLinkedPaths,e.__dataHasPaths,e.__dataCompoundStorage,e.__dataHost,e.__dataTemp,e.__dataClientsInitialized,e.__data,e.__dataPending,e.__dataOld,e.__computeEffects,e.__computeInfo,e.__reflectEffects,e.__notifyEffects,e.__propagateEffects,e.__observeEffects,e.__readOnly,e.__templateInfo,e._overrideLegacyUndefined,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(n,e),i=n,s=[{key:"PROPERTY_EFFECT_TYPES",get:function(){return D}},{key:"_initializeProperties",value:function(){P(n,"_initializeProperties",this,3)([]),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}},{key:"_registerHost",value:function(){if(ve.length){var e=ve[ve.length-1];e._enqueueClient(this),this.__dataHost=e}}},{key:"_initializeProtoProperties",value:function(e){this.__data=Object.create(e),this.__dataPending=Object.create(e),this.__dataOld={}}},{key:"_initializeInstanceProperties",value:function(e){var t=this[D.READ_ONLY];for(var n in e)t&&t[n]||(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[n]=this.__dataPending[n]=e[n])}},{key:"_addPropertyEffect",value:function(e,t,n){this._createPropertyAccessor(e,t==D.READ_ONLY);var r=B(this,t,!0)[e];r||(r=this[t][e]=[]),r.push(n)}},{key:"_removePropertyEffect",value:function(e,t,n){var r=B(this,t,!0)[e],i=r.indexOf(n);i>=0&&r.splice(i,1)}},{key:"_hasPropertyEffect",value:function(e,t){var n=this[t];return Boolean(n&&n[e])}},{key:"_hasReadOnlyEffect",value:function(e){return this._hasPropertyEffect(e,D.READ_ONLY)}},{key:"_hasNotifyEffect",value:function(e){return this._hasPropertyEffect(e,D.NOTIFY)}},{key:"_hasReflectEffect",value:function(e){return this._hasPropertyEffect(e,D.REFLECT)}},{key:"_hasComputedEffect",value:function(e){return this._hasPropertyEffect(e,D.COMPUTE)}},{key:"_setPendingPropertyOrPath",value:function(e,t,r,i){if(i||(0,a.zr)(Array.isArray(e)?e[0]:e)!==e){if(!i){var o=(0,a.Jt)(this,e);if(!(e=(0,a.hZ)(this,e,t))||!P(n,"_shouldPropertyChange",this,3)([e,t,o]))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(e,t,r))return function(e,t,n){var r,i=e.__dataLinkedPaths;if(i)for(var o in i){var s=i[o];(0,a.K9)(o,t)?(r=(0,a.Tl)(o,s,t),e._setPendingPropertyOrPath(r,n,!0,!0)):(0,a.K9)(s,t)&&(r=(0,a.Tl)(s,o,t),e._setPendingPropertyOrPath(r,n,!0,!0))}}(this,e,t),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[e])return this._setPendingProperty(e,t,r);this[e]=t}return!1}},{key:"_setUnmanagedPropertyToNode",value:function(e,t,n){n===e[t]&&"object"!=I(n)||("className"===t&&(e=(0,r.L)(e)),e[t]=n)}},{key:"_setPendingProperty",value:function(e,t,n){var r=this.__dataHasPaths&&(0,a.uf)(e),i=r?this.__dataTemp:this.__data;return!!this._shouldPropertyChange(e,t,i[e])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),e in this.__dataOld||(this.__dataOld[e]=this.__data[e]),r?this.__dataTemp[e]=t:this.__data[e]=t,this.__dataPending[e]=t,(r||this[D.NOTIFY]&&this[D.NOTIFY][e])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[e]=n),!0)}},{key:"_setProperty",value:function(e,t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}},{key:"_invalidateProperties",value:function(){this.__dataReady&&this._flushProperties()}},{key:"_enqueueClient",value:function(e){this.__dataPendingClients=this.__dataPendingClients||[],e!==this&&this.__dataPendingClients.push(e)}},{key:"_flushClients",value:function(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}},{key:"__enableOrFlushClients",value:function(){var e=this.__dataPendingClients;if(e){this.__dataPendingClients=null;for(var t=0;t<e.length;t++){var n=e[t];n.__dataEnabled?n.__dataPending&&n._flushProperties():n._enableProperties()}}}},{key:"_readyClients",value:function(){this.__enableOrFlushClients()}},{key:"setProperties",value:function(e,t){for(var n in e)!t&&this[D.READ_ONLY]&&this[D.READ_ONLY][n]||this._setPendingPropertyOrPath(n,e[n],!0);this._invalidateProperties()}},{key:"ready",value:function(){this._flushProperties(),this.__dataClientsReady||this._flushClients(),this.__dataPending&&this._flushProperties()}},{key:"_propertiesChanged",value:function(e,t,n){var r,i=this.__dataHasPaths;this.__dataHasPaths=!1,function(e,t,n,r){var i=e[D.COMPUTE];if(i)if(M.Xj){N++;var a,o=function(e){var t=e.constructor.__orderedComputedDeps;if(!t){t=new Map;for(var n,r=e[D.COMPUTE],i=function(e){var t=e[U],n={},r=e[D.COMPUTE],i=[],a=0;for(var o in t){var s=t[o];a+=n[o]=s.args.filter((function(e){return!e.literal})).length+(s.dynamicFn?1:0)}for(var l in r)t[l]||i.push(l);return{counts:n,ready:i,total:a}}(e),a=i.counts,o=i.ready,s=i.total;n=o.shift();){t.set(n,t.size);var l=r[n];l&&l.forEach((function(e){var t=e.info.methodInfo;--s,0===--a[t]&&o.push(t)}))}if(0!==s){var u=e;console.warn("Computed graph for ".concat(u.localName," incomplete; circular?"))}e.constructor.__orderedComputedDeps=t}return t}(e),s=[];for(var l in t)J(l,i,s,o,r);for(;a=s.shift();)Z(e,"",t,0,a)&&J(a.methodInfo,i,s,o,r);Object.assign(n,e.__dataOld),Object.assign(t,e.__dataPending),e.__dataPending=null}else for(var u=t;z(e,i,u,n,r);)Object.assign(n,e.__dataOld),Object.assign(t,e.__dataPending),u=e.__dataPending,e.__dataPending=null}(this,t,n,i),r=this.__dataToNotify,this.__dataToNotify=null,this._propagatePropertyChanges(t,n,i),this._flushClients(),z(this,this[D.REFLECT],t,n,i),z(this,this[D.OBSERVE],t,n,i),r&&function(e,t,n,r,i){var a,o,s=e[D.NOTIFY],l=N++;for(var u in t)t[u]&&(s&&j(e,s,l,u,n,r,i)||i&&G(e,u,n))&&(a=!0);a&&(o=e.__dataHost)&&o._invalidateProperties&&o._invalidateProperties()}(this,r,t,n,i),1==this.__dataCounter&&(this.__dataTemp={})}},{key:"_propagatePropertyChanges",value:function(e,t,n){this[D.PROPAGATE]&&z(this,this[D.PROPAGATE],e,t,n),this.__templateInfo&&this._runEffectsForTemplate(this.__templateInfo,e,t,n)}},{key:"_runEffectsForTemplate",value:function(e,t,n,r){var i=this,a=function(t,r){z(i,e.propertyEffects,t,n,r,e.nodeList);for(var a=e.firstChild;a;a=a.nextSibling)i._runEffectsForTemplate(a,t,n,r)};e.runEffects?e.runEffects(a,t,r):a(t,r)}},{key:"linkPaths",value:function(e,t){e=(0,a.S8)(e),t=(0,a.S8)(t),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[e]=t}},{key:"unlinkPaths",value:function(e){e=(0,a.S8)(e),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[e]}},{key:"notifySplices",value:function(e,t){var n={path:""};de(this,(0,a.Jt)(this,e,n),n.path,t)}},{key:"get",value:function(e,t){return(0,a.Jt)(t||this,e)}},{key:"set",value:function(e,t,n){n?(0,a.hZ)(n,e,t):this[D.READ_ONLY]&&this[D.READ_ONLY][e]||this._setPendingPropertyOrPath(e,t,!0)&&this._invalidateProperties()}},{key:"push",value:function(e){for(var t={path:""},n=(0,a.Jt)(this,e,t),r=n.length,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];var l=n.push.apply(n,o);return o.length&&fe(this,n,t.path,r,o.length,[]),l}},{key:"pop",value:function(e){var t={path:""},n=(0,a.Jt)(this,e,t),r=Boolean(n.length),i=n.pop();return r&&fe(this,n,t.path,n.length,0,[i]),i}},{key:"splice",value:function(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];var s,l={path:""},u=(0,a.Jt)(this,e,l);return t<0?t=u.length-Math.floor(-t):t&&(t=Math.floor(t)),s=2===arguments.length?u.splice(t):u.splice.apply(u,[t,n].concat(i)),(i.length||s.length)&&fe(this,u,l.path,t,i.length,s),s}},{key:"shift",value:function(e){var t={path:""},n=(0,a.Jt)(this,e,t),r=Boolean(n.length),i=n.shift();return r&&fe(this,n,t.path,0,0,[i]),i}},{key:"unshift",value:function(e){for(var t={path:""},n=(0,a.Jt)(this,e,t),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var s=n.unshift.apply(n,i);return i.length&&fe(this,n,t.path,0,i.length,[]),s}},{key:"notifyPath",value:function(e,t){var n;if(1==arguments.length){var r={path:""};t=(0,a.Jt)(this,e,r),n=r.path}else n=Array.isArray(e)?(0,a.S8)(e):e;this._setPendingPropertyOrPath(n,t,!0,!0)&&this._invalidateProperties()}},{key:"_createReadOnlyProperty",value:function(e,t){var n;this._addPropertyEffect(e,D.READ_ONLY),t&&(this["_set"+(n=e,n[0].toUpperCase()+n.substring(1))]=function(t){this._setProperty(e,t)})}},{key:"_createPropertyObserver",value:function(e,t,n){var r={property:e,method:t,dynamicFn:Boolean(n)};this._addPropertyEffect(e,D.OBSERVE,{fn:V,info:r,trigger:{name:e}}),n&&this._addPropertyEffect(t,D.OBSERVE,{fn:V,info:r,trigger:{name:t}})}},{key:"_createMethodObserver",value:function(e,t){var n=ue(e);if(!n)throw new Error("Malformed observer expression '"+e+"'");ne(this,n,D.OBSERVE,re,null,t)}},{key:"_createNotifyingProperty",value:function(e){this._addPropertyEffect(e,D.NOTIFY,{fn:X,info:{eventName:(0,o.e)(e)+"-changed",property:e}})}},{key:"_createReflectedProperty",value:function(e){var t=this.constructor.attributeNameForProperty(e);"-"===t[0]?console.warn("Property "+e+" cannot be reflected to attribute "+t+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(e,D.REFLECT,{fn:q,info:{attrName:t}})}},{key:"_createComputedProperty",value:function(e,t,n){var r=ue(t);if(!r)throw new Error("Malformed computed expression '"+t+"'");var i=ne(this,r,D.COMPUTE,Z,e,n);B(this,U)[e]=i}},{key:"_marshalArgs",value:function(e,t,n){for(var r=this.__data,i=[],o=0,s=e.length;o<s;o++){var l=e[o],u=l.name,c=l.structured,h=l.wildcard,d=l.value;if(!l.literal)if(h){var f=(0,a.K9)(u,t),p=he(r,n,f?t:u);d={path:f?t:u,value:p,base:f?(0,a.Jt)(r,u):p}}else d=c?he(r,n,u):r[u];if(M.oO&&!this._overrideLegacyUndefined&&void 0===d&&e.length>1)return L;i[o]=d}return i}},{key:"_bindTemplate",value:function(e,t){var n=this.constructor._parseTemplate(e),r=this.__preBoundTemplateInfo==n;if(!r)for(var i in n.propertyEffects)this._createPropertyAccessor(i);if(t)if((n=Object.create(n)).wasPreBound=r,this.__templateInfo){var a=e._parentTemplateInfo||this.__templateInfo,o=a.lastChild;n.parent=a,a.lastChild=n,n.previousSibling=o,o?o.nextSibling=n:a.firstChild=n}else this.__templateInfo=n;else this.__preBoundTemplateInfo=n;return n}},{key:"_stampTemplate",value:function(e,t){t=t||this._bindTemplate(e,!0),ve.push(this);var r=P(n,"_stampTemplate",this,3)([e,t]);if(ve.pop(),t.nodeList=r.nodeList,!t.wasPreBound)for(var i=t.childNodes=[],a=r.firstChild;a;a=a.nextSibling)i.push(a);return r.templateInfo=t,function(e,t){var n=t.nodeList,r=t.nodeInfoList;if(r.length)for(var i=0;i<r.length;i++){var a=r[i],o=n[i],s=a.bindings;if(s)for(var l=0;l<s.length;l++){var u=s[l];ee(o,u),te(o,e,u)}o.__dataHost=e}}(this,t),this.__dataClientsReady&&(this._runEffectsForTemplate(t,this.__data,null,!1),this._flushClients()),r}},{key:"_removeBoundDom",value:function(e){var t=e.templateInfo,n=t.previousSibling,i=t.nextSibling,a=t.parent;n?n.nextSibling=i:a&&(a.firstChild=i),i?i.previousSibling=n:a&&(a.lastChild=n),t.nextSibling=t.previousSibling=null;for(var o=t.childNodes,s=0;s<o.length;s++){var l=o[s];(0,r.L)((0,r.L)(l).parentNode).removeChild(l)}}}],l=[{key:"addPropertyEffect",value:function(e,t,n){this.prototype._addPropertyEffect(e,t,n)}},{key:"createPropertyObserver",value:function(e,t,n){this.prototype._createPropertyObserver(e,t,n)}},{key:"createMethodObserver",value:function(e,t){this.prototype._createMethodObserver(e,t)}},{key:"createNotifyingProperty",value:function(e){this.prototype._createNotifyingProperty(e)}},{key:"createReadOnlyProperty",value:function(e,t){this.prototype._createReadOnlyProperty(e,t)}},{key:"createReflectedProperty",value:function(e){this.prototype._createReflectedProperty(e)}},{key:"createComputedProperty",value:function(e,t,n){this.prototype._createComputedProperty(e,t,n)}},{key:"bindTemplate",value:function(e){return this.prototype._bindTemplate(e)}},{key:"_addTemplatePropertyEffect",value:function(e,t,n){(e.hostProps=e.hostProps||{})[t]=!0;var r=e.propertyEffects=e.propertyEffects||{};(r[t]=r[t]||[]).push(n)}},{key:"_parseTemplateNode",value:function(e,n,r){var i=t._parseTemplateNode.call(this,e,n,r);if(e.nodeType===Node.TEXT_NODE){var a=this._parseBindings(e.textContent,n);a&&(e.textContent=le(a)||" ",K(this,n,r,"text","textContent",a),i=!0)}return i}},{key:"_parseTemplateNodeAttribute",value:function(e,n,r,i,a){var s=this._parseBindings(a,n);if(s){var l=i,u="property";F.test(i)?u="attribute":"$"==i[i.length-1]&&(i=i.slice(0,-1),u="attribute");var c=le(s);return c&&"attribute"==u&&("class"==i&&e.hasAttribute("class")&&(c+=" "+e.getAttribute(i)),e.setAttribute(i,c)),"attribute"==u&&"disable-upgrade$"==l&&e.setAttribute(i,""),"input"===e.localName&&"value"===l&&e.setAttribute(l,""),e.removeAttribute(l),"property"===u&&(i=(0,o.I)(i)),K(this,n,r,u,i,s,c),!0}return t._parseTemplateNodeAttribute.call(this,e,n,r,i,a)}},{key:"_parseTemplateNestedTemplate",value:function(e,n,r){var i=t._parseTemplateNestedTemplate.call(this,e,n,r),a=e.parentNode,o=r.templateInfo,s="dom-if"===a.localName,l="dom-repeat"===a.localName;M.fF&&(s||l)&&(a.removeChild(e),(r=r.parentInfo).templateInfo=o,r.noted=!0,i=!1);var u=o.hostProps;if(M.s&&s)u&&(n.hostProps=Object.assign(n.hostProps||{},u),M.fF||(r.parentInfo.noted=!0));else for(var c in u)K(this,n,r,"property","_host_"+c,[{mode:"{",source:c,dependencies:[c],hostProp:!0}]);return i}},{key:"_parseBindings",value:function(e,t){for(var n,r=[],i=0;null!==(n=se.exec(e));){n.index>i&&r.push({literal:e.slice(i,n.index)});var a=n[1][0],o=Boolean(n[2]),s=n[3].trim(),l=!1,u="",c=-1;"{"==a&&(c=s.indexOf("::"))>0&&(u=s.substring(c+2),s=s.substring(0,c),l=!0);var h=ue(s),d=[];if(h){for(var f=h.args,p=h.methodName,v=0;v<f.length;v++){var m=f[v];m.literal||d.push(m)}var y=t.dynamicFns;(y&&y[p]||h.static)&&(d.push(p),h.dynamicFn=!0)}else d.push(s);r.push({source:s,mode:a,negate:o,customEvent:l,signature:h,dependencies:d,event:u}),i=se.lastIndex}if(i&&i<e.length){var g=e.substring(i);g&&r.push({literal:g})}return r.length?r:null}},{key:"_evaluateBinding",value:function(e,t,n,r,i,o){var s;return s=t.signature?re(e,n,r,0,t.signature):n!=t.source?(0,a.Jt)(e,t.source):o&&(0,a.uf)(n)?(0,a.Jt)(e,n):e.__data[n],t.negate&&(s=!s),s}}],s&&T(i.prototype,s),l&&T(i,l),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,s,l}(t);return n})),ve=[]},3766:(e,t,n)=>{var r=n(5161),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,a=0,o=0,s=arguments.length,l=0;o<s;)l<(n=i(arguments[o++]))?(a=a*(r=l/n)*r+1,l=n):a+=n>0?(r=n/l)*r:n;return l===1/0?1/0:l*Math.sqrt(a)}})},3783:(e,t,n)=>{var r=n(5161);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},3786:(e,t,n)=>{var r=n(5161),i=n(6094),a=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return a&&a(e),!0}catch(e){return!1}}})},3814:(e,t,n)=>{var r=n(4547),i=n(3991),a=n(1167);e.exports=function(e){return function(t,n,o){var s,l=r(t),u=i(l.length),c=a(o,u);if(e&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}}},3821:(e,t,n)=>{var r=n(6094),i=n(8840),a=n(4638),o=n(9788)("IE_PROTO"),s=function(){},l="prototype",u=function(){var e,t=n(928)("iframe"),r=a.length;for(t.style.display="none",n(5086).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u[l][a[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[l]=r(e),n=new s,s[l]=null,n[o]=e):n=u(),void 0===t?n:i(n,t)}},3851:(e,t,n)=>{var r=n(7947);n(7265)("isExtensible",(function(e){return function(t){return!!r(t)&&(!e||e(t))}}))},3854:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},3863:(e,t,n)=>{var r=n(2228),i=n(1282),a=n(4397).f,o=n(7753).f,s=n(6357),l=n(3944),u=r.RegExp,c=u,h=u.prototype,d=/a/g,f=/a/g,p=new u(d)!==d;if(n(9417)&&(!p||n(110)((function(){return f[n(5440)("match")]=!1,u(d)!=d||u(f)==f||"/a/i"!=u(d,"i")})))){u=function(e,t){var n=this instanceof u,r=s(e),a=void 0===t;return!n&&r&&e.constructor===u&&a?e:i(p?new c(r&&!a?e.source:e,t):c((r=e instanceof u)?e.source:e,r&&a?l.call(e):t),n?this:h,u)};for(var v=function(e){e in u||a(u,e,{configurable:!0,get:function(){return c[e]},set:function(t){c[e]=t}})},m=o(c),y=0;m.length>y;)v(m[y++]);h.constructor=u,u.prototype=h,n(9337)(r,"RegExp",u)}n(8544)("RegExp")},3905:(e,t,n)=>{var r=n(4300),i=n(8276),a=n(6502),o=n(5799),s=n(1271),l="prototype",u=function(e,t,n){var c,h,d,f=e&u.F,p=e&u.G,v=e&u.S,m=e&u.P,y=e&u.B,g=e&u.W,_=p?i:i[t]||(i[t]={}),b=_[l],x=p?r:v?r[t]:(r[t]||{})[l];for(c in p&&(n=t),n)(h=!f&&x&&void 0!==x[c])&&s(_,c)||(d=h?x[c]:n[c],_[c]=p&&"function"!=typeof x[c]?n[c]:y&&h?a(d,r):g&&x[c]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[l]=e[l],t}(d):m&&"function"==typeof d?a(Function.call,d):d,m&&((_.virtual||(_.virtual={}))[c]=d,e&u.R&&b&&!b[c]&&o(b,c,d)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},3907:(e,t,n)=>{"use strict";var r=n(2228),i=n(8319),a=n(4171),o=n(1282),s=n(4142),l=n(110),u=n(7753).f,c=n(5935).f,h=n(4397).f,d=n(2671).trim,f="Number",p=r[f],v=p,m=p.prototype,y=a(n(3821)(m))==f,g="trim"in String.prototype,_=function(e){var t=s(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,a=(t=g?t.trim():d(t,3)).charCodeAt(0);if(43===a||45===a){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===a){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var o,l=t.slice(2),u=0,c=l.length;u<c;u++)if((o=l.charCodeAt(u))<48||o>i)return NaN;return parseInt(l,r)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof p&&(y?l((function(){m.valueOf.call(n)})):a(n)!=f)?o(new v(_(t)),n,p):_(t)};for(var b,x=n(9417)?u(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;x.length>S;S++)i(v,b=x[S])&&!i(p,b)&&h(p,b,c(v,b));p.prototype=m,m.constructor=p,n(9337)(r,f,p)}},3944:(e,t,n)=>{"use strict";var r=n(6094);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},3991:(e,t,n)=>{var r=n(2497),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},4040:(e,t,n)=>{var r=n(5161),i=n(7824)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},4041:(e,t,n)=>{n(7265)("getOwnPropertyNames",(function(){return n(1655).f}))},4140:(e,t,n)=>{"use strict";var r=n(2395),i=n(7947),a=n(3991),o=n(7102),s=n(5440)("isConcatSpreadable");e.exports=function e(t,n,l,u,c,h,d,f){for(var p,v,m=c,y=0,g=!!d&&o(d,f,3);y<u;){if(y in l){if(p=g?g(l[y],y,n):l[y],v=!1,i(p)&&(v=void 0!==(v=p[s])?!!v:r(p)),v&&h>0)m=e(t,n,p,a(p.length),m,h-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=p}m++}y++}return m}},4142:(e,t,n)=>{var r=n(7947);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},4144:(e,t,n)=>{var r=n(7947),i=n(4286).onFreeze;n(7265)("seal",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},4152:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{q:()=>u}),n(9032);var o=window.trustedTypes&&trustedTypes.createPolicy("polymer-html-literal",{createHTML:function(e){return e}}),s=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(t,n);var r=n.reduce((function(e,n,r){return e+l(n)+t[r+1]}),t[0]);this.value=r.toString()},(t=[{key:"toString",value:function(){return this.value}}])&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function l(e){if(e instanceof s)return e.value;throw new Error("non-literal value passed to Polymer's htmlLiteral function: ".concat(e))}var u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];c(e,n);var i=document.createElement("template"),a=n.reduce((function(t,n,r){return t+function(e){if(e instanceof HTMLTemplateElement)return e.innerHTML;if(e instanceof s)return l(e);throw new Error("non-template value passed to Polymer's html function: ".concat(e))}(n)+e[r+1]}),e[0]);return o&&(a=o.createHTML(a)),i.innerHTML=a,i},c=function(e,t){if(!Array.isArray(e)||!Array.isArray(e.raw)||t.length!==e.length-1)throw new TypeError("Invalid call to the html template tag")}},4168:(e,t,n)=>{var r=n(5427),i=n(4300).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},4171:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},4184:e=>{e.exports=function(e,t){return{value:t,done:!!e}}},4195:(e,t)=>{t.f={}.propertyIsEnumerable},4221:(e,t,n)=>{n(3116),n(5029),n(342),n(3754),n(1572),n(702),n(8653),n(4041),n(438),n(4144),n(2690),n(5568),n(3666),n(3851),n(2980),n(69),n(3210),n(2880),n(2659),n(3439),n(5676),n(2793),n(1590),n(3907),n(3425),n(4567),n(5781),n(1727),n(6060),n(5871),n(3718),n(8616),n(4922),n(6299),n(3100),n(8670),n(2293),n(7961),n(4273),n(7746),n(163),n(285),n(9620),n(3766),n(7205),n(3783),n(9655),n(9106),n(6288),n(3596),n(9223),n(5870),n(1386),n(6205),n(1871),n(7542),n(6967),n(7878),n(594),n(5464),n(6227),n(7990),n(3381),n(2613),n(532),n(825),n(8891),n(375),n(6062),n(6683),n(5200),n(8265),n(3217),n(4239),n(6330),n(2352),n(8107),n(9111),n(4785),n(7681),n(4437),n(4636),n(8925),n(6795),n(7833),n(9354),n(9815),n(775),n(6449),n(2670),n(8363),n(1412),n(3039),n(976),n(2098),n(2960),n(6586),n(735),n(5699),n(4683),n(3863),n(6462),n(3226),n(8948),n(4422),n(8051),n(5967),n(7787),n(307),n(652),n(3262),n(355),n(8845),n(2636),n(6458),n(4865),n(7120),n(803),n(8410),n(5585),n(2988),n(5719),n(6939),n(8292),n(25),n(2268),n(238),n(3118),n(6731),n(8501),n(5596),n(230),n(3129),n(6803),n(8474),n(3786),n(9665),n(4290),e.exports=n(1212)},4239:(e,t,n)=>{"use strict";n(1794)("sup",(function(e){return function(){return e(this,"sup","","")}}))},4242:(e,t,n)=>{n(7736),e.exports=n(1212).String.trimLeft},4273:(e,t,n)=>{var r=n(5161),i=n(3367);r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},4286:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(4317)("meta"),a=n(7947),o=n(8319),s=n(4397).f,l=0,u=Object.isExtensible||function(){return!0},c=!n(110)((function(){return u(Object.preventExtensions({}))})),h=function(e){s(e,i,{value:{i:"O"+ ++l,w:{}}})},d=e.exports={KEY:i,NEED:!1,fastKey:function(e,t){if(!a(e))return"symbol"==r(e)?e:("string"==typeof e?"S":"P")+e;if(!o(e,i)){if(!u(e))return"F";if(!t)return"E";h(e)}return e[i].i},getWeak:function(e,t){if(!o(e,i)){if(!u(e))return!0;if(!t)return!1;h(e)}return e[i].w},onFreeze:function(e){return c&&d.NEED&&u(e)&&!o(e,i)&&h(e),e}}},4287:(e,t,n)=>{n(4747),e.exports=n(1212).String.trimRight},4290:(e,t,n)=>{var r=n(5161),i=n(9584);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},4300:e=>{var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},4317:e=>{var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},4397:(e,t,n)=>{var r=n(6094),i=n(2018),a=n(4142),o=Object.defineProperty;t.f=n(9417)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},4414:(e,t,n)=>{"use strict";var r=n(5971),i=n(947),a=n(1475),o=n(544),s=n(7550),l=n(8023),u=n(8834),c=n(5572),h=n(7922),d=n(7925);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function v(e){var t=function(e){if("object"!=f(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(t)?t:t+""}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}function y(e,t,n,r){var i=g(_(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function g(){return g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},g.apply(null,arguments)}function _(e){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_(e)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}var x=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=_(t),function(e,t){if(t&&("object"==f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,m()?Reflect.construct(t,n||[],_(e).constructor):t.apply(e,n))}(this,t)).__instances=[],e.__renderDebouncer=null,e.__itemsIdxToInstIdx={},e.__chunkCount=null,e.__renderStartTime=null,e.__itemsArrayChanged=!1,e.__shouldMeasureChunk=!1,e.__shouldContinueChunking=!1,e.__chunkingId=0,e.__sortFn=null,e.__filterFn=null,e.__observePaths=null,e.__ctor=null,e.__isDetached=!0,e.template=null,e._templateInfo,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(t,e),n=t,r=[{key:"disconnectedCallback",value:function(){y(t,"disconnectedCallback",this,3)([]),this.__isDetached=!0;for(var e=0;e<this.__instances.length;e++)this.__detachInstance(e);this.__chunkingId&&cancelAnimationFrame(this.__chunkingId)}},{key:"connectedCallback",value:function(){if(y(t,"connectedCallback",this,3)([]),(0,h.I)()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;for(var e=(0,c.L)((0,c.L)(this).parentNode),n=0;n<this.__instances.length;n++)this.__attachInstance(n,e);this.__chunkingId&&this.__render()}}},{key:"__ensureTemplatized",value:function(){var e=this;if(!this.__ctor){var t=this.template=this._templateInfo?this:this.querySelector("template");if(!t){var n=new MutationObserver((function(){if(!e.querySelector("template"))throw new Error("dom-repeat requires a <template> child");n.disconnect(),e.__render()}));return n.observe(this,{childList:!0}),!1}var r={};r[this.as]=!0,r[this.indexAs]=!0,r[this.itemsIndexAs]=!0,this.__ctor=(0,i.sm)(t,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:r,forwardHostProp:function(e,t){for(var n,r=this.__instances,i=0;i<r.length&&(n=r[i]);i++)n.forwardHostProp(e,t)},notifyInstanceProp:function(e,t,n){if((0,l.cK)(this.as,t)){var r=e[this.itemsIndexAs];t==this.as&&(this.items[r]=n);var i=(0,l.Tl)(this.as,"".concat(JSCompiler_renameProperty("items",this),".").concat(r),t);this.notifyPath(i,n)}}})}return!0}},{key:"__getMethodHost",value:function(){return this.__dataHost._methodHost||this.__dataHost}},{key:"__functionFromPropertyValue",value:function(e){if("string"==typeof e){var t=e,n=this.__getMethodHost();return function(){return n[t].apply(n,arguments)}}return e}},{key:"__sortChanged",value:function(e){this.__sortFn=this.__functionFromPropertyValue(e),this.items&&this.__debounceRender(this.__render)}},{key:"__filterChanged",value:function(e){this.__filterFn=this.__functionFromPropertyValue(e),this.items&&this.__debounceRender(this.__render)}},{key:"__computeFrameTime",value:function(e){return Math.ceil(1e3/e)}},{key:"__observeChanged",value:function(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}},{key:"__handleObservedPaths",value:function(e){if(this.__sortFn||this.__filterFn)if(e){if(this.__observePaths)for(var t=this.__observePaths,n=0;n<t.length;n++)0===e.indexOf(t[n])&&this.__debounceRender(this.__render,this.delay)}else this.__debounceRender(this.__render,this.delay)}},{key:"__itemsChanged",value:function(e){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(e.path,e.value)||("items"===e.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}},{key:"__debounceRender",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.__renderDebouncer=a.aq.debounce(this.__renderDebouncer,t>0?u.EV.after(t):u._3,e.bind(this)),(0,o.O)(this.__renderDebouncer)}},{key:"render",value:function(){this.__debounceRender(this.__render),(0,o.b)()}},{key:"__render",value:function(){var e=this;if(this.__ensureTemplatized()){var t=this.items||[],n=this.__sortAndFilterItems(t),r=this.__calculateLimit(n.length);this.__updateInstances(t,r,n),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((function(){e.__chunkingId=null,e.__continueChunking()}))),this._setRenderedItemCount(this.__instances.length),d.w9&&!this.notifyDomChange||this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}}},{key:"__sortAndFilterItems",value:function(e){for(var t=this,n=new Array(e.length),r=0;r<e.length;r++)n[r]=r;return this.__filterFn&&(n=n.filter((function(n,r,i){return t.__filterFn(e[n],r,i)}))),this.__sortFn&&n.sort((function(n,r){return t.__sortFn(e[n],e[r])})),n}},{key:"__calculateLimit",value:function(e){var t,n=e,r=this.__instances.length;return this.initialCount&&(!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(n=Math.min(e,this.initialCount),t=Math.max(n-r,0),this.__chunkCount=t||1):(t=Math.min(Math.max(e-r,0),this.__chunkCount),n=Math.min(r+t,e)),this.__shouldMeasureChunk=t===this.__chunkCount,this.__shouldContinueChunking=n<e,this.__renderStartTime=performance.now()),this.__itemsArrayChanged=!1,n}},{key:"__continueChunking",value:function(){if(this.__shouldMeasureChunk){var e=performance.now()-this.__renderStartTime,t=this._targetFrameTime/e;this.__chunkCount=Math.round(this.__chunkCount*t)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}},{key:"__updateInstances",value:function(e,t,n){var r,i=this.__itemsIdxToInstIdx={};for(r=0;r<t;r++){var a=this.__instances[r],o=n[r],s=e[o];i[o]=r,a?(a._setPendingProperty(this.as,s),a._setPendingProperty(this.indexAs,r),a._setPendingProperty(this.itemsIndexAs,o),a._flushProperties()):this.__insertInstance(s,r,o)}for(var l=this.__instances.length-1;l>=r;l--)this.__detachAndRemoveInstance(l)}},{key:"__detachInstance",value:function(e){for(var t=this.__instances[e],n=(0,c.L)(t.root),r=0;r<t.children.length;r++){var i=t.children[r];n.appendChild(i)}return t}},{key:"__attachInstance",value:function(e,t){var n=this.__instances[e];t.insertBefore(n.root,this)}},{key:"__detachAndRemoveInstance",value:function(e){this.__detachInstance(e),this.__instances.splice(e,1)}},{key:"__stampInstance",value:function(e,t,n){var r={};return r[this.as]=e,r[this.indexAs]=t,r[this.itemsIndexAs]=n,new this.__ctor(r)}},{key:"__insertInstance",value:function(e,t,n){var r=this.__stampInstance(e,t,n),i=this.__instances[t+1],a=i?i.children[0]:this;return(0,c.L)((0,c.L)(this).parentNode).insertBefore(r.root,a),this.__instances[t]=r,r}},{key:"_showHideChildren",value:function(e){for(var t=0;t<this.__instances.length;t++)this.__instances[t]._showHideChildren(e)}},{key:"__handleItemPath",value:function(e,t){var n=e.slice(6),r=n.indexOf("."),i=r<0?n:n.substring(0,r);if(i==parseInt(i,10)){var a=r<0?"":n.substring(r+1);this.__handleObservedPaths(a);var o=this.__itemsIdxToInstIdx[i],s=this.__instances[o];if(s){var l=this.as+(a?"."+a:"");s._setPendingPropertyOrPath(l,t,!1,!0),s._flushProperties()}return!0}}},{key:"itemForElement",value:function(e){var t=this.modelForElement(e);return t&&t[this.as]}},{key:"indexForElement",value:function(e){var t=this.modelForElement(e);return t&&t[this.indexAs]}},{key:"modelForElement",value:function(e){return(0,i.lH)(this.template,e)}}],s=[{key:"is",get:function(){return"dom-repeat"}},{key:"template",get:function(){return null}},{key:"properties",get:function(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!d.w9,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}},{key:"observers",get:function(){return["__itemsChanged(items.*)"]}}],r&&p(n.prototype,r),s&&p(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,s}((0,s.j)(r.Pu));customElements.define(x.is,x)},4422:(e,t,n)=>{"use strict";var r=n(6094),i=n(3991),a=n(6718),o=n(7565);n(9666)("match",1,(function(e,t,n,s){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var l=r(e),u=String(this);if(!l.global)return o(l,u);var c=l.unicode;l.lastIndex=0;for(var h,d=[],f=0;null!==(h=o(l,u));){var p=String(h[0]);d[f]=p,""===p&&(l.lastIndex=a(u,i(l.lastIndex),c)),f++}return 0===f?null:d}]}))},4437:(e,t,n)=>{"use strict";var r=n(7102),i=n(5161),a=n(5560),o=n(5678),s=n(2730),l=n(3991),u=n(101),c=n(8424);i(i.S+i.F*!n(8113)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,i,h,d=a(e),f="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,m=void 0!==v,y=0,g=c(d);if(m&&(v=r(v,p>2?arguments[2]:void 0,2)),null==g||f==Array&&s(g))for(n=new f(t=l(d.length));t>y;y++)u(n,y,m?v(d[y],y):d[y]);else for(h=g.call(d),n=new f;!(i=h.next()).done;y++)u(n,y,m?o(h,v,[i.value,y],!0):i.value);return n.length=y,n}})},4547:(e,t,n)=>{var r=n(7295),i=n(7462);e.exports=function(e){return r(i(e))}},4567:(e,t,n)=>{"use strict";var r=n(5161),i=n(110),a=n(7964),o=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==o.call(1,void 0)}))||!i((function(){o.call({})}))),"Number",{toPrecision:function(e){var t=a(this,"Number#toPrecision: incorrect invocation!");return void 0===e?o.call(t):o.call(t,e)}})},4576:()=>{!function(){"use strict";!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.polyfillWrapFlushCallback){var e=HTMLElement;window.HTMLElement={HTMLElement:function(){return Reflect.construct(e,[],this.constructor)}}.HTMLElement,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}()}()},4636:(e,t,n)=>{"use strict";var r=n(5161),i=n(101);r(r.S+r.F*n(110)((function(){function e(){}return!(Array.of.call(e)instanceof e)})),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},4638:e=>{e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},4683:(e,t,n)=>{"use strict";var r=n(2846),i=n(4184),a=n(8360),o=n(4547);e.exports=n(7905)(Array,"Array",(function(e,t){this._t=o(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},4709:(e,t,n)=>{var r=n(5440)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},4747:(e,t,n)=>{"use strict";n(2671)("trimRight",(function(e){return function(){return e(this,2)}}),"trimEnd")},4785:(e,t,n)=>{var r=n(5440)("toPrimitive"),i=Date.prototype;r in i||n(6271)(i,r,n(6237))},4865:(e,t,n)=>{n(7495)("Int8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},4922:(e,t,n)=>{var r=n(5161);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},4996:(e,t,n)=>{"use strict";var r=n(609),i=n(7947),a=n(8719),o=[].slice,s={};e.exports=Function.bind||function(e){var t=r(this),n=o.call(arguments,1),l=function(){var r=n.concat(o.call(arguments));return this instanceof l?function(e,t,n){if(!(t in s)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";s[t]=Function("F,a","return new F("+r.join(",")+")")}return s[t](e,n)}(t,r.length,r):a(t,r,e)};return i(t.prototype)&&(l.prototype=t.prototype),l}},5002:(e,t,n)=>{t.f=n(5440)},5029:(e,t,n)=>{var r=n(5161);r(r.S,"Object",{create:n(3821)})},5042:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}(function(){"use strict";var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var i,a="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},o=function(e){e=["object"==("undefined"==typeof globalThis?"undefined":r(globalThis))&&globalThis,e,"object"==("undefined"==typeof window?"undefined":r(window))&&window,"object"==("undefined"==typeof self?"undefined":r(self))&&self,"object"==(void 0===n.g?"undefined":r(n.g))&&n.g];for(var t=0;t<e.length;++t){var i=e[t];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")}(this);function s(e,t){if(t)e:{var n=o;e=e.split(".");for(var r=0;r<e.length-1;r++){var i=e[r];if(!(i in n))break e;n=n[i]}(t=t(r=n[e=e[e.length-1]]))!=r&&null!=t&&a(n,e,{configurable:!0,writable:!0,value:t})}}function l(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function u(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function c(e){if(!(e instanceof Array)){e=u(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}if(s("Symbol",(function(e){function t(e,t){this.g=e,a(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t("jscomp_symbol_"+(r||"")+"_"+n++,r)}})),s("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),r=0;r<n.length;r++){var i=o[n[r]];"function"==typeof i&&"function"!=typeof i.prototype[e]&&a(i.prototype,e,{configurable:!0,writable:!0,value:function(){return l(t(this))}})}return e})),"function"==typeof Object.setPrototypeOf)i=Object.setPrototypeOf;else{var h;e:{var d={};try{d.__proto__={a:!0},h=d.a;break e}catch(I){}h=!1}i=h?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=i;function p(){this.u=!1,this.h=null,this.Oa=void 0,this.g=1,this.ea=0,this.i=null}function v(e){if(e.u)throw new TypeError("Generator is already running");e.u=!0}function m(e,t){e.i={ab:t,fb:!0},e.g=e.ea}function y(e,t){return e.g=3,{value:t}}function g(e){this.g=new p,this.h=e}function _(e,t,n,r){try{var i=t.call(e.g.h,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.u=!1,i;var a=i.value}catch(t){return e.g.h=null,m(e.g,t),b(e)}return e.g.h=null,r.call(e.g,a),b(e)}function b(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.u=!1,{value:t.value,done:!1}}catch(t){e.g.Oa=void 0,m(e.g,t)}if(e.g.u=!1,e.g.i){if(t=e.g.i,e.g.i=null,t.fb)throw t.ab;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function x(e){this.next=function(t){return v(e.g),e.g.h?t=_(e,e.g.h.next,t,e.g.O):(e.g.O(t),t=b(e)),t},this.throw=function(t){return v(e.g),e.g.h?t=_(e,e.g.h.throw,t,e.g.O):(m(e.g,t),t=b(e)),t},this.return=function(t){return function(e,t){v(e.g);var n=e.g.h;return n?_(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),b(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function S(e,t){return t=new x(new g(t)),f&&e.prototype&&f(t,e.prototype),t}p.prototype.O=function(e){this.Oa=e},p.prototype.return=function(e){this.i={return:e},this.g=this.ea},Array.from||(Array.from=function(e){return[].slice.call(e)}),Object.assign||(Object.assign=function(e){for(var t,n=[].slice.call(arguments,1),r=0;r<n.length;r++)if(t=n[r])for(var i=e,a=Object.keys(t),o=0;o<a.length;o++){var s=a[o];i[s]=t[s]}return e});var w=setTimeout;function E(){}function M(e){if(!(this instanceof M))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this.N=0,this.Ha=!1,this.I=void 0,this.ba=[],O(e,this)}function T(e,t){for(;3===e.N;)e=e.I;0===e.N?e.ba.push(t):(e.Ha=!0,B((function(){var n=1===e.N?t.hb:t.ib;if(null===n)(1===e.N?C:A)(t.promise,e.I);else{try{var r=n(e.I)}catch(e){return void A(t.promise,e)}C(t.promise,r)}})))}function C(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===r(t)||"function"==typeof t)){var n=t.then;if(t instanceof M)return e.N=3,e.I=t,void P(e);if("function"==typeof n)return void O(function(e,t){return function(){e.apply(t,arguments)}}(n,t),e)}e.N=1,e.I=t,P(e)}catch(t){A(e,t)}}function A(e,t){e.N=2,e.I=t,P(e)}function P(e){2===e.N&&0===e.ba.length&&B((function(){e.Ha||"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e.I)}));for(var t=0,n=e.ba.length;t<n;t++)T(e,e.ba[t]);e.ba=null}function k(e,t,n){this.hb="function"==typeof e?e:null,this.ib="function"==typeof t?t:null,this.promise=n}function O(e,t){var n=!1;try{e((function(e){n||(n=!0,C(t,e))}),(function(e){n||(n=!0,A(t,e))}))}catch(e){n||(n=!0,A(t,e))}}function R(e){return e&&"object"===r(e)&&e.constructor===M?e:new M((function(t){t(e)}))}M.prototype.catch=function(e){return this.then(null,e)},M.prototype.then=function(e,t){var n=new this.constructor(E);return T(this,new k(e,t,n)),n},M.prototype.finally=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))};var I,N,L,D,U,F,B="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){w(e,0)};if(!window.Promise){window.Promise=M,M.prototype.then=M.prototype.then,M.all=function(e){return new M((function(t,n){function i(e,s){try{if(s&&("object"===r(s)||"function"==typeof s)){var l=s.then;if("function"==typeof l)return void l.call(s,(function(t){i(e,t)}),n)}a[e]=s,0===--o&&t(a)}catch(e){n(e)}}if(!e||void 0===e.length)return n(new TypeError("Promise.all accepts an array"));var a=Array.prototype.slice.call(e);if(0===a.length)return t([]);for(var o=a.length,s=0;s<a.length;s++)i(s,a[s])}))},M.race=function(e){return new M((function(t,n){if(!e||void 0===e.length)return n(new TypeError("Promise.race accepts an array"));for(var r=0,i=e.length;r<i;r++)R(e[r]).then(t,n)}))},M.resolve=R,M.reject=function(e){return new M((function(t,n){n(e)}))};var z=document.createTextNode(""),j=[];new MutationObserver((function(){for(var e=j.length,t=0;t<e;t++)j[t]();j.splice(0,e)})).observe(z,{characterData:!0}),B=function(e){j.push(e),z.textContent=0<z.textContent.length?"":"a"}}!function(e,t){if(!(t in e)){var i=(void 0===n.g?"undefined":r(n.g))===r(i)?window:n.g,a=0,o=String(Math.random()),s="__symbol@@"+o,l=e.getOwnPropertyNames,u=e.getOwnPropertyDescriptor,c=e.create,h=e.keys,d=e.freeze||e,f=e.defineProperty,p=e.defineProperties,v=u(e,"getOwnPropertyNames"),m=e.prototype,y=m.hasOwnProperty,g=m.propertyIsEnumerable,_=m.toString,b=function(e,t,n){y.call(e,s)||f(e,s,{enumerable:!1,configurable:!1,writable:!1,value:{}}),e[s]["@@"+t]=n},x=function(){},S=function(e){return e!=s&&!y.call(C,e)},w=function(e){return e!=s&&y.call(C,e)},E=function(e){var t=String(e);return w(t)?y.call(this,t)&&!!this[s]&&this[s]["@@"+t]:g.call(this,e)},M=function(t){return f(m,t,{enumerable:!1,configurable:!0,get:x,set:function(e){R(this,t,{enumerable:!1,configurable:!0,writable:!0,value:e}),b(this,t,!0)}}),C[t]=f(e(t),"constructor",A),d(C[t])},T=function e(t){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return M("__symbol:".concat(t||"",o,++a))},C=c(null),A={value:T},P=function(e){return C[e]},k=function(e,t,n){var r=String(t);if(w(r)){if(t=R,n.enumerable){var i=c(n);i.enumerable=!1}else i=n;t(e,r,i),b(e,r,!!n.enumerable)}else f(e,t,n);return e},O=function(e){return l(e).filter(w).map(P)};v.value=k,f(e,"defineProperty",v),v.value=O,f(e,t,v),v.value=function(e){return l(e).filter(S)},f(e,"getOwnPropertyNames",v),v.value=function(e,t){var n=O(t);return n.length?h(t).concat(n).forEach((function(n){E.call(t,n)&&k(e,n,t[n])})):p(e,t),e},f(e,"defineProperties",v),v.value=E,f(m,"propertyIsEnumerable",v),v.value=T,f(i,"Symbol",v),v.value=function(e){return(e="__symbol:".concat("__symbol:",e,o))in m?C[e]:M(e)},f(T,"for",v),v.value=function(e){if(S(e))throw new TypeError(e+" is not a symbol");if(y.call(C,e)&&"__symbol:"===(e=e.slice(10)).slice(0,10)&&(e=e.slice(10))!==o)return 0<(e=e.slice(0,e.length-o.length)).length?e:void 0},f(T,"keyFor",v),v.value=function(e,t){var n=u(e,t);return n&&w(t)&&(n.enumerable=E.call(e,t)),n},f(e,"getOwnPropertyDescriptor",v),v.value=function(e,t){return 1===arguments.length||void 0===t?c(e):function(e,t){var n=c(e);return l(t).forEach((function(e){E.call(t,e)&&k(n,e,t[e])})),n}(e,t)},f(e,"create",v),v.value=function(){var e=_.call(this);return"[object String]"===e&&w(this)?"[object Symbol]":e},f(m,"toString",v);try{if(!0!==c(f({},"__symbol:",{get:function(){return f(this,"__symbol:",{value:!0})["__symbol:"]}}))["__symbol:"])throw"IE11";var R=f}catch(e){R=function(e,t,n){var r=u(m,t);delete m[t],f(e,t,n),f(m,t,r)}}}}(Object,"getOwnPropertySymbols"),I=Object,N=Symbol,D=I.defineProperty,U=I.prototype,F=U.toString,"iterator match replace search split hasInstance isConcatSpreadable unscopables species toPrimitive toStringTag".split(" ").forEach((function(e){e in N||(D(N,e,{value:N(e)}),"toStringTag"===e&&((L=I.getOwnPropertyDescriptor(U,"toString")).value=function(){var e=F.call(this),t=null==this?this:this[N.toStringTag];return null==t?e:"[object "+t+"]"},D(U,"toString",L)))})),function(e,t,n){function r(){return this}t[e]||(t[e]=function(){var t=0,n=this,i={next:function(){var e=n.length<=t;return e?{done:e}:{done:e,value:n[t++]}}};return i[e]=r,i}),n[e]||(n[e]=function(){var t=String.fromCodePoint,n=this,i=0,a=n.length,o={next:function(){var e=a<=i,r=e?"":t(n.codePointAt(i));return i+=r.length,e?{done:e}:{done:e,value:r}}};return o[e]=r,o})}(Symbol.iterator,Array.prototype,String.prototype);var H=Object.prototype.toString;Object.prototype.toString=function(){return void 0===this?"[object Undefined]":null===this?"[object Null]":H.call(this)},Object.keys=function(e){return Object.getOwnPropertyNames(e).filter((function(t){return(t=Object.getOwnPropertyDescriptor(e,t))&&t.enumerable}))},String.prototype[Symbol.iterator]&&String.prototype.codePointAt||(String.prototype[Symbol.iterator]=function e(){var t,n=this;return S(e,(function(e){if(1==e.g&&(t=0),3!=e.g)return t<n.length?e=y(e,n[t]):(e.g=0,e=void 0),e;t++,e.g=2}))}),Set.prototype[Symbol.iterator]||(Set.prototype[Symbol.iterator]=function e(){var t,n,r=this;return S(e,(function(e){if(1==e.g&&(t=[],r.forEach((function(e){t.push(e)})),n=0),3!=e.g)return n<t.length?e=y(e,t[n]):(e.g=0,e=void 0),e;n++,e.g=2}))}),Map.prototype[Symbol.iterator]||(Map.prototype[Symbol.iterator]=function e(){var t,n,r=this;return S(e,(function(e){if(1==e.g&&(t=[],r.forEach((function(e,n){t.push([n,e])})),n=0),3!=e.g)return n<t.length?e=y(e,t[n]):(e.g=0,e=void 0),e;n++,e.g=2}))});var V=document.createEvent("Event");if(V.initEvent("foo",!0,!0),V.preventDefault(),!V.defaultPrevented){var G=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(G.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var W=/Trident/.test(navigator.userAgent);if(!window.Event||W&&"function"!=typeof window.Event){var X=window.Event;if(window.Event=function(e,t){t=t||{};var n=document.createEvent("Event");return n.initEvent(e,!!t.bubbles,!!t.cancelable),n},X){for(var q in X)window.Event[q]=X[q];window.Event.prototype=X.prototype}}if((!window.CustomEvent||W&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n},window.CustomEvent.prototype=window.Event.prototype),!window.MouseEvent||W&&"function"!=typeof window.MouseEvent){var Y=window.MouseEvent;if(window.MouseEvent=function(e,t){t=t||{};var n=document.createEvent("MouseEvent");return n.initMouseEvent(e,!!t.bubbles,!!t.cancelable,t.view||window,t.detail,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget),n},Y)for(var J in Y)window.MouseEvent[J]=Y[J];window.MouseEvent.prototype=Y.prototype}var Z,K=function(){function e(){i++}var t=!1,n=!1,r={get capture(){return t=!0},get once(){return n=!0}},i=0,a=document.createElement("div");a.addEventListener("click",e,r);var o=t&&n;return o&&(a.dispatchEvent(new Event("click")),a.dispatchEvent(new Event("click")),o=1==i),a.removeEventListener("click",e,r),o}(),$=null!==(Z=window.EventTarget)&&void 0!==Z?Z:window.Node;if(!K&&"addEventListener"in $.prototype){var Q=function(e){if(!e||"object"!==r(e)&&"function"!=typeof e){var t=!!e;e=!1}else t=!!e.capture,e=!!e.once;return{capture:t,once:e}},ee=$.prototype.addEventListener,te=$.prototype.removeEventListener,ne=new WeakMap,re=new WeakMap,ie=function(e,t,n){var r=n?ne:re;return void 0===(n=r.get(e))&&r.set(e,n=new Map),void 0===(e=n.get(t))&&n.set(t,e=new WeakMap),e};$.prototype.addEventListener=function(e,t,n){var r=this;if(null!=t){var i=(n=Q(n)).capture;n=n.once;var a=ie(this,e,i);if(!a.has(t)){var o=n?function(n){return a.delete(t),te.call(r,e,o,i),"function"==typeof t?t.call(r,n):"function"==typeof(null==t?void 0:t.handleEvent)?t.handleEvent(n):void 0}:null;a.set(t,o),ee.call(this,e,null!=o?o:t,i)}}},$.prototype.removeEventListener=function(e,t,n){if(null!=t){n=Q(n).capture;var r=ie(this,e,n),i=r.get(t);void 0!==i&&(r.delete(t),te.call(this,e,null!=i?i:t,n))}}}Object.getOwnPropertyDescriptor(Node.prototype,"baseURI")||Object.defineProperty(Node.prototype,"baseURI",{get:function(){var e=(this.ownerDocument||this).querySelector("base[href]");return e&&e.href||window.location.href},configurable:!0,enumerable:!0});var ae,oe,se=Element.prototype,le=null!==(ae=Object.getOwnPropertyDescriptor(se,"attributes"))&&void 0!==ae?ae:Object.getOwnPropertyDescriptor(Node.prototype,"attributes"),ue=null!==(oe=null==le?void 0:le.get)&&void 0!==oe?oe:function(){return this.attributes},ce=Array.prototype.map;se.hasOwnProperty("getAttributeNames")||(se.getAttributeNames=function(){return ce.call(ue.call(this),(function(e){return e.name}))});var he,de=Element.prototype;de.hasOwnProperty("matches")||(de.matches=null!==(he=de.webkitMatchesSelector)&&void 0!==he?he:de.msMatchesSelector);var fe=Node.prototype.appendChild;function pe(e){(e=e.prototype).hasOwnProperty("append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];for(n=(t=u(t)).next();!n.done;n=t.next())n=n.value,fe.call(this,"string"==typeof n?document.createTextNode(n):n)}})}pe(Document),pe(DocumentFragment),pe(Element);var ve,me,ye=Node.prototype.insertBefore,ge=null!==(me=null===(ve=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild"))||void 0===ve?void 0:ve.get)&&void 0!==me?me:function(){return this.firstChild};function _e(e){(e=e.prototype).hasOwnProperty("prepend")||Object.defineProperty(e,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];n=ge.call(this);for(var r=(t=u(t)).next();!r.done;r=t.next())r=r.value,ye.call(this,"string"==typeof r?document.createTextNode(r):r,n)}})}_e(Document),_e(DocumentFragment),_e(Element);var be,xe,Se=Node.prototype.appendChild,we=Node.prototype.removeChild,Ee=null!==(xe=null===(be=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild"))||void 0===be?void 0:be.get)&&void 0!==xe?xe:function(){return this.firstChild};function Me(e){(e=e.prototype).hasOwnProperty("replaceChildren")||Object.defineProperty(e,"replaceChildren",{configurable:!0,enumerable:!0,writable:!0,value:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];for(;null!==(n=Ee.call(this));)we.call(this,n);for(n=(t=u(t)).next();!n.done;n=t.next())n=n.value,Se.call(this,"string"==typeof n?document.createTextNode(n):n)}})}Me(Document),Me(DocumentFragment),Me(Element);var Te,Ce,Ae,Pe,ke=Node.prototype.insertBefore,Oe=null!==(Ce=null===(Te=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode"))||void 0===Te?void 0:Te.get)&&void 0!==Ce?Ce:function(){return this.parentNode},Re=null!==(Pe=null===(Ae=Object.getOwnPropertyDescriptor(Node.prototype,"nextSibling"))||void 0===Ae?void 0:Ae.get)&&void 0!==Pe?Pe:function(){return this.nextSibling};function Ie(e){(e=e.prototype).hasOwnProperty("after")||Object.defineProperty(e,"after",{configurable:!0,enumerable:!0,writable:!0,value:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=Oe.call(this)))for(var r=Re.call(this),i=(t=u(t)).next();!i.done;i=t.next())i=i.value,ke.call(n,"string"==typeof i?document.createTextNode(i):i,r)}})}Ie(CharacterData),Ie(Element);var Ne,Le,De=Node.prototype.insertBefore,Ue=null!==(Le=null===(Ne=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode"))||void 0===Ne?void 0:Ne.get)&&void 0!==Le?Le:function(){return this.parentNode};function Fe(e){(e=e.prototype).hasOwnProperty("before")||Object.defineProperty(e,"before",{configurable:!0,enumerable:!0,writable:!0,value:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=Ue.call(this)))for(var r=(t=u(t)).next();!r.done;r=t.next())r=r.value,De.call(n,"string"==typeof r?document.createTextNode(r):r,this)}})}Fe(CharacterData),Fe(Element);var Be,ze,je=Node.prototype.removeChild,He=null!==(ze=null===(Be=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode"))||void 0===Be?void 0:Be.get)&&void 0!==ze?ze:function(){return this.parentNode};function Ve(e){(e=e.prototype).hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=He.call(this);e&&je.call(e,this)}})}Ve(CharacterData),Ve(Element);var Ge,We,Xe=Node.prototype.insertBefore,qe=Node.prototype.removeChild,Ye=null!==(We=null===(Ge=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode"))||void 0===Ge?void 0:Ge.get)&&void 0!==We?We:function(){return this.parentNode};function Je(e){(e=e.prototype).hasOwnProperty("replaceWith")||Object.defineProperty(e,"replaceWith",{configurable:!0,enumerable:!0,writable:!0,value:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=Ye.call(this))){for(var r=(t=u(t)).next();!r.done;r=t.next())r=r.value,Xe.call(n,"string"==typeof r?document.createTextNode(r):r,this);qe.call(n,this)}}})}Je(CharacterData),Je(Element);var Ze=window.Element.prototype,Ke=window.HTMLElement.prototype,$e=window.SVGElement.prototype;!Ke.hasOwnProperty("classList")||Ze.hasOwnProperty("classList")||$e.hasOwnProperty("classList")||Object.defineProperty(Ze,"classList",Object.getOwnPropertyDescriptor(Ke,"classList"));var Qe=Element.prototype,et=Element.prototype.hasAttribute,tt=Element.prototype.setAttribute,nt=Element.prototype.removeAttribute;Qe.hasOwnProperty("toggleAttribute")||(Qe.toggleAttribute=function(e,t){return void 0===t?et.call(this,e)?(nt.call(this,e),!1):(tt.call(this,e,""),!0):t?(et.call(this,e)||tt.call(this,e,""),!0):(nt.call(this,e),!1)});var rt=document.createElement("style");rt.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var it=document.querySelector("head");it.insertBefore(rt,it.firstChild);var at=window;at.WebComponents=at.WebComponents||{flags:{}};var ot=document.querySelector('script[src*="webcomponents-bundle"]'),st=/wc-(.+)/,lt={};if(!lt.noOpts){if(location.search.slice(1).split("&").forEach((function(e){var t;(e=e.split("="))[0]&&(t=e[0].match(st))&&(lt[t[1]]=e[1]||!0)})),ot)for(var ut=0,ct=void 0;ct=ot.attributes[ut];ut++)"src"!==ct.name&&(lt[ct.name]=ct.value||!0);var ht={};lt.log&&lt.log.split&&lt.log.split(",").forEach((function(e){ht[e]=!0})),lt.log=ht}at.WebComponents.flags=lt;var dt=lt.shadydom;if(dt){at.ShadyDOM=at.ShadyDOM||{},at.ShadyDOM.force=dt;var ft=lt.noPatch;at.ShadyDOM.noPatch="true"===ft||ft}var pt=lt.register||lt.ce;function vt(){}function mt(e){return e.__shady||(e.__shady=new vt),e.__shady}function yt(e){return e&&e.__shady}pt&&window.customElements&&(at.customElements.forcePolyfill=pt),function(){function e(){}function t(e,t){if(!e.childNodes.length)return[];switch(e.nodeType){case Node.DOCUMENT_NODE:return v.call(e,t);case Node.DOCUMENT_FRAGMENT_NODE:return m.call(e,t);default:return p.call(e,t)}}var n="undefined"==typeof HTMLTemplateElement,r=!(document.createDocumentFragment().cloneNode()instanceof DocumentFragment),i=!1;/Trident/.test(navigator.userAgent)&&function(){function e(e,t){if(e instanceof DocumentFragment)for(var r;r=e.firstChild;)n.call(this,r,t);else n.call(this,e,t);return e}i=!0;var t=Node.prototype.cloneNode;Node.prototype.cloneNode=function(e){return e=t.call(this,e),this instanceof DocumentFragment&&(e.__proto__=DocumentFragment.prototype),e},DocumentFragment.prototype.querySelectorAll=HTMLElement.prototype.querySelectorAll,DocumentFragment.prototype.querySelector=HTMLElement.prototype.querySelector,Object.defineProperties(DocumentFragment.prototype,{nodeType:{get:function(){return Node.DOCUMENT_FRAGMENT_NODE},configurable:!0},localName:{get:function(){},configurable:!0},nodeName:{get:function(){return"#document-fragment"},configurable:!0}});var n=Node.prototype.insertBefore;Node.prototype.insertBefore=e;var r=Node.prototype.appendChild;Node.prototype.appendChild=function(t){return t instanceof DocumentFragment?e.call(this,t,null):r.call(this,t),t};var a=Node.prototype.removeChild,o=Node.prototype.replaceChild;Node.prototype.replaceChild=function(t,n){return t instanceof DocumentFragment?(e.call(this,t,n),a.call(this,n)):o.call(this,t,n),n},Document.prototype.createDocumentFragment=function(){var e=this.createElement("df");return e.__proto__=DocumentFragment.prototype,e};var s=Document.prototype.importNode;Document.prototype.importNode=function(e,t){return t=s.call(this,e,t||!1),e instanceof DocumentFragment&&(t.__proto__=DocumentFragment.prototype),t}}();var a=Node.prototype.cloneNode,o=Document.prototype.createElement,s=Document.prototype.importNode,l=Node.prototype.removeChild,u=Node.prototype.appendChild,c=Node.prototype.replaceChild,h=DOMParser.prototype.parseFromString,d=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML")||{get:function(){return this.innerHTML},set:function(e){this.innerHTML=e}},f=Object.getOwnPropertyDescriptor(window.Node.prototype,"childNodes")||{get:function(){return this.childNodes}},p=Element.prototype.querySelectorAll,v=Document.prototype.querySelectorAll,m=DocumentFragment.prototype.querySelectorAll,y=function(){if(!n){var e=document.createElement("template"),t=document.createElement("template");return t.content.appendChild(document.createElement("div")),e.content.appendChild(t),0===(e=e.cloneNode(!0)).content.childNodes.length||0===e.content.firstChild.content.childNodes.length||r}}();if(n){var g=document.implementation.createHTMLDocument("template"),_=!0,b=document.createElement("style");b.textContent="template{display:none;}";var x=document.head;x.insertBefore(b,x.firstElementChild),e.prototype=Object.create(HTMLElement.prototype);var S=!document.createElement("div").hasOwnProperty("innerHTML");e.Z=function(t){if(!t.content&&t.namespaceURI===document.documentElement.namespaceURI){t.content=g.createDocumentFragment();for(var n;n=t.firstChild;)u.call(t.content,n);if(S)t.__proto__=e.prototype;else if(t.cloneNode=function(t){return e.va(this,t)},_)try{E(t),M(t)}catch(e){_=!1}e.bootstrap(t.content)}};var w={option:["select"],thead:["table"],col:["colgroup","table"],tr:["tbody","table"],th:["tr","tbody","table"],td:["tr","tbody","table"]},E=function(t){Object.defineProperty(t,"innerHTML",{get:function(){return O(this)},set:function(t){var n=w[(/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(t)||["",""])[1].toLowerCase()];if(n)for(var r=0;r<n.length;r++)t="<"+n[r]+">"+t+"</"+n[r]+">";for(g.body.innerHTML=t,e.bootstrap(g);this.content.firstChild;)l.call(this.content,this.content.firstChild);if(t=g.body,n)for(r=0;r<n.length;r++)t=t.lastChild;for(;t.firstChild;)u.call(this.content,t.firstChild)},configurable:!0})},M=function(e){Object.defineProperty(e,"outerHTML",{get:function(){return"<template>"+this.innerHTML+"</template>"},set:function(e){if(!this.parentNode)throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");for(g.body.innerHTML=e,e=this.ownerDocument.createDocumentFragment();g.body.firstChild;)u.call(e,g.body.firstChild);c.call(this.parentNode,e,this)},configurable:!0})};E(e.prototype),M(e.prototype),e.bootstrap=function(n){for(var r,i=0,a=(n=t(n,"template")).length;i<a&&(r=n[i]);i++)e.Z(r)},document.addEventListener("DOMContentLoaded",(function(){e.bootstrap(document)})),Document.prototype.createElement=function(){var t=o.apply(this,arguments);return"template"===t.localName&&e.Z(t),t},DOMParser.prototype.parseFromString=function(){var t=h.apply(this,arguments);return e.bootstrap(t),t},Object.defineProperty(HTMLElement.prototype,"innerHTML",{get:function(){return O(this)},set:function(t){d.set.call(this,t),e.bootstrap(this)},configurable:!0,enumerable:!0});var T=/[&\u00A0"]/g,C=/[&\u00A0<>]/g,A=function(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}},P=(b=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t})("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),k=b("style script xmp iframe noembed noframes plaintext noscript".split(" ")),O=function(e,t){"template"===e.localName&&(e=e.content);for(var n,r="",i=t?t(e):f.get.call(e),a=0,o=i.length;a<o&&(n=i[a]);a++){e:{var s=n,l=e,u=t;switch(s.nodeType){case Node.ELEMENT_NODE:for(var c=s.localName,h="<"+c,d=s.attributes,p=0;l=d[p];p++)h+=" "+l.name+'="'+l.value.replace(T,A)+'"';h+=">",s=P[c]?h:h+O(s,u)+"</"+c+">";break e;case Node.TEXT_NODE:s=s.data,s=l&&k[l.localName]?s:s.replace(C,A);break e;case Node.COMMENT_NODE:s="\x3c!--"+s.data+"--\x3e";break e;default:throw window.console.error(s),Error("not implemented")}}r+=s}return r}}if(n||y){e.va=function(e,t){var n=a.call(e,!1);return this.Z&&this.Z(n),t&&(u.call(n.content,a.call(e.content,!0)),R(n.content,e.content)),n};var R=function(n,r){if(r.querySelectorAll&&0!==(r=t(r,"template")).length)for(var i,a,o=0,s=(n=t(n,"template")).length;o<s;o++)a=r[o],i=n[o],e&&e.Z&&e.Z(a),c.call(i.parentNode,I.call(a,!0),i)},I=Node.prototype.cloneNode=function(t){if(!i&&r&&this instanceof DocumentFragment){if(!t)return this.ownerDocument.createDocumentFragment();var n=N.call(this.ownerDocument,this,!0)}else n=this.nodeType===Node.ELEMENT_NODE&&"template"===this.localName&&this.namespaceURI==document.documentElement.namespaceURI?e.va(this,t):a.call(this,t);return t&&R(n,this),n},N=Document.prototype.importNode=function(n,r){if(r=r||!1,"template"===n.localName)return e.va(n,r);var i=s.call(this,n,r);if(r){R(i,n),n=t(i,'script:not([type]),script[type="application/javascript"],script[type="text/javascript"]');for(var a,l=0;l<n.length;l++){a=n[l],(r=o.call(document,"script")).textContent=a.textContent;for(var u,h=a.attributes,d=0;d<h.length;d++)u=h[d],r.setAttribute(u.name,u.value);c.call(a.parentNode,r,a)}}return i}}n&&(window.HTMLTemplateElement=e)}(),vt.prototype.toJSON=function(){return{}};var gt=window.ShadyDOM||{};gt.cb=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var _t,bt=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");gt.D=!!(bt&&bt.configurable&&bt.get),gt.Ba=gt.force||!gt.cb,gt.J=gt.noPatch||!1,gt.ha=gt.preferPerformance,gt.Da="on-demand"===gt.J;var xt=gt.querySelectorImplementation;function St(){return Document.prototype.msElementsFromPoint?"msElementsFromPoint":"elementsFromPoint"}function wt(e){return(e=yt(e))&&void 0!==e.firstChild}function Et(e){return e instanceof ShadowRoot}function Mt(e){return(e=(e=yt(e))&&e.root)&&_i(e)}_t=-1<["native","selectorEngine"].indexOf(xt)?xt:void 0,gt.wb=_t,gt.Ra=navigator.userAgent.match("Trident");var Tt=Element.prototype,Ct=Tt.matches||Tt.matchesSelector||Tt.mozMatchesSelector||Tt.msMatchesSelector||Tt.oMatchesSelector||Tt.webkitMatchesSelector,At=document.createTextNode(""),Pt=0,kt=[];function Ot(e){kt.push(e),At.textContent=Pt++}new MutationObserver((function(){for(;kt.length;)try{kt.shift()()}catch(e){throw At.textContent=Pt++,e}})).observe(At,{characterData:!0});var Rt=document.contains?function(e,t){return e.__shady_native_contains(t)}:function(e,t){return e===t||e.documentElement&&e.documentElement.__shady_native_contains(t)};function It(e,t){for(;t;){if(t==e)return!0;t=t.__shady_parentNode}return!1}function Nt(e){for(var t=e.length-1;0<=t;t--){var n=e[t],r=n.getAttribute("id")||n.getAttribute("name");r&&"length"!==r&&isNaN(r)&&(e[r]=n)}return e.item=function(t){return e[t]},e.namedItem=function(t){if("length"!==t&&isNaN(t)&&e[t])return e[t];for(var n=u(e),r=n.next();!r.done;r=n.next())if(((r=r.value).getAttribute("id")||r.getAttribute("name"))==t)return r;return null},e}function Lt(e){var t=[];for(e=e.__shady_native_firstChild;e;e=e.__shady_native_nextSibling)t.push(e);return t}function Dt(e){var t=[];for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling)t.push(e);return t}function Ut(e,t,n){if(n.configurable=!0,n.value)e[t]=n.value;else try{Object.defineProperty(e,t,n)}catch(e){}}function Ft(e,t,n,r){for(var i in n=void 0===n?"":n,t)r&&0<=r.indexOf(i)||Ut(e,n+i,t[i])}function Bt(e,t){for(var n in t)n in e&&Ut(e,n,t[n])}function zt(e){var t={};return Object.getOwnPropertyNames(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t}function jt(e,t){for(var n,r=Object.getOwnPropertyNames(t),i=0;i<r.length;i++)e[n=r[i]]=t[n]}function Ht(e){return e instanceof Node?e:document.createTextNode(""+e)}function Vt(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(1===t.length)return Ht(t[0]);n=document.createDocumentFragment();for(var r=(t=u(t)).next();!r.done;r=t.next())n.appendChild(Ht(r.value));return n}function Gt(e){var t;for(t=void 0===t?1:t;0<t;t--)e=e.reduce((function(e,t){return Array.isArray(t)?e.push.apply(e,c(t)):e.push(t),e}),[]);return e}var Wt,Xt=[];function qt(e){Wt||(Wt=!0,Ot(Yt)),Xt.push(e)}function Yt(){Wt=!1;for(var e=!!Xt.length;Xt.length;)Xt.shift()();return e}function Jt(){this.g=!1,this.addedNodes=[],this.removedNodes=[],this.qa=new Set}Yt.list=Xt,Jt.prototype.flush=function(){if(this.g){this.g=!1;var e=this.takeRecords();e.length&&this.qa.forEach((function(t){t(e)}))}},Jt.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var e=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];return this.addedNodes=[],this.removedNodes=[],e}return[]};var Zt=/[&\u00A0"]/g,Kt=/[&\u00A0<>]/g;function $t(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}}function Qt(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t}var en=Qt("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),tn=Qt("style script xmp iframe noembed noframes plaintext noscript".split(" "));function nn(e,t){"template"===e.localName&&(e=e.content);for(var n="",r=t?t(e):e.childNodes,i=0,a=r.length,o=void 0;i<a&&(o=r[i]);i++){e:{var s=o,l=e,u=t;switch(s.nodeType){case Node.ELEMENT_NODE:for(var c,h="<"+(l=s.localName),d=s.attributes,f=0;c=d[f];f++)h+=" "+c.name+'="'+c.value.replace(Zt,$t)+'"';h+=">",s=en[l]?h:h+nn(s,u)+"</"+l+">";break e;case Node.TEXT_NODE:s=s.data,s=l&&tn[l.localName]?s:s.replace(Kt,$t);break e;case Node.COMMENT_NODE:s="\x3c!--"+s.data+"--\x3e";break e;default:throw window.console.error(s),Error("not implemented")}}n+=s}return n}var rn=gt.D,an={querySelector:function(e){return this.__shady_native_querySelector(e)},querySelectorAll:function(e){return this.__shady_native_querySelectorAll(e)}},on={};function sn(e){on[e]=function(t){return t["__shady_native_"+e]}}function ln(e,t){for(var n in Ft(e,t,"__shady_native_"),t)sn(n)}function un(e,t){t=void 0===t?[]:t;for(var n=0;n<t.length;n++){var r=t[n],i=Object.getOwnPropertyDescriptor(e,r);i&&(Object.defineProperty(e,"__shady_native_"+r,i),i.value?an[r]||(an[r]=i.value):sn(r))}}var cn=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),hn=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1),dn=document.implementation.createHTMLDocument("inert");function fn(e){for(var t;t=e.__shady_native_firstChild;)e.__shady_native_removeChild(t)}var pn=["firstElementChild","lastElementChild","children","childElementCount"],vn=["querySelector","querySelectorAll","append","prepend","replaceChildren"],mn=zt({get childNodes(){return this.__shady_childNodes},get firstChild(){return this.__shady_firstChild},get lastChild(){return this.__shady_lastChild},get childElementCount(){return this.__shady_childElementCount},get children(){return this.__shady_children},get firstElementChild(){return this.__shady_firstElementChild},get lastElementChild(){return this.__shady_lastElementChild},get shadowRoot(){return this.__shady_shadowRoot}}),yn=zt({get textContent(){return this.__shady_textContent},set textContent(e){this.__shady_textContent=e},get innerHTML(){return this.__shady_innerHTML},set innerHTML(e){this.__shady_innerHTML=e}}),gn=zt({get parentElement(){return this.__shady_parentElement},get parentNode(){return this.__shady_parentNode},get nextSibling(){return this.__shady_nextSibling},get previousSibling(){return this.__shady_previousSibling},get nextElementSibling(){return this.__shady_nextElementSibling},get previousElementSibling(){return this.__shady_previousElementSibling},get className(){return this.__shady_className},set className(e){this.__shady_className=e}});function _n(e){for(var t in e){var n=e[t];n&&(n.enumerable=!1)}}_n(mn),_n(yn),_n(gn);var bn=gt.D||!0===gt.J,xn=bn?function(){}:function(e){var t=mt(e);t.Ta||(t.Ta=!0,Bt(e,gn))},Sn=bn?function(){}:function(e){var t=mt(e);t.Sa||(t.Sa=!0,Bt(e,mn),window.customElements&&window.customElements.polyfillWrapFlushCallback&&!gt.J||Bt(e,yn))},wn="__eventWrappers"+Date.now(),En=function(){var e=Object.getOwnPropertyDescriptor(Event.prototype,"composed");return e?function(t){return e.get.call(t)}:null}(),Mn=function(){function e(){}var t=!1,n={get capture(){return t=!0,!1}};return window.addEventListener("test",e,n),window.removeEventListener("test",e,n),t}();function Tn(e){if(null===e||"object"!==r(e)&&"function"!=typeof e)var t=!!e,n=!1;else{t=!!e.capture,n=!!e.once;var i=e.U}return{Pa:i,capture:t,once:n,Na:Mn?e:t}}var Cn={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},An={DOMAttrModified:!0,DOMAttributeNameChanged:!0,DOMCharacterDataModified:!0,DOMElementNameChanged:!0,DOMNodeInserted:!0,DOMNodeInsertedIntoDocument:!0,DOMNodeRemoved:!0,DOMNodeRemovedFromDocument:!0,DOMSubtreeModified:!0};function Pn(e){return e instanceof Node?e.__shady_getRootNode():e}function kn(e,t){var n=[],r=e;for(e=Pn(e);r;)n.push(r),r=r.__shady_assignedSlot?r.__shady_assignedSlot:r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host&&(t||r!==e)?r.host:r.__shady_parentNode;return n[n.length-1]===document&&n.push(window),n}function On(e,t){if(!Et)return e;e=kn(e,!0);for(var n,r,i=0,a=void 0,o=void 0;i<t.length;i++)if((r=Pn(n=t[i]))!==a&&(o=e.indexOf(r),a=r),!Et(r)||-1<o)return n}var Rn={get composed(){return void 0===this.__composed&&(En?this.__composed="focusin"===this.type||"focusout"===this.type||En(this):!1!==this.isTrusted&&(this.__composed=Cn[this.type])),this.__composed||!1},composedPath:function(){return this.__composedPath||(this.__composedPath=kn(this.__target,this.composed)),this.__composedPath},get target(){return On(this.currentTarget||this.__previousCurrentTarget,this.composedPath())},get relatedTarget(){return this.__relatedTarget?(this.__relatedTargetComposedPath||(this.__relatedTargetComposedPath=kn(this.__relatedTarget,!0)),On(this.currentTarget||this.__previousCurrentTarget,this.__relatedTargetComposedPath)):null},stopPropagation:function(){Event.prototype.stopPropagation.call(this),this.ua=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this),this.ua=this.__immediatePropagationStopped=!0}},In=gt.D&&Object.getOwnPropertyDescriptor(Event.prototype,"eventPhase");function Nn(e){function t(t,n){return(t=new e(t,n)).__composed=n&&!!n.composed,t}return t.__proto__=e,t.prototype=e.prototype,t}In&&(Object.defineProperty(Rn,"eventPhase",{get:function(){return this.currentTarget===this.target?Event.AT_TARGET:this.__shady_native_eventPhase},enumerable:!0,configurable:!0}),Object.defineProperty(Rn,"__shady_native_eventPhase",In));var Ln={focus:!0,blur:!0};function Dn(e){return e.__target!==e.target||e.__relatedTarget!==e.relatedTarget}function Un(e,t,n){if(n=t.__handlers&&t.__handlers[e.type]&&t.__handlers[e.type][n])for(var r,i=0;(r=n[i])&&(!Dn(e)||e.target!==e.relatedTarget)&&(r.call(t,e),!e.__immediatePropagationStopped);i++);}var Fn=new Event("e").hasOwnProperty("currentTarget");function Bn(e){var t=(e=Fn?Object.create(e):e).composedPath(),n=t.map((function(e){return On(e,t)})),r=e.bubbles,i=Object.getOwnPropertyDescriptor(e,"currentTarget");Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:function(){return l}});var a=Event.CAPTURING_PHASE,o=Object.getOwnPropertyDescriptor(e,"eventPhase");Object.defineProperty(e,"eventPhase",{configurable:!0,enumerable:!0,get:function(){return a}});try{for(var s=t.length-1;0<=s;s--){var l=t[s];if(a=l===n[s]?Event.AT_TARGET:Event.CAPTURING_PHASE,Un(e,l,"capture"),e.ua)return}for(s=0;s<t.length;s++){var u=(l=t[s])===n[s];if((u||r)&&(a=u?Event.AT_TARGET:Event.BUBBLING_PHASE,Un(e,l,"bubble"),e.ua))break}}finally{Fn||(i?Object.defineProperty(e,"currentTarget",i):delete e.currentTarget,o?Object.defineProperty(e,"eventPhase",o):delete e.eventPhase)}}function zn(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i],o=a.type,s=a.capture;if(t===a.node&&n===o&&r===s)return i}return-1}function jn(e){return Yt(),!gt.ha&&this instanceof Node&&!Rt(document,this)?(e.__target||Wn(e,this),Bn(e)):this.__shady_native_dispatchEvent(e)}function Hn(e,t,n){var i=this,a=Tn(n),o=a.capture,s=a.once,l=a.Pa;if(a=a.Na,t){var u=r(t);if(("function"===u||"object"===u)&&("object"!==u||t.handleEvent&&"function"==typeof t.handleEvent)){if(An[e])return this.__shady_native_addEventListener(e,t,a);var c=l||this;if(l=t[wn]){if(-1<zn(l,c,e,o))return}else t[wn]=[];l=function(r){if(s&&i.__shady_removeEventListener(e,t,n),r.__target||Wn(r),c!==i){var a=Object.getOwnPropertyDescriptor(r,"currentTarget");Object.defineProperty(r,"currentTarget",{get:function(){return c},configurable:!0});var l=Object.getOwnPropertyDescriptor(r,"eventPhase");Object.defineProperty(r,"eventPhase",{configurable:!0,enumerable:!0,get:function(){return o?Event.CAPTURING_PHASE:Event.BUBBLING_PHASE}})}if(r.__previousCurrentTarget=r.currentTarget,(!Et(c)&&"slot"!==c.localName||-1!=r.composedPath().indexOf(c))&&(r.composed||-1<r.composedPath().indexOf(c)))if(Dn(r)&&r.target===r.relatedTarget)r.eventPhase===Event.BUBBLING_PHASE&&r.stopImmediatePropagation();else if(r.eventPhase===Event.CAPTURING_PHASE||r.bubbles||r.target===c||c instanceof Window){var h="function"===u?t.call(c,r):t.handleEvent&&t.handleEvent(r);return c!==i&&(a?(Object.defineProperty(r,"currentTarget",a),a=null):delete r.currentTarget,l?(Object.defineProperty(r,"eventPhase",l),l=null):delete r.eventPhase),h}},t[wn].push({node:c,type:e,capture:o,ub:l}),this.__handlers=this.__handlers||{},this.__handlers[e]=this.__handlers[e]||{capture:[],bubble:[]},this.__handlers[e][o?"capture":"bubble"].push(l),Ln[e]||this.__shady_native_addEventListener(e,l,a)}}}function Vn(e,t,n){if(t){var r=Tn(n);n=r.capture;var i=r.Pa;if(r=r.Na,An[e])return this.__shady_native_removeEventListener(e,t,r);var a=i||this;i=void 0;var o=null;try{o=t[wn]}catch(e){}o&&-1<(a=zn(o,a,e,n))&&(i=o.splice(a,1)[0].ub,o.length||(t[wn]=void 0)),this.__shady_native_removeEventListener(e,i||t,r),i&&this.__handlers&&this.__handlers[e]&&-1<(t=(e=this.__handlers[e][n?"capture":"bubble"]).indexOf(i))&&e.splice(t,1)}}var Gn=zt(Rn);function Wn(e,t){if(t=void 0===t?e.target:t,e.__target=t,e.__relatedTarget=e.relatedTarget,gt.D){if(!(t=Object.getPrototypeOf(e)).hasOwnProperty("__shady_patchedProto")){var n=Object.create(t);n.__shady_sourceProto=t,Ft(n,Gn),t.__shady_patchedProto=n}e.__proto__=t.__shady_patchedProto}else Ft(e,Gn)}var Xn=Nn(Event),qn=Nn(CustomEvent),Yn=Nn(MouseEvent),Jn=Object.getOwnPropertyNames(Element.prototype).filter((function(e){return"on"===e.substring(0,2)})),Zn=Object.getOwnPropertyNames(HTMLElement.prototype).filter((function(e){return"on"===e.substring(0,2)}));function Kn(e){return{set:function(t){var n=mt(this),r=e.substring(2);n.T||(n.T={}),n.T[e]&&this.removeEventListener(r,n.T[e]),this.__shady_addEventListener(r,t),n.T[e]=t},get:function(){var t=yt(this);return t&&t.T&&t.T[e]},configurable:!0}}function $n(e,t){return{index:e,ia:[],pa:t}}function Qn(e,t,n,r){var i=0,a=0,o=0,s=0,l=Math.min(t-i,r-a);if(0==i&&0==a)e:{for(o=0;o<l;o++)if(e[o]!==n[o])break e;o=l}if(t==e.length&&r==n.length){s=e.length;for(var u=n.length,c=0;c<l-o&&er(e[--s],n[--u]);)c++;s=c}if(a+=o,r-=s,0==(t-=s)-(i+=o)&&0==r-a)return[];if(i==t){for(t=$n(i,0);a<r;)t.ia.push(n[a++]);return[t]}if(a==r)return[$n(i,t-i)];for(r=r-(o=a)+1,s=t-(l=i)+1,t=Array(r),u=0;u<r;u++)t[u]=Array(s),t[u][0]=u;for(u=0;u<s;u++)t[0][u]=u;for(u=1;u<r;u++)for(c=1;c<s;c++)if(e[l+c-1]===n[o+u-1])t[u][c]=t[u-1][c-1];else{var h=t[u-1][c]+1,d=t[u][c-1]+1;t[u][c]=h<d?h:d}for(l=t.length-1,o=t[0].length-1,r=t[l][o],e=[];0<l||0<o;)0==l?(e.push(2),o--):0==o?(e.push(3),l--):(s=t[l-1][o-1],(h=(u=t[l-1][o])<(c=t[l][o-1])?u<s?u:s:c<s?c:s)==s?(s==r?e.push(0):(e.push(1),r=s),l--,o--):h==u?(e.push(3),l--,r=u):(e.push(2),o--,r=c));for(e.reverse(),t=void 0,l=[],o=0;o<e.length;o++)switch(e[o]){case 0:t&&(l.push(t),t=void 0),i++,a++;break;case 1:t||(t=$n(i,0)),t.pa++,i++,t.ia.push(n[a]),a++;break;case 2:t||(t=$n(i,0)),t.pa++,i++;break;case 3:t||(t=$n(i,0)),t.ia.push(n[a]),a++}return t&&l.push(t),l}function er(e,t){return e===t}var tr=zt({dispatchEvent:jn,addEventListener:Hn,removeEventListener:Vn}),nr=null;function rr(){return nr||(nr=window.ShadyCSS&&window.ShadyCSS.ScopingShim),nr||null}function ir(e,t,n){var r=rr();return!(!r||"class"!==t||(r.setElementClass(e,n),0))}function ar(e,t){var n=rr();n&&n.unscopeNode(e,t)}function or(e,t){var n=rr();if(!n)return!0;if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){for(n=!0,e=e.__shady_firstChild;e;e=e.__shady_nextSibling)n=n&&or(e,t);return n}return e.nodeType!==Node.ELEMENT_NODE||n.currentScopeForNode(e)===t}function sr(e){if(e.nodeType!==Node.ELEMENT_NODE)return"";var t=rr();return t?t.currentScopeForNode(e):""}function lr(e,t){if(e)for(e.nodeType===Node.ELEMENT_NODE&&t(e),e=e.__shady_firstChild;e;e=e.__shady_nextSibling)e.nodeType===Node.ELEMENT_NODE&&lr(e,t)}var ur=window.document,cr=gt.ha,hr=Object.getOwnPropertyDescriptor(Node.prototype,"isConnected"),dr=hr&&hr.get;function fr(e){for(var t;t=e.__shady_firstChild;)e.__shady_removeChild(t)}function pr(e){var t=yt(e);if(t&&void 0!==t.ta)for(t=e.__shady_firstChild;t;t=t.__shady_nextSibling)pr(t);(e=yt(e))&&(e.ta=void 0)}function vr(e){var t=e;if(e&&"slot"===e.localName){var n=yt(e);(n=n&&n.aa)&&(t=n.length?n[0]:vr(e.__shady_nextSibling))}return t}function mr(e,t,n){if(e=(e=yt(e))&&e.ga){if(t)if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(var r=0,i=t.childNodes.length;r<i;r++)e.addedNodes.push(t.childNodes[r]);else e.addedNodes.push(t);n&&e.removedNodes.push(n),function(e){e.g||(e.g=!0,Ot((function(){e.flush()})))}(e)}}var yr=zt({get parentNode(){var e=yt(this);return void 0!==(e=e&&e.parentNode)?e:this.__shady_native_parentNode},get firstChild(){var e=yt(this);return void 0!==(e=e&&e.firstChild)?e:this.__shady_native_firstChild},get lastChild(){var e=yt(this);return void 0!==(e=e&&e.lastChild)?e:this.__shady_native_lastChild},get nextSibling(){var e=yt(this);return void 0!==(e=e&&e.nextSibling)?e:this.__shady_native_nextSibling},get previousSibling(){var e=yt(this);return void 0!==(e=e&&e.previousSibling)?e:this.__shady_native_previousSibling},get childNodes(){if(wt(this)){var e=yt(this);if(!e.childNodes){e.childNodes=[];for(var t=this.__shady_firstChild;t;t=t.__shady_nextSibling)e.childNodes.push(t)}var n=e.childNodes}else n=this.__shady_native_childNodes;return n.item=function(e){return n[e]},n},get parentElement(){var e=yt(this);return(e=e&&e.parentNode)&&e.nodeType!==Node.ELEMENT_NODE&&(e=null),void 0!==e?e:this.__shady_native_parentElement},get isConnected(){if(dr&&dr.call(this))return!0;if(this.nodeType==Node.DOCUMENT_FRAGMENT_NODE)return!1;var e=this.ownerDocument;if(null===e||Rt(e,this))return!0;for(e=this;e&&!(e instanceof Document);)e=e.__shady_parentNode||(Et(e)?e.host:void 0);return!!(e&&e instanceof Document)},get textContent(){if(wt(this)){for(var e=[],t=this.__shady_firstChild;t;t=t.__shady_nextSibling)t.nodeType!==Node.COMMENT_NODE&&e.push(t.__shady_textContent);return e.join("")}return this.__shady_native_textContent},set textContent(e){switch(null==e&&(e=""),this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:if(!wt(this)&&gt.D){var t=this.__shady_firstChild;(t!=this.__shady_lastChild||t&&t.nodeType!=Node.TEXT_NODE)&&fr(this),this.__shady_native_textContent=e}else fr(this),(0<e.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_insertBefore(document.createTextNode(e));break;default:this.nodeValue=e}},insertBefore:function(e,t){if(this.ownerDocument!==ur&&e.ownerDocument!==ur)return this.__shady_native_insertBefore(e,t),e;if(e===this)throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if(t){var n=yt(t);if(void 0!==(n=n&&n.parentNode)&&n!==this||void 0===n&&t.__shady_native_parentNode!==this)throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.")}if(t===e)return e;mr(this,e);var r=[],i=(n=wi(this))?n.host.localName:sr(this),a=e.__shady_parentNode;if(a){var o=sr(e),s=!!n||!wi(e)||cr&&void 0!==this.__noInsertionPoint;a.__shady_removeChild(e,s)}a=!0;var l=(!cr||void 0===e.__noInsertionPoint&&void 0===this.__noInsertionPoint)&&!or(e,i),u=n&&!e.__noInsertionPoint&&(!cr||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE);return(u||l)&&(l&&(o=o||sr(e)),lr(e,(function(e){if(u&&"slot"===e.localName&&r.push(e),l){var t=o;rr()&&(t&&ar(e,t),(t=rr())&&t.scopeNode(e,i))}}))),r.length&&(vi(n),n.i.push.apply(n.i,c(r)),ci(n)),wt(this)&&(function(e,t,n){Qr(t,2);var r=mt(t);if(void 0!==r.firstChild&&(r.childNodes=null),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(e=e.__shady_native_firstChild;e;e=e.__shady_native_nextSibling)ei(e,t,r,n);else ei(e,t,r,n)}(e,this,t),(s=yt(this)).root?(a=!1,Mt(this)&&ci(s.root)):n&&"slot"===this.localName&&(a=!1,ci(n))),a?(n=Et(this)?this.host:this,t?(t=vr(t),n.__shady_native_insertBefore(e,t)):n.__shady_native_appendChild(e)):e.ownerDocument!==this.ownerDocument&&this.ownerDocument.adoptNode(e),e},appendChild:function(e){if(this!=e||!Et(e))return this.__shady_insertBefore(e)},removeChild:function(e,t){if(t=void 0!==t&&t,this.ownerDocument!==ur)return this.__shady_native_removeChild(e);if(e.__shady_parentNode!==this)throw Error("The node to be removed is not a child of this node: "+e);mr(this,null,e);var n=wi(e),r=n&&function(e,t){if(e.g){mi(e);var n,r=e.h;for(n in r)for(var i=r[n],a=0;a<i.length;a++){var o=i[a];if(It(t,o)){i.splice(a,1);var s=e.g.indexOf(o);if(0<=s&&(e.g.splice(s,1),(s=yt(o.__shady_parentNode))&&s.ka&&s.ka--),a--,s=(o=yt(o)).aa)for(var l=0;l<s.length;l++){var u=s[l],c=u.__shady_native_parentNode;c&&c.__shady_native_removeChild(u)}o.aa=[],o.assignedNodes=[],s=!0}}return s}}(n,e),i=yt(this);if(wt(this)&&(function(e,t){var n=mt(e);e===(t=mt(t)).firstChild&&(t.firstChild=n.nextSibling),e===t.lastChild&&(t.lastChild=n.previousSibling),e=n.previousSibling;var r=n.nextSibling;e&&(mt(e).nextSibling=r),r&&(mt(r).previousSibling=e),n.parentNode=n.previousSibling=n.nextSibling=void 0,void 0!==t.childNodes&&(t.childNodes=null)}(e,this),Mt(this))){ci(i.root);var a=!0}if(rr()&&!t&&n&&e.nodeType!==Node.TEXT_NODE){var o=sr(e);lr(e,(function(e){ar(e,o)}))}return pr(e),n&&((t="slot"===this.localName)&&(a=!0),(r||t)&&ci(n)),a||(a=Et(this)?this.host:this,(!i.root&&"slot"!==e.localName||a===e.__shady_native_parentNode)&&a.__shady_native_removeChild(e)),e},replaceChild:function(e,t){return this.__shady_insertBefore(e,t),this.__shady_removeChild(t),e},cloneNode:function(e){if("template"==this.localName)return this.__shady_native_cloneNode(e);var t=this.__shady_native_cloneNode(!1);if(e&&t.nodeType!==Node.ATTRIBUTE_NODE){e=this.__shady_firstChild;for(var n;e;e=e.__shady_nextSibling)n=e.__shady_cloneNode(!0),t.__shady_appendChild(n)}return t},getRootNode:function(e){if(this&&this.nodeType){var t=mt(this),n=t.ta;return void 0===n&&(Et(this)?(n=this,t.ta=n):(n=(n=this.__shady_parentNode)?n.__shady_getRootNode(e):this,document.documentElement.__shady_native_contains(this)&&(t.ta=n))),n}},contains:function(e){return It(this,e)}}),gr=zt({get assignedSlot(){var e=this.__shady_parentNode;return(e=e&&e.__shady_shadowRoot)&&hi(e),(e=yt(this))&&e.assignedSlot||null}}),_r=new Map;function br(e,t,n,r){for(r=void 0===r||r;t<e.length;t++)if("\\"===e[t]&&t<e.length-1&&"\n"!==e[t+1])t++;else{if(-1!==n.indexOf(e[t]))return t;if(r&&_r.has(e[t])){var i=_r.get(e[t]);t=br(e,t+1,[i.end],i.sa)}}return e.length}function xr(e,t,n){var r=[];return Sr(e,t,n,r),r}function Sr(e,t,n,r){for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling){var i;if(i=e.nodeType===Node.ELEMENT_NODE){var a=t,o=n,s=r,l=a(i=e);l&&s.push(i),o&&o(l)?i=l:(Sr(i,a,o,s),i=void 0)}if(i)break}}[["(",{end:")",sa:!0}],["[",{end:"]",sa:!0}],['"',{end:'"',sa:!1}],["'",{end:"'",sa:!1}]].forEach((function(e){var t=u(e);e=t.next().value,t=t.next().value,_r.set(e,t)}));var wr={get firstElementChild(){var e=yt(this);if(e&&void 0!==e.firstChild){for(e=this.__shady_firstChild;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_nextSibling;return e}return this.__shady_native_firstElementChild},get lastElementChild(){var e=yt(this);if(e&&void 0!==e.lastChild){for(e=this.__shady_lastChild;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_previousSibling;return e}return this.__shady_native_lastElementChild},get children(){return wt(this)?Nt(Array.prototype.filter.call(Dt(this),(function(e){return e.nodeType===Node.ELEMENT_NODE}))):this.__shady_native_children},get childElementCount(){var e=this.__shady_children;return e?e.length:0}},Er=zt((wr.append=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];this.__shady_insertBefore(Vt.apply(null,c(t)),null)},wr.prepend=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];this.__shady_insertBefore(Vt.apply(null,c(t)),this.__shady_firstChild)},wr.replaceChildren=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];for(;null!==(n=this.__shady_firstChild);)this.__shady_removeChild(n);this.__shady_insertBefore(Vt.apply(null,c(t)),null)},wr));function Mr(e,t){function n(t,n){return(t===e||-1===n.indexOf(":scope"))&&Ct.call(t,n)}var r=function(e){function t(){if(0<r.length){for(;" "===r[r.length-1];)r.pop();n.push({La:r.filter((function(e,t){return 0==t%2})),Za:r.filter((function(e,t){return 1==t%2}))}),r.length=0}}for(var n=[],r=[],i=0;i<e.length;){var a=r[r.length-1],o=br(e,i,[","," ",">","+","~"]),s=o===i?e[i]:e.substring(i,o);","===s?t():-1!==[void 0," ",">","+","~"].indexOf(a)&&" "===s||(" "===a&&-1!==[">","+","~"].indexOf(s)?r[r.length-1]=s:r.push(s)),i=o+(o===i?1:0)}return t(),n}(t);if(1>r.length)return[];for(t=Gt(xr(e,(function(){return!0})).map((function(e){return Gt(r.map((function(t){var r=t.La,i=r.length-1;return n(e,r[i])?{target:e,da:t,fa:e,index:i}:[]})))})));t.some((function(e){return 0<e.index}));)t=Gt(t.map((function(e){if(0>=e.index)return e;var t=e.target,r=e.fa,i=e.da;e=e.index-1;var a=i.Za[e],o=i.La[e];if(" "===a){for(a=[],r=r.__shady_parentElement;r;r=r.__shady_parentElement)n(r,o)&&a.push({target:t,da:i,fa:r,index:e});return a}if(">"===a)return n(r=r.__shady_parentElement,o)?{target:t,da:i,fa:r,index:e}:[];if("+"===a)return(r=r.__shady_previousElementSibling)&&n(r,o)?{target:t,da:i,fa:r,index:e}:[];if("~"===a){for(a=[],r=r.__shady_previousElementSibling;r;r=r.__shady_previousElementSibling)n(r,o)&&a.push({target:t,da:i,fa:r,index:e});return a}throw Error("Unrecognized combinator: '"+a+"'.")})));return function(e){for(var t=[],n=new Set,r=(e=u(e)).next();!r.done;r=e.next())r=r.value,n.has(r)||(t.push(r),n.add(r));return t}(t.map((function(e){return e.target})))}var Tr=gt.querySelectorImplementation,Cr=zt({querySelector:function(e){if("native"===Tr){for(var t=Array.prototype.slice.call((this instanceof ShadowRoot?this.host:this).__shady_native_querySelectorAll(e)),n=this.__shady_getRootNode(),r=(t=u(t)).next();!r.done;r=t.next())if((r=r.value).__shady_getRootNode()==n)return r;return null}if("selectorEngine"===Tr)return Mr(this,e)[0]||null;if(void 0===Tr)return xr(this,(function(t){return Ct.call(t,e)}),(function(e){return!!e}))[0]||null;throw Error("Unrecognized value of ShadyDOM.querySelectorImplementation: '"+Tr+"'")},querySelectorAll:function(e,t){if(t||"native"===Tr){t=Array.prototype.slice.call((this instanceof ShadowRoot?this.host:this).__shady_native_querySelectorAll(e));var n=this.__shady_getRootNode();return Nt(t.filter((function(e){return e.__shady_getRootNode()==n})))}if("selectorEngine"===Tr)return Nt(Mr(this,e));if(void 0===Tr)return Nt(xr(this,(function(t){return Ct.call(t,e)})));throw Error("Unrecognized value of ShadyDOM.querySelectorImplementation: '"+Tr+"'")}}),Ar=gt.ha&&!gt.J?jt({},Er):Er;jt(Er,Cr);var Pr=zt({after:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=this.__shady_parentNode)){var r=this.__shady_nextSibling;n.__shady_insertBefore(Vt.apply(null,c(t)),r)}},before:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];null!==(n=this.__shady_parentNode)&&n.__shady_insertBefore(Vt.apply(null,c(t)),this)},remove:function(){var e=this.__shady_parentNode;null!==e&&e.__shady_removeChild(this)},replaceWith:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=this.__shady_parentNode)){var r=this.__shady_nextSibling;n.__shady_removeChild(this),n.__shady_insertBefore(Vt.apply(null,c(t)),r)}}}),kr=window.document;function Or(e,t){if("slot"===t)Mt(e=e.__shady_parentNode)&&ci(yt(e).root);else if("slot"===e.localName&&"name"===t&&(t=wi(e))){if(t.g){mi(t);var n=e.Ua,r=yi(e);if(r!==n){var i=(n=t.h[n]).indexOf(e);0<=i&&n.splice(i,1),(n=t.h[r]||(t.h[r]=[])).push(e),1<n.length&&(t.h[r]=gi(n))}}ci(t)}}var Rr=zt({get previousElementSibling(){var e=yt(this);if(e&&void 0!==e.previousSibling){for(e=this.__shady_previousSibling;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_previousSibling;return e}return this.__shady_native_previousElementSibling},get nextElementSibling(){var e=yt(this);if(e&&void 0!==e.nextSibling){for(e=this.__shady_nextSibling;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_nextSibling;return e}return this.__shady_native_nextElementSibling},get slot(){return this.getAttribute("slot")},set slot(e){this.__shady_setAttribute("slot",e)},get className(){return this.getAttribute("class")||""},set className(e){this.__shady_setAttribute("class",e)},setAttribute:function(e,t){this.ownerDocument!==kr?this.__shady_native_setAttribute(e,t):ir(this,e,t)||(this.__shady_native_setAttribute(e,t),Or(this,e))},removeAttribute:function(e){this.ownerDocument!==kr?this.__shady_native_removeAttribute(e):ir(this,e,"")?""===this.getAttribute(e)&&this.__shady_native_removeAttribute(e):(this.__shady_native_removeAttribute(e),Or(this,e))},toggleAttribute:function(e,t){return this.ownerDocument!==kr?this.__shady_native_toggleAttribute(e,t):ir(this,e,"")?""!==this.getAttribute(e)||t?void 0:this.__shady_native_toggleAttribute(e,t):(t=this.__shady_native_toggleAttribute(e,t),Or(this,e),t)}});gt.ha||Jn.forEach((function(e){Rr[e]=Kn(e)}));var Ir=zt({attachShadow:function(e){if(!this)throw Error("Must provide a host.");if(!e)throw Error("Not enough arguments.");if(e.shadyUpgradeFragment&&!gt.Ra){var t=e.shadyUpgradeFragment;if(t.__proto__=ShadowRoot.prototype,ui(t,this,e),ti(t,t),e=t.__noInsertionPoint?null:t.querySelectorAll("slot"),t.__noInsertionPoint=void 0,e&&e.length){var n=t;vi(n),n.i.push.apply(n.i,c(e)),ci(t)}t.host.__shady_native_appendChild(t)}else t=new li(ai,this,e);return this.__CE_shadowRoot=t},get shadowRoot(){var e=yt(this);return e&&e.lb||null}});jt(Rr,Ir);var Nr=document.implementation.createHTMLDocument("inert"),Lr=zt({get innerHTML(){return wt(this)?nn("template"===this.localName?this.content:this,Dt):this.__shady_native_innerHTML},set innerHTML(e){if("template"===this.localName)this.__shady_native_innerHTML=e;else{fr(this);var t=this.localName||"div";for(t=this.namespaceURI&&this.namespaceURI!==Nr.namespaceURI?Nr.createElementNS(this.namespaceURI,t):Nr.createElement(t),gt.D?t.__shady_native_innerHTML=e:t.innerHTML=e;e=t.__shady_firstChild;)this.__shady_insertBefore(e)}}}),Dr=zt({blur:function(){var e=yt(this);(e=(e=e&&e.root)&&e.activeElement)?e.__shady_blur():this.__shady_native_blur()}});gt.ha||Zn.forEach((function(e){Dr[e]=Kn(e)}));var Ur=zt({assignedNodes:function(e){if("slot"===this.localName){var t=this.__shady_getRootNode();return t&&Et(t)&&hi(t),(t=yt(this))&&(e&&e.flatten?t.aa:t.assignedNodes)||[]}},addEventListener:function(e,t,n){if("slot"!==this.localName||"slotchange"===e)Hn.call(this,e,t,n);else{"object"!==r(n)&&(n={capture:!!n});var i=this.__shady_parentNode;if(!i)throw Error("ShadyDOM cannot attach event to slot unless it has a `parentNode`");n.U=this,i.__shady_addEventListener(e,t,n)}},removeEventListener:function(e,t,n){if("slot"!==this.localName||"slotchange"===e)Vn.call(this,e,t,n);else{"object"!==r(n)&&(n={capture:!!n});var i=this.__shady_parentNode;if(!i)throw Error("ShadyDOM cannot attach event to slot unless it has a `parentNode`");n.U=this,i.__shady_removeEventListener(e,t,n)}}}),Fr=zt({getElementById:function(e){return""===e?null:xr(this,(function(t){return t.id==e}),(function(e){return!!e}))[0]||null}});function Br(e,t){for(var n;t&&!e.has(n=t.__shady_getRootNode());)t=n.host;return t}var zr="__shady_native_"+St(),jr=zt({get activeElement(){var e=gt.D?document.__shady_native_activeElement:document.activeElement;if(!e||!e.nodeType)return null;var t=!!Et(this);if(!(this===document||t&&this.host!==e&&this.host.__shady_native_contains(e)))return null;for(t=wi(e);t&&t!==this;)t=wi(e=t.host);return this===document?t?null:e:t===this?e:null},elementsFromPoint:function(e,t){if(e=document[zr](e,t),this===document&&gt.useNativeDocumentEFP)return e;e=[].slice.call(e),t=function(e){var t=new Set;for(t.add(e);Et(e)&&e.host;)e=e.host.__shady_getRootNode(),t.add(e);return t}(this);for(var n=new Set,r=0;r<e.length;r++)n.add(Br(t,e[r]));var i=[];return n.forEach((function(e){return i.push(e)})),i},elementFromPoint:function(e,t){return this===document&&gt.useNativeDocumentEFP?this.__shady_native_elementFromPoint(e,t):this.__shady_elementsFromPoint(e,t)[0]||null}}),Hr=window.document,Vr=zt({importNode:function(e,t){if(e.ownerDocument!==Hr||"template"===e.localName)return this.__shady_native_importNode(e,t);var n=this.__shady_native_importNode(e,!1);if(t)for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling)t=this.__shady_importNode(e,!0),n.__shady_appendChild(t);return n}}),Gr=zt({dispatchEvent:jn,addEventListener:Hn.bind(window),removeEventListener:Vn.bind(window)}),Wr={};Object.getOwnPropertyDescriptor(HTMLElement.prototype,"parentElement")&&(Wr.parentElement=yr.parentElement),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"contains")&&(Wr.contains=yr.contains),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"children")&&(Wr.children=Er.children),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML")&&(Wr.innerHTML=Lr.innerHTML),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"className")&&(Wr.className=Rr.className);var Xr={EventTarget:[tr],Node:[yr,window.EventTarget?null:tr],Text:[gr],Comment:[gr],CDATASection:[gr],ProcessingInstruction:[gr],Element:[Rr,Er,Pr,gr,!gt.D||"innerHTML"in Element.prototype?Lr:null,window.HTMLSlotElement?null:Ur],HTMLElement:[Dr,Wr],HTMLSlotElement:[Ur],DocumentFragment:[Ar,Fr],Document:[Vr,Ar,Fr,jr],Window:[Gr],CharacterData:[Pr],XMLHttpRequest:[window.EventTarget?null:tr]},qr=gt.D?null:["innerHTML","textContent"];function Yr(e,t,n,r){t.forEach((function(t){return e&&t&&Ft(e,t,n,r)}))}function Jr(e){var t,n=e?null:qr;for(t in Xr)Yr(window[t]&&window[t].prototype,Xr[t],e,n)}function Zr(e){return e.__shady_protoIsPatched=!0,Yr(e,Xr.EventTarget),Yr(e,Xr.Node),Yr(e,Xr.Element),Yr(e,Xr.HTMLElement),Yr(e,Xr.HTMLSlotElement),e}["Text","Comment","CDATASection","ProcessingInstruction"].forEach((function(e){var t=window[e],n=Object.create(t.prototype);n.__shady_protoIsPatched=!0,Yr(n,Xr.EventTarget),Yr(n,Xr.Node),Xr[e]&&Yr(n,Xr[e]),t.prototype.__shady_patchedProto=n}));var Kr=gt.Da,$r=gt.D;function Qr(e,t){if(Kr&&!e.__shady_protoIsPatched&&!Et(e)){var n=Object.getPrototypeOf(e),r=n.hasOwnProperty("__shady_patchedProto")&&n.__shady_patchedProto;r||(Zr(r=Object.create(n)),n.__shady_patchedProto=r),Object.setPrototypeOf(e,r)}$r||(1===t?xn(e):2===t&&Sn(e))}function ei(e,t,n,r){Qr(e,1),r=r||null;var i=mt(e),a=r?mt(r):null;i.previousSibling=r?a.previousSibling:t.__shady_lastChild,(a=yt(i.previousSibling))&&(a.nextSibling=e),(a=yt(i.nextSibling=r))&&(a.previousSibling=e),i.parentNode=t,r?r===n.firstChild&&(n.firstChild=e):(n.lastChild=e,n.firstChild||(n.firstChild=e)),n.childNodes=null}function ti(e,t){var n=mt(e);if(t||void 0===n.firstChild){n.childNodes=null;var r=n.firstChild=e.__shady_native_firstChild;for(n.lastChild=e.__shady_native_lastChild,Qr(e,2),n=r,r=void 0;n;n=n.__shady_native_nextSibling){var i=mt(n);i.parentNode=t||e,i.nextSibling=n.__shady_native_nextSibling,i.previousSibling=r||null,r=n,Qr(n,1)}}}var ni=zt({addEventListener:function(e,t,n){"object"!==r(n)&&(n={capture:!!n}),n.U=n.U||this,this.host.__shady_addEventListener(e,t,n)},removeEventListener:function(e,t,n){"object"!==r(n)&&(n={capture:!!n}),n.U=n.U||this,this.host.__shady_removeEventListener(e,t,n)}});function ri(e,t){Ft(e,ni,t),Ft(e,jr,t),Ft(e,Lr,t),Ft(e,Er,t),gt.J&&!t?(Ft(e,yr,t),Ft(e,Fr,t)):gt.D||(Ft(e,gn),Ft(e,mn),Ft(e,yn))}var ii,ai={},oi=gt.deferConnectionCallbacks&&"loading"===document.readyState;function si(e){var t=[];do{t.unshift(e)}while(e=e.__shady_parentNode);return t}function li(e,t,n){if(e!==ai)throw new TypeError("Illegal constructor");this.g=null,ui(this,t,n)}function ui(e,t,n){if(e.host=t,e.mode=n&&n.mode,ti(e.host),(t=mt(e.host)).root=e,t.lb="closed"!==e.mode?e:null,(t=mt(e)).firstChild=t.lastChild=t.parentNode=t.nextSibling=t.previousSibling=null,gt.preferPerformance)for(;t=e.host.__shady_native_firstChild;)e.host.__shady_native_removeChild(t);else ci(e)}function ci(e){e.Y||(e.Y=!0,qt((function(){return hi(e)})))}function hi(e){var t;if(t=e.Y){for(var n;e;)e.Y&&(n=e),Et(e=(t=e).host.__shady_getRootNode())&&(t=yt(t.host))&&0<t.ka||(e=void 0);t=n}(n=t)&&n._renderSelf()}function di(e,t,n){var r=mt(t),i=r.xa;r.xa=null,n||(n=(e=e.h[t.__shady_slot||"__catchall"])&&e[0]),n?(mt(n).assignedNodes.push(t),r.assignedSlot=n):r.assignedSlot=void 0,i!==r.assignedSlot&&r.assignedSlot&&(mt(r.assignedSlot).Aa=!0)}function fi(e,t,n){for(var r=0,i=void 0;r<n.length&&(i=n[r]);r++)if("slot"==i.localName){var a=yt(i).assignedNodes;a&&a.length&&fi(e,t,a)}else t.push(n[r])}function pi(e,t){t.__shady_native_dispatchEvent(new Event("slotchange")),(t=yt(t)).assignedSlot&&pi(e,t.assignedSlot)}function vi(e){e.i=e.i||[],e.g=e.g||[],e.h=e.h||{}}function mi(e){if(e.i&&e.i.length){for(var t,n=e.i,r=0;r<n.length;r++){var i=n[r];ti(i);var a=i.__shady_parentNode;ti(a),(a=yt(a)).ka=(a.ka||0)+1,a=yi(i),e.h[a]?((t=t||{})[a]=!0,e.h[a].push(i)):e.h[a]=[i],e.g.push(i)}if(t)for(var o in t)e.h[o]=gi(e.h[o]);e.i=[]}}function yi(e){var t=e.name||e.getAttribute("name")||"__catchall";return e.Ua=t}function gi(e){return e.sort((function(e,t){e=si(e);for(var n=si(t),r=0;r<e.length;r++){t=e[r];var i=n[r];if(t!==i)return(e=Dt(t.__shady_parentNode)).indexOf(t)-e.indexOf(i)}}))}function _i(e){return mi(e),!(!e.g||!e.g.length)}if(li.prototype._renderSelf=function(){var e=oi;if(oi=!0,this.Y=!1,this.g){mi(this);for(var t,n=0;n<this.g.length;n++){var r=yt(t=this.g[n]),i=r.assignedNodes;if(r.assignedNodes=[],r.aa=[],r.Ja=i)for(r=0;r<i.length;r++){var a=yt(i[r]);a.xa=a.assignedSlot,a.assignedSlot===t&&(a.assignedSlot=null)}}for(n=this.host.__shady_firstChild;n;n=n.__shady_nextSibling)di(this,n);for(n=0;n<this.g.length;n++){if(!(i=yt(t=this.g[n])).assignedNodes.length)for(r=t.__shady_firstChild;r;r=r.__shady_nextSibling)di(this,r,t);if((r=(r=yt(t.__shady_parentNode))&&r.root)&&(_i(r)||r.Y)&&r._renderSelf(),fi(this,i.aa,i.assignedNodes),r=i.Ja){for(a=0;a<r.length;a++)yt(r[a]).xa=null;i.Ja=null,r.length>i.assignedNodes.length&&(i.Aa=!0)}i.Aa&&(i.Aa=!1,pi(this,t))}for(t=this.g,n=[],i=0;i<t.length;i++)(a=yt(r=t[i].__shady_parentNode))&&a.root||!(0>n.indexOf(r))||n.push(r);for(t=0;t<n.length;t++){for(i=(a=n[t])===this?this.host:a,r=[],a=a.__shady_firstChild;a;a=a.__shady_nextSibling)if("slot"==a.localName)for(var o=yt(a).aa,s=0;s<o.length;s++)r.push(o[s]);else r.push(a);a=Lt(i),o=Qn(r,r.length,a,a.length);for(var l=s=0,u=void 0;s<o.length&&(u=o[s]);s++){for(var c=0,h=void 0;c<u.ia.length&&(h=u.ia[c]);c++)h.__shady_native_parentNode===i&&i.__shady_native_removeChild(h),a.splice(u.index+l,1);l-=u.pa}for(l=0,u=void 0;l<o.length&&(u=o[l]);l++)for(s=a[u.index],c=u.index;c<u.index+u.pa;c++)h=r[c],i.__shady_native_insertBefore(h,s),a.splice(c,0,h)}}if(!gt.preferPerformance&&!this.Ia)for(n=this.host.__shady_firstChild;n;n=n.__shady_nextSibling)t=yt(n),n.__shady_native_parentNode!==this.host||"slot"!==n.localName&&t.assignedSlot||this.host.__shady_native_removeChild(n);this.Ia=!0,oi=e,ii&&ii()},function(e){e.__proto__=DocumentFragment.prototype,ri(e,"__shady_"),ri(e),Object.defineProperties(e,{nodeType:{value:Node.DOCUMENT_FRAGMENT_NODE,configurable:!0},nodeName:{value:"#document-fragment",configurable:!0},nodeValue:{value:null,configurable:!0}}),["localName","namespaceURI","prefix"].forEach((function(t){Object.defineProperty(e,t,{value:void 0,configurable:!0})})),["ownerDocument","baseURI","isConnected"].forEach((function(t){Object.defineProperty(e,t,{get:function(){return this.host[t]},configurable:!0})}))}(li.prototype),window.customElements&&window.customElements.define&&gt.Ba&&!gt.preferPerformance){var bi=new Map;ii=function(){var e=[];bi.forEach((function(t,n){e.push([n,t])})),bi.clear();for(var t=0;t<e.length;t++){var n=e[t][0];e[t][1]?n.__shadydom_connectedCallback():n.__shadydom_disconnectedCallback()}},oi&&document.addEventListener("readystatechange",(function(){oi=!1,ii()}),{once:!0});var xi=window.customElements.define,Si=function(e,t){var n=t.prototype.connectedCallback,r=t.prototype.disconnectedCallback;xi.call(window.customElements,e,function(e,t,n){var r=0,i="__isConnected"+r++;return(t||n)&&(e.prototype.connectedCallback=e.prototype.__shadydom_connectedCallback=function(){oi?bi.set(this,!0):this[i]||(this[i]=!0,t&&t.call(this))},e.prototype.disconnectedCallback=e.prototype.__shadydom_disconnectedCallback=function(){oi?this.isConnected||bi.set(this,!1):this[i]&&(this[i]=!1,n&&n.call(this))}),e}(t,n,r)),t.prototype.connectedCallback=n,t.prototype.disconnectedCallback=r};window.customElements.define=Si,Object.defineProperty(window.CustomElementRegistry.prototype,"define",{value:Si,configurable:!0})}function wi(e){if(Et(e=e.__shady_getRootNode()))return e}function Ei(e){this.node=e}function Mi(e){Object.defineProperty(Ei.prototype,e,{get:function(){return this.node["__shady_"+e]},set:function(t){this.node["__shady_"+e]=t},configurable:!0})}(e=Ei.prototype).addEventListener=function(e,t,n){return this.node.__shady_addEventListener(e,t,n)},e.removeEventListener=function(e,t,n){return this.node.__shady_removeEventListener(e,t,n)},e.appendChild=function(e){return this.node.__shady_appendChild(e)},e.insertBefore=function(e,t){return this.node.__shady_insertBefore(e,t)},e.removeChild=function(e){return this.node.__shady_removeChild(e)},e.replaceChild=function(e,t){return this.node.__shady_replaceChild(e,t)},e.cloneNode=function(e){return this.node.__shady_cloneNode(e)},e.getRootNode=function(e){return this.node.__shady_getRootNode(e)},e.contains=function(e){return this.node.__shady_contains(e)},e.dispatchEvent=function(e){return this.node.__shady_dispatchEvent(e)},e.setAttribute=function(e,t){this.node.__shady_setAttribute(e,t)},e.getAttribute=function(e){return this.node.__shady_native_getAttribute(e)},e.hasAttribute=function(e){return this.node.__shady_native_hasAttribute(e)},e.removeAttribute=function(e){this.node.__shady_removeAttribute(e)},e.toggleAttribute=function(e,t){return this.node.__shady_toggleAttribute(e,t)},e.attachShadow=function(e){return this.node.__shady_attachShadow(e)},e.focus=function(){this.node.__shady_native_focus()},e.blur=function(){this.node.__shady_blur()},e.importNode=function(e,t){if(this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_importNode(e,t)},e.getElementById=function(e){if(this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_getElementById(e)},e.elementsFromPoint=function(e,t){return this.node.__shady_elementsFromPoint(e,t)},e.elementFromPoint=function(e,t){return this.node.__shady_elementFromPoint(e,t)},e.querySelector=function(e){return this.node.__shady_querySelector(e)},e.querySelectorAll=function(e,t){return this.node.__shady_querySelectorAll(e,t)},e.assignedNodes=function(e){if("slot"===this.node.localName)return this.node.__shady_assignedNodes(e)},e.append=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_append.apply(this.node,c(t))},e.prepend=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_prepend.apply(this.node,c(t))},e.after=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_after.apply(this.node,c(t))},e.before=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_before.apply(this.node,c(t))},e.remove=function(){return this.node.__shady_remove()},e.replaceWith=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_replaceWith.apply(this.node,c(t))},o.Object.defineProperties(Ei.prototype,{activeElement:{configurable:!0,enumerable:!0,get:function(){if(Et(this.node)||this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_activeElement}},_activeElement:{configurable:!0,enumerable:!0,get:function(){return this.activeElement}},host:{configurable:!0,enumerable:!0,get:function(){if(Et(this.node))return this.node.host}},parentNode:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_parentNode}},firstChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_firstChild}},lastChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_lastChild}},nextSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_nextSibling}},previousSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_previousSibling}},childNodes:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_childNodes}},parentElement:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_parentElement}},firstElementChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_firstElementChild}},lastElementChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_lastElementChild}},nextElementSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_nextElementSibling}},previousElementSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_previousElementSibling}},children:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_children}},childElementCount:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_childElementCount}},shadowRoot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_shadowRoot}},assignedSlot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_assignedSlot}},isConnected:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_isConnected}},innerHTML:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_innerHTML},set:function(e){this.node.__shady_innerHTML=e}},textContent:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_textContent},set:function(e){this.node.__shady_textContent=e}},slot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_slot},set:function(e){this.node.__shady_slot=e}},className:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_className},set:function(e){this.node.__shady_className=e}}}),Jn.forEach((function(e){return Mi(e)})),Zn.forEach((function(e){return Mi(e)}));var Ti=new WeakMap;function Ci(e){if(Et(e)||e instanceof Ei)return e;var t=Ti.get(e);return t||(t=new Ei(e),Ti.set(e,t)),t}if(gt.Ba){var Ai=gt.D?function(e){return e}:function(e){return Sn(e),xn(e),e},Pi={inUse:gt.Ba,patch:Ai,isShadyRoot:Et,enqueue:qt,flush:Yt,flushInitial:function(e){!e.Ia&&e.Y&&hi(e)},settings:gt,filterMutations:function(e,t){var n=t.getRootNode();return e.map((function(e){var t=n===e.target.getRootNode();if(t&&e.addedNodes){if(t=[].slice.call(e.addedNodes).filter((function(e){return n===e.getRootNode()})),t.length)return e=Object.create(e),Object.defineProperty(e,"addedNodes",{value:t,configurable:!0}),e}else if(t)return e})).filter((function(e){return e}))},observeChildren:function(e,t){var n=mt(e);n.ga||(n.ga=new Jt),n.ga.qa.add(t);var r=n.ga;return{Va:t,X:r,Wa:e,takeRecords:function(){return r.takeRecords()}}},unobserveChildren:function(e){var t=e&&e.X;t&&(t.qa.delete(e.Va),t.qa.size||(mt(e.Wa).ga=null))},deferConnectionCallbacks:gt.deferConnectionCallbacks,preferPerformance:gt.preferPerformance,handlesDynamicScoping:!0,wrap:gt.J?Ci:Ai,wrapIfNeeded:!0===gt.J?Ci:function(e){return e},Wrapper:Ei,composedPath:function(e){return e.__composedPath||(e.__composedPath=kn(e.target,!0)),e.__composedPath},noPatch:gt.J,patchOnDemand:gt.Da,nativeMethods:an,nativeTree:on,patchElementProto:Zr,querySelectorImplementation:gt.querySelectorImplementation};window.ShadyDOM=Pi,function(){var e=["dispatchEvent","addEventListener","removeEventListener"];window.EventTarget?(un(window.EventTarget.prototype,e),void 0===window.__shady_native_addEventListener&&un(Window.prototype,e)):(un(Node.prototype,e),un(Window.prototype,e),un(XMLHttpRequest.prototype,e)),rn?un(Node.prototype,"parentNode firstChild lastChild previousSibling nextSibling childNodes parentElement textContent".split(" ")):ln(Node.prototype,{parentNode:{get:function(){return cn.currentNode=this,cn.parentNode()}},firstChild:{get:function(){return cn.currentNode=this,cn.firstChild()}},lastChild:{get:function(){return cn.currentNode=this,cn.lastChild()}},previousSibling:{get:function(){return cn.currentNode=this,cn.previousSibling()}},nextSibling:{get:function(){return cn.currentNode=this,cn.nextSibling()}},childNodes:{get:function(){var e=[];cn.currentNode=this;for(var t=cn.firstChild();t;)e.push(t),t=cn.nextSibling();return e}},parentElement:{get:function(){return hn.currentNode=this,hn.parentNode()}},textContent:{get:function(){switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:for(var e,t=document.createTreeWalker(this,NodeFilter.SHOW_TEXT,null,!1),n="";e=t.nextNode();)n+=e.nodeValue;return n;default:return this.nodeValue}},set:function(e){switch(null==e&&(e=""),this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:fn(this),(0<e.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_native_insertBefore(document.createTextNode(e),void 0);break;default:this.nodeValue=e}}}}),un(Node.prototype,"appendChild insertBefore removeChild replaceChild cloneNode contains".split(" ")),un(HTMLElement.prototype,["parentElement","contains"]),e={firstElementChild:{get:function(){return hn.currentNode=this,hn.firstChild()}},lastElementChild:{get:function(){return hn.currentNode=this,hn.lastChild()}},children:{get:function(){var e=[];hn.currentNode=this;for(var t=hn.firstChild();t;)e.push(t),t=hn.nextSibling();return Nt(e)}},childElementCount:{get:function(){return this.children?this.children.length:0}}},rn?(un(Element.prototype,pn),un(Element.prototype,["previousElementSibling","nextElementSibling","innerHTML","className"]),un(HTMLElement.prototype,["children","innerHTML","className"])):(ln(Element.prototype,e),ln(Element.prototype,{previousElementSibling:{get:function(){return hn.currentNode=this,hn.previousSibling()}},nextElementSibling:{get:function(){return hn.currentNode=this,hn.nextSibling()}},innerHTML:{get:function(){return nn(this,Lt)},set:function(e){var t="template"===this.localName?this.content:this;fn(t);var n=this.localName||"div";for((n=this.namespaceURI&&this.namespaceURI!==dn.namespaceURI?dn.createElementNS(this.namespaceURI,n):dn.createElement(n)).innerHTML=e,e="template"===this.localName?n.content:n;n=e.__shady_native_firstChild;)t.__shady_native_insertBefore(n,void 0)}},className:{get:function(){return this.getAttribute("class")||""},set:function(e){this.setAttribute("class",e)}}})),un(Element.prototype,"setAttribute getAttribute hasAttribute removeAttribute toggleAttribute focus blur".split(" ")),un(Element.prototype,vn),un(HTMLElement.prototype,["focus","blur"]),window.HTMLTemplateElement&&un(window.HTMLTemplateElement.prototype,["innerHTML"]),rn?un(DocumentFragment.prototype,pn):ln(DocumentFragment.prototype,e),un(DocumentFragment.prototype,vn),rn?(un(Document.prototype,pn),un(Document.prototype,["activeElement"])):ln(Document.prototype,e),un(Document.prototype,["importNode","getElementById","elementFromPoint",St()]),un(Document.prototype,vn)}(),Jr("__shady_"),Object.defineProperty(document,"_activeElement",jr.activeElement),Ft(Window.prototype,Gr,"__shady_"),gt.J?gt.Da&&Ft(Element.prototype,Ir):(Jr(),function(){if(!En&&Object.getOwnPropertyDescriptor(Event.prototype,"isTrusted")){var e=function(){var e=new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0});this.__shady_dispatchEvent(e)};Element.prototype.click?Element.prototype.click=e:HTMLElement.prototype.click&&(HTMLElement.prototype.click=e)}}()),function(){for(var e in Ln)window.__shady_native_addEventListener(e,(function(e){e.__target||(Wn(e),Bn(e))}),!0)}(),window.Event=Xn,window.CustomEvent=qn,window.MouseEvent=Yn,window.ShadowRoot=li}var ki=window.Document.prototype.createElement,Oi=window.Document.prototype.createElementNS,Ri=window.Document.prototype.importNode,Ii=window.Document.prototype.prepend,Ni=window.Document.prototype.append,Li=window.DocumentFragment.prototype.prepend,Di=window.DocumentFragment.prototype.append,Ui=window.Node.prototype.cloneNode,Fi=window.Node.prototype.appendChild,Bi=window.Node.prototype.insertBefore,zi=window.Node.prototype.removeChild,ji=window.Node.prototype.replaceChild,Hi=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),Vi=window.Element.prototype.attachShadow,Gi=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),Wi=window.Element.prototype.getAttribute,Xi=window.Element.prototype.setAttribute,qi=window.Element.prototype.removeAttribute,Yi=window.Element.prototype.toggleAttribute,Ji=window.Element.prototype.getAttributeNS,Zi=window.Element.prototype.setAttributeNS,Ki=window.Element.prototype.removeAttributeNS,$i=window.Element.prototype.insertAdjacentElement,Qi=window.Element.prototype.insertAdjacentHTML,ea=window.Element.prototype.prepend,ta=window.Element.prototype.append,na=window.Element.prototype.before,ra=window.Element.prototype.after,ia=window.Element.prototype.replaceWith,aa=window.Element.prototype.remove,oa=window.HTMLElement,sa=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),la=window.HTMLElement.prototype.insertAdjacentElement,ua=window.HTMLElement.prototype.insertAdjacentHTML,ca=new Set;function ha(e){var t=ca.has(e);return e=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(e),!t&&e}"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach((function(e){return ca.add(e)}));var da=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function fa(e){var t=e.isConnected;if(void 0!==t)return t;if(da(e))return!0;for(;e&&!(e.__CE_isImportDocument||e instanceof Document);)e=e.parentNode||(window.ShadowRoot&&e instanceof ShadowRoot?e.host:void 0);return!(!e||!(e.__CE_isImportDocument||e instanceof Document))}function pa(e){var t=e.children;if(t)return Array.prototype.slice.call(t);for(t=[],e=e.firstChild;e;e=e.nextSibling)e.nodeType===Node.ELEMENT_NODE&&t.push(e);return t}function va(e,t){for(;t&&t!==e&&!t.nextSibling;)t=t.parentNode;return t&&t!==e?t.nextSibling:null}function ma(e,t,n){for(var r=e;r;){if(r.nodeType===Node.ELEMENT_NODE){var i=r;t(i);var a=i.localName;if("link"===a&&"import"===i.getAttribute("rel")){if(r=i.import,void 0===n&&(n=new Set),r instanceof Node&&!n.has(r))for(n.add(r),r=r.firstChild;r;r=r.nextSibling)ma(r,t,n);r=va(e,i);continue}if("template"===a){r=va(e,i);continue}if(i=i.__CE_shadowRoot)for(i=i.firstChild;i;i=i.nextSibling)ma(i,t,n)}r=r.firstChild?r.firstChild:va(e,r)}}function ya(){var e=!(null==Ua||!Ua.noDocumentConstructionObserver),t=!(null==Ua||!Ua.shadyDomFastWalk);this.ca=[],this.g=[],this.W=!1,this.shadyDomFastWalk=t,this.sb=!e}function ga(e,t,n,r){var i=window.ShadyDOM;if(e.shadyDomFastWalk&&i&&i.inUse){if(t.nodeType===Node.ELEMENT_NODE&&n(t),t.querySelectorAll)for(e=i.nativeMethods.querySelectorAll.call(t,"*"),t=0;t<e.length;t++)n(e[t])}else ma(t,n,r)}function _a(e,t){e.W&&ga(e,t,(function(t){return ba(e,t)}))}function ba(e,t){if(e.W&&!t.__CE_patched){t.__CE_patched=!0;for(var n=0;n<e.ca.length;n++)e.ca[n](t);for(n=0;n<e.g.length;n++)e.g[n](t)}}function xa(e,t){var n=[];for(ga(e,t,(function(e){return n.push(e)})),t=0;t<n.length;t++){var r=n[t];1===r.__CE_state?e.connectedCallback(r):Ea(e,r)}}function Sa(e,t){var n=[];for(ga(e,t,(function(e){return n.push(e)})),t=0;t<n.length;t++){var r=n[t];1===r.__CE_state&&e.disconnectedCallback(r)}}function wa(e,t,n){var r=(n=void 0===n?{}:n).tb,i=n.upgrade||function(t){return Ea(e,t)},a=[];for(ga(e,t,(function(t){if(e.W&&ba(e,t),"link"===t.localName&&"import"===t.getAttribute("rel")){var n=t.import;n instanceof Node&&(n.__CE_isImportDocument=!0,n.__CE_registry=document.__CE_registry),n&&"complete"===n.readyState?n.__CE_documentLoadHandled=!0:t.addEventListener("load",(function(){var n=t.import;if(!n.__CE_documentLoadHandled){n.__CE_documentLoadHandled=!0;var a=new Set;r&&(r.forEach((function(e){return a.add(e)})),a.delete(n)),wa(e,n,{tb:a,upgrade:i})}}))}else a.push(t)}),r),t=0;t<a.length;t++)i(a[t])}function Ea(e,t){try{var n=t.ownerDocument,r=n.__CE_registry,i=r&&(n.defaultView||n.__CE_isImportDocument)?Na(r,t.localName):void 0;if(i&&void 0===t.__CE_state){i.constructionStack.push(t);try{try{if(new i.constructorFunction!==t)throw Error("The custom element constructor did not produce the element being upgraded.")}finally{i.constructionStack.pop()}}catch(e){throw t.__CE_state=2,e}if(t.__CE_state=1,t.__CE_definition=i,i.attributeChangedCallback&&t.hasAttributes()){var a=i.observedAttributes;for(i=0;i<a.length;i++){var o=a[i],s=t.getAttribute(o);null!==s&&e.attributeChangedCallback(t,o,null,s,null)}}fa(t)&&e.connectedCallback(t)}}catch(e){Ta(e)}}function Ma(e,t,n,r){var i=t.__CE_registry;if(i&&(null===r||"http://www.w3.org/1999/xhtml"===r)&&(i=Na(i,n)))try{var a=new i.constructorFunction;if(void 0===a.__CE_state||void 0===a.__CE_definition)throw Error("Failed to construct '"+n+"': The returned value was not constructed with the HTMLElement constructor.");if("http://www.w3.org/1999/xhtml"!==a.namespaceURI)throw Error("Failed to construct '"+n+"': The constructed element's namespace must be the HTML namespace.");if(a.hasAttributes())throw Error("Failed to construct '"+n+"': The constructed element must not have any attributes.");if(null!==a.firstChild)throw Error("Failed to construct '"+n+"': The constructed element must not have any children.");if(null!==a.parentNode)throw Error("Failed to construct '"+n+"': The constructed element must not have a parent node.");if(a.ownerDocument!==t)throw Error("Failed to construct '"+n+"': The constructed element's owner document is incorrect.");if(a.localName!==n)throw Error("Failed to construct '"+n+"': The constructed element's local name is incorrect.");return a}catch(i){return Ta(i),t=null===r?ki.call(t,n):Oi.call(t,r,n),Object.setPrototypeOf(t,HTMLUnknownElement.prototype),t.__CE_state=2,t.__CE_definition=void 0,ba(e,t),t}return ba(e,t=null===r?ki.call(t,n):Oi.call(t,r,n)),t}function Ta(e){var t="",n="",r=0,i=0;e instanceof Error?(t=e.message,n=e.sourceURL||e.fileName||"",r=e.line||e.lineNumber||0,i=e.column||e.columnNumber||0):t="Uncaught "+String(e);var a=void 0;void 0===ErrorEvent.prototype.initErrorEvent?a=new ErrorEvent("error",{cancelable:!0,message:t,filename:n,lineno:r,colno:i,error:e}):((a=document.createEvent("ErrorEvent")).initErrorEvent("error",!1,!0,t,n,r),a.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{configurable:!0,get:function(){return!0}})}),void 0===a.error&&Object.defineProperty(a,"error",{configurable:!0,enumerable:!0,get:function(){return e}}),window.dispatchEvent(a),a.defaultPrevented||console.error(e)}function Ca(){var e=this;this.I=void 0,this.Ka=new Promise((function(t){e.g=t}))}function Aa(e){var t=document;this.X=void 0,this.S=e,this.g=t,wa(this.S,this.g),"loading"===this.g.readyState&&(this.X=new MutationObserver(this.h.bind(this)),this.X.observe(this.g,{childList:!0,subtree:!0}))}function Pa(e){e.X&&e.X.disconnect()}function ka(e){this.ma=new Map,this.na=new Map,this.Fa=new Map,this.wa=!1,this.za=new Map,this.la=function(e){return e()},this.V=!1,this.oa=[],this.S=e,this.Ga=e.sb?new Aa(e):void 0}function Oa(e,t){if(!ha(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(Na(e,t))throw Error("A custom element with name '"+t+"' has already been defined.");if(e.wa)throw Error("A custom element is already being defined.")}function Ra(e,t,n){var r;e.wa=!0;try{var i=n.prototype;if(!(i instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var a=function(e){var t=i[e];if(void 0!==t&&!(t instanceof Function))throw Error("The '"+e+"' callback must be a function.");return t},o=a("connectedCallback"),s=a("disconnectedCallback"),l=a("adoptedCallback"),u=(r=a("attributeChangedCallback"))&&n.observedAttributes||[]}catch(e){throw e}finally{e.wa=!1}return n={localName:t,constructorFunction:n,connectedCallback:o,disconnectedCallback:s,adoptedCallback:l,attributeChangedCallback:r,observedAttributes:u,constructionStack:[]},e.na.set(t,n),e.Fa.set(n.constructorFunction,n),n}function Ia(e){if(!1!==e.V){e.V=!1;for(var t=[],n=e.oa,r=new Map,i=0;i<n.length;i++)r.set(n[i],[]);for(wa(e.S,document,{upgrade:function(n){if(void 0===n.__CE_state){var i=n.localName,a=r.get(i);a?a.push(n):e.na.has(i)&&t.push(n)}}}),i=0;i<t.length;i++)Ea(e.S,t[i]);for(i=0;i<n.length;i++){for(var a=n[i],o=r.get(a),s=0;s<o.length;s++)Ea(e.S,o[s]);(a=e.za.get(a))&&a.resolve(void 0)}n.length=0}}function Na(e,t){var n=e.na.get(t);if(n)return n;if(n=e.ma.get(t)){e.ma.delete(t);try{return Ra(e,t,n())}catch(e){Ta(e)}}}function La(e,t,n){function r(t){return function(n){for(var r=[],i=0;i<arguments.length;++i)r[i]=arguments[i];i=[];for(var a=[],o=0;o<r.length;o++){var s=r[o];if(s instanceof Element&&fa(s)&&a.push(s),s instanceof DocumentFragment)for(s=s.firstChild;s;s=s.nextSibling)i.push(s);else i.push(s)}for(t.apply(this,r),r=0;r<a.length;r++)Sa(e,a[r]);if(fa(this))for(r=0;r<i.length;r++)(a=i[r])instanceof Element&&xa(e,a)}}void 0!==n.prepend&&(t.prepend=r(n.prepend)),void 0!==n.append&&(t.append=r(n.append))}ya.prototype.connectedCallback=function(e){var t=e.__CE_definition;if(t.connectedCallback)try{t.connectedCallback.call(e)}catch(e){Ta(e)}},ya.prototype.disconnectedCallback=function(e){var t=e.__CE_definition;if(t.disconnectedCallback)try{t.disconnectedCallback.call(e)}catch(e){Ta(e)}},ya.prototype.attributeChangedCallback=function(e,t,n,r,i){var a=e.__CE_definition;if(a.attributeChangedCallback&&-1<a.observedAttributes.indexOf(t))try{a.attributeChangedCallback.call(e,t,n,r,i)}catch(e){Ta(e)}},Ca.prototype.resolve=function(e){if(this.I)throw Error("Already resolved.");this.I=e,this.g(e)},Aa.prototype.h=function(e){var t=this.g.readyState;for("interactive"!==t&&"complete"!==t||Pa(this),t=0;t<e.length;t++)for(var n=e[t].addedNodes,r=0;r<n.length;r++)wa(this.S,n[r])},(e=ka.prototype).jb=function(e,t){var n=this;if(!(t instanceof Function))throw new TypeError("Custom element constructor getters must be functions.");Oa(this,e),this.ma.set(e,t),this.oa.push(e),this.V||(this.V=!0,this.la((function(){return Ia(n)})))},e.define=function(e,t){var n=this;if(!(t instanceof Function))throw new TypeError("Custom element constructors must be functions.");Oa(this,e),Ra(this,e,t),this.oa.push(e),this.V||(this.V=!0,this.la((function(){return Ia(n)})))},e.upgrade=function(e){wa(this.S,e)},e.get=function(e){if(e=Na(this,e))return e.constructorFunction},e.whenDefined=function(e){if(!ha(e))return Promise.reject(new SyntaxError("'"+e+"' is not a valid custom element name."));var t=this.za.get(e);if(t)return t.Ka;t=new Ca,this.za.set(e,t);var n=this.na.has(e)||this.ma.has(e);return e=-1===this.oa.indexOf(e),n&&e&&t.resolve(void 0),t.Ka},e.polyfillWrapFlushCallback=function(e){this.Ga&&Pa(this.Ga);var t=this.la;this.la=function(n){return e((function(){return t(n)}))}},ka.prototype.define=ka.prototype.define,ka.prototype.upgrade=ka.prototype.upgrade,ka.prototype.get=ka.prototype.get,ka.prototype.whenDefined=ka.prototype.whenDefined,ka.prototype.polyfillDefineLazy=ka.prototype.jb,ka.prototype.polyfillWrapFlushCallback=ka.prototype.polyfillWrapFlushCallback;var Da={},Ua=window.customElements;function Fa(){var e=new ya;!function(e){function t(){var t=this.constructor,n=document.__CE_registry.Fa.get(t);if(!n)throw Error("Failed to construct a custom element: The constructor was not registered with `customElements`.");var r=n.constructionStack;if(0===r.length)return r=ki.call(document,n.localName),Object.setPrototypeOf(r,t.prototype),r.__CE_state=1,r.__CE_definition=n,ba(e,r),r;var i=r.length-1,a=r[i];if(a===Da)throw Error("Failed to construct '"+n.localName+"': This element was already constructed.");return r[i]=Da,Object.setPrototypeOf(a,t.prototype),ba(e,a),a}t.prototype=oa.prototype,Object.defineProperty(HTMLElement.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:t}),window.HTMLElement=t}(e),function(e){Document.prototype.createElement=function(t){return Ma(e,this,t,null)},Document.prototype.importNode=function(t,n){return t=Ri.call(this,t,!!n),this.__CE_registry?wa(e,t):_a(e,t),t},Document.prototype.createElementNS=function(t,n){return Ma(e,this,n,t)},La(e,Document.prototype,{prepend:Ii,append:Ni})}(e),La(e,DocumentFragment.prototype,{prepend:Li,append:Di}),function(e){function t(t,n){Object.defineProperty(t,"textContent",{enumerable:n.enumerable,configurable:!0,get:n.get,set:function(t){if(this.nodeType===Node.TEXT_NODE)n.set.call(this,t);else{var r=void 0;if(this.firstChild){var i=this.childNodes,a=i.length;if(0<a&&fa(this)){r=Array(a);for(var o=0;o<a;o++)r[o]=i[o]}}if(n.set.call(this,t),r)for(t=0;t<r.length;t++)Sa(e,r[t])}}})}Node.prototype.insertBefore=function(t,n){if(t instanceof DocumentFragment){var r=pa(t);if(t=Bi.call(this,t,n),fa(this))for(n=0;n<r.length;n++)xa(e,r[n]);return t}return r=t instanceof Element&&fa(t),n=Bi.call(this,t,n),r&&Sa(e,t),fa(this)&&xa(e,t),n},Node.prototype.appendChild=function(t){if(t instanceof DocumentFragment){var n=pa(t);if(t=Fi.call(this,t),fa(this))for(var r=0;r<n.length;r++)xa(e,n[r]);return t}return n=t instanceof Element&&fa(t),r=Fi.call(this,t),n&&Sa(e,t),fa(this)&&xa(e,t),r},Node.prototype.cloneNode=function(t){return t=Ui.call(this,!!t),this.ownerDocument.__CE_registry?wa(e,t):_a(e,t),t},Node.prototype.removeChild=function(t){var n=t instanceof Element&&fa(t),r=zi.call(this,t);return n&&Sa(e,t),r},Node.prototype.replaceChild=function(t,n){if(t instanceof DocumentFragment){var r=pa(t);if(t=ji.call(this,t,n),fa(this))for(Sa(e,n),n=0;n<r.length;n++)xa(e,r[n]);return t}r=t instanceof Element&&fa(t);var i=ji.call(this,t,n),a=fa(this);return a&&Sa(e,n),r&&Sa(e,t),a&&xa(e,t),i},Hi&&Hi.get?t(Node.prototype,Hi):function(e,t){e.W=!0,e.ca.push(t)}(e,(function(e){t(e,{enumerable:!0,configurable:!0,get:function(){for(var e=[],t=this.firstChild;t;t=t.nextSibling)t.nodeType!==Node.COMMENT_NODE&&e.push(t.textContent);return e.join("")},set:function(e){for(;this.firstChild;)zi.call(this,this.firstChild);null!=e&&""!==e&&Fi.call(this,document.createTextNode(e))}})}))}(e),function(e){function t(t,n){Object.defineProperty(t,"innerHTML",{enumerable:n.enumerable,configurable:!0,get:n.get,set:function(t){var r=this,i=void 0;if(fa(this)&&(i=[],ga(e,this,(function(e){e!==r&&i.push(e)}))),n.set.call(this,t),i)for(var a=0;a<i.length;a++){var o=i[a];1===o.__CE_state&&e.disconnectedCallback(o)}return this.ownerDocument.__CE_registry?wa(e,this):_a(e,this),t}})}function n(t,n){t.insertAdjacentElement=function(t,r){var i=fa(r);return t=n.call(this,t,r),i&&Sa(e,r),fa(t)&&xa(e,r),t}}function r(t,n){function r(t,n){for(var r=[];t!==n;t=t.nextSibling)r.push(t);for(n=0;n<r.length;n++)wa(e,r[n])}t.insertAdjacentHTML=function(e,t){if("beforebegin"===(e=e.toLowerCase())){var i=this.previousSibling;n.call(this,e,t),r(i||this.parentNode.firstChild,this)}else if("afterbegin"===e)i=this.firstChild,n.call(this,e,t),r(this.firstChild,i);else if("beforeend"===e)i=this.lastChild,n.call(this,e,t),r(i||this.firstChild,null);else{if("afterend"!==e)throw new SyntaxError("The value provided ("+String(e)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");i=this.nextSibling,n.call(this,e,t),r(this.nextSibling,i)}}}Vi&&(Element.prototype.attachShadow=function(t){if(t=Vi.call(this,t),e.W&&!t.__CE_patched){t.__CE_patched=!0;for(var n=0;n<e.ca.length;n++)e.ca[n](t)}return this.__CE_shadowRoot=t}),Gi&&Gi.get?t(Element.prototype,Gi):sa&&sa.get?t(HTMLElement.prototype,sa):function(e,t){e.W=!0,e.g.push(t)}(e,(function(e){t(e,{enumerable:!0,configurable:!0,get:function(){return Ui.call(this,!0).innerHTML},set:function(e){var t="template"===this.localName,n=t?this.content:this,r=Oi.call(document,this.namespaceURI,this.localName);for(r.innerHTML=e;0<n.childNodes.length;)zi.call(n,n.childNodes[0]);for(e=t?r.content:r;0<e.childNodes.length;)Fi.call(n,e.childNodes[0])}})})),Element.prototype.setAttribute=function(t,n){if(1!==this.__CE_state)return Xi.call(this,t,n);var r=Wi.call(this,t);Xi.call(this,t,n),n=Wi.call(this,t),e.attributeChangedCallback(this,t,r,n,null)},Element.prototype.setAttributeNS=function(t,n,r){if(1!==this.__CE_state)return Zi.call(this,t,n,r);var i=Ji.call(this,t,n);Zi.call(this,t,n,r),r=Ji.call(this,t,n),e.attributeChangedCallback(this,n,i,r,t)},Element.prototype.removeAttribute=function(t){if(1!==this.__CE_state)return qi.call(this,t);var n=Wi.call(this,t);qi.call(this,t),null!==n&&e.attributeChangedCallback(this,t,n,null,null)},Yi&&(Element.prototype.toggleAttribute=function(t,n){if(1!==this.__CE_state)return Yi.call(this,t,n);var r=Wi.call(this,t);return null!==r!==(n=Yi.call(this,t,n))&&e.attributeChangedCallback(this,t,r,n?"":null,null),n}),Element.prototype.removeAttributeNS=function(t,n){if(1!==this.__CE_state)return Ki.call(this,t,n);var r=Ji.call(this,t,n);Ki.call(this,t,n);var i=Ji.call(this,t,n);r!==i&&e.attributeChangedCallback(this,n,r,i,t)},la?n(HTMLElement.prototype,la):$i&&n(Element.prototype,$i),ua?r(HTMLElement.prototype,ua):Qi&&r(Element.prototype,Qi),La(e,Element.prototype,{prepend:ea,append:ta}),function(e){function t(t){return function(n){for(var r=[],i=0;i<arguments.length;++i)r[i]=arguments[i];i=[];for(var a=[],o=0;o<r.length;o++){var s=r[o];if(s instanceof Element&&fa(s)&&a.push(s),s instanceof DocumentFragment)for(s=s.firstChild;s;s=s.nextSibling)i.push(s);else i.push(s)}for(t.apply(this,r),r=0;r<a.length;r++)Sa(e,a[r]);if(fa(this))for(r=0;r<i.length;r++)(a=i[r])instanceof Element&&xa(e,a)}}var n=Element.prototype;void 0!==na&&(n.before=t(na)),void 0!==ra&&(n.after=t(ra)),void 0!==ia&&(n.replaceWith=function(t){for(var n=[],r=0;r<arguments.length;++r)n[r]=arguments[r];r=[];for(var i=[],a=0;a<n.length;a++){var o=n[a];if(o instanceof Element&&fa(o)&&i.push(o),o instanceof DocumentFragment)for(o=o.firstChild;o;o=o.nextSibling)r.push(o);else r.push(o)}for(a=fa(this),ia.apply(this,n),n=0;n<i.length;n++)Sa(e,i[n]);if(a)for(Sa(e,this),n=0;n<r.length;n++)(i=r[n])instanceof Element&&xa(e,i)}),void 0!==aa&&(n.remove=function(){var t=fa(this);aa.call(this),t&&Sa(e,this)})}(e)}(e),window.CustomElementRegistry=ka,e=new ka(e),document.__CE_registry=e,Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:e})}function Ba(){this.end=this.start=0,this.rules=this.parent=this.previous=null,this.cssText=this.parsedCssText="",this.atRule=!1,this.type=0,this.parsedSelector=this.selector=this.keyframesName=""}function za(e){var t=e=e.replace(Ja,"").replace(Za,""),n=new Ba;n.start=0,n.end=t.length;for(var r=n,i=0,a=t.length;i<a;i++)if("{"===t[i]){r.rules||(r.rules=[]);var o=r,s=o.rules[o.rules.length-1]||null;(r=new Ba).start=i+1,r.parent=o,r.previous=s,o.rules.push(r)}else"}"===t[i]&&(r.end=i+1,r=r.parent||n);return ja(n,e)}function ja(e,t){var n=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=n.trim(),e.parent&&(n=function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(e,t){for(t=6-(e=t).length;t--;)e="0"+e;return"\\"+e}))}(n=t.substring(e.previous?e.previous.end:e.parent.start,e.start-1)),n=(n=n.replace(no," ")).substring(n.lastIndexOf(";")+1),n=e.parsedSelector=e.selector=n.trim(),e.atRule=0===n.indexOf("@"),e.atRule?0===n.indexOf("@media")?e.type=qa:n.match(to)&&(e.type=Xa,e.keyframesName=e.selector.split(no).pop()):e.type=0===n.indexOf("--")?Ya:Wa),n=e.rules)for(var r=0,i=n.length,a=void 0;r<i&&(a=n[r]);r++)ja(a,t);return e}function Ha(e,t,n){n=void 0===n?"":n;var r="";if(e.cssText||e.rules){var i,a=e.rules;if((i=a)&&(i=!((i=a[0])&&i.selector&&0===i.selector.indexOf("--"))),i){i=0;for(var o=a.length,s=void 0;i<o&&(s=a[i]);i++)r=Ha(s,t,r)}else(r=(t=t?e.cssText:(t=(t=e.cssText).replace(Ka,"").replace($a,"")).replace(Qa,"").replace(eo,"")).trim())&&(r=" "+r+"\n")}return r&&(e.selector&&(n+=e.selector+" {\n"),n+=r,e.selector&&(n+="}\n\n")),n}Ua&&!Ua.forcePolyfill&&"function"==typeof Ua.define&&"function"==typeof Ua.get||Fa(),window.__CE_installPolyfill=Fa;var Va,Ga,Wa=1,Xa=7,qa=4,Ya=1e3,Ja=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,Za=/@import[^;]*;/gim,Ka=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,$a=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,Qa=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,eo=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,to=/^@[^\s]*keyframes/,no=/\s+/g,ro=!(window.ShadyDOM&&window.ShadyDOM.inUse);function io(e){Va=(!e||!e.shimcssproperties)&&(ro||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)")))}window.ShadyCSS&&void 0!==window.ShadyCSS.cssBuild&&(Ga=window.ShadyCSS.cssBuild);var ao=!(!window.ShadyCSS||!window.ShadyCSS.disableRuntime);window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?Va=window.ShadyCSS.nativeCss:window.ShadyCSS?(io(window.ShadyCSS),window.ShadyCSS=void 0):io(window.WebComponents&&window.WebComponents.flags);var oo=Va,so=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,lo=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,uo=/(--[\w-]+)\s*([:,;)]|$)/gi,co=/(animation\s*:)|(animation-name\s*:)/,ho=/@media\s(.*)/,fo=/\{[^}]*\}/g,po=new Set;function vo(e,t){return e?("string"==typeof e&&(e=za(e)),t&&go(e,t),Ha(e,oo)):""}function mo(e){return!e.__cssRules&&e.textContent&&(e.__cssRules=za(e.textContent)),e.__cssRules||null}function yo(e){return!!e.parent&&e.parent.type===Xa}function go(e,t,n,r){if(e){var i=!1,a=e.type;if(r&&a===qa){var o=e.selector.match(ho);o&&(window.matchMedia(o[1]).matches||(i=!0))}if(a===Wa?t(e):n&&a===Xa?n(e):a===Ya&&(i=!0),(e=e.rules)&&!i)for(i=0,a=e.length,o=void 0;i<a&&(o=e[i]);i++)go(o,t,n,r)}}function _o(e,t,n,r){var i=document.createElement("style");return t&&i.setAttribute("scope",t),i.textContent=e,So(i,n,r),i}var bo=null;function xo(e){e=document.createComment(" Shady DOM styles for "+e+" ");var t=document.head;return t.insertBefore(e,(bo?bo.nextSibling:null)||t.firstChild),bo=e}function So(e,t,n){(t=t||document.head).insertBefore(e,n&&n.nextSibling||t.firstChild),bo?e.compareDocumentPosition(bo)===Node.DOCUMENT_POSITION_PRECEDING&&(bo=e):bo=e}function wo(e,t){for(var n=0,r=e.length;t<r;t++)if("("===e[t])n++;else if(")"===e[t]&&0===--n)return t;return-1}function Eo(e,t){var n=e.indexOf("var(");if(-1===n)return t(e,"","","");var r=wo(e,n+3),i=e.substring(n+4,r);return n=e.substring(0,n),e=Eo(e.substring(r+1),t),-1===(r=i.indexOf(","))?t(n,i.trim(),"",e):t(n,i.substring(0,r).trim(),i.substring(r+1).trim(),e)}function Mo(e,t){ro?e.setAttribute("class",t):window.ShadyDOM.nativeMethods.setAttribute.call(e,"class",t)}var To=window.ShadyDOM&&window.ShadyDOM.wrap||function(e){return e};function Co(e){var t=e.localName,n="";return t?-1<t.indexOf("-")||(n=t,t=e.getAttribute&&e.getAttribute("is")||""):(t=e.is,n=e.extends),{is:t,ja:n}}function Ao(e){for(var t=[],n="",r=0;0<=r&&r<e.length;r++)if("("===e[r]){var i=wo(e,r);n+=e.slice(r,i+1),r=i}else","===e[r]?(t.push(n),n=""):n+=e[r];return n&&t.push(n),t}function Po(e){if(void 0!==Ga)return Ga;if(void 0===e.__cssBuild){var t=e.getAttribute("css-build");if(t)e.__cssBuild=t;else{if(""!==(t=(t="template"===e.localName?e.content.firstChild:e.firstChild)instanceof Comment&&"css-build"===(t=t.textContent.trim().split(":"))[0]?t[1]:"")){var n="template"===e.localName?e.content.firstChild:e.firstChild;n.parentNode.removeChild(n)}e.__cssBuild=t}}return e.__cssBuild||""}function ko(e){return!(""===(e=void 0===e?"":e)||!oo)&&(ro?"shadow"===e:"shady"===e)}function Oo(){}function Ro(e,t,n){var r;if(t.nodeType===Node.ELEMENT_NODE&&n(t),r="template"===t.localName?(t.content||t._content||t).childNodes:t.children||t.childNodes)for(t=0;t<r.length;t++)Ro(e,r[t],n)}function Io(e,t,n){if(t)if(e.classList)n?(e.classList.remove("style-scope"),e.classList.remove(t)):(e.classList.add("style-scope"),e.classList.add(t));else if(e.getAttribute){var r=e.getAttribute("class");n?r&&Mo(e,t=r.replace("style-scope","").replace(t,"")):Mo(e,(r?r+" ":"")+"style-scope "+t)}}function No(e,t,n){Ro(Zo,e,(function(e){Io(e,t,!0),Io(e,n)}))}function Lo(e,t){Ro(Zo,e,(function(e){Io(e,t||"",!0)}))}function Do(e,t,n,r,i){var a=Zo;return""===(i=void 0===i?"":i)&&(i=ro||"shady"===(void 0===r?"":r)?vo(t,n):function(e,t,n,r,i){var a=Uo(n,r);return n=n?"."+n:"",vo(t,(function(t){t.i||(t.selector=t.G=Fo(e,t,e.h,n,a),t.i=!0),i&&i(t,n,a)}))}(a,t,(e=Co(e)).is,e.ja,n)+"\n\n"),i.trim()}function Uo(e,t){return t?"[is="+e+"]":e}function Fo(e,t,n,r,i){var a=Ao(t.selector);if(!yo(t)){t=0;for(var o=a.length,s=void 0;t<o&&(s=a[t]);t++)a[t]=n.call(e,s,r,i)}return a.filter((function(e){return!!e})).join(",")}function Bo(e){return e.replace(Ho,(function(e,t,n){return-1<n.indexOf("+")?n=n.replace(/\+/g,"___"):-1<n.indexOf("___")&&(n=n.replace(/___/g,"+")),":"+t+"("+n+")"}))}function zo(e,t){e=e.split(/(\[.+?\])/);for(var n=[],r=0;r<e.length;r++)if(1==r%2)n.push(e[r]);else{var i=e[r];""===i&&r===e.length-1||((i=i.split(":"))[0]+=t,n.push(i.join(":")))}return n.join("")}function jo(e){":root"===e.selector&&(e.selector="html")}Oo.prototype.h=function(e,t,n){var r=!1;e=e.trim();var i=Ho.test(e);i&&(e=Bo(e=e.replace(Ho,(function(e,t,n){return":"+t+"("+n.replace(/\s/g,"")+")"}))));var a=Jo.test(e);if(a){var o=function(e){for(var t,n=[];t=e.match(Jo);){var r=t.index,i=wo(e,r);if(-1===i)throw Error(t.input+" selector missing ')'");t=e.slice(r,i+1),e=e.replace(t,""),n.push(t)}return{Ea:e,matches:n}}(e);e=o.Ea,o=o.matches}return e=(e=e.replace(Wo,":host $1")).replace(Vo,(function(e,i,a){return r||(e=function(e,t,n,r){var i=e.indexOf("::slotted");if(0<=e.indexOf(":host")?e=function(e,t){var n=e.match(Xo);return(n=n&&n[2].trim()||"")?n[0].match(Go)?e.replace(Xo,(function(e,n,r){return t+r})):n.split(Go)[0]===t?n:"should_not_match":e.replace(":host",t)}(e,r):0!==i&&(e=n?zo(e,n):e),n=!1,0<=i&&(t="",n=!0),n){var a=!0;n&&(e=e.replace(qo,(function(e,t){return" > "+t})))}return{value:e,Ya:t,stop:a}}(a,i,t,n),r=r||e.stop,i=e.Ya,a=e.value),i+a})),a&&(e=function(e,t){var n=e.split("");return t.reduce((function(e,t,r){return e+t+n[r+1]}),n[0])}(e,o)),i&&(e=Bo(e)),e.replace(Yo,(function(e,t,n,r){return'[dir="'+n+'"] '+t+r+", "+t+'[dir="'+n+'"]'+r}))},Oo.prototype.i=function(e){return e.match(":host")?"":e.match("::slotted")?this.h(e,":not(.style-scope)"):zo(e.trim(),":not(.style-scope)")},o.Object.defineProperties(Oo.prototype,{g:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}});var Ho=/:(nth[-\w]+)\(([^)]+)\)/,Vo=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Go=/[[.:#*]/,Wo=/^(::slotted)/,Xo=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,qo=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Yo=/(.*):dir\((?:(ltr|rtl))\)(.*)/,Jo=/:(?:matches|any|-(?:webkit|moz)-any)/,Zo=new Oo;function Ko(e,t,n,r,i){this.M=e||null,this.h=t||null,this.Ca=n||[],this.K=null,this.cssBuild=i||"",this.ja=r||"",this.g=this.L=this.R=null}function $o(e){return e?e.__styleInfo:null}function Qo(e,t){return e.__styleInfo=t}function es(e){var t=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return t&&t.call(this,e)}Ko.prototype.i=function(){return this.M},Ko.prototype._getStyleRules=Ko.prototype.i;var ts=/:host\s*>\s*/,ns=navigator.userAgent.match("Trident");function rs(){}function is(e){if(!e.F){var t={},n={};as(e,n)&&(t.P=n,e.rules=null),t.cssText=e.parsedCssText.replace(fo,"").replace(so,""),e.F=t}}function as(e,t){var n=e.F;if(!n){n=e.parsedCssText;for(var r;e=so.exec(n);)"inherit"===(r=(e[2]||e[3]).trim())&&"unset"===r||(t[e[1].trim()]=r),r=!0;return r}if(n.P)return Object.assign(t,n.P),!0}function os(e,t,n){return t&&(t=0<=t.indexOf(";")?ss(e,t,n):Eo(t,(function(t,r,i,a){return r?((r=os(e,n[r],n))&&"initial"!==r?"apply-shim-inherit"===r&&(r="inherit"):r=os(e,n[i]||i,n)||i,t+(r||"")+a):t+a}))),t&&t.trim()||""}function ss(e,t,n){t=t.split(";");for(var r,i,a=0;a<t.length;a++)if(r=t[a]){if(lo.lastIndex=0,i=lo.exec(r))r=os(e,n[i[1]],n);else if(-1!==(i=r.indexOf(":"))){var o=r.substring(i);o=os(e,o=o.trim(),n)||o,r=r.substring(0,i)+o}t[a]=r&&r.lastIndexOf(";")===r.length-1?r.slice(0,-1):r||""}return t.join(";")}function ls(e){return function(t){return t.replace(e.u,e.g)}}function us(e,t){var n=cs,r=mo(e);e.textContent=vo(r,(function(e){var r=e.cssText=e.parsedCssText;e.F&&e.F.cssText&&(r=r.replace(Ka,"").replace($a,""),e.cssText=ss(n,r,t))}))}o.Object.defineProperties(rs.prototype,{g:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var cs=new rs,hs={},ds=window.customElements;if(ds&&!ro&&!ao){var fs=ds.define;ds.define=function(e,t,n){hs[e]||(hs[e]=xo(e)),fs.call(ds,e,t,n)}}function ps(){this.cache={}}function vs(){}ps.prototype.store=function(e,t,n,r){var i=this.cache[e]||[];i.push({P:t,styleElement:n,L:r}),100<i.length&&i.shift(),this.cache[e]=i};var ms=new RegExp(Zo.g+"\\s*([^\\s]*)");function ys(e){return(e=(e.classList&&e.classList.value?e.classList.value:e.getAttribute("class")||"").match(ms))?e[1]:""}function gs(e){var t=To(e).getRootNode();return t===e||t===e.ownerDocument?"":(e=t.host)?Co(e).is:""}function _s(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.target!==document.documentElement&&n.target!==document.head)for(var r=0;r<n.addedNodes.length;r++){var i=n.addedNodes[r];if(i.nodeType===Node.ELEMENT_NODE){var a=i.getRootNode(),o=ys(i);if(o&&a===i.ownerDocument&&("style"!==i.localName&&"template"!==i.localName||""===Po(i)))Lo(i,o);else if(a instanceof ShadowRoot)for((a=gs(i))!==o&&No(i,o,a),i=window.ShadyDOM.nativeMethods.querySelectorAll.call(i,":not(."+Zo.g+")"),o=0;o<i.length;o++){var s=gs(a=i[o]);s&&Io(a,s)}}}}}if(!(ro||window.ShadyDOM&&window.ShadyDOM.handlesDynamicScoping)){var bs=new MutationObserver(_s),xs=function(e){bs.observe(e,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)xs(document);else{var Ss=function(){xs(document.body)};window.HTMLImports?window.HTMLImports.whenReady(Ss):requestAnimationFrame((function(){if("loading"===document.readyState){var e=function(){Ss(),document.removeEventListener("readystatechange",e)};document.addEventListener("readystatechange",e)}else Ss()}))}vs=function(){_s(bs.takeRecords())}}var ws={},Es=Promise.resolve();function Ms(e){(e=ws[e])&&(e._applyShimCurrentVersion=e._applyShimCurrentVersion||0,e._applyShimValidatingVersion=e._applyShimValidatingVersion||0,e._applyShimNextVersion=(e._applyShimNextVersion||0)+1)}function Ts(e){return e._applyShimCurrentVersion===e._applyShimNextVersion}var Cs={},As=new ps;function Ps(){this.ea={},this.i=document.documentElement;var e=new Ba;e.rules=[],this.u=Qo(this.i,new Ko(e)),this.O=!1,this.g=this.h=null}function ks(e){var t=Co(e),n=t.is;t=t.ja;var r=hs[n]||null,i=ws[n];if(i)return Qo(e,t=new Ko(n=i._styleAst,r,i.g,t,i=Po(i))),t}function Os(e){if(!e.h&&window.ShadyCSS&&window.ShadyCSS.ApplyShim){e.h=window.ShadyCSS.ApplyShim,e.h.invalidCallback=Ms;var t=!0}else t=!1;return function(e){!e.g&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(e.g=window.ShadyCSS.CustomStyleInterface,e.g.transformCallback=function(t){e.Qa(t)},e.g.validateCallback=function(){requestAnimationFrame((function(){(e.g.enqueued||e.O)&&e.flushCustomStyles()}))})}(e),t}function Rs(e,t,n){var r=Co(t).is;if(n.K){var i,a=n.K;for(i in a)null===i?t.style.removeProperty(i):t.style.setProperty(i,a[i])}!(a=ws[r])&&t!==e.i||a&&""!==Po(a)||!a||!a._style||Ts(a)||((Ts(a)||a._applyShimValidatingVersion!==a._applyShimNextVersion)&&(Os(e),e.h&&e.h.transformRules(a._styleAst,r),a._style.textContent=Do(t,n.M),function(e){e._applyShimValidatingVersion=e._applyShimNextVersion,e._validating||(e._validating=!0,Es.then((function(){e._applyShimCurrentVersion=e._applyShimNextVersion,e._validating=!1})))}(a)),ro&&(e=t.shadowRoot)&&(e=e.querySelector("style"))&&(e.textContent=Do(t,n.M)),n.M=a._styleAst)}function Is(e,t){return(t=To(t).getRootNode().host)?$o(t)||ks(t)?t:Is(e,t):e.i}function Ns(e,t,n){var r=Is(e,t),i=$o(r),a=i.R;for(var o in r===e.i||a||(Ns(e,r,i),a=i.R),e=Object.create(a||null),r=function(e,t,n){var r={},i={};return go(t,(function(t){!function(e,t,n,r){if(t.F||is(t),t.F.P){var i=Co(e);e=i.is,i=i.ja,i=e?Uo(e,i):"html";var a=t.parsedSelector,o=!!a.match(ts)||"html"===i&&-1<a.indexOf("html"),s=0===a.indexOf(":host")&&!o;"shady"===n&&(s=!(o=a===i+" > *."+i||-1!==a.indexOf("html"))&&0===a.indexOf(i)),(o||s)&&(n=i,s&&(t.G||(t.G=Fo(Zo,t,Zo.h,e?"."+e:"",i)),n=t.G||i),o&&"html"===i&&(n=t.G||t.O),r({Ea:n,gb:s,vb:o}))}}(e,t,n,(function(n){es.call(e._element||e,n.Ea)&&(n.gb?as(t,r):as(t,i))}))}),null,!0),{mb:i,eb:r}}(t,n.M,n.cssBuild),t=function(e,t){var n={},r=[];return go(e,(function(e){e.F||is(e);var i=e.G||e.parsedSelector;t&&e.F.P&&i&&es.call(t,i)&&(as(e,n),e=e.index,i=parseInt(e/32,10),r[i]=(r[i]||0)|1<<e%32)}),null,!0),{P:n,key:r}}(i.M,t).P,Object.assign(e,r.eb,t,r.mb),t=n.K)((i=t[o])||0===i)&&(e[o]=i);for(o=cs,t=Object.getOwnPropertyNames(e),i=0;i<t.length;i++)e[r=t[i]]=os(o,e[r],e);n.R=e}(e=Ps.prototype).flush=function(){vs()},e.bb=function(e){return mo(e)},e.qb=function(e){return vo(e)},e.prepareTemplate=function(e,t,n){this.prepareTemplateDom(e,t),this.prepareTemplateStyles(e,t,n)},e.prepareTemplateStyles=function(e,t,n){if(!e._prepared&&!ao){ro||hs[t]||(hs[t]=xo(t)),e._prepared=!0,e.name=t,e.extends=n,ws[t]=e;var r=Po(e),i=ko(r);n={is:t,extends:n};for(var a=[],o=e.content.querySelectorAll("style"),s=0;s<o.length;s++){var l=o[s];if(l.hasAttribute("shady-unscoped")){if(!ro){var u=l.textContent;if(!po.has(u)){po.add(u);var c=document.createElement("style");c.setAttribute("shady-unscoped",""),c.textContent=u,document.head.appendChild(c)}l.parentNode.removeChild(l)}}else a.push(l.textContent),l.parentNode.removeChild(l)}a=a.join("").trim()+(Cs[t]||""),Os(this),i||((o=!r)&&(o=lo.test(a)||so.test(a),lo.lastIndex=0,so.lastIndex=0),s=za(a),o&&oo&&this.h&&this.h.transformRules(s,t),e._styleAst=s),o=[],oo||(o=function(e){var t={},n=[],r=0;for(var i in go(e,(function(e){is(e),e.index=r++,e=e.F.cssText;for(var n;n=uo.exec(e);){var i=n[1];":"!==n[2]&&(t[i]=!0)}}),(function(e){n.push(e)})),e.h=n,e=[],t)e.push(i);return e}(e._styleAst)),o.length&&!oo||(s=ro?e.content:null,t=hs[t]||null,r=(r=Do(n,e._styleAst,null,r,i?a:"")).length?_o(r,n.is,s,t):null,e._style=r),e.g=o}},e.kb=function(e,t){Cs[t]=e.join(" ")},e.prepareTemplateDom=function(e,t){if(!ao){var n=Po(e);ro||"shady"===n||e._domPrepared||(e._domPrepared=!0,function(e,t){Ro(Zo,e,(function(e){Io(e,t||"")}))}(e.content,t))}},e.flushCustomStyles=function(){if(!ao){var e=Os(this);if(this.g){var t=this.g.processStyles();if((e||this.g.enqueued)&&!ko(this.u.cssBuild)){if(oo){if(!this.u.cssBuild)for(e=0;e<t.length;e++){var n=this.g.getStyleForCustomStyle(t[e]);if(n&&oo&&this.h){var r=mo(n);Os(this),this.h.transformRules(r),n.textContent=vo(r)}}}else{for(function(e,t){t=t.map((function(t){return e.g.getStyleForCustomStyle(t)})).filter((function(e){return!!e})),t.sort((function(e,t){return(e=t.compareDocumentPosition(e))&Node.DOCUMENT_POSITION_FOLLOWING?1:e&Node.DOCUMENT_POSITION_PRECEDING?-1:0})),e.u.M.rules=t.map((function(e){return mo(e)}))}(this,t),Ns(this,this.i,this.u),e=0;e<t.length;e++)(n=this.g.getStyleForCustomStyle(t[e]))&&us(n,this.u.R);this.O&&this.styleDocument()}this.g.enqueued=!1}}}},e.styleElement=function(e,t){if(ao){if(t){$o(e)||Qo(e,new Ko(null));var n=$o(e);n.K=n.K||{},Object.assign(n.K,t),Rs(this,e,n)}}else if(n=$o(e)||ks(e))if(e!==this.i&&(this.O=!0),t&&(n.K=n.K||{},Object.assign(n.K,t)),oo)Rs(this,e,n);else if(this.flush(),Ns(this,e,n),n.Ca&&n.Ca.length){var r;t=Co(e).is;e:{if(r=As.cache[t])for(var i=r.length-1;0<=i;i--){var a=r[i];t:{for(var o=n.Ca,s=0;s<o.length;s++){var l=o[s];if(a.P[l]!==n.R[l]){o=!1;break t}}o=!0}if(o){r=a;break e}}r=void 0}o=r?r.styleElement:null,i=n.L,(a=r&&r.L)||(a=t+"-"+(a=this.ea[t]=(this.ea[t]||0)+1)),n.L=a,a=n.L,s=cs,s=o?o.textContent||"":function(e,t,n,r){var i=Co(t),a=Uo(i.is,i.ja),o=new RegExp("(?:^|[^.#[:])"+(t.extends?"\\"+a.slice(0,-1)+"\\]":a)+"($|[.:[\\s>+~])"),s=$o(t);i=s.M,s=s.cssBuild;var l=function(e,t){e=e.h;var n={};if(!ro&&e)for(var r=0,i=e[r];r<e.length;i=e[++r]){var a=i,o=t;a.u=new RegExp("\\b"+a.keyframesName+"(?!\\B|-)","g"),a.g=a.keyframesName+"-"+o,a.G=a.G||a.selector,a.selector=a.G.replace(a.keyframesName,a.g),n[i.keyframesName]=ls(i)}return n}(i,r);return Do(t,i,(function(t){var i="";if(t.F||is(t),t.F.cssText&&(i=ss(e,t.F.cssText,n)),t.cssText=i,!ro&&!yo(t)&&t.cssText){var s=i=t.cssText;if(null==t.Ma&&(t.Ma=co.test(i)),t.Ma)if(null==t.ra)for(var u in t.ra=[],l)i!==(s=(s=l[u])(i))&&(i=s,t.ra.push(u));else{for(u=0;u<t.ra.length;++u)i=(s=l[t.ra[u]])(i);s=i}t.cssText=s,t.G=t.G||t.selector,i="."+r,s=0;for(var c=(u=Ao(t.G)).length,h=void 0;s<c&&(h=u[s]);s++)u[s]=h.match(o)?h.replace(a,i):i+" "+h;t.selector=u.join(",")}}),s)}(s,e,n.R,a);var u=(l=$o(e)).g;u&&!ro&&u!==o&&(u._useCount--,0>=u._useCount&&u.parentNode&&u.parentNode.removeChild(u)),ro?l.g?(l.g.textContent=s,o=l.g):s&&(o=_o(s,a,e.shadowRoot,l.h)):o?o.parentNode||(ns&&-1<s.indexOf("@media")&&(o.textContent=s),So(o,null,l.h)):s&&(o=_o(s,a,null,l.h)),o&&(o._useCount=o._useCount||0,l.g!=o&&o._useCount++,l.g=o),a=o,ro||(o=n.L,l=s=e.getAttribute("class")||"",i&&(l=s.replace(new RegExp("\\s*x-scope\\s*"+i+"\\s*","g")," ")),s!==(l+=(l?" ":"")+"x-scope "+o)&&Mo(e,l)),r||As.store(t,n.R,a,n.L)}},e.styleDocument=function(e){this.styleSubtree(this.i,e)},e.styleSubtree=function(e,t){var n=To(e),r=n.shadowRoot,i=e===this.i;if((r||i)&&this.styleElement(e,t),e=i?n:r)for(e=Array.from(e.querySelectorAll("*")).filter((function(e){return To(e).shadowRoot})),t=0;t<e.length;t++)this.styleSubtree(e[t])},e.Qa=function(e){var t=this,n=Po(e);if(n!==this.u.cssBuild&&(this.u.cssBuild=n),!ko(n)){var r=mo(e);go(r,(function(e){if(ro)jo(e);else{var r=Zo;e.selector=e.parsedSelector,jo(e),e.selector=e.G=Fo(r,e,r.i,void 0,void 0)}oo&&""===n&&(Os(t),t.h&&t.h.transformRule(e))})),oo?e.textContent=vo(r):this.u.M.rules.push(r)}},e.getComputedStyleValue=function(e,t){var n;return oo||(n=($o(e)||$o(Is(this,e))).R[t]),(n=n||window.getComputedStyle(e).getPropertyValue(t))?n.trim():""},e.pb=function(e,t){var n=To(e).getRootNode();if(t=t?("string"==typeof t?t:String(t)).split(/\s/):[],!(n=n.host&&n.host.localName)){var r=e.getAttribute("class");if(r){r=r.split(/\s/);for(var i=0;i<r.length;i++)if(r[i]===Zo.g){n=r[i+1];break}}}n&&t.push(Zo.g,n),oo||(n=$o(e))&&n.L&&t.push(cs.g,n.L),Mo(e,t.join(" "))},e.Xa=function(e){return $o(e)},e.ob=function(e,t){Io(e,t)},e.rb=function(e,t){Io(e,t,!0)},e.nb=function(e){return gs(e)},e.$a=function(e){return ys(e)},Ps.prototype.flush=Ps.prototype.flush,Ps.prototype.prepareTemplate=Ps.prototype.prepareTemplate,Ps.prototype.styleElement=Ps.prototype.styleElement,Ps.prototype.styleDocument=Ps.prototype.styleDocument,Ps.prototype.styleSubtree=Ps.prototype.styleSubtree,Ps.prototype.getComputedStyleValue=Ps.prototype.getComputedStyleValue,Ps.prototype.setElementClass=Ps.prototype.pb,Ps.prototype._styleInfoForNode=Ps.prototype.Xa,Ps.prototype.transformCustomStyleForDocument=Ps.prototype.Qa,Ps.prototype.getStyleAst=Ps.prototype.bb,Ps.prototype.styleAstToString=Ps.prototype.qb,Ps.prototype.flushCustomStyles=Ps.prototype.flushCustomStyles,Ps.prototype.scopeNode=Ps.prototype.ob,Ps.prototype.unscopeNode=Ps.prototype.rb,Ps.prototype.scopeForNode=Ps.prototype.nb,Ps.prototype.currentScopeForNode=Ps.prototype.$a,Ps.prototype.prepareAdoptedCssText=Ps.prototype.kb,Object.defineProperties(Ps.prototype,{nativeShadow:{get:function(){return ro}},nativeCss:{get:function(){return oo}}});var Ls,Ds,Us=new Ps;window.ShadyCSS&&(Ls=window.ShadyCSS.ApplyShim,Ds=window.ShadyCSS.CustomStyleInterface),window.ShadyCSS={ScopingShim:Us,prepareTemplate:function(e,t,n){Us.flushCustomStyles(),Us.prepareTemplate(e,t,n)},prepareTemplateDom:function(e,t){Us.prepareTemplateDom(e,t)},prepareTemplateStyles:function(e,t,n){Us.flushCustomStyles(),Us.prepareTemplateStyles(e,t,n)},styleSubtree:function(e,t){Us.flushCustomStyles(),Us.styleSubtree(e,t)},styleElement:function(e){Us.flushCustomStyles(),Us.styleElement(e)},styleDocument:function(e){Us.flushCustomStyles(),Us.styleDocument(e)},flushCustomStyles:function(){Us.flushCustomStyles()},getComputedStyleValue:function(e,t){return Us.getComputedStyleValue(e,t)},nativeCss:oo,nativeShadow:ro,cssBuild:Ga,disableRuntime:ao},Ls&&(window.ShadyCSS.ApplyShim=Ls),Ds&&(window.ShadyCSS.CustomStyleInterface=Ds),function(e){function t(e){return""==e&&(a.call(this),this.m=!0),e.toLowerCase()}function n(e){var t=e.charCodeAt(0);return 32<t&&127>t&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function r(e){var t=e.charCodeAt(0);return 32<t&&127>t&&-1==[34,35,60,62,96].indexOf(t)?e:encodeURIComponent(e)}function i(e,i,o){function s(e){y.push(e)}var l=i||"scheme start",f=0,p="",v=!1,m=!1,y=[];e:for(;(null!=e[f-1]||0==f)&&!this.m;){var g=e[f];switch(l){case"scheme start":if(!g||!h.test(g)){if(i){s("Invalid scheme.");break e}p="",l="no scheme";continue}p+=g.toLowerCase(),l="scheme";break;case"scheme":if(g&&d.test(g))p+=g.toLowerCase();else{if(":"!=g){if(i){null!=g&&s("Code point not allowed in scheme: "+g);break e}p="",f=0,l="no scheme";continue}if(this.l=p,p="",i)break e;void 0!==u[this.l]&&(this.H=!0),l="file"==this.l?"relative":this.H&&o&&o.l==this.l?"relative or authority":this.H?"authority first slash":"scheme data"}break;case"scheme data":"?"==g?(this.A="?",l="query"):"#"==g?(this.C="#",l="fragment"):null!=g&&"\t"!=g&&"\n"!=g&&"\r"!=g&&(this.ya+=n(g));break;case"no scheme":if(o&&void 0!==u[o.l]){l="relative";continue}s("Missing scheme."),a.call(this),this.m=!0;break;case"relative or authority":if("/"!=g||"/"!=e[f+1]){s("Expected /, got: "+g),l="relative";continue}l="authority ignore slashes";break;case"relative":if(this.H=!0,"file"!=this.l&&(this.l=o.l),null==g){this.o=o.o,this.v=o.v,this.s=o.s.slice(),this.A=o.A,this.B=o.B,this.j=o.j;break e}if("/"==g||"\\"==g)"\\"==g&&s("\\ is an invalid code point."),l="relative slash";else if("?"==g)this.o=o.o,this.v=o.v,this.s=o.s.slice(),this.A="?",this.B=o.B,this.j=o.j,l="query";else{if("#"!=g){l=e[f+1];var _=e[f+2];("file"!=this.l||!h.test(g)||":"!=l&&"|"!=l||null!=_&&"/"!=_&&"\\"!=_&&"?"!=_&&"#"!=_)&&(this.o=o.o,this.v=o.v,this.B=o.B,this.j=o.j,this.s=o.s.slice(),this.s.pop()),l="relative path";continue}this.o=o.o,this.v=o.v,this.s=o.s.slice(),this.A=o.A,this.C="#",this.B=o.B,this.j=o.j,l="fragment"}break;case"relative slash":if("/"!=g&&"\\"!=g){"file"!=this.l&&(this.o=o.o,this.v=o.v,this.B=o.B,this.j=o.j),l="relative path";continue}"\\"==g&&s("\\ is an invalid code point."),l="file"==this.l?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=g){s("Expected '/', got: "+g),l="authority ignore slashes";continue}l="authority second slash";break;case"authority second slash":if(l="authority ignore slashes","/"!=g){s("Expected '/', got: "+g);continue}break;case"authority ignore slashes":if("/"!=g&&"\\"!=g){l="authority";continue}s("Expected authority, got: "+g);break;case"authority":if("@"==g){for(v&&(s("@ already seen."),p+="%40"),v=!0,g=0;g<p.length;g++)"\t"==(_=p[g])||"\n"==_||"\r"==_?s("Invalid whitespace in authority."):":"==_&&null===this.j?this.j="":(_=n(_),null!==this.j?this.j+=_:this.B+=_);p=""}else{if(null==g||"/"==g||"\\"==g||"?"==g||"#"==g){f-=p.length,p="",l="host";continue}p+=g}break;case"file host":if(null==g||"/"==g||"\\"==g||"?"==g||"#"==g){2!=p.length||!h.test(p[0])||":"!=p[1]&&"|"!=p[1]?(0!=p.length&&(this.o=t.call(this,p),p=""),l="relative path start"):l="relative path";continue}"\t"==g||"\n"==g||"\r"==g?s("Invalid whitespace in file host."):p+=g;break;case"host":case"hostname":if(":"!=g||m){if(null==g||"/"==g||"\\"==g||"?"==g||"#"==g){if(this.o=t.call(this,p),p="",l="relative path start",i)break e;continue}"\t"!=g&&"\n"!=g&&"\r"!=g?("["==g?m=!0:"]"==g&&(m=!1),p+=g):s("Invalid code point in host/hostname: "+g)}else if(this.o=t.call(this,p),p="",l="port","hostname"==i)break e;break;case"port":if(/[0-9]/.test(g))p+=g;else{if(null==g||"/"==g||"\\"==g||"?"==g||"#"==g||i){if(""!=p&&((p=parseInt(p,10))!=u[this.l]&&(this.v=p+""),p=""),i)break e;l="relative path start";continue}"\t"==g||"\n"==g||"\r"==g?s("Invalid code point in port: "+g):(a.call(this),this.m=!0)}break;case"relative path start":if("\\"==g&&s("'\\' not allowed in path."),l="relative path","/"!=g&&"\\"!=g)continue;break;case"relative path":null!=g&&"/"!=g&&"\\"!=g&&(i||"?"!=g&&"#"!=g)?"\t"!=g&&"\n"!=g&&"\r"!=g&&(p+=n(g)):("\\"==g&&s("\\ not allowed in relative path."),(_=c[p.toLowerCase()])&&(p=_),".."==p?(this.s.pop(),"/"!=g&&"\\"!=g&&this.s.push("")):"."==p&&"/"!=g&&"\\"!=g?this.s.push(""):"."!=p&&("file"==this.l&&0==this.s.length&&2==p.length&&h.test(p[0])&&"|"==p[1]&&(p=p[0]+":"),this.s.push(p)),p="","?"==g?(this.A="?",l="query"):"#"==g&&(this.C="#",l="fragment"));break;case"query":i||"#"!=g?null!=g&&"\t"!=g&&"\n"!=g&&"\r"!=g&&(this.A+=r(g)):(this.C="#",l="fragment");break;case"fragment":null!=g&&"\t"!=g&&"\n"!=g&&"\r"!=g&&(this.C+=g)}f++}}function a(){this.B=this.ya=this.l="",this.j=null,this.v=this.o="",this.s=[],this.C=this.A="",this.H=this.m=!1}function o(e,t){void 0===t||t instanceof o||(t=new o(String(t))),this.g=e,a.call(this),i.call(this,this.g.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,""),null,t)}var s=!1;try{var l=new URL("b","http://a");l.pathname="c%20d",s="http://a/c%20d"===l.href}catch(e){}if(!s){var u=Object.create(null);u.ftp=21,u.file=0,u.gopher=70,u.http=80,u.https=443,u.ws=80,u.wss=443;var c=Object.create(null);c["%2e"]=".",c[".%2e"]="..",c["%2e."]="..",c["%2e%2e"]="..";var h=/[a-zA-Z]/,d=/[a-zA-Z0-9+\-.]/;o.prototype={toString:function(){return this.href},get href(){if(this.m)return this.g;var e="";return""==this.B&&null==this.j||(e=this.B+(null!=this.j?":"+this.j:"")+"@"),this.protocol+(this.H?"//"+e+this.host:"")+this.pathname+this.A+this.C},set href(e){a.call(this),i.call(this,e)},get protocol(){return this.l+":"},set protocol(e){this.m||i.call(this,e+":","scheme start")},get host(){return this.m?"":this.v?this.o+":"+this.v:this.o},set host(e){!this.m&&this.H&&i.call(this,e,"host")},get hostname(){return this.o},set hostname(e){!this.m&&this.H&&i.call(this,e,"hostname")},get port(){return this.v},set port(e){!this.m&&this.H&&i.call(this,e,"port")},get pathname(){return this.m?"":this.H?"/"+this.s.join("/"):this.ya},set pathname(e){!this.m&&this.H&&(this.s=[],i.call(this,e,"relative path start"))},get search(){return this.m||!this.A||"?"==this.A?"":this.A},set search(e){!this.m&&this.H&&(this.A="?","?"==e[0]&&(e=e.slice(1)),i.call(this,e,"query"))},get hash(){return this.m||!this.C||"#"==this.C?"":this.C},set hash(e){this.m||(e?(this.C="#","#"==e[0]&&(e=e.slice(1)),i.call(this,e,"fragment")):this.C="")},get origin(){var e;if(this.m||!this.l)return"";switch(this.l){case"data":case"file":case"javascript":case"mailto":return"null"}return(e=this.host)?this.l+"://"+e:""}};var f=e.URL;f&&(o.createObjectURL=function(e){return f.createObjectURL.apply(f,arguments)},o.revokeObjectURL=function(e){f.revokeObjectURL(e)}),e.URL=o}}(window);var Fs=window.customElements,Bs=!1,zs=null;function js(){window.HTMLTemplateElement.bootstrap&&window.HTMLTemplateElement.bootstrap(window.document),zs&&zs(),Bs=!0,window.WebComponents.ready=!0,document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))}Fs.polyfillWrapFlushCallback&&Fs.polyfillWrapFlushCallback((function(e){zs=e,Bs&&e()})),"complete"!==document.readyState?(window.addEventListener("load",js),window.addEventListener("DOMContentLoaded",(function(){window.removeEventListener("load",js),js()}))):js()}).call(this)},5086:(e,t,n)=>{var r=n(2228).document;e.exports=r&&r.documentElement},5161:(e,t,n)=>{var r=n(2228),i=n(1212),a=n(6271),o=n(9337),s=n(7102),l="prototype",u=function(e,t,n){var c,h,d,f,p=e&u.F,v=e&u.G,m=e&u.S,y=e&u.P,g=e&u.B,_=v?r:m?r[t]||(r[t]={}):(r[t]||{})[l],b=v?i:i[t]||(i[t]={}),x=b[l]||(b[l]={});for(c in v&&(n=t),n)d=((h=!p&&_&&void 0!==_[c])?_:n)[c],f=g&&h?s(d,r):y&&"function"==typeof d?s(Function.call,d):d,_&&o(_,c,d,e&u.U),b[c]!=d&&a(b,c,f),y&&x[c]!=d&&(x[c]=d)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},5200:(e,t,n)=>{"use strict";n(1794)("small",(function(e){return function(){return e(this,"small","","")}}))},5289:e=>{e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},5323:(e,t,n)=>{"use strict";var r=n(4397).f,i=n(3821),a=n(2119),o=n(7102),s=n(2490),l=n(940),u=n(7905),c=n(4184),h=n(8544),d=n(9417),f=n(4286).fastKey,p=n(2454),v=d?"_s":"size",m=function(e,t){var n,r=f(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,u){var c=e((function(e,r){s(e,c,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[v]=0,null!=r&&l(r,n,e[u],e)}));return a(c.prototype,{clear:function(){for(var e=p(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var n=p(this,t),r=m(n,e);if(r){var i=r.n,a=r.p;delete n._i[r.i],r.r=!0,a&&(a.n=i),i&&(i.p=a),n._f==r&&(n._f=i),n._l==r&&(n._l=a),n[v]--}return!!r},forEach:function(e){p(this,t);for(var n,r=o(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(p(this,t),e)}}),d&&r(c.prototype,"size",{get:function(){return p(this,t)[v]}}),c},def:function(e,t,n){var r,i,a=m(e,t);return a?a.v=n:(e._l=a={i:i=f(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=a),r&&(r.n=a),e[v]++,"F"!==i&&(e._i[i]=a)),e},getEntry:m,setStrong:function(e,t,n){u(e,t,(function(e,n){this._t=p(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?c(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=void 0,c(1))}),n?"entries":"values",!n,!0),h(t)}}},5387:e=>{e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},5427:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.exports=function(e){return"object"===t(e)?null!==e:"function"==typeof e}},5440:(e,t,n)=>{var r=n(3134)("wks"),i=n(4317),a=n(2228).Symbol,o="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))}).store=r},5462:(e,t,n)=>{var r=n(4397).f,i=n(8319),a=n(5440)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},5464:(e,t,n)=>{var r=n(5161);r(r.P,"String",{repeat:n(6424)})},5560:(e,t,n)=>{var r=n(7462);e.exports=function(e){return Object(r(e))}},5568:(e,t,n)=>{var r=n(7947);n(7265)("isFrozen",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},5572:(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var r=window.ShadyDOM&&window.ShadyDOM.noPatch&&window.ShadyDOM.wrap?window.ShadyDOM.wrap:window.ShadyDOM?function(e){return ShadyDOM.patch(e)}:function(e){return e}},5585:(e,t,n)=>{n(7495)("Uint16",2,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},5596:(e,t,n)=>{var r=n(5935),i=n(5161),a=n(6094);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(a(e),t)}})},5602:(e,t,n)=>{var r=n(4171),i=n(5440)("toStringTag"),a="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?r(t):"Object"==(o=r(t))&&"function"==typeof t.callee?"Arguments":o}},5619:(e,t,n)=>{var r=n(7029),i=n(7598),a=n(4195);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var o,s=n(e),l=a.f,u=0;s.length>u;)l.call(e,o=s[u++])&&t.push(o);return t}},5652:(e,t,n)=>{"use strict";var r=n(2119),i=n(4286).getWeak,a=n(6094),o=n(7947),s=n(2490),l=n(940),u=n(9705),c=n(8319),h=n(2454),d=u(5),f=u(6),p=0,v=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},y=function(e,t){return d(e.a,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var n=y(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=f(this.a,(function(t){return t[0]===e}));return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,a){var u=e((function(e,r){s(e,u,t,"_i"),e._t=t,e._i=p++,e._l=void 0,null!=r&&l(r,n,e[a],e)}));return r(u.prototype,{delete:function(e){if(!o(e))return!1;var n=i(e);return!0===n?v(h(this,t)).delete(e):n&&c(n,this._i)&&delete n[this._i]},has:function(e){if(!o(e))return!1;var n=i(e);return!0===n?v(h(this,t)).has(e):n&&c(n,this._i)}}),u},def:function(e,t,n){var r=i(a(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},5676:(e,t,n)=>{"use strict";var r=n(7947),i=n(2381),a=n(5440)("hasInstance"),o=Function.prototype;a in o||n(4397).f(o,a,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},5678:(e,t,n)=>{var r=n(6094);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},5699:(e,t,n)=>{n(8544)("Array")},5719:(e,t,n)=>{n(7495)("Uint32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},5781:(e,t,n)=>{var r=n(5161);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},5787:(e,t,n)=>{var r=n(2228).parseFloat,i=n(2671).trim;e.exports=1/r(n(8129)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},5799:(e,t,n)=>{var r=n(9013),i=n(3854);e.exports=n(8529)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},5870:(e,t,n)=>{var r=n(5161);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},5871:(e,t,n)=>{var r=n(5161);r(r.S,"Number",{isNaN:function(e){return e!=e}})},5881:e=>{var t=Math.expm1;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!=t(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:t},5935:(e,t,n)=>{var r=n(4195),i=n(9142),a=n(4547),o=n(4142),s=n(8319),l=n(2018),u=Object.getOwnPropertyDescriptor;t.f=n(9417)?u:function(e,t){if(e=a(e),t=o(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},5967:(e,t,n)=>{"use strict";var r=n(6094),i=n(5289),a=n(7565);n(9666)("search",1,(function(e,t,n,o){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=o(n,e,this);if(t.done)return t.value;var s=r(e),l=String(this),u=s.lastIndex;i(u,0)||(s.lastIndex=0);var c=a(s,l);return i(s.lastIndex,u)||(s.lastIndex=u),null===c?-1:c.index}]}))},5971:(e,t,n)=>{"use strict";n.d(t,{Pu:()=>a,qy:()=>i.q});var r=n(3438),i=n(4152),a=(0,r.q2)(HTMLElement)},5979:(e,t,n)=>{"use strict";var r=n(609);function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},6060:(e,t,n)=>{var r=n(5161);r(r.S,"Number",{isInteger:n(8252)})},6062:(e,t,n)=>{"use strict";n(1794)("italics",(function(e){return function(){return e(this,"i","","")}}))},6094:(e,t,n)=>{var r=n(7947);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},6115:(e,t,n)=>{n(9336),e.exports=n(1212).Object.values},6205:(e,t,n)=>{var r=n(5161),i=n(4547),a=n(3991);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=a(t.length),r=arguments.length,o=[],s=0;n>s;)o.push(String(t[s++])),s<r&&o.push(String(arguments[s]));return o.join("")}})},6227:(e,t,n)=>{"use strict";var r=n(5161),i=n(3991),a=n(7108),o="startsWith",s=""[o];r(r.P+r.F*n(4709)(o),"String",{startsWith:function(e){var t=a(this,e,o),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return s?s.call(t,r,n):t.slice(n,n+r.length)===r}})},6237:(e,t,n)=>{"use strict";var r=n(6094),i=n(4142),a="number";e.exports=function(e){if("string"!==e&&e!==a&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),e!=a)}},6271:(e,t,n)=>{var r=n(4397),i=n(9142);e.exports=n(9417)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},6288:(e,t,n)=>{var r=n(5161);r(r.S,"Math",{sign:n(3367)})},6299:(e,t,n)=>{var r=n(5161),i=n(5787);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},6330:(e,t,n)=>{var r=n(5161);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},6357:(e,t,n)=>{var r=n(7947),i=n(4171),a=n(5440)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},6424:(e,t,n)=>{"use strict";var r=n(2497),i=n(7462);e.exports=function(e){var t=String(i(this)),n="",a=r(e);if(a<0||a==1/0)throw RangeError("Count can't be negative");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(n+=t);return n}},6449:(e,t,n)=>{"use strict";var r=n(5161),i=n(9705)(3);r(r.P+r.F*!n(938)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},6454:(e,t,n)=>{var r=n(3905);r(r.G,{global:n(4300)})},6458:(e,t,n)=>{var r=n(5161);r(r.G+r.W+r.F*!n(7064).ABV,{DataView:n(2330).DataView})},6462:(e,t,n)=>{"use strict";var r=n(1978);n(5161)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},6502:(e,t,n)=>{var r=n(2406);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},6552:(e,t,n)=>{"use strict";n.d(t,{I:()=>o,e:()=>s}),n(9032);var r={},i=/-[a-z]/g,a=/([A-Z])/g;function o(e){return r[e]||(r[e]=e.indexOf("-")<0?e:e.replace(i,(function(e){return e[1].toUpperCase()})))}function s(e){return r[e]||(r[e]=e.replace(a,"-$1").toLowerCase())}},6586:(e,t,n)=>{"use strict";var r=n(5161),i=n(9705)(5),a="find",o=!0;a in[]&&Array(1)[a]((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(2846)(a)},6683:(e,t,n)=>{"use strict";n(1794)("link",(function(e){return function(t){return e(this,"a","href",t)}}))},6705:(e,t,n)=>{"use strict";n.d(t,{$:()=>m}),n(9032);var r=n(1606),i=n(7925);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(u())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&c(i,n.prototype),i}(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},l(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}var d={},f={};function p(e,t){d[e]=f[e.toLowerCase()]=t}function v(e){return d[e]||f[e.toLowerCase()]}var m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=h(t),function(e,t){if(t&&("object"==a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],h(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),n=t,l=[{key:"observedAttributes",get:function(){return["id"]}},{key:"import",value:function(e,t){if(e){var n=v(e);return n&&t?n.querySelector(t):n}return null}}],(s=[{key:"attributeChangedCallback",value:function(e,t,n,r){t!==n&&this.register()}},{key:"assetpath",get:function(){if(!this.__assetpath){var e=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument,t=(0,r.O2)(this.getAttribute("assetpath")||"",e.baseURI);this.__assetpath=(0,r.rG)(t)}return this.__assetpath}},{key:"register",value:function(e){if(e=e||this.id){if(i.yu&&void 0!==v(e))throw p(e,null),new Error("strictTemplatePolicy: dom-module ".concat(e," re-registered"));this.id=e,p(e,this),(t=this).querySelector("style")&&console.warn("dom-module %s has style outside template",t.id)}var t}}])&&o(n.prototype,s),l&&o(n,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,s,l}(l(HTMLElement));m.prototype.modules=d,customElements.define("dom-module",m)},6707:(e,t,n)=>{n(1822),e.exports=n(1212).String.padStart},6718:(e,t,n)=>{"use strict";var r=n(9378)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},6731:(e,t,n)=>{"use strict";var r=n(5161),i=n(6094),a=function(e){this._t=i(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n(9002)(a,"Object",(function(){var e,t=this,n=t._k;do{if(t._i>=n.length)return{value:void 0,done:!0}}while(!((e=n[t._i++])in t._t));return{value:e,done:!1}})),r(r.S,"Reflect",{enumerate:function(e){return new a(e)}})},6795:(e,t,n)=>{"use strict";var r=n(5161),i=n(5086),a=n(4171),o=n(1167),s=n(3991),l=[].slice;r(r.P+r.F*n(110)((function(){i&&l.call(i)})),"Array",{slice:function(e,t){var n=s(this.length),r=a(this);if(t=void 0===t?n:t,"Array"==r)return l.call(this,e,t);for(var i=o(e,n),u=o(t,n),c=s(u-i),h=new Array(c),d=0;d<c;d++)h[d]="String"==r?this.charAt(i+d):this[i+d];return h}})},6803:(e,t,n)=>{var r=n(5161),i=n(6094),a=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!a||a(e)}})},6816:(e,t,n)=>{var r=n(6094),i=n(609),a=n(5440)("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||null==(n=r(o)[a])?t:i(n)}},6939:(e,t,n)=>{n(7495)("Float32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},6967:(e,t,n)=>{"use strict";var r=n(5161),i=n(9378)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},7029:(e,t,n)=>{var r=n(1343),i=n(4638);e.exports=Object.keys||function(e){return r(e,i)}},7064:(e,t,n)=>{for(var r,i=n(2228),a=n(6271),o=n(4317),s=o("typed_array"),l=o("view"),u=!(!i.ArrayBuffer||!i.DataView),c=u,h=0,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");h<9;)(r=i[d[h++]])?(a(r.prototype,s,!0),a(r.prototype,l,!0)):c=!1;e.exports={ABV:u,CONSTR:c,TYPED:s,VIEW:l}},7098:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=function(e){"use strict";var t,n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),s=new O(r||[]);return a(o,"_invoke",{value:C(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=h;var f="suspendedStart",p="suspendedYield",v="executing",m="completed",y={};function g(){}function _(){}function b(){}var x={};c(x,s,(function(){return this}));var S=Object.getPrototypeOf,w=S&&S(S(R([])));w&&w!==n&&i.call(w,s)&&(x=w);var E=b.prototype=g.prototype=Object.create(x);function M(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(a,o,s,l){var u=d(e[a],e,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"===r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(h).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,l)}))}l(u.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function C(e,t,n){var r=f;return function(i,a){if(r===v)throw new Error("Generator is already running");if(r===m){if("throw"===i)throw a;return I()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=A(o,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=v;var l=d(e,t,n);if("normal"===l.type){if(r=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=m,n.method="throw",n.arg=l.arg)}}}function A(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=d(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function R(e){if(e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:I}}function I(){return{value:t,done:!0}}return _.prototype=b,a(E,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:_,configurable:!0}),_.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},M(T.prototype),c(T.prototype,l,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new T(h(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},M(E),c(E,u,"Generator"),c(E,s,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=R,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}("object"===r(e=n.nmd(e))?e.exports:{});try{regeneratorRuntime=i}catch(e){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}},7102:(e,t,n)=>{var r=n(609);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},7108:(e,t,n)=>{var r=n(6357),i=n(7462);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},7120:(e,t,n)=>{n(7495)("Uint8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},7170:(e,t,n)=>{n(6454),e.exports=n(8276).global},7205:(e,t,n)=>{var r=n(5161),i=Math.imul;r(r.S+r.F*n(110)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(e,t){var n=65535,r=+e,i=+t,a=n&r,o=n&i;return 0|a*o+((n&r>>>16)*o+a*(n&i>>>16)<<16>>>0)}})},7206:(e,t,n)=>{var r=n(5427);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},7265:(e,t,n)=>{var r=n(5161),i=n(1212),a=n(110);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],o={};o[e]=t(n),r(r.S+r.F*a((function(){n(1)})),"Object",o)}},7295:(e,t,n)=>{var r=n(4171);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},7382:(e,t,n)=>{var r=n(5427);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},7385:(e,t,n)=>{n(1674),n(9787),n(272),e.exports=n(1212)},7462:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},7495:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}if(n(9417)){var i=n(2864),a=n(2228),o=n(110),s=n(5161),l=n(7064),u=n(2330),c=n(7102),h=n(2490),d=n(9142),f=n(6271),p=n(2119),v=n(2497),m=n(3991),y=n(1399),g=n(1167),_=n(4142),b=n(8319),x=n(5602),S=n(7947),w=n(5560),E=n(2730),M=n(3821),T=n(2381),C=n(7753).f,A=n(8424),P=n(4317),k=n(5440),O=n(9705),R=n(3814),I=n(6816),N=n(4683),L=n(8360),D=n(8113),U=n(8544),F=n(570),B=n(2204),z=n(4397),j=n(5935),H=z.f,V=j.f,G=a.RangeError,W=a.TypeError,X=a.Uint8Array,q="ArrayBuffer",Y="Shared"+q,J="BYTES_PER_ELEMENT",Z="prototype",K=Array[Z],$=u.ArrayBuffer,Q=u.DataView,ee=O(0),te=O(2),ne=O(3),re=O(4),ie=O(5),ae=O(6),oe=R(!0),se=R(!1),le=N.values,ue=N.keys,ce=N.entries,he=K.lastIndexOf,de=K.reduce,fe=K.reduceRight,pe=K.join,ve=K.sort,me=K.slice,ye=K.toString,ge=K.toLocaleString,_e=k("iterator"),be=k("toStringTag"),xe=P("typed_constructor"),Se=P("def_constructor"),we=l.CONSTR,Ee=l.TYPED,Me=l.VIEW,Te="Wrong length!",Ce=O(1,(function(e,t){return Re(I(e,e[Se]),t)})),Ae=o((function(){return 1===new X(new Uint16Array([1]).buffer)[0]})),Pe=!!X&&!!X[Z].set&&o((function(){new X(1).set({})})),ke=function(e,t){var n=v(e);if(n<0||n%t)throw G("Wrong offset!");return n},Oe=function(e){if(S(e)&&Ee in e)return e;throw W(e+" is not a typed array!")},Re=function(e,t){if(!S(e)||!(xe in e))throw W("It is not a typed array constructor!");return new e(t)},Ie=function(e,t){return Ne(I(e,e[Se]),t)},Ne=function(e,t){for(var n=0,r=t.length,i=Re(e,r);r>n;)i[n]=t[n++];return i},Le=function(e,t,n){H(e,t,{get:function(){return this._d[n]}})},De=function(e){var t,n,r,i,a,o,s=w(e),l=arguments.length,u=l>1?arguments[1]:void 0,h=void 0!==u,d=A(s);if(null!=d&&!E(d)){for(o=d.call(s),r=[],t=0;!(a=o.next()).done;t++)r.push(a.value);s=r}for(h&&l>2&&(u=c(u,arguments[2],2)),t=0,n=m(s.length),i=Re(this,n);n>t;t++)i[t]=h?u(s[t],t):s[t];return i},Ue=function(){for(var e=0,t=arguments.length,n=Re(this,t);t>e;)n[e]=arguments[e++];return n},Fe=!!X&&o((function(){ge.call(new X(1))})),Be=function(){return ge.apply(Fe?me.call(Oe(this)):Oe(this),arguments)},ze={copyWithin:function(e,t){return B.call(Oe(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return re(Oe(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return F.apply(Oe(this),arguments)},filter:function(e){return Ie(this,te(Oe(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ie(Oe(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ae(Oe(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){ee(Oe(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return se(Oe(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return oe(Oe(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return pe.apply(Oe(this),arguments)},lastIndexOf:function(e){return he.apply(Oe(this),arguments)},map:function(e){return Ce(Oe(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return de.apply(Oe(this),arguments)},reduceRight:function(e){return fe.apply(Oe(this),arguments)},reverse:function(){for(var e,t=this,n=Oe(t).length,r=Math.floor(n/2),i=0;i<r;)e=t[i],t[i++]=t[--n],t[n]=e;return t},some:function(e){return ne(Oe(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return ve.call(Oe(this),e)},subarray:function(e,t){var n=Oe(this),r=n.length,i=g(e,r);return new(I(n,n[Se]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,m((void 0===t?r:g(t,r))-i))}},je=function(e,t){return Ie(this,me.call(Oe(this),e,t))},He=function(e){Oe(this);var t=ke(arguments[1],1),n=this.length,r=w(e),i=m(r.length),a=0;if(i+t>n)throw G(Te);for(;a<i;)this[t+a]=r[a++]},Ve={entries:function(){return ce.call(Oe(this))},keys:function(){return ue.call(Oe(this))},values:function(){return le.call(Oe(this))}},Ge=function(e,t){return S(e)&&e[Ee]&&"symbol"!=r(t)&&t in e&&String(+t)==String(t)},We=function(e,t){return Ge(e,t=_(t,!0))?d(2,e[t]):V(e,t)},Xe=function(e,t,n){return!(Ge(e,t=_(t,!0))&&S(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?H(e,t,n):(e[t]=n.value,e)};we||(j.f=We,z.f=Xe),s(s.S+s.F*!we,"Object",{getOwnPropertyDescriptor:We,defineProperty:Xe}),o((function(){ye.call({})}))&&(ye=ge=function(){return pe.call(this)});var qe=p({},ze);p(qe,Ve),f(qe,_e,Ve.values),p(qe,{slice:je,set:He,constructor:function(){},toString:ye,toLocaleString:Be}),Le(qe,"buffer","b"),Le(qe,"byteOffset","o"),Le(qe,"byteLength","l"),Le(qe,"length","e"),H(qe,be,{get:function(){return this[Ee]}}),e.exports=function(e,t,n,r){var u=e+((r=!!r)?"Clamped":"")+"Array",c="get"+e,d="set"+e,p=a[u],v=p||{},g=p&&T(p),_=!p||!l.ABV,b={},w=p&&p[Z],E=function(e,n){H(e,n,{get:function(){return function(e,n){var r=e._d;return r.v[c](n*t+r.o,Ae)}(this,n)},set:function(e){return function(e,n,i){var a=e._d;r&&(i=(i=Math.round(i))<0?0:i>255?255:255&i),a.v[d](n*t+a.o,i,Ae)}(this,n,e)},enumerable:!0})};_?(p=n((function(e,n,r,i){h(e,p,u,"_d");var a,o,s,l,c=0,d=0;if(S(n)){if(!(n instanceof $||(l=x(n))==q||l==Y))return Ee in n?Ne(p,n):De.call(p,n);a=n,d=ke(r,t);var v=n.byteLength;if(void 0===i){if(v%t)throw G(Te);if((o=v-d)<0)throw G(Te)}else if((o=m(i)*t)+d>v)throw G(Te);s=o/t}else s=y(n),a=new $(o=s*t);for(f(e,"_d",{b:a,o:d,l:o,e:s,v:new Q(a)});c<s;)E(e,c++)})),w=p[Z]=M(qe),f(w,"constructor",p)):o((function(){p(1)}))&&o((function(){new p(-1)}))&&D((function(e){new p,new p(null),new p(1.5),new p(e)}),!0)||(p=n((function(e,n,r,i){var a;return h(e,p,u),S(n)?n instanceof $||(a=x(n))==q||a==Y?void 0!==i?new v(n,ke(r,t),i):void 0!==r?new v(n,ke(r,t)):new v(n):Ee in n?Ne(p,n):De.call(p,n):new v(y(n))})),ee(g!==Function.prototype?C(v).concat(C(g)):C(v),(function(e){e in p||f(p,e,v[e])})),p[Z]=w,i||(w.constructor=p));var A=w[_e],P=!!A&&("values"==A.name||null==A.name),k=Ve.values;f(p,xe,!0),f(w,Ee,u),f(w,Me,!0),f(w,Se,p),(r?new p(1)[be]==u:be in w)||H(w,be,{get:function(){return u}}),b[u]=p,s(s.G+s.W+s.F*(p!=v),b),s(s.S,u,{BYTES_PER_ELEMENT:t}),s(s.S+s.F*o((function(){v.of.call(p,1)})),u,{from:De,of:Ue}),J in w||f(w,J,t),s(s.P,u,ze),U(u),s(s.P+s.F*Pe,u,{set:He}),s(s.P+s.F*!P,u,Ve),i||w.toString==ye||(w.toString=ye),s(s.P+s.F*o((function(){new p(1).slice()})),u,{slice:je}),s(s.P+s.F*(o((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!o((function(){w.toLocaleString.call([1,2])}))),u,{toLocaleString:Be}),L[u]=P?A:k,i||P||f(w,_e,k)}}else e.exports=function(){}},7542:(e,t,n)=>{"use strict";var r=n(9378)(!0);n(7905)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},7550:(e,t,n)=>{"use strict";n.d(t,{H:()=>v,j:()=>m});var r=n(9259);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=function(e){if("object"!=f(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(t)?t:t+""}function l(e,t,n){return t=c(t),function(e,t){if(t&&("object"==f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function p(e,t,n,r,i){var a;i&&(a="object"===f(n)&&null!==n)&&(r=e.__dataTemp[t]);var o=r!==n&&(r==r||n==n);return a&&o&&(e.__dataTemp[t]=n),o}var v=(0,r.y)((function(e){var t=function(e){function t(){return i(this,t),l(this,t,arguments)}return h(t,e),o(t,[{key:"_shouldPropertyChange",value:function(e,t,n){return p(this,e,t,n,!0)}}])}(e);return t})),m=(0,r.y)((function(e){var t=function(e){function t(){return i(this,t),l(this,t,arguments)}return h(t,e),o(t,[{key:"_shouldPropertyChange",value:function(e,t,n){return p(this,e,t,n,this.mutableData)}}],[{key:"properties",get:function(){return{mutableData:Boolean}}}])}(e);return t}));v._mutablePropertyChange=p},7555:(e,t,n)=>{"use strict";n.d(t,{e:()=>v}),n(9032);var r=n(9259),i=n(8834),a=n(5572);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function l(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function c(e,t,n,r){var i=h(d(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var p=i._3,v=(0,r.y)((function(e){var t=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=d(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}(this,t)).__dataEnabled=!1,e.__dataReady=!1,e.__dataInvalid=!1,e.__data={},e.__dataPending=null,e.__dataOld=null,e.__dataInstanceProps=null,e.__dataCounter=0,e.__serializing=!1,e._initializeProperties(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,r=[{key:"_createPropertyAccessor",value:function(e,t){this._addPropertyToAttributeMap(e),this.hasOwnProperty(JSCompiler_renameProperty("__dataHasAccessor",this))||(this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)),this.__dataHasAccessor[e]||(this.__dataHasAccessor[e]=!0,this._definePropertyAccessor(e,t))}},{key:"_addPropertyToAttributeMap",value:function(e){this.hasOwnProperty(JSCompiler_renameProperty("__dataAttributes",this))||(this.__dataAttributes=Object.assign({},this.__dataAttributes));var t=this.__dataAttributes[e];return t||(t=this.constructor.attributeNameForProperty(e),this.__dataAttributes[t]=e),t}},{key:"_definePropertyAccessor",value:function(e,t){Object.defineProperty(this,e,{get:function(){return this.__data[e]},set:t?function(){}:function(t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}})}},{key:"ready",value:function(){this.__dataReady=!0,this._flushProperties()}},{key:"_initializeProperties",value:function(){for(var e in this.__dataHasAccessor)this.hasOwnProperty(e)&&(this.__dataInstanceProps=this.__dataInstanceProps||{},this.__dataInstanceProps[e]=this[e],delete this[e])}},{key:"_initializeInstanceProperties",value:function(e){Object.assign(this,e)}},{key:"_setProperty",value:function(e,t){this._setPendingProperty(e,t)&&this._invalidateProperties()}},{key:"_getProperty",value:function(e){return this.__data[e]}},{key:"_setPendingProperty",value:function(e,t,n){var r=this.__data[e],i=this._shouldPropertyChange(e,t,r);return i&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),this.__dataOld&&!(e in this.__dataOld)&&(this.__dataOld[e]=r),this.__data[e]=t,this.__dataPending[e]=t),i}},{key:"_isPropertyPending",value:function(e){return!(!this.__dataPending||!this.__dataPending.hasOwnProperty(e))}},{key:"_invalidateProperties",value:function(){var e=this;!this.__dataInvalid&&this.__dataReady&&(this.__dataInvalid=!0,p.run((function(){e.__dataInvalid&&(e.__dataInvalid=!1,e._flushProperties())})))}},{key:"_enableProperties",value:function(){this.__dataEnabled||(this.__dataEnabled=!0,this.__dataInstanceProps&&(this._initializeInstanceProperties(this.__dataInstanceProps),this.__dataInstanceProps=null),this.ready())}},{key:"_flushProperties",value:function(){this.__dataCounter++;var e=this.__data,t=this.__dataPending,n=this.__dataOld;this._shouldPropertiesChange(e,t,n)&&(this.__dataPending=null,this.__dataOld=null,this._propertiesChanged(e,t,n)),this.__dataCounter--}},{key:"_shouldPropertiesChange",value:function(e,t,n){return Boolean(t)}},{key:"_propertiesChanged",value:function(e,t,n){}},{key:"_shouldPropertyChange",value:function(e,t,n){return n!==t&&(n==n||t==t)}},{key:"attributeChangedCallback",value:function(e,n,r,i){n!==r&&this._attributeToProperty(e,r),c(t,"attributeChangedCallback",this,1)&&c(t,"attributeChangedCallback",this,3)([e,n,r,i])}},{key:"_attributeToProperty",value:function(e,t,n){if(!this.__serializing){var r=this.__dataAttributes,i=r&&r[e]||e;this[i]=this._deserializeValue(t,n||this.constructor.typeForProperty(i))}}},{key:"_propertyToAttribute",value:function(e,t,n){this.__serializing=!0,n=arguments.length<3?this[e]:n,this._valueToNodeAttribute(this,n,t||this.constructor.attributeNameForProperty(e)),this.__serializing=!1}},{key:"_valueToNodeAttribute",value:function(e,t,n){var r=this._serializeValue(t);"class"!==n&&"name"!==n&&"slot"!==n||(e=(0,a.L)(e)),void 0===r?e.removeAttribute(n):e.setAttribute(n,""===r&&window.trustedTypes?window.trustedTypes.emptyScript:r)}},{key:"_serializeValue",value:function(e){return"boolean"===o(e)?e?"":void 0:null!=e?e.toString():void 0}},{key:"_deserializeValue",value:function(e,t){switch(t){case Boolean:return null!==e;case Number:return Number(e);default:return e}}}],i=[{key:"createProperties",value:function(e){var t=this.prototype;for(var n in e)n in t||t._createPropertyAccessor(n)}},{key:"attributeNameForProperty",value:function(e){return e.toLowerCase()}},{key:"typeForProperty",value:function(e){}}],r&&s(n.prototype,r),i&&s(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(e);return t}))},7565:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(5602),a=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!==r(o))throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==i(e))throw new TypeError("RegExp#exec called on incompatible receiver");return a.call(e,t)}},7598:(e,t)=>{t.f=Object.getOwnPropertySymbols},7681:(e,t,n)=>{var r=n(5161);r(r.S,"Array",{isArray:n(2395)})},7736:(e,t,n)=>{"use strict";n(2671)("trimLeft",(function(e){return function(){return e(this,1)}}),"trimStart")},7746:(e,t,n)=>{var r=n(5161);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},7753:(e,t,n)=>{var r=n(1343),i=n(4638).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},7787:(e,t,n)=>{"use strict";var r=n(6357),i=n(6094),a=n(6816),o=n(6718),s=n(3991),l=n(7565),u=n(1978),c=n(110),h=Math.min,d=[].push,f="split",p="length",v="lastIndex",m=4294967295,y=!c((function(){RegExp(m,"y")}));n(9666)("split",2,(function(e,t,n,c){var g;return g="c"=="abbc"[f](/(b)*/)[1]||4!="test"[f](/(?:)/,-1)[p]||2!="ab"[f](/(?:ab)*/)[p]||4!="."[f](/(.?)(.?)/)[p]||"."[f](/()()/)[p]>1||""[f](/.?/)[p]?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(i,e,t);for(var a,o,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,f=void 0===t?m:t>>>0,y=new RegExp(e.source,c+"g");(a=u.call(y,i))&&!((o=y[v])>h&&(l.push(i.slice(h,a.index)),a[p]>1&&a.index<i[p]&&d.apply(l,a.slice(1)),s=a[0][p],h=o,l[p]>=f));)y[v]===a.index&&y[v]++;return h===i[p]?!s&&y.test("")||l.push(""):l.push(i.slice(h)),l[p]>f?l.slice(0,f):l}:"0"[f](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var i=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,i,r):g.call(String(i),n,r)},function(e,t){var r=c(g,e,this,t,g!==n);if(r.done)return r.value;var u=i(e),d=String(this),f=a(u,RegExp),p=u.unicode,v=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(y?"y":"g"),_=new f(y?u:"^(?:"+u.source+")",v),b=void 0===t?m:t>>>0;if(0===b)return[];if(0===d.length)return null===l(_,d)?[d]:[];for(var x=0,S=0,w=[];S<d.length;){_.lastIndex=y?S:0;var E,M=l(_,y?d:d.slice(S));if(null===M||(E=h(s(_.lastIndex+(y?0:S)),d.length))===x)S=o(d,S,p);else{if(w.push(d.slice(x,S)),w.length===b)return w;for(var T=1;T<=M.length-1;T++)if(w.push(M[T]),w.length===b)return w;S=x=E}}return w.push(d.slice(x)),w}]}))},7824:(e,t,n)=>{var r=n(9417),i=n(7029),a=n(4547),o=n(4195).f;e.exports=function(e){return function(t){for(var n,s=a(t),l=i(s),u=l.length,c=0,h=[];u>c;)n=l[c++],r&&!o.call(s,n)||h.push(e?[n,s[n]]:s[n]);return h}}},7833:(e,t,n)=>{"use strict";var r=n(5161),i=n(609),a=n(5560),o=n(110),s=[].sort,l=[1,2,3];r(r.P+r.F*(o((function(){l.sort(void 0)}))||!o((function(){l.sort(null)}))||!n(938)(s)),"Array",{sort:function(e){return void 0===e?s.call(a(this)):s.call(a(this),i(e))}})},7878:(e,t,n)=>{"use strict";var r=n(5161),i=n(3991),a=n(7108),o="endsWith",s=""[o];r(r.P+r.F*n(4709)(o),"String",{endsWith:function(e){var t=a(this,e,o),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),l=void 0===n?r:Math.min(i(n),r),u=String(e);return s?s.call(t,u,l):t.slice(l-u.length,l)===u}})},7903:(e,t,n)=>{e.exports=n(3134)("native-function-to-string",Function.toString)},7905:(e,t,n)=>{"use strict";var r=n(2864),i=n(5161),a=n(9337),o=n(6271),s=n(8360),l=n(9002),u=n(5462),c=n(2381),h=n(5440)("iterator"),d=!([].keys&&"next"in[].keys()),f="keys",p="values",v=function(){return this};e.exports=function(e,t,n,m,y,g,_){l(n,t,m);var b,x,S,w=function(e){if(!d&&e in C)return C[e];switch(e){case f:case p:return function(){return new n(this,e)}}return function(){return new n(this,e)}},E=t+" Iterator",M=y==p,T=!1,C=e.prototype,A=C[h]||C["@@iterator"]||y&&C[y],P=A||w(y),k=y?M?w("entries"):P:void 0,O="Array"==t&&C.entries||A;if(O&&(S=c(O.call(new e)))!==Object.prototype&&S.next&&(u(S,E,!0),r||"function"==typeof S[h]||o(S,h,v)),M&&A&&A.name!==p&&(T=!0,P=function(){return A.call(this)}),r&&!_||!d&&!T&&C[h]||o(C,h,P),s[t]=P,s[E]=v,y)if(b={values:M?P:w(p),keys:g?P:w(f),entries:k},_)for(x in b)x in C||a(C,x,b[x]);else i(i.P+i.F*(d||T),t,b);return b}},7922:(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var r=n(7925),i=!1;function a(){if(r.IP&&!r.sv){if(!i){i=!0;var e=document.createElement("style");e.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(e)}return!0}return!1}},7925:(e,t,n)=>{"use strict";n.d(t,{CE:()=>b,F3:()=>d,Hp:()=>l,IP:()=>h,Kp:()=>f,Xj:()=>v,bK:()=>m,dV:()=>s,ek:()=>c,fF:()=>y,oO:()=>p,qM:()=>a,s:()=>g,sv:()=>i,vK:()=>x,w9:()=>_,wA:()=>o,yu:()=>u}),n(9032);var r=n(1606),i=!window.ShadyDOM||!window.ShadyDOM.inUse,a=(Boolean(!window.ShadyCSS||window.ShadyCSS.nativeCss),window.customElements.polyfillWrapFlushCallback,i&&"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype&&function(){try{var e=new CSSStyleSheet;e.replaceSync("");var t=document.createElement("div");return t.attachShadow({mode:"open"}),t.shadowRoot.adoptedStyleSheets=[e],t.shadowRoot.adoptedStyleSheets[0]===e}catch(e){return!1}}()),o=window.Polymer&&window.Polymer.rootPath||(0,r.rG)(document.baseURI||window.location.href),s=window.Polymer&&window.Polymer.sanitizeDOMValue||void 0,l=window.Polymer&&window.Polymer.setPassiveTouchGestures||!1,u=window.Polymer&&window.Polymer.strictTemplatePolicy||!1,c=window.Polymer&&window.Polymer.allowTemplateFromDomModule||!1,h=window.Polymer&&window.Polymer.legacyOptimizations||!1,d=window.Polymer&&window.Polymer.legacyWarnings||!1,f=window.Polymer&&window.Polymer.syncInitialRender||!1,p=window.Polymer&&window.Polymer.legacyUndefined||!1,v=window.Polymer&&window.Polymer.orderedComputed||!1,m=!0,y=window.Polymer&&window.Polymer.removeNestedTemplates||!1,g=window.Polymer&&window.Polymer.fastDomIf||!1,_=window.Polymer&&window.Polymer.suppressTemplateNotifications||!1,b=window.Polymer&&window.Polymer.legacyNoObservedAttributes||!1,x=window.Polymer&&window.Polymer.useAdoptedStyleSheetsWithBuiltCSS||!1},7947:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.exports=function(e){return"object"===t(e)?null!==e:"function"==typeof e}},7961:(e,t,n)=>{var r=n(5161),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},7964:(e,t,n)=>{var r=n(4171);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},7990:(e,t,n)=>{"use strict";n(1794)("anchor",(function(e){return function(t){return e(this,"a","name",t)}}))},8023:(e,t,n)=>{"use strict";function r(e){return e.indexOf(".")>=0}function i(e){var t=e.indexOf(".");return-1===t?e:e.slice(0,t)}function a(e,t){return 0===e.indexOf(t+".")}function o(e,t){return 0===t.indexOf(e+".")}function s(e,t,n){return t+n.slice(e.length)}function l(e,t){return e===t||a(e,t)||o(e,t)}function u(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)for(var r=e[n].toString().split("."),i=0;i<r.length;i++)t.push(r[i]);return t.join(".")}return e}function c(e){return Array.isArray(e)?u(e).split("."):e.toString().split(".")}function h(e,t,n){for(var r=e,i=c(t),a=0;a<i.length;a++){if(!r)return;r=r[i[a]]}return n&&(n.path=i.join(".")),r}function d(e,t,n){var r=e,i=c(t),a=i[i.length-1];if(i.length>1){for(var o=0;o<i.length-1;o++)if(!(r=r[i[o]]))return;r[a]=n}else r[t]=n;return i.join(".")}n.d(t,{Jt:()=>h,K9:()=>o,QX:()=>a,S8:()=>u,Tl:()=>s,cK:()=>l,hZ:()=>d,uf:()=>r,zr:()=>i}),n(9032)},8051:(e,t,n)=>{"use strict";var r=n(6094),i=n(5560),a=n(3991),o=n(2497),s=n(6718),l=n(7565),u=Math.max,c=Math.min,h=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,f=/\$([$&`']|\d\d?)/g;n(9666)("replace",2,(function(e,t,n,p){return[function(r,i){var a=e(this),o=null==r?void 0:r[t];return void 0!==o?o.call(r,a,i):n.call(String(a),r,i)},function(e,t){var i=p(n,e,this,t);if(i.done)return i.value;var h=r(e),d=String(this),f="function"==typeof t;f||(t=String(t));var m=h.global;if(m){var y=h.unicode;h.lastIndex=0}for(var g=[];;){var _=l(h,d);if(null===_)break;if(g.push(_),!m)break;""===String(_[0])&&(h.lastIndex=s(d,a(h.lastIndex),y))}for(var b,x="",S=0,w=0;w<g.length;w++){_=g[w];for(var E=String(_[0]),M=u(c(o(_.index),d.length),0),T=[],C=1;C<_.length;C++)T.push(void 0===(b=_[C])?b:String(b));var A=_.groups;if(f){var P=[E].concat(T,M,d);void 0!==A&&P.push(A);var k=String(t.apply(void 0,P))}else k=v(E,d,M,T,A,t);M>=S&&(x+=d.slice(S,M)+k,S=M+E.length)}return x+d.slice(S)}];function v(e,t,r,a,o,s){var l=r+e.length,u=a.length,c=f;return void 0!==o&&(o=i(o),c=d),n.call(s,c,(function(n,i){var s;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(l);case"<":s=o[i.slice(1,-1)];break;default:var c=+i;if(0===c)return n;if(c>u){var d=h(c/10);return 0===d?n:d<=u?void 0===a[d-1]?i.charAt(1):a[d-1]+i.charAt(1):n}s=a[c-1]}return void 0===s?"":s}))}}))},8107:(e,t,n)=>{var r=n(5161),i=n(1911);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},8113:(e,t,n)=>{var r=n(5440)("iterator"),i=!1;try{var a=[7][r]();a.return=function(){i=!0},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var a=[7],o=a[r]();o.next=function(){return{done:n=!0}},a[r]=function(){return o},e(a)}catch(e){}return n}},8115:(e,t,n)=>{"use strict";var r=n(5161),i=n(9746),a=n(9940),o=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(a);r(r.P+r.F*o,"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},8129:e=>{e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},8252:(e,t,n)=>{var r=n(7947),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},8265:(e,t,n)=>{"use strict";n(1794)("strike",(function(e){return function(){return e(this,"strike","","")}}))},8276:e=>{var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},8289:(e,t,n)=>{"use strict";var r=n(5161),i=n(1212),a=n(2228),o=n(6816),s=n(1079);r(r.P+r.R,"Promise",{finally:function(e){var t=o(this,i.Promise||a.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then((function(){return n}))}:e,n?function(n){return s(t,e()).then((function(){throw n}))}:e)}})},8292:(e,t,n)=>{n(7495)("Float64",8,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},8319:e=>{var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},8360:e=>{e.exports={}},8363:(e,t,n)=>{"use strict";var r=n(5161),i=n(9841);r(r.P+r.F*!n(938)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},8410:(e,t,n)=>{n(7495)("Int16",2,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},8424:(e,t,n)=>{var r=n(5602),i=n(5440)("iterator"),a=n(8360);e.exports=n(1212).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||a[r(e)]}},8474:(e,t,n)=>{var r=n(5161);r(r.S,"Reflect",{ownKeys:n(1084)})},8501:(e,t,n)=>{var r=n(5935),i=n(2381),a=n(8319),o=n(5161),s=n(7947),l=n(6094);o(o.S,"Reflect",{get:function e(t,n){var o,u,c=arguments.length<3?t:arguments[2];return l(t)===c?t[n]:(o=r.f(t,n))?a(o,"value")?o.value:void 0!==o.get?o.get.call(c):void 0:s(u=i(t))?e(u,n,c):void 0}})},8529:(e,t,n)=>{e.exports=!n(1734)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},8544:(e,t,n)=>{"use strict";var r=n(2228),i=n(4397),a=n(9417),o=n(5440)("species");e.exports=function(e){var t=r[e];a&&t&&!t[o]&&i.f(t,o,{configurable:!0,get:function(){return this}})}},8616:(e,t,n)=>{var r=n(5161);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},8653:(e,t,n)=>{var r=n(5560),i=n(7029);n(7265)("keys",(function(){return function(e){return i(r(e))}}))},8670:(e,t,n)=>{var r=n(5161),i=n(5387),a=Math.sqrt,o=Math.acosh;r(r.S+r.F*!(o&&710==Math.floor(o(Number.MAX_VALUE))&&o(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+a(e-1)*a(e+1))}})},8719:e=>{e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},8818:(e,t,n)=>{var r=n(2228),i=n(3342).set,a=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,l="process"==n(4171)(o);e.exports=function(){var e,t,n,u=function(){var r,i;for(l&&(r=o.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){o.nextTick(u)};else if(!a||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);n=function(){c.then(u)}}else n=function(){i.call(r,u)};else{var h=!0,d=document.createTextNode("");new a(u).observe(d,{characterData:!0}),n=function(){d.data=h=!h}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},8834:(e,t,n)=>{"use strict";n.d(t,{EV:()=>u,_3:()=>c}),n(9032);var r=0,i=0,a=[],o=0,s=!1,l=document.createTextNode("");new window.MutationObserver((function(){s=!1;for(var e=a.length,t=function(){var e=a[n];if(e)try{e()}catch(e){setTimeout((function(){throw e}))}},n=0;n<e;n++)t();a.splice(0,e),i+=e})).observe(l,{characterData:!0});var u={after:function(e){return{run:function(t){return window.setTimeout(t,e)},cancel:function(e){window.clearTimeout(e)}}},run:function(e,t){return window.setTimeout(e,t)},cancel:function(e){window.clearTimeout(e)}},c={run:function(e){return s||(s=!0,l.textContent=o++),a.push(e),r++},cancel:function(e){var t=e-i;if(t>=0){if(!a[t])throw new Error("invalid async handle: "+e);a[t]=null}}}},8840:(e,t,n)=>{var r=n(4397),i=n(6094),a=n(7029);e.exports=n(9417)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,l=0;s>l;)r.f(e,n=o[l++],t[n]);return e}},8845:(e,t,n)=>{"use strict";var r=n(5652),i=n(2454),a="WeakSet";n(859)(a,(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,a),e,!0)}},r,!1,!0)},8891:(e,t,n)=>{"use strict";n(1794)("fontcolor",(function(e){return function(t){return e(this,"font","color",t)}}))},8925:(e,t,n)=>{"use strict";var r=n(5161),i=n(4547),a=[].join;r(r.P+r.F*(n(7295)!=Object||!n(938)(a)),"Array",{join:function(e){return a.call(i(this),void 0===e?",":e)}})},8948:(e,t,n)=>{n(9417)&&"g"!=/./g.flags&&n(4397).f(RegExp.prototype,"flags",{configurable:!0,get:n(3944)})},9002:(e,t,n)=>{"use strict";var r=n(3821),i=n(9142),a=n(5462),o={};n(6271)(o,n(5440)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},9013:(e,t,n)=>{var r=n(7382),i=n(1690),a=n(7206),o=Object.defineProperty;t.f=n(8529)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},9032:()=>{"use strict";window.JSCompiler_renameProperty=function(e,t){return e}},9106:(e,t,n)=>{var r=n(5161);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},9111:(e,t,n)=>{var r=Date.prototype,i="Invalid Date",a="toString",o=r[a],s=r.getTime;new Date(NaN)+""!=i&&n(9337)(r,a,(function(){var e=s.call(this);return e==e?o.call(this):i}))},9142:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},9173:(e,t,n)=>{"use strict";var r=n(5161),i=n(3814)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(2846)("includes")},9223:(e,t,n)=>{var r=n(5161),i=n(5881),a=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(a(e)+a(-e))}})},9259:(e,t,n)=>{"use strict";n.d(t,{y:()=>a}),n(9032);var r=0;function i(){}i.prototype.__mixinApplications,i.prototype.__mixinSet;var a=function(e){var t=e.__mixinApplications;t||(t=new WeakMap,e.__mixinApplications=t);var n=r++;return function(r){var i=r.__mixinSet;if(i&&i[n])return r;var a=t,o=a.get(r);if(!o){o=e(r),a.set(r,o);var s=Object.create(o.__mixinSet||i||null);s[n]=!0,o.__mixinSet=s}return o}}},9279:(e,t,n)=>{n(9492),e.exports=n(1212).Array.flatMap},9289:(e,t,n)=>{n(4040),e.exports=n(1212).Object.entries},9318:(e,t,n)=>{var r=n(2228),i=n(1212),a=n(2864),o=n(5002),s=n(4397).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:o.f(e)})}},9324:(e,t,n)=>{"use strict";var r=n(9417),i=n(7029),a=n(7598),o=n(4195),s=n(5560),l=n(7295),u=Object.assign;e.exports=!u||n(110)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r}))?function(e,t){for(var n=s(e),u=arguments.length,c=1,h=a.f,d=o.f;u>c;)for(var f,p=l(arguments[c++]),v=h?i(p).concat(h(p)):i(p),m=v.length,y=0;m>y;)f=v[y++],r&&!d.call(p,f)||(n[f]=p[f]);return n}:u},9336:(e,t,n)=>{var r=n(5161),i=n(7824)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},9337:(e,t,n)=>{var r=n(2228),i=n(6271),a=n(8319),o=n(4317)("src"),s=n(7903),l="toString",u=(""+s).split(l);n(1212).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(a(n,"name")||i(n,"name",t)),e[t]!==n&&(l&&(a(n,o)||i(n,o,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[o]||s.call(this)}))},9354:(e,t,n)=>{"use strict";var r=n(5161),i=n(9705)(0),a=n(938)([].forEach,!0);r(r.P+r.F*!a,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},9378:(e,t,n)=>{var r=n(2497),i=n(7462);e.exports=function(e){return function(t,n){var a,o,s=String(i(t)),l=r(n),u=s.length;return l<0||l>=u?e?"":void 0:(a=s.charCodeAt(l))<55296||a>56319||l+1===u||(o=s.charCodeAt(l+1))<56320||o>57343?e?s.charAt(l):a:e?s.slice(l,l+2):o-56320+(a-55296<<10)+65536}}},9417:(e,t,n)=>{e.exports=!n(110)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},9450:(e,t,n)=>{var r=n(1416);e.exports=function(e,t){return new(r(e))(t)}},9492:(e,t,n)=>{"use strict";var r=n(5161),i=n(4140),a=n(5560),o=n(3991),s=n(609),l=n(9450);r(r.P,"Array",{flatMap:function(e){var t,n,r=a(this);return s(e),t=o(r.length),n=l(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(2846)("flatMap")},9502:(e,t,n)=>{n(9318)("asyncIterator")},9507:(e,t,n)=>{"use strict";n.d(t,{Ho:()=>v,Vg:()=>y,nX:()=>p});var r=n(6705),i=n(1606);function a(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var s="link[rel=import][type~=css]",l="include",u="shady-unscoped";function c(e){return r.$.import(e)}function h(e){var t=e.body?e.body:e,n=(0,i.c0)(t.textContent,e.baseURI),r=document.createElement("style");return r.textContent=n,r}function d(e){for(var t=e.trim().split(/\s+/),n=[],r=0;r<t.length;r++)n.push.apply(n,a(f(t[r])));return n}function f(e){var t=c(e);if(!t)return console.warn("Could not find style data in module named",e),[];if(void 0===t._styles){var n=[];n.push.apply(n,a(m(t)));var r=t.querySelector("template");r&&n.push.apply(n,a(p(r,t.assetpath))),t._styles=n}return t._styles}function p(e,t){if(!e._styles){for(var n=[],r=e.content.querySelectorAll("style"),o=0;o<r.length;o++){var s=r[o],u=s.getAttribute(l);u&&n.push.apply(n,a(d(u).filter((function(e,t,n){return n.indexOf(e)===t})))),t&&(s.textContent=(0,i.c0)(s.textContent,t)),n.push(s)}e._styles=n}return e._styles}function v(e){var t=c(e);return t?m(t):[]}function m(e){for(var t=[],n=e.querySelectorAll(s),r=0;r<n.length;r++){var i=n[r];if(i.import){var a=i.import,o=i.hasAttribute(u);if(o&&!a._unscopedStyle){var l=h(a);l.setAttribute(u,""),a._unscopedStyle=l}else a._style||(a._style=h(a));t.push(o?a._unscopedStyle:a._style)}}return t}function y(e){for(var t=e.trim().split(/\s+/),n="",r=0;r<t.length;r++)n+=g(t[r]);return n}function g(e){var t=c(e);if(t&&void 0===t._cssText){var n=function(e){for(var t="",n=m(e),r=0;r<n.length;r++)t+=n[r].textContent;return t}(t),r=t.querySelector("template");r&&(n+=function(e,t){for(var n="",r=p(e,t),i=0;i<r.length;i++){var a=r[i];a.parentNode&&a.parentNode.removeChild(a),n+=a.textContent}return n}(r,t.assetpath)),t._cssText=n||null}return t||console.warn("Could not find style data in module named",e),t&&t._cssText||""}},9549:(e,t,n)=>{"use strict";var r,i,a=n(5971),o=!(window.ShadyDOM&&window.ShadyDOM.inUse);function s(e){r=(!e||!e.shimcssproperties)&&(o||Boolean(!navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)&&window.CSS&&CSS.supports&&CSS.supports("box-shadow","0 0 0 var(--foo)")))}window.ShadyCSS&&void 0!==window.ShadyCSS.cssBuild&&(i=window.ShadyCSS.cssBuild);var l=Boolean(window.ShadyCSS&&window.ShadyCSS.disableRuntime);window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?r=window.ShadyCSS.nativeCss:window.ShadyCSS?(s(window.ShadyCSS),window.ShadyCSS=void 0):s(window.WebComponents&&window.WebComponents.flags);var u=r;function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function d(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var p=d((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""}));function v(e){return m(function(e){var t=new p;t.start=0,t.end=e.length;for(var n=t,r=0,i=e.length;r<i;r++)if(e[r]===_){n.rules||(n.rules=[]);var a=n,o=a.rules[a.rules.length-1]||null;(n=new p).start=r+1,n.parent=a,n.previous=o,a.rules.push(n)}else e[r]===b&&(n.end=r+1,n=n.parent||t);return t}(e=e.replace(x.comments,"").replace(x.port,"")),e)}function m(e,t){var n=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=n.trim(),e.parent){var r=e.previous?e.previous.end:e.parent.start;n=function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}(n=t.substring(r,e.start-1)),n=(n=n.replace(x.multipleSpaces," ")).substring(n.lastIndexOf(";")+1);var i=e.parsedSelector=e.selector=n.trim();e.atRule=0===i.indexOf(E),e.atRule?0===i.indexOf(w)?e.type=g.MEDIA_RULE:i.match(x.keyframesRule)&&(e.type=g.KEYFRAMES_RULE,e.keyframesName=e.selector.split(x.multipleSpaces).pop()):0===i.indexOf(S)?e.type=g.MIXIN_RULE:e.type=g.STYLE_RULE}var a=e.rules;if(a)for(var o,s=0,l=a.length;s<l&&(o=a[s]);s++)m(o,t);return e}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="";if(e.cssText||e.rules){var i=e.rules;if(i&&!function(e){var t=e[0];return Boolean(t)&&Boolean(t.selector)&&0===t.selector.indexOf(S)}(i))for(var a,o=0,s=i.length;o<s&&(a=i[o]);o++)r=y(a,t,r);else(r=(r=t?e.cssText:function(e){return function(e){return e.replace(x.mixinApply,"").replace(x.varApply,"")}(e=function(e){return e.replace(x.customProp,"").replace(x.mixinProp,"")}(e))}(e.cssText)).trim())&&(r=" "+r+"\n")}return r&&(e.selector&&(n+=e.selector+" "+_+"\n"),n+=r,e.selector&&(n+=b+"\n\n")),n}var g={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},_="{",b="}",x={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},S="--",w="@media",E="@",M=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,T=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,C=/@media\s(.*)/,A=new Set;function P(e){var t=e.textContent;if(!A.has(t)){A.add(t);var n=document.createElement("style");n.setAttribute("shady-unscoped",""),n.textContent=t,document.head.appendChild(n)}}function k(e){return e.hasAttribute("shady-unscoped")}function O(e,t){return e?("string"==typeof e&&(e=v(e)),t&&I(e,t),y(e,u)):""}function R(e){return!e.__cssRules&&e.textContent&&(e.__cssRules=v(e.textContent)),e.__cssRules||null}function I(e,t,n,r){if(e){var i=!1,a=e.type;if(r&&a===g.MEDIA_RULE){var o=e.selector.match(C);o&&(window.matchMedia(o[1]).matches||(i=!0))}a===g.STYLE_RULE?t(e):n&&a===g.KEYFRAMES_RULE?n(e):a===g.MIXIN_RULE&&(i=!0);var s=e.rules;if(s&&!i)for(var l,u=0,c=s.length;u<c&&(l=s[u]);u++)I(l,t,n,r)}}function N(e,t){var n=e.indexOf("var(");if(-1===n)return t(e,"","","");var r=function(e,t){for(var n=0,r=t,i=e.length;r<i;r++)if("("===e[r])n++;else if(")"===e[r]&&0===--n)return r;return-1}(e,n+3),i=e.substring(n+4,r),a=e.substring(0,n),o=N(e.substring(r+1),t),s=i.indexOf(",");return-1===s?t(a,i.trim(),"",o):t(a,i.substring(0,s).trim(),i.substring(s+1).trim(),o)}window.ShadyDOM&&window.ShadyDOM.wrap;var L="css-build";function D(e){return""!==function(e){if(void 0!==i)return i;if(void 0===e.__cssBuild){var t=e.getAttribute(L);if(t)e.__cssBuild=t;else{var n=function(e){var t="template"===e.localName?e.content.firstChild:e.firstChild;if(t instanceof Comment){var n=t.textContent.trim().split(":");if(n[0]===L)return n[1]}return""}(e);""!==n&&function(e){var t="template"===e.localName?e.content.firstChild:e.firstChild;t.parentNode.removeChild(t)}(e),e.__cssBuild=n}}return e.__cssBuild||""}(e)}function U(e,t){for(var n in t)null===n?e.style.removeProperty(n):e.style.setProperty(n,t[n])}function F(e,t){var n=window.getComputedStyle(e).getPropertyValue(t);return n?n.trim():""}function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V(r.key),r)}}function H(e,t,n){return t&&j(e.prototype,t),n&&j(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function V(e){var t=function(e){if("object"!=B(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=B(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==B(t)?t:t+""}var G=/;\s*/m,W=/^\s*(initial)|(inherit)\s*$/,X=/\s*!important/,q="_-_",Y=function(){return H((function e(){z(this,e),this._map={}}),[{key:"set",value:function(e,t){e=e.trim(),this._map[e]={properties:t,dependants:{}}}},{key:"get",value:function(e){return e=e.trim(),this._map[e]||null}}])}(),J=null,Z=function(){return H((function e(){z(this,e),this._currentElement=null,this._measureElement=null,this._map=new Y}),[{key:"detectMixin",value:function(e){return function(e){var t=T.test(e)||M.test(e);return T.lastIndex=0,M.lastIndex=0,t}(e)}},{key:"gatherStyles",value:function(e){var t=function(e){for(var t=[],n=e.querySelectorAll("style"),r=0;r<n.length;r++){var i=n[r];k(i)?o||(P(i),i.parentNode.removeChild(i)):(t.push(i.textContent),i.parentNode.removeChild(i))}return t.join("").trim()}(e.content);if(t){var n=document.createElement("style");return n.textContent=t,e.content.insertBefore(n,e.content.firstChild),n}return null}},{key:"transformTemplate",value:function(e,t){void 0===e._gatheredStyle&&(e._gatheredStyle=this.gatherStyles(e));var n=e._gatheredStyle;return n?this.transformStyle(n,t):null}},{key:"transformStyle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=R(e);return this.transformRules(n,t),e.textContent=O(n),n}},{key:"transformCustomStyle",value:function(e){var t=this,n=R(e);return I(n,(function(e){":root"===e.selector&&(e.selector="html"),t.transformRule(e)})),e.textContent=O(n),n}},{key:"transformRules",value:function(e,t){var n=this;this._currentElement=t,I(e,(function(e){n.transformRule(e)})),this._currentElement=null}},{key:"transformRule",value:function(e){e.cssText=this.transformCssText(e.parsedCssText,e),":root"===e.selector&&(e.selector=":host > *")}},{key:"transformCssText",value:function(e,t){var n=this;return e=e.replace(M,(function(e,r,i,a){return n._produceCssProperties(e,r,i,a,t)})),this._consumeCssProperties(e,t)}},{key:"_getInitialValueForProperty",value:function(e){return this._measureElement||(this._measureElement=document.createElement("meta"),this._measureElement.setAttribute("apply-shim-measure",""),this._measureElement.style.all="initial",document.head.appendChild(this._measureElement)),window.getComputedStyle(this._measureElement).getPropertyValue(e)}},{key:"_fallbacksFromPreviousRules",value:function(e){for(var t=this,n=e;n.parent;)n=n.parent;var r={},i=!1;return I(n,(function(n){(i=i||n===e)||n.selector===e.selector&&Object.assign(r,t._cssTextToMap(n.parsedCssText))})),r}},{key:"_consumeCssProperties",value:function(e,t){for(var n=null;n=T.exec(e);){var r=n[0],i=n[1],a=n.index,o=a+r.indexOf("@apply"),s=a+r.length,l=e.slice(0,o),u=e.slice(s),c=t?this._fallbacksFromPreviousRules(t):{};Object.assign(c,this._cssTextToMap(l));var h=this._atApplyToCssProperties(i,c);e="".concat(l).concat(h).concat(u),T.lastIndex=a+h.length}return e}},{key:"_atApplyToCssProperties",value:function(e,t){e=e.replace(G,"");var n=[],r=this._map.get(e);if(r||(this._map.set(e,{}),r=this._map.get(e)),r){var i,a,o;this._currentElement&&(r.dependants[this._currentElement]=!0);var s=r.properties;for(i in s)o=t&&t[i],a=[i,": var(",e,q,i],o&&a.push(",",o.replace(X,"")),a.push(")"),X.test(s[i])&&a.push(" !important"),n.push(a.join(""))}return n.join("; ")}},{key:"_replaceInitialOrInherit",value:function(e,t){var n=W.exec(t);return n&&(t=n[1]?this._getInitialValueForProperty(e):"apply-shim-inherit"),t}},{key:"_cssTextToMap",value:function(e){for(var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=e.split(";"),s={},l=0;l<o.length;l++)(r=o[l])&&(i=r.split(":")).length>1&&(t=i[0].trim(),n=i.slice(1).join(":"),a&&(n=this._replaceInitialOrInherit(t,n)),s[t]=n);return s}},{key:"_invalidateMixinEntry",value:function(e){if(J)for(var t in e.dependants)t!==this._currentElement&&J(t)}},{key:"_produceCssProperties",value:function(e,t,n,r,i){var a=this;if(n&&N(n,(function(e,t){t&&a._map.get(t)&&(r="@apply ".concat(t,";"))})),!r)return e;var o=this._consumeCssProperties(""+r,i),s=e.slice(0,e.indexOf("--")),l=this._cssTextToMap(o,!0),u=l,c=this._map.get(t),h=c&&c.properties;h?u=Object.assign(Object.create(h),l):this._map.set(t,u);var d,f,p=[],v=!1;for(d in u)void 0===(f=l[d])&&(f="initial"),h&&!(d in h)&&(v=!0),p.push("".concat(t).concat(q).concat(d,": ").concat(f));return v&&this._invalidateMixinEntry(c),c&&(c.properties=u),n&&(s="".concat(e,";").concat(s)),"".concat(s).concat(p.join("; "),";")}}])}();Z.prototype.detectMixin=Z.prototype.detectMixin,Z.prototype.transformStyle=Z.prototype.transformStyle,Z.prototype.transformCustomStyle=Z.prototype.transformCustomStyle,Z.prototype.transformRules=Z.prototype.transformRules,Z.prototype.transformRule=Z.prototype.transformRule,Z.prototype.transformTemplate=Z.prototype.transformTemplate,Z.prototype._separator=q,Object.defineProperty(Z.prototype,"invalidCallback",{get:function(){return J},set:function(e){J=e}});const K=Z,$={};var Q="_applyShimCurrentVersion",ee="_applyShimNextVersion",te="_applyShimValidatingVersion",ne=Promise.resolve();function re(e){var t=$[e];t&&function(e){e[Q]=e[Q]||0,e[te]=e[te]||0,e[ee]=(e[ee]||0)+1}(t)}function ie(e){return e[Q]===e[ee]}var ae,oe=null,se=window.HTMLImports&&window.HTMLImports.whenReady||null;function le(e){requestAnimationFrame((function(){se?se(e):(oe||(oe=new Promise((function(e){ae=e})),"complete"===document.readyState?ae():document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&ae()}))),oe.then((function(){e&&e()})))}))}function ue(e){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(e)}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,he(r.key),r)}}function he(e){var t=function(e){if("object"!=ue(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ue(t)?t:t+""}var de="__seenByShadyCSS",fe="__shadyCSSCachedStyle",pe=null,ve=null,me=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.customStyles=[],this.enqueued=!1,le((function(){window.ShadyCSS.flushCustomStyles&&window.ShadyCSS.flushCustomStyles()}))},(t=[{key:"enqueueDocumentValidation",value:function(){!this.enqueued&&ve&&(this.enqueued=!0,le(ve))}},{key:"addCustomStyle",value:function(e){e[de]||(e[de]=!0,this.customStyles.push(e),this.enqueueDocumentValidation())}},{key:"getStyleForCustomStyle",value:function(e){return e[fe]?e[fe]:e.getStyle?e.getStyle():e}},{key:"processStyles",value:function(){for(var e=this.customStyles,t=0;t<e.length;t++){var n=e[t];if(!n[fe]){var r=this.getStyleForCustomStyle(n);if(r){var i=r.__appliedElement||r;pe&&pe(i),n[fe]=i}}}return e}}])&&ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ye(e){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ye(e)}function ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_e(r.key),r)}}function _e(e){var t=function(e){if("object"!=ye(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ye(t)?t:t+""}me.prototype.addCustomStyle=me.prototype.addCustomStyle,me.prototype.getStyleForCustomStyle=me.prototype.getStyleForCustomStyle,me.prototype.processStyles=me.prototype.processStyles,Object.defineProperties(me.prototype,{transformCallback:{get:function(){return pe},set:function(e){pe=e}},validateCallback:{get:function(){return ve},set:function(e){var t=!1;ve||(t=!0),ve=e,t&&this.enqueueDocumentValidation()}}});var be=new K,xe=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.customStyleInterface=null,be.invalidCallback=re},(t=[{key:"ensure",value:function(){var e=this;this.customStyleInterface||window.ShadyCSS.CustomStyleInterface&&(this.customStyleInterface=window.ShadyCSS.CustomStyleInterface,this.customStyleInterface.transformCallback=function(e){be.transformCustomStyle(e)},this.customStyleInterface.validateCallback=function(){requestAnimationFrame((function(){e.customStyleInterface.enqueued&&e.flushCustomStyles()}))})}},{key:"prepareTemplate",value:function(e,t){if(this.ensure(),!D(e)){$[t]=e;var n=be.transformTemplate(e,t);e._styleAst=n}}},{key:"flushCustomStyles",value:function(){if(this.ensure(),this.customStyleInterface){var e=this.customStyleInterface.processStyles();if(this.customStyleInterface.enqueued){for(var t=0;t<e.length;t++){var n=e[t],r=this.customStyleInterface.getStyleForCustomStyle(n);r&&be.transformCustomStyle(r)}this.customStyleInterface.enqueued=!1}}}},{key:"styleSubtree",value:function(e,t){if(this.ensure(),t&&U(e,t),e.shadowRoot){this.styleElement(e);for(var n=e.shadowRoot.children||e.shadowRoot.childNodes,r=0;r<n.length;r++)this.styleSubtree(n[r])}else for(var i=e.children||e.childNodes,a=0;a<i.length;a++)this.styleSubtree(i[a])}},{key:"styleElement",value:function(e){this.ensure();var t=function(e){var t=e.localName,n="",r="";return t?t.indexOf("-")>-1?n=t:(r=t,n=e.getAttribute&&e.getAttribute("is")||""):(n=e.is,r=e.extends),{is:n,typeExtension:r}}(e),n=t.is,r=$[n];if((!r||!D(r))&&r&&!ie(r)){(function(e){return!ie(e)&&e[te]===e[ee]})(r)||(this.prepareTemplate(r,n),function(e){e[te]=e[ee],e._validating||(e._validating=!0,ne.then((function(){e[Q]=e[ee],e._validating=!1})))}(r));var i=e.shadowRoot;if(i){var a=i.querySelector("style");a&&(a.__cssRules=r._styleAst,a.textContent=O(r._styleAst))}}}},{key:"styleDocument",value:function(e){this.ensure(),this.styleSubtree(document.body,e)}}])&&ge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){var Se=new xe,we=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate:function(e,t,n){Se.flushCustomStyles(),Se.prepareTemplate(e,t)},prepareTemplateStyles:function(e,t,n){window.ShadyCSS.prepareTemplate(e,t,n)},prepareTemplateDom:function(e,t){},styleSubtree:function(e,t){Se.flushCustomStyles(),Se.styleSubtree(e,t)},styleElement:function(e){Se.flushCustomStyles(),Se.styleElement(e)},styleDocument:function(e){Se.flushCustomStyles(),Se.styleDocument(e)},getComputedStyleValue:function(e,t){return F(e,t)},flushCustomStyles:function(){Se.flushCustomStyles()},nativeCss:u,nativeShadow:o,cssBuild:i,disableRuntime:l},we&&(window.ShadyCSS.CustomStyleInterface=we)}window.ShadyCSS.ApplyShim=be;var Ee=n(3438),Me=(n(9032),n(9259)),Te=n(8834),Ce=n(1475),Ae=n(7925),Pe=n(5572),ke="string"==typeof document.head.style.touchAction,Oe="__polymerGestures",Re="__polymerGesturesHandled",Ie="__polymerGesturesTouchAction",Ne=["mousedown","mousemove","mouseup","click"],Le=[0,1,4,2],De=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}();function Ue(e){return Ne.indexOf(e)>-1}var Fe=!1;function Be(e){if(!Ue(e)&&"touchend"!==e)return ke&&Fe&&Ae.Hp?{passive:!0}:void 0}!function(){try{var e=Object.defineProperty({},"passive",{get:function(){Fe=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}();var ze=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/),je=[],He={button:!0,input:!0,keygen:!0,meter:!0,output:!0,textarea:!0,progress:!0,select:!0},Ve={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function Ge(e){var t=Array.prototype.slice.call(e.labels||[]);if(!t.length){t=[];try{var n=e.getRootNode();if(e.id)for(var r=n.querySelectorAll("label[for = '".concat(e.id,"']")),i=0;i<r.length;i++)t.push(r[i])}catch(e){}}return t}var We=function(e){var t,n=e.sourceCapabilities;if((!n||n.firesTouchEvents)&&(e[Re]={skip:!0},"click"===e.type)){for(var r=!1,i=Ke(e),a=0;a<i.length;a++){if(i[a].nodeType===Node.ELEMENT_NODE)if("label"===i[a].localName)je.push(i[a]);else if(t=i[a],He[t.localName])for(var o=Ge(i[a]),s=0;s<o.length;s++)r=r||je.indexOf(o[s])>-1;if(i[a]===Ye.mouse.target)return}if(r)return;e.preventDefault(),e.stopPropagation()}};function Xe(e){for(var t,n=ze?["click"]:Ne,r=0;r<n.length;r++)t=n[r],e?(je.length=0,document.addEventListener(t,We,!0)):document.removeEventListener(t,We,!0)}function qe(e){var t=e.type;if(!Ue(t))return!1;if("mousemove"===t){var n=void 0===e.buttons?1:e.buttons;return e instanceof window.MouseEvent&&!De&&(n=Le[e.which]||0),Boolean(1&n)}return 0===(void 0===e.button?0:e.button)}var Ye={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:!1}};function Je(e,t,n){e.movefn=t,e.upfn=n,document.addEventListener("mousemove",t),document.addEventListener("mouseup",n)}function Ze(e){document.removeEventListener("mousemove",e.movefn),document.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}Ae.bK&&document.addEventListener("touchend",(function(e){Ae.bK&&(Ye.mouse.mouseIgnoreJob||Xe(!0),Ye.mouse.target=Ke(e)[0],Ye.mouse.mouseIgnoreJob=Ce.aq.debounce(Ye.mouse.mouseIgnoreJob,Te.EV.after(2500),(function(){Xe(),Ye.mouse.target=null,Ye.mouse.mouseIgnoreJob=null})))}),!!Fe&&{passive:!0});var Ke=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:function(e){return e.composedPath&&e.composedPath()||[]},$e={},Qe=[];function et(e){var t=Ke(e);return t.length>0?t[0]:e.target}function tt(e){var t,n=e.type,r=e.currentTarget[Oe];if(r){var i=r[n];if(i){if(!e[Re]&&(e[Re]={},"touch"===n.slice(0,5))){var a=e.changedTouches[0];if("touchstart"===n&&1===e.touches.length&&(Ye.touch.id=a.identifier),Ye.touch.id!==a.identifier)return;ke||"touchstart"!==n&&"touchmove"!==n||function(e){var t=e.changedTouches[0],n=e.type;if("touchstart"===n)Ye.touch.x=t.clientX,Ye.touch.y=t.clientY,Ye.touch.scrollDecided=!1;else if("touchmove"===n){if(Ye.touch.scrollDecided)return;Ye.touch.scrollDecided=!0;var r=function(e){for(var t,n="auto",r=Ke(e),i=0;i<r.length;i++)if((t=r[i])[Ie]){n=t[Ie];break}return n}(e),i=!1,a=Math.abs(Ye.touch.x-t.clientX),o=Math.abs(Ye.touch.y-t.clientY);e.cancelable&&("none"===r?i=!0:"pan-x"===r?i=o>a:"pan-y"===r&&(i=a>o)),i?e.preventDefault():at("track")}}(e)}if(!(t=e[Re]).skip){for(var o,s=0;s<Qe.length;s++)i[(o=Qe[s]).name]&&!t[o.name]&&o.flow&&o.flow.start.indexOf(e.type)>-1&&o.reset&&o.reset();for(var l,u=0;u<Qe.length;u++)i[(l=Qe[u]).name]&&!t[l.name]&&(t[l.name]=!0,l[n](e))}}}}function nt(e){Qe.push(e);for(var t=0;t<e.emits.length;t++)$e[e.emits[t]]=e}function rt(e,t){ke&&e instanceof HTMLElement&&Te._3.run((function(){e.style.touchAction=t})),e[Ie]=t}function it(e,t,n){var r=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(r.detail=n,(0,Pe.L)(e).dispatchEvent(r),r.defaultPrevented){var i=n.preventer||n.sourceEvent;i&&i.preventDefault&&i.preventDefault()}}function at(e){var t=function(e){for(var t,n=0;n<Qe.length;n++){t=Qe[n];for(var r=0;r<t.emits.length;r++)if(t.emits[r]===e)return t}return null}(e);t.info&&(t.info.prevent=!0)}function ot(e,t,n,r){t&&it(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,prevent:function(e){return at(e)}})}function st(e,t,n){if(e.prevent)return!1;if(e.started)return!0;var r=Math.abs(e.x-t),i=Math.abs(e.y-n);return r>=5||i>=5}function lt(e,t,n){if(t){var r,i=e.moves[e.moves.length-2],a=e.moves[e.moves.length-1],o=a.x-e.x,s=a.y-e.y,l=0;i&&(r=a.x-i.x,l=a.y-i.y),it(t,"track",{state:e.state,x:n.clientX,y:n.clientY,dx:o,dy:s,ddx:r,ddy:l,sourceEvent:n,hover:function(){return function(e,t){for(var n=document.elementFromPoint(e,t),r=n;r&&r.shadowRoot&&!window.ShadyDOM&&r!==(r=r.shadowRoot.elementFromPoint(e,t));)r&&(n=r);return n}(n.clientX,n.clientY)}})}}function ut(e,t,n){var r=Math.abs(t.clientX-e.x),i=Math.abs(t.clientY-e.y),a=et(n||t);!a||Ve[a.localName]&&a.hasAttribute("disabled")||(isNaN(r)||isNaN(i)||r<=25&&i<=25||function(e){if("click"===e.type){if(0===e.detail)return!0;var t=et(e);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE)return!0;var n=t.getBoundingClientRect(),r=e.pageX,i=e.pageY;return!(r>=n.left&&r<=n.right&&i>=n.top&&i<=n.bottom)}return!1}(t))&&(e.prevent||it(a,"tap",{x:t.clientX,y:t.clientY,sourceEvent:t,preventer:n}))}function ct(e){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ct(e)}function ht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,dt(r.key),r)}}function dt(e){var t=function(e){if("object"!=ct(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ct(t)?t:t+""}function ft(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ft=function(){return!!e})()}function pt(e,t,n,r){var i=vt(mt(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function vt(){return vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=mt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},vt.apply(null,arguments)}function mt(e){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mt(e)}function yt(e,t){return yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yt(e,t)}nt({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){Ze(this.info)},mousedown:function(e){if(qe(e)){var t=et(e),n=this;Je(this.info,(function(e){qe(e)||(ot("up",t,e),Ze(n.info))}),(function(e){qe(e)&&ot("up",t,e),Ze(n.info)})),ot("down",t,e)}},touchstart:function(e){ot("down",et(e),e.changedTouches[0],e)},touchend:function(e){ot("up",et(e),e.changedTouches[0],e)}}),nt({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>2&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,Ze(this.info)},mousedown:function(e){if(qe(e)){var t=et(e),n=this,r=function(e){var r=e.clientX,i=e.clientY;st(n.info,r,i)&&(n.info.state=n.info.started?"mouseup"===e.type?"end":"track":"start","start"===n.info.state&&at("tap"),n.info.addMove({x:r,y:i}),qe(e)||(n.info.state="end",Ze(n.info)),t&&lt(n.info,t,e),n.info.started=!0)};Je(this.info,r,(function(e){n.info.started&&r(e),Ze(n.info)})),this.info.x=e.clientX,this.info.y=e.clientY}},touchstart:function(e){var t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){var t=et(e),n=e.changedTouches[0],r=n.clientX,i=n.clientY;st(this.info,r,i)&&("start"===this.info.state&&at("tap"),this.info.addMove({x:r,y:i}),lt(this.info,t,n),this.info.state="track",this.info.started=!0)},touchend:function(e){var t=et(e),n=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:n.clientX,y:n.clientY}),lt(this.info,t,n))}}),nt({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown:function(e){qe(e)&&(this.info.x=e.clientX,this.info.y=e.clientY)},click:function(e){qe(e)&&ut(this.info,e)},touchstart:function(e){var t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchend:function(e){ut(this.info,e.changedTouches[0],e)}});var gt=(0,Me.y)((function(e){var t=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=mt(t),function(e,t){if(t&&("object"==ct(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ft()?Reflect.construct(t,n||[],mt(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yt(e,t)}(t,e),n=t,(r=[{key:"_addEventListenerToNode",value:function(e,n,r){(function(e,t,n){return!!$e[t]&&(function(e,t,n){var r=$e[t],i=r.deps,a=r.name,o=e[Oe];o||(e[Oe]=o={});for(var s,l,u=0;u<i.length;u++)s=i[u],ze&&Ue(s)&&"click"!==s||((l=o[s])||(o[s]=l={_count:0}),0===l._count&&e.addEventListener(s,tt,Be(s)),l[a]=(l[a]||0)+1,l._count=(l._count||0)+1);e.addEventListener(t,n),r.touchAction&&rt(e,r.touchAction)}(e,t,n),!0)})(e,n,r)||pt(t,"_addEventListenerToNode",this,3)([e,n,r])}},{key:"_removeEventListenerFromNode",value:function(e,n,r){(function(e,t,n){return!!$e[t]&&(function(e,t,n){var r=$e[t],i=r.deps,a=r.name,o=e[Oe];if(o)for(var s,l,u=0;u<i.length;u++)(l=o[s=i[u]])&&l[a]&&(l[a]=(l[a]||1)-1,l._count=(l._count||1)-1,0===l._count&&e.removeEventListener(s,tt,Be(s)));e.removeEventListener(t,n)}(e,t,n),!0)})(e,n,r)||pt(t,"_removeEventListenerFromNode",this,3)([e,n,r])}}])&&ht(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(e);return t})),_t=n(2015);function bt(e){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bt(e)}function xt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,St(r.key),r)}}function St(e){var t=function(e){if("object"!=bt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bt(t)?t:t+""}function wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wt=function(){return!!e})()}function Et(e,t,n,r){var i=Mt(Tt(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Mt(){return Mt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Tt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Mt.apply(null,arguments)}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tt(e)}function Ct(e,t){return Ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ct(e,t)}var At=/:host\(:dir\((ltr|rtl)\)\)/g,Pt=/([\s\w-#\.\[\]\*]*):dir\((ltr|rtl)\)/g,kt=/:dir\((?:ltr|rtl)\)/,Ot=Boolean(window.ShadyDOM&&window.ShadyDOM.inUse),Rt=[],It=null,Nt="";function Lt(){Nt=document.documentElement.getAttribute("dir")}function Dt(e){e.__autoDirOptOut||e.setAttribute("dir",Nt)}function Ut(){Lt(),Nt=document.documentElement.getAttribute("dir");for(var e=0;e<Rt.length;e++)Dt(Rt[e])}var Ft=(0,Me.y)((function(e){Ot||It||(Lt(),(It=new MutationObserver(Ut)).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}));var t=(0,_t.W)(e),n=function(e){function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=function(e,t,n){return t=Tt(t),function(e,t){if(t&&("object"==bt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wt()?Reflect.construct(t,n||[],Tt(e).constructor):t.apply(e,n))}(this,n)).__autoDirOptOut=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ct(e,t)}(n,e),r=n,a=[{key:"_processStyleText",value:function(e,n){return e=t._processStyleText.call(this,e,n),!Ot&&kt.test(e)&&(e=this._replaceDirInCssText(e),this.__activateDir=!0),e}},{key:"_replaceDirInCssText",value:function(e){var t=e;return(t=t.replace(At,':host([dir="$1"])')).replace(Pt,':host([dir="$2"]) $1')}}],(i=[{key:"ready",value:function(){Et(n,"ready",this,3)([]),this.__autoDirOptOut=this.hasAttribute("dir")}},{key:"connectedCallback",value:function(){t.prototype.connectedCallback&&Et(n,"connectedCallback",this,3)([]),this.constructor.__activateDir&&(It&&It.takeRecords().length&&Ut(),Rt.push(this),Dt(this))}},{key:"disconnectedCallback",value:function(){if(t.prototype.disconnectedCallback&&Et(n,"disconnectedCallback",this,3)([]),this.constructor.__activateDir){var e=Rt.indexOf(this);e>-1&&Rt.splice(e,1)}}}])&&xt(r.prototype,i),a&&xt(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,a}(t);return n.__activateDir=!1,n})),Bt=n(491);function zt(){document.body.removeAttribute("unresolved")}function jt(e,t,n){return{index:e,removed:t,addedCount:n}}function Ht(e,t){return function(e,t,n,r,i,a){var o,s=0,l=0,u=Math.min(n-t,a-i);if(0==t&&0==i&&(s=function(e,t,n){for(var r=0;r<n;r++)if(!Vt(e[r],t[r]))return r;return n}(e,r,u)),n==e.length&&a==r.length&&(l=function(e,t,n){for(var r=e.length,i=t.length,a=0;a<n&&Vt(e[--r],t[--i]);)a++;return a}(e,r,u-s)),i+=s,a-=l,(n-=l)-(t+=s)==0&&a-i==0)return[];if(t==n){for(o=jt(t,[],0);i<a;)o.removed.push(r[i++]);return[o]}if(i==a)return[jt(t,[],n-t)];var c=function(e){for(var t=e.length-1,n=e[0].length-1,r=e[t][n],i=[];t>0||n>0;)if(0!=t)if(0!=n){var a,o=e[t-1][n-1],s=e[t-1][n],l=e[t][n-1];(a=s<l?s<o?s:o:l<o?l:o)==o?(o==r?i.push(0):(i.push(1),r=o),t--,n--):a==s?(i.push(3),t--,r=s):(i.push(2),n--,r=l)}else i.push(3),t--;else i.push(2),n--;return i.reverse(),i}(function(e,t,n,r,i,a){for(var o=a-i+1,s=n-t+1,l=new Array(o),u=0;u<o;u++)l[u]=new Array(s),l[u][0]=u;for(var c=0;c<s;c++)l[0][c]=c;for(var h=1;h<o;h++)for(var d=1;d<s;d++)if(Vt(e[t+d-1],r[i+h-1]))l[h][d]=l[h-1][d-1];else{var f=l[h-1][d]+1,p=l[h][d-1]+1;l[h][d]=f<p?f:p}return l}(e,t,n,r,i,a));o=void 0;for(var h=[],d=t,f=i,p=0;p<c.length;p++)switch(c[p]){case 0:o&&(h.push(o),o=void 0),d++,f++;break;case 1:o||(o=jt(d,[],0)),o.addedCount++,d++,o.removed.push(r[f]),f++;break;case 2:o||(o=jt(d,[],0)),o.addedCount++,d++;break;case 3:o||(o=jt(d,[],0)),o.removed.push(r[f]),f++}return o&&h.push(o),h}(e,0,e.length,t,0,t.length)}function Vt(e,t){return e===t}function Gt(e){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gt(e)}function Wt(e){return function(e){if(Array.isArray(e))return Xt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Xt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Yt(r.key),r)}}function Yt(e){var t=function(e){if("object"!=Gt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Gt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gt(t)?t:t+""}function Jt(e){return"slot"===e.localName}"interactive"===document.readyState||"complete"===document.readyState?zt():window.addEventListener("DOMContentLoaded",zt);var Zt=function(){return e=function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._shadyChildrenObserver=null,this._nativeChildrenObserver=null,this._connected=!1,this._target=t,this.callback=n,this._effectiveNodes=[],this._observer=null,this._scheduled=!1,this._boundSchedule=function(){r._schedule()},this.connect(),this._schedule()},n=[{key:"getFlattenedNodes",value:function(e){var t=(0,Pe.L)(e);if(Jt(e))return t.assignedNodes({flatten:!0});for(var n=[],r=0;r<t.childNodes.length;r++){var i=t.childNodes[r];if(Jt(i)){var a=i;n.push.apply(n,Wt((0,Pe.L)(a).assignedNodes({flatten:!0})))}else n.push(i)}return n}}],(t=[{key:"connect",value:function(){var e=this;Jt(this._target)?this._listenSlots([this._target]):(0,Pe.L)(this._target).children&&(this._listenSlots((0,Pe.L)(this._target).children),window.ShadyDOM?this._shadyChildrenObserver=window.ShadyDOM.observeChildren(this._target,(function(t){e._processMutations(t)})):(this._nativeChildrenObserver=new MutationObserver((function(t){e._processMutations(t)})),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}},{key:"disconnect",value:function(){Jt(this._target)?this._unlistenSlots([this._target]):(0,Pe.L)(this._target).children&&(this._unlistenSlots((0,Pe.L)(this._target).children),window.ShadyDOM&&this._shadyChildrenObserver?(window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}},{key:"_schedule",value:function(){var e=this;this._scheduled||(this._scheduled=!0,Te._3.run((function(){return e.flush()})))}},{key:"_processMutations",value:function(e){this._processSlotMutations(e),this.flush()}},{key:"_processSlotMutations",value:function(e){if(e)for(var t=0;t<e.length;t++){var n=e[t];n.addedNodes&&this._listenSlots(n.addedNodes),n.removedNodes&&this._unlistenSlots(n.removedNodes)}}},{key:"flush",value:function(){if(!this._connected)return!1;window.ShadyDOM&&ShadyDOM.flush(),this._nativeChildrenObserver?this._processSlotMutations(this._nativeChildrenObserver.takeRecords()):this._shadyChildrenObserver&&this._processSlotMutations(this._shadyChildrenObserver.takeRecords()),this._scheduled=!1;for(var e,t={target:this._target,addedNodes:[],removedNodes:[]},n=this.constructor.getFlattenedNodes(this._target),r=Ht(n,this._effectiveNodes),i=0;i<r.length&&(e=r[i]);i++)for(var a,o=0;o<e.removed.length&&(a=e.removed[o]);o++)t.removedNodes.push(a);for(var s,l=0;l<r.length&&(s=r[l]);l++)for(var u=s.index;u<s.index+s.addedCount;u++)t.addedNodes.push(n[u]);this._effectiveNodes=n;var c=!1;return(t.addedNodes.length||t.removedNodes.length)&&(c=!0,this.callback.call(this._target,t)),c}},{key:"_listenSlots",value:function(e){for(var t=0;t<e.length;t++){var n=e[t];Jt(n)&&n.addEventListener("slotchange",this._boundSchedule)}}},{key:"_unlistenSlots",value:function(e){for(var t=0;t<e.length;t++){var n=e[t];Jt(n)&&n.removeEventListener("slotchange",this._boundSchedule)}}}])&&qt(e.prototype,t),n&&qt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),Kt=n(544);function $t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($t=function(){return!!e})()}function Qt(e){return Qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qt(e)}function en(e,t){return en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},en(e,t)}function tn(e){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tn(e)}function nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,on(r.key),r)}}function an(e,t,n){return t&&rn(e.prototype,t),n&&rn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function on(e){var t=function(e){if("object"!=tn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tn(t)?t:t+""}var sn=Element.prototype,ln=sn.matches||sn.matchesSelector||sn.mozMatchesSelector||sn.msMatchesSelector||sn.oMatchesSelector||sn.webkitMatchesSelector,un=function(e,t){return ln.call(e,t)},cn=function(){return an((function e(t){nn(this,e),window.ShadyDOM&&window.ShadyDOM.inUse&&window.ShadyDOM.patch(t),this.node=t}),[{key:"observeNodes",value:function(e){return new Zt(this.node,e)}},{key:"unobserveNodes",value:function(e){e.disconnect()}},{key:"notifyObserver",value:function(){}},{key:"deepContains",value:function(e){if((0,Pe.L)(this.node).contains(e))return!0;for(var t=e,n=e.ownerDocument;t&&t!==n&&t!==this.node;)t=(0,Pe.L)(t).parentNode||(0,Pe.L)(t).host;return t===this.node}},{key:"getOwnerRoot",value:function(){return(0,Pe.L)(this.node).getRootNode()}},{key:"getDistributedNodes",value:function(){return"slot"===this.node.localName?(0,Pe.L)(this.node).assignedNodes({flatten:!0}):[]}},{key:"getDestinationInsertionPoints",value:function(){for(var e=[],t=(0,Pe.L)(this.node).assignedSlot;t;)e.push(t),t=(0,Pe.L)(t).assignedSlot;return e}},{key:"importNode",value:function(e,t){var n=this.node instanceof Document?this.node:this.node.ownerDocument;return(0,Pe.L)(n).importNode(e,t)}},{key:"getEffectiveChildNodes",value:function(){return Zt.getFlattenedNodes(this.node)}},{key:"queryDistributedElements",value:function(e){for(var t,n=this.getEffectiveChildNodes(),r=[],i=0,a=n.length;i<a&&(t=n[i]);i++)t.nodeType===Node.ELEMENT_NODE&&un(t,e)&&r.push(t);return r}},{key:"activeElement",get:function(){var e=this.node;return void 0!==e._activeElement?e._activeElement:e.activeElement}}])}();function hn(e,t){for(var n=function(){var n=t[r];Object.defineProperty(e,n,{get:function(){return this.node[n]},configurable:!0})},r=0;r<t.length;r++)n()}var dn=function(){return an((function e(t){nn(this,e),this.event=t}),[{key:"rootTarget",get:function(){return this.path[0]}},{key:"localTarget",get:function(){return this.event.target}},{key:"path",get:function(){return this.event.composedPath()}}])}();cn.prototype.cloneNode,cn.prototype.appendChild,cn.prototype.insertBefore,cn.prototype.removeChild,cn.prototype.replaceChild,cn.prototype.setAttribute,cn.prototype.removeAttribute,cn.prototype.querySelector,cn.prototype.querySelectorAll,cn.prototype.parentNode,cn.prototype.firstChild,cn.prototype.lastChild,cn.prototype.nextSibling,cn.prototype.previousSibling,cn.prototype.firstElementChild,cn.prototype.lastElementChild,cn.prototype.nextElementSibling,cn.prototype.previousElementSibling,cn.prototype.childNodes,cn.prototype.children,cn.prototype.classList,cn.prototype.textContent,cn.prototype.innerHTML;var fn=cn;if(window.ShadyDOM&&window.ShadyDOM.inUse&&window.ShadyDOM.noPatch&&window.ShadyDOM.Wrapper){var pn=function(){function e(){return nn(this,e),t=this,r=arguments,n=Qt(n=e),function(e,t){if(t&&("object"==tn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,$t()?Reflect.construct(n,r||[],Qt(t).constructor):n.apply(t,r));var t,n,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&en(e,t)}(e,window.ShadyDOM.Wrapper),an(e)}();Object.getOwnPropertyNames(cn.prototype).forEach((function(e){"activeElement"!=e&&(pn.prototype[e]=cn.prototype[e])})),hn(pn.prototype,["classList"]),fn=pn,Object.defineProperties(dn.prototype,{localTarget:{get:function(){for(var e=this.event.currentTarget,t=e&&vn(e).getOwnerRoot(),n=this.path,r=0;r<n.length;r++){var i=n[r];if(vn(i).getOwnerRoot()===t)return i}},configurable:!0},path:{get:function(){return window.ShadyDOM.composedPath(this.event)},configurable:!0}})}else!function(e,t){for(var n=function(){var n=t[r];e[n]=function(){return this.node[n].apply(this.node,arguments)}},r=0;r<t.length;r++)n()}(cn.prototype,["cloneNode","appendChild","insertBefore","removeChild","replaceChild","setAttribute","removeAttribute","querySelector","querySelectorAll","attachShadow"]),hn(cn.prototype,["parentNode","firstChild","lastChild","nextSibling","previousSibling","firstElementChild","lastElementChild","nextElementSibling","previousElementSibling","childNodes","children","classList","shadowRoot"]),function(e,t){for(var n=function(){var n=t[r];Object.defineProperty(e,n,{get:function(){return this.node[n]},set:function(e){this.node[n]=e},configurable:!0})},r=0;r<t.length;r++)n()}(cn.prototype,["textContent","innerHTML","className"]);var vn=function(e){if((e=e||document)instanceof fn)return e;if(e instanceof dn)return e;var t=e.__domApi;return t||(t=e instanceof Event?new dn(e):new fn(e),e.__domApi=t),t},mn=n(8023),yn=window.ShadyDOM,gn=window.ShadyCSS;function _n(e,t){return(0,Pe.L)(e).getRootNode()===t}function bn(e){return bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bn(e)}function xn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sn(r.key),r)}}function Sn(e){var t=function(e){if("object"!=bn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bn(t)?t:t+""}function wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wn=function(){return!!e})()}function En(e,t,n,r){var i=Mn(Tn(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Mn(){return Mn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Tn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Mn.apply(null,arguments)}function Tn(e){return Tn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tn(e)}function Cn(e,t){return Cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cn(e,t)}var An="disable-upgrade",Pn=function(e){for(;e;){var t=Object.getOwnPropertyDescriptor(e,"observedAttributes");if(t)return t.get;e=Object.getPrototypeOf(e.prototype).constructor}return function(){return[]}},kn=((0,Me.y)((function(e){var t=(0,Ee.q2)(e),n=Pn(t);return function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Tn(t),function(e,t){if(t&&("object"==bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wn()?Reflect.construct(t,n||[],Tn(e).constructor):t.apply(e,n))}(this,t)).__isUpgradeDisabled,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cn(e,t)}(t,e),r=t,a=[{key:"observedAttributes",get:function(){return n.call(this).concat(An)}}],(i=[{key:"_initializeProperties",value:function(){this.hasAttribute(An)?this.__isUpgradeDisabled=!0:En(t,"_initializeProperties",this,3)([])}},{key:"_enableProperties",value:function(){this.__isUpgradeDisabled||En(t,"_enableProperties",this,3)([])}},{key:"_canApplyPropertyDefault",value:function(e){return En(t,"_canApplyPropertyDefault",this,3)([e])&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}},{key:"attributeChangedCallback",value:function(e,n,r,i){e==An?this.__isUpgradeDisabled&&null==r&&(En(t,"_initializeProperties",this,3)([]),this.__isUpgradeDisabled=!1,(0,Pe.L)(this).isConnected&&En(t,"connectedCallback",this,3)([])):En(t,"attributeChangedCallback",this,3)([e,n,r,i])}},{key:"connectedCallback",value:function(){this.__isUpgradeDisabled||En(t,"connectedCallback",this,3)([])}},{key:"disconnectedCallback",value:function(){this.__isUpgradeDisabled||En(t,"disconnectedCallback",this,3)([])}}])&&xn(r.prototype,i),a&&xn(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,a}(t)})),n(3261));function On(e){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},On(e)}function Rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function In(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Nn(r.key),r)}}function Nn(e){var t=function(e){if("object"!=On(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=On(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==On(t)?t:t+""}function Ln(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ln=function(){return!!e})()}function Dn(e,t,n,r){var i=Un(Fn(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Un(){return Un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Fn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Un.apply(null,arguments)}function Fn(e){return Fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fn(e)}function Bn(e,t){return Bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bn(e,t)}var zn="disable-upgrade",jn=window.ShadyCSS,Hn=(0,Me.y)((function(e){var t=gt((0,Ee.q2)(e)),n=Ee.IS?t:Ft(t),r=Pn(n),i={x:"pan-x",y:"pan-y",none:"none",all:"auto"},a=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Fn(t),function(e,t){if(t&&("object"==On(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ln()?Reflect.construct(t,n||[],Fn(e).constructor):t.apply(e,n))}(this,t)).isAttached,e.__boundListeners,e._debouncers,e.__isUpgradeDisabled,e.__needsAttributesAtConnected,e._legacyForceObservedAttributes,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bn(e,t)}(t,e),n=t,a=[{key:"created",value:function(){}},{key:"__attributeReaction",value:function(e,t,n){(this.__dataAttributes&&this.__dataAttributes[e]||e===zn)&&this.attributeChangedCallback(e,t,n,null)}},{key:"setAttribute",value:function(e,n){if(Ae.CE&&!this._legacyForceObservedAttributes){var r=this.getAttribute(e);Dn(t,"setAttribute",this,3)([e,n]),this.__attributeReaction(e,r,String(n))}else Dn(t,"setAttribute",this,3)([e,n])}},{key:"removeAttribute",value:function(e){if(Ae.CE&&!this._legacyForceObservedAttributes){var n=this.getAttribute(e);Dn(t,"removeAttribute",this,3)([e]),this.__attributeReaction(e,n,null)}else Dn(t,"removeAttribute",this,3)([e])}},{key:"_enableProperties",value:function(){this.__isUpgradeDisabled||Dn(t,"_enableProperties",this,3)([])}},{key:"_canApplyPropertyDefault",value:function(e){return Dn(t,"_canApplyPropertyDefault",this,3)([e])&&!(this.__isUpgradeDisabled&&this._isPropertyPending(e))}},{key:"connectedCallback",value:function(){this.__needsAttributesAtConnected&&this._takeAttributes(),this.__isUpgradeDisabled||(Dn(t,"connectedCallback",this,3)([]),this.isAttached=!0,this.attached())}},{key:"attached",value:function(){}},{key:"disconnectedCallback",value:function(){this.__isUpgradeDisabled||(Dn(t,"disconnectedCallback",this,3)([]),this.isAttached=!1,this.detached())}},{key:"detached",value:function(){}},{key:"attributeChangedCallback",value:function(e,n,r,i){n!==r&&(e==zn?this.__isUpgradeDisabled&&null==r&&(this._initializeProperties(),this.__isUpgradeDisabled=!1,(0,Pe.L)(this).isConnected&&this.connectedCallback()):(Dn(t,"attributeChangedCallback",this,3)([e,n,r,i]),this.attributeChanged(e,n,r)))}},{key:"attributeChanged",value:function(e,t,n){}},{key:"_initializeProperties",value:function(){if(Ae.IP&&this.hasAttribute(zn))this.__isUpgradeDisabled=!0;else{var e=Object.getPrototypeOf(this);e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))||(this._registered(),e.__hasRegisterFinished=!0),Dn(t,"_initializeProperties",this,3)([]),this.root=this,this.created(),Ae.CE&&!this._legacyForceObservedAttributes&&(this.hasAttributes()?this._takeAttributes():this.parentNode||(this.__needsAttributesAtConnected=!0)),this._applyListeners()}}},{key:"_takeAttributes",value:function(){for(var e=this.attributes,t=0,n=e.length;t<n;t++){var r=e[t];this.__attributeReaction(r.name,null,r.value)}}},{key:"_registered",value:function(){}},{key:"ready",value:function(){this._ensureAttributes(),Dn(t,"ready",this,3)([])}},{key:"_ensureAttributes",value:function(){}},{key:"_applyListeners",value:function(){}},{key:"serialize",value:function(e){return this._serializeValue(e)}},{key:"deserialize",value:function(e,t){return this._deserializeValue(e,t)}},{key:"reflectPropertyToAttribute",value:function(e,t,n){this._propertyToAttribute(e,t,n)}},{key:"serializeValueToAttribute",value:function(e,t,n){this._valueToNodeAttribute(n||this,e,t)}},{key:"extend",value:function(e,t){if(!e||!t)return e||t;for(var n,r=Object.getOwnPropertyNames(t),i=0;i<r.length&&(n=r[i]);i++){var a=Object.getOwnPropertyDescriptor(t,n);a&&Object.defineProperty(e,n,a)}return e}},{key:"mixin",value:function(e,t){for(var n in t)e[n]=t[n];return e}},{key:"chainObject",value:function(e,t){return e&&t&&e!==t&&(e.__proto__=t),e}},{key:"instanceTemplate",value:function(e){var t=this.constructor._contentForTemplate(e);return document.importNode(t,!0)}},{key:"fire",value:function(e,t,n){n=n||{},t=null==t?{}:t;var r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});r.detail=t;var i=n.node||this;return(0,Pe.L)(i).dispatchEvent(r),r}},{key:"listen",value:function(e,t,n){e=e||this;var r=this.__boundListeners||(this.__boundListeners=new WeakMap),i=r.get(e);i||(i={},r.set(e,i));var a=t+n;i[a]||(i[a]=this._addMethodEventListenerToNode(e,t,n,this))}},{key:"unlisten",value:function(e,t,n){e=e||this;var r=this.__boundListeners&&this.__boundListeners.get(e),i=t+n,a=r&&r[i];a&&(this._removeEventListenerFromNode(e,t,a),r[i]=null)}},{key:"setScrollDirection",value:function(e,t){rt(t||this,i[e]||"auto")}},{key:"$$",value:function(e){return this.root.querySelector(e)}},{key:"domHost",get:function(){var e=(0,Pe.L)(this).getRootNode();return e instanceof DocumentFragment?e.host:e}},{key:"distributeContent",value:function(){var e=vn(this);window.ShadyDOM&&e.shadowRoot&&ShadyDOM.flush()}},{key:"getEffectiveChildNodes",value:function(){return vn(this).getEffectiveChildNodes()}},{key:"queryDistributedElements",value:function(e){return vn(this).queryDistributedElements(e)}},{key:"getEffectiveChildren",value:function(){return this.getEffectiveChildNodes().filter((function(e){return e.nodeType===Node.ELEMENT_NODE}))}},{key:"getEffectiveTextContent",value:function(){for(var e,t=this.getEffectiveChildNodes(),n=[],r=0;e=t[r];r++)e.nodeType!==Node.COMMENT_NODE&&n.push(e.textContent);return n.join("")}},{key:"queryEffectiveChildren",value:function(e){var t=this.queryDistributedElements(e);return t&&t[0]}},{key:"queryAllEffectiveChildren",value:function(e){return this.queryDistributedElements(e)}},{key:"getContentChildNodes",value:function(e){var t=this.root.querySelector(e||"slot");return t?vn(t).getDistributedNodes():[]}},{key:"getContentChildren",value:function(e){return this.getContentChildNodes(e).filter((function(e){return e.nodeType===Node.ELEMENT_NODE}))}},{key:"isLightDescendant",value:function(e){var t=this;return t!==e&&(0,Pe.L)(t).contains(e)&&(0,Pe.L)(t).getRootNode()===(0,Pe.L)(e).getRootNode()}},{key:"isLocalDescendant",value:function(e){return this.root===(0,Pe.L)(e).getRootNode()}},{key:"scopeSubtree",value:function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!yn||!gn)return null;if(!yn.handlesDynamicScoping)return null;var n=gn.ScopingShim;if(!n)return null;var r=n.scopeForNode(e),i=(0,Pe.L)(e).getRootNode(),a=function(e){if(_n(e,i)){var t=Array.from(yn.nativeMethods.querySelectorAll.call(e,"*"));t.push(e);for(var a=0;a<t.length;a++){var o=t[a];if(_n(o,i)){var s=n.currentScopeForNode(o);s!==r&&(""!==s&&n.unscopeNode(o,s),n.scopeNode(o,r))}}}};if(a(e),t){var o=new MutationObserver((function(e){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<n.addedNodes.length;r++){var i=n.addedNodes[r];i.nodeType===Node.ELEMENT_NODE&&a(i)}}));return o.observe(e,{childList:!0,subtree:!0}),o}return null}(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1])}},{key:"getComputedStyleValue",value:function(e){return jn.getComputedStyleValue(this,e)}},{key:"debounce",value:function(e,t,n){return this._debouncers=this._debouncers||{},this._debouncers[e]=Ce.aq.debounce(this._debouncers[e],n>0?Te.EV.after(n):Te._3,t.bind(this))}},{key:"isDebouncerActive",value:function(e){this._debouncers=this._debouncers||{};var t=this._debouncers[e];return!(!t||!t.isActive())}},{key:"flushDebouncer",value:function(e){this._debouncers=this._debouncers||{};var t=this._debouncers[e];t&&t.flush()}},{key:"cancelDebouncer",value:function(e){this._debouncers=this._debouncers||{};var t=this._debouncers[e];t&&t.cancel()}},{key:"async",value:function(e,t){return t>0?Te.EV.run(e.bind(this),t):~Te._3.run(e.bind(this))}},{key:"cancelAsync",value:function(e){e<0?Te._3.cancel(~e):Te.EV.cancel(e)}},{key:"create",value:function(e,t){var n=document.createElement(e);if(t)if(n.setProperties)n.setProperties(t);else for(var r in t)n[r]=t[r];return n}},{key:"elementMatches",value:function(e,t){return un(t||this,e)}},{key:"toggleAttribute",value:function(e,t){var n=this;return 3===arguments.length&&(n=arguments[2]),1==arguments.length&&(t=!n.hasAttribute(e)),t?((0,Pe.L)(n).setAttribute(e,""),!0):((0,Pe.L)(n).removeAttribute(e),!1)}},{key:"toggleClass",value:function(e,t,n){n=n||this,1==arguments.length&&(t=!n.classList.contains(e)),t?n.classList.add(e):n.classList.remove(e)}},{key:"transform",value:function(e,t){(t=t||this).style.webkitTransform=e,t.style.transform=e}},{key:"translate3d",value:function(e,t,n,r){r=r||this,this.transform("translate3d("+e+","+t+","+n+")",r)}},{key:"arrayDelete",value:function(e,t){var n;if(Array.isArray(e)){if((n=e.indexOf(t))>=0)return e.splice(n,1)}else if((n=(0,mn.Jt)(this,e).indexOf(t))>=0)return this.splice(e,n,1);return null}},{key:"_logger",value:function(e,t){var n;switch(Array.isArray(t)&&1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"error":(n=console)[e].apply(n,function(e){return function(e){if(Array.isArray(e))return Rn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Rn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t))}}},{key:"_log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._logger("log",t)}},{key:"_warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._logger("warn",t)}},{key:"_error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._logger("error",t)}},{key:"_logf",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return["[%s::%s]",this.is,e].concat(n)}}],o=[{key:"importMeta",get:function(){return this.prototype.importMeta}},{key:"observedAttributes",get:function(){return Ae.CE&&!this.prototype._legacyForceObservedAttributes?(this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))||(this.__observedAttributes=[],(0,kn.kz)(this.prototype)),this.__observedAttributes):r.call(this).concat(zn)}}],a&&In(n.prototype,a),o&&In(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,o}(n);return a.prototype.is="",a}));function Vn(e){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vn(e)}function Gn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Wn(r.key),r)}}function Wn(e){var t=function(e){if("object"!=Vn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Vn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vn(t)?t:t+""}function Xn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xn=function(){return!!e})()}function qn(e,t,n,r){var i=Yn(Jn(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Yn(){return Yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Jn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Yn.apply(null,arguments)}function Jn(e){return Jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jn(e)}function Zn(e,t){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zn(e,t)}var Kn={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,listeners:!0,hostAttributes:!0},$n={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,behaviors:!0,_noAccessors:!0},Qn=Object.assign({listeners:!0,hostAttributes:!0,properties:!0,observers:!0},$n);function er(e,t,n,r){for(var i in function(e,t,n){for(var r=e._noAccessors,i=Object.getOwnPropertyNames(e),a=0;a<i.length;a++){var o=i[a];if(!(o in n))if(r)t[o]=e[o];else{var s=Object.getOwnPropertyDescriptor(e,o);s&&(s.configurable=!0,Object.defineProperty(t,o,s))}}}(t,e,r),Kn)t[i]&&(n[i]=n[i]||[],n[i].push(t[i]))}function tr(e,t,n){t=t||[];for(var r=e.length-1;r>=0;r--){var i=e[r];i?Array.isArray(i)?tr(i,t):t.indexOf(i)<0&&(!n||n.indexOf(i)<0)&&t.unshift(i):console.warn("behavior is null, check for missing or 404 import")}return t}function nr(e,t){for(var n in t){var r=e[n],i=t[n];e[n]=!("value"in i)&&r&&"value"in r?Object.assign({value:r.value},i):i}}var rr=Hn(HTMLElement);function ir(e,t,n){var r,i={},a=function(n){function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),function(e,t,n){return t=Jn(t),function(e,t){if(t&&("object"==Vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Xn()?Reflect.construct(t,n||[],Jn(e).constructor):t.apply(e,n))}(this,a,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zn(e,t)}(a,n),o=a,u=[{key:"_finalizeClass",value:function(){if(this.hasOwnProperty(JSCompiler_renameProperty("generatedFrom",this))){if(r)for(var n,i=0;i<r.length;i++)(n=r[i]).properties&&this.createProperties(n.properties),n.observers&&this.createObservers(n.observers,n.properties);e.properties&&this.createProperties(e.properties),e.observers&&this.createObservers(e.observers,e.properties),this._prepareTemplate()}else t._finalizeClass.call(this)}},{key:"properties",get:function(){var t={};if(r)for(var n=0;n<r.length;n++)nr(t,r[n].properties);return nr(t,e.properties),t}},{key:"observers",get:function(){var t=[];if(r)for(var n,i=0;i<r.length;i++)(n=r[i]).observers&&(t=t.concat(n.observers));return e.observers&&(t=t.concat(e.observers)),t}}],(l=[{key:"created",value:function(){qn(a,"created",this,3)([]);var e=i.created;if(e)for(var t=0;t<e.length;t++)e[t].call(this)}},{key:"_registered",value:function(){var e=a.prototype;if(!e.hasOwnProperty(JSCompiler_renameProperty("__hasRegisterFinished",e))){e.__hasRegisterFinished=!0,qn(a,"_registered",this,3)([]),Ae.IP&&s(e);var t=Object.getPrototypeOf(this),n=i.beforeRegister;if(n)for(var r=0;r<n.length;r++)n[r].call(t);if(n=i.registered)for(var o=0;o<n.length;o++)n[o].call(t)}}},{key:"_applyListeners",value:function(){qn(a,"_applyListeners",this,3)([]);var e=i.listeners;if(e)for(var t=0;t<e.length;t++){var n=e[t];if(n)for(var r in n)this._addMethodEventListenerToNode(this,r,n[r])}}},{key:"_ensureAttributes",value:function(){var e=i.hostAttributes;if(e)for(var t=e.length-1;t>=0;t--){var n=e[t];for(var r in n)this._ensureAttribute(r,n[r])}qn(a,"_ensureAttributes",this,3)([])}},{key:"ready",value:function(){qn(a,"ready",this,3)([]);var e=i.ready;if(e)for(var t=0;t<e.length;t++)e[t].call(this)}},{key:"attached",value:function(){qn(a,"attached",this,3)([]);var e=i.attached;if(e)for(var t=0;t<e.length;t++)e[t].call(this)}},{key:"detached",value:function(){qn(a,"detached",this,3)([]);var e=i.detached;if(e)for(var t=0;t<e.length;t++)e[t].call(this)}},{key:"attributeChanged",value:function(e,t,n){qn(a,"attributeChanged",this,3)([]);var r=i.attributeChanged;if(r)for(var o=0;o<r.length;o++)r[o].call(this,e,t,n)}}])&&Gn(o.prototype,l),u&&Gn(o,u),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,l,u}(t);if(n){Array.isArray(n)||(n=[n]);var o=t.prototype.behaviors;r=tr(n,null,o),a.prototype.behaviors=o?o.concat(n):r}var s=function(t){r&&function(e,t,n){for(var r=0;r<t.length;r++)er(e,t[r],n,Qn)}(t,r,i),er(t,e,i,$n)};return Ae.IP||s(a.prototype),a.generatedFrom=e,a}var ar=function(e){var t;return t="function"==typeof e?e:ar.Class(e),e._legacyForceObservedAttributes&&(t.prototype._legacyForceObservedAttributes=e._legacyForceObservedAttributes),customElements.define(t.is,t),t};ar.Class=function(e,t){e||console.warn("Polymer.Class requires `info` argument");var n=t?t(rr):rr;return(n=ir(e,n,e.behaviors)).is=n.prototype.is=e.is,n};var or=n(947),sr=n(3764),lr=n(7550),ur=n(7922);function cr(e){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cr(e)}function hr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,dr(r.key),r)}}function dr(e){var t=function(e){if("object"!=cr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cr(t)?t:t+""}function fr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fr=function(){return!!e})()}function pr(e){return pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pr(e)}function vr(e,t){return vr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vr(e,t)}var mr=function(e){function t(){var e;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t,n){return t=pr(t),function(e,t){if(t&&("object"==cr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fr()?Reflect.construct(t,n||[],pr(e).constructor):t.apply(e,n))}(this,t),Ae.yu)throw new Error("strictTemplatePolicy: dom-bind not allowed");return e.root=null,e.$=null,e.__children=null,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vr(e,t)}(t,e),n=t,r=[{key:"attributeChangedCallback",value:function(e,t,n,r){this.mutableData=!0}},{key:"connectedCallback",value:function(){(0,ur.I)()||(this.style.display="none"),this.render()}},{key:"disconnectedCallback",value:function(){this.__removeChildren()}},{key:"__insertChildren",value:function(){(0,Pe.L)((0,Pe.L)(this).parentNode).insertBefore(this.root,this)}},{key:"__removeChildren",value:function(){if(this.__children)for(var e=0;e<this.__children.length;e++)this.root.appendChild(this.__children[e])}},{key:"render",value:function(){var e,t=this;if(!this.__children){if(!(e=e||this.querySelector("template"))){var n=new MutationObserver((function(){if(!(e=t.querySelector("template")))throw new Error("dom-bind requires a <template> child");n.disconnect(),t.render()}));return void n.observe(this,{childList:!0})}this.root=this._stampTemplate(e),this.$=this.root.$,this.__children=[];for(var r=this.root.firstChild;r;r=r.nextSibling)this.__children[this.__children.length]=r;this._enableProperties()}this.__insertChildren(),this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}}],i=[{key:"observedAttributes",get:function(){return["mutable-data"]}}],r&&hr(n.prototype,r),i&&hr(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(gt((0,lr.j)((0,sr.s)(HTMLElement))));function yr(e){return yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yr(e)}function gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xr(r.key),r)}}function br(e,t,n){return t&&_r(e.prototype,t),n&&_r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xr(e){var t=function(e){if("object"!=yr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=yr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yr(t)?t:t+""}function Sr(e,t,n){return t=Tr(t),function(e,t){if(t&&("object"==yr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wr()?Reflect.construct(t,n||[],Tr(e).constructor):t.apply(e,n))}function wr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wr=function(){return!!e})()}function Er(e,t,n,r){var i=Mr(Tr(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Mr(){return Mr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Tr(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Mr.apply(null,arguments)}function Tr(e){return Tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tr(e)}function Cr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ar(e,t)}function Ar(e,t){return Ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ar(e,t)}customElements.define("dom-bind",mr),n(4414);var Pr=function(e){function t(){var e;return gr(this,t),(e=Sr(this,t)).__renderDebouncer=null,e._lastIf=!1,e.__hideTemplateChildren__=!1,e.__template,e._templateInfo,e}return Cr(t,e),br(t,[{key:"__debounceRender",value:function(){var e=this;this.__renderDebouncer=Ce.aq.debounce(this.__renderDebouncer,Te._3,(function(){return e.__render()})),(0,Kt.O)(this.__renderDebouncer)}},{key:"disconnectedCallback",value:function(){Er(t,"disconnectedCallback",this,3)([]);var e=(0,Pe.L)(this).parentNode;e&&(e.nodeType!=Node.DOCUMENT_FRAGMENT_NODE||(0,Pe.L)(e).host)||this.__teardownInstance()}},{key:"connectedCallback",value:function(){Er(t,"connectedCallback",this,3)([]),(0,ur.I)()||(this.style.display="none"),this.if&&this.__debounceRender()}},{key:"__ensureTemplate",value:function(){var e=this;if(!this.__template){var t=this,n=t._templateInfo?t:(0,Pe.L)(t).querySelector("template");if(!n){var r=new MutationObserver((function(){if(!(0,Pe.L)(e).querySelector("template"))throw new Error("dom-if requires a <template> child");r.disconnect(),e.__render()}));return r.observe(this,{childList:!0}),!1}this.__template=n}return!0}},{key:"__ensureInstance",value:function(){var e=(0,Pe.L)(this).parentNode;if(this.__hasInstance()){var t=this.__getInstanceNodes();if(t&&t.length&&(0,Pe.L)(this).previousSibling!==t[t.length-1])for(var n,r=0;r<t.length&&(n=t[r]);r++)(0,Pe.L)(e).insertBefore(n,this)}else{if(!e)return!1;if(!this.__ensureTemplate())return!1;this.__createAndInsertInstance(e)}return!0}},{key:"render",value:function(){(0,Kt.b)()}},{key:"__render",value:function(){if(this.if){if(!this.__ensureInstance())return}else this.restamp&&this.__teardownInstance();this._showHideChildren(),Ae.w9&&!this.notifyDomChange||this.if==this._lastIf||(this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0})),this._lastIf=this.if)}},{key:"__hasInstance",value:function(){}},{key:"__getInstanceNodes",value:function(){}},{key:"__createAndInsertInstance",value:function(e){}},{key:"__teardownInstance",value:function(){}},{key:"_showHideChildren",value:function(){}}],[{key:"is",get:function(){return"dom-if"}},{key:"template",get:function(){return null}},{key:"properties",get:function(){return{if:{type:Boolean,observer:"__debounceRender"},restamp:{type:Boolean,observer:"__debounceRender"},notifyDomChange:{type:Boolean}}}}])}(a.Pu),kr=function(e){function t(){var e;return gr(this,t),(e=Sr(this,t)).__instance=null,e.__syncInfo=null,e}return Cr(t,e),br(t,[{key:"__hasInstance",value:function(){return Boolean(this.__instance)}},{key:"__getInstanceNodes",value:function(){return this.__instance.templateInfo.childNodes}},{key:"__createAndInsertInstance",value:function(e){var t=this,n=this.__dataHost||this;if(Ae.yu&&!this.__dataHost)throw new Error("strictTemplatePolicy: template owner not trusted");var r=n._bindTemplate(this.__template,!0);r.runEffects=function(e,n,r){var i=t.__syncInfo;if(t.if)i&&(t.__syncInfo=null,t._showHideChildren(),n=Object.assign(i.changedProps,n)),e(n,r);else if(t.__instance)if(i||(i=t.__syncInfo={runEffects:e,changedProps:{}}),r)for(var a in n){var o=(0,mn.zr)(a);i.changedProps[o]=t.__dataHost[o]}else Object.assign(i.changedProps,n)},this.__instance=n._stampTemplate(this.__template,r),(0,Pe.L)(e).insertBefore(this.__instance,this)}},{key:"__syncHostProperties",value:function(){var e=this.__syncInfo;e&&(this.__syncInfo=null,e.runEffects(e.changedProps,!1))}},{key:"__teardownInstance",value:function(){var e=this.__dataHost||this;this.__instance&&(e._removeBoundDom(this.__instance),this.__instance=null,this.__syncInfo=null)}},{key:"_showHideChildren",value:function(){var e=this.__hideTemplateChildren__||!this.if;this.__instance&&Boolean(this.__instance.__hidden)!==e&&(this.__instance.__hidden=e,(0,or.$k)(e,this.__instance.templateInfo.childNodes)),e||this.__syncHostProperties()}}])}(Pr),Or=function(e){function t(){var e;return gr(this,t),(e=Sr(this,t)).__ctor=null,e.__instance=null,e.__invalidProps=null,e}return Cr(t,e),br(t,[{key:"__hasInstance",value:function(){return Boolean(this.__instance)}},{key:"__getInstanceNodes",value:function(){return this.__instance.children}},{key:"__createAndInsertInstance",value:function(e){this.__ctor||(this.__ctor=(0,or.sm)(this.__template,this,{mutableData:!0,forwardHostProp:function(e,t){this.__instance&&(this.if?this.__instance.forwardHostProp(e,t):(this.__invalidProps=this.__invalidProps||Object.create(null),this.__invalidProps[(0,mn.zr)(e)]=!0))}})),this.__instance=new this.__ctor,(0,Pe.L)(e).insertBefore(this.__instance.root,this)}},{key:"__teardownInstance",value:function(){if(this.__instance){var e=this.__instance.children;if(e&&e.length){var t=(0,Pe.L)(e[0]).parentNode;if(t){t=(0,Pe.L)(t);for(var n,r=0;r<e.length&&(n=e[r]);r++)t.removeChild(n)}}this.__invalidProps=null,this.__instance=null}}},{key:"__syncHostProperties",value:function(){var e=this.__invalidProps;if(e){for(var t in this.__invalidProps=null,e)this.__instance._setPendingProperty(t,this.__dataHost[t]);this.__instance._flushProperties()}}},{key:"_showHideChildren",value:function(){var e=this.__hideTemplateChildren__||!this.if;this.__instance&&Boolean(this.__instance.__hidden)!==e&&(this.__instance.__hidden=e,this.__instance._showHideChildren(e)),e||this.__syncHostProperties()}}])}(Pr),Rr=Ae.s?kr:Or;function Ir(e){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ir(e)}function Nr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ur(r.key),r)}}function Dr(e,t,n){return t&&Lr(e.prototype,t),n&&Lr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ur(e){var t=function(e){if("object"!=Ir(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ir(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ir(t)?t:t+""}function Fr(e,t,n){return t=zr(t),function(e,t){if(t&&("object"==Ir(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Br()?Reflect.construct(t,n||[],zr(e).constructor):t.apply(e,n))}function Br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Br=function(){return!!e})()}function zr(e){return zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zr(e)}function jr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hr(e,t)}function Hr(e,t){return Hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hr(e,t)}customElements.define(Rr.is,Rr);var Vr=(0,Me.y)((function(e){var t=function(e){function t(){var e;return Nr(this,t),(e=Fr(this,t)).__lastItems=null,e.__lastMulti=null,e.__selectedMap=null,e}return jr(t,e),Dr(t,[{key:"__updateSelection",value:function(e,t){var n=t.path;if(n==JSCompiler_renameProperty("items",this)){var r=t.base||[],i=this.__lastItems;if(e!==this.__lastMulti&&this.clearSelection(),i){var a=Ht(r,i);this.__applySplices(a)}this.__lastItems=r,this.__lastMulti=e}else if(t.path=="".concat(JSCompiler_renameProperty("items",this),".splices"))this.__applySplices(t.value.indexSplices);else{var o=n.slice("".concat(JSCompiler_renameProperty("items",this),".").length),s=parseInt(o,10);o.indexOf(".")<0&&o==s&&this.__deselectChangedIdx(s)}}},{key:"__applySplices",value:function(e){for(var t=this,n=this.__selectedMap,r=function(){var r=e[i];n.forEach((function(e,t){e<r.index||(e>=r.index+r.removed.length?n.set(t,e+r.addedCount-r.removed.length):n.set(t,-1))}));for(var a=0;a<r.addedCount;a++){var o=r.index+a;n.has(t.items[o])&&n.set(t.items[o],o)}},i=0;i<e.length;i++)r();this.__updateLinks();var a=0;n.forEach((function(e,r){e<0?(t.multi?t.splice(JSCompiler_renameProperty("selected",t),a,1):t.selected=t.selectedItem=null,n.delete(r)):a++}))}},{key:"__updateLinks",value:function(){var e=this;if(this.__dataLinkedPaths={},this.multi){var t=0;this.__selectedMap.forEach((function(n){n>=0&&e.linkPaths("".concat(JSCompiler_renameProperty("items",e),".").concat(n),"".concat(JSCompiler_renameProperty("selected",e),".").concat(t++))}))}else this.__selectedMap.forEach((function(t){e.linkPaths(JSCompiler_renameProperty("selected",e),"".concat(JSCompiler_renameProperty("items",e),".").concat(t)),e.linkPaths(JSCompiler_renameProperty("selectedItem",e),"".concat(JSCompiler_renameProperty("items",e),".").concat(t))}))}},{key:"clearSelection",value:function(){this.__dataLinkedPaths={},this.__selectedMap=new Map,this.selected=this.multi?[]:null,this.selectedItem=null}},{key:"isSelected",value:function(e){return this.__selectedMap.has(e)}},{key:"isIndexSelected",value:function(e){return this.isSelected(this.items[e])}},{key:"__deselectChangedIdx",value:function(e){var t=this,n=this.__selectedIndexForItemIndex(e);if(n>=0){var r=0;this.__selectedMap.forEach((function(e,i){n==r++&&t.deselect(i)}))}}},{key:"__selectedIndexForItemIndex",value:function(e){var t=this.__dataLinkedPaths["".concat(JSCompiler_renameProperty("items",this),".").concat(e)];if(t)return parseInt(t.slice("".concat(JSCompiler_renameProperty("selected",this),".").length),10)}},{key:"deselect",value:function(e){var t,n=this.__selectedMap.get(e);n>=0&&(this.__selectedMap.delete(e),this.multi&&(t=this.__selectedIndexForItemIndex(n)),this.__updateLinks(),this.multi?this.splice(JSCompiler_renameProperty("selected",this),t,1):this.selected=this.selectedItem=null)}},{key:"deselectIndex",value:function(e){this.deselect(this.items[e])}},{key:"select",value:function(e){this.selectIndex(this.items.indexOf(e))}},{key:"selectIndex",value:function(e){var t=this.items[e];this.isSelected(t)?this.toggle&&this.deselectIndex(e):(this.multi||this.__selectedMap.clear(),this.__selectedMap.set(t,e),this.__updateLinks(),this.multi?this.push(JSCompiler_renameProperty("selected",this),t):this.selected=this.selectedItem=t)}}],[{key:"properties",get:function(){return{items:{type:Array},multi:{type:Boolean,value:!1},selected:{type:Object,notify:!0},selectedItem:{type:Object,notify:!0},toggle:{type:Boolean,value:!1}}}},{key:"observers",get:function(){return["__updateSelection(multi, items.*)"]}}])}((0,Ee.q2)(e));return t})),Gr=function(e){function t(){return Nr(this,t),Fr(this,t,arguments)}return jr(t,e),Dr(t,null,[{key:"is",get:function(){return"array-selector"}},{key:"template",get:function(){return null}}])}(Vr(a.Pu));customElements.define(Gr.is,Gr);var Wr=new me;window.ShadyCSS||(window.ShadyCSS={prepareTemplate:function(e,t,n){},prepareTemplateDom:function(e,t){},prepareTemplateStyles:function(e,t,n){},styleSubtree:function(e,t){Wr.processStyles(),U(e,t)},styleElement:function(e){Wr.processStyles()},styleDocument:function(e){Wr.processStyles(),U(document.body,e)},getComputedStyleValue:function(e,t){return F(e,t)},flushCustomStyles:function(){},nativeCss:u,nativeShadow:o,cssBuild:i,disableRuntime:l}),window.ShadyCSS.CustomStyleInterface=Wr;var Xr=n(9507);function qr(e){return qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qr(e)}function Yr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Jr(r.key),r)}}function Jr(e){var t=function(e){if("object"!=qr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=qr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qr(t)?t:t+""}function Zr(e){var t="function"==typeof Map?new Map:void 0;return Zr=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Kr())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&$r(i,n.prototype),i}(e,arguments,Qr(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),$r(n,e)},Zr(e)}function Kr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kr=function(){return!!e})()}function $r(e,t){return $r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$r(e,t)}function Qr(e){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qr(e)}var ei="include",ti=window.ShadyCSS.CustomStyleInterface,ni=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Qr(t),function(e,t){if(t&&("object"==qr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Kr()?Reflect.construct(t,n||[],Qr(e).constructor):t.apply(e,n))}(this,t))._style=null,ti.addCustomStyle(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$r(e,t)}(t,e),n=t,(r=[{key:"getStyle",value:function(){if(this._style)return this._style;var e=this.querySelector("style");if(!e)return null;this._style=e;var t=e.getAttribute(ei);return t&&(e.removeAttribute(ei),e.textContent=(0,Xr.Vg)(t)+e.textContent),this.ownerDocument!==window.document&&window.document.head.appendChild(this),this._style}}])&&Yr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Zr(HTMLElement));window.customElements.define("custom-style",ni),lr.H._mutablePropertyChange,Boolean,n(4152),Hn(HTMLElement).prototype;var ri=new Set,ii={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[],this._boundNotifyResize=this.notifyResize.bind(this),this._boundOnDescendantIronResize=this._onDescendantIronResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):(ri.delete(this),window.removeEventListener("resize",this._boundNotifyResize)),this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach((function(e){this.resizerShouldNotify(e)&&this._notifyDescendant(e)}),this),this._fireResize())},assignParentResizable:function(e){this._parentResizable&&this._parentResizable.stopResizeNotificationsFor(this),this._parentResizable=e,e&&-1===e._interestedResizables.indexOf(this)&&(e._interestedResizables.push(this),e._subscribeIronResize(this))},stopResizeNotificationsFor:function(e){var t=this._interestedResizables.indexOf(e);t>-1&&(this._interestedResizables.splice(t,1),this._unsubscribeIronResize(e))},_subscribeIronResize:function(e){e.addEventListener("iron-resize",this._boundOnDescendantIronResize)},_unsubscribeIronResize:function(e){e.removeEventListener("iron-resize",this._boundOnDescendantIronResize)},resizerShouldNotify:function(e){return!0},_onDescendantIronResize:function(e){this._notifyingDescendant?e.stopPropagation():Ae.sv||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(e){var t=vn(e).rootTarget;t!==this&&(t.assignParentResizable(this),this._notifyDescendant(t),e.stopPropagation())},_parentResizableChanged:function(e){e&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(e){this.isAttached&&(this._notifyingDescendant=!0,e.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var e=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",(function t(){document.removeEventListener("readystatechange",t),e()}))}else this._findParent(),this._parentResizable?this._parentResizable._interestedResizables.forEach((function(e){e!==this&&e._findParent()}),this):(ri.forEach((function(e){e!==this&&e._findParent()}),this),window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())},_findParent:function(){this.assignParentResizable(null),this.fire("iron-request-resize-notifications",null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable?ri.delete(this):ri.add(this)}};function ai(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function oi(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){ai(a,r,i,o,s,"next",e)}function s(e){ai(a,r,i,o,s,"throw",e)}o(void 0)}))}}function si(e){var t="function"==typeof Map?new Map:void 0;return si=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(gi())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&xi(i,n.prototype),i}(e,arguments,_i(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),xi(n,e)},si(e)}function li(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=vi(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ui(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||vi(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ci(e,t,n,r){var i=hi(_i(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function hi(){return hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_i(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},hi.apply(null,arguments)}function di(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?di(Object(n),!0).forEach((function(t){Si(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):di(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pi(e){return function(e){if(Array.isArray(e))return mi(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||vi(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vi(e,t){if(e){if("string"==typeof e)return mi(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mi(e,t):void 0}}function mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yi(e,t,n){return t=_i(t),function(e,t){if(t&&("object"==Mi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,gi()?Reflect.construct(t,n||[],_i(e).constructor):t.apply(e,n))}function gi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gi=function(){return!!e})()}function _i(e){return _i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_i(e)}function bi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xi(e,t)}function xi(e,t){return xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xi(e,t)}function Si(e,t,n){return(t=Pi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wi(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return Ei(u,"_invoke",function(n,r,i){var a,s,l,u=0,c=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,s=0,l=e,d.n=n,o}};function f(n,r){for(s=n,l=r,t=0;!h&&u&&!i&&t<c.length;t++){var i,a=c[t],f=d.p,p=a[2];n>3?(i=p===r)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=f&&((i=n<2&&f<a[1])?(s=0,d.v=r,d.n=a[1]):f<p&&(i=n<3||a[0]>r||r>p)&&(a[4]=n,a[5]=r,d.n=p,s=0))}if(i||n>1)return o;throw h=!0,r}return function(i,c,p){if(u>1)throw TypeError("Generator is already running");for(h&&1===c&&f(c,p),s=c,l=p;(t=s<2?e:l)||!h;){a||(s?s<3?(s>1&&(d.n=-1),f(s,l)):d.n=l:d.v=l);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==o)break}catch(t){a=e,s=1,l=t}finally{u=1}}return{value:t,done:h}}}(n,i,a),!0),u}var o={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Ei(t={},r,(function(){return this})),t),h=u.prototype=s.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ei(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=u,Ei(h,"constructor",u),Ei(u,"constructor",l),l.displayName="GeneratorFunction",Ei(u,i,"GeneratorFunction"),Ei(h),Ei(h,i,"Generator"),Ei(h,r,(function(){return this})),Ei(h,"toString",(function(){return"[object Generator]"})),(wi=function(){return{w:a,m:d}})()}function Ei(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}Ei=function(e,t,n,r){function a(t,n){Ei(e,t,(function(e){return this._invoke(t,n,e)}))}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},Ei(e,t,n,r)}function Mi(e){return Mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(e)}function Ti(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ci(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Pi(r.key),r)}}function Ai(e,t,n){return t&&Ci(e.prototype,t),n&&Ci(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pi(e){var t=function(e){if("object"!=Mi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mi(t)?t:t+""}var ki="180",Oi={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ri=100,Ii="attached",Ni=301,Li=302,Di=303,Ui=304,Fi=306,Bi=1e3,zi=1001,ji=1002,Hi=1003,Vi=1005,Gi=1006,Wi=1007,Xi=1008,qi=1009,Yi=1012,Ji=1013,Zi=1014,Ki=1015,$i=1016,Qi=1017,ea=1018,ta=1020,na=1023,ra=1026,ia=1027,aa=1028,oa=1029,sa=1031,la=1033,ua=33776,ca=33777,ha=33778,da=33779,fa=35840,pa=35841,va=35842,ma=35843,ya=36196,ga=37492,_a=37496,ba=37808,xa=37809,Sa=37810,wa=37811,Ea=37812,Ma=37813,Ta=37814,Ca=37815,Aa=37816,Pa=37817,ka=37818,Oa=37819,Ra=37820,Ia=37821,Na=36492,La=36494,Da=36495,Ua=36283,Fa=36284,Ba=36285,za=36286,ja=2300,Ha=2301,Va=2302,Ga=2400,Wa=2401,Xa=2402,qa="",Ya="srgb",Ja="srgb-linear",Za="linear",Ka="srgb",$a=7680,Qa=35044,eo="300 es",to=2e3,no=2001,ro=function(){return Ai((function e(){Ti(this,e)}),[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}},{key:"hasEventListener",value:function(e,t){var n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){var n=this._listeners;if(void 0!==n){var r=n[e];if(void 0!==r){var i=r.indexOf(t);-1!==i&&r.splice(i,1)}}}},{key:"dispatchEvent",value:function(e){var t=this._listeners;if(void 0!==t){var n=t[e.type];if(void 0!==n){e.target=this;for(var r=n.slice(0),i=0,a=r.length;i<a;i++)r[i].call(this,e);e.target=null}}}}])}(),io=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],ao=1234567,oo=Math.PI/180,so=180/Math.PI;function lo(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(io[255&e]+io[e>>8&255]+io[e>>16&255]+io[e>>24&255]+"-"+io[255&t]+io[t>>8&255]+"-"+io[t>>16&15|64]+io[t>>24&255]+"-"+io[63&n|128]+io[n>>8&255]+"-"+io[n>>16&255]+io[n>>24&255]+io[255&r]+io[r>>8&255]+io[r>>16&255]+io[r>>24&255]).toLowerCase()}function uo(e,t,n){return Math.max(t,Math.min(n,e))}function co(e,t){return(e%t+t)%t}function ho(e,t,n){return(1-n)*e+n*t}function fo(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function po(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}var vo={DEG2RAD:oo,RAD2DEG:so,generateUUID:lo,clamp:uo,euclideanModulo:co,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:ho,damp:function(e,t,n,r){return ho(e,t,1-Math.exp(-n*r))},pingpong:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(co(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(ao=e);var t=ao+=1831565813;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*oo},radToDeg:function(e){return e*so},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),u=a((t+r)/2),c=o((t+r)/2),h=a((t-r)/2),d=o((t-r)/2),f=a((r-t)/2),p=o((r-t)/2);switch(i){case"XYX":e.set(s*c,l*h,l*d,s*u);break;case"YZY":e.set(l*d,s*c,l*h,s*u);break;case"ZXZ":e.set(l*h,l*d,s*c,s*u);break;case"XZX":e.set(s*c,l*p,l*f,s*u);break;case"YXY":e.set(l*f,s*c,l*p,s*u);break;case"ZYZ":e.set(l*p,l*f,s*c,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:po,denormalize:fo},mo=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ti(this,e),e.prototype.isVector2=!0,this.x=t,this.y=n}),[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=uo(this.x,e.x,t.x),this.y=uo(this.y,e.y,t.y),this}},{key:"clampScalar",value:function(e,t){return this.x=uo(this.x,e,t),this.y=uo(this.y,e,t),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(uo(n,e,t))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(uo(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:wi().m((function e(){return wi().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.x;case 1:return e.n=2,this.y;case 2:return e.a(2)}}),e,this)}))}])}(),yo=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Ti(this,e),this.isQuaternion=!0,this._x=t,this._y=n,this._z=r,this._w=i}),[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(r/2),c=o(i/2),h=s(n/2),d=s(r/2),f=s(i/2);switch(a){case"XYZ":this._x=h*u*c+l*d*f,this._y=l*d*c-h*u*f,this._z=l*u*f+h*d*c,this._w=l*u*c-h*d*f;break;case"YXZ":this._x=h*u*c+l*d*f,this._y=l*d*c-h*u*f,this._z=l*u*f-h*d*c,this._w=l*u*c+h*d*f;break;case"ZXY":this._x=h*u*c-l*d*f,this._y=l*d*c+h*u*f,this._z=l*u*f+h*d*c,this._w=l*u*c-h*d*f;break;case"ZYX":this._x=h*u*c-l*d*f,this._y=l*d*c+h*u*f,this._z=l*u*f-h*d*c,this._w=l*u*c+h*d*f;break;case"YZX":this._x=h*u*c+l*d*f,this._y=l*d*c+h*u*f,this._z=l*u*f-h*d*c,this._w=l*u*c-h*d*f;break;case"XZY":this._x=h*u*c-l*d*f,this._y=l*d*c-h*u*f,this._z=l*u*f+h*d*c,this._w=l*u*c+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],u=t[6],c=t[10],h=n+o+c;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-s)*d,this._y=(i-l)*d,this._z=(a-r)*d}else if(n>o&&n>c){var f=2*Math.sqrt(1+n-o-c);this._w=(u-s)/f,this._x=.25*f,this._y=(r+a)/f,this._z=(i+l)/f}else if(o>c){var p=2*Math.sqrt(1+o-n-c);this._w=(i-l)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(s+u)/p}else{var v=2*Math.sqrt(1+c-n-o);this._w=(a-r)/v,this._x=(i+l)/v,this._y=(s+u)/v,this._z=.25*v}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(uo(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(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}},{key:"multiply",value:function(e){return this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+r*l-i*s,this._y=r*u+a*s+i*o-n*l,this._z=i*u+a*l+n*s-r*o,this._w=a*u-n*o-r*s-i*l,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this}var u=Math.sqrt(s),c=Math.atan2(u,o),h=Math.sin((1-t)*c)/u,d=Math.sin(t*c)/u;return this._w=a*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,n){return this.copy(e).slerp(t,n)}},{key:"random",value:function(){var e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(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}},{key:"toJSON",value:function(){return this.toArray()}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:wi().m((function e(){return wi().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this._x;case 1:return e.n=2,this._y;case 2:return e.n=3,this._z;case 3:return e.n=4,this._w;case 4:return e.a(2)}}),e,this)}))}],[{key:"slerpFlat",value:function(e,t,n,r,i,a,o){var s=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3],h=i[a+0],d=i[a+1],f=i[a+2],p=i[a+3];if(0===o)return e[t+0]=s,e[t+1]=l,e[t+2]=u,void(e[t+3]=c);if(1===o)return e[t+0]=h,e[t+1]=d,e[t+2]=f,void(e[t+3]=p);if(c!==p||s!==h||l!==d||u!==f){var v=1-o,m=s*h+l*d+u*f+c*p,y=m>=0?1:-1,g=1-m*m;if(g>Number.EPSILON){var _=Math.sqrt(g),b=Math.atan2(_,m*y);v=Math.sin(v*b)/_,o=Math.sin(o*b)/_}var x=o*y;if(s=s*v+h*x,l=l*v+d*x,u=u*v+f*x,c=c*v+p*x,v===1-o){var S=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=S,l*=S,u*=S,c*=S}}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=c}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,a){var o=n[r],s=n[r+1],l=n[r+2],u=n[r+3],c=i[a],h=i[a+1],d=i[a+2],f=i[a+3];return e[t]=o*f+u*c+s*d-l*h,e[t+1]=s*f+u*h+l*c-o*d,e[t+2]=l*f+u*d+o*h-s*c,e[t+3]=u*f-o*c-s*h-l*d,e}}])}(),go=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Ti(this,e),e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}),[{key:"set",value:function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return this.applyQuaternion(bo.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(bo.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}},{key:"applyQuaternion",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=2*(a*r-o*n),u=2*(o*t-i*r),c=2*(i*n-a*t);return this.x=t+s*l+a*c-o*u,this.y=n+s*u+o*l-i*c,this.z=r+s*c+i*u-a*l,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(e,t){return this.x=uo(this.x,e.x,t.x),this.y=uo(this.y,e.y,t.y),this.z=uo(this.z,e.z,t.z),this}},{key:"clampScalar",value:function(e,t){return this.x=uo(this.x,e,t),this.y=uo(this.y,e,t),this.z=uo(this.z,e,t),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(uo(n,e,t))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(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}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}},{key:"cross",value:function(e){return this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(e){return _o.copy(this).projectOnVector(e),this.sub(_o)}},{key:"reflect",value:function(e){return this.sub(_o.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(uo(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"setFromEuler",value:function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}},{key:"setFromColor",value:function(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}},{key:Symbol.iterator,value:wi().m((function e(){return wi().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.x;case 1:return e.n=2,this.y;case 2:return e.n=3,this.z;case 3:return e.a(2)}}),e,this)}))}])}(),_o=new go,bo=new yo,xo=function(){return Ai((function e(t,n,r,i,a,o,s,l,u){Ti(this,e),e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,n,r,i,a,o,s,l,u)}),[{key:"set",value:function(e,t,n,r,i,a,o,s,l){var u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=l,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var 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}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],f=n[8],p=r[0],v=r[3],m=r[6],y=r[1],g=r[4],_=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*p+o*y+s*b,i[3]=a*v+o*g+s*x,i[6]=a*m+o*_+s*S,i[1]=l*p+u*y+c*b,i[4]=l*v+u*g+c*x,i[7]=l*m+u*_+c*S,i[2]=h*p+d*y+f*b,i[5]=h*v+d*g+f*x,i[8]=h*m+d*_+f*S,this}},{key:"multiplyScalar",value:function(e){var 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}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*a*u-t*o*l-n*i*u+n*o*s+r*i*l-r*a*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=u*a-o*l,h=o*s-u*i,d=l*i-a*s,f=t*c+n*h+r*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);var p=1/f;return e[0]=c*p,e[1]=(r*l-u*n)*p,e[2]=(o*n-r*a)*p,e[3]=h*p,e[4]=(u*t-r*s)*p,e[5]=(r*i-o*t)*p,e[6]=d*p,e[7]=(n*s-l*t)*p,e[8]=(a*t-n*i)*p,this}},{key:"transpose",value:function(){var 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}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var 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}},{key:"setUvTransform",value:function(e,t,n,r,i,a,o){var s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}},{key:"scale",value:function(e,t){return this.premultiply(So.makeScale(e,t)),this}},{key:"rotate",value:function(e){return this.premultiply(So.makeRotation(-e)),this}},{key:"translate",value:function(e,t){return this.premultiply(So.makeTranslation(e,t)),this}},{key:"makeTranslation",value:function(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}},{key:"makeRotation",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}},{key:"makeScale",value:function(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}])}(),So=new xo;function wo(e){for(var t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var Eo={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Mo(e,t){return new Eo[e](t)}function To(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}var Co={};function Ao(e){e in Co||(Co[e]=!0,console.warn(e))}function Po(e,t,n){return new Promise((function(r,i){setTimeout((function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}),n)}))}var ko=(new xo).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Oo=(new xo).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Ro(){var e={enabled:!0,workingColorSpace:Ja,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n?(this.spaces[t].transfer===Ka&&(e.r=Lo(e.r),e.g=Lo(e.g),e.b=Lo(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===Ka&&(e.r=Do(e.r),e.g=Do(e.g),e.b=Do(e.b)),e):e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===qa?Za:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.workingColorSpace;return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.workingColorSpace;return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return Ao("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return Ao("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define(Si(Si({},Ja,{primaries:t,whitePoint:r,transfer:Za,toXYZ:ko,fromXYZ:Oo,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Ya},outputColorSpaceConfig:{drawingBufferColorSpace:Ya}}),Ya,{primaries:t,whitePoint:r,transfer:Ka,toXYZ:ko,fromXYZ:Oo,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Ya}})),e}var Io,No=Ro();function Lo(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Do(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Uo=function(){return Ai((function e(){Ti(this,e)}),null,[{key:"getDataURL",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Io&&(Io=To("canvas")),Io.width=e.width,Io.height=e.height;var r=Io.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=Io}return t.toDataURL(n)}},{key:"sRGBToLinear",value:function(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var t=To("canvas");t.width=e.width,t.height=e.height;var n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);for(var r=n.getImageData(0,0,e.width,e.height),i=r.data,a=0;a<i.length;a++)i[a]=255*Lo(i[a]/255);return n.putImageData(r,0,0),t}if(e.data){for(var o=e.data.slice(0),s=0;s<o.length;s++)o instanceof Uint8Array||o instanceof Uint8ClampedArray?o[s]=Math.floor(255*Lo(o[s]/255)):o[s]=Lo(o[s]);return{data:o,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}])}(),Fo=0,Bo=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;Ti(this,e),this.isSource=!0,Object.defineProperty(this,"id",{value:Fo++}),this.uuid=lo(),this.data=t,this.dataReady=!0,this.version=0}),[{key:"getSize",value:function(e){var t=this.data;return"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];var n={uuid:this.uuid,url:""},r=this.data;if(null!==r){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)r[a].isDataTexture?i.push(zo(r[a].image)):i.push(zo(r[a]))}else i=zo(r);n.url=i}return t||(e.images[this.uuid]=n),n}}])}();function zo(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Uo.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var jo=0,Ho=new go,Vo=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.DEFAULT_IMAGE,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.DEFAULT_MAPPING,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zi,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zi,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Gi,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Xi,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:na,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:qi,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:t.DEFAULT_ANISOTROPY,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:qa;return Ti(this,t),(e=yi(this,t)).isTexture=!0,Object.defineProperty(e,"id",{value:jo++}),e.uuid=lo(),e.name="",e.source=new Bo(n),e.mipmaps=[],e.mapping=r,e.channel=0,e.wrapS=i,e.wrapT=a,e.magFilter=o,e.minFilter=s,e.anisotropy=c,e.format=l,e.internalFormat=null,e.type=u,e.offset=new mo(0,0),e.repeat=new mo(1,1),e.center=new mo(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new xo,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.colorSpace=h,e.userData={},e.updateRanges=[],e.version=0,e.onUpdate=null,e.renderTarget=null,e.isRenderTargetTexture=!1,e.isArrayTexture=!!(n&&n.depth&&n.depth>1),e.pmremVersion=0,e}return bi(t,e),Ai(t,[{key:"width",get:function(){return this.source.getSize(Ho).x}},{key:"height",get:function(){return this.source.getSize(Ho).y}},{key:"depth",get:function(){return this.source.getSize(Ho).z}},{key:"image",get:function(){return this.source.data},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.source.data=e}},{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"addUpdateRange",value:function(e,t){this.updateRanges.push({start:e,count:t})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}},{key:"setValues",value:function(e){for(var t in e){var n=e[t];if(void 0!==n){var r=this[t];void 0!==r?r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n:console.warn("THREE.Texture.setValues(): property '".concat(t,"' does not exist."))}else console.warn("THREE.Texture.setValues(): parameter '".concat(t,"' has value of undefined."))}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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),t||(e.textures[this.uuid]=n),n}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Bi:e.x=e.x-Math.floor(e.x);break;case zi:e.x=e.x<0?0:1;break;case ji:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Bi:e.y=e.y-Math.floor(e.y);break;case zi:e.y=e.y<0?0:1;break;case ji:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}},{key:"needsUpdate",set:function(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}},{key:"needsPMREMUpdate",set:function(e){!0===e&&this.pmremVersion++}}])}(ro);Vo.DEFAULT_IMAGE=null,Vo.DEFAULT_MAPPING=300,Vo.DEFAULT_ANISOTROPY=1;var Go=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Ti(this,e),e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}),[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(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}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(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}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var 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}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,a=.01,o=.1,s=e.elements,l=s[0],u=s[4],c=s[8],h=s[1],d=s[5],f=s[9],p=s[2],v=s[6],m=s[10];if(Math.abs(u-h)<a&&Math.abs(c-p)<a&&Math.abs(f-v)<a){if(Math.abs(u+h)<o&&Math.abs(c+p)<o&&Math.abs(f+v)<o&&Math.abs(l+d+m-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var y=(l+1)/2,g=(d+1)/2,_=(m+1)/2,b=(u+h)/4,x=(c+p)/4,S=(f+v)/4;return y>g&&y>_?y<a?(n=0,r=.707106781,i=.707106781):(r=b/(n=Math.sqrt(y)),i=x/n):g>_?g<a?(n=.707106781,r=0,i=.707106781):(n=b/(r=Math.sqrt(g)),i=S/r):_<a?(n=.707106781,r=.707106781,i=0):(n=x/(i=Math.sqrt(_)),r=S/i),this.set(n,r,i,t),this}var w=Math.sqrt((v-f)*(v-f)+(c-p)*(c-p)+(h-u)*(h-u));return Math.abs(w)<.001&&(w=1),this.x=(v-f)/w,this.y=(c-p)/w,this.z=(h-u)/w,this.w=Math.acos((l+d+m-1)/2),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(e,t){return this.x=uo(this.x,e.x,t.x),this.y=uo(this.y,e.y,t.y),this.z=uo(this.z,e.z,t.z),this.w=uo(this.w,e.w,t.w),this}},{key:"clampScalar",value:function(e,t){return this.x=uo(this.x,e,t),this.y=uo(this.y,e,t),this.z=uo(this.z,e,t),this.w=uo(this.w,e,t),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(uo(n,e,t))}},{key:"floor",value:function(){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}},{key:"ceil",value:function(){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}},{key:"round",value:function(){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}},{key:"roundToZero",value:function(){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}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(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}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:wi().m((function e(){return wi().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.x;case 1:return e.n=2,this.y;case 2:return e.n=3,this.z;case 3:return e.n=4,this.w;case 4:return e.a(2)}}),e,this)}))}])}(),Wo=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ti(this,t),(e=yi(this,t,[n,r,i])).isWebGLRenderTarget=!0,e}return bi(t,e),Ai(t)}(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Ti(this,t),e=yi(this,t),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Gi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),e.isRenderTarget=!0,e.width=n,e.height=r,e.depth=i.depth,e.scissor=new Go(0,0,n,r),e.scissorTest=!1,e.viewport=new Go(0,0,n,r);var a={width:n,height:r,depth:i.depth},o=new Vo(a);e.textures=[];for(var s=i.count,l=0;l<s;l++)e.textures[l]=o.clone(),e.textures[l].isRenderTargetTexture=!0,e.textures[l].renderTarget=e;return e._setTextureOptions(i),e.depthBuffer=i.depthBuffer,e.stencilBuffer=i.stencilBuffer,e.resolveDepthBuffer=i.resolveDepthBuffer,e.resolveStencilBuffer=i.resolveStencilBuffer,e._depthTexture=null,e.depthTexture=i.depthTexture,e.samples=i.samples,e.multiview=i.multiview,e}return bi(t,e),Ai(t,[{key:"_setTextureOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={minFilter:Gi,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(var n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}},{key:"texture",get:function(){return this.textures[0]},set:function(e){this.textures[0]=e}},{key:"depthTexture",get:function(){return this._depthTexture},set:function(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}},{key:"setSize",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(var r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(var t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;var r=Object.assign({},e.textures[t].image);this.textures[t].source=new Bo(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}])}(ro)),Xo=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Ti(this,t),(e=yi(this,t,[null])).isDataArrayTexture=!0,e.image={data:n,width:r,height:i,depth:a},e.magFilter=Hi,e.minFilter=Hi,e.wrapR=zi,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.layerUpdates=new Set,e}return bi(t,e),Ai(t,[{key:"addLayerUpdate",value:function(e){this.layerUpdates.add(e)}},{key:"clearLayerUpdates",value:function(){this.layerUpdates.clear()}}])}(Vo),qo=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Ti(this,t),(e=yi(this,t,[null])).isData3DTexture=!0,e.image={data:n,width:r,height:i,depth:a},e.magFilter=Hi,e.minFilter=Hi,e.wrapR=zi,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return bi(t,e),Ai(t)}(Vo),Yo=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new go(1/0,1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go(-1/0,-1/0,-1/0);Ti(this,e),this.isBox3=!0,this.min=t,this.max=n}),[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t+=3)this.expandByPoint(Zo.fromArray(e,t));return this}},{key:"setFromBufferAttribute",value:function(e){this.makeEmpty();for(var t=0,n=e.count;t<n;t++)this.expandByPoint(Zo.fromBufferAttribute(e,t));return this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}},{key:"setFromCenterAndSize",value:function(e,t){var n=Zo.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}},{key:"setFromObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"expandByObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);var n=e.geometry;if(void 0!==n){var r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(var i=0,a=r.count;i<a;i++)!0===e.isMesh?e.getVertexPosition(i,Zo):Zo.fromBufferAttribute(r,i),Zo.applyMatrix4(e.matrixWorld),this.expandByPoint(Zo);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),Ko.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),Ko.copy(n.boundingBox)),Ko.applyMatrix4(e.matrixWorld),this.union(Ko)}for(var o=e.children,s=0,l=o.length;s<l;s++)this.expandByObject(o[s],t);return this}},{key:"containsPoint",value:function(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}},{key:"containsBox",value:function(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}},{key:"getParameter",value:function(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))}},{key:"intersectsBox",value:function(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,Zo),Zo.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(is),as.subVectors(this.max,is),$o.subVectors(e.a,is),Qo.subVectors(e.b,is),es.subVectors(e.c,is),ts.subVectors(Qo,$o),ns.subVectors(es,Qo),rs.subVectors($o,es);var t=[0,-ts.z,ts.y,0,-ns.z,ns.y,0,-rs.z,rs.y,ts.z,0,-ts.x,ns.z,0,-ns.x,rs.z,0,-rs.x,-ts.y,ts.x,0,-ns.y,ns.x,0,-rs.y,rs.x,0];return!!ls(t,$o,Qo,es,as)&&!!ls(t=[1,0,0,0,1,0,0,0,1],$o,Qo,es,as)&&(os.crossVectors(ts,ns),ls(t=[os.x,os.y,os.z],$o,Qo,es,as))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return this.clampPoint(e,Zo).distanceTo(e)}},{key:"getBoundingSphere",value:function(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(Zo).length()),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(Jo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Jo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Jo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Jo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Jo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Jo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Jo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Jo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Jo)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},{key:"toJSON",value:function(){return{min:this.min.toArray(),max:this.max.toArray()}}},{key:"fromJSON",value:function(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}])}(),Jo=[new go,new go,new go,new go,new go,new go,new go,new go],Zo=new go,Ko=new Yo,$o=new go,Qo=new go,es=new go,ts=new go,ns=new go,rs=new go,is=new go,as=new go,os=new go,ss=new go;function ls(e,t,n,r,i){for(var a=0,o=e.length-3;a<=o;a+=3){ss.fromArray(e,a);var s=i.x*Math.abs(ss.x)+i.y*Math.abs(ss.y)+i.z*Math.abs(ss.z),l=t.dot(ss),u=n.dot(ss),c=r.dot(ss);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var us=new Yo,cs=new go,hs=new go,ds=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new go,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;Ti(this,e),this.isSphere=!0,this.center=t,this.radius=n}),[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var n=this.center;void 0!==t?n.copy(t):us.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}},{key:"copy",value:function(e){return this.center.copy(e.center),this.radius=e.radius,this}},{key:"isEmpty",value:function(){return this.radius<0}},{key:"makeEmpty",value:function(){return this.center.set(0,0,0),this.radius=-1,this}},{key:"containsPoint",value:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}},{key:"distanceToPoint",value:function(e){return e.distanceTo(this.center)-this.radius}},{key:"intersectsSphere",value:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}},{key:"intersectsBox",value:function(e){return e.intersectsSphere(this)}},{key:"intersectsPlane",value:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}},{key:"clampPoint",value:function(e,t){var n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;cs.subVectors(e,this.center);var t=cs.lengthSq();if(t>this.radius*this.radius){var n=Math.sqrt(t),r=.5*(n-this.radius);this.center.addScaledVector(cs,r/n),this.radius+=r}return this}},{key:"union",value:function(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(hs.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(cs.copy(e.center).add(hs)),this.expandByPoint(cs.copy(e.center).sub(hs))),this)}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){return{radius:this.radius,center:this.center.toArray()}}},{key:"fromJSON",value:function(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}])}(),fs=new go,ps=new go,vs=new go,ms=new go,ys=new go,gs=new go,_s=new go,bs=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new go,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go(0,0,-1);Ti(this,e),this.origin=t,this.direction=n}),[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,fs)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=fs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(fs.copy(this.origin).addScaledVector(this.direction,t),fs.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,n,r){ps.copy(e).add(t).multiplyScalar(.5),vs.copy(t).sub(e).normalize(),ms.copy(this.origin).sub(ps);var i,a,o,s,l=.5*e.distanceTo(t),u=-this.direction.dot(vs),c=ms.dot(this.direction),h=-ms.dot(vs),d=ms.lengthSq(),f=Math.abs(1-u*u);if(f>0)if(a=u*c-h,s=l*f,(i=u*h-c)>=0)if(a>=-s)if(a<=s){var p=1/f;o=(i*=p)*(i+u*(a*=p)+2*c)+a*(u*i+a+2*h)+d}else a=l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;else a=-l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;else a<=-s?o=-(i=Math.max(0,-(-u*l+c)))*i+(a=i>0?-l:Math.min(Math.max(-l,-h),l))*(a+2*h)+d:a<=s?(i=0,o=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):o=-(i=Math.max(0,-(u*l+c)))*i+(a=i>0?l:Math.min(Math.max(-l,-h),l))*(a+2*h)+d;else a=u>0?-l:l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,i),r&&r.copy(ps).addScaledVector(vs,a),o}},{key:"intersectSphere",value:function(e,t){fs.subVectors(e.center,this.origin);var n=fs.dot(this.direction),r=fs.dot(fs)-n*n,i=e.radius*e.radius;if(r>i)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}},{key:"intersectsSphere",value:function(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}},{key:"intersectPlane",value:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var n,r,i,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),u>=0?(i=(e.min.y-h.y)*u,a=(e.max.y-h.y)*u):(i=(e.max.y-h.y)*u,a=(e.min.y-h.y)*u),n>a||i>r?null:((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),c>=0?(o=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(o=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,fs)}},{key:"intersectTriangle",value:function(e,t,n,r,i){ys.subVectors(t,e),gs.subVectors(n,e),_s.crossVectors(ys,gs);var a,o=this.direction.dot(_s);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}ms.subVectors(this.origin,e);var s=a*this.direction.dot(gs.crossVectors(ms,gs));if(s<0)return null;var l=a*this.direction.dot(ys.cross(ms));if(l<0)return null;if(s+l>o)return null;var u=-a*ms.dot(_s);return u<0?null:this.at(u/o,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),xs=function(){function e(t,n,r,i,a,o,s,l,u,c,h,d,f,p,v,m){Ti(this,e),e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,n,r,i,a,o,s,l,u,c,h,d,f,p,v,m)}return Ai(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,l,u,c,h,d,f,p,v){var m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=a,m[9]=o,m[13]=s,m[2]=l,m[6]=u,m[10]=c,m[14]=h,m[3]=d,m[7]=f,m[11]=p,m[15]=v,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"setFromMatrix3",value:function(e){var 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}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,n=e.elements,r=1/Ss.setFromMatrixColumn(e,0).length(),i=1/Ss.setFromMatrixColumn(e,1).length(),a=1/Ss.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var h=a*u,d=a*c,f=o*u,p=o*c;t[0]=s*u,t[4]=-s*c,t[8]=l,t[1]=d+f*l,t[5]=h-p*l,t[9]=-o*s,t[2]=p-h*l,t[6]=f+d*l,t[10]=a*s}else if("YXZ"===e.order){var v=s*u,m=s*c,y=l*u,g=l*c;t[0]=v+g*o,t[4]=y*o-m,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-o,t[2]=m*o-y,t[6]=g+v*o,t[10]=a*s}else if("ZXY"===e.order){var _=s*u,b=s*c,x=l*u,S=l*c;t[0]=_-S*o,t[4]=-a*c,t[8]=x+b*o,t[1]=b+x*o,t[5]=a*u,t[9]=S-_*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var w=a*u,E=a*c,M=o*u,T=o*c;t[0]=s*u,t[4]=M*l-E,t[8]=w*l+T,t[1]=s*c,t[5]=T*l+w,t[9]=E*l-M,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var C=a*s,A=a*l,P=o*s,k=o*l;t[0]=s*u,t[4]=k-C*c,t[8]=P*c+A,t[1]=c,t[5]=a*u,t[9]=-o*u,t[2]=-l*u,t[6]=A*c+P,t[10]=C-k*c}else if("XZY"===e.order){var O=a*s,R=a*l,I=o*s,N=o*l;t[0]=s*u,t[4]=-c,t[8]=l*u,t[1]=O*c+N,t[5]=a*u,t[9]=R*c-I,t[2]=I*c-R,t[6]=o*u,t[10]=N*c+O}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Es,e,Ms)}},{key:"lookAt",value:function(e,t,n){var r=this.elements;return As.subVectors(e,t),0===As.lengthSq()&&(As.z=1),As.normalize(),Ts.crossVectors(n,As),0===Ts.lengthSq()&&(1===Math.abs(n.z)?As.x+=1e-4:As.z+=1e-4,As.normalize(),Ts.crossVectors(n,As)),Ts.normalize(),Cs.crossVectors(As,Ts),r[0]=Ts.x,r[4]=Cs.x,r[8]=As.x,r[1]=Ts.y,r[5]=Cs.y,r[9]=As.y,r[2]=Ts.z,r[6]=Cs.z,r[10]=As.z,this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],f=n[2],p=n[6],v=n[10],m=n[14],y=n[3],g=n[7],_=n[11],b=n[15],x=r[0],S=r[4],w=r[8],E=r[12],M=r[1],T=r[5],C=r[9],A=r[13],P=r[2],k=r[6],O=r[10],R=r[14],I=r[3],N=r[7],L=r[11],D=r[15];return i[0]=a*x+o*M+s*P+l*I,i[4]=a*S+o*T+s*k+l*N,i[8]=a*w+o*C+s*O+l*L,i[12]=a*E+o*A+s*R+l*D,i[1]=u*x+c*M+h*P+d*I,i[5]=u*S+c*T+h*k+d*N,i[9]=u*w+c*C+h*O+d*L,i[13]=u*E+c*A+h*R+d*D,i[2]=f*x+p*M+v*P+m*I,i[6]=f*S+p*T+v*k+m*N,i[10]=f*w+p*C+v*O+m*L,i[14]=f*E+p*A+v*R+m*D,i[3]=y*x+g*M+_*P+b*I,i[7]=y*S+g*T+_*k+b*N,i[11]=y*w+g*C+_*O+b*L,i[15]=y*E+g*A+_*R+b*D,this}},{key:"multiplyScalar",value:function(e){var 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}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14];return e[3]*(+i*s*c-r*l*c-i*o*h+n*l*h+r*o*d-n*s*d)+e[7]*(+t*s*d-t*l*h+i*a*h-r*a*d+r*l*u-i*s*u)+e[11]*(+t*l*c-t*o*d-i*a*c+n*a*d+i*o*u-n*l*u)+e[15]*(-r*o*u-t*s*c+t*o*h+r*a*c-n*a*h+n*s*u)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],f=e[12],p=e[13],v=e[14],m=e[15],y=c*v*l-p*h*l+p*s*d-o*v*d-c*s*m+o*h*m,g=f*h*l-u*v*l-f*s*d+a*v*d+u*s*m-a*h*m,_=u*p*l-f*c*l+f*o*d-a*p*d-u*o*m+a*c*m,b=f*c*s-u*p*s-f*o*h+a*p*h+u*o*v-a*c*v,x=t*y+n*g+r*_+i*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var S=1/x;return e[0]=y*S,e[1]=(p*h*i-c*v*i-p*r*d+n*v*d+c*r*m-n*h*m)*S,e[2]=(o*v*i-p*s*i+p*r*l-n*v*l-o*r*m+n*s*m)*S,e[3]=(c*s*i-o*h*i-c*r*l+n*h*l+o*r*d-n*s*d)*S,e[4]=g*S,e[5]=(u*v*i-f*h*i+f*r*d-t*v*d-u*r*m+t*h*m)*S,e[6]=(f*s*i-a*v*i-f*r*l+t*v*l+a*r*m-t*s*m)*S,e[7]=(a*h*i-u*s*i+u*r*l-t*h*l-a*r*d+t*s*d)*S,e[8]=_*S,e[9]=(f*c*i-u*p*i-f*n*d+t*p*d+u*n*m-t*c*m)*S,e[10]=(a*p*i-f*o*i+f*n*l-t*p*l-a*n*m+t*o*m)*S,e[11]=(u*o*i-a*c*i-u*n*l+t*c*l+a*n*d-t*o*d)*S,e[12]=b*S,e[13]=(u*p*r-f*c*r+f*n*h-t*p*h-u*n*v+t*c*v)*S,e[14]=(f*o*r-a*p*r-f*n*s+t*p*s+a*n*v-t*o*v)*S,e[15]=(a*c*r-u*o*r+u*n*s-t*c*s-a*n*h+t*o*h)*S,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}},{key:"makeTranslation",value:function(e,t,n){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,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,u=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,u*o+n,u*s-r*a,0,l*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,u=a+a,c=o+o,h=i*l,d=i*u,f=i*c,p=a*u,v=a*c,m=o*c,y=s*l,g=s*u,_=s*c,b=n.x,x=n.y,S=n.z;return r[0]=(1-(p+m))*b,r[1]=(d+_)*b,r[2]=(f-g)*b,r[3]=0,r[4]=(d-_)*x,r[5]=(1-(h+m))*x,r[6]=(v+y)*x,r[7]=0,r[8]=(f+g)*S,r[9]=(v-y)*S,r[10]=(1-(h+p))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(e,t,n){var r=this.elements,i=Ss.set(r[0],r[1],r[2]).length(),a=Ss.set(r[4],r[5],r[6]).length(),o=Ss.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ws.copy(this);var s=1/i,l=1/a,u=1/o;return ws.elements[0]*=s,ws.elements[1]*=s,ws.elements[2]*=s,ws.elements[4]*=l,ws.elements[5]*=l,ws.elements[6]*=l,ws.elements[8]*=u,ws.elements[9]*=u,ws.elements[10]*=u,t.setFromRotationMatrix(ws),n.x=i,n.y=a,n.z=o,this}},{key:"makePerspective",value:function(e,t,n,r,i,a){var o,s,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:to,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=this.elements,h=2*i/(t-e),d=2*i/(n-r),f=(t+e)/(t-e),p=(n+r)/(n-r);if(u)o=i/(a-i),s=a*i/(a-i);else if(l===to)o=-(a+i)/(a-i),s=-2*a*i/(a-i);else{if(l!==no)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);o=-a/(a-i),s=-a*i/(a-i)}return c[0]=h,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=d,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=o,c[14]=s,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,a){var o,s,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:to,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=this.elements,h=2/(t-e),d=2/(n-r),f=-(t+e)/(t-e),p=-(n+r)/(n-r);if(u)o=1/(a-i),s=a/(a-i);else if(l===to)o=-2/(a-i),s=-(a+i)/(a-i);else{if(l!==no)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);o=-1/(a-i),s=-i/(a-i)}return c[0]=h,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=d,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=o,c[14]=s,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}])}(),Ss=new go,ws=new xs,Es=new go(0,0,0),Ms=new go(1,1,1),Ts=new go,Cs=new go,As=new go,Ps=new xs,ks=new yo,Os=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DEFAULT_ORDER;Ti(this,e),this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}),[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],l=r[5],u=r[9],c=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(uo(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-uo(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(s,l)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(uo(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-uo(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(uo(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-uo(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,n){return Ps.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ps,t,n)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(e){return ks.setFromEuler(this),this.setFromQuaternion(ks,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:wi().m((function e(){return wi().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this._x;case 1:return e.n=2,this._y;case 2:return e.n=3,this._z;case 3:return e.n=4,this._order;case 4:return e.a(2)}}),e,this)}))}])}();Os.DEFAULT_ORDER="XYZ";var Rs=function(){return Ai((function e(){Ti(this,e),this.mask=1}),[{key:"set",value:function(e){this.mask=1<<e>>>0}},{key:"enable",value:function(e){this.mask|=1<<e}},{key:"enableAll",value:function(){this.mask=-1}},{key:"toggle",value:function(e){this.mask^=1<<e}},{key:"disable",value:function(e){this.mask&=~(1<<e)}},{key:"disableAll",value:function(){this.mask=0}},{key:"test",value:function(e){return 0!==(this.mask&e.mask)}},{key:"isEnabled",value:function(e){return!!(this.mask&1<<e)}}])}(),Is=0,Ns=new go,Ls=new yo,Ds=new xs,Us=new go,Fs=new go,Bs=new go,zs=new yo,js=new go(1,0,0),Hs=new go(0,1,0),Vs=new go(0,0,1),Gs={type:"added"},Ws={type:"removed"},Xs={type:"childadded",child:null},qs={type:"childremoved",child:null},Ys=function(e){function t(){var e;Ti(this,t),(e=yi(this,t)).isObject3D=!0,Object.defineProperty(e,"id",{value:Is++}),e.uuid=lo(),e.name="",e.type="Object3D",e.parent=null,e.children=[],e.up=t.DEFAULT_UP.clone();var n=new go,r=new Os,i=new yo,a=new go(1,1,1);return r._onChange((function(){i.setFromEuler(r,!1)})),i._onChange((function(){r.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(e,{position:{configurable:!0,enumerable:!0,value:n},rotation:{configurable:!0,enumerable:!0,value:r},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new xs},normalMatrix:{value:new xo}}),e.matrix=new xs,e.matrixWorld=new xs,e.matrixAutoUpdate=t.DEFAULT_MATRIX_AUTO_UPDATE,e.matrixWorldAutoUpdate=t.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,e.matrixWorldNeedsUpdate=!1,e.layers=new Rs,e.visible=!0,e.castShadow=!1,e.receiveShadow=!1,e.frustumCulled=!0,e.renderOrder=0,e.animations=[],e.customDepthMaterial=void 0,e.customDistanceMaterial=void 0,e.userData={},e}return bi(t,e),Ai(t,[{key:"onBeforeShadow",value:function(){}},{key:"onAfterShadow",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(e){return this.quaternion.premultiply(e),this}},{key:"setRotationFromAxisAngle",value:function(e,t){this.quaternion.setFromAxisAngle(e,t)}},{key:"setRotationFromEuler",value:function(e){this.quaternion.setFromEuler(e,!0)}},{key:"setRotationFromMatrix",value:function(e){this.quaternion.setFromRotationMatrix(e)}},{key:"setRotationFromQuaternion",value:function(e){this.quaternion.copy(e)}},{key:"rotateOnAxis",value:function(e,t){return Ls.setFromAxisAngle(e,t),this.quaternion.multiply(Ls),this}},{key:"rotateOnWorldAxis",value:function(e,t){return Ls.setFromAxisAngle(e,t),this.quaternion.premultiply(Ls),this}},{key:"rotateX",value:function(e){return this.rotateOnAxis(js,e)}},{key:"rotateY",value:function(e){return this.rotateOnAxis(Hs,e)}},{key:"rotateZ",value:function(e){return this.rotateOnAxis(Vs,e)}},{key:"translateOnAxis",value:function(e,t){return Ns.copy(e).applyQuaternion(this.quaternion),this.position.add(Ns.multiplyScalar(t)),this}},{key:"translateX",value:function(e){return this.translateOnAxis(js,e)}},{key:"translateY",value:function(e){return this.translateOnAxis(Hs,e)}},{key:"translateZ",value:function(e){return this.translateOnAxis(Vs,e)}},{key:"localToWorld",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ds.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(e,t,n){e.isVector3?Us.copy(e):Us.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),Fs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ds.lookAt(Fs,Us,this.up):Ds.lookAt(Us,Fs,this.up),this.quaternion.setFromRotationMatrix(Ds),r&&(Ds.extractRotation(r.matrixWorld),Ls.setFromRotationMatrix(Ds),this.quaternion.premultiply(Ls.invert()))}},{key:"add",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Gs),Xs.child=e,this.dispatchEvent(Xs),Xs.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}},{key:"remove",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Ws),qs.child=e,this.dispatchEvent(qs),qs.child=null),this}},{key:"removeFromParent",value:function(){var e=this.parent;return null!==e&&e.remove(this),this}},{key:"clear",value:function(){return this.remove.apply(this,pi(this.children))}},{key:"attach",value:function(e){return this.updateWorldMatrix(!0,!1),Ds.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Ds.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ds),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Gs),Xs.child=e,this.dispatchEvent(Xs),Xs.child=null,this}},{key:"getObjectById",value:function(e){return this.getObjectByProperty("id",e)}},{key:"getObjectByName",value:function(e){return this.getObjectByProperty("name",e)}},{key:"getObjectByProperty",value:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}},{key:"getObjectsByProperty",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&n.push(this);for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}},{key:"getWorldPosition",value:function(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fs,e,Bs),e}},{key:"getWorldScale",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fs,zs,e),e}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)}},{key:"traverseVisible",value:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}}},{key:"traverseAncestors",value:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}},{key:"updateWorldMatrix",value:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map((function(e){return fi(fi({},e),{},{boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})})),r.instanceInfo=this._instanceInfo.map((function(e){return fi({},e)})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(r.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(r.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var u=o[s];i(e.shapes,u)}else i(e.shapes,o)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var c=[],h=0,d=this.material.length;h<d;h++)c.push(i(e.materials,this.material[h]));r.material=c}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(var f=0;f<this.children.length;f++)r.children.push(this.children[f].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(var p=0;p<this.animations.length;p++){var v=this.animations[p];r.animations.push(i(e.animations,v))}}if(t){var m=E(e.geometries),y=E(e.materials),g=E(e.textures),_=E(e.images),b=E(e.shapes),x=E(e.skeletons),S=E(e.animations),w=E(e.nodes);m.length>0&&(n.geometries=m),y.length>0&&(n.materials=y),g.length>0&&(n.textures=g),_.length>0&&(n.images=_),b.length>0&&(n.shapes=b),x.length>0&&(n.skeletons=x),S.length>0&&(n.animations=S),w.length>0&&(n.nodes=w)}return n.object=r,n;function E(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}])}(ro);Ys.DEFAULT_UP=new go(0,1,0),Ys.DEFAULT_MATRIX_AUTO_UPDATE=!0,Ys.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Js=new go,Zs=new go,Ks=new go,$s=new go,Qs=new go,el=new go,tl=new go,nl=new go,rl=new go,il=new go,al=new Go,ol=new Go,sl=new Go,ll=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new go,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new go;Ti(this,e),this.a=t,this.b=n,this.c=r}return Ai(e,[{key:"set",value:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}},{key:"setFromAttributeAndIndices",value:function(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return Js.subVectors(this.c,this.b),Zs.subVectors(this.a,this.b),.5*Js.cross(Zs).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}},{key:"getInterpolation",value:function(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var n,r,i=this.a,a=this.b,o=this.c;Qs.subVectors(a,i),el.subVectors(o,i),nl.subVectors(e,i);var s=Qs.dot(nl),l=el.dot(nl);if(s<=0&&l<=0)return t.copy(i);rl.subVectors(e,a);var u=Qs.dot(rl),c=el.dot(rl);if(u>=0&&c<=u)return t.copy(a);var h=s*c-u*l;if(h<=0&&s>=0&&u<=0)return n=s/(s-u),t.copy(i).addScaledVector(Qs,n);il.subVectors(e,o);var d=Qs.dot(il),f=el.dot(il);if(f>=0&&d<=f)return t.copy(o);var p=d*l-s*f;if(p<=0&&l>=0&&f<=0)return r=l/(l-f),t.copy(i).addScaledVector(el,r);var v=u*f-d*c;if(v<=0&&c-u>=0&&d-f>=0)return tl.subVectors(o,a),r=(c-u)/(c-u+(d-f)),t.copy(a).addScaledVector(tl,r);var m=1/(v+p+h);return n=p*m,r=h*m,t.copy(i).addScaledVector(Qs,n).addScaledVector(el,r)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,n,r){r.subVectors(n,t),Js.subVectors(e,t),r.cross(Js);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,n,r,i){Js.subVectors(r,t),Zs.subVectors(n,t),Ks.subVectors(e,t);var a=Js.dot(Js),o=Js.dot(Zs),s=Js.dot(Ks),l=Zs.dot(Zs),u=Zs.dot(Ks),c=a*l-o*o;if(0===c)return i.set(0,0,0),null;var h=1/c,d=(l*s-o*u)*h,f=(a*u-o*s)*h;return i.set(1-d-f,f,d)}},{key:"containsPoint",value:function(e,t,n,r){return null!==this.getBarycoord(e,t,n,r,$s)&&$s.x>=0&&$s.y>=0&&$s.x+$s.y<=1}},{key:"getInterpolation",value:function(e,t,n,r,i,a,o,s){return null===this.getBarycoord(e,t,n,r,$s)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,$s.x),s.addScaledVector(a,$s.y),s.addScaledVector(o,$s.z),s)}},{key:"getInterpolatedAttribute",value:function(e,t,n,r,i,a){return al.setScalar(0),ol.setScalar(0),sl.setScalar(0),al.fromBufferAttribute(e,t),ol.fromBufferAttribute(e,n),sl.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(al,i.x),a.addScaledVector(ol,i.y),a.addScaledVector(sl,i.z),a}},{key:"isFrontFacing",value:function(e,t,n,r){return Js.subVectors(n,t),Zs.subVectors(e,t),Js.cross(Zs).dot(r)<0}}])}(),ul={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},cl={h:0,s:0,l:0},hl={h:0,s:0,l:0};function dl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}var fl=function(){return Ai((function e(t,n,r){return Ti(this,e),this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,n,r)}),[{key:"set",value:function(e,t,n){if(void 0===t&&void 0===n){var r=e;r&&r.isColor?this.copy(r):"number"==typeof r?this.setHex(r):"string"==typeof r&&this.setStyle(r)}else this.setRGB(e,t,n);return this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ya;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,No.colorSpaceToWorking(this,t),this}},{key:"setRGB",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:No.workingColorSpace;return this.r=e,this.g=t,this.b=n,No.colorSpaceToWorking(this,r),this}},{key:"setHSL",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:No.workingColorSpace;if(e=co(e,1),t=uo(t,0,1),n=uo(n,0,1),0===t)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+t):n+t-n*t,a=2*n-i;this.r=dl(a,i,e+1/3),this.g=dl(a,i,e),this.b=dl(a,i,e-1/3)}return No.colorSpaceToWorking(this,r),this}},{key:"setStyle",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ya;function r(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){var i,a=t[1],o=t[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,n);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,n);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){var s=t[1],l=s.length;if(3===l)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(6===l)return this.setHex(parseInt(s,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}},{key:"setColorName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ya,n=ul[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copySRGBToLinear",value:function(e){return this.r=Lo(e.r),this.g=Lo(e.g),this.b=Lo(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Do(e.r),this.g=Do(e.g),this.b=Do(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ya;return No.workingToColorSpace(pl.copy(this),e),65536*Math.round(uo(255*pl.r,0,255))+256*Math.round(uo(255*pl.g,0,255))+Math.round(uo(255*pl.b,0,255))}},{key:"getHexString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ya;return("000000"+this.getHex(e).toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:No.workingColorSpace;No.workingToColorSpace(pl.copy(this),t);var n,r,i=pl.r,a=pl.g,o=pl.b,s=Math.max(i,a,o),l=Math.min(i,a,o),u=(l+s)/2;if(l===s)n=0,r=0;else{var c=s-l;switch(r=u<=.5?c/(s+l):c/(2-s-l),s){case i:n=(a-o)/c+(a<o?6:0);break;case a:n=(o-i)/c+2;break;case o:n=(i-a)/c+4}n/=6}return e.h=n,e.s=r,e.l=u,e}},{key:"getRGB",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:No.workingColorSpace;return No.workingToColorSpace(pl.copy(this),t),e.r=pl.r,e.g=pl.g,e.b=pl.b,e}},{key:"getStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ya;No.workingToColorSpace(pl.copy(this),e);var t=pl.r,n=pl.g,r=pl.b;return e!==Ya?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(n.toFixed(3)," ").concat(r.toFixed(3),")"):"rgb(".concat(Math.round(255*t),",").concat(Math.round(255*n),",").concat(Math.round(255*r),")")}},{key:"offsetHSL",value:function(e,t,n){return this.getHSL(cl),this.setHSL(cl.h+e,cl.s+t,cl.l+n)}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}},{key:"lerpColors",value:function(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}},{key:"lerpHSL",value:function(e,t){this.getHSL(cl),e.getHSL(hl);var n=ho(cl.h,hl.h,t),r=ho(cl.s,hl.s,t),i=ho(cl.l,hl.l,t);return this.setHSL(n,r,i),this}},{key:"setFromVector3",value:function(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}},{key:"applyMatrix3",value:function(e){var t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:Symbol.iterator,value:wi().m((function e(){return wi().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.r;case 1:return e.n=2,this.g;case 2:return e.n=3,this.b;case 3:return e.a(2)}}),e,this)}))}])}(),pl=new fl;fl.NAMES=ul;var vl=0,ml=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).isMaterial=!0,Object.defineProperty(e,"id",{value:vl++}),e.uuid=lo(),e.name="",e.type="Material",e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.alphaHash=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=Ri,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.blendColor=new fl(0,0,0),e.blendAlpha=0,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=$a,e.stencilZFail=$a,e.stencilZPass=$a,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.forceSinglePass=!1,e.allowOverride=!0,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e._alphaTest=0,e}return bi(t,e),Ai(t,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE.Material: '".concat(t,"' is not a property of THREE.").concat(this.type,"."))}else console.warn("THREE.Material: parameter '".concat(t,"' has value of undefined."))}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==Ri&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==$a&&(n.stencilFail=this.stencilFail),this.stencilZFail!==$a&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==$a&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(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;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,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}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}])}(ro),yl=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshBasicMaterial=!0,n.type="MeshBasicMaterial",n.color=new fl(16777215),n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.specularMap=null,n.alphaMap=null,n.envMap=null,n.envMapRotation=new Os,n.combine=0,n.reflectivity=1,n.refractionRatio=.98,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([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}}])}(ml),gl=new go,_l=new mo,bl=0,xl=function(){return Ai((function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Ti(this,e),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:bl++}),this.name="",this.array=t,this.itemSize=n,this.count=void 0!==t?t.length/n:0,this.normalized=r,this.usage=Qa,this.updateRanges=[],this.gpuType=Ki,this.version=0}),[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"addUpdateRange",value:function(e,t){this.updateRanges.push({start:e,count:t})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(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}},{key:"copyAt",value:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}},{key:"copyArray",value:function(e){return this.array.set(e),this}},{key:"applyMatrix3",value:function(e){if(2===this.itemSize)for(var t=0,n=this.count;t<n;t++)_l.fromBufferAttribute(this,t),_l.applyMatrix3(e),this.setXY(t,_l.x,_l.y);else if(3===this.itemSize)for(var r=0,i=this.count;r<i;r++)gl.fromBufferAttribute(this,r),gl.applyMatrix3(e),this.setXYZ(r,gl.x,gl.y,gl.z);return this}},{key:"applyMatrix4",value:function(e){for(var t=0,n=this.count;t<n;t++)gl.fromBufferAttribute(this,t),gl.applyMatrix4(e),this.setXYZ(t,gl.x,gl.y,gl.z);return this}},{key:"applyNormalMatrix",value:function(e){for(var t=0,n=this.count;t<n;t++)gl.fromBufferAttribute(this,t),gl.applyNormalMatrix(e),this.setXYZ(t,gl.x,gl.y,gl.z);return this}},{key:"transformDirection",value:function(e){for(var t=0,n=this.count;t<n;t++)gl.fromBufferAttribute(this,t),gl.transformDirection(e),this.setXYZ(t,gl.x,gl.y,gl.z);return this}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"getComponent",value:function(e,t){var n=this.array[e*this.itemSize+t];return this.normalized&&(n=fo(n,this.array)),n}},{key:"setComponent",value:function(e,t,n){return this.normalized&&(n=po(n,this.array)),this.array[e*this.itemSize+t]=n,this}},{key:"getX",value:function(e){var t=this.array[e*this.itemSize];return this.normalized&&(t=fo(t,this.array)),t}},{key:"setX",value:function(e,t){return this.normalized&&(t=po(t,this.array)),this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){var t=this.array[e*this.itemSize+1];return this.normalized&&(t=fo(t,this.array)),t}},{key:"setY",value:function(e,t){return this.normalized&&(t=po(t,this.array)),this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){var t=this.array[e*this.itemSize+2];return this.normalized&&(t=fo(t,this.array)),t}},{key:"setZ",value:function(e,t){return this.normalized&&(t=po(t,this.array)),this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){var t=this.array[e*this.itemSize+3];return this.normalized&&(t=fo(t,this.array)),t}},{key:"setW",value:function(e,t){return this.normalized&&(t=po(t,this.array)),this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,n){return e*=this.itemSize,this.normalized&&(t=po(t,this.array),n=po(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}},{key:"setXYZ",value:function(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=po(t,this.array),n=po(n,this.array),r=po(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}},{key:"setXYZW",value:function(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=po(t,this.array),n=po(n,this.array),r=po(r,this.array),i=po(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Qa&&(e.usage=this.usage),e}}])}(),Sl=function(e){function t(e,n,r){return Ti(this,t),yi(this,t,[new Uint16Array(e),n,r])}return bi(t,e),Ai(t)}(xl),wl=function(e){function t(e,n,r){return Ti(this,t),yi(this,t,[new Uint32Array(e),n,r])}return bi(t,e),Ai(t)}(xl),El=function(e){function t(e,n,r){return Ti(this,t),yi(this,t,[new Float32Array(e),n,r])}return bi(t,e),Ai(t)}(xl),Ml=0,Tl=new xs,Cl=new Ys,Al=new go,Pl=new Yo,kl=new Yo,Ol=new go,Rl=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).isBufferGeometry=!0,Object.defineProperty(e,"id",{value:Ml++}),e.uuid=lo(),e.name="",e.type="BufferGeometry",e.index=null,e.indirect=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return bi(t,e),Ai(t,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(wo(e)?wl:Sl)(e,1):this.index=e,this}},{key:"setIndirect",value:function(e){return this.indirect=e,this}},{key:"getIndirect",value:function(){return this.indirect}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new xo).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return Tl.makeRotationFromQuaternion(e),this.applyMatrix4(Tl),this}},{key:"rotateX",value:function(e){return Tl.makeRotationX(e),this.applyMatrix4(Tl),this}},{key:"rotateY",value:function(e){return Tl.makeRotationY(e),this.applyMatrix4(Tl),this}},{key:"rotateZ",value:function(e){return Tl.makeRotationZ(e),this.applyMatrix4(Tl),this}},{key:"translate",value:function(e,t,n){return Tl.makeTranslation(e,t,n),this.applyMatrix4(Tl),this}},{key:"scale",value:function(e,t,n){return Tl.makeScale(e,t,n),this.applyMatrix4(Tl),this}},{key:"lookAt",value:function(e){return Cl.lookAt(e),Cl.updateMatrix(),this.applyMatrix4(Cl.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Al).negate(),this.translate(Al.x,Al.y,Al.z),this}},{key:"setFromPoints",value:function(e){var t=this.getAttribute("position");if(void 0===t){for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new El(n,3))}else{for(var o=Math.min(e.length,t.count),s=0;s<o;s++){var l=e[s];t.setXYZ(s,l.x,l.y,l.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}},{key:"computeBoundingBox",value:function(){null===this.boundingBox&&(this.boundingBox=new Yo);var e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new go(-1/0,-1/0,-1/0),new go(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];Pl.setFromBufferAttribute(i),this.morphTargetsRelative?(Ol.addVectors(this.boundingBox.min,Pl.min),this.boundingBox.expandByPoint(Ol),Ol.addVectors(this.boundingBox.max,Pl.max),this.boundingBox.expandByPoint(Ol)):(this.boundingBox.expandByPoint(Pl.min),this.boundingBox.expandByPoint(Pl.max))}}else 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)}},{key:"computeBoundingSphere",value:function(){null===this.boundingSphere&&(this.boundingSphere=new ds);var e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new go,1/0);if(e){var n=this.boundingSphere.center;if(Pl.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];kl.setFromBufferAttribute(a),this.morphTargetsRelative?(Ol.addVectors(Pl.min,kl.min),Pl.expandByPoint(Ol),Ol.addVectors(Pl.max,kl.max),Pl.expandByPoint(Ol)):(Pl.expandByPoint(kl.min),Pl.expandByPoint(kl.max))}Pl.getCenter(n);for(var o=0,s=0,l=e.count;s<l;s++)Ol.fromBufferAttribute(e,s),o=Math.max(o,n.distanceToSquared(Ol));if(t)for(var u=0,c=t.length;u<c;u++)for(var h=t[u],d=this.morphTargetsRelative,f=0,p=h.count;f<p;f++)Ol.fromBufferAttribute(h,f),d&&(Al.fromBufferAttribute(e,f),Ol.add(Al)),o=Math.max(o,n.distanceToSquared(Ol));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}},{key:"computeTangents",value:function(){var e=this.index,t=this.attributes;if(null!==e&&void 0!==t.position&&void 0!==t.normal&&void 0!==t.uv){var n=t.position,r=t.normal,i=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new xl(new Float32Array(4*n.count),4));for(var a=this.getAttribute("tangent"),o=[],s=[],l=0;l<n.count;l++)o[l]=new go,s[l]=new go;var u=new go,c=new go,h=new go,d=new mo,f=new mo,p=new mo,v=new go,m=new go,y=this.groups;0===y.length&&(y=[{start:0,count:e.count}]);for(var g=0,_=y.length;g<_;++g)for(var b=y[g],x=b.start,S=x,w=x+b.count;S<w;S+=3)N(e.getX(S+0),e.getX(S+1),e.getX(S+2));for(var E=new go,M=new go,T=new go,C=new go,A=0,P=y.length;A<P;++A)for(var k=y[A],O=k.start,R=O,I=O+k.count;R<I;R+=3)L(e.getX(R+0)),L(e.getX(R+1)),L(e.getX(R+2))}else console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");function N(e,t,r){u.fromBufferAttribute(n,e),c.fromBufferAttribute(n,t),h.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),c.sub(u),h.sub(u),f.sub(d),p.sub(d);var a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(v.copy(c).multiplyScalar(p.y).addScaledVector(h,-f.y).multiplyScalar(a),m.copy(h).multiplyScalar(f.x).addScaledVector(c,-p.x).multiplyScalar(a),o[e].add(v),o[t].add(v),o[r].add(v),s[e].add(m),s[t].add(m),s[r].add(m))}function L(e){T.fromBufferAttribute(r,e),C.copy(T);var t=o[e];E.copy(t),E.sub(T.multiplyScalar(T.dot(t))).normalize(),M.crossVectors(C,t);var n=M.dot(s[e])<0?-1:1;a.setXYZW(e,E.x,E.y,E.z,n)}}},{key:"computeVertexNormals",value:function(){var e=this.index,t=this.getAttribute("position");if(void 0!==t){var n=this.getAttribute("normal");if(void 0===n)n=new xl(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(var r=0,i=n.count;r<i;r++)n.setXYZ(r,0,0,0);var a=new go,o=new go,s=new go,l=new go,u=new go,c=new go,h=new go,d=new go;if(e)for(var f=0,p=e.count;f<p;f+=3){var v=e.getX(f+0),m=e.getX(f+1),y=e.getX(f+2);a.fromBufferAttribute(t,v),o.fromBufferAttribute(t,m),s.fromBufferAttribute(t,y),h.subVectors(s,o),d.subVectors(a,o),h.cross(d),l.fromBufferAttribute(n,v),u.fromBufferAttribute(n,m),c.fromBufferAttribute(n,y),l.add(h),u.add(h),c.add(h),n.setXYZ(v,l.x,l.y,l.z),n.setXYZ(m,u.x,u.y,u.z),n.setXYZ(y,c.x,c.y,c.z)}else for(var g=0,_=t.count;g<_;g+=3)a.fromBufferAttribute(t,g+0),o.fromBufferAttribute(t,g+1),s.fromBufferAttribute(t,g+2),h.subVectors(s,o),d.subVectors(a,o),h.cross(d),n.setXYZ(g+0,h.x,h.y,h.z),n.setXYZ(g+1,h.x,h.y,h.z),n.setXYZ(g+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}},{key:"normalizeNormals",value:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Ol.fromBufferAttribute(e,t),Ol.normalize(),e.setXYZ(t,Ol.x,Ol.y,Ol.z)}},{key:"toNonIndexed",value:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0,l=0,u=t.length;l<u;l++){o=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*r;for(var c=0;c<r;c++)a[s++]=n[o++]}return new xl(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;var n=new t,r=this.index.array,i=this.attributes;for(var a in i){var o=e(i[a],r);n.setAttribute(a,o)}var s=this.morphAttributes;for(var l in s){for(var u=[],c=s[l],h=0,d=c.length;h<d;h++){var f=e(c[h],r);u.push(f)}n.morphAttributes[l]=u}n.morphTargetsRelative=this.morphTargetsRelative;for(var p=this.groups,v=0,m=p.length;v<m;v++){var y=p[v];n.addGroup(y.start,y.count,y.materialIndex)}return n}},{key:"toJSON",value:function(){var e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var a in i){var o=i[a];e.data.attributes[a]=o.toJSON(e.data)}var s={},l=!1;for(var u in this.morphAttributes){for(var c=this.morphAttributes[u],h=[],d=0,f=c.length;d<f;d++){var p=c[d];h.push(p.toJSON(e.data))}h.length>0&&(s[u]=h,l=!0)}l&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var v=this.groups;v.length>0&&(e.data.groups=JSON.parse(JSON.stringify(v)));var m=this.boundingSphere;return null!==m&&(e.data.boundingSphere=m.toJSON()),e}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone());var r=e.attributes;for(var i in r){var a=r[i];this.setAttribute(i,a.clone(t))}var o=e.morphAttributes;for(var s in o){for(var l=[],u=o[s],c=0,h=u.length;c<h;c++)l.push(u[c].clone(t));this.morphAttributes[s]=l}this.morphTargetsRelative=e.morphTargetsRelative;for(var d=e.groups,f=0,p=d.length;f<p;f++){var v=d[f];this.addGroup(v.start,v.count,v.materialIndex)}var m=e.boundingBox;null!==m&&(this.boundingBox=m.clone());var y=e.boundingSphere;return null!==y&&(this.boundingSphere=y.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}])}(ro),Il=new xs,Nl=new bs,Ll=new ds,Dl=new go,Ul=new go,Fl=new go,Bl=new go,zl=new go,jl=new go,Hl=new go,Vl=new go,Gl=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rl,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new yl;return Ti(this,t),(e=yi(this,t)).isMesh=!0,e.type="Mesh",e.geometry=n,e.material=r,e.morphTargetDictionary=void 0,e.morphTargetInfluences=void 0,e.count=1,e.updateMorphTargets(),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){var n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var r=0,i=n.length;r<i;r++){var a=n[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}},{key:"getVertexPosition",value:function(e,t){var n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);var o=this.morphTargetInfluences;if(i&&o){jl.set(0,0,0);for(var s=0,l=i.length;s<l;s++){var u=o[s],c=i[s];0!==u&&(zl.fromBufferAttribute(c,e),a?jl.addScaledVector(zl,u):jl.addScaledVector(zl.sub(t),u))}t.add(jl)}return t}},{key:"raycast",value:function(e,t){var n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),Ll.copy(n.boundingSphere),Ll.applyMatrix4(i),Nl.copy(e.ray).recast(e.near),!1===Ll.containsPoint(Nl.origin)){if(null===Nl.intersectSphere(Ll,Dl))return;if(Nl.origin.distanceToSquared(Dl)>Math.pow(e.far-e.near,2))return}Il.copy(i).invert(),Nl.copy(e.ray).applyMatrix4(Il),null!==n.boundingBox&&!1===Nl.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,Nl)}}},{key:"_computeIntersections",value:function(e,t,n){var r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,l=i.attributes.uv,u=i.attributes.uv1,c=i.attributes.normal,h=i.groups,d=i.drawRange;if(null!==o)if(Array.isArray(a))for(var f=0,p=h.length;f<p;f++)for(var v=h[f],m=a[v.materialIndex],y=Math.max(v.start,d.start),g=Math.min(o.count,Math.min(v.start+v.count,d.start+d.count));y<g;y+=3)(r=Wl(this,m,e,n,l,u,c,o.getX(y),o.getX(y+1),o.getX(y+2)))&&(r.faceIndex=Math.floor(y/3),r.face.materialIndex=v.materialIndex,t.push(r));else for(var _=Math.max(0,d.start),b=Math.min(o.count,d.start+d.count);_<b;_+=3)(r=Wl(this,a,e,n,l,u,c,o.getX(_),o.getX(_+1),o.getX(_+2)))&&(r.faceIndex=Math.floor(_/3),t.push(r));else if(void 0!==s)if(Array.isArray(a))for(var x=0,S=h.length;x<S;x++)for(var w=h[x],E=a[w.materialIndex],M=Math.max(w.start,d.start),T=Math.min(s.count,Math.min(w.start+w.count,d.start+d.count));M<T;M+=3)(r=Wl(this,E,e,n,l,u,c,M,M+1,M+2))&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=w.materialIndex,t.push(r));else for(var C=Math.max(0,d.start),A=Math.min(s.count,d.start+d.count);C<A;C+=3)(r=Wl(this,a,e,n,l,u,c,C,C+1,C+2))&&(r.faceIndex=Math.floor(C/3),t.push(r))}}])}(Ys);function Wl(e,t,n,r,i,a,o,s,l,u){e.getVertexPosition(s,Ul),e.getVertexPosition(l,Fl),e.getVertexPosition(u,Bl);var c=function(e,t,n,r,i,a,o,s){if(null===(1===t.side?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,0===t.side,s)))return null;Vl.copy(s),Vl.applyMatrix4(e.matrixWorld);var l=n.ray.origin.distanceTo(Vl);return l<n.near||l>n.far?null:{distance:l,point:Vl.clone(),object:e}}(e,t,n,r,Ul,Fl,Bl,Hl);if(c){var h=new go;ll.getBarycoord(Hl,Ul,Fl,Bl,h),i&&(c.uv=ll.getInterpolatedAttribute(i,s,l,u,h,new mo)),a&&(c.uv1=ll.getInterpolatedAttribute(a,s,l,u,h,new mo)),o&&(c.normal=ll.getInterpolatedAttribute(o,s,l,u,h,new go),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));var d={a:s,b:l,c:u,normal:new go,materialIndex:0};ll.getNormal(Ul,Fl,Bl,d.normal),c.face=d,c.barycoord=h}return c}var Xl=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;Ti(this,t),(e=yi(this,t)).type="BoxGeometry",e.parameters={width:n,height:r,depth:i,widthSegments:a,heightSegments:o,depthSegments:s};var l=e;a=Math.floor(a),o=Math.floor(o),s=Math.floor(s);var u=[],c=[],h=[],d=[],f=0,p=0;function v(e,t,n,r,i,a,o,s,v,m,y){for(var g=a/v,_=o/m,b=a/2,x=o/2,S=s/2,w=v+1,E=m+1,M=0,T=0,C=new go,A=0;A<E;A++)for(var P=A*_-x,k=0;k<w;k++){var O=k*g-b;C[e]=O*r,C[t]=P*i,C[n]=S,c.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=s>0?1:-1,h.push(C.x,C.y,C.z),d.push(k/v),d.push(1-A/m),M+=1}for(var R=0;R<m;R++)for(var I=0;I<v;I++){var N=f+I+w*R,L=f+I+w*(R+1),D=f+(I+1)+w*(R+1),U=f+(I+1)+w*R;u.push(N,L,U),u.push(L,D,U),T+=6}l.addGroup(p,T,y),p+=T,f+=M}return v("z","y","x",-1,-1,i,r,n,s,o,0),v("z","y","x",1,-1,i,r,-n,s,o,1),v("x","z","y",1,1,n,i,r,a,s,2),v("x","z","y",1,-1,n,i,-r,a,s,3),v("x","y","z",1,-1,n,r,i,a,o,4),v("x","y","z",-1,-1,n,r,-i,a,o,5),e.setIndex(u),e.setAttribute("position",new El(c,3)),e.setAttribute("normal",new El(h,3)),e.setAttribute("uv",new El(d,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}])}(Rl);function ql(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][r]=null):t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function Yl(e){for(var t={},n=0;n<e.length;n++){var r=ql(e[n]);for(var i in r)t[i]=r[i]}return t}function Jl(e){var t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:No.workingColorSpace}var Zl,Kl={clone:ql,merge:Yl},$l=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isShaderMaterial=!0,n.type="ShaderMaterial",n.defines={},n.uniforms={},n.uniformsGroups=[],n.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",n.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",n.linewidth=1,n.wireframe=!1,n.wireframeLinewidth=1,n.fog=!1,n.lights=!1,n.clipping=!1,n.forceSinglePass=!0,n.extensions={clipCullDistance:!1,multiDraw:!1},n.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},n.index0AttributeName=void 0,n.uniformsNeedUpdate=!1,n.glslVersion=null,void 0!==e&&n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ql(e.uniforms),this.uniformsGroups=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].clone());return t}(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}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);for(var r in n.glslVersion=this.glslVersion,n.uniforms={},this.uniforms){var i=this.uniforms[r].value;i&&i.isTexture?n.uniforms[r]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?n.uniforms[r]={type:"c",value:i.getHex()}:i&&i.isVector2?n.uniforms[r]={type:"v2",value:i.toArray()}:i&&i.isVector3?n.uniforms[r]={type:"v3",value:i.toArray()}:i&&i.isVector4?n.uniforms[r]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?n.uniforms[r]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?n.uniforms[r]={type:"m4",value:i.toArray()}:n.uniforms[r]={value:i}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;var a={};for(var o in this.extensions)!0===this.extensions[o]&&(a[o]=!0);return Object.keys(a).length>0&&(n.extensions=a),n}}])}(ml),Ql=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).isCamera=!0,e.type="Camera",e.matrixWorldInverse=new xs,e.projectionMatrix=new xs,e.projectionMatrixInverse=new xs,e.coordinateSystem=to,e._reversedDepth=!1,e}return bi(t,e),Ai(t,[{key:"reversedDepth",get:function(){return this._reversedDepth}},{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}},{key:"getWorldDirection",value:function(e){return ci(t,"getWorldDirection",this,3)([e]).negate()}},{key:"updateMatrixWorld",value:function(e){ci(t,"updateMatrixWorld",this,3)([e]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,n){ci(t,"updateWorldMatrix",this,3)([e,n]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(Ys),eu=new go,tu=new mo,nu=new mo,ru=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;return Ti(this,t),(e=yi(this,t)).isPerspectiveCamera=!0,e.type="PerspectiveCamera",e.fov=n,e.zoom=1,e.near=i,e.far=a,e.focus=10,e.aspect=r,e.view=null,e.filmGauge=35,e.filmOffset=0,e.updateProjectionMatrix(),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}},{key:"setFocalLength",value:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*so*Math.atan(t),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*oo*this.fov);return.5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*so*Math.atan(Math.tan(.5*oo*this.fov)/this.zoom)}},{key:"getFilmWidth",value:function(){return this.filmGauge*Math.min(this.aspect,1)}},{key:"getFilmHeight",value:function(){return this.filmGauge/Math.max(this.aspect,1)}},{key:"getViewBounds",value:function(e,t,n){eu.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(eu.x,eu.y).multiplyScalar(-e/eu.z),eu.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(eu.x,eu.y).multiplyScalar(-e/eu.z)}},{key:"getViewSize",value:function(e,t){return this.getViewBounds(e,tu,nu),t.subVectors(nu,tu)}},{key:"setViewOffset",value:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(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=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=this.near,t=e*Math.tan(.5*oo*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,null!==this.view&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}])}(Ql),iu=-90,au=function(e){function t(e,n,r){var i;Ti(this,t),(i=yi(this,t)).type="CubeCamera",i.renderTarget=r,i.coordinateSystem=null,i.activeMipmapLevel=0;var a=new ru(iu,1,e,n);a.layers=i.layers,i.add(a);var o=new ru(iu,1,e,n);o.layers=i.layers,i.add(o);var s=new ru(iu,1,e,n);s.layers=i.layers,i.add(s);var l=new ru(iu,1,e,n);l.layers=i.layers,i.add(l);var u=new ru(iu,1,e,n);u.layers=i.layers,i.add(u);var c=new ru(iu,1,e,n);return c.layers=i.layers,i.add(c),i}return bi(t,e),Ai(t,[{key:"updateCoordinateSystem",value:function(){var e,t=this.coordinateSystem,n=this.children.concat(),r=ui(n,6),i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=li(n);try{for(c.s();!(e=c.n()).done;){var h=e.value;this.remove(h)}}catch(e){c.e(e)}finally{c.f()}if(t===to)i.up.set(0,1,0),i.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else{if(t!==no)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);i.up.set(0,-1,0),i.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1)}var d,f=li(n);try{for(f.s();!(d=f.n()).done;){var p=d.value;this.add(p),p.updateMatrixWorld()}}catch(e){f.e(e)}finally{f.f()}}},{key:"update",value:function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,r=this.activeMipmapLevel;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());var i=ui(this.children,6),a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],c=i[5],h=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;var v=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,a),e.setRenderTarget(n,1,r),e.render(t,o),e.setRenderTarget(n,2,r),e.render(t,s),e.setRenderTarget(n,3,r),e.render(t,l),e.setRenderTarget(n,4,r),e.render(t,u),n.texture.generateMipmaps=v,e.setRenderTarget(n,5,r),e.render(t,c),e.setRenderTarget(h,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}])}(Ys),ou=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ni,i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0,c=arguments.length>8?arguments[8]:void 0,h=arguments.length>9?arguments[9]:void 0;return Ti(this,t),(e=yi(this,t,[n,r,i,a,o,s,l,u,c,h])).isCubeTexture=!0,e.flipY=!1,e}return bi(t,e),Ai(t,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}])}(Vo),su=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ti(this,t),(e=yi(this,t,[n,n,r])).isWebGLCubeRenderTarget=!0;var i={width:n,height:n,depth:1},a=[i,i,i,i,i,i];return e.texture=new ou(a),e._setTextureOptions(r),e.texture.isRenderTargetTexture=!0,e}return bi(t,e),Ai(t,[{key:"fromEquirectangularTexture",value:function(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;var n=new Xl(5,5,5),r=new $l({name:"CubemapFromEquirect",uniforms:ql({tEquirect:{value:null}}),vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",side:1,blending:0});r.uniforms.tEquirect.value=t;var i=new Gl(n,r),a=t.minFilter;return t.minFilter===Xi&&(t.minFilter=Gi),new au(1,10,this).update(e,i),t.minFilter=a,i.geometry.dispose(),i.material.dispose(),this}},{key:"clear",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=e.getRenderTarget(),a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(i)}}])}(Wo),lu=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).isGroup=!0,e.type="Group",e}return bi(t,e),Ai(t)}(Ys),uu={type:"move"},cu=function(){return Ai((function e(){Ti(this,e),this._targetRay=null,this._grip=null,this._hand=null}),[{key:"getHandSpace",value:function(){return null===this._hand&&(this._hand=new lu,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}},{key:"getTargetRaySpace",value:function(){return null===this._targetRay&&(this._targetRay=new lu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new go,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new go),this._targetRay}},{key:"getGripSpace",value:function(){return null===this._grip&&(this._grip=new lu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new go,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new go),this._grip}},{key:"dispatchEvent",value:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}},{key:"connect",value:function(e){if(e&&e.hand){var t=this._hand;if(t){var n,r=li(e.hand.values());try{for(r.s();!(n=r.n()).done;){var i=n.value;this._getHandJoint(t,i)}}catch(e){r.e(e)}finally{r.f()}}}return this.dispatchEvent({type:"connected",data:e}),this}},{key:"disconnect",value:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}},{key:"update",value:function(e,t,n){var r=null,i=null,a=null,o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;var u,c=li(e.hand.values());try{for(c.s();!(u=c.n()).done;){var h=u.value,d=t.getJointPose(h,n),f=this._getHandJoint(l,h);null!==d&&(f.matrix.fromArray(d.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,f.jointRadius=d.radius),f.visible=null!==d}}catch(e){c.e(e)}finally{c.f()}var p=l.joints["index-finger-tip"],v=l.joints["thumb-tip"],m=p.position.distanceTo(v.position);l.inputState.pinching&&m>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&m<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1);null!==o&&(null===(r=t.getPose(e.targetRaySpace,n))&&null!==i&&(r=i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(uu)))}return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}},{key:"_getHandJoint",value:function(e,t){if(void 0===e.joints[t.jointName]){var n=new lu;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}])}(),hu=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25e-5;Ti(this,e),this.isFogExp2=!0,this.name="",this.color=new fl(t),this.density=n}return Ai(e,[{key:"clone",value:function(){return new e(this.color,this.density)}},{key:"toJSON",value:function(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}])}(),du=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;Ti(this,e),this.isFog=!0,this.name="",this.color=new fl(t),this.near=n,this.far=r}return Ai(e,[{key:"clone",value:function(){return new e(this.color,this.near,this.far)}},{key:"toJSON",value:function(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}])}(),fu=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).isScene=!0,e.type="Scene",e.background=null,e.environment=null,e.fog=null,e.backgroundBlurriness=0,e.backgroundIntensity=1,e.backgroundRotation=new Os,e.environmentIntensity=1,e.environmentRotation=new Os,e.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:e})),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);return null!==this.fog&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}])}(Ys),pu=function(){return Ai((function e(t,n){Ti(this,e),this.isInterleavedBuffer=!0,this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=Qa,this.updateRanges=[],this.version=0,this.uuid=lo()}),[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"addUpdateRange",value:function(e,t){this.updateRanges.push({start:e,count:t})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"clone",value:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=lo()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"toJSON",value:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=lo()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}])}(),vu=new go,mu=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Ti(this,e),this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=n,this.offset=r,this.normalized=i}return Ai(e,[{key:"count",get:function(){return this.data.count}},{key:"array",get:function(){return this.data.array}},{key:"needsUpdate",set:function(e){this.data.needsUpdate=e}},{key:"applyMatrix4",value:function(e){for(var t=0,n=this.data.count;t<n;t++)vu.fromBufferAttribute(this,t),vu.applyMatrix4(e),this.setXYZ(t,vu.x,vu.y,vu.z);return this}},{key:"applyNormalMatrix",value:function(e){for(var t=0,n=this.count;t<n;t++)vu.fromBufferAttribute(this,t),vu.applyNormalMatrix(e),this.setXYZ(t,vu.x,vu.y,vu.z);return this}},{key:"transformDirection",value:function(e){for(var t=0,n=this.count;t<n;t++)vu.fromBufferAttribute(this,t),vu.transformDirection(e),this.setXYZ(t,vu.x,vu.y,vu.z);return this}},{key:"getComponent",value:function(e,t){var n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=fo(n,this.array)),n}},{key:"setComponent",value:function(e,t,n){return this.normalized&&(n=po(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}},{key:"setX",value:function(e,t){return this.normalized&&(t=po(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}},{key:"setY",value:function(e,t){return this.normalized&&(t=po(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}},{key:"setZ",value:function(e,t){return this.normalized&&(t=po(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}},{key:"setW",value:function(e,t){return this.normalized&&(t=po(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}},{key:"getX",value:function(e){var t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=fo(t,this.array)),t}},{key:"getY",value:function(e){var t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=fo(t,this.array)),t}},{key:"getZ",value:function(e){var t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=fo(t,this.array)),t}},{key:"getW",value:function(e){var t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=fo(t,this.array)),t}},{key:"setXY",value:function(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=po(t,this.array),n=po(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}},{key:"setXYZ",value:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=po(t,this.array),n=po(n,this.array),r=po(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}},{key:"setXYZW",value:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=po(t,this.array),n=po(n,this.array),r=po(r,this.array),i=po(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}},{key:"clone",value:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");for(var n=[],r=0;r<this.count;r++)for(var i=r*this.data.stride+this.offset,a=0;a<this.itemSize;a++)n.push(this.data.array[i+a]);return new xl(new this.array.constructor(n),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}},{key:"toJSON",value:function(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");for(var t=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)t.push(this.data.array[r+i]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}])}(),yu=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isSpriteMaterial=!0,n.type="SpriteMaterial",n.color=new fl(16777215),n.map=null,n.alphaMap=null,n.rotation=0,n.sizeAttenuation=!0,n.transparent=!0,n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}])}(ml),gu=new go,_u=new go,bu=new go,xu=new mo,Su=new mo,wu=new xs,Eu=new go,Mu=new go,Tu=new go,Cu=new mo,Au=new mo,Pu=new mo,ku=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new yu;if(Ti(this,t),(e=yi(this,t)).isSprite=!0,e.type="Sprite",void 0===Zl){Zl=new Rl;var r=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new pu(r,5);Zl.setIndex([0,1,2,0,2,3]),Zl.setAttribute("position",new mu(i,3,0,!1)),Zl.setAttribute("uv",new mu(i,2,3,!1))}return e.geometry=Zl,e.material=n,e.center=new mo(.5,.5),e.count=1,e}return bi(t,e),Ai(t,[{key:"raycast",value:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),_u.setFromMatrixScale(this.matrixWorld),wu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),bu.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&_u.multiplyScalar(-bu.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;Ou(Eu.set(-.5,-.5,0),bu,a,_u,n,r),Ou(Mu.set(.5,-.5,0),bu,a,_u,n,r),Ou(Tu.set(.5,.5,0),bu,a,_u,n,r),Cu.set(0,0),Au.set(1,0),Pu.set(1,1);var o=e.ray.intersectTriangle(Eu,Mu,Tu,!1,gu);if(null!==o||(Ou(Mu.set(-.5,.5,0),bu,a,_u,n,r),Au.set(0,1),null!==(o=e.ray.intersectTriangle(Eu,Tu,Mu,!1,gu)))){var s=e.ray.origin.distanceTo(gu);s<e.near||s>e.far||t.push({distance:s,point:gu.clone(),uv:ll.getInterpolation(gu,Eu,Mu,Tu,Cu,Au,Pu,new mo),face:null,object:this})}}},{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}])}(Ys);function Ou(e,t,n,r,i,a){xu.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(Su.x=a*xu.x-i*xu.y,Su.y=i*xu.x+a*xu.y):Su.copy(xu),e.copy(t),e.x+=Su.x,e.y+=Su.y,e.applyMatrix4(wu)}var Ru=new go,Iu=new go,Nu=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).isLOD=!0,e._currentLevel=0,e.type="LOD",Object.defineProperties(e,{levels:{enumerable:!0,value:[]}}),e.autoUpdate=!0,e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){ci(t,"copy",this,3)([e,!1]);for(var n=e.levels,r=0,i=n.length;r<i;r++){var a=n[r];this.addLevel(a.object.clone(),a.distance,a.hysteresis)}return this.autoUpdate=e.autoUpdate,this}},{key:"addLevel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t=Math.abs(t);var r,i=this.levels;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}},{key:"removeLevel",value:function(e){for(var t=this.levels,n=0;n<t.length;n++)if(t[n].distance===e){var r=t.splice(n,1);return this.remove(r[0].object),!0}return!1}},{key:"getCurrentLevel",value:function(){return this._currentLevel}},{key:"getObjectForDistance",value:function(e){var t=this.levels;if(t.length>0){var n,r;for(n=1,r=t.length;n<r;n++){var i=t[n].distance;if(t[n].object.visible&&(i-=i*t[n].hysteresis),e<i)break}return t[n-1].object}return null}},{key:"raycast",value:function(e,t){if(this.levels.length>0){Ru.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Ru);this.getObjectForDistance(n).raycast(e,t)}}},{key:"update",value:function(e){var t=this.levels;if(t.length>1){Ru.setFromMatrixPosition(e.matrixWorld),Iu.setFromMatrixPosition(this.matrixWorld);var n,r,i=Ru.distanceTo(Iu)/e.zoom;for(t[0].object.visible=!0,n=1,r=t.length;n<r;n++){var a=t[n].distance;if(t[n].object.visible&&(a-=a*t[n].hysteresis),!(i>=a))break;t[n-1].object.visible=!1,t[n].object.visible=!0}for(this._currentLevel=n-1;n<r;n++)t[n].object.visible=!1}}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);!1===this.autoUpdate&&(n.object.autoUpdate=!1),n.object.levels=[];for(var r=this.levels,i=0,a=r.length;i<a;i++){var o=r[i];n.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return n}}])}(Ys),Lu=new go,Du=new Go,Uu=new Go,Fu=new go,Bu=new xs,zu=new go,ju=new ds,Hu=new xs,Vu=new bs,Gu=function(e){function t(e,n){var r;return Ti(this,t),(r=yi(this,t,[e,n])).isSkinnedMesh=!0,r.type="SkinnedMesh",r.bindMode=Ii,r.bindMatrix=new xs,r.bindMatrixInverse=new xs,r.boundingBox=null,r.boundingSphere=null,r}return bi(t,e),Ai(t,[{key:"computeBoundingBox",value:function(){var e=this.geometry;null===this.boundingBox&&(this.boundingBox=new Yo),this.boundingBox.makeEmpty();for(var t=e.getAttribute("position"),n=0;n<t.count;n++)this.getVertexPosition(n,zu),this.boundingBox.expandByPoint(zu)}},{key:"computeBoundingSphere",value:function(){var e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new ds),this.boundingSphere.makeEmpty();for(var t=e.getAttribute("position"),n=0;n<t.count;n++)this.getVertexPosition(n,zu),this.boundingSphere.expandByPoint(zu)}},{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}},{key:"raycast",value:function(e,t){var n=this.material,r=this.matrixWorld;void 0!==n&&(null===this.boundingSphere&&this.computeBoundingSphere(),ju.copy(this.boundingSphere),ju.applyMatrix4(r),!1!==e.ray.intersectsSphere(ju)&&(Hu.copy(r).invert(),Vu.copy(e.ray).applyMatrix4(Hu),null!==this.boundingBox&&!1===Vu.intersectsBox(this.boundingBox)||this._computeIntersections(e,t,Vu)))}},{key:"getVertexPosition",value:function(e,n){return ci(t,"getVertexPosition",this,3)([e,n]),this.applyBoneTransform(e,n),n}},{key:"bind",value:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}},{key:"pose",value:function(){this.skeleton.pose()}},{key:"normalizeSkinWeights",value:function(){for(var e=new Go,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);var i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}},{key:"updateMatrixWorld",value:function(e){ci(t,"updateMatrixWorld",this,3)([e]),this.bindMode===Ii?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}},{key:"applyBoneTransform",value:function(e,t){var n=this.skeleton,r=this.geometry;Du.fromBufferAttribute(r.attributes.skinIndex,e),Uu.fromBufferAttribute(r.attributes.skinWeight,e),Lu.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(var i=0;i<4;i++){var a=Uu.getComponent(i);if(0!==a){var o=Du.getComponent(i);Bu.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Fu.copy(Lu).applyMatrix4(Bu),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}])}(Gl),Wu=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).isBone=!0,e.type="Bone",e}return bi(t,e),Ai(t)}(Ys),Xu=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Hi,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Hi,d=arguments.length>10?arguments[10]:void 0,f=arguments.length>11?arguments[11]:void 0;return Ti(this,t),(e=yi(this,t,[null,s,l,u,c,h,a,o,d,f])).isDataTexture=!0,e.image={data:n,width:r,height:i},e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return bi(t,e),Ai(t)}(Vo),qu=new xs,Yu=new xs,Ju=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Ti(this,e),this.uuid=lo(),this.bones=t.slice(0),this.boneInverses=n,this.boneMatrices=null,this.boneTexture=null,this.init()}return Ai(e,[{key:"init",value:function(){var e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new xs)}}},{key:"calculateInverses",value:function(){this.boneInverses.length=0;for(var e=0,t=this.bones.length;e<t;e++){var n=new xs;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}},{key:"pose",value:function(){for(var e=0,t=this.bones.length;e<t;e++){var n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(var r=0,i=this.bones.length;r<i;r++){var a=this.bones[r];a&&(a.parent&&a.parent.isBone?(a.matrix.copy(a.parent.matrixWorld).invert(),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale))}}},{key:"update",value:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:Yu;qu.multiplyMatrices(o,t[i]),qu.toArray(n,16*i)}null!==r&&(r.needsUpdate=!0)}},{key:"clone",value:function(){return new e(this.bones,this.boneInverses)}},{key:"computeBoneTexture",value:function(){var e=Math.sqrt(4*this.bones.length);e=4*Math.ceil(e/4),e=Math.max(e,4);var t=new Float32Array(e*e*4);t.set(this.boneMatrices);var n=new Xu(t,e,e,na,Ki);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}},{key:"getBoneByName",value:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}},{key:"dispose",value:function(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}},{key:"fromJSON",value:function(e,t){this.uuid=e.uuid;for(var n=0,r=e.bones.length;n<r;n++){var i=e.bones[n],a=t[i];void 0===a&&(console.warn("THREE.Skeleton: No bone found with UUID:",i),a=new Wu),this.bones.push(a),this.boneInverses.push((new xs).fromArray(e.boneInverses[n]))}return this.init(),this}},{key:"toJSON",value:function(){var e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;for(var t=this.bones,n=this.boneInverses,r=0,i=t.length;r<i;r++){var a=t[r];e.bones.push(a.uuid);var o=n[r];e.boneInverses.push(o.toArray())}return e}}])}(),Zu=function(e){function t(e,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Ti(this,t),(i=yi(this,t,[e,n,r])).isInstancedBufferAttribute=!0,i.meshPerAttribute=a,i}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}])}(xl),Ku=new xs,$u=new xs,Qu=[],ec=new Yo,tc=new xs,nc=new Gl,rc=new ds,ic=function(e){function t(e,n,r){var i;Ti(this,t),(i=yi(this,t,[e,n])).isInstancedMesh=!0,i.instanceMatrix=new Zu(new Float32Array(16*r),16),i.instanceColor=null,i.morphTexture=null,i.count=r,i.boundingBox=null,i.boundingSphere=null;for(var a=0;a<r;a++)i.setMatrixAt(a,tc);return i}return bi(t,e),Ai(t,[{key:"computeBoundingBox",value:function(){var e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new Yo),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(var n=0;n<t;n++)this.getMatrixAt(n,Ku),ec.copy(e.boundingBox).applyMatrix4(Ku),this.boundingBox.union(ec)}},{key:"computeBoundingSphere",value:function(){var e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new ds),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(var n=0;n<t;n++)this.getMatrixAt(n,Ku),rc.copy(e.boundingSphere).applyMatrix4(Ku),this.boundingSphere.union(rc)}},{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),this.instanceMatrix.copy(e.instanceMatrix),null!==e.morphTexture&&(this.morphTexture=e.morphTexture.clone()),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}},{key:"getColorAt",value:function(e,t){t.fromArray(this.instanceColor.array,3*e)}},{key:"getMatrixAt",value:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)}},{key:"getMorphAt",value:function(e,t){for(var n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,i=e*(n.length+1)+1,a=0;a<n.length;a++)n[a]=r[i+a]}},{key:"raycast",value:function(e,t){var n=this.matrixWorld,r=this.count;if(nc.geometry=this.geometry,nc.material=this.material,void 0!==nc.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),rc.copy(this.boundingSphere),rc.applyMatrix4(n),!1!==e.ray.intersectsSphere(rc)))for(var i=0;i<r;i++){this.getMatrixAt(i,Ku),$u.multiplyMatrices(n,Ku),nc.matrixWorld=$u,nc.raycast(e,Qu);for(var a=0,o=Qu.length;a<o;a++){var s=Qu[a];s.instanceId=i,s.object=this,t.push(s)}Qu.length=0}}},{key:"setColorAt",value:function(e,t){null===this.instanceColor&&(this.instanceColor=new Zu(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),t.toArray(this.instanceColor.array,3*e)}},{key:"setMatrixAt",value:function(e,t){t.toArray(this.instanceMatrix.array,16*e)}},{key:"setMorphAt",value:function(e,t){var n=t.morphTargetInfluences,r=n.length+1;null===this.morphTexture&&(this.morphTexture=new Xu(new Float32Array(r*this.count),r,this.count,aa,Ki));for(var i=this.morphTexture.source.data.data,a=0,o=0;o<n.length;o++)a+=n[o];var s=this.geometry.morphTargetsRelative?1:1-a,l=r*e;i[l]=s,i.set(n,l+1)}},{key:"updateMorphTargets",value:function(){}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}])}(Gl),ac=new go,oc=new go,sc=new xo,lc=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new go(1,0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ti(this,e),this.isPlane=!0,this.normal=t,this.constant=n}),[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,n){var r=ac.subVectors(n,t).cross(oc.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}},{key:"intersectLine",value:function(e,t){var n=e.delta(ac),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var n=t||sc.getNormalMatrix(e),r=this.coplanarPoint(ac).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),uc=new ds,cc=new mo(.5,.5),hc=new go,dc=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new lc,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new lc,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new lc,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new lc,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new lc,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new lc;Ti(this,e),this.planes=[t,n,r,i,a,o]}),[{key:"set",value:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:to,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],c=i[5],h=i[6],d=i[7],f=i[8],p=i[9],v=i[10],m=i[11],y=i[12],g=i[13],_=i[14],b=i[15];if(r[0].setComponents(l-a,d-u,m-f,b-y).normalize(),r[1].setComponents(l+a,d+u,m+f,b+y).normalize(),r[2].setComponents(l+o,d+c,m+p,b+g).normalize(),r[3].setComponents(l-o,d-c,m-p,b-g).normalize(),n)r[4].setComponents(s,h,v,_).normalize(),r[5].setComponents(l-s,d-h,m-v,b-_).normalize();else if(r[4].setComponents(l-s,d-h,m-v,b-_).normalize(),t===to)r[5].setComponents(l+s,d+h,m+v,b+_).normalize();else{if(t!==no)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);r[5].setComponents(s,h,v,_).normalize()}return this}},{key:"intersectsObject",value:function(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),uc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{var t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),uc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(uc)}},{key:"intersectsSprite",value:function(e){uc.center.set(0,0,0);var t=cc.distanceTo(e.center);return uc.radius=.7071067811865476+t,uc.applyMatrix4(e.matrixWorld),this.intersectsSphere(uc)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(n)<r)return!1;return!0}},{key:"intersectsBox",value:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(hc.x=r.normal.x>0?e.max.x:e.min.x,hc.y=r.normal.y>0?e.max.y:e.min.y,hc.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(hc)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),fc=new xs,pc=new dc,vc=function(){function e(){Ti(this,e),this.coordinateSystem=to}return Ai(e,[{key:"intersectsObject",value:function(e,t){if(!t.isArrayCamera||0===t.cameras.length)return!1;for(var n=0;n<t.cameras.length;n++){var r=t.cameras[n];if(fc.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),pc.setFromProjectionMatrix(fc,r.coordinateSystem,r.reversedDepth),pc.intersectsObject(e))return!0}return!1}},{key:"intersectsSprite",value:function(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(var n=0;n<t.cameras.length;n++){var r=t.cameras[n];if(fc.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),pc.setFromProjectionMatrix(fc,r.coordinateSystem,r.reversedDepth),pc.intersectsSprite(e))return!0}return!1}},{key:"intersectsSphere",value:function(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(var n=0;n<t.cameras.length;n++){var r=t.cameras[n];if(fc.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),pc.setFromProjectionMatrix(fc,r.coordinateSystem,r.reversedDepth),pc.intersectsSphere(e))return!0}return!1}},{key:"intersectsBox",value:function(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(var n=0;n<t.cameras.length;n++){var r=t.cameras[n];if(fc.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),pc.setFromProjectionMatrix(fc,r.coordinateSystem,r.reversedDepth),pc.intersectsBox(e))return!0}return!1}},{key:"containsPoint",value:function(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(var n=0;n<t.cameras.length;n++){var r=t.cameras[n];if(fc.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),pc.setFromProjectionMatrix(fc,r.coordinateSystem,r.reversedDepth),pc.containsPoint(e))return!0}return!1}},{key:"clone",value:function(){return new e}}])}();function mc(e,t){return e-t}function yc(e,t){return e.z-t.z}function gc(e,t){return t.z-e.z}var _c=function(){return Ai((function e(){Ti(this,e),this.index=0,this.pool=[],this.list=[]}),[{key:"push",value:function(e,t,n,r){var i=this.pool,a=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});var o=i[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=n,o.index=r}},{key:"reset",value:function(){this.list.length=0,this.index=0}}])}(),bc=new xs,xc=new fl(1,1,1),Sc=new dc,wc=new vc,Ec=new Yo,Mc=new ds,Tc=new go,Cc=new go,Ac=new go,Pc=new _c,kc=new Gl,Oc=[];function Rc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor)for(var i=e.count,a=0;a<i;a++)for(var o=0;o<r;o++)t.setComponent(a+n,o,e.getComponent(a,o));else t.array.set(e.array,n*r);t.needsUpdate=!0}function Ic(e,t){if(e.constructor!==t.constructor)for(var n=Math.min(e.length,t.length),r=0;r<n;r++)t[r]=e[r];else{var i=Math.min(e.length,t.length);t.set(new e.constructor(e.buffer,0,i))}}var Nc=function(e){function t(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2*n,a=arguments.length>3?arguments[3]:void 0;return Ti(this,t),(r=yi(this,t,[new Rl,a])).isBatchedMesh=!0,r.perObjectFrustumCulled=!0,r.sortObjects=!0,r.boundingBox=null,r.boundingSphere=null,r.customSort=null,r._instanceInfo=[],r._geometryInfo=[],r._availableInstanceIds=[],r._availableGeometryIds=[],r._nextIndexStart=0,r._nextVertexStart=0,r._geometryCount=0,r._visibilityChanged=!0,r._geometryInitialized=!1,r._maxInstanceCount=e,r._maxVertexCount=n,r._maxIndexCount=i,r._multiDrawCounts=new Int32Array(e),r._multiDrawStarts=new Int32Array(e),r._multiDrawCount=0,r._multiDrawInstances=null,r._matricesTexture=null,r._indirectTexture=null,r._colorsTexture=null,r._initMatricesTexture(),r._initIndirectTexture(),r}return bi(t,e),Ai(t,[{key:"maxInstanceCount",get:function(){return this._maxInstanceCount}},{key:"instanceCount",get:function(){return this._instanceInfo.length-this._availableInstanceIds.length}},{key:"unusedVertexCount",get:function(){return this._maxVertexCount-this._nextVertexStart}},{key:"unusedIndexCount",get:function(){return this._maxIndexCount-this._nextIndexStart}},{key:"_initMatricesTexture",value:function(){var e=Math.sqrt(4*this._maxInstanceCount);e=4*Math.ceil(e/4),e=Math.max(e,4);var t=new Float32Array(e*e*4),n=new Xu(t,e,e,na,Ki);this._matricesTexture=n}},{key:"_initIndirectTexture",value:function(){var e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);var t=new Uint32Array(e*e),n=new Xu(t,e,e,oa,Zi);this._indirectTexture=n}},{key:"_initColorsTexture",value:function(){var e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);var t=new Float32Array(e*e*4).fill(1),n=new Xu(t,e,e,na,Ki);n.colorSpace=No.workingColorSpace,this._colorsTexture=n}},{key:"_initializeGeometry",value:function(e){var t=this.geometry,n=this._maxVertexCount,r=this._maxIndexCount;if(!1===this._geometryInitialized){for(var i in e.attributes){var a=e.getAttribute(i),o=a.array,s=a.itemSize,l=a.normalized,u=new o.constructor(n*s),c=new xl(u,s,l);t.setAttribute(i,c)}if(null!==e.getIndex()){var h=n>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new xl(h,1))}this._geometryInitialized=!0}}},{key:"_validateGeometry",value:function(e){var t=this.geometry;if(Boolean(e.getIndex())!==Boolean(t.getIndex()))throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(var n in t.attributes){if(!e.hasAttribute(n))throw new Error('THREE.BatchedMesh: Added geometry missing "'.concat(n,'". All geometries must have consistent attributes.'));var r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}},{key:"validateInstanceId",value:function(e){var t=this._instanceInfo;if(e<0||e>=t.length||!1===t[e].active)throw new Error("THREE.BatchedMesh: Invalid instanceId ".concat(e,". Instance is either out of range or has been deleted."))}},{key:"validateGeometryId",value:function(e){var t=this._geometryInfo;if(e<0||e>=t.length||!1===t[e].active)throw new Error("THREE.BatchedMesh: Invalid geometryId ".concat(e,". Geometry is either out of range or has been deleted."))}},{key:"setCustomSort",value:function(e){return this.customSort=e,this}},{key:"computeBoundingBox",value:function(){null===this.boundingBox&&(this.boundingBox=new Yo);var e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(var n=0,r=t.length;n<r;n++)if(!1!==t[n].active){var i=t[n].geometryIndex;this.getMatrixAt(n,bc),this.getBoundingBoxAt(i,Ec).applyMatrix4(bc),e.union(Ec)}}},{key:"computeBoundingSphere",value:function(){null===this.boundingSphere&&(this.boundingSphere=new ds);var e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(var n=0,r=t.length;n<r;n++)if(!1!==t[n].active){var i=t[n].geometryIndex;this.getMatrixAt(n,bc),this.getBoundingSphereAt(i,Mc).applyMatrix4(bc),e.union(Mc)}}},{key:"addInstance",value:function(e){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw new Error("THREE.BatchedMesh: Maximum item count reached.");var t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(mc),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));var r=this._matricesTexture;bc.identity().toArray(r.image.data,16*n),r.needsUpdate=!0;var i=this._colorsTexture;return i&&(xc.toArray(i.image.data,4*n),i.needsUpdate=!0),this._visibilityChanged=!0,n}},{key:"addGeometry",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this._initializeGeometry(e),this._validateGeometry(e);var r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},i=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=-1===t?e.getAttribute("position").count:t;var a,o=e.getIndex();if(null!==o&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=-1===n?o.count:n),-1!==r.indexStart&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(mc),i[a=this._availableGeometryIds.shift()]=r):(a=this._geometryCount,this._geometryCount++,i.push(r)),this.setGeometryAt(a,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,a}},{key:"setGeometryAt",value:function(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);var n=this.geometry,r=null!==n.getIndex(),i=n.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(r&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");var s=o.vertexStart,l=o.reservedVertexCount;for(var u in o.vertexCount=t.getAttribute("position").count,n.attributes){var c=t.getAttribute(u),h=n.getAttribute(u);Rc(c,h,s);for(var d=c.itemSize,f=c.count,p=l;f<p;f++)for(var v=s+f,m=0;m<d;m++)h.setComponent(v,m,0);h.needsUpdate=!0,h.addUpdateRange(s*d,l*d)}if(r){var y=o.indexStart,g=o.reservedIndexCount;o.indexCount=t.getIndex().count;for(var _=0;_<a.count;_++)i.setX(y+_,s+a.getX(_));for(var b=a.count,x=g;b<x;b++)i.setX(y+b,s);i.needsUpdate=!0,i.addUpdateRange(y,o.reservedIndexCount)}return o.start=r?o.indexStart:o.vertexStart,o.count=r?o.indexCount:o.vertexCount,o.boundingBox=null,null!==t.boundingBox&&(o.boundingBox=t.boundingBox.clone()),o.boundingSphere=null,null!==t.boundingSphere&&(o.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}},{key:"deleteGeometry",value:function(e){var t=this._geometryInfo;if(e>=t.length||!1===t[e].active)return this;for(var n=this._instanceInfo,r=0,i=n.length;r<i;r++)n[r].active&&n[r].geometryIndex===e&&this.deleteInstance(r);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}},{key:"deleteInstance",value:function(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}},{key:"optimize",value:function(){for(var e=0,t=0,n=this._geometryInfo,r=n.map((function(e,t){return t})).sort((function(e,t){return n[e].vertexStart-n[t].vertexStart})),i=this.geometry,a=0,o=n.length;a<o;a++){var s=r[a],l=n[s];if(!1!==l.active){if(null!==i.index){if(l.indexStart!==t){for(var u=l.indexStart,c=l.vertexStart,h=l.reservedIndexCount,d=i.index,f=d.array,p=e-c,v=u;v<u+h;v++)f[v]=f[v]+p;d.array.copyWithin(t,u,u+h),d.addUpdateRange(t,h),l.indexStart=t}t+=l.reservedIndexCount}if(l.vertexStart!==e){var m=l.vertexStart,y=l.reservedVertexCount,g=i.attributes;for(var _ in g){var b=g[_],x=b.array,S=b.itemSize;x.copyWithin(e*S,m*S,(m+y)*S),b.addUpdateRange(e*S,y*S)}l.vertexStart=e}e+=l.reservedVertexCount,l.start=i.index?l.indexStart:l.vertexStart,this._nextIndexStart=i.index?l.indexStart+l.reservedIndexCount:0,this._nextVertexStart=l.vertexStart+l.reservedVertexCount}}return this}},{key:"getBoundingBoxAt",value:function(e,t){if(e>=this._geometryCount)return null;var n=this.geometry,r=this._geometryInfo[e];if(null===r.boundingBox){for(var i=new Yo,a=n.index,o=n.attributes.position,s=r.start,l=r.start+r.count;s<l;s++){var u=s;a&&(u=a.getX(u)),i.expandByPoint(Tc.fromBufferAttribute(o,u))}r.boundingBox=i}return t.copy(r.boundingBox),t}},{key:"getBoundingSphereAt",value:function(e,t){if(e>=this._geometryCount)return null;var n=this.geometry,r=this._geometryInfo[e];if(null===r.boundingSphere){var i=new ds;this.getBoundingBoxAt(e,Ec),Ec.getCenter(i.center);for(var a=n.index,o=n.attributes.position,s=0,l=r.start,u=r.start+r.count;l<u;l++){var c=l;a&&(c=a.getX(c)),Tc.fromBufferAttribute(o,c),s=Math.max(s,i.center.distanceToSquared(Tc))}i.radius=Math.sqrt(s),r.boundingSphere=i}return t.copy(r.boundingSphere),t}},{key:"setMatrixAt",value:function(e,t){this.validateInstanceId(e);var n=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,16*e),n.needsUpdate=!0,this}},{key:"getMatrixAt",value:function(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,16*e)}},{key:"setColorAt",value:function(e,t){return this.validateInstanceId(e),null===this._colorsTexture&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,4*e),this._colorsTexture.needsUpdate=!0,this}},{key:"getColorAt",value:function(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,4*e)}},{key:"setVisibleAt",value:function(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t||(this._instanceInfo[e].visible=t,this._visibilityChanged=!0),this}},{key:"getVisibleAt",value:function(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}},{key:"setGeometryIdAt",value:function(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}},{key:"getGeometryIdAt",value:function(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}},{key:"getGeometryRangeAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.validateGeometryId(e);var n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}},{key:"setInstanceCount",value:function(e){var t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(mc);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw new Error("BatchedMesh: Instance ids outside the range ".concat(e," are being used. Cannot shrink instance count."));var r=new Int32Array(e),i=new Int32Array(e);Ic(this._multiDrawCounts,r),Ic(this._multiDrawStarts,i),this._multiDrawCounts=r,this._multiDrawStarts=i,this._maxInstanceCount=e;var a=this._indirectTexture,o=this._matricesTexture,s=this._colorsTexture;a.dispose(),this._initIndirectTexture(),Ic(a.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),Ic(o.image.data,this._matricesTexture.image.data),s&&(s.dispose(),this._initColorsTexture(),Ic(s.image.data,this._colorsTexture.image.data))}},{key:"setGeometrySize",value:function(e,t){var n=pi(this._geometryInfo).filter((function(e){return e.active}));if(Math.max.apply(Math,pi(n.map((function(e){return e.vertexStart+e.reservedVertexCount}))))>e)throw new Error("BatchedMesh: Geometry vertex values are being used outside the range ".concat(t,". Cannot shrink further."));if(this.geometry.index&&Math.max.apply(Math,pi(n.map((function(e){return e.indexStart+e.reservedIndexCount}))))>t)throw new Error("BatchedMesh: Geometry index values are being used outside the range ".concat(t,". Cannot shrink further."));var r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Rl,this._initializeGeometry(r));var i=this.geometry;for(var a in r.index&&Ic(r.index.array,i.index.array),r.attributes)Ic(r.attributes[a].array,i.attributes[a].array)}},{key:"raycast",value:function(e,t){var n=this._instanceInfo,r=this._geometryInfo,i=this.matrixWorld,a=this.geometry;kc.material=this.material,kc.geometry.index=a.index,kc.geometry.attributes=a.attributes,null===kc.geometry.boundingBox&&(kc.geometry.boundingBox=new Yo),null===kc.geometry.boundingSphere&&(kc.geometry.boundingSphere=new ds);for(var o=0,s=n.length;o<s;o++)if(n[o].visible&&n[o].active){var l=n[o].geometryIndex,u=r[l];kc.geometry.setDrawRange(u.start,u.count),this.getMatrixAt(o,kc.matrixWorld).premultiply(i),this.getBoundingBoxAt(l,kc.geometry.boundingBox),this.getBoundingSphereAt(l,kc.geometry.boundingSphere),kc.raycast(e,Oc);for(var c=0,h=Oc.length;c<h;c++){var d=Oc[c];d.object=this,d.batchId=o,t.push(d)}Oc.length=0}kc.material=null,kc.geometry.index=null,kc.geometry.attributes={},kc.geometry.setDrawRange(0,1/0)}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=null!==e.boundingBox?e.boundingBox.clone():null,this.boundingSphere=null!==e.boundingSphere?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map((function(e){return fi(fi({},e),{},{boundingBox:null!==e.boundingBox?e.boundingBox.clone():null,boundingSphere:null!==e.boundingSphere?e.boundingSphere.clone():null})})),this._instanceInfo=e._instanceInfo.map((function(e){return fi({},e)})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}},{key:"dispose",value:function(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}},{key:"onBeforeRender",value:function(e,t,n,r,i){if(this._visibilityChanged||this.perObjectFrustumCulled||this.sortObjects){var a=r.getIndex(),o=null===a?1:a.array.BYTES_PER_ELEMENT,s=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,c=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,f=d.image.data,p=n.isArrayCamera?wc:Sc;h&&!n.isArrayCamera&&(bc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),Sc.setFromProjectionMatrix(bc,n.coordinateSystem,n.reversedDepth));var v=0;if(this.sortObjects){bc.copy(this.matrixWorld).invert(),Tc.setFromMatrixPosition(n.matrixWorld).applyMatrix4(bc),Cc.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(bc);for(var m=0,y=s.length;m<y;m++)if(s[m].visible&&s[m].active){var g=s[m].geometryIndex;this.getMatrixAt(m,bc),this.getBoundingSphereAt(g,Mc).applyMatrix4(bc);var _=!1;if(h&&(_=!p.intersectsSphere(Mc,n)),!_){var b=c[g],x=Ac.subVectors(Mc.center,Tc).dot(Cc);Pc.push(b.start,b.count,x,m)}}var S=Pc.list,w=this.customSort;null===w?S.sort(i.transparent?gc:yc):w.call(this,S,n);for(var E=0,M=S.length;E<M;E++){var T=S[E];l[v]=T.start*o,u[v]=T.count,f[v]=T.index,v++}Pc.reset()}else for(var C=0,A=s.length;C<A;C++)if(s[C].visible&&s[C].active){var P=s[C].geometryIndex,k=!1;if(h&&(this.getMatrixAt(C,bc),this.getBoundingSphereAt(P,Mc).applyMatrix4(bc),k=!p.intersectsSphere(Mc,n)),!k){var O=c[P];l[v]=O.start*o,u[v]=O.count,f[v]=C,v++}}d.needsUpdate=!0,this._multiDrawCount=v,this._visibilityChanged=!1}}},{key:"onBeforeShadow",value:function(e,t,n,r,i,a){this.onBeforeRender(e,null,r,i,a)}}])}(Gl),Lc=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isLineBasicMaterial=!0,n.type="LineBasicMaterial",n.color=new fl(16777215),n.map=null,n.linewidth=1,n.linecap="round",n.linejoin="round",n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}])}(ml),Dc=new go,Uc=new go,Fc=new xs,Bc=new bs,zc=new ds,jc=new go,Hc=new go,Vc=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rl,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Lc;return Ti(this,t),(e=yi(this,t)).isLine=!0,e.type="Line",e.geometry=n,e.material=r,e.morphTargetDictionary=void 0,e.morphTargetInfluences=void 0,e.updateMorphTargets(),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}},{key:"computeLineDistances",value:function(){var e=this.geometry;if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)Dc.fromBufferAttribute(t,r-1),Uc.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Dc.distanceTo(Uc);e.setAttribute("lineDistance",new El(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},{key:"raycast",value:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),zc.copy(n.boundingSphere),zc.applyMatrix4(r),zc.radius+=i,!1!==e.ray.intersectsSphere(zc)){Fc.copy(r).invert(),Bc.copy(e.ray).applyMatrix4(Fc);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=this.isLineSegments?2:1,u=n.index,c=n.attributes.position;if(null!==u){for(var h=Math.max(0,a.start),d=Math.min(u.count,a.start+a.count),f=h,p=d-1;f<p;f+=l){var v=u.getX(f),m=u.getX(f+1),y=Gc(this,e,Bc,s,v,m,f);y&&t.push(y)}if(this.isLineLoop){var g=u.getX(d-1),_=u.getX(h),b=Gc(this,e,Bc,s,g,_,d-1);b&&t.push(b)}}else{for(var x=Math.max(0,a.start),S=Math.min(c.count,a.start+a.count),w=x,E=S-1;w<E;w+=l){var M=Gc(this,e,Bc,s,w,w+1,w);M&&t.push(M)}if(this.isLineLoop){var T=Gc(this,e,Bc,s,S-1,x,S-1);T&&t.push(T)}}}}},{key:"updateMorphTargets",value:function(){var e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){var n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var r=0,i=n.length;r<i;r++){var a=n[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}}])}(Ys);function Gc(e,t,n,r,i,a,o){var s=e.geometry.attributes.position;if(Dc.fromBufferAttribute(s,i),Uc.fromBufferAttribute(s,a),!(n.distanceSqToSegment(Dc,Uc,jc,Hc)>r)){jc.applyMatrix4(e.matrixWorld);var l=t.ray.origin.distanceTo(jc);if(!(l<t.near||l>t.far))return{distance:l,point:Hc.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}}var Wc=new go,Xc=new go,qc=function(e){function t(e,n){var r;return Ti(this,t),(r=yi(this,t,[e,n])).isLineSegments=!0,r.type="LineSegments",r}return bi(t,e),Ai(t,[{key:"computeLineDistances",value:function(){var e=this.geometry;if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)Wc.fromBufferAttribute(t,r),Xc.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Wc.distanceTo(Xc);e.setAttribute("lineDistance",new El(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}])}(Vc),Yc=function(e){function t(e,n){var r;return Ti(this,t),(r=yi(this,t,[e,n])).isLineLoop=!0,r.type="LineLoop",r}return bi(t,e),Ai(t)}(Vc),Jc=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isPointsMaterial=!0,n.type="PointsMaterial",n.color=new fl(16777215),n.map=null,n.alphaMap=null,n.size=1,n.sizeAttenuation=!0,n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}])}(ml),Zc=new xs,Kc=new bs,$c=new ds,Qc=new go,eh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rl,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jc;return Ti(this,t),(e=yi(this,t)).isPoints=!0,e.type="Points",e.geometry=n,e.material=r,e.morphTargetDictionary=void 0,e.morphTargetInfluences=void 0,e.updateMorphTargets(),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}},{key:"raycast",value:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),$c.copy(n.boundingSphere),$c.applyMatrix4(r),$c.radius+=i,!1!==e.ray.intersectsSphere($c)){Zc.copy(r).invert(),Kc.copy(e.ray).applyMatrix4(Zc);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=n.index,u=n.attributes.position;if(null!==l)for(var c=Math.max(0,a.start),h=Math.min(l.count,a.start+a.count);c<h;c++){var d=l.getX(c);Qc.fromBufferAttribute(u,d),th(Qc,d,s,r,e,t,this)}else for(var f=Math.max(0,a.start),p=Math.min(u.count,a.start+a.count);f<p;f++)Qc.fromBufferAttribute(u,f),th(Qc,f,s,r,e,t,this)}}},{key:"updateMorphTargets",value:function(){var e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){var n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var r=0,i=n.length;r<i;r++){var a=n[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}}])}(Ys);function th(e,t,n,r,i,a,o){var s=Kc.distanceSqToPoint(e);if(s<n){var l=new go;Kc.closestPointToPoint(e,l),l.applyMatrix4(r);var u=i.ray.origin.distanceTo(l);if(u<i.near||u>i.far)return;a.push({distance:u,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var nh=function(e){function t(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zi,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Hi,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Hi,c=arguments.length>8?arguments[8]:void 0,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:ra,d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1;if(Ti(this,t),h!==ra&&h!==ia)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return(r=yi(this,t,[{width:e,height:n,depth:d},a,o,s,l,u,h,i,c])).isDepthTexture=!0,r.flipY=!1,r.generateMipmaps=!1,r.compareFunction=null,r}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.source=new Bo(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);return null!==this.compareFunction&&(n.compareFunction=this.compareFunction),n}}])}(Vo),rh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Ti(this,t),(e=yi(this,t)).sourceTexture=n,e.isExternalTexture=!0,e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.sourceTexture=e.sourceTexture,this}}])}(Vo),ih=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;Ti(this,t),(e=yi(this,t)).type="CapsuleGeometry",e.parameters={radius:n,height:r,capSegments:i,radialSegments:a,heightSegments:o},r=Math.max(0,r),i=Math.max(1,Math.floor(i)),a=Math.max(3,Math.floor(a)),o=Math.max(1,Math.floor(o));for(var s=[],l=[],u=[],c=[],h=r/2,d=Math.PI/2*n,f=r,p=2*d+f,v=2*i+o,m=a+1,y=new go,g=new go,_=0;_<=v;_++){var b=0,x=0,S=0,w=0;if(_<=i){var E=_/i,M=E*Math.PI/2;x=-h-n*Math.cos(M),S=n*Math.sin(M),w=-n*Math.cos(M),b=E*d}else if(_<=i+o){var T=(_-i)/o;x=T*r-h,S=n,w=0,b=d+T*f}else{var C=(_-i-o)/i,A=C*Math.PI/2;x=h+n*Math.sin(A),S=n*Math.cos(A),w=n*Math.sin(A),b=d+f+C*d}var P=Math.max(0,Math.min(1,b/p)),k=0;0===_?k=.5/a:_===v&&(k=-.5/a);for(var O=0;O<=a;O++){var R=O/a,I=R*Math.PI*2,N=Math.sin(I),L=Math.cos(I);g.x=-S*L,g.y=x,g.z=S*N,l.push(g.x,g.y,g.z),y.set(-S*L,w,S*N),y.normalize(),u.push(y.x,y.y,y.z),c.push(R+k,P)}if(_>0)for(var D=(_-1)*m,U=0;U<a;U++){var F=D+U,B=D+U+1,z=_*m+U,j=_*m+U+1;s.push(F,B,z),s.push(B,j,z)}}return e.setIndex(s),e.setAttribute("position",new El(l,3)),e.setAttribute("normal",new El(u,3)),e.setAttribute("uv",new El(c,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}])}(Rl),ah=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;Ti(this,t),(e=yi(this,t)).type="CircleGeometry",e.parameters={radius:n,segments:r,thetaStart:i,thetaLength:a},r=Math.max(3,r);var o=[],s=[],l=[],u=[],c=new go,h=new mo;s.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(var d=0,f=3;d<=r;d++,f+=3){var p=i+d/r*a;c.x=n*Math.cos(p),c.y=n*Math.sin(p),s.push(c.x,c.y,c.z),l.push(0,0,1),h.x=(s[f]/n+1)/2,h.y=(s[f+1]/n+1)/2,u.push(h.x,h.y)}for(var v=1;v<=r;v++)o.push(v,v+1,0);return e.setIndex(o),e.setAttribute("position",new El(s,3)),e.setAttribute("normal",new El(l,3)),e.setAttribute("uv",new El(u,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.segments,e.thetaStart,e.thetaLength)}}])}(Rl),oh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;Ti(this,t),(e=yi(this,t)).type="CylinderGeometry",e.parameters={radiusTop:n,radiusBottom:r,height:i,radialSegments:a,heightSegments:o,openEnded:s,thetaStart:l,thetaLength:u};var c=e;a=Math.floor(a),o=Math.floor(o);var h=[],d=[],f=[],p=[],v=0,m=[],y=i/2,g=0;function _(e){for(var t=v,i=new mo,o=new go,s=0,m=!0===e?n:r,_=!0===e?1:-1,b=1;b<=a;b++)d.push(0,y*_,0),f.push(0,_,0),p.push(.5,.5),v++;for(var x=v,S=0;S<=a;S++){var w=S/a*u+l,E=Math.cos(w),M=Math.sin(w);o.x=m*M,o.y=y*_,o.z=m*E,d.push(o.x,o.y,o.z),f.push(0,_,0),i.x=.5*E+.5,i.y=.5*M*_+.5,p.push(i.x,i.y),v++}for(var T=0;T<a;T++){var C=t+T,A=x+T;!0===e?h.push(A,A+1,C):h.push(A+1,A,C),s+=3}c.addGroup(g,s,!0===e?1:2),g+=s}return function(){for(var e=new go,t=new go,s=0,_=(r-n)/i,b=0;b<=o;b++){for(var x=[],S=b/o,w=S*(r-n)+n,E=0;E<=a;E++){var M=E/a,T=M*u+l,C=Math.sin(T),A=Math.cos(T);t.x=w*C,t.y=-S*i+y,t.z=w*A,d.push(t.x,t.y,t.z),e.set(C,_,A).normalize(),f.push(e.x,e.y,e.z),p.push(M,1-S),x.push(v++)}m.push(x)}for(var P=0;P<a;P++)for(var k=0;k<o;k++){var O=m[k][P],R=m[k+1][P],I=m[k+1][P+1],N=m[k][P+1];(n>0||0!==k)&&(h.push(O,R,N),s+=3),(r>0||k!==o-1)&&(h.push(R,I,N),s+=3)}c.addGroup(g,s,0),g+=s}(),!1===s&&(n>0&&_(!0),r>0&&_(!1)),e.setIndex(h),e.setAttribute("position",new El(d,3)),e.setAttribute("normal",new El(f,3)),e.setAttribute("uv",new El(p,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}])}(Rl),sh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return Ti(this,t),(e=yi(this,t,[0,n,r,i,a,o,s,l])).type="ConeGeometry",e.parameters={radius:n,height:r,radialSegments:i,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:l},e}return bi(t,e),Ai(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}])}(oh),lh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Ti(this,t),(e=yi(this,t)).type="PolyhedronGeometry",e.parameters={vertices:n,indices:r,radius:i,detail:a};var o=[],s=[];function l(e,t,n,r){for(var i=r+1,a=[],o=0;o<=i;o++){a[o]=[];for(var s=e.clone().lerp(n,o/i),l=t.clone().lerp(n,o/i),c=i-o,h=0;h<=c;h++)a[o][h]=0===h&&o===i?s:s.clone().lerp(l,h/c)}for(var d=0;d<i;d++)for(var f=0;f<2*(i-d)-1;f++){var p=Math.floor(f/2);f%2==0?(u(a[d][p+1]),u(a[d+1][p]),u(a[d][p])):(u(a[d][p+1]),u(a[d+1][p+1]),u(a[d+1][p]))}}function u(e){o.push(e.x,e.y,e.z)}function c(e,t){var r=3*e;t.x=n[r+0],t.y=n[r+1],t.z=n[r+2]}function h(e,t,n,r){r<0&&1===e.x&&(s[t]=e.x-1),0===n.x&&0===n.z&&(s[t]=r/2/Math.PI+.5)}function d(e){return Math.atan2(e.z,-e.x)}return function(e){for(var t=new go,n=new go,i=new go,a=0;a<r.length;a+=3)c(r[a+0],t),c(r[a+1],n),c(r[a+2],i),l(t,n,i,e)}(a),function(e){for(var t=new go,n=0;n<o.length;n+=3)t.x=o[n+0],t.y=o[n+1],t.z=o[n+2],t.normalize().multiplyScalar(e),o[n+0]=t.x,o[n+1]=t.y,o[n+2]=t.z}(i),function(){for(var e=new go,t=0;t<o.length;t+=3){e.x=o[t+0],e.y=o[t+1],e.z=o[t+2];var n=d(e)/2/Math.PI+.5,r=(i=e,Math.atan2(-i.y,Math.sqrt(i.x*i.x+i.z*i.z))/Math.PI+.5);s.push(n,1-r)}var i;(function(){for(var e=new go,t=new go,n=new go,r=new go,i=new mo,a=new mo,l=new mo,u=0,c=0;u<o.length;u+=9,c+=6){e.set(o[u+0],o[u+1],o[u+2]),t.set(o[u+3],o[u+4],o[u+5]),n.set(o[u+6],o[u+7],o[u+8]),i.set(s[c+0],s[c+1]),a.set(s[c+2],s[c+3]),l.set(s[c+4],s[c+5]),r.copy(e).add(t).add(n).divideScalar(3);var f=d(r);h(i,c+0,e,f),h(a,c+2,t,f),h(l,c+4,n,f)}})(),function(){for(var e=0;e<s.length;e+=6){var t=s[e+0],n=s[e+2],r=s[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);i>.9&&a<.1&&(t<.2&&(s[e+0]+=1),n<.2&&(s[e+2]+=1),r<.2&&(s[e+4]+=1))}}()}(),e.setAttribute("position",new El(o,3)),e.setAttribute("normal",new El(o.slice(),3)),e.setAttribute("uv",new El(s,2)),0===a?e.computeVertexNormals():e.normalizeNormals(),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.vertices,e.indices,e.radius,e.details)}}])}(Rl),uh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ti(this,t);var i=(1+Math.sqrt(5))/2,a=1/i;return(e=yi(this,t,[[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-a,-i,0,-a,i,0,a,-i,0,a,i,-a,-i,0,-a,i,0,a,-i,0,a,i,0,-i,0,-a,i,0,-a,-i,0,a,i,0,a],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],n,r])).type="DodecahedronGeometry",e.parameters={radius:n,detail:r},e}return bi(t,e),Ai(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(lh),ch=new go,hh=new go,dh=new go,fh=new ll,ph=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(Ti(this,t),(e=yi(this,t)).type="EdgesGeometry",e.parameters={geometry:n,thresholdAngle:r},null!==n){for(var i=Math.pow(10,4),a=Math.cos(oo*r),o=n.getIndex(),s=n.getAttribute("position"),l=o?o.count:s.count,u=[0,0,0],c=["a","b","c"],h=new Array(3),d={},f=[],p=0;p<l;p+=3){o?(u[0]=o.getX(p),u[1]=o.getX(p+1),u[2]=o.getX(p+2)):(u[0]=p,u[1]=p+1,u[2]=p+2);var v=fh.a,m=fh.b,y=fh.c;if(v.fromBufferAttribute(s,u[0]),m.fromBufferAttribute(s,u[1]),y.fromBufferAttribute(s,u[2]),fh.getNormal(dh),h[0]="".concat(Math.round(v.x*i),",").concat(Math.round(v.y*i),",").concat(Math.round(v.z*i)),h[1]="".concat(Math.round(m.x*i),",").concat(Math.round(m.y*i),",").concat(Math.round(m.z*i)),h[2]="".concat(Math.round(y.x*i),",").concat(Math.round(y.y*i),",").concat(Math.round(y.z*i)),h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(var g=0;g<3;g++){var _=(g+1)%3,b=h[g],x=h[_],S=fh[c[g]],w=fh[c[_]],E="".concat(b,"_").concat(x),M="".concat(x,"_").concat(b);M in d&&d[M]?(dh.dot(d[M].normal)<=a&&(f.push(S.x,S.y,S.z),f.push(w.x,w.y,w.z)),d[M]=null):E in d||(d[E]={index0:u[g],index1:u[_],normal:dh.clone()})}}for(var T in d)if(d[T]){var C=d[T],A=C.index0,P=C.index1;ch.fromBufferAttribute(s,A),hh.fromBufferAttribute(s,P),f.push(ch.x,ch.y,ch.z),f.push(hh.x,hh.y,hh.z)}e.setAttribute("position",new El(f,3))}return e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}])}(Rl),vh=function(){return Ai((function e(){Ti(this,e),this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}),[{key:"getPoint",value:function(){console.warn("THREE.Curve: .getPoint() not implemented.")}},{key:"getPointAt",value:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n=[],r=this.getPoint(0),i=0;n.push(0);for(var a=1;a<=e;a++)i+=(t=this.getPoint(a/e)).distanceTo(r),n.push(i),r=t;return this.cacheArcLengths=n,n}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getLengths(),i=0,a=r.length;t=n||e*r[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=r[i=Math.floor(s+(l-s)/2)]-t)<0)s=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(r[i=l]===t)return i/(a-1);var u=r[i];return(i+(t-u)/(r[i+1]-u))/(a-1)}},{key:"getTangent",value:function(e,t){var n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);var a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new mo:new go);return s.copy(o).sub(a).normalize(),s}},{key:"getTangentAt",value:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)}},{key:"computeFrenetFrames",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new go,r=[],i=[],a=[],o=new go,s=new xs,l=0;l<=e;l++){var u=l/e;r[l]=this.getTangentAt(u,new go)}i[0]=new go,a[0]=new go;var c=Number.MAX_VALUE,h=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);h<=c&&(c=h,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),f<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(var p=1;p<=e;p++){if(i[p]=i[p-1].clone(),a[p]=a[p-1].clone(),o.crossVectors(r[p-1],r[p]),o.length()>Number.EPSILON){o.normalize();var v=Math.acos(uo(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(o,v))}a[p].crossVectors(r[p],i[p])}if(!0===t){var m=Math.acos(uo(i[0].dot(i[e]),-1,1));m/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(m=-m);for(var y=1;y<=e;y++)i[y].applyMatrix4(s.makeRotationAxis(r[y],m*y)),a[y].crossVectors(r[y],i[y])}return{tangents:r,normals:i,binormals:a}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}])}(),mh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return Ti(this,t),(e=yi(this,t)).isEllipseCurve=!0,e.type="EllipseCurve",e.aX=n,e.aY=r,e.xRadius=i,e.yRadius=a,e.aStartAngle=o,e.aEndAngle=s,e.aClockwise=l,e.aRotation=u,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,i=Math.abs(r)<Number.EPSILON;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=i?0:n),!0!==this.aClockwise||i||(r===n?r=-n:r-=n);var a=this.aStartAngle+e*r,o=this.aX+this.xRadius*Math.cos(a),s=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),c=o-this.aX,h=s-this.aY;o=c*l-h*u+this.aX,s=c*u+h*l+this.aY}return t.set(o,s)}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}},{key:"fromJSON",value:function(e){return ci(t,"fromJSON",this,3)([e]),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}])}(vh),yh=function(e){function t(e,n,r,i,a,o){var s;return Ti(this,t),(s=yi(this,t,[e,n,r,r,i,a,o])).isArcCurve=!0,s.type="ArcCurve",s}return bi(t,e),Ai(t)}(mh);function gh(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var l=(t-e)/a-(n-e)/(a+o)+(n-t)/o,u=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,l*=o,u*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}var _h=new go,bh=new gh,xh=new gh,Sh=new gh,wh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return Ti(this,t),(e=yi(this,t)).isCatmullRomCurve3=!0,e.type="CatmullRomCurve3",e.points=n,e.closed=r,e.curveType=i,e.tension=a,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go,i=this.points,a=i.length,o=(a-(this.closed?0:1))*e,s=Math.floor(o),l=o-s;this.closed?s+=s>0?0:(Math.floor(Math.abs(s)/a)+1)*a:0===l&&s===a-1&&(s=a-2,l=1),this.closed||s>0?t=i[(s-1)%a]:(_h.subVectors(i[0],i[1]).add(i[0]),t=_h);var u=i[s%a],c=i[(s+1)%a];if(this.closed||s+2<a?n=i[(s+2)%a]:(_h.subVectors(i[a-1],i[a-2]).add(i[a-1]),n=_h),"centripetal"===this.curveType||"chordal"===this.curveType){var h="chordal"===this.curveType?.5:.25,d=Math.pow(t.distanceToSquared(u),h),f=Math.pow(u.distanceToSquared(c),h),p=Math.pow(c.distanceToSquared(n),h);f<1e-4&&(f=1),d<1e-4&&(d=f),p<1e-4&&(p=f),bh.initNonuniformCatmullRom(t.x,u.x,c.x,n.x,d,f,p),xh.initNonuniformCatmullRom(t.y,u.y,c.y,n.y,d,f,p),Sh.initNonuniformCatmullRom(t.z,u.z,c.z,n.z,d,f,p)}else"catmullrom"===this.curveType&&(bh.initCatmullRom(t.x,u.x,c.x,n.x,this.tension),xh.initCatmullRom(t.y,u.y,c.y,n.y,this.tension),Sh.initCatmullRom(t.z,u.z,c.z,n.z,this.tension));return r.set(bh.calc(l),xh.calc(l),Sh.calc(l)),r}},{key:"copy",value:function(e){ci(t,"copy",this,3)([e]),this.points=[];for(var n=0,r=e.points.length;n<r;n++){var i=e.points[n];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);e.points=[];for(var n=0,r=this.points.length;n<r;n++){var i=this.points[n];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}},{key:"fromJSON",value:function(e){ci(t,"fromJSON",this,3)([e]),this.points=[];for(var n=0,r=e.points.length;n<r;n++){var i=e.points[n];this.points.push((new go).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}])}(vh);function Eh(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function Mh(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Th(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}var Ch=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new mo,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new mo,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new mo;return Ti(this,t),(e=yi(this,t)).isCubicBezierCurve=!0,e.type="CubicBezierCurve",e.v0=n,e.v1=r,e.v2=i,e.v3=a,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo,n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(Th(e,n.x,r.x,i.x,a.x),Th(e,n.y,r.y,i.y,a.y)),t}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return ci(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}])}(vh),Ah=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new go,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new go,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new go;return Ti(this,t),(e=yi(this,t)).isCubicBezierCurve3=!0,e.type="CubicBezierCurve3",e.v0=n,e.v1=r,e.v2=i,e.v3=a,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go,n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(Th(e,n.x,r.x,i.x,a.x),Th(e,n.y,r.y,i.y,a.y),Th(e,n.z,r.z,i.z,a.z)),t}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return ci(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}])}(vh),Ph=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new mo,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo;return Ti(this,t),(e=yi(this,t)).isLineCurve=!0,e.type="LineCurve",e.v1=n,e.v2=r,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo).subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,t){return this.getTangent(e,t)}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return ci(t,"fromJSON",this,3)([e]),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vh),kh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new go,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go;return Ti(this,t),(e=yi(this,t)).isLineCurve3=!0,e.type="LineCurve3",e.v1=n,e.v2=r,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go).subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,t){return this.getTangent(e,t)}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return ci(t,"fromJSON",this,3)([e]),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vh),Oh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new mo,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new mo;return Ti(this,t),(e=yi(this,t)).isQuadraticBezierCurve=!0,e.type="QuadraticBezierCurve",e.v0=n,e.v1=r,e.v2=i,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo,n=this.v0,r=this.v1,i=this.v2;return t.set(Mh(e,n.x,r.x,i.x),Mh(e,n.y,r.y,i.y)),t}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return ci(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vh),Rh=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new go,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new go;return Ti(this,t),(e=yi(this,t)).isQuadraticBezierCurve3=!0,e.type="QuadraticBezierCurve3",e.v0=n,e.v1=r,e.v2=i,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new go,n=this.v0,r=this.v1,i=this.v2;return t.set(Mh(e,n.x,r.x,i.x),Mh(e,n.y,r.y,i.y),Mh(e,n.z,r.z,i.z)),t}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return ci(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vh),Ih=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ti(this,t),(e=yi(this,t)).isSplineCurve=!0,e.type="SplineCurve",e.points=n,e}return bi(t,e),Ai(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mo,n=this.points,r=(n.length-1)*e,i=Math.floor(r),a=r-i,o=n[0===i?i:i-1],s=n[i],l=n[i>n.length-2?n.length-1:i+1],u=n[i>n.length-3?n.length-1:i+2];return t.set(Eh(a,o.x,s.x,l.x,u.x),Eh(a,o.y,s.y,l.y,u.y)),t}},{key:"copy",value:function(e){ci(t,"copy",this,3)([e]),this.points=[];for(var n=0,r=e.points.length;n<r;n++){var i=e.points[n];this.points.push(i.clone())}return this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);e.points=[];for(var n=0,r=this.points.length;n<r;n++){var i=this.points[n];e.points.push(i.toArray())}return e}},{key:"fromJSON",value:function(e){ci(t,"fromJSON",this,3)([e]),this.points=[];for(var n=0,r=e.points.length;n<r;n++){var i=e.points[n];this.points.push((new mo).fromArray(i))}return this}}])}(vh),Nh=Object.freeze({__proto__:null,ArcCurve:yh,CatmullRomCurve3:wh,CubicBezierCurve:Ch,CubicBezierCurve3:Ah,EllipseCurve:mh,LineCurve:Ph,LineCurve3:kh,QuadraticBezierCurve:Oh,QuadraticBezierCurve3:Rh,SplineCurve:Ih}),Lh=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).type="Path",n.currentPoint=new mo,e&&n.setFromPoints(e),n}return bi(t,e),Ai(t,[{key:"setFromPoints",value:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}},{key:"moveTo",value:function(e,t){return this.currentPoint.set(e,t),this}},{key:"lineTo",value:function(e,t){var n=new Ph(this.currentPoint.clone(),new mo(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}},{key:"quadraticCurveTo",value:function(e,t,n,r){var i=new Oh(this.currentPoint.clone(),new mo(e,t),new mo(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}},{key:"bezierCurveTo",value:function(e,t,n,r,i,a){var o=new Ch(this.currentPoint.clone(),new mo(e,t),new mo(n,r),new mo(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}},{key:"splineThru",value:function(e){var t=[this.currentPoint.clone()].concat(e),n=new Ih(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}},{key:"arc",value:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this}},{key:"absarc",value:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this}},{key:"ellipse",value:function(e,t,n,r,i,a,o,s){var l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,n,r,i,a,o,s),this}},{key:"absellipse",value:function(e,t,n,r,i,a,o,s){var l=new mh(e,t,n,r,i,a,o,s);if(this.curves.length>0){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var c=l.getPoint(1);return this.currentPoint.copy(c),this}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return ci(t,"fromJSON",this,3)([e]),this.currentPoint.fromArray(e.currentPoint),this}}])}(function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return bi(t,e),Ai(t,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){var n=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Nh[n](t,e))}return this}},{key:"getPoint",value:function(e,t){for(var n=e*this.getLength(),r=this.getCurveLengths(),i=0;i<r.length;){if(r[i]>=n){var a=r[i]-n,o=this.curves[i],s=o.getLength(),l=0===s?0:1-a/s;return o.getPointAt(l,t)}i++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}},{key:"getPoints",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a.isEllipseCurve?2*t:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),l=0;l<s.length;l++){var u=s[l];e&&e.equals(u)||(n.push(u),e=u)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}},{key:"copy",value:function(e){ci(t,"copy",this,3)([e]),this.curves=[];for(var n=0,r=e.curves.length;n<r;n++){var i=e.curves[n];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);e.autoClose=this.autoClose,e.curves=[];for(var n=0,r=this.curves.length;n<r;n++){var i=this.curves[n];e.curves.push(i.toJSON())}return e}},{key:"fromJSON",value:function(e){ci(t,"fromJSON",this,3)([e]),this.autoClose=e.autoClose,this.curves=[];for(var n=0,r=e.curves.length;n<r;n++){var i=e.curves[n];this.curves.push((new Nh[i.type]).fromJSON(i))}return this}}])}(vh)),Dh=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t,[e])).uuid=lo(),n.type="Shape",n.holes=[],n}return bi(t,e),Ai(t,[{key:"getPointsHoles",value:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}},{key:"extractPoints",value:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}},{key:"copy",value:function(e){ci(t,"copy",this,3)([e]),this.holes=[];for(var n=0,r=e.holes.length;n<r;n++){var i=e.holes[n];this.holes.push(i.clone())}return this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);e.uuid=this.uuid,e.holes=[];for(var n=0,r=this.holes.length;n<r;n++){var i=this.holes[n];e.holes.push(i.toJSON())}return e}},{key:"fromJSON",value:function(e){ci(t,"fromJSON",this,3)([e]),this.uuid=e.uuid,this.holes=[];for(var n=0,r=e.holes.length;n<r;n++){var i=e.holes[n];this.holes.push((new Lh).fromJSON(i))}return this}}])}(Lh);function Uh(e,t,n,r,i){var a;if(i===function(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(var o=t;o<n;o+=r)a=ad(o/r|0,e[o],e[o+1],a);else for(var s=n-r;s>=t;s-=r)a=ad(s/r|0,e[s],e[s+1],a);return a&&Qh(a,a.next)&&(od(a),a=a.next),a}function Fh(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Qh(r,r.next)&&0!==$h(r.prev,r,r.next))r=r.next;else{if(od(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Bh(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do{0===i.z&&(i.z=qh(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n=1;do{var r=e,i=void 0;e=null;var a=null;for(t=0;r;){t++;for(var o=r,s=0,l=0;l<n&&(s++,o=o.nextZ);l++);for(var u=n;s>0||u>0&&o;)0!==s&&(0===u||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1)}(i)}(e,r,i,a);for(var s=e;e.prev!==e.next;){var l=e.prev,u=e.next;if(a?jh(e,r,i,a):zh(e))t.push(l.i,e.i,u.i),od(e),e=u.next,s=u.next;else if((e=u)===s){o?1===o?Bh(e=Hh(Fh(e),t),t,n,r,i,a,2):2===o&&Vh(e,t,n,r,i,a):Bh(Fh(e),t,n,r,i,a,1);break}}}}function zh(e){var t=e.prev,n=e,r=e.next;if($h(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,l=n.y,u=r.y,c=Math.min(i,a,o),h=Math.min(s,l,u),d=Math.max(i,a,o),f=Math.max(s,l,u),p=r.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&Zh(i,s,a,l,o,u,p.x,p.y)&&$h(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function jh(e,t,n,r){var i=e.prev,a=e,o=e.next;if($h(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,u=o.x,c=i.y,h=a.y,d=o.y,f=Math.min(s,l,u),p=Math.min(c,h,d),v=Math.max(s,l,u),m=Math.max(c,h,d),y=qh(f,p,t,n,r),g=qh(v,m,t,n,r),_=e.prevZ,b=e.nextZ;_&&_.z>=y&&b&&b.z<=g;){if(_.x>=f&&_.x<=v&&_.y>=p&&_.y<=m&&_!==i&&_!==o&&Zh(s,c,l,h,u,d,_.x,_.y)&&$h(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,b.x>=f&&b.x<=v&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&Zh(s,c,l,h,u,d,b.x,b.y)&&$h(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;_&&_.z>=y;){if(_.x>=f&&_.x<=v&&_.y>=p&&_.y<=m&&_!==i&&_!==o&&Zh(s,c,l,h,u,d,_.x,_.y)&&$h(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;b&&b.z<=g;){if(b.x>=f&&b.x<=v&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&Zh(s,c,l,h,u,d,b.x,b.y)&&$h(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Hh(e,t){var n=e;do{var r=n.prev,i=n.next.next;!Qh(r,i)&&ed(r,n,n.next,i)&&rd(r,i)&&rd(i,r)&&(t.push(r.i,n.i,i.i),od(n),od(n.next),n=e=i),n=n.next}while(n!==e);return Fh(n)}function Vh(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Kh(o,s)){var l=id(o,s);return o=Fh(o,o.next),l=Fh(l,l.next),Bh(o,t,n,r,i,a,0),void Bh(l,t,n,r,i,a,0)}s=s.next}o=o.next}while(o!==e)}function Gh(e,t){var n=e.x-t.x;return 0===n&&0===(n=e.y-t.y)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),n}function Wh(e,t){var n=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;if(Qh(e,r))return r;do{if(Qh(e,r.next))return r.next;if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==t);if(!n)return null;var l=n,u=n.x,c=n.y,h=1/0;r=n;do{if(i>=r.x&&r.x>=u&&i!==r.x&&Jh(a<c?i:o,a,u,c,a<c?o:i,a,r.x,r.y)){var d=Math.abs(a-r.y)/(i-r.x);rd(r,e)&&(d<h||d===h&&(r.x>n.x||r.x===n.x&&Xh(n,r)))&&(n=r,h=d)}r=r.next}while(r!==l);return n}(e,t);if(!n)return t;var r=id(n,e);return Fh(r,r.next),Fh(n,n.next)}function Xh(e,t){return $h(e.prev,e,t.prev)<0&&$h(t.next,e,e.next)<0}function qh(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Yh(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Jh(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function Zh(e,t,n,r,i,a,o,s){return!(e===o&&t===s)&&Jh(e,t,n,r,i,a,o,s)}function Kh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ed(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(rd(e,t)&&rd(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&($h(e.prev,e,t.prev)||$h(e,t.prev,t))||Qh(e,t)&&$h(e.prev,e,e.next)>0&&$h(t.prev,t,t.next)>0)}function $h(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Qh(e,t){return e.x===t.x&&e.y===t.y}function ed(e,t,n,r){var i=nd($h(e,t,n)),a=nd($h(e,t,r)),o=nd($h(n,r,e)),s=nd($h(n,r,t));return i!==a&&o!==s||!(0!==i||!td(e,n,t))||!(0!==a||!td(e,r,t))||!(0!==o||!td(n,e,r))||!(0!==s||!td(n,t,r))}function td(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function nd(e){return e>0?1:e<0?-1:0}function rd(e,t){return $h(e.prev,e,e.next)<0?$h(e,t,e.next)>=0&&$h(e,e.prev,t)>=0:$h(e,t,e.prev)<0||$h(e,e.next,t)<0}function id(e,t){var n=sd(e.i,e.x,e.y),r=sd(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function ad(e,t,n,r){var i=sd(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function od(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function sd(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var ld=function(){return Ai((function e(){Ti(this,e)}),null,[{key:"triangulate",value:function(e,t){return function(e,t){var n,r,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,o=t&&t.length,s=o?t[0]*a:e.length,l=Uh(e,0,s,a,!0),u=[];if(!l||l.next===l.prev)return u;if(o&&(l=function(e,t,n,r){for(var i=[],a=0,o=t.length;a<o;a++){var s=Uh(e,t[a]*r,a<o-1?t[a+1]*r:e.length,r,!1);s===s.next&&(s.steiner=!0),i.push(Yh(s))}i.sort(Gh);for(var l=0;l<i.length;l++)n=Wh(i[l],n);return n}(e,t,l,a)),e.length>80*a){n=1/0,r=1/0;for(var c=-1/0,h=-1/0,d=a;d<s;d+=a){var f=e[d],p=e[d+1];f<n&&(n=f),p<r&&(r=p),f>c&&(c=f),p>h&&(h=p)}i=0!==(i=Math.max(c-n,h-r))?32767/i:0}return Bh(l,u,a,n,r,i,0),u}(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:2)}}])}(),ud=function(){function e(){Ti(this,e)}return Ai(e,null,[{key:"area",value:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}},{key:"isClockWise",value:function(t){return e.area(t)<0}},{key:"triangulateShape",value:function(e,t){var n=[],r=[],i=[];cd(e),hd(n,e);var a=e.length;t.forEach(cd);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,hd(n,t[o]);for(var s=ld.triangulate(n,r),l=0;l<s.length;l+=3)i.push(s.slice(l,l+3));return i}}])}();function cd(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function hd(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}var dd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Dh([new mo(.5,.5),new mo(-.5,.5),new mo(-.5,-.5),new mo(.5,-.5)]),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ti(this,t),(e=yi(this,t)).type="ExtrudeGeometry",e.parameters={shapes:n,options:r},n=Array.isArray(n)?n:[n];for(var i=e,a=[],o=[],s=0,l=n.length;s<l;s++)u(n[s]);function u(e){var t,n,s,l,u,c=[],h=void 0!==r.curveSegments?r.curveSegments:12,d=void 0!==r.steps?r.steps:1,f=void 0!==r.depth?r.depth:1,p=void 0===r.bevelEnabled||r.bevelEnabled,v=void 0!==r.bevelThickness?r.bevelThickness:.2,m=void 0!==r.bevelSize?r.bevelSize:v-.1,y=void 0!==r.bevelOffset?r.bevelOffset:0,g=void 0!==r.bevelSegments?r.bevelSegments:3,_=r.extrudePath,b=void 0!==r.UVGenerator?r.UVGenerator:fd,x=!1;_&&(t=_.getSpacedPoints(d),x=!0,p=!1,n=_.computeFrenetFrames(d,!1),s=new go,l=new go,u=new go),p||(g=0,v=0,m=0,y=0);var S=e.extractPoints(h),w=S.shape,E=S.holes;if(!ud.isClockWise(w)){w=w.reverse();for(var M=0,T=E.length;M<T;M++){var C=E[M];ud.isClockWise(C)&&(E[M]=C.reverse())}}function A(e){for(var t=1e-10*1e-10,n=e[0],r=1;r<=e.length;r++){var i=r%e.length,a=e[i],o=a.x-n.x,s=a.y-n.y,l=o*o+s*s,u=Math.max(Math.abs(a.x),Math.abs(a.y),Math.abs(n.x),Math.abs(n.y));l<=t*u*u?(e.splice(i,1),r--):n=a}}A(w),E.forEach(A);for(var P=E.length,k=w,O=0;O<P;O++){var R=E[O];w=w.concat(R)}function I(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,n)}var N=w.length;function L(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,u=n.y-e.y,c=o*o+s*s,h=o*u-s*l;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(c),f=Math.sqrt(l*l+u*u),p=t.x-s/d,v=t.y+o/d,m=((n.x-u/f-p)*u-(n.y+l/f-v)*l)/(o*u-s*l),y=(r=p+o*m-e.x)*r+(i=v+s*m-e.y)*i;if(y<=2)return new mo(r,i);a=Math.sqrt(y/2)}else{var g=!1;o>Number.EPSILON?l>Number.EPSILON&&(g=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(g=!0):Math.sign(s)===Math.sign(u)&&(g=!0),g?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2))}return new mo(r/a,i/a)}for(var D=[],U=0,F=k.length,B=F-1,z=U+1;U<F;U++,B++,z++)B===F&&(B=0),z===F&&(z=0),D[U]=L(k[U],k[B],k[z]);for(var j,H,V=[],G=D.concat(),W=0,X=P;W<X;W++){var q=E[W];j=[];for(var Y=0,J=q.length,Z=J-1,K=Y+1;Y<J;Y++,Z++,K++)Z===J&&(Z=0),K===J&&(K=0),j[Y]=L(q[Y],q[Z],q[K]);V.push(j),G=G.concat(j)}if(0===g)H=ud.triangulateShape(k,E);else{for(var $=[],Q=[],ee=0;ee<g;ee++){for(var te=ee/g,ne=v*Math.cos(te*Math.PI/2),re=m*Math.sin(te*Math.PI/2)+y,ie=0,ae=k.length;ie<ae;ie++){var oe=I(k[ie],D[ie],re);Le(oe.x,oe.y,-ne),0===te&&$.push(oe)}for(var se=0,le=P;se<le;se++){var ue=E[se];j=V[se];for(var ce=[],he=0,de=ue.length;he<de;he++){var fe=I(ue[he],j[he],re);Le(fe.x,fe.y,-ne),0===te&&ce.push(fe)}0===te&&Q.push(ce)}}H=ud.triangulateShape($,Q)}for(var pe=H.length,ve=m+y,me=0;me<N;me++){var ye=p?I(w[me],G[me],ve):w[me];x?(l.copy(n.normals[0]).multiplyScalar(ye.x),s.copy(n.binormals[0]).multiplyScalar(ye.y),u.copy(t[0]).add(l).add(s),Le(u.x,u.y,u.z)):Le(ye.x,ye.y,0)}for(var ge=1;ge<=d;ge++)for(var _e=0;_e<N;_e++){var be=p?I(w[_e],G[_e],ve):w[_e];x?(l.copy(n.normals[ge]).multiplyScalar(be.x),s.copy(n.binormals[ge]).multiplyScalar(be.y),u.copy(t[ge]).add(l).add(s),Le(u.x,u.y,u.z)):Le(be.x,be.y,f/d*ge)}for(var xe=g-1;xe>=0;xe--){for(var Se=xe/g,we=v*Math.cos(Se*Math.PI/2),Ee=m*Math.sin(Se*Math.PI/2)+y,Me=0,Te=k.length;Me<Te;Me++){var Ce=I(k[Me],D[Me],Ee);Le(Ce.x,Ce.y,f+we)}for(var Ae=0,Pe=E.length;Ae<Pe;Ae++){var ke=E[Ae];j=V[Ae];for(var Oe=0,Re=ke.length;Oe<Re;Oe++){var Ie=I(ke[Oe],j[Oe],Ee);x?Le(Ie.x,Ie.y+t[d-1].y,t[d-1].x+we):Le(Ie.x,Ie.y,f+we)}}}function Ne(e,t){for(var n=e.length;--n>=0;){var r=n,i=n-1;i<0&&(i=e.length-1);for(var a=0,o=d+2*g;a<o;a++){var s=N*a,l=N*(a+1);Ue(t+r+s,t+i+s,t+i+l,t+r+l)}}}function Le(e,t,n){c.push(e),c.push(t),c.push(n)}function De(e,t,n){Fe(e),Fe(t),Fe(n);var r=a.length/3,o=b.generateTopUV(i,a,r-3,r-2,r-1);Be(o[0]),Be(o[1]),Be(o[2])}function Ue(e,t,n,r){Fe(e),Fe(t),Fe(r),Fe(t),Fe(n),Fe(r);var o=a.length/3,s=b.generateSideWallUV(i,a,o-6,o-3,o-2,o-1);Be(s[0]),Be(s[1]),Be(s[3]),Be(s[1]),Be(s[2]),Be(s[3])}function Fe(e){a.push(c[3*e+0]),a.push(c[3*e+1]),a.push(c[3*e+2])}function Be(e){o.push(e.x),o.push(e.y)}!function(){var e=a.length/3;if(p){for(var t=0,n=N*t,r=0;r<pe;r++){var o=H[r];De(o[2]+n,o[1]+n,o[0]+n)}n=N*(t=d+2*g);for(var s=0;s<pe;s++){var l=H[s];De(l[0]+n,l[1]+n,l[2]+n)}}else{for(var u=0;u<pe;u++){var c=H[u];De(c[2],c[1],c[0])}for(var h=0;h<pe;h++){var f=H[h];De(f[0]+N*d,f[1]+N*d,f[2]+N*d)}}i.addGroup(e,a.length/3-e,0)}(),function(){var e=a.length/3,t=0;Ne(k,t),t+=k.length;for(var n=0,r=E.length;n<r;n++){var o=E[n];Ne(o,t),t+=o.length}i.addGroup(e,a.length/3-e,1)}()}return e.setAttribute("position",new El(a,3)),e.setAttribute("uv",new El(o,2)),e.computeVertexNormals(),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}(this.parameters.shapes,this.parameters.options,e)}}],[{key:"fromJSON",value:function(e,n){for(var r=[],i=0,a=e.shapes.length;i<a;i++){var o=n[e.shapes[i]];r.push(o)}var s=e.options.extrudePath;return void 0!==s&&(e.options.extrudePath=(new Nh[s.type]).fromJSON(s)),new t(r,e.options)}}])}(Rl),fd={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],u=t[3*i],c=t[3*i+1];return[new mo(a,o),new mo(s,l),new mo(u,c)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],l=t[3*n+2],u=t[3*r],c=t[3*r+1],h=t[3*r+2],d=t[3*i],f=t[3*i+1],p=t[3*i+2],v=t[3*a],m=t[3*a+1],y=t[3*a+2];return Math.abs(s-c)<Math.abs(o-u)?[new mo(o,1-l),new mo(u,1-h),new mo(d,1-p),new mo(v,1-y)]:[new mo(s,1-l),new mo(c,1-h),new mo(f,1-p),new mo(m,1-y)]}},pd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ti(this,t);var i=(1+Math.sqrt(5))/2;return(e=yi(this,t,[[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],n,r])).type="IcosahedronGeometry",e.parameters={radius:n,detail:r},e}return bi(t,e),Ai(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(lh),vd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new mo(0,-.5),new mo(.5,0),new mo(0,.5)],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;Ti(this,t),(e=yi(this,t)).type="LatheGeometry",e.parameters={points:n,segments:r,phiStart:i,phiLength:a},r=Math.floor(r),a=uo(a,0,2*Math.PI);for(var o=[],s=[],l=[],u=[],c=[],h=1/r,d=new go,f=new mo,p=new go,v=new go,m=new go,y=0,g=0,_=0;_<=n.length-1;_++)switch(_){case 0:y=n[_+1].x-n[_].x,g=n[_+1].y-n[_].y,p.x=1*g,p.y=-y,p.z=0*g,m.copy(p),p.normalize(),u.push(p.x,p.y,p.z);break;case n.length-1:u.push(m.x,m.y,m.z);break;default:y=n[_+1].x-n[_].x,g=n[_+1].y-n[_].y,p.x=1*g,p.y=-y,p.z=0*g,v.copy(p),p.x+=m.x,p.y+=m.y,p.z+=m.z,p.normalize(),u.push(p.x,p.y,p.z),m.copy(v)}for(var b=0;b<=r;b++)for(var x=i+b*h*a,S=Math.sin(x),w=Math.cos(x),E=0;E<=n.length-1;E++){d.x=n[E].x*S,d.y=n[E].y,d.z=n[E].x*w,s.push(d.x,d.y,d.z),f.x=b/r,f.y=E/(n.length-1),l.push(f.x,f.y);var M=u[3*E+0]*S,T=u[3*E+1],C=u[3*E+0]*w;c.push(M,T,C)}for(var A=0;A<r;A++)for(var P=0;P<n.length-1;P++){var k=P+A*n.length,O=k,R=k+n.length,I=k+n.length+1,N=k+1;o.push(O,R,N),o.push(I,N,R)}return e.setIndex(o),e.setAttribute("position",new El(s,3)),e.setAttribute("uv",new El(l,2)),e.setAttribute("normal",new El(c,3)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.points,e.segments,e.phiStart,e.phiLength)}}])}(Rl),md=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ti(this,t),(e=yi(this,t,[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],n,r])).type="OctahedronGeometry",e.parameters={radius:n,detail:r},e}return bi(t,e),Ai(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(lh),yd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Ti(this,t),(e=yi(this,t)).type="PlaneGeometry",e.parameters={width:n,height:r,widthSegments:i,heightSegments:a};for(var o=n/2,s=r/2,l=Math.floor(i),u=Math.floor(a),c=l+1,h=u+1,d=n/l,f=r/u,p=[],v=[],m=[],y=[],g=0;g<h;g++)for(var _=g*f-s,b=0;b<c;b++){var x=b*d-o;v.push(x,-_,0),m.push(0,0,1),y.push(b/l),y.push(1-g/u)}for(var S=0;S<u;S++)for(var w=0;w<l;w++){var E=w+c*S,M=w+c*(S+1),T=w+1+c*(S+1),C=w+1+c*S;p.push(E,M,C),p.push(M,T,C)}return e.setIndex(p),e.setAttribute("position",new El(v,3)),e.setAttribute("normal",new El(m,3)),e.setAttribute("uv",new El(y,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.width,e.height,e.widthSegments,e.heightSegments)}}])}(Rl),gd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;Ti(this,t),(e=yi(this,t)).type="RingGeometry",e.parameters={innerRadius:n,outerRadius:r,thetaSegments:i,phiSegments:a,thetaStart:o,thetaLength:s},i=Math.max(3,i);for(var l=[],u=[],c=[],h=[],d=n,f=(r-n)/(a=Math.max(1,a)),p=new go,v=new mo,m=0;m<=a;m++){for(var y=0;y<=i;y++){var g=o+y/i*s;p.x=d*Math.cos(g),p.y=d*Math.sin(g),u.push(p.x,p.y,p.z),c.push(0,0,1),v.x=(p.x/r+1)/2,v.y=(p.y/r+1)/2,h.push(v.x,v.y)}d+=f}for(var _=0;_<a;_++)for(var b=_*(i+1),x=0;x<i;x++){var S=x+b,w=S,E=S+i+1,M=S+i+2,T=S+1;l.push(w,E,T),l.push(E,M,T)}return e.setIndex(l),e.setAttribute("position",new El(u,3)),e.setAttribute("normal",new El(c,3)),e.setAttribute("uv",new El(h,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}])}(Rl),_d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Dh([new mo(0,.5),new mo(-.5,-.5),new mo(.5,-.5)]),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;Ti(this,t),(e=yi(this,t)).type="ShapeGeometry",e.parameters={shapes:n,curveSegments:r};var i=[],a=[],o=[],s=[],l=0,u=0;if(!1===Array.isArray(n))h(n);else for(var c=0;c<n.length;c++)h(n[c]),e.addGroup(l,u,c),l+=u,u=0;function h(e){var t=a.length/3,n=e.extractPoints(r),l=n.shape,c=n.holes;!1===ud.isClockWise(l)&&(l=l.reverse());for(var h=0,d=c.length;h<d;h++){var f=c[h];!0===ud.isClockWise(f)&&(c[h]=f.reverse())}for(var p=ud.triangulateShape(l,c),v=0,m=c.length;v<m;v++){var y=c[v];l=l.concat(y)}for(var g=0,_=l.length;g<_;g++){var b=l[g];a.push(b.x,b.y,0),o.push(0,0,1),s.push(b.x,b.y)}for(var x=0,S=p.length;x<S;x++){var w=p[x],E=w[0]+t,M=w[1]+t,T=w[2]+t;i.push(E,M,T),u+=3}}return e.setIndex(i),e.setAttribute("position",new El(a,3)),e.setAttribute("normal",new El(o,3)),e.setAttribute("uv",new El(s,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return function(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}}],[{key:"fromJSON",value:function(e,n){for(var r=[],i=0,a=e.shapes.length;i<a;i++){var o=n[e.shapes[i]];r.push(o)}return new t(r,e.curveSegments)}}])}(Rl),bd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;Ti(this,t),(e=yi(this,t)).type="SphereGeometry",e.parameters={radius:n,widthSegments:r,heightSegments:i,phiStart:a,phiLength:o,thetaStart:s,thetaLength:l},r=Math.max(3,Math.floor(r)),i=Math.max(2,Math.floor(i));for(var u=Math.min(s+l,Math.PI),c=0,h=[],d=new go,f=new go,p=[],v=[],m=[],y=[],g=0;g<=i;g++){var _=[],b=g/i,x=0;0===g&&0===s?x=.5/r:g===i&&u===Math.PI&&(x=-.5/r);for(var S=0;S<=r;S++){var w=S/r;d.x=-n*Math.cos(a+w*o)*Math.sin(s+b*l),d.y=n*Math.cos(s+b*l),d.z=n*Math.sin(a+w*o)*Math.sin(s+b*l),v.push(d.x,d.y,d.z),f.copy(d).normalize(),m.push(f.x,f.y,f.z),y.push(w+x,1-b),_.push(c++)}h.push(_)}for(var E=0;E<i;E++)for(var M=0;M<r;M++){var T=h[E][M+1],C=h[E][M],A=h[E+1][M],P=h[E+1][M+1];(0!==E||s>0)&&p.push(T,C,P),(E!==i-1||u<Math.PI)&&p.push(C,A,P)}return e.setIndex(p),e.setAttribute("position",new El(v,3)),e.setAttribute("normal",new El(m,3)),e.setAttribute("uv",new El(y,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}])}(Rl),xd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ti(this,t),(e=yi(this,t,[[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],n,r])).type="TetrahedronGeometry",e.parameters={radius:n,detail:r},e}return bi(t,e),Ai(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(lh),Sd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;Ti(this,t),(e=yi(this,t)).type="TorusGeometry",e.parameters={radius:n,tube:r,radialSegments:i,tubularSegments:a,arc:o},i=Math.floor(i),a=Math.floor(a);for(var s=[],l=[],u=[],c=[],h=new go,d=new go,f=new go,p=0;p<=i;p++)for(var v=0;v<=a;v++){var m=v/a*o,y=p/i*Math.PI*2;d.x=(n+r*Math.cos(y))*Math.cos(m),d.y=(n+r*Math.cos(y))*Math.sin(m),d.z=r*Math.sin(y),l.push(d.x,d.y,d.z),h.x=n*Math.cos(m),h.y=n*Math.sin(m),f.subVectors(d,h).normalize(),u.push(f.x,f.y,f.z),c.push(v/a),c.push(p/i)}for(var g=1;g<=i;g++)for(var _=1;_<=a;_++){var b=(a+1)*g+_-1,x=(a+1)*(g-1)+_-1,S=(a+1)*(g-1)+_,w=(a+1)*g+_;s.push(b,x,w),s.push(x,S,w)}return e.setIndex(s),e.setAttribute("position",new El(l,3)),e.setAttribute("normal",new El(u,3)),e.setAttribute("uv",new El(c,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}])}(Rl),wd=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;Ti(this,t),(e=yi(this,t)).type="TorusKnotGeometry",e.parameters={radius:n,tube:r,tubularSegments:i,radialSegments:a,p:o,q:s},i=Math.floor(i),a=Math.floor(a);for(var l=[],u=[],c=[],h=[],d=new go,f=new go,p=new go,v=new go,m=new go,y=new go,g=new go,_=0;_<=i;++_){var b=_/i*o*Math.PI*2;O(b,o,s,n,p),O(b+.01,o,s,n,v),y.subVectors(v,p),g.addVectors(v,p),m.crossVectors(y,g),g.crossVectors(m,y),m.normalize(),g.normalize();for(var x=0;x<=a;++x){var S=x/a*Math.PI*2,w=-r*Math.cos(S),E=r*Math.sin(S);d.x=p.x+(w*g.x+E*m.x),d.y=p.y+(w*g.y+E*m.y),d.z=p.z+(w*g.z+E*m.z),u.push(d.x,d.y,d.z),f.subVectors(d,p).normalize(),c.push(f.x,f.y,f.z),h.push(_/i),h.push(x/a)}}for(var M=1;M<=i;M++)for(var T=1;T<=a;T++){var C=(a+1)*(M-1)+(T-1),A=(a+1)*M+(T-1),P=(a+1)*M+T,k=(a+1)*(M-1)+T;l.push(C,A,k),l.push(A,P,k)}function O(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*a,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(s)*.5}return e.setIndex(l),e.setAttribute("position",new El(u,3)),e.setAttribute("normal",new El(c,3)),e.setAttribute("uv",new El(h,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}])}(Rl),Ed=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rh(new go(-1,-1,0),new go(-1,1,0),new go(1,1,0)),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Ti(this,t),(e=yi(this,t)).type="TubeGeometry",e.parameters={path:n,tubularSegments:r,radius:i,radialSegments:a,closed:o};var s=n.computeFrenetFrames(r,o);e.tangents=s.tangents,e.normals=s.normals,e.binormals=s.binormals;var l=new go,u=new go,c=new mo,h=new go,d=[],f=[],p=[],v=[];function m(e){h=n.getPointAt(e/r,h);for(var t=s.normals[e],o=s.binormals[e],c=0;c<=a;c++){var p=c/a*Math.PI*2,v=Math.sin(p),m=-Math.cos(p);u.x=m*t.x+v*o.x,u.y=m*t.y+v*o.y,u.z=m*t.z+v*o.z,u.normalize(),f.push(u.x,u.y,u.z),l.x=h.x+i*u.x,l.y=h.y+i*u.y,l.z=h.z+i*u.z,d.push(l.x,l.y,l.z)}}return function(){for(var e=0;e<r;e++)m(e);m(!1===o?r:0),function(){for(var e=0;e<=r;e++)for(var t=0;t<=a;t++)c.x=e/r,c.y=t/a,p.push(c.x,c.y)}(),function(){for(var e=1;e<=r;e++)for(var t=1;t<=a;t++){var n=(a+1)*(e-1)+(t-1),i=(a+1)*e+(t-1),o=(a+1)*e+t,s=(a+1)*(e-1)+t;v.push(n,i,s),v.push(i,o,s)}}()}(),e.setIndex(v),e.setAttribute("position",new El(d,3)),e.setAttribute("normal",new El(f,3)),e.setAttribute("uv",new El(p,2)),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.path=this.parameters.path.toJSON(),e}}],[{key:"fromJSON",value:function(e){return new t((new Nh[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}])}(Rl),Md=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(Ti(this,t),(e=yi(this,t)).type="WireframeGeometry",e.parameters={geometry:n},null!==n){var r=[],i=new Set,a=new go,o=new go;if(null!==n.index){var s=n.attributes.position,l=n.index,u=n.groups;0===u.length&&(u=[{start:0,count:l.count,materialIndex:0}]);for(var c=0,h=u.length;c<h;++c)for(var d=u[c],f=d.start,p=f,v=f+d.count;p<v;p+=3)for(var m=0;m<3;m++){var y=l.getX(p+m),g=l.getX(p+(m+1)%3);a.fromBufferAttribute(s,y),o.fromBufferAttribute(s,g),!0===Td(a,o,i)&&(r.push(a.x,a.y,a.z),r.push(o.x,o.y,o.z))}}else for(var _=n.attributes.position,b=0,x=_.count/3;b<x;b++)for(var S=0;S<3;S++){var w=3*b+S,E=3*b+(S+1)%3;a.fromBufferAttribute(_,w),o.fromBufferAttribute(_,E),!0===Td(a,o,i)&&(r.push(a.x,a.y,a.z),r.push(o.x,o.y,o.z))}e.setAttribute("position",new El(r,3))}return e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}])}(Rl);function Td(e,t,n){var r="".concat(e.x,",").concat(e.y,",").concat(e.z,"-").concat(t.x,",").concat(t.y,",").concat(t.z),i="".concat(t.x,",").concat(t.y,",").concat(t.z,"-").concat(e.x,",").concat(e.y,",").concat(e.z);return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}var Cd=Object.freeze({__proto__:null,BoxGeometry:Xl,CapsuleGeometry:ih,CircleGeometry:ah,ConeGeometry:sh,CylinderGeometry:oh,DodecahedronGeometry:uh,EdgesGeometry:ph,ExtrudeGeometry:dd,IcosahedronGeometry:pd,LatheGeometry:vd,OctahedronGeometry:md,PlaneGeometry:yd,PolyhedronGeometry:lh,RingGeometry:gd,ShapeGeometry:_d,SphereGeometry:bd,TetrahedronGeometry:xd,TorusGeometry:Sd,TorusKnotGeometry:wd,TubeGeometry:Ed,WireframeGeometry:Md}),Ad=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isShadowMaterial=!0,n.type="ShadowMaterial",n.color=new fl(0),n.transparent=!0,n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.color.copy(e.color),this.fog=e.fog,this}}])}(ml),Pd=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t,[e])).isRawShaderMaterial=!0,n.type="RawShaderMaterial",n}return bi(t,e),Ai(t)}($l),kd=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshStandardMaterial=!0,n.type="MeshStandardMaterial",n.defines={STANDARD:""},n.color=new fl(16777215),n.roughness=1,n.metalness=0,n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.emissive=new fl(0),n.emissiveIntensity=1,n.emissiveMap=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new mo(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.roughnessMap=null,n.metalnessMap=null,n.alphaMap=null,n.envMap=null,n.envMapRotation=new Os,n.envMapIntensity=1,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.flatShading=!1,n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}])}(ml),Od=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshPhysicalMaterial=!0,n.defines={STANDARD:"",PHYSICAL:""},n.type="MeshPhysicalMaterial",n.anisotropyRotation=0,n.anisotropyMap=null,n.clearcoatMap=null,n.clearcoatRoughness=0,n.clearcoatRoughnessMap=null,n.clearcoatNormalScale=new mo(1,1),n.clearcoatNormalMap=null,n.ior=1.5,Object.defineProperty(n,"reflectivity",{get:function(){return uo(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),n.iridescenceMap=null,n.iridescenceIOR=1.3,n.iridescenceThicknessRange=[100,400],n.iridescenceThicknessMap=null,n.sheenColor=new fl(0),n.sheenColorMap=null,n.sheenRoughness=1,n.sheenRoughnessMap=null,n.transmissionMap=null,n.thickness=0,n.thicknessMap=null,n.attenuationDistance=1/0,n.attenuationColor=new fl(1,1,1),n.specularIntensity=1,n.specularIntensityMap=null,n.specularColor=new fl(1,1,1),n.specularColorMap=null,n._anisotropy=0,n._clearcoat=0,n._dispersion=0,n._iridescence=0,n._sheen=0,n._transmission=0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"anisotropy",get:function(){return this._anisotropy},set:function(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}},{key:"clearcoat",get:function(){return this._clearcoat},set:function(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}},{key:"iridescence",get:function(){return this._iridescence},set:function(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}},{key:"dispersion",get:function(){return this._dispersion},set:function(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}},{key:"sheen",get:function(){return this._sheen},set:function(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}},{key:"transmission",get:function(){return this._transmission},set:function(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=pi(e.iridescenceThicknessRange),this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}])}(kd),Rd=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshPhongMaterial=!0,n.type="MeshPhongMaterial",n.color=new fl(16777215),n.specular=new fl(1118481),n.shininess=30,n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.emissive=new fl(0),n.emissiveIntensity=1,n.emissiveMap=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new mo(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=null,n.alphaMap=null,n.envMap=null,n.envMapRotation=new Os,n.combine=0,n.reflectivity=1,n.refractionRatio=.98,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.flatShading=!1,n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.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.flatShading=e.flatShading,this.fog=e.fog,this}}])}(ml),Id=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshToonMaterial=!0,n.defines={TOON:""},n.type="MeshToonMaterial",n.color=new fl(16777215),n.map=null,n.gradientMap=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.emissive=new fl(0),n.emissiveIntensity=1,n.emissiveMap=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new mo(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.alphaMap=null,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}])}(ml),Nd=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshNormalMaterial=!0,n.type="MeshNormalMaterial",n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new mo(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.wireframe=!1,n.wireframeLinewidth=1,n.flatShading=!1,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}])}(ml),Ld=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshLambertMaterial=!0,n.type="MeshLambertMaterial",n.color=new fl(16777215),n.map=null,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=null,n.aoMapIntensity=1,n.emissive=new fl(0),n.emissiveIntensity=1,n.emissiveMap=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new mo(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=null,n.alphaMap=null,n.envMap=null,n.envMapRotation=new Os,n.combine=0,n.reflectivity=1,n.refractionRatio=.98,n.wireframe=!1,n.wireframeLinewidth=1,n.wireframeLinecap="round",n.wireframeLinejoin="round",n.flatShading=!1,n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.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.flatShading=e.flatShading,this.fog=e.fog,this}}])}(ml),Dd=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshDepthMaterial=!0,n.type="MeshDepthMaterial",n.depthPacking=3200,n.map=null,n.alphaMap=null,n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.wireframe=!1,n.wireframeLinewidth=1,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([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}}])}(ml),Ud=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshDistanceMaterial=!0,n.type="MeshDistanceMaterial",n.map=null,n.alphaMap=null,n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}])}(ml),Fd=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isMeshMatcapMaterial=!0,n.defines={MATCAP:""},n.type="MeshMatcapMaterial",n.color=new fl(16777215),n.matcap=null,n.map=null,n.bumpMap=null,n.bumpScale=1,n.normalMap=null,n.normalMapType=0,n.normalScale=new mo(1,1),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.alphaMap=null,n.flatShading=!1,n.fog=!0,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}])}(ml),Bd=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t)).isLineDashedMaterial=!0,n.type="LineDashedMaterial",n.scale=1,n.dashSize=3,n.gapSize=1,n.setValues(e),n}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}])}(Lc);function zd(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function jd(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n}function Hd(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,l=0;l!==t;++l)i[o++]=e[s+l];return i}function Vd(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,pi(o))),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)}}var Gd=function(){return Ai((function e(t,n,r,i){Ti(this,e),this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}),[{key:"evaluate",value:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(var l=n-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(r=i,e>=(i=t[--n-1]))break t}a=n,n=0}for(;n<a;){var u=n+a>>>1;e<t[u]?a=u:n=u+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}},{key:"getSettings_",value:function(){return this.settings||this.DefaultSettings_}},{key:"copySampleValue_",value:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t}},{key:"interpolate_",value:function(){throw new Error("call to abstract method")}},{key:"intervalChanged_",value:function(){}}])}(),Wd=function(e){function t(e,n,r,i){var a;return Ti(this,t),(a=yi(this,t,[e,n,r,i]))._weightPrev=-0,a._offsetPrev=-0,a._weightNext=-0,a._offsetNext=-0,a.DefaultSettings_={endingStart:Ga,endingEnd:Ga},a}return bi(t,e),Ai(t,[{key:"intervalChanged_",value:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case Wa:i=e,o=2*t-n;break;case Xa:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case Wa:a=e,s=2*n-t;break;case Xa:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var l=.5*(n-t),u=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u}},{key:"interpolate_",value:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=this._offsetPrev,c=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(n-t)/(r-t),p=f*f,v=p*f,m=-h*v+2*h*p-h*f,y=(1+h)*v+(-1.5-2*h)*p+(-.5+h)*f+1,g=(-1-d)*v+(1.5+d)*p+.5*f,_=d*v-d*p,b=0;b!==o;++b)i[b]=m*a[u+b]+y*a[l+b]+g*a[s+b]+_*a[c+b];return i}}])}(Gd),Xd=function(e){function t(e,n,r,i){return Ti(this,t),yi(this,t,[e,n,r,i])}return bi(t,e),Ai(t,[{key:"interpolate_",value:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=(n-t)/(r-t),c=1-u,h=0;h!==o;++h)i[h]=a[l+h]*c+a[s+h]*u;return i}}])}(Gd),qd=function(e){function t(e,n,r,i){return Ti(this,t),yi(this,t,[e,n,r,i])}return bi(t,e),Ai(t,[{key:"interpolate_",value:function(e){return this.copySampleValue_(e-1)}}])}(Gd),Yd=function(){return Ai((function e(t,n,r,i){if(Ti(this,e),void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===n||0===n.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=zd(n,this.TimeBufferType),this.values=zd(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}),[{key:"InterpolantFactoryMethodDiscrete",value:function(e){return new qd(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodLinear",value:function(e){return new Xd(this.times,this.values,this.getValueSize(),e)}},{key:"InterpolantFactoryMethodSmooth",value:function(e){return new Wd(this.times,this.values,this.getValueSize(),e)}},{key:"setInterpolation",value:function(e){var t;switch(e){case ja:t=this.InterpolantFactoryMethodDiscrete;break;case Ha:t=this.InterpolantFactoryMethodLinear;break;case Va:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}},{key:"getInterpolation",value:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ja;case this.InterpolantFactoryMethodLinear:return Ha;case this.InterpolantFactoryMethodSmooth:return Va}}},{key:"getValueSize",value:function(){return this.values.length/this.times.length}},{key:"shift",value:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this}},{key:"scale",value:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this}},{key:"trim",value:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*o,a*o)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n,r=this.times,i=this.values,a=r.length;0===a&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,s=0;s!==a;s++){var l=r[s];if("number"==typeof l&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(null!==o&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,o),e=!1;break}o=l}if(void 0!==i&&(n=i,ArrayBuffer.isView(n)&&!(n instanceof DataView)))for(var u=0,c=i.length;u!==c;++u){var h=i[u];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,h),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===Va,i=e.length-1,a=1,o=1;o<i;++o){var s=!1,l=e[o];if(l!==e[o+1]&&(1!==o||l!==e[0]))if(r)s=!0;else for(var u=o*n,c=u-n,h=u+n,d=0;d!==n;++d){var f=t[u+d];if(f!==t[c+d]||f!==t[h+d]){s=!0;break}}if(s){if(o!==a){e[a]=e[o];for(var p=o*n,v=a*n,m=0;m!==n;++m)t[v+m]=t[p+m]}++a}}if(i>0){e[a]=e[i];for(var y=i*n,g=a*n,_=0;_!==n;++_)t[g+_]=t[y+_];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=this.times.slice(),t=this.values.slice(),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}],[{key:"toJSON",value:function(e){var t,n=e.constructor;if(n.toJSON!==this.toJSON)t=n.toJSON(e);else{t={name:e.name,times:zd(e.times,Array),values:zd(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}])}();Yd.prototype.ValueTypeName="",Yd.prototype.TimeBufferType=Float32Array,Yd.prototype.ValueBufferType=Float32Array,Yd.prototype.DefaultInterpolation=Ha;var Jd=function(e){function t(e,n,r){return Ti(this,t),yi(this,t,[e,n,r])}return bi(t,e),Ai(t)}(Yd);Jd.prototype.ValueTypeName="bool",Jd.prototype.ValueBufferType=Array,Jd.prototype.DefaultInterpolation=ja,Jd.prototype.InterpolantFactoryMethodLinear=void 0,Jd.prototype.InterpolantFactoryMethodSmooth=void 0;var Zd=function(e){function t(e,n,r,i){return Ti(this,t),yi(this,t,[e,n,r,i])}return bi(t,e),Ai(t)}(Yd);Zd.prototype.ValueTypeName="color";var Kd=function(e){function t(e,n,r,i){return Ti(this,t),yi(this,t,[e,n,r,i])}return bi(t,e),Ai(t)}(Yd);Kd.prototype.ValueTypeName="number";var $d=function(e){function t(e,n,r,i){return Ti(this,t),yi(this,t,[e,n,r,i])}return bi(t,e),Ai(t,[{key:"interpolate_",value:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),l=e*o,u=l+o;l!==u;l+=4)yo.slerpFlat(i,0,a,l-o,a,l,s);return i}}])}(Gd),Qd=function(e){function t(e,n,r,i){return Ti(this,t),yi(this,t,[e,n,r,i])}return bi(t,e),Ai(t,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new $d(this.times,this.values,this.getValueSize(),e)}}])}(Yd);Qd.prototype.ValueTypeName="quaternion",Qd.prototype.InterpolantFactoryMethodSmooth=void 0;var ef=function(e){function t(e,n,r){return Ti(this,t),yi(this,t,[e,n,r])}return bi(t,e),Ai(t)}(Yd);ef.prototype.ValueTypeName="string",ef.prototype.ValueBufferType=Array,ef.prototype.DefaultInterpolation=ja,ef.prototype.InterpolantFactoryMethodLinear=void 0,ef.prototype.InterpolantFactoryMethodSmooth=void 0;var tf=function(e){function t(e,n,r,i){return Ti(this,t),yi(this,t,[e,n,r,i])}return bi(t,e),Ai(t)}(Yd);tf.prototype.ValueTypeName="vector";var nf=function(){return Ai((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500;Ti(this,e),this.name=t,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=lo(),this.userData={},this.duration<0&&this.resetDuration()}),[{key:"resetDuration",value:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}},{key:"trim",value:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}},{key:"validate",value:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}},{key:"optimize",value:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}},{key:"clone",value:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());var n=new this.constructor(this.name,this.duration,e,this.blendMode);return n.userData=JSON.parse(JSON.stringify(this.userData)),n}},{key:"toJSON",value:function(){return this.constructor.toJSON(this)}}],[{key:"parse",value:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(rf(n[i]).scale(r));var o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o.userData=JSON.parse(e.userData||"{}"),o}},{key:"toJSON",value:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)},i=0,a=n.length;i!==a;++i)t.push(Yd.toJSON(n[i]));return r}},{key:"CreateFromMorphTargetSequence",value:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],l=[];s.push((o+i-1)%i,o,(o+1)%i),l.push(0,1,0);var u=jd(s);s=Hd(s,1,u),l=Hd(l,1,u),r||0!==s[0]||(s.push(i),l.push(l[0])),a.push(new Kd(".morphTargetInfluences["+t[o].name+"]",s,l).scale(1/n))}return new this(e,-1,a)}},{key:"findByName",value:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}},{key:"CreateClipsFromMorphTargetSequences",value:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],l=s.name.match(i);if(l&&l.length>1){var u=l[1],c=r[u];c||(r[u]=c=[]),c.push(s)}}var h=[];for(var d in r)h.push(this.CreateFromMorphTargetSequence(d,r[d],t,n));return h}},{key:"parseAnimation",value:function(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];Vd(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode,s=e.length||-1,l=e.hierarchy||[],u=0;u<l.length;u++){var c=l[u].keys;if(c&&0!==c.length)if(c[0].morphTargets){var h={},d=void 0;for(d=0;d<c.length;d++)if(c[d].morphTargets)for(var f=0;f<c[d].morphTargets.length;f++)h[c[d].morphTargets[f]]=-1;for(var p in h){for(var v=[],m=[],y=0;y!==c[d].morphTargets.length;++y){var g=c[d];v.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new Kd(".morphTargetInfluence["+p+"]",v,m))}s=h.length*a}else{var _=".bones["+t[u].name+"]";n(tf,_+".position",c,"pos",r),n(Qd,_+".quaternion",c,"rot",r),n(tf,_+".scale",c,"scl",r)}}return 0===r.length?null:new this(i,s,r,o)}}])}();function rf(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Kd;case"vector":case"vector2":case"vector3":case"vector4":return tf;case"color":return Zd;case"quaternion":return Qd;case"bool":case"boolean":return Jd;case"string":return ef}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],r=[];Vd(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}var af={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},of=Ai((function e(t,n,r){Ti(this,e);var i=this,a=!1,o=0,s=0,l=void 0,u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=n,this.onError=r,this.abortController=new AbortController,this.itemStart=function(e){s++,!1===a&&void 0!==i.onStart&&i.onStart(e,o,s),a=!0},this.itemEnd=function(e){o++,void 0!==i.onProgress&&i.onProgress(e,o,s),o===s&&(a=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return l?l(e):e},this.setURLModifier=function(e){return l=e,this},this.addHandler=function(e,t){return u.push(e,t),this},this.removeHandler=function(e){var t=u.indexOf(e);return-1!==t&&u.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=u.length;t<n;t+=2){var r=u[t],i=u[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}})),sf=new of,lf=function(){return Ai((function e(t){Ti(this,e),this.manager=void 0!==t?t:sf,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}),[{key:"load",value:function(){}},{key:"loadAsync",value:function(e,t){var n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}},{key:"parse",value:function(){}},{key:"setCrossOrigin",value:function(e){return this.crossOrigin=e,this}},{key:"setWithCredentials",value:function(e){return this.withCredentials=e,this}},{key:"setPath",value:function(e){return this.path=e,this}},{key:"setResourcePath",value:function(e){return this.resourcePath=e,this}},{key:"setRequestHeader",value:function(e){return this.requestHeader=e,this}},{key:"abort",value:function(){return this}}])}();lf.DEFAULT_MATERIAL_NAME="__DEFAULT";var uf={},cf=function(e){function t(e,n){var r;return Ti(this,t),(r=yi(this,t,[e])).response=n,r}return bi(t,e),Ai(t)}(si(Error)),hf=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t,[e])).mimeType="",n.responseType="",n._abortController=new AbortController,n}return bi(t,e),Ai(t,[{key:"load",value:function(e,t,n,r){var i=this;void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var a=af.get("file:".concat(e));if(void 0!==a)return this.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===uf[e]){uf[e]=[],uf[e].push({onLoad:t,onProgress:n,onError:r});var o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),s=this.mimeType,l=this.responseType;fetch(o).then((function(t){if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;var n=uf[e],r=t.body.getReader(),i=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),a=i?parseInt(i):0,o=0!==a,s=0,l=new ReadableStream({start:function(e){!function t(){r.read().then((function(r){var i=r.done,l=r.value;if(i)e.close();else{s+=l.byteLength;for(var u=new ProgressEvent("progress",{lengthComputable:o,loaded:s,total:a}),c=0,h=n.length;c<h;c++){var d=n[c];d.onProgress&&d.onProgress(u)}e.enqueue(l),t()}}),(function(t){e.error(t)}))}()}});return new Response(l)}throw new cf('fetch for "'.concat(t.url,'" responded with ').concat(t.status,": ").concat(t.statusText),t)})).then((function(e){switch(l){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((function(e){return(new DOMParser).parseFromString(e,s)}));case"json":return e.json();default:if(""===s)return e.text();var t=/charset="?([^;"\s]*)"?/i.exec(s),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((function(e){return r.decode(e)}))}})).then((function(t){af.add("file:".concat(e),t);var n=uf[e];delete uf[e];for(var r=0,i=n.length;r<i;r++){var a=n[r];a.onLoad&&a.onLoad(t)}})).catch((function(t){var n=uf[e];if(void 0===n)throw i.manager.itemError(e),t;delete uf[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e)})).finally((function(){i.manager.itemEnd(e)})),this.manager.itemStart(e)}else uf[e].push({onLoad:t,onProgress:n,onError:r})}},{key:"setResponseType",value:function(e){return this.responseType=e,this}},{key:"setMimeType",value:function(e){return this.mimeType=e,this}},{key:"abort",value:function(){return this._abortController.abort(),this._abortController=new AbortController,this}}])}(lf),df=new WeakMap,ff=function(e){function t(e){return Ti(this,t),yi(this,t,[e])}return bi(t,e),Ai(t,[{key:"load",value:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=af.get("image:".concat(e));if(void 0!==a){if(!0===a.complete)i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0);else{var o=df.get(a);void 0===o&&(o=[],df.set(a,o)),o.push({onLoad:t,onError:r})}return a}var s=To("img");function l(){c(),t&&t(this);for(var n=df.get(this)||[],r=0;r<n.length;r++){var a=n[r];a.onLoad&&a.onLoad(this)}df.delete(this),i.manager.itemEnd(e)}function u(t){c(),r&&r(t),af.remove("image:".concat(e));for(var n=df.get(this)||[],a=0;a<n.length;a++){var o=n[a];o.onError&&o.onError(t)}df.delete(this),i.manager.itemError(e),i.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),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),af.add("image:".concat(e),s),i.manager.itemStart(e),s.src=e,s}}])}(lf),pf=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Ti(this,t),(n=yi(this,t)).isLight=!0,n.type="Light",n.color=new fl(e),n.intensity=r,n}return bi(t,e),Ai(t,[{key:"dispose",value:function(){}},{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),this.color.copy(e.color),this.intensity=e.intensity,this}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,void 0!==this.groundColor&&(n.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(n.object.distance=this.distance),void 0!==this.angle&&(n.object.angle=this.angle),void 0!==this.decay&&(n.object.decay=this.decay),void 0!==this.penumbra&&(n.object.penumbra=this.penumbra),void 0!==this.shadow&&(n.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(n.object.target=this.target.uuid),n}}])}(Ys),vf=function(e){function t(e,n,r){var i;return Ti(this,t),(i=yi(this,t,[e,r])).isHemisphereLight=!0,i.type="HemisphereLight",i.position.copy(Ys.DEFAULT_UP),i.updateMatrix(),i.groundColor=new fl(n),i}return bi(t,e),Ai(t,[{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),this.groundColor.copy(e.groundColor),this}}])}(pf),mf=new xs,yf=new go,gf=new go,_f=function(){return Ai((function e(t){Ti(this,e),this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new mo(512,512),this.mapType=qi,this.map=null,this.mapPass=null,this.matrix=new xs,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new dc,this._frameExtents=new mo(1,1),this._viewportCount=1,this._viewports=[new Go(0,0,1,1)]}),[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(e){var t=this.camera,n=this.matrix;yf.setFromMatrixPosition(e.matrixWorld),t.position.copy(yf),gf.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(gf),t.updateMatrixWorld(),mf.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(mf,t.coordinateSystem,t.reversedDepth),t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(mf)}},{key:"getViewport",value:function(e){return this._viewports[e]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"dispose",value:function(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}},{key:"copy",value:function(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}])}(),bf=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t,[new ru(50,1,.5,500)])).isSpotLightShadow=!0,e.focus=1,e.aspect=1,e}return bi(t,e),Ai(t,[{key:"updateMatrices",value:function(e){var n=this.camera,r=2*so*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,a=e.distance||n.far;r===n.fov&&i===n.aspect&&a===n.far||(n.fov=r,n.aspect=i,n.far=a,n.updateProjectionMatrix()),ci(t,"updateMatrices",this,3)([e])}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.focus=e.focus,this}}])}(_f),xf=function(e){function t(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2;return Ti(this,t),(r=yi(this,t,[e,n])).isSpotLight=!0,r.type="SpotLight",r.position.copy(Ys.DEFAULT_UP),r.updateMatrix(),r.target=new Ys,r.distance=i,r.angle=a,r.penumbra=o,r.decay=s,r.map=null,r.shadow=new bf,r}return bi(t,e),Ai(t,[{key:"power",get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}},{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),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}}])}(pf),Sf=new xs,wf=new go,Ef=new go,Mf=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t,[new ru(90,1,.5,500)])).isPointLightShadow=!0,e._frameExtents=new mo(4,2),e._viewportCount=6,e._viewports=[new Go(2,1,1,1),new Go(0,1,1,1),new Go(3,1,1,1),new Go(1,1,1,1),new Go(3,0,1,1),new Go(1,0,1,1)],e._cubeDirections=[new go(1,0,0),new go(-1,0,0),new go(0,0,1),new go(0,0,-1),new go(0,1,0),new go(0,-1,0)],e._cubeUps=[new go(0,1,0),new go(0,1,0),new go(0,1,0),new go(0,1,0),new go(0,0,1),new go(0,0,-1)],e}return bi(t,e),Ai(t,[{key:"updateMatrices",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),wf.setFromMatrixPosition(e.matrixWorld),n.position.copy(wf),Ef.copy(n.position),Ef.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Ef),n.updateMatrixWorld(),r.makeTranslation(-wf.x,-wf.y,-wf.z),Sf.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Sf,n.coordinateSystem,n.reversedDepth)}}])}(_f),Tf=function(e){function t(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return Ti(this,t),(r=yi(this,t,[e,n])).isPointLight=!0,r.type="PointLight",r.distance=i,r.decay=a,r.shadow=new Mf,r}return bi(t,e),Ai(t,[{key:"power",get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}},{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}])}(pf),Cf=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return Ti(this,t),(e=yi(this,t)).isOrthographicCamera=!0,e.type="OrthographicCamera",e.zoom=1,e.view=null,e.left=n,e.right=r,e.top=i,e.bottom=a,e.near=o,e.far=s,e.updateProjectionMatrix(),e}return bi(t,e),Ai(t,[{key:"copy",value:function(e,n){return ci(t,"copy",this,3)([e,n]),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=null===e.view?null:Object.assign({},e.view),this}},{key:"setViewOffset",value:function(e,t,n,r,i,a){null===this.view&&(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=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=l*this.view.offsetX)+l*this.view.width,s=(o-=u*this.view.offsetY)-u*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,null!==this.view&&(n.object.view=Object.assign({},this.view)),n}}])}(Ql),Af=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t,[new Cf(-5,5,5,-5,.5,500)])).isDirectionalLightShadow=!0,e}return bi(t,e),Ai(t)}(_f),Pf=function(e){function t(e,n){var r;return Ti(this,t),(r=yi(this,t,[e,n])).isDirectionalLight=!0,r.type="DirectionalLight",r.position.copy(Ys.DEFAULT_UP),r.updateMatrix(),r.target=new Ys,r.shadow=new Af,r}return bi(t,e),Ai(t,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}])}(pf),kf=function(e){function t(e,n){var r;return Ti(this,t),(r=yi(this,t,[e,n])).isAmbientLight=!0,r.type="AmbientLight",r}return bi(t,e),Ai(t)}(pf),Of=function(e){function t(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return Ti(this,t),(r=yi(this,t,[e,n])).isRectAreaLight=!0,r.type="RectAreaLight",r.width=i,r.height=a,r}return bi(t,e),Ai(t,[{key:"power",get:function(){return this.intensity*this.width*this.height*Math.PI},set:function(e){this.intensity=e/(this.width*this.height*Math.PI)}},{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.width=e.width,this.height=e.height,this}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);return n.object.width=this.width,n.object.height=this.height,n}}])}(pf),Rf=function(){return Ai((function e(){Ti(this,e),this.isSphericalHarmonics3=!0,this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new go)}),[{key:"set",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}},{key:"getIrradianceAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}},{key:"add",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}},{key:"addScaledSH",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}},{key:"scale",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}},{key:"lerp",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}},{key:"equals",value:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}],[{key:"getBasisAt",value:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}])}(),If=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rf,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Ti(this,t),(e=yi(this,t,[void 0,r])).isLightProbe=!0,e.sh=n,e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.sh.copy(e.sh),this}},{key:"fromJSON",value:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);return n.object.sh=this.sh.toArray(),n}}])}(pf),Nf=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t,[e])).textures={},n}return bi(t,e),Ai(t,[{key:"load",value:function(e,t,n,r){var i=this,a=new hf(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}},{key:"parse",value:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=this.createMaterialFromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=(new fl).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(r.dispersion=e.dispersion),void 0!==e.iridescence&&(r.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(r.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(r.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(r.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(r.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(r.depthFunc=e.depthFunc),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(r.blendSrc=e.blendSrc),void 0!==e.blendDst&&(r.blendDst=e.blendDst),void 0!==e.blendEquation&&(r.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(r.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(r.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(r.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==r.blendColor&&r.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(r.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),void 0!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(r.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new fl).setHex(a.value);break;case"v2":r.uniforms[i].value=(new mo).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new go).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new Go).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new xo).fromArray(a.value);break;case"m4":r.uniforms[i].value=(new xs).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(r.glslVersion=e.glslVersion),void 0!==e.extensions)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(void 0!==e.lights&&(r.lights=e.lights),void 0!==e.clipping&&(r.clipping=e.clipping),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new mo).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapRotation&&r.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new mo).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(r.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.anisotropyMap&&(r.anisotropyMap=n(e.anisotropyMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}},{key:"setTextures",value:function(e){return this.textures=e,this}},{key:"createMaterialFromType",value:function(e){return t.createMaterialFromType(e)}}],[{key:"createMaterialFromType",value:function(e){return new{ShadowMaterial:Ad,SpriteMaterial:yu,RawShaderMaterial:Pd,ShaderMaterial:$l,PointsMaterial:Jc,MeshPhysicalMaterial:Od,MeshStandardMaterial:kd,MeshPhongMaterial:Rd,MeshToonMaterial:Id,MeshNormalMaterial:Nd,MeshLambertMaterial:Ld,MeshDepthMaterial:Dd,MeshDistanceMaterial:Ud,MeshBasicMaterial:yl,MeshMatcapMaterial:Fd,LineDashedMaterial:Bd,LineBasicMaterial:Lc,Material:ml}[e]}}])}(lf),Lf=function(){return Ai((function e(){Ti(this,e)}),null,[{key:"extractUrlBase",value:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}},{key:"resolveURL",value:function(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}])}(),Df=function(e){function t(){var e;return Ti(this,t),(e=yi(this,t)).isInstancedBufferGeometry=!0,e.type="InstancedBufferGeometry",e.instanceCount=1/0,e}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.instanceCount=e.instanceCount,this}},{key:"toJSON",value:function(){var e=ci(t,"toJSON",this,3)([]);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}])}(Rl),Uf=function(e){function t(e){return Ti(this,t),yi(this,t,[e])}return bi(t,e),Ai(t,[{key:"load",value:function(e,t,n,r){var i=this,a=new hf(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}},{key:"parse",value:function(e){var t={},n={};function r(e,r){if(void 0!==t[r])return t[r];var i=e.interleavedBuffers[r],a=function(e,t){if(void 0!==n[t])return n[t];var r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),o=Mo(i.type,a),s=new pu(o,i.stride);return s.uuid=i.uuid,t[r]=s,s}var i=e.isInstancedBufferGeometry?new Df:new Rl,a=e.data.index;if(void 0!==a){var o=Mo(a.type,a.array);i.setIndex(new xl(o,1))}var s=e.data.attributes;for(var l in s){var u=s[l],c=void 0;if(u.isInterleavedBufferAttribute){var h=r(e.data,u.data);c=new mu(h,u.itemSize,u.offset,u.normalized)}else{var d=Mo(u.type,u.array);c=new(u.isInstancedBufferAttribute?Zu:xl)(d,u.itemSize,u.normalized)}void 0!==u.name&&(c.name=u.name),void 0!==u.usage&&c.setUsage(u.usage),i.setAttribute(l,c)}var f=e.data.morphAttributes;if(f)for(var p in f){for(var v=f[p],m=[],y=0,g=v.length;y<g;y++){var _=v[y],b=void 0;if(_.isInterleavedBufferAttribute){var x=r(e.data,_.data);b=new mu(x,_.itemSize,_.offset,_.normalized)}else{var S=Mo(_.type,_.array);b=new xl(S,_.itemSize,_.normalized)}void 0!==_.name&&(b.name=_.name),m.push(b)}i.morphAttributes[p]=m}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);var w=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==w)for(var E=0,M=w.length;E!==M;++E){var T=w[E];i.addGroup(T.start,T.count,T.materialIndex)}var C=e.data.boundingSphere;return void 0!==C&&(i.boundingSphere=(new ds).fromJSON(C)),e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}])}(lf),Ff=function(e){function t(e){return Ti(this,t),yi(this,t,[e])}return bi(t,e),Ai(t,[{key:"load",value:function(e,t,n,r){var i=this,a=""===this.path?Lf.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new hf(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())return void 0!==r&&r(new Error("THREE.ObjectLoader: Can't load "+e)),void console.error("THREE.ObjectLoader: Can't load "+e);i.parse(a,t)}),n,r)}},{key:"loadAsync",value:(i=oi(wi().m((function e(t,n){var r,i,a,o,s,l;return wi().w((function(e){for(;;)switch(e.n){case 0:return r=this,i=""===this.path?Lf.extractUrlBase(t):this.path,this.resourcePath=this.resourcePath||i,(a=new hf(this.manager)).setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),e.n=1,a.loadAsync(t,n);case 1:if(o=e.v,s=JSON.parse(o),void 0!==(l=s.metadata)&&void 0!==l.type&&"geometry"!==l.type.toLowerCase()){e.n=2;break}throw new Error("THREE.ObjectLoader: Can't load "+t);case 2:return e.n=3,r.parseAsync(s);case 3:return e.a(2,e.v)}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"parse",value:function(e,t){var n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),a=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),o=this.parseTextures(e.textures,a),s=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,i,s,o,n),u=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,u),this.bindLightTargets(l),void 0!==t){var c=!1;for(var h in a)if(a[h].data instanceof HTMLImageElement){c=!0;break}!1===c&&t(l)}return l}},{key:"parseAsync",value:(r=oi(wi().m((function e(t){var n,r,i,a,o,s,l,u;return wi().w((function(e){for(;;)switch(e.n){case 0:return n=this.parseAnimations(t.animations),r=this.parseShapes(t.shapes),i=this.parseGeometries(t.geometries,r),e.n=1,this.parseImagesAsync(t.images);case 1:return a=e.v,o=this.parseTextures(t.textures,a),s=this.parseMaterials(t.materials,o),l=this.parseObject(t.object,i,s,o,n),u=this.parseSkeletons(t.skeletons,l),this.bindSkeletons(l,u),this.bindLightTargets(l),e.a(2,l)}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"parseShapes",value:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Dh).fromJSON(e[n]);t[i.uuid]=i}return t}},{key:"parseSkeletons",value:function(e,t){var n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(var i=0,a=e.length;i<a;i++){var o=(new Ju).fromJSON(e[i],r);n[o.uuid]=o}return n}},{key:"parseGeometries",value:function(e,t){var n={};if(void 0!==e)for(var r=new Uf,i=0,a=e.length;i<a;i++){var o=void 0,s=e[i];switch(s.type){case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;default:s.type in Cd?o=Cd[s.type].fromJSON(s,t):console.warn('THREE.ObjectLoader: Unsupported geometry type "'.concat(s.type,'"'))}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n}},{key:"parseMaterials",value:function(e,t){var n={},r={};if(void 0!==e){var i=new Nf;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r}},{key:"parseAnimations",value:function(e){var t={};if(void 0!==e)for(var n=0;n<e.length;n++){var r=e[n],i=nf.parse(r);t[i.uuid]=i}return t}},{key:"parseImages",value:function(e,t){var n,r=this,i={};function a(e){if("string"==typeof e){var t=e;return function(e){return r.manager.itemStart(e),n.load(e,(function(){r.manager.itemEnd(e)}),void 0,(function(){r.manager.itemError(e),r.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t)}return e.data?{data:Mo(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){var o=new of(t);(n=new ff(o)).setCrossOrigin(this.crossOrigin);for(var s=0,l=e.length;s<l;s++){var u=e[s],c=u.url;if(Array.isArray(c)){for(var h=[],d=0,f=c.length;d<f;d++){var p=a(c[d]);null!==p&&(p instanceof HTMLImageElement?h.push(p):h.push(new Xu(p.data,p.width,p.height)))}i[u.uuid]=new Bo(h)}else{var v=a(u.url);i[u.uuid]=new Bo(v)}}}return i}},{key:"parseImagesAsync",value:(n=oi(wi().m((function e(t){var n,r,i,a,o,s,l,u,c,h,d,f,p,v,m;return wi().w((function(e){for(;;)switch(e.n){case 0:if(o=function(){return o=oi(wi().m((function e(t){var r,a;return wi().w((function(e){for(;;)switch(e.n){case 0:if("string"!=typeof t){e.n=2;break}return a=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r=t)?r:n.resourcePath+r,e.n=1,i.loadAsync(a);case 1:return e.a(2,e.v);case 2:if(!t.data){e.n=3;break}return e.a(2,{data:Mo(t.type,t.data),width:t.width,height:t.height});case 3:return e.a(2,null);case 4:return e.a(2)}}),e)}))),o.apply(this,arguments)},a=function(e){return o.apply(this,arguments)},n=this,r={},!(void 0!==t&&t.length>0)){e.n=9;break}(i=new ff(this.manager)).setCrossOrigin(this.crossOrigin),s=0,l=t.length;case 1:if(!(s<l)){e.n=9;break}if(u=t[s],c=u.url,!Array.isArray(c)){e.n=6;break}h=[],d=0,f=c.length;case 2:if(!(d<f)){e.n=5;break}return p=c[d],e.n=3,a(p);case 3:null!==(v=e.v)&&(v instanceof HTMLImageElement?h.push(v):h.push(new Xu(v.data,v.width,v.height)));case 4:d++,e.n=2;break;case 5:r[u.uuid]=new Bo(h),e.n=8;break;case 6:return e.n=7,a(u.url);case 7:m=e.v,r[u.uuid]=new Bo(m);case 8:s++,e.n=1;break;case 9:return e.a(2,r)}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"parseTextures",value:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o=e[i];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===t[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s=t[o.image],l=s.data,u=void 0;Array.isArray(l)?(u=new ou,6===l.length&&(u.needsUpdate=!0)):(u=l&&l.data?new Xu:new Vo,l&&(u.needsUpdate=!0)),u.source=s,u.uuid=o.uuid,void 0!==o.name&&(u.name=o.name),void 0!==o.mapping&&(u.mapping=n(o.mapping,Bf)),void 0!==o.channel&&(u.channel=o.channel),void 0!==o.offset&&u.offset.fromArray(o.offset),void 0!==o.repeat&&u.repeat.fromArray(o.repeat),void 0!==o.center&&u.center.fromArray(o.center),void 0!==o.rotation&&(u.rotation=o.rotation),void 0!==o.wrap&&(u.wrapS=n(o.wrap[0],zf),u.wrapT=n(o.wrap[1],zf)),void 0!==o.format&&(u.format=o.format),void 0!==o.internalFormat&&(u.internalFormat=o.internalFormat),void 0!==o.type&&(u.type=o.type),void 0!==o.colorSpace&&(u.colorSpace=o.colorSpace),void 0!==o.minFilter&&(u.minFilter=n(o.minFilter,jf)),void 0!==o.magFilter&&(u.magFilter=n(o.magFilter,jf)),void 0!==o.anisotropy&&(u.anisotropy=o.anisotropy),void 0!==o.flipY&&(u.flipY=o.flipY),void 0!==o.generateMipmaps&&(u.generateMipmaps=o.generateMipmaps),void 0!==o.premultiplyAlpha&&(u.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(u.unpackAlignment=o.unpackAlignment),void 0!==o.compareFunction&&(u.compareFunction=o.compareFunction),void 0!==o.userData&&(u.userData=o.userData),r[o.uuid]=u}return r}},{key:"parseObject",value:function(e,t,n,r,i){var a,o,s;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function u(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}function c(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":a=new fu,void 0!==e.background&&(Number.isInteger(e.background)?a.background=new fl(e.background):a.background=c(e.background)),void 0!==e.environment&&(a.environment=c(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new du(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new hu(e.fog.color,e.fog.density)),""!==e.fog.name&&(a.fog.name=e.fog.name)),void 0!==e.backgroundBlurriness&&(a.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(a.backgroundIntensity=e.backgroundIntensity),void 0!==e.backgroundRotation&&a.backgroundRotation.fromArray(e.backgroundRotation),void 0!==e.environmentIntensity&&(a.environmentIntensity=e.environmentIntensity),void 0!==e.environmentRotation&&a.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":a=new ru(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new Cf(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new kf(e.color,e.intensity);break;case"DirectionalLight":(a=new Pf(e.color,e.intensity)).target=e.target||"";break;case"PointLight":a=new Tf(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new Of(e.color,e.intensity,e.width,e.height);break;case"SpotLight":(a=new xf(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay)).target=e.target||"";break;case"HemisphereLight":a=new vf(e.color,e.groundColor,e.intensity);break;case"LightProbe":a=(new If).fromJSON(e);break;case"SkinnedMesh":o=l(e.geometry),s=u(e.material),a=new Gu(o,s),void 0!==e.bindMode&&(a.bindMode=e.bindMode),void 0!==e.bindMatrix&&a.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(a.skeleton=e.skeleton);break;case"Mesh":o=l(e.geometry),s=u(e.material),a=new Gl(o,s);break;case"InstancedMesh":o=l(e.geometry),s=u(e.material);var h=e.count,d=e.instanceMatrix,f=e.instanceColor;(a=new ic(o,s,h)).instanceMatrix=new Zu(new Float32Array(d.array),16),void 0!==f&&(a.instanceColor=new Zu(new Float32Array(f.array),f.itemSize));break;case"BatchedMesh":o=l(e.geometry),s=u(e.material),(a=new Nc(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,s)).geometry=o,a.perObjectFrustumCulled=e.perObjectFrustumCulled,a.sortObjects=e.sortObjects,a._drawRanges=e.drawRanges,a._reservedRanges=e.reservedRanges,a._geometryInfo=e.geometryInfo.map((function(e){var t=null,n=null;return void 0!==e.boundingBox&&(t=(new Yo).fromJSON(e.boundingBox)),void 0!==e.boundingSphere&&(n=(new ds).fromJSON(e.boundingSphere)),fi(fi({},e),{},{boundingBox:t,boundingSphere:n})})),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),void 0!==e.colorsTexture&&(a._colorsTexture=c(e.colorsTexture.uuid)),void 0!==e.boundingSphere&&(a.boundingSphere=(new ds).fromJSON(e.boundingSphere)),void 0!==e.boundingBox&&(a.boundingBox=(new Yo).fromJSON(e.boundingBox));break;case"LOD":a=new Nu;break;case"Line":a=new Vc(l(e.geometry),u(e.material));break;case"LineLoop":a=new Yc(l(e.geometry),u(e.material));break;case"LineSegments":a=new qc(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":a=new eh(l(e.geometry),u(e.material));break;case"Sprite":a=new ku(u(e.material));break;case"Group":a=new lu;break;case"Bone":a=new Wu;break;default:a=new Ys}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.up&&a.up.fromArray(e.up),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(a.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children)for(var p=e.children,v=0;v<p.length;v++)a.add(this.parseObject(p[v],t,n,r,i));if(void 0!==e.animations)for(var m=e.animations,y=0;y<m.length;y++){var g=m[y];a.animations.push(i[g])}if("LOD"===e.type){void 0!==e.autoUpdate&&(a.autoUpdate=e.autoUpdate);for(var _=e.levels,b=0;b<_.length;b++){var x=_[b],S=a.getObjectByProperty("uuid",x.object);void 0!==S&&a.addLevel(S,x.distance,x.hysteresis)}}return a}},{key:"bindSkeletons",value:function(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){var n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}},{key:"bindLightTargets",value:function(e){e.traverse((function(t){if(t.isDirectionalLight||t.isSpotLight){var n=t.target,r=e.getObjectByProperty("uuid",n);t.target=void 0!==r?r:new Ys}}))}}]);var n,r,i}(lf),Bf={UVMapping:300,CubeReflectionMapping:Ni,CubeRefractionMapping:Li,EquirectangularReflectionMapping:Di,EquirectangularRefractionMapping:Ui,CubeUVReflectionMapping:Fi},zf={RepeatWrapping:Bi,ClampToEdgeWrapping:zi,MirroredRepeatWrapping:ji},jf={NearestFilter:Hi,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:Vi,LinearFilter:Gi,LinearMipmapNearestFilter:Wi,LinearMipmapLinearFilter:Xi},Hf=(new WeakMap,function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ti(this,t),(e=yi(this,t)).isArrayCamera=!0,e.isMultiViewCamera=!1,e.cameras=n,e}return bi(t,e),Ai(t)}(ru)),Vf=function(){return Ai((function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Ti(this,e),this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}),[{key:"start",value:function(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}])}(),Gf=function(){return Ai((function e(t,n,r){var i,a,o;switch(Ti(this,e),this.binding=t,this.valueSize=r,n){case"quaternion":i=this._slerp,a=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*r),this._workIndex=5;break;case"string":case"bool":i=this._select,a=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*r);break;default:i=this._lerp,a=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*r)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=a,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}),[{key:"accumulate",value:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a}},{key:"accumulateAdditive",value:function(e){var t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}},{key:"apply",value:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=t*this._origIndex;this._mixBufferRegion(n,r,s,1-i,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var l=t,u=t+t;l!==u;++l)if(n[l]!==n[l+t]){o.setValue(n,r);break}}},{key:"saveOriginalState",value:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}},{key:"restoreOriginalState",value:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)}},{key:"_setAdditiveIdentityNumeric",value:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n<t;n++)this.buffer[n]=0}},{key:"_setAdditiveIdentityQuaternion",value:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}},{key:"_setAdditiveIdentityOther",value:function(){for(var e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}},{key:"_select",value:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]}},{key:"_slerp",value:function(e,t,n,r){yo.slerpFlat(e,t,e,t,e,n,r)}},{key:"_slerpAdditive",value:function(e,t,n,r,i){var a=this._workIndex*i;yo.multiplyQuaternionsFlat(e,a,e,t,e,n),yo.slerpFlat(e,t,e,t,e,a,r)}},{key:"_lerp",value:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}},{key:"_lerpAdditive",value:function(e,t,n,r,i){for(var a=0;a!==i;++a){var o=t+a;e[o]=e[o]+e[n+a]*r}}}])}(),Wf="\\[\\]\\.:\\/",Xf=new RegExp("["+Wf+"]","g"),qf="[^"+Wf+"]",Yf="[^"+Wf.replace("\\.","")+"]",Jf=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",qf)+/(WCOD+)?/.source.replace("WCOD",Yf)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",qf)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",qf)+"$"),Zf=["material","materials","bones","map"],Kf=function(){return Ai((function e(t,n,r){Ti(this,e);var i=r||$f.parseTrackName(n);this._targetGroup=t,this._bindings=t.subscribe_(n,i)}),[{key:"getValue",value:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}},{key:"setValue",value:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}},{key:"bind",value:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}},{key:"unbind",value:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}])}(),$f=function(){function e(t,n,r){Ti(this,e),this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return Ai(e,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(e,t){e[t]=this.targetObject[this.propertyName]}},{key:"_getValue_array",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]}},{key:"_getValue_arrayElement",value:function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(e,t){this.resolvedProperty.toArray(e,t)}},{key:"_setValue_direct",value:function(e,t){this.targetObject[this.propertyName]=e[t]}},{key:"_setValue_direct_setNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]}},{key:"_setValue_array_setNeedsUpdate",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(e,t){this.resolvedProperty.fromArray(e,t)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(e,t){this.bind(),this.getValue(e,t)}},{key:"_setValue_unbound",value:function(e,t){this.bind(),this.setValue(e,t)}},{key:"bind",value:function(){var t=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,a=n.propertyIndex;if(t||(t=e.findNode(this.rootNode,n.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(r){var o=n.objectIndex;switch(r){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var s=0;s<t.length;s++)if(t[s].name===o){o=s;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[r])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[r]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var l=t[i];if(void 0!==l){var u=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?u=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(u=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==a){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[a]&&(a=t.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=a}else void 0!==l.fromArray&&void 0!==l.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(c=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][u]}else{var h=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",t)}}else console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".")}},{key:"unbind",value:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}],[{key:"create",value:function(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}},{key:"sanitizeNodeName",value:function(e){return e.replace(/\s/g,"_").replace(Xf,"")}},{key:"parseTrackName",value:function(e){var t=Jf.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==Zf.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}},{key:"findNode",value:function(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}])}();$f.Composite=Kf,$f.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},$f.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},$f.prototype.GetterByBindingType=[$f.prototype._getValue_direct,$f.prototype._getValue_array,$f.prototype._getValue_arrayElement,$f.prototype._getValue_toArray],$f.prototype.SetterByBindingTypeAndVersioning=[[$f.prototype._setValue_direct,$f.prototype._setValue_direct_setNeedsUpdate,$f.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[$f.prototype._setValue_array,$f.prototype._setValue_array_setNeedsUpdate,$f.prototype._setValue_array_setMatrixWorldNeedsUpdate],[$f.prototype._setValue_arrayElement,$f.prototype._setValue_arrayElement_setNeedsUpdate,$f.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[$f.prototype._setValue_fromArray,$f.prototype._setValue_fromArray_setNeedsUpdate,$f.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Qf=function(){return Ai((function e(){Ti(this,e),this.isAnimationObjectGroup=!0,this.uuid=lo(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var n=0,r=arguments.length;n!==r;++n)t[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}),[{key:"add",value:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,a=i.length,o=void 0,s=e.length,l=this.nCachedObjects_,u=0,c=arguments.length;u!==c;++u){var h=arguments[u],d=h.uuid,f=t[d];if(void 0===f){f=s++,t[d]=f,e.push(h);for(var p=0,v=a;p!==v;++p)i[p].push(new $f(h,n[p],r[p]))}else if(f<l){o=e[f];var m=--l,y=e[m];t[y.uuid]=f,e[f]=y,t[d]=m,e[m]=h;for(var g=0,_=a;g!==_;++g){var b=i[g],x=b[m],S=b[f];b[f]=x,void 0===S&&(S=new $f(h,n[g],r[g])),b[m]=S}}else e[f]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}},{key:"remove",value:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,u=t[l];if(void 0!==u&&u>=i){var c=i++,h=e[c];t[h.uuid]=u,e[u]=h,t[l]=c,e[c]=s;for(var d=0,f=r;d!==f;++d){var p=n[d],v=p[c],m=p[u];p[u]=v,p[c]=m}}}this.nCachedObjects_=i}},{key:"uncache",value:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o].uuid,u=t[l];if(void 0!==u)if(delete t[l],u<i){var c=--i,h=e[c],d=--a,f=e[d];t[h.uuid]=u,e[u]=h,t[f.uuid]=c,e[c]=f,e.pop();for(var p=0,v=r;p!==v;++p){var m=n[p],y=m[c],g=m[d];m[u]=y,m[c]=g,m.pop()}}else{var _=--a,b=e[_];_>0&&(t[b.uuid]=u),e[u]=b,e.pop();for(var x=0,S=r;x!==S;++x){var w=n[x];w[u]=w[_],w.pop()}}}this.nCachedObjects_=i}},{key:"subscribe_",value:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,c=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(c);for(var h=u,d=s.length;h!==d;++h){var f=s[h];c[h]=new $f(f,e,t)}return c}},{key:"unsubscribe_",value:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}])}(),ep=function(){return Ai((function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.blendMode;Ti(this,e),this._mixer=t,this._clip=n,this._localRoot=r,this.blendMode=i;for(var a=n.tracks,o=a.length,s=new Array(o),l={endingStart:Ga,endingEnd:Ga},u=0;u!==o;++u){var c=a[u].createInterpolant(null);s[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}),[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,t){return this.loop=e,this.repetitions=t,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.fadeOut(t),this.fadeIn(t),!0===n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this}},{key:"crossFadeTo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.crossFadeFrom(this,t,n)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,t,n){var r=this._mixer,i=r.time,a=this.timeScale,o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/a,l[1]=t/a,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;a<0||0===n?t=0:(this._startTime=null,t=n*a)}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0){var l=this._interpolants,u=this._propertyBindings;if(2501===this.blendMode)for(var c=0,h=l.length;c!==h;++c)l[c].evaluate(o),u[c].accumulateAdditive(s);else for(var d=0,f=l.length;d!==f;++d)l[d].evaluate(o),u[d].accumulate(r,s)}}else this._updateWeight(e)}},{key:"_updateWeight",value:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}},{key:"_updateTimeScale",value:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}},{key:"_updateTime",value:function(e){var t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=2202===n;if(0===e)return-1===i||!a||1&~i?r:t-r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){var o=Math.floor(r/t);r-=t*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=r;if(a&&!(1&~i))return t-r}return r}},{key:"_setEndings",value:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=Wa,r.endingEnd=Wa):(r.endingStart=e?this.zeroSlopeAtStart?Wa:Ga:Xa,r.endingEnd=t?this.zeroSlopeAtEnd?Wa:Ga:Xa)}},{key:"_scheduleFading",value:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}])}(),tp=new Float32Array(1),np=function(e){function t(e){var n;return Ti(this,t),(n=yi(this,t))._root=e,n._initMemoryManager(),n._accuIndex=0,n.time=0,n.timeScale=1,n}return bi(t,e),Ai(t,[{key:"_bindAction",value:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,u=l[s];void 0===u&&(u={},l[s]=u);for(var c=0;c!==i;++c){var h=r[c],d=h.name,f=u[d];if(void 0!==f)++f.referenceCount,a[c]=f;else{if(void 0!==(f=a[c])){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=t&&t._propertyBindings[c].binding.parsedPath;++(f=new Gf($f.create(n,d,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(f,s,d),a[c]=f}o[c].resultBuffer=f.buffer}}},{key:"_activateAction",value:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}},{key:"_deactivateAction",value:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}},{key:"_initMemoryManager",value:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}},{key:"_isActiveAction",value:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions}},{key:"_addInactiveAction",value:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e}},{key:"_removeInactiveAction",value:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],u=e._byClipCacheIndex;l._byClipCacheIndex=u,s[u]=l,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)}},{key:"_removeInactiveBindingsForAction",value:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0===--i.referenceCount&&this._removeInactiveBinding(i)}}},{key:"_lendAction",value:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}},{key:"_takeBackAction",value:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}},{key:"_addInactiveBinding",value:function(e,t,n){var r=this._bindingsByRootAndName,i=this._bindings,a=r[t];void 0===a&&(a={},r[t]=a),a[n]=e,e._cacheIndex=i.length,i.push(e)}},{key:"_removeInactiveBinding",value:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]}},{key:"_lendBinding",value:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}},{key:"_takeBackBinding",value:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}},{key:"_lendControlInterpolant",value:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new Xd(new Float32Array(2),new Float32Array(2),1,tp)).__cacheIndex=t,e[t]=n),n}},{key:"_takeBackControlInterpolant",value:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}},{key:"clipAction",value:function(e,t,n){var r=t||this._root,i=r.uuid,a="string"==typeof e?nf.findByName(r,e):e,o=null!==a?a.uuid:e,s=this._actionsByClip[o],l=null;if(void 0===n&&(n=null!==a?a.blendMode:2500),void 0!==s){var u=s.actionByRoot[i];if(void 0!==u&&u.blendMode===n)return u;l=s.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;var c=new ep(this,a,t,n);return this._bindAction(c,l),this._addInactiveAction(c,o,i),c}},{key:"existingAction",value:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?nf.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null}},{key:"stopAllAction",value:function(){for(var e=this._actions,t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}},{key:"update",value:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o)t[o]._update(r,e,i,a);for(var s=this._bindings,l=this._nActiveBindings,u=0;u!==l;++u)s[u].apply(a);return this}},{key:"setTime",value:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}},{key:"getRoot",value:function(){return this._root}},{key:"uncacheClip",value:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var u=l._cacheIndex,c=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=u,t[u]=c,t.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}}},{key:"uncacheRoot",value:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}}},{key:"uncacheAction",value:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}])}(ro),rp=function(e){function t(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Ti(this,t),(r=yi(this,t,[e,n])).isInstancedInterleavedBuffer=!0,r.meshPerAttribute=i,r}return bi(t,e),Ai(t,[{key:"copy",value:function(e){return ci(t,"copy",this,3)([e]),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"clone",value:function(e){var n=ci(t,"clone",this,3)([e]);return n.meshPerAttribute=this.meshPerAttribute,n}},{key:"toJSON",value:function(e){var n=ci(t,"toJSON",this,3)([e]);return n.isInstancedInterleavedBuffer=!0,n.meshPerAttribute=this.meshPerAttribute,n}}])}(pu),ip=new xs,ap=function(){return Ai((function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;Ti(this,e),this.ray=new bs(t,n),this.near=r,this.far=i,this.camera=null,this.layers=new Rs,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}),[{key:"set",value:function(e,t){this.ray.set(e,t)}},{key:"setFromCamera",value:function(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}},{key:"setFromXRController",value:function(e){return ip.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(ip),this}},{key:"intersectObject",value:function(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return sp(e,this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),t.sort(op),t}},{key:"intersectObjects",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0,i=e.length;r<i;r++)sp(e[r],this,n,t);return n.sort(op),n}}])}();function op(e,t){return e.distance-t.distance}function sp(e,t,n,r){var i=!0;if(e.layers.test(t.layers)&&!1===e.raycast(t,n)&&(i=!1),!0===i&&!0===r)for(var a=e.children,o=0,s=a.length;o<s;o++)sp(a[o],t,n,!0)}function lp(e,t,n,r){var i=function(e){switch(e){case qi:case 1010:return{byteLength:1,components:1};case Yi:case 1011:case $i:return{byteLength:2,components:1};case Qi:case ea:return{byteLength:2,components:4};case Zi:case Ji:case Ki:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw new Error("Unknown texture type ".concat(e,"."))}(r);switch(n){case 1021:return e*t;case aa:case oa:return e*t/i.components*i.byteLength;case 1030:case sa:return e*t*2/i.components*i.byteLength;case 1022:return e*t*3/i.components*i.byteLength;case na:case la:return e*t*4/i.components*i.byteLength;case ua:case ca:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case ha:case da:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case pa:case ma:return Math.max(e,16)*Math.max(t,8)/4;case fa:case va:return Math.max(e,8)*Math.max(t,8)/2;case ya:case ga:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case _a:case ba:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case xa:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case Sa:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case wa:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case Ea:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case Ma:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case Ta:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case Ca:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case Aa:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case Pa:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case ka:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case Oa:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case Ra:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case Ia:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case Na:case La:case Da:return Math.ceil(e/4)*Math.ceil(t/4)*16;case Ua:case Fa:return Math.ceil(e/4)*Math.ceil(t/4)*8;case Ba:case za:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw new Error("Unable to determine texture byte length for ".concat(n," format."))}function up(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return cp(u,"_invoke",function(n,r,i){var a,s,l,u=0,c=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,s=0,l=e,d.n=n,o}};function f(n,r){for(s=n,l=r,t=0;!h&&u&&!i&&t<c.length;t++){var i,a=c[t],f=d.p,p=a[2];n>3?(i=p===r)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=f&&((i=n<2&&f<a[1])?(s=0,d.v=r,d.n=a[1]):f<p&&(i=n<3||a[0]>r||r>p)&&(a[4]=n,a[5]=r,d.n=p,s=0))}if(i||n>1)return o;throw h=!0,r}return function(i,c,p){if(u>1)throw TypeError("Generator is already running");for(h&&1===c&&f(c,p),s=c,l=p;(t=s<2?e:l)||!h;){a||(s?s<3?(s>1&&(d.n=-1),f(s,l)):d.n=l:d.v=l);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==o)break}catch(t){a=e,s=1,l=t}finally{u=1}}return{value:t,done:h}}}(n,i,a),!0),u}var o={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(cp(t={},r,(function(){return this})),t),h=u.prototype=s.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,cp(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=u,cp(h,"constructor",u),cp(u,"constructor",l),l.displayName="GeneratorFunction",cp(u,i,"GeneratorFunction"),cp(h),cp(h,i,"Generator"),cp(h,r,(function(){return this})),cp(h,"toString",(function(){return"[object Generator]"})),(up=function(){return{w:a,m:d}})()}function cp(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}cp=function(e,t,n,r){function a(t,n){cp(e,t,(function(e){return this._invoke(t,n,e)}))}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},cp(e,t,n,r)}function hp(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function dp(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){hp(a,r,i,o,s,"next",e)}function s(e){hp(a,r,i,o,s,"throw",e)}o(void 0)}))}}function fp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fp=function(){return!!e})()}function pp(e){return pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pp(e)}function vp(e,t){return vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vp(e,t)}function mp(e,t,n){return(t=wp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return gp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function gp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _p(e){return _p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_p(e)}function bp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wp(r.key),r)}}function Sp(e,t,n){return t&&xp(e.prototype,t),n&&xp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wp(e){var t=function(e){if("object"!=_p(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_p(t)?t:t+""}function Ep(){var e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Mp(e){var t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))},update:function(n,r){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){var i=t.get(n);(!i||i.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version})}else{var a=t.get(n);if(void 0===a)t.set(n,function(t,n){var r,i=t.array,a=t.usage,o=i.byteLength,s=e.createBuffer();if(e.bindBuffer(n,s),e.bufferData(n,i,a),t.onUploadCallback(),i instanceof Float32Array)r=e.FLOAT;else if("undefined"!=typeof Float16Array&&i instanceof Float16Array)r=e.HALF_FLOAT;else if(i instanceof Uint16Array)r=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(i instanceof Int16Array)r=e.SHORT;else if(i instanceof Uint32Array)r=e.UNSIGNED_INT;else if(i instanceof Int32Array)r=e.INT;else if(i instanceof Int8Array)r=e.BYTE;else if(i instanceof Uint8Array)r=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);r=e.UNSIGNED_BYTE}return{buffer:s,type:r,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version,size:o}}(n,r));else if(a.version<n.version){if(a.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,r){var i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),0===a.length)e.bufferSubData(r,0,i);else{a.sort((function(e,t){return e.start-t.start}));for(var o=0,s=1;s<a.length;s++){var l=a[o],u=a[s];u.start<=l.start+l.count+1?l.count=Math.max(l.count,u.start+u.count-l.start):a[++o]=u}a.length=o+1;for(var c=0,h=a.length;c<h;c++){var d=a[c];e.bufferSubData(r,d.start*i.BYTES_PER_ELEMENT,i,d.start,d.count)}n.clearUpdateRanges()}n.onUploadCallback()}(a.buffer,n,r),a.version=n.version}}}}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ki}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ki);var Tp={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\tfloat depth = unpackRGBAToDepth( texture2D( depths, uv ) );\n\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\treturn step( depth, compare );\n\t\t#else\n\t\t\treturn step( compare, depth );\n\t\t#endif\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow( sampler2D shadow, vec2 uv, float compare ) {\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\tfloat hard_shadow = step( distribution.x, compare );\n\t\t#else\n\t\t\tfloat hard_shadow = step( compare, distribution.x );\n\t\t#endif\n\t\tif ( hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t#else\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n\t#else\n\t\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n\t#endif\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},Cp={common:{diffuse:{value:new fl(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new xo},alphaMap:{value:null},alphaMapTransform:{value:new xo},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new xo}},envmap:{envMap:{value:null},envMapRotation:{value:new xo},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new xo}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new xo}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new xo},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new xo},normalScale:{value:new mo(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new xo},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new xo}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new xo}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new xo}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fl(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 fl(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new xo},alphaTest:{value:0},uvTransform:{value:new xo}},sprite:{diffuse:{value:new fl(16777215)},opacity:{value:1},center:{value:new mo(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new xo},alphaMap:{value:null},alphaMapTransform:{value:new xo},alphaTest:{value:0}}},Ap={basic:{uniforms:Yl([Cp.common,Cp.specularmap,Cp.envmap,Cp.aomap,Cp.lightmap,Cp.fog]),vertexShader:Tp.meshbasic_vert,fragmentShader:Tp.meshbasic_frag},lambert:{uniforms:Yl([Cp.common,Cp.specularmap,Cp.envmap,Cp.aomap,Cp.lightmap,Cp.emissivemap,Cp.bumpmap,Cp.normalmap,Cp.displacementmap,Cp.fog,Cp.lights,{emissive:{value:new fl(0)}}]),vertexShader:Tp.meshlambert_vert,fragmentShader:Tp.meshlambert_frag},phong:{uniforms:Yl([Cp.common,Cp.specularmap,Cp.envmap,Cp.aomap,Cp.lightmap,Cp.emissivemap,Cp.bumpmap,Cp.normalmap,Cp.displacementmap,Cp.fog,Cp.lights,{emissive:{value:new fl(0)},specular:{value:new fl(1118481)},shininess:{value:30}}]),vertexShader:Tp.meshphong_vert,fragmentShader:Tp.meshphong_frag},standard:{uniforms:Yl([Cp.common,Cp.envmap,Cp.aomap,Cp.lightmap,Cp.emissivemap,Cp.bumpmap,Cp.normalmap,Cp.displacementmap,Cp.roughnessmap,Cp.metalnessmap,Cp.fog,Cp.lights,{emissive:{value:new fl(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Tp.meshphysical_vert,fragmentShader:Tp.meshphysical_frag},toon:{uniforms:Yl([Cp.common,Cp.aomap,Cp.lightmap,Cp.emissivemap,Cp.bumpmap,Cp.normalmap,Cp.displacementmap,Cp.gradientmap,Cp.fog,Cp.lights,{emissive:{value:new fl(0)}}]),vertexShader:Tp.meshtoon_vert,fragmentShader:Tp.meshtoon_frag},matcap:{uniforms:Yl([Cp.common,Cp.bumpmap,Cp.normalmap,Cp.displacementmap,Cp.fog,{matcap:{value:null}}]),vertexShader:Tp.meshmatcap_vert,fragmentShader:Tp.meshmatcap_frag},points:{uniforms:Yl([Cp.points,Cp.fog]),vertexShader:Tp.points_vert,fragmentShader:Tp.points_frag},dashed:{uniforms:Yl([Cp.common,Cp.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Tp.linedashed_vert,fragmentShader:Tp.linedashed_frag},depth:{uniforms:Yl([Cp.common,Cp.displacementmap]),vertexShader:Tp.depth_vert,fragmentShader:Tp.depth_frag},normal:{uniforms:Yl([Cp.common,Cp.bumpmap,Cp.normalmap,Cp.displacementmap,{opacity:{value:1}}]),vertexShader:Tp.meshnormal_vert,fragmentShader:Tp.meshnormal_frag},sprite:{uniforms:Yl([Cp.sprite,Cp.fog]),vertexShader:Tp.sprite_vert,fragmentShader:Tp.sprite_frag},background:{uniforms:{uvTransform:{value:new xo},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Tp.background_vert,fragmentShader:Tp.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new xo}},vertexShader:Tp.backgroundCube_vert,fragmentShader:Tp.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Tp.cube_vert,fragmentShader:Tp.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Tp.equirect_vert,fragmentShader:Tp.equirect_frag},distanceRGBA:{uniforms:Yl([Cp.common,Cp.displacementmap,{referencePosition:{value:new go},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Tp.distanceRGBA_vert,fragmentShader:Tp.distanceRGBA_frag},shadow:{uniforms:Yl([Cp.lights,Cp.fog,{color:{value:new fl(0)},opacity:{value:1}}]),vertexShader:Tp.shadow_vert,fragmentShader:Tp.shadow_frag}};Ap.physical={uniforms:Yl([Ap.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new xo},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new xo},clearcoatNormalScale:{value:new mo(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new xo},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new xo},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new xo},sheen:{value:0},sheenColor:{value:new fl(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new xo},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new xo},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new xo},transmissionSamplerSize:{value:new mo},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new xo},attenuationDistance:{value:0},attenuationColor:{value:new fl(0)},specularColor:{value:new fl(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new xo},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new xo},anisotropyVector:{value:new mo},anisotropyMap:{value:null},anisotropyMapTransform:{value:new xo}}]),vertexShader:Tp.meshphysical_vert,fragmentShader:Tp.meshphysical_frag};var Pp={r:0,b:0,g:0},kp=new Os,Op=new xs;function Rp(e,t,n,r,i,a,o){var s,l,u=new fl(0),c=!0===a?0:1,h=null,d=0,f=null;function p(e){var r=!0===e.isScene?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function v(t,n){t.getRGB(Pp,Jl(e)),r.buffers.color.setClear(Pp.r,Pp.g,Pp.b,n,o)}return{getClearColor:function(){return u},setClearColor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;u.set(e),v(u,c=t)},getClearAlpha:function(){return c},setClearAlpha:function(e){v(u,c=e)},render:function(t){var n=!1,i=p(t);null===i?v(u,c):i&&i.isColor&&(v(i,1),n=!0);var a=e.xr.getEnvironmentBlendMode();"additive"===a?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===a&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){var r=p(n);r&&(r.isCubeTexture||r.mapping===Fi)?(void 0===l&&((l=new Gl(new Xl(1,1,1),new $l({name:"BackgroundCubeMaterial",uniforms:ql(Ap.backgroundCube.uniforms),vertexShader:Ap.backgroundCube.vertexShader,fragmentShader:Ap.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),kp.copy(n.backgroundRotation),kp.x*=-1,kp.y*=-1,kp.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(kp.y*=-1,kp.z*=-1),l.material.uniforms.envMap.value=r,l.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(Op.makeRotationFromEuler(kp)),l.material.toneMapped=No.getTransfer(r.colorSpace)!==Ka,h===r&&d===r.version&&f===e.toneMapping||(l.material.needsUpdate=!0,h=r,d=r.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):r&&r.isTexture&&(void 0===s&&((s=new Gl(new yd(2,2),new $l({name:"BackgroundMaterial",uniforms:ql(Ap.background.uniforms),vertexShader:Ap.background.vertexShader,fragmentShader:Ap.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(s)),s.material.uniforms.t2D.value=r,s.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,s.material.toneMapped=No.getTransfer(r.colorSpace)!==Ka,!0===r.matrixAutoUpdate&&r.updateMatrix(),s.material.uniforms.uvTransform.value.copy(r.matrix),h===r&&d===r.version&&f===e.toneMapping||(s.material.needsUpdate=!0,h=r,d=r.version,f=e.toneMapping),s.layers.enableAll(),t.unshift(s,s.geometry,s.material,0,0,null))},dispose:function(){void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0),void 0!==s&&(s.geometry.dispose(),s.material.dispose(),s=void 0)}}}function Ip(e,t){var n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=u(null),a=i,o=!1;function s(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function u(e){for(var t=[],r=[],i=[],a=0;a<n;a++)t[a]=0,r[a]=0,i[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function c(){for(var e=a.newAttributes,t=0,n=e.length;t<n;t++)e[t]=0}function h(e){d(e,0)}function d(t,n){var r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,0===i[t]&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function f(){for(var t=a.newAttributes,n=a.enabledAttributes,r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function p(t,n,r,i,a,o,s){!0===s?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function v(){m(),o=!0,a!==i&&s((a=i).object)}function m(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:function(n,i,l,v,m){var y,g=function(t,n,i){var a=!0===i.wireframe,o=r[t.id];void 0===o&&(o={},r[t.id]=o);var s=o[n.id];void 0===s&&(s={},o[n.id]=s);var l=s[a];return void 0===l&&(l=u(e.createVertexArray()),s[a]=l),l}(v,l,i);a!==g&&s((a=g).object),(y=function(e,t,n,r){var i=a.attributes,o=t.attributes,s=0,l=n.getAttributes();for(var u in l)if(l[u].location>=0){var c=i[u],h=o[u];if(void 0===h&&("instanceMatrix"===u&&e.instanceMatrix&&(h=e.instanceMatrix),"instanceColor"===u&&e.instanceColor&&(h=e.instanceColor)),void 0===c)return!0;if(c.attribute!==h)return!0;if(h&&c.data!==h.data)return!0;s++}return a.attributesNum!==s||a.index!==r}(n,v,l,m))&&function(e,t,n,r){var i={},o=t.attributes,s=0,l=n.getAttributes();for(var u in l)if(l[u].location>=0){var c=o[u];void 0===c&&("instanceMatrix"===u&&e.instanceMatrix&&(c=e.instanceMatrix),"instanceColor"===u&&e.instanceColor&&(c=e.instanceColor));var h={};h.attribute=c,c&&c.data&&(h.data=c.data),i[u]=h,s++}a.attributes=i,a.attributesNum=s,a.index=r}(n,v,l,m),null!==m&&t.update(m,e.ELEMENT_ARRAY_BUFFER),(y||o)&&(o=!1,function(n,r,i,a){c();var o=a.attributes,s=i.getAttributes(),l=r.defaultAttributeValues;for(var u in s){var v=s[u];if(v.location>=0){var m=o[u];if(void 0===m&&("instanceMatrix"===u&&n.instanceMatrix&&(m=n.instanceMatrix),"instanceColor"===u&&n.instanceColor&&(m=n.instanceColor)),void 0!==m){var y=m.normalized,g=m.itemSize,_=t.get(m);if(void 0===_)continue;var b=_.buffer,x=_.type,S=_.bytesPerElement,w=x===e.INT||x===e.UNSIGNED_INT||m.gpuType===Ji;if(m.isInterleavedBufferAttribute){var E=m.data,M=E.stride,T=m.offset;if(E.isInstancedInterleavedBuffer){for(var C=0;C<v.locationSize;C++)d(v.location+C,E.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=E.meshPerAttribute*E.count)}else for(var A=0;A<v.locationSize;A++)h(v.location+A);e.bindBuffer(e.ARRAY_BUFFER,b);for(var P=0;P<v.locationSize;P++)p(v.location+P,g/v.locationSize,x,y,M*S,(T+g/v.locationSize*P)*S,w)}else{if(m.isInstancedBufferAttribute){for(var k=0;k<v.locationSize;k++)d(v.location+k,m.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=m.meshPerAttribute*m.count)}else for(var O=0;O<v.locationSize;O++)h(v.location+O);e.bindBuffer(e.ARRAY_BUFFER,b);for(var R=0;R<v.locationSize;R++)p(v.location+R,g/v.locationSize,x,y,g*S,g/v.locationSize*R*S,w)}}else if(void 0!==l){var I=l[u];if(void 0!==I)switch(I.length){case 2:e.vertexAttrib2fv(v.location,I);break;case 3:e.vertexAttrib3fv(v.location,I);break;case 4:e.vertexAttrib4fv(v.location,I);break;default:e.vertexAttrib1fv(v.location,I)}}}}f()}(n,i,l,v),null!==m&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(m).buffer))},reset:v,resetDefaultState:m,dispose:function(){for(var e in v(),r){var t=r[e];for(var n in t){var i=t[n];for(var a in i)l(i[a].object),delete i[a];delete t[n]}delete r[e]}},releaseStatesOfGeometry:function(e){if(void 0!==r[e.id]){var t=r[e.id];for(var n in t){var i=t[n];for(var a in i)l(i[a].object),delete i[a];delete t[n]}delete r[e.id]}},releaseStatesOfProgram:function(e){for(var t in r){var n=r[t];if(void 0!==n[e.id]){var i=n[e.id];for(var a in i)l(i[a].object),delete i[a];delete n[e.id]}}},initAttributes:c,enableAttribute:h,disableUnusedAttributes:f}}function Np(e,t,n){var r;function i(t,i,a){0!==a&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=i,this.renderMultiDraw=function(e,i,a){if(0!==a){t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,e,0,i,0,a);for(var o=0,s=0;s<a;s++)o+=i[s];n.update(o,r,1)}},this.renderMultiDrawInstances=function(e,a,o,s){if(0!==o){var l=t.get("WEBGL_multi_draw");if(null===l)for(var u=0;u<e.length;u++)i(e[u],a[u],s[u]);else{l.multiDrawArraysInstancedWEBGL(r,e,0,a,0,s,0,o);for(var c=0,h=0;h<o;h++)c+=a[h]*s[h];n.update(c,r,1)}}}}function Lp(e,t,n,r){var i;function a(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=void 0!==n.precision?n.precision:"highp",s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=!0===n.logarithmicDepthBuffer,u=!0===n.reversedDepthBuffer&&t.has("EXT_clip_control"),c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){var n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:a,textureFormatReadable:function(t){return t===na||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){var i=n===$i&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(n!==qi&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==Ki&&!i)},precision:o,logarithmicDepthBuffer:l,reversedDepthBuffer:u,maxTextures:c,maxVertexTextures:h,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:h>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function Dp(e){var t=this,n=null,r=0,i=!1,a=!1,o=new lc,s=new xo,l={value:null,needsUpdate:!1};function u(e,n,r,i){var a=null!==e?e.length:0,u=null;if(0!==a){if(u=l.value,!0!==i||null===u){var c=r+4*a,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===u||u.length<c)&&(u=new Float32Array(c));for(var d=0,f=r;d!==a;++d,f+=4)o.copy(e[d]).applyMatrix4(h,s),o.normal.toArray(u,f),u[f+3]=o.constant}l.value=u,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,u}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){var n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(o,s,c){var h=o.clippingPlanes,d=o.clipIntersection,f=o.clipShadows,p=e.get(o);if(!i||null===h||0===h.length||a&&!f)a?u(null):(l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0);else{var v=a?0:r,m=4*v,y=p.clippingState||null;l.value=y,y=u(h,s,m,c);for(var g=0;g!==m;++g)y[g]=n[g];p.clippingState=y,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=v}}}function Up(e){var t=new WeakMap;function n(e,t){return t===Di?e.mapping=Ni:t===Ui&&(e.mapping=Li),e}function r(e){var n=e.target;n.removeEventListener("dispose",r);var i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){var a=i.mapping;if(a===Di||a===Ui){if(t.has(i))return n(t.get(i).texture,i.mapping);var o=i.image;if(o&&o.height>0){var s=new su(o.height);return s.fromEquirectangularTexture(e,i),t.set(i,s),i.addEventListener("dispose",r),n(s.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}var Fp=[.125,.215,.35,.446,.526,.582],Bp=20,zp=new Cf,jp=new fl,Hp=null,Vp=0,Gp=0,Wp=!1,Xp=(1+Math.sqrt(5))/2,qp=1/Xp,Yp=[new go(-Xp,qp,0),new go(Xp,qp,0),new go(-qp,0,Xp),new go(qp,0,Xp),new go(0,Xp,-qp),new go(0,Xp,qp),new go(-1,1,-1),new go(1,1,-1),new go(-1,1,1),new go(1,1,1)],Jp=new go,Zp=function(){return Sp((function e(t){bp(this,e),this._renderer=t,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)}),[{key:"fromScene",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=i.size,o=void 0===a?256:a,s=i.position,l=void 0===s?Jp:s;Hp=this._renderer.getRenderTarget(),Vp=this._renderer.getActiveCubeFace(),Gp=this._renderer.getActiveMipmapLevel(),Wp=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);var u=this._allocateTargets();return u.depthBuffer=!0,this._sceneToCubeUV(e,n,r,u,l),t>0&&this._blur(u,0,0,t),this._applyPMREM(u),this._cleanup(u),u}},{key:"fromEquirectangular",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}},{key:"fromCubemap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}},{key:"compileCubemapShader",value:function(){null===this._cubemapMaterial&&(this._cubemapMaterial=ev(),this._compileMaterial(this._cubemapMaterial))}},{key:"compileEquirectangularShader",value:function(){null===this._equirectMaterial&&(this._equirectMaterial=Qp(),this._compileMaterial(this._equirectMaterial))}},{key:"dispose",value:function(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}},{key:"_setSize",value:function(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}},{key:"_dispose",value:function(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(var e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}},{key:"_cleanup",value:function(e){this._renderer.setRenderTarget(Hp,Vp,Gp),this._renderer.xr.enabled=Wp,e.scissorTest=!1,$p(e,0,0,e.width,e.height)}},{key:"_fromTexture",value:function(e,t){e.mapping===Ni||e.mapping===Li?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Hp=this._renderer.getRenderTarget(),Vp=this._renderer.getActiveCubeFace(),Gp=this._renderer.getActiveMipmapLevel(),Wp=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;var n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}},{key:"_allocateTargets",value:function(){var e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Gi,minFilter:Gi,generateMipmaps:!1,type:$i,format:na,colorSpace:Ja,depthBuffer:!1},r=Kp(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Kp(e,t,n);var i=this._lodMax,a=function(e){for(var t=[],n=[],r=[],i=e,a=e-4+1+Fp.length,o=0;o<a;o++){var s=Math.pow(2,i);n.push(s);var l=1/s;o>e-4?l=Fp[o-e+4-1]:0===o&&(l=0),r.push(l);for(var u=1/(s-2),c=-u,h=1+u,d=[c,c,h,c,h,h,c,c,h,h,c,h],f=new Float32Array(108),p=new Float32Array(72),v=new Float32Array(36),m=0;m<6;m++){var y=m%3*2/3-1,g=m>2?0:-1,_=[y,g,0,y+2/3,g,0,y+2/3,g+1,0,y,g,0,y+2/3,g+1,0,y,g+1,0];f.set(_,18*m),p.set(d,12*m);var b=[m,m,m,m,m,m];v.set(b,6*m)}var x=new Rl;x.setAttribute("position",new xl(f,3)),x.setAttribute("uv",new xl(p,2)),x.setAttribute("faceIndex",new xl(v,1)),t.push(x),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(i);this._sizeLods=a.sizeLods,this._lodPlanes=a.lodPlanes,this._sigmas=a.sigmas,this._blurMaterial=function(e,t,n){var r=new Float32Array(Bp),i=new go(0,1,0);return new $l({name:"SphericalGaussianBlur",defines:{n:Bp,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:"".concat(e,".0")},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(i,e,t)}return r}},{key:"_compileMaterial",value:function(e){var t=new Gl(this._lodPlanes[0],e);this._renderer.compile(t,zp)}},{key:"_sceneToCubeUV",value:function(e,t,n,r,i){var a=new ru(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.toneMapping;l.getClearColor(jp),l.toneMapping=0,l.autoClear=!1,l.state.buffers.depth.getReversed()&&(l.setRenderTarget(r),l.clearDepth(),l.setRenderTarget(null));var h=new yl({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),d=new Gl(new Xl,h),f=!1,p=e.background;p?p.isColor&&(h.color.copy(p),e.background=null,f=!0):(h.color.copy(jp),f=!0);for(var v=0;v<6;v++){var m=v%3;0===m?(a.up.set(0,o[v],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+s[v],i.y,i.z)):1===m?(a.up.set(0,0,o[v]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+s[v],i.z)):(a.up.set(0,o[v],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+s[v]));var y=this._cubeSize;$p(r,m*y,v>2?y:0,y,y),l.setRenderTarget(r),f&&l.render(d,a),l.render(e,a)}d.geometry.dispose(),d.material.dispose(),l.toneMapping=c,l.autoClear=u,e.background=p}},{key:"_textureToCubeUV",value:function(e,t){var n=this._renderer,r=e.mapping===Ni||e.mapping===Li;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=ev()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Qp());var i=r?this._cubemapMaterial:this._equirectMaterial,a=new Gl(this._lodPlanes[0],i);i.uniforms.envMap.value=e;var o=this._cubeSize;$p(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(a,zp)}},{key:"_applyPMREM",value:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=this._lodPlanes.length,i=1;i<r;i++){var a=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=Yp[(r-i-1)%Yp.length];this._blur(e,i-1,i,a,o)}t.autoClear=n}},{key:"_blur",value:function(e,t,n,r,i){var a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",i),this._halfBlur(a,e,n,n,r,"longitudinal",i)}},{key:"_halfBlur",value:function(e,t,n,r,i,a,o){var s=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var u=new Gl(this._lodPlanes[r],l),c=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,f=i/d,p=isFinite(i)?1+Math.floor(3*f):Bp;p>Bp&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(p," samples when the maximum is set to ").concat(Bp));for(var v=[],m=0,y=0;y<Bp;++y){var g=y/f,_=Math.exp(-g*g/2);v.push(_),0===y?m+=_:y<p&&(m+=2*_)}for(var b=0;b<v.length;b++)v[b]=v[b]/m;c.envMap.value=e.texture,c.samples.value=p,c.weights.value=v,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o);var x=this._lodMax;c.dTheta.value=d,c.mipInt.value=x-n;var S=this._sizeLods[r];$p(t,3*S*(r>x-4?r-x+4:0),4*(this._cubeSize-S),3*S,2*S),s.setRenderTarget(t),s.render(u,zp)}}])}();function Kp(e,t,n){var r=new Wo(e,t,n);return r.texture.mapping=Fi,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function $p(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Qp(){return new $l({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function ev(){return new $l({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function tv(e){var t=new WeakMap,n=null;function r(e){var n=e.target;n.removeEventListener("dispose",r);var i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){var a=i.mapping,o=a===Di||a===Ui,s=a===Ni||a===Li;if(o||s){var l=t.get(i),u=void 0!==l?l.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==u)return null===n&&(n=new Zp(e)),(l=o?n.fromEquirectangular(i,l):n.fromCubemap(i,l)).texture.pmremVersion=i.pmremVersion,t.set(i,l),l.texture;if(void 0!==l)return l.texture;var c=i.image;return o&&c&&c.height>0||s&&c&&function(e){for(var t=0,n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(c)?(null===n&&(n=new Zp(e)),(l=o?n.fromEquirectangular(i):n.fromCubemap(i)).texture.pmremVersion=i.pmremVersion,t.set(i,l),i.addEventListener("dispose",r),l.texture):null}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function nv(e){var t={};function n(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){var t=n(e);return null===t&&Ao("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function rv(e,t,n,r){var i={},a=new WeakMap;function o(e){var s=e.target;for(var l in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[l]);s.removeEventListener("dispose",o),delete i[s.id];var u=a.get(s);u&&(t.remove(u),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){var n=[],r=e.index,i=e.attributes.position,o=0;if(null!==r){var s=r.array;o=r.version;for(var l=0,u=s.length;l<u;l+=3){var c=s[l+0],h=s[l+1],d=s[l+2];n.push(c,h,h,d,d,c)}}else{if(void 0===i)return;var f=i.array;o=i.version;for(var p=0,v=f.length/3-1;p<v;p+=3){var m=p+0,y=p+1,g=p+2;n.push(m,y,y,g,g,m)}}var _=new(wo(n)?wl:Sl)(n,1);_.version=o;var b=a.get(e);b&&t.remove(b),a.set(e,_)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(n){var r=n.attributes;for(var i in r)t.update(r[i],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){var t=a.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return a.get(e)}}}function iv(e,t,n){var r,i,a;function o(t,o,s){0!==s&&(e.drawElementsInstanced(r,o,i,t*a,s),n.update(o,r,s))}this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(r,o,i,t*a),n.update(o,r,1)},this.renderInstances=o,this.renderMultiDraw=function(e,a,o){if(0!==o){t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,a,0,i,e,0,o);for(var s=0,l=0;l<o;l++)s+=a[l];n.update(s,r,1)}},this.renderMultiDrawInstances=function(e,s,l,u){if(0!==l){var c=t.get("WEBGL_multi_draw");if(null===c)for(var h=0;h<e.length;h++)o(e[h]/a,s[h],u[h]);else{c.multiDrawElementsInstancedWEBGL(r,s,0,i,e,0,u,0,l);for(var d=0,f=0;f<l;f++)d+=s[f]*u[f];n.update(d,r,1)}}}}function av(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=i*(n/3);break;case e.LINES:t.lines+=i*(n/2);break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function ov(e,t,n){var r=new WeakMap,i=new Go;return{update:function(a,o,s){var l=a.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,c=void 0!==u?u.length:0,h=r.get(o);if(void 0===h||h.count!==c){var d=function(){w.dispose(),r.delete(o),o.removeEventListener("dispose",d)};void 0!==h&&h.texture.dispose();var f=void 0!==o.morphAttributes.position,p=void 0!==o.morphAttributes.normal,v=void 0!==o.morphAttributes.color,m=o.morphAttributes.position||[],y=o.morphAttributes.normal||[],g=o.morphAttributes.color||[],_=0;!0===f&&(_=1),!0===p&&(_=2),!0===v&&(_=3);var b=o.attributes.position.count*_,x=1;b>t.maxTextureSize&&(x=Math.ceil(b/t.maxTextureSize),b=t.maxTextureSize);var S=new Float32Array(b*x*4*c),w=new Xo(S,b,x,c);w.type=Ki,w.needsUpdate=!0;for(var E=4*_,M=0;M<c;M++)for(var T=m[M],C=y[M],A=g[M],P=b*x*4*M,k=0;k<T.count;k++){var O=k*E;!0===f&&(i.fromBufferAttribute(T,k),S[P+O+0]=i.x,S[P+O+1]=i.y,S[P+O+2]=i.z,S[P+O+3]=0),!0===p&&(i.fromBufferAttribute(C,k),S[P+O+4]=i.x,S[P+O+5]=i.y,S[P+O+6]=i.z,S[P+O+7]=0),!0===v&&(i.fromBufferAttribute(A,k),S[P+O+8]=i.x,S[P+O+9]=i.y,S[P+O+10]=i.z,S[P+O+11]=4===A.itemSize?i.w:1)}h={count:c,texture:w,size:new mo(b,x)},r.set(o,h),o.addEventListener("dispose",d)}if(!0===a.isInstancedMesh&&null!==a.morphTexture)s.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{for(var R=0,I=0;I<l.length;I++)R+=l[I];var N=o.morphTargetsRelative?1:1-R;s.getUniforms().setValue(e,"morphTargetBaseInfluence",N),s.getUniforms().setValue(e,"morphTargetInfluences",l)}s.getUniforms().setValue(e,"morphTargetsTexture",h.texture,n),s.getUniforms().setValue(e,"morphTargetsTextureSize",h.size)}}}function sv(e,t,n,r){var i=new WeakMap;function a(e){var t=e.target;t.removeEventListener("dispose",a),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(o){var s=r.render.frame,l=o.geometry,u=t.get(o,l);if(i.get(u)!==s&&(t.update(u),i.set(u,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),i.get(o)!==s&&(n.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,e.ARRAY_BUFFER),i.set(o,s))),o.isSkinnedMesh){var c=o.skeleton;i.get(c)!==s&&(c.update(),i.set(c,s))}return u},dispose:function(){i=new WeakMap}}}var lv=new Vo,uv=new nh(1,1),cv=new Xo,hv=new qo,dv=new ou,fv=[],pv=[],vv=new Float32Array(16),mv=new Float32Array(9),yv=new Float32Array(4);function gv(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=fv[i];if(void 0===a&&(a=new Float32Array(i),fv[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function _v(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function bv(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function xv(e,t){var n=pv[t];void 0===n&&(n=new Int32Array(t),pv[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Sv(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function wv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(_v(n,t))return;e.uniform2fv(this.addr,t),bv(n,t)}}function Ev(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(_v(n,t))return;e.uniform3fv(this.addr,t),bv(n,t)}}function Mv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(_v(n,t))return;e.uniform4fv(this.addr,t),bv(n,t)}}function Tv(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(_v(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),bv(n,t)}else{if(_v(n,r))return;yv.set(r),e.uniformMatrix2fv(this.addr,!1,yv),bv(n,r)}}function Cv(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(_v(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),bv(n,t)}else{if(_v(n,r))return;mv.set(r),e.uniformMatrix3fv(this.addr,!1,mv),bv(n,r)}}function Av(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(_v(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),bv(n,t)}else{if(_v(n,r))return;vv.set(r),e.uniformMatrix4fv(this.addr,!1,vv),bv(n,r)}}function Pv(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function kv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(_v(n,t))return;e.uniform2iv(this.addr,t),bv(n,t)}}function Ov(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(_v(n,t))return;e.uniform3iv(this.addr,t),bv(n,t)}}function Rv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(_v(n,t))return;e.uniform4iv(this.addr,t),bv(n,t)}}function Iv(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Nv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(_v(n,t))return;e.uniform2uiv(this.addr,t),bv(n,t)}}function Lv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(_v(n,t))return;e.uniform3uiv(this.addr,t),bv(n,t)}}function Dv(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(_v(n,t))return;e.uniform4uiv(this.addr,t),bv(n,t)}}function Uv(e,t,n){var r,i=this.cache,a=n.allocateTextureUnit();i[0]!==a&&(e.uniform1i(this.addr,a),i[0]=a),this.type===e.SAMPLER_2D_SHADOW?(uv.compareFunction=515,r=uv):r=lv,n.setTexture2D(t||r,a)}function Fv(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||hv,i)}function Bv(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||dv,i)}function zv(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||cv,i)}function jv(e,t){e.uniform1fv(this.addr,t)}function Hv(e,t){var n=gv(t,this.size,2);e.uniform2fv(this.addr,n)}function Vv(e,t){var n=gv(t,this.size,3);e.uniform3fv(this.addr,n)}function Gv(e,t){var n=gv(t,this.size,4);e.uniform4fv(this.addr,n)}function Wv(e,t){var n=gv(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Xv(e,t){var n=gv(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function qv(e,t){var n=gv(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Yv(e,t){e.uniform1iv(this.addr,t)}function Jv(e,t){e.uniform2iv(this.addr,t)}function Zv(e,t){e.uniform3iv(this.addr,t)}function Kv(e,t){e.uniform4iv(this.addr,t)}function $v(e,t){e.uniform1uiv(this.addr,t)}function Qv(e,t){e.uniform2uiv(this.addr,t)}function em(e,t){e.uniform3uiv(this.addr,t)}function tm(e,t){e.uniform4uiv(this.addr,t)}function nm(e,t,n){var r=this.cache,i=t.length,a=xv(n,i);_v(r,a)||(e.uniform1iv(this.addr,a),bv(r,a));for(var o=0;o!==i;++o)n.setTexture2D(t[o]||lv,a[o])}function rm(e,t,n){var r=this.cache,i=t.length,a=xv(n,i);_v(r,a)||(e.uniform1iv(this.addr,a),bv(r,a));for(var o=0;o!==i;++o)n.setTexture3D(t[o]||hv,a[o])}function im(e,t,n){var r=this.cache,i=t.length,a=xv(n,i);_v(r,a)||(e.uniform1iv(this.addr,a),bv(r,a));for(var o=0;o!==i;++o)n.setTextureCube(t[o]||dv,a[o])}function am(e,t,n){var r=this.cache,i=t.length,a=xv(n,i);_v(r,a)||(e.uniform1iv(this.addr,a),bv(r,a));for(var o=0;o!==i;++o)n.setTexture2DArray(t[o]||cv,a[o])}var om=Sp((function e(t,n,r){bp(this,e),this.id=t,this.addr=r,this.cache=[],this.type=n.type,this.setValue=function(e){switch(e){case 5126:return Sv;case 35664:return wv;case 35665:return Ev;case 35666:return Mv;case 35674:return Tv;case 35675:return Cv;case 35676:return Av;case 5124:case 35670:return Pv;case 35667:case 35671:return kv;case 35668:case 35672:return Ov;case 35669:case 35673:return Rv;case 5125:return Iv;case 36294:return Nv;case 36295:return Lv;case 36296:return Dv;case 35678:case 36198:case 36298:case 36306:case 35682:return Uv;case 35679:case 36299:case 36307:return Fv;case 35680:case 36300:case 36308:case 36293:return Bv;case 36289:case 36303:case 36311:case 36292:return zv}}(n.type)})),sm=Sp((function e(t,n,r){bp(this,e),this.id=t,this.addr=r,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=function(e){switch(e){case 5126:return jv;case 35664:return Hv;case 35665:return Vv;case 35666:return Gv;case 35674:return Wv;case 35675:return Xv;case 35676:return qv;case 5124:case 35670:return Yv;case 35667:case 35671:return Jv;case 35668:case 35672:return Zv;case 35669:case 35673:return Kv;case 5125:return $v;case 36294:return Qv;case 36295:return em;case 36296:return tm;case 35678:case 36198:case 36298:case 36306:case 35682:return nm;case 35679:case 36299:case 36307:return rm;case 35680:case 36300:case 36308:case 36293:return im;case 36289:case 36303:case 36311:case 36292:return am}}(n.type)})),lm=function(){return Sp((function e(t){bp(this,e),this.id=t,this.seq=[],this.map={}}),[{key:"setValue",value:function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}}}])}(),um=/(\w+)(\])?(\[|\.)?/g;function cm(e,t){e.seq.push(t),e.map[t.id]=t}function hm(e,t,n){var r=e.name,i=r.length;for(um.lastIndex=0;;){var a=um.exec(r),o=um.lastIndex,s=a[1],l="]"===a[2],u=a[3];if(l&&(s|=0),void 0===u||"["===u&&o+2===i){cm(n,void 0===u?new om(s,e,t):new sm(s,e,t));break}var c=n.map[s];void 0===c&&cm(n,c=new lm(s)),n=c}}var dm=function(){return Sp((function e(t,n){bp(this,e),this.seq=[],this.map={};for(var r=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),i=0;i<r;++i){var a=t.getActiveUniform(n,i);hm(a,t.getUniformLocation(n,a.name),this)}}),[{key:"setValue",value:function(e,t,n,r){var i=this.map[t];void 0!==i&&i.setValue(e,n,r)}},{key:"setOptional",value:function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)}}],[{key:"upload",value:function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}}},{key:"seqWithValue",value:function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n}}])}();function fm(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var pm=0,vm=new xo;function mm(e,t,n){var r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||"").trim();if(r&&""===i)return"";var a=/ERROR: 0:(\d+)/.exec(i);if(a){var o=parseInt(a[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){for(var n=e.split("\n"),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length),o=i;o<a;o++){var s=o+1;r.push("".concat(s===t?">":" "," ").concat(s,": ").concat(n[o]))}return r.join("\n")}(e.getShaderSource(t),o)}return i}function ym(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Cineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}var gm=new go;function _m(){No.getLuminanceCoefficients(gm);var e=gm.x.toFixed(4),t=gm.y.toFixed(4),n=gm.z.toFixed(4);return["float luminance( const in vec3 rgb ) {","\tconst vec3 weights = vec3( ".concat(e,", ").concat(t,", ").concat(n," );"),"\treturn dot( weights, rgb );","}"].join("\n")}function bm(e){return""!==e}function xm(e,t){var n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Sm(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var wm=/^[ \t]*#include +<([\w\d./]+)>/gm;function Em(e){return e.replace(wm,Tm)}var Mm=new Map;function Tm(e,t){var n=Tp[t];if(void 0===n){var r=Mm.get(t);if(void 0===r)throw new Error("Can not resolve #include <"+t+">");n=Tp[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,r)}return Em(n)}var Cm=/#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 Am(e){return e.replace(Cm,Pm)}function Pm(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function km(e){var t="precision ".concat(e.precision," float;\n\tprecision ").concat(e.precision," int;\n\tprecision ").concat(e.precision," sampler2D;\n\tprecision ").concat(e.precision," samplerCube;\n\tprecision ").concat(e.precision," sampler3D;\n\tprecision ").concat(e.precision," sampler2DArray;\n\tprecision ").concat(e.precision," sampler2DShadow;\n\tprecision ").concat(e.precision," samplerCubeShadow;\n\tprecision ").concat(e.precision," sampler2DArrayShadow;\n\tprecision ").concat(e.precision," isampler2D;\n\tprecision ").concat(e.precision," isampler3D;\n\tprecision ").concat(e.precision," isamplerCube;\n\tprecision ").concat(e.precision," isampler2DArray;\n\tprecision ").concat(e.precision," usampler2D;\n\tprecision ").concat(e.precision," usampler3D;\n\tprecision ").concat(e.precision," usamplerCube;\n\tprecision ").concat(e.precision," usampler2DArray;\n\t");return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Om(e,t,n,r){var i,a,o,s,l,u=e.getContext(),c=n.defines,h=n.vertexShader,d=n.fragmentShader,f=function(e){var t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),p=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case Ni:case Li:t="ENVMAP_TYPE_CUBE";break;case Fi:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),v=function(e){var t="ENVMAP_MODE_REFLECTION";return e.envMap&&e.envMapMode===Li&&(t="ENVMAP_MODE_REFRACTION"),t}(n),m=function(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),y=function(e){var t=e.envMapCubeUVHeight;if(null===t)return null;var n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),g=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(bm).join("\n")}(n),_=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(c),b=u.createProgram(),x=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,_].filter(bm).join("\n")).length>0&&(i+="\n"),(a=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,_].filter(bm).join("\n")).length>0&&(a+="\n")):(i=[km(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,_,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+v:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+f:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(bm).join("\n"),a=[km(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,_,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.envMap?"#define "+v:"",n.envMap?"#define "+m:"",y?"#define CUBEUV_TEXEL_WIDTH "+y.texelWidth:"",y?"#define CUBEUV_TEXEL_HEIGHT "+y.texelHeight:"",y?"#define CUBEUV_MAX_MIP "+y.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+f:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Tp.tonemapping_pars_fragment:"",0!==n.toneMapping?ym("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Tp.colorspace_pars_fragment,(o="linearToOutputTexel",s=n.outputColorSpace,l=function(e){No._getMatrix(vm,No.workingColorSpace,e);var t="mat3( ".concat(vm.elements.map((function(e){return e.toFixed(4)}))," )");switch(No.getTransfer(e)){case Za:return[t,"LinearTransferOETF"];case Ka:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(s),["vec4 ".concat(o,"( vec4 value ) {"),"\treturn ".concat(l[1],"( vec4( value.rgb * ").concat(l[0],", value.a ) );"),"}"].join("\n")),_m(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(bm).join("\n")),h=Sm(h=xm(h=Em(h),n),n),d=Sm(d=xm(d=Em(d),n),n),h=Am(h),d=Am(d),!0!==n.isRawShaderMaterial&&(x="#version 300 es\n",i=[g,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,a=["#define varying in",n.glslVersion===eo?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===eo?"":"#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("\n")+"\n"+a);var S,w,E=x+i+h,M=x+a+d,T=fm(u,u.VERTEX_SHADER,E),C=fm(u,u.FRAGMENT_SHADER,M);function A(t){if(e.debug.checkShaderErrors){var n=u.getProgramInfoLog(b)||"",r=u.getShaderInfoLog(T)||"",o=u.getShaderInfoLog(C)||"",s=n.trim(),l=r.trim(),c=o.trim(),h=!0,d=!0;if(!1===u.getProgramParameter(b,u.LINK_STATUS))if(h=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(u,b,T,C);else{var f=mm(u,T,"vertex"),p=mm(u,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+u.getError()+" - VALIDATE_STATUS "+u.getProgramParameter(b,u.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+s+"\n"+f+"\n"+p)}else""!==s?console.warn("THREE.WebGLProgram: Program Info Log:",s):""!==l&&""!==c||(d=!1);d&&(t.diagnostics={runnable:h,programLog:s,vertexShader:{log:l,prefix:i},fragmentShader:{log:c,prefix:a}})}u.deleteShader(T),u.deleteShader(C),S=new dm(u,b),w=function(e,t){for(var n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<r;i++){var a=e.getActiveAttrib(t,i),o=a.name,s=1;a.type===e.FLOAT_MAT2&&(s=2),a.type===e.FLOAT_MAT3&&(s=3),a.type===e.FLOAT_MAT4&&(s=4),n[o]={type:a.type,location:e.getAttribLocation(t,o),locationSize:s}}return n}(u,b)}u.attachShader(b,T),u.attachShader(b,C),void 0!==n.index0AttributeName?u.bindAttribLocation(b,0,n.index0AttributeName):!0===n.morphTargets&&u.bindAttribLocation(b,0,"position"),u.linkProgram(b),this.getUniforms=function(){return void 0===S&&A(this),S},this.getAttributes=function(){return void 0===w&&A(this),w};var P=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===P&&(P=u.getProgramParameter(b,37297)),P},this.destroy=function(){r.releaseStatesOfProgram(this),u.deleteProgram(b),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=pm++,this.cacheKey=t,this.usedTimes=1,this.program=b,this.vertexShader=T,this.fragmentShader=C,this}var Rm=0,Im=function(){return Sp((function e(){bp(this,e),this.shaderCache=new Map,this.materialCache=new Map}),[{key:"update",value:function(e){var t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}},{key:"remove",value:function(e){var t,n=yp(this.materialCache.get(e));try{for(n.s();!(t=n.n()).done;){var r=t.value;r.usedTimes--,0===r.usedTimes&&this.shaderCache.delete(r.code)}}catch(e){n.e(e)}finally{n.f()}return this.materialCache.delete(e),this}},{key:"getVertexShaderID",value:function(e){return this._getShaderStage(e.vertexShader).id}},{key:"getFragmentShaderID",value:function(e){return this._getShaderStage(e.fragmentShader).id}},{key:"dispose",value:function(){this.shaderCache.clear(),this.materialCache.clear()}},{key:"_getShaderCacheForMaterial",value:function(e){var t=this.materialCache,n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}},{key:"_getShaderStage",value:function(e){var t=this.shaderCache,n=t.get(e);return void 0===n&&(n=new Nm(e),t.set(e,n)),n}}])}(),Nm=Sp((function e(t){bp(this,e),this.id=Rm++,this.code=t,this.usedTimes=0}));function Lm(e,t,n,r,i,a,o){var s=new Rs,l=new Im,u=new Set,c=[],h=i.logarithmicDepthBuffer,d=i.vertexTextures,f=i.precision,p={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 v(e){return u.add(e),0===e?"uv":"uv".concat(e)}return{getParameters:function(a,s,c,m,y){var g=m.fog,_=y.geometry,b=a.isMeshStandardMaterial?m.environment:null,x=(a.isMeshStandardMaterial?n:t).get(a.envMap||b),S=x&&x.mapping===Fi?x.image.height:null,w=p[a.type];null!==a.precision&&(f=i.getMaxPrecision(a.precision))!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",f,"instead.");var E,M,T,C,A=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,P=void 0!==A?A.length:0,k=0;if(void 0!==_.morphAttributes.position&&(k=1),void 0!==_.morphAttributes.normal&&(k=2),void 0!==_.morphAttributes.color&&(k=3),w){var O=Ap[w];E=O.vertexShader,M=O.fragmentShader}else E=a.vertexShader,M=a.fragmentShader,l.update(a),T=l.getVertexShaderID(a),C=l.getFragmentShaderID(a);var R=e.getRenderTarget(),I=e.state.buffers.depth.getReversed(),N=!0===y.isInstancedMesh,L=!0===y.isBatchedMesh,D=!!a.map,U=!!a.matcap,F=!!x,B=!!a.aoMap,z=!!a.lightMap,j=!!a.bumpMap,H=!!a.normalMap,V=!!a.displacementMap,G=!!a.emissiveMap,W=!!a.metalnessMap,X=!!a.roughnessMap,q=a.anisotropy>0,Y=a.clearcoat>0,J=a.dispersion>0,Z=a.iridescence>0,K=a.sheen>0,$=a.transmission>0,Q=q&&!!a.anisotropyMap,ee=Y&&!!a.clearcoatMap,te=Y&&!!a.clearcoatNormalMap,ne=Y&&!!a.clearcoatRoughnessMap,re=Z&&!!a.iridescenceMap,ie=Z&&!!a.iridescenceThicknessMap,ae=K&&!!a.sheenColorMap,oe=K&&!!a.sheenRoughnessMap,se=!!a.specularMap,le=!!a.specularColorMap,ue=!!a.specularIntensityMap,ce=$&&!!a.transmissionMap,he=$&&!!a.thicknessMap,de=!!a.gradientMap,fe=!!a.alphaMap,pe=a.alphaTest>0,ve=!!a.alphaHash,me=!!a.extensions,ye=0;a.toneMapped&&(null!==R&&!0!==R.isXRRenderTarget||(ye=e.toneMapping));var ge={shaderID:w,shaderType:a.type,shaderName:a.name,vertexShader:E,fragmentShader:M,defines:a.defines,customVertexShaderID:T,customFragmentShaderID:C,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:f,batching:L,batchingColor:L&&null!==y._colorsTexture,instancing:N,instancingColor:N&&null!==y.instanceColor,instancingMorph:N&&null!==y.morphTexture,supportsVertexTextures:d,outputColorSpace:null===R?e.outputColorSpace:!0===R.isXRRenderTarget?R.texture.colorSpace:Ja,alphaToCoverage:!!a.alphaToCoverage,map:D,matcap:U,envMap:F,envMapMode:F&&x.mapping,envMapCubeUVHeight:S,aoMap:B,lightMap:z,bumpMap:j,normalMap:H,displacementMap:d&&V,emissiveMap:G,normalMapObjectSpace:H&&1===a.normalMapType,normalMapTangentSpace:H&&0===a.normalMapType,metalnessMap:W,roughnessMap:X,anisotropy:q,anisotropyMap:Q,clearcoat:Y,clearcoatMap:ee,clearcoatNormalMap:te,clearcoatRoughnessMap:ne,dispersion:J,iridescence:Z,iridescenceMap:re,iridescenceThicknessMap:ie,sheen:K,sheenColorMap:ae,sheenRoughnessMap:oe,specularMap:se,specularColorMap:le,specularIntensityMap:ue,transmission:$,transmissionMap:ce,thicknessMap:he,gradientMap:de,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:fe,alphaTest:pe,alphaHash:ve,combine:a.combine,mapUv:D&&v(a.map.channel),aoMapUv:B&&v(a.aoMap.channel),lightMapUv:z&&v(a.lightMap.channel),bumpMapUv:j&&v(a.bumpMap.channel),normalMapUv:H&&v(a.normalMap.channel),displacementMapUv:V&&v(a.displacementMap.channel),emissiveMapUv:G&&v(a.emissiveMap.channel),metalnessMapUv:W&&v(a.metalnessMap.channel),roughnessMapUv:X&&v(a.roughnessMap.channel),anisotropyMapUv:Q&&v(a.anisotropyMap.channel),clearcoatMapUv:ee&&v(a.clearcoatMap.channel),clearcoatNormalMapUv:te&&v(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ne&&v(a.clearcoatRoughnessMap.channel),iridescenceMapUv:re&&v(a.iridescenceMap.channel),iridescenceThicknessMapUv:ie&&v(a.iridescenceThicknessMap.channel),sheenColorMapUv:ae&&v(a.sheenColorMap.channel),sheenRoughnessMapUv:oe&&v(a.sheenRoughnessMap.channel),specularMapUv:se&&v(a.specularMap.channel),specularColorMapUv:le&&v(a.specularColorMap.channel),specularIntensityMapUv:ue&&v(a.specularIntensityMap.channel),transmissionMapUv:ce&&v(a.transmissionMap.channel),thicknessMapUv:he&&v(a.thicknessMap.channel),alphaMapUv:fe&&v(a.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(H||q),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,pointsUvs:!0===y.isPoints&&!!_.attributes.uv&&(D||fe),fog:!!g,useFog:!0===a.fog,fogExp2:!!g&&g.isFogExp2,flatShading:!0===a.flatShading&&!1===a.wireframe,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,reversedDepthBuffer:I,skinning:!0===y.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:P,morphTextureStride:k,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:ye,decodeVideoTexture:D&&!0===a.map.isVideoTexture&&No.getTransfer(a.map.colorSpace)===Ka,decodeVideoTextureEmissive:G&&!0===a.emissiveMap.isVideoTexture&&No.getTransfer(a.emissiveMap.colorSpace)===Ka,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:1===a.side,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:me&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(me&&!0===a.extensions.multiDraw||L)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ge.vertexUv1s=u.has(1),ge.vertexUv2s=u.has(2),ge.vertexUv3s=u.has(3),u.clear(),ge},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);return!1===t.isRawShaderMaterial&&(function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){s.disableAll(),t.supportsVertexTextures&&s.enable(0),t.instancing&&s.enable(1),t.instancingColor&&s.enable(2),t.instancingMorph&&s.enable(3),t.matcap&&s.enable(4),t.envMap&&s.enable(5),t.normalMapObjectSpace&&s.enable(6),t.normalMapTangentSpace&&s.enable(7),t.clearcoat&&s.enable(8),t.iridescence&&s.enable(9),t.alphaTest&&s.enable(10),t.vertexColors&&s.enable(11),t.vertexAlphas&&s.enable(12),t.vertexUv1s&&s.enable(13),t.vertexUv2s&&s.enable(14),t.vertexUv3s&&s.enable(15),t.vertexTangents&&s.enable(16),t.anisotropy&&s.enable(17),t.alphaHash&&s.enable(18),t.batching&&s.enable(19),t.dispersion&&s.enable(20),t.batchingColor&&s.enable(21),t.gradientMap&&s.enable(22),e.push(s.mask),s.disableAll(),t.fog&&s.enable(0),t.useFog&&s.enable(1),t.flatShading&&s.enable(2),t.logarithmicDepthBuffer&&s.enable(3),t.reversedDepthBuffer&&s.enable(4),t.skinning&&s.enable(5),t.morphTargets&&s.enable(6),t.morphNormals&&s.enable(7),t.morphColors&&s.enable(8),t.premultipliedAlpha&&s.enable(9),t.shadowMapEnabled&&s.enable(10),t.doubleSided&&s.enable(11),t.flipSided&&s.enable(12),t.useDepthPacking&&s.enable(13),t.dithering&&s.enable(14),t.transmission&&s.enable(15),t.sheen&&s.enable(16),t.opaque&&s.enable(17),t.pointsUvs&&s.enable(18),t.decodeVideoTexture&&s.enable(19),t.decodeVideoTextureEmissive&&s.enable(20),t.alphaToCoverage&&s.enable(21),e.push(s.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){var t,n=p[e.type];if(n){var r=Ap[n];t=Kl.clone(r.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){for(var r,i=0,o=c.length;i<o;i++){var s=c[i];if(s.cacheKey===n){++(r=s).usedTimes;break}}return void 0===r&&(r=new Om(e,n,t,a),c.push(r)),r},releaseProgram:function(e){if(0===--e.usedTimes){var t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function Dm(){var e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function Um(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Fm(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Bm(){var e=[],t=0,n=[],r=[],i=[];function a(n,r,i,a,o,s){var l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=o,l.group=s),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,o,s,l,u){var c=a(e,t,o,s,l,u);o.transmission>0?r.push(c):!0===o.transparent?i.push(c):n.push(c)},unshift:function(e,t,o,s,l,u){var c=a(e,t,o,s,l,u);o.transmission>0?r.unshift(c):!0===o.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(var n=t,r=e.length;n<r;n++){var i=e[n];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.group=null}},sort:function(e,t){n.length>1&&n.sort(e||Um),r.length>1&&r.sort(t||Fm),i.length>1&&i.sort(t||Fm)}}}function zm(){var e=new WeakMap;return{get:function(t,n){var r,i=e.get(t);return void 0===i?(r=new Bm,e.set(t,[r])):n>=i.length?(r=new Bm,i.push(r)):r=i[n],r},dispose:function(){e=new WeakMap}}}function jm(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new go,color:new fl};break;case"SpotLight":n={position:new go,direction:new go,color:new fl,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new go,color:new fl,distance:0,decay:0};break;case"HemisphereLight":n={direction:new go,skyColor:new fl,groundColor:new fl};break;case"RectAreaLight":n={color:new fl,position:new go,halfWidth:new go,halfHeight:new go}}return e[t.id]=n,n}}}var Hm=0;function Vm(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function Gm(e){for(var t,n=new jm,r=(t={},{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mo};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mo,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}),i={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},a=0;a<9;a++)i.probe.push(new go);var o=new go,s=new xs,l=new xs;return{setup:function(t){for(var a=0,o=0,s=0,l=0;l<9;l++)i.probe[l].set(0,0,0);var u=0,c=0,h=0,d=0,f=0,p=0,v=0,m=0,y=0,g=0,_=0;t.sort(Vm);for(var b=0,x=t.length;b<x;b++){var S=t[b],w=S.color,E=S.intensity,M=S.distance,T=S.shadow&&S.shadow.map?S.shadow.map.texture:null;if(S.isAmbientLight)a+=w.r*E,o+=w.g*E,s+=w.b*E;else if(S.isLightProbe){for(var C=0;C<9;C++)i.probe[C].addScaledVector(S.sh.coefficients[C],E);_++}else if(S.isDirectionalLight){var A=n.get(S);if(A.color.copy(S.color).multiplyScalar(S.intensity),S.castShadow){var P=S.shadow,k=r.get(S);k.shadowIntensity=P.intensity,k.shadowBias=P.bias,k.shadowNormalBias=P.normalBias,k.shadowRadius=P.radius,k.shadowMapSize=P.mapSize,i.directionalShadow[u]=k,i.directionalShadowMap[u]=T,i.directionalShadowMatrix[u]=S.shadow.matrix,p++}i.directional[u]=A,u++}else if(S.isSpotLight){var O=n.get(S);O.position.setFromMatrixPosition(S.matrixWorld),O.color.copy(w).multiplyScalar(E),O.distance=M,O.coneCos=Math.cos(S.angle),O.penumbraCos=Math.cos(S.angle*(1-S.penumbra)),O.decay=S.decay,i.spot[h]=O;var R=S.shadow;if(S.map&&(i.spotLightMap[y]=S.map,y++,R.updateMatrices(S),S.castShadow&&g++),i.spotLightMatrix[h]=R.matrix,S.castShadow){var I=r.get(S);I.shadowIntensity=R.intensity,I.shadowBias=R.bias,I.shadowNormalBias=R.normalBias,I.shadowRadius=R.radius,I.shadowMapSize=R.mapSize,i.spotShadow[h]=I,i.spotShadowMap[h]=T,m++}h++}else if(S.isRectAreaLight){var N=n.get(S);N.color.copy(w).multiplyScalar(E),N.halfWidth.set(.5*S.width,0,0),N.halfHeight.set(0,.5*S.height,0),i.rectArea[d]=N,d++}else if(S.isPointLight){var L=n.get(S);if(L.color.copy(S.color).multiplyScalar(S.intensity),L.distance=S.distance,L.decay=S.decay,S.castShadow){var D=S.shadow,U=r.get(S);U.shadowIntensity=D.intensity,U.shadowBias=D.bias,U.shadowNormalBias=D.normalBias,U.shadowRadius=D.radius,U.shadowMapSize=D.mapSize,U.shadowCameraNear=D.camera.near,U.shadowCameraFar=D.camera.far,i.pointShadow[c]=U,i.pointShadowMap[c]=T,i.pointShadowMatrix[c]=S.shadow.matrix,v++}i.point[c]=L,c++}else if(S.isHemisphereLight){var F=n.get(S);F.skyColor.copy(S.color).multiplyScalar(E),F.groundColor.copy(S.groundColor).multiplyScalar(E),i.hemi[f]=F,f++}}d>0&&(!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Cp.LTC_FLOAT_1,i.rectAreaLTC2=Cp.LTC_FLOAT_2):(i.rectAreaLTC1=Cp.LTC_HALF_1,i.rectAreaLTC2=Cp.LTC_HALF_2)),i.ambient[0]=a,i.ambient[1]=o,i.ambient[2]=s;var B=i.hash;B.directionalLength===u&&B.pointLength===c&&B.spotLength===h&&B.rectAreaLength===d&&B.hemiLength===f&&B.numDirectionalShadows===p&&B.numPointShadows===v&&B.numSpotShadows===m&&B.numSpotMaps===y&&B.numLightProbes===_||(i.directional.length=u,i.spot.length=h,i.rectArea.length=d,i.point.length=c,i.hemi.length=f,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=v,i.pointShadowMap.length=v,i.spotShadow.length=m,i.spotShadowMap.length=m,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=v,i.spotLightMatrix.length=m+y-g,i.spotLightMap.length=y,i.numSpotLightShadowsWithMaps=g,i.numLightProbes=_,B.directionalLength=u,B.pointLength=c,B.spotLength=h,B.rectAreaLength=d,B.hemiLength=f,B.numDirectionalShadows=p,B.numPointShadows=v,B.numSpotShadows=m,B.numSpotMaps=y,B.numLightProbes=_,i.version=Hm++)},setupView:function(e,t){for(var n=0,r=0,a=0,u=0,c=0,h=t.matrixWorldInverse,d=0,f=e.length;d<f;d++){var p=e[d];if(p.isDirectionalLight){var v=i.directional[n];v.direction.setFromMatrixPosition(p.matrixWorld),o.setFromMatrixPosition(p.target.matrixWorld),v.direction.sub(o),v.direction.transformDirection(h),n++}else if(p.isSpotLight){var m=i.spot[a];m.position.setFromMatrixPosition(p.matrixWorld),m.position.applyMatrix4(h),m.direction.setFromMatrixPosition(p.matrixWorld),o.setFromMatrixPosition(p.target.matrixWorld),m.direction.sub(o),m.direction.transformDirection(h),a++}else if(p.isRectAreaLight){var y=i.rectArea[u];y.position.setFromMatrixPosition(p.matrixWorld),y.position.applyMatrix4(h),l.identity(),s.copy(p.matrixWorld),s.premultiply(h),l.extractRotation(s),y.halfWidth.set(.5*p.width,0,0),y.halfHeight.set(0,.5*p.height,0),y.halfWidth.applyMatrix4(l),y.halfHeight.applyMatrix4(l),u++}else if(p.isPointLight){var g=i.point[r];g.position.setFromMatrixPosition(p.matrixWorld),g.position.applyMatrix4(h),r++}else if(p.isHemisphereLight){var _=i.hemi[c];_.direction.setFromMatrixPosition(p.matrixWorld),_.direction.transformDirection(h),c++}}},state:i}}function Wm(e){var t=new Gm(e),n=[],r=[],i={lightsArray:n,shadowsArray:r,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){i.camera=e,n.length=0,r.length=0},state:i,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function Xm(e){var t=new WeakMap;return{get:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=t.get(n);return void 0===a?(r=new Wm(e),t.set(n,[r])):i>=a.length?(r=new Wm(e),a.push(r)):r=a[i],r},dispose:function(){t=new WeakMap}}}function qm(e,t,n){var r=new dc,i=new mo,a=new mo,o=new Go,s=new Dd({depthPacking:3201}),l=new Ud,u={},c=n.maxTextureSize,h=mp(mp(mp({},0,1),1,0),2,2),d=new $l({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new mo},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;var p=new Rl;p.setAttribute("position",new xl(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var v=new Gl(p,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;var y=this.type;function g(n,r){var a=t.update(v);d.defines.VSM_SAMPLES!==n.blurSamples&&(d.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Wo(i.x,i.y)),d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,d,v,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,f,v,null)}function _(t,n,r,i){var a=null,o=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?l:s,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){var c=a.uuid,d=n.uuid,f=u[c];void 0===f&&(f={},u[c]=f);var p=f[d];void 0===p&&(p=a.clone(),f[d]=p,n.addEventListener("dispose",x)),a=p}return a.visible=n.visible,a.wireframe=n.wireframe,a.side=3===i?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=!0===n.alphaToCoverage?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=r),a}function b(n,i,a,o,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var l=t.update(n),u=n.material;if(Array.isArray(u))for(var c=l.groups,h=0,d=c.length;h<d;h++){var f=c[h],p=u[f.materialIndex];if(p&&p.visible){var v=_(n,p,o,s);n.onBeforeShadow(e,n,i,a,l,v,f),e.renderBufferDirect(a,null,l,v,n,f),n.onAfterShadow(e,n,i,a,l,v,f)}}else if(u.visible){var m=_(n,u,o,s);n.onBeforeShadow(e,n,i,a,l,m,null),e.renderBufferDirect(a,null,l,m,n,null),n.onAfterShadow(e,n,i,a,l,m,null)}}for(var y=n.children,g=0,x=y.length;g<x;g++)b(y[g],i,a,o,s)}}function x(e){var t=e.target;for(var n in t.removeEventListener("dispose",x),u){var r=u[n],i=e.target.uuid;i in r&&(r[i].dispose(),delete r[i])}}this.render=function(t,n,s){if(!1!==m.enabled&&(!1!==m.autoUpdate||!1!==m.needsUpdate)&&0!==t.length){var l=e.getRenderTarget(),u=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.state;d.setBlending(0),!0===d.buffers.depth.getReversed()?d.buffers.color.setClear(0,0,0,0):d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var f=3!==y&&3===this.type,p=3===y&&3!==this.type,v=0,_=t.length;v<_;v++){var x=t[v],S=x.shadow;if(void 0!==S){if(!1!==S.autoUpdate||!1!==S.needsUpdate){i.copy(S.mapSize);var w=S.getFrameExtents();if(i.multiply(w),a.copy(S.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/w.x),i.x=a.x*w.x,S.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/w.y),i.y=a.y*w.y,S.mapSize.y=a.y)),null===S.map||!0===f||!0===p){var E=3!==this.type?{minFilter:Hi,magFilter:Hi}:{};null!==S.map&&S.map.dispose(),S.map=new Wo(i.x,i.y,E),S.map.texture.name=x.name+".shadowMap",S.camera.updateProjectionMatrix()}e.setRenderTarget(S.map),e.clear();for(var M=S.getViewportCount(),T=0;T<M;T++){var C=S.getViewport(T);o.set(a.x*C.x,a.y*C.y,a.x*C.z,a.y*C.w),d.viewport(o),S.updateMatrices(x,T),r=S.getFrustum(),b(n,s,S.camera,x,this.type)}!0!==S.isPointLightShadow&&3===this.type&&g(S,s),S.needsUpdate=!1}}else console.warn("THREE.WebGLShadowMap:",x,"has no shadow.")}y=this.type,m.needsUpdate=!1,e.setRenderTarget(l,u,h)}}}var Ym=mp(mp(mp(mp(mp(mp(mp(mp({},0,1),2,6),4,7),3,5),1,0),6,2),7,4),5,3);function Jm(e,t){var n,r=new function(){var t=!1,n=new Go,r=null,i=new Go(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},i=new function(){var n=!1,r=!1,i=null,a=null,o=null;return{setReversed:function(e){if(r!==e){var n=t.get("EXT_clip_control");e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;var i=o;o=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?j(e.DEPTH_TEST):H(e.DEPTH_TEST)},setMask:function(t){i===t||n||(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=Ym[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){o!==t&&(r&&(t=1-t),e.clearDepth(t),o=t)},reset:function(){n=!1,i=null,a=null,o=null,r=!1}}},a=new function(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;return{setTest:function(n){t||(n?j(e.STENCIL_TEST):H(e.STENCIL_TEST))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){o===t&&s===n&&l===r||(e.stencilOp(t,n,r),o=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null}}},o=new WeakMap,s=new WeakMap,l={},u={},c=new WeakMap,h=[],d=null,f=!1,p=null,v=null,m=null,y=null,g=null,_=null,b=null,x=new fl(0,0,0),S=0,w=!1,E=null,M=null,T=null,C=null,A=null,P=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),k=!1,O=0,R=e.getParameter(e.VERSION);-1!==R.indexOf("WebGL")?(O=parseFloat(/^WebGL (\d)/.exec(R)[1]),k=O>=1):-1!==R.indexOf("OpenGL ES")&&(O=parseFloat(/^OpenGL ES (\d)/.exec(R)[1]),k=O>=2);var I=null,N={},L=e.getParameter(e.SCISSOR_BOX),D=e.getParameter(e.VIEWPORT),U=(new Go).fromArray(L),F=(new Go).fromArray(D);function B(t,n,r,i){var a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var s=0;s<r;s++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}var z={};function j(t){!0!==l[t]&&(e.enable(t),l[t]=!0)}function H(t){!1!==l[t]&&(e.disable(t),l[t]=!1)}z[e.TEXTURE_2D]=B(e.TEXTURE_2D,e.TEXTURE_2D,1),z[e.TEXTURE_CUBE_MAP]=B(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),z[e.TEXTURE_2D_ARRAY]=B(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),z[e.TEXTURE_3D]=B(e.TEXTURE_3D,e.TEXTURE_3D,1,1),r.setClear(0,0,0,1),i.setClear(1),a.setClear(0),j(e.DEPTH_TEST),i.setFunc(3),X(!1),q(1),j(e.CULL_FACE),W(0);var V=mp(mp(mp({},Ri,e.FUNC_ADD),101,e.FUNC_SUBTRACT),102,e.FUNC_REVERSE_SUBTRACT);V[103]=e.MIN,V[104]=e.MAX;var G=(mp(mp(mp(mp(mp(mp(mp(mp(mp(mp(n={},200,e.ZERO),201,e.ONE),202,e.SRC_COLOR),204,e.SRC_ALPHA),210,e.SRC_ALPHA_SATURATE),208,e.DST_COLOR),206,e.DST_ALPHA),203,e.ONE_MINUS_SRC_COLOR),205,e.ONE_MINUS_SRC_ALPHA),209,e.ONE_MINUS_DST_COLOR),mp(mp(mp(mp(mp(n,207,e.ONE_MINUS_DST_ALPHA),211,e.CONSTANT_COLOR),212,e.ONE_MINUS_CONSTANT_COLOR),213,e.CONSTANT_ALPHA),214,e.ONE_MINUS_CONSTANT_ALPHA));function W(t,n,r,i,a,o,s,l,u,c){if(0!==t){if(!1===f&&(j(e.BLEND),f=!0),5===t)a=a||n,o=o||r,s=s||i,n===v&&a===g||(e.blendEquationSeparate(V[n],V[a]),v=n,g=a),r===m&&i===y&&o===_&&s===b||(e.blendFuncSeparate(G[r],G[i],G[o],G[s]),m=r,y=i,_=o,b=s),!1!==l.equals(x)&&u===S||(e.blendColor(l.r,l.g,l.b,u),x.copy(l),S=u),p=t,w=!1;else if(t!==p||c!==w){if(v===Ri&&g===Ri||(e.blendEquation(e.FUNC_ADD),v=Ri,g=Ri),c)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case 4:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}m=null,y=null,_=null,b=null,x.set(0,0,0),S=0,p=t,w=c}}else!0===f&&(H(e.BLEND),f=!1)}function X(t){E!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),E=t)}function q(t){0!==t?(j(e.CULL_FACE),t!==M&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):H(e.CULL_FACE),M=t}function Y(t,n,r){t?(j(e.POLYGON_OFFSET_FILL),C===n&&A===r||(e.polygonOffset(n,r),C=n,A=r)):H(e.POLYGON_OFFSET_FILL)}return{buffers:{color:r,depth:i,stencil:a},enable:j,disable:H,bindFramebuffer:function(t,n){return u[t]!==n&&(e.bindFramebuffer(t,n),u[t]=n,t===e.DRAW_FRAMEBUFFER&&(u[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(u[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){var r=h,i=!1;if(t){void 0===(r=c.get(n))&&(r=[],c.set(n,r));var a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(var o=0,s=a.length;o<s;o++)r[o]=e.COLOR_ATTACHMENT0+o;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:W,setMaterial:function(t,n){2===t.side?H(e.CULL_FACE):j(e.CULL_FACE);var o=1===t.side;n&&(o=!o),X(o),1===t.blending&&!1===t.transparent?W(0):W(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),r.setMask(t.colorWrite);var s=t.stencilWrite;a.setTest(s),s&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Y(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?j(e.SAMPLE_ALPHA_TO_COVERAGE):H(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:X,setCullFace:q,setLineWidth:function(t){t!==T&&(k&&e.lineWidth(t),T=t)},setPolygonOffset:Y,setScissorTest:function(t){t?j(e.SCISSOR_TEST):H(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+P-1),I!==t&&(e.activeTexture(t),I=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===I?e.TEXTURE0+P-1:I);var i=N[r];void 0===i&&(i={type:void 0,texture:void 0},N[r]=i),i.type===t&&i.texture===n||(I!==r&&(e.activeTexture(r),I=r),e.bindTexture(t,n||z[t]),i.type=t,i.texture=n)},unbindTexture:function(){var t=N[I];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},updateUBOMapping:function(t,n){var r=s.get(n);void 0===r&&(r=new WeakMap,s.set(n,r));var i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){var r=s.get(n).get(t);o.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),o.set(n,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===U.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),U.copy(t))},viewport:function(t){!1===F.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),F.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),i.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),l={},I=null,N={},u={},c=new WeakMap,h=[],d=null,f=!1,p=null,v=null,m=null,y=null,g=null,_=null,b=null,x=new fl(0,0,0),S=0,w=!1,E=null,M=null,T=null,C=null,A=null,U.set(0,0,e.canvas.width,e.canvas.height),F.set(0,0,e.canvas.width,e.canvas.height),r.reset(),i.reset(),a.reset()}}}function Zm(e,t,n,r,i,a,o){var s,l=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,u="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new mo,h=new WeakMap,d=new WeakMap,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function p(e,t){return f?new OffscreenCanvas(e,t):To("canvas")}function v(e,t,n){var r=1,i=V(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){var a=Math.floor(r*i.width),o=Math.floor(r*i.height);void 0===s&&(s=p(a,o));var l=t?p(a,o):s;return l.width=a,l.height=o,l.getContext("2d").drawImage(e,0,0,a,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+a+"x"+o+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+")."),e}return e}function m(e){return e.generateMipmaps}function y(t){e.generateMipmap(t)}function g(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function _(n,r,i,a){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGB8UI),i===e.UNSIGNED_SHORT&&(s=e.RGB16UI),i===e.UNSIGNED_INT&&(s=e.RGB32UI),i===e.BYTE&&(s=e.RGB8I),i===e.SHORT&&(s=e.RGB16I),i===e.INT&&(s=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(s=e.RGBA16UI),i===e.UNSIGNED_INT&&(s=e.RGBA32UI),i===e.BYTE&&(s=e.RGBA8I),i===e.SHORT&&(s=e.RGBA16I),i===e.INT&&(s=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(s=e.R11F_G11F_B10F)),r===e.RGBA){var l=o?Za:No.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=l===Ka?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return s!==e.R16F&&s!==e.R32F&&s!==e.RG16F&&s!==e.RG32F&&s!==e.RGBA16F&&s!==e.RGBA32F||t.get("EXT_color_buffer_float"),s}function b(t,n){var r;return t?null===n||n===Zi||n===ta?r=e.DEPTH24_STENCIL8:n===Ki?r=e.DEPTH32F_STENCIL8:n===Yi&&(r=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===Zi||n===ta?r=e.DEPTH_COMPONENT24:n===Ki?r=e.DEPTH_COMPONENT32F:n===Yi&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return!0===m(e)||e.isFramebufferTexture&&e.minFilter!==Hi&&e.minFilter!==Gi?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){var t=e.target;t.removeEventListener("dispose",S),function(e){var t=r.get(e);if(void 0!==t.__webglInit){var n=e.source,i=d.get(n);if(i){var a=i[t.__cacheKey];a.usedTimes--,0===a.usedTimes&&E(e),0===Object.keys(i).length&&d.delete(n)}r.remove(e)}}(t),t.isVideoTexture&&h.delete(t)}function w(t){var n=t.target;n.removeEventListener("dispose",w),function(t){var n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(var i=0;i<6;i++){if(Array.isArray(n.__webglFramebuffer[i]))for(var a=0;a<n.__webglFramebuffer[i].length;a++)e.deleteFramebuffer(n.__webglFramebuffer[i][a]);else e.deleteFramebuffer(n.__webglFramebuffer[i]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[i])}else{if(Array.isArray(n.__webglFramebuffer))for(var s=0;s<n.__webglFramebuffer.length;s++)e.deleteFramebuffer(n.__webglFramebuffer[s]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(var l=0;l<n.__webglColorRenderbuffer.length;l++)n.__webglColorRenderbuffer[l]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[l]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}for(var u=t.textures,c=0,h=u.length;c<h;c++){var d=r.get(u[c]);d.__webglTexture&&(e.deleteTexture(d.__webglTexture),o.memory.textures--),r.remove(u[c])}r.remove(t)}(n)}function E(t){var n=r.get(t);e.deleteTexture(n.__webglTexture);var i=t.source;delete d.get(i)[n.__cacheKey],o.memory.textures--}var M=0;function T(t,i){var a=r.get(t);if(t.isVideoTexture&&function(e){var t=o.render.frame;h.get(e)!==t&&(h.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&!0!==t.isExternalTexture&&t.version>0&&a.__version!==t.version){var s=t.image;if(null===s)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==s.complete)return void I(a,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}var C=mp(mp(mp({},Bi,e.REPEAT),zi,e.CLAMP_TO_EDGE),ji,e.MIRRORED_REPEAT),A=mp(mp(mp(mp(mp(mp({},Hi,e.NEAREST),1004,e.NEAREST_MIPMAP_NEAREST),Vi,e.NEAREST_MIPMAP_LINEAR),Gi,e.LINEAR),Wi,e.LINEAR_MIPMAP_NEAREST),Xi,e.LINEAR_MIPMAP_LINEAR),P=mp(mp(mp(mp(mp(mp(mp(mp({},512,e.NEVER),519,e.ALWAYS),513,e.LESS),515,e.LEQUAL),514,e.EQUAL),518,e.GEQUAL),516,e.GREATER),517,e.NOTEQUAL);function k(n,a){if(a.type!==Ki||!1!==t.has("OES_texture_float_linear")||a.magFilter!==Gi&&a.magFilter!==Wi&&a.magFilter!==Vi&&a.magFilter!==Xi&&a.minFilter!==Gi&&a.minFilter!==Wi&&a.minFilter!==Vi&&a.minFilter!==Xi||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,C[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,C[a.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,C[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,P[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(a.magFilter===Hi)return;if(a.minFilter!==Vi&&a.minFilter!==Xi)return;if(a.type===Ki&&!1===t.has("OES_texture_float_linear"))return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){var o=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function O(t,n){var r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",S));var i=n.source,a=d.get(i);void 0===a&&(a={},d.set(i,a));var s=function(e){var t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;var l=a[t.__cacheKey];void 0!==l&&(a[t.__cacheKey].usedTimes--,0===l.usedTimes&&E(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function R(e,t,n){return Math.floor(Math.floor(e/n)/t)}function I(t,o,s){var l=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=e.TEXTURE_3D);var u=O(t,o),c=o.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+s);var h=r.get(c);if(c.version!==h.__version||!0===u){n.activeTexture(e.TEXTURE0+s);var d=No.getPrimaries(No.workingColorSpace),f=o.colorSpace===qa?null:No.getPrimaries(o.colorSpace),p=o.colorSpace===qa||d===f?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);var g=v(o.image,!1,i.maxTextureSize);g=H(o,g);var S,w=a.convert(o.format,o.colorSpace),E=a.convert(o.type),M=_(o.internalFormat,w,E,o.colorSpace,o.isVideoTexture);k(l,o);var T=o.mipmaps,C=!0!==o.isVideoTexture,A=void 0===h.__version||!0===u,P=c.dataReady,I=x(o,g);if(o.isDepthTexture)M=b(o.format===ia,o.type),A&&(C?n.texStorage2D(e.TEXTURE_2D,1,M,g.width,g.height):n.texImage2D(e.TEXTURE_2D,0,M,g.width,g.height,0,w,E,null));else if(o.isDataTexture)if(T.length>0){C&&A&&n.texStorage2D(e.TEXTURE_2D,I,M,T[0].width,T[0].height);for(var N=0,L=T.length;N<L;N++)S=T[N],C?P&&n.texSubImage2D(e.TEXTURE_2D,N,0,0,S.width,S.height,w,E,S.data):n.texImage2D(e.TEXTURE_2D,N,M,S.width,S.height,0,w,E,S.data);o.generateMipmaps=!1}else C?(A&&n.texStorage2D(e.TEXTURE_2D,I,M,g.width,g.height),P&&function(t,r,i,a){var o=t.updateRanges;if(0===o.length)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((function(e,t){return e.start-t.start}));for(var s=0,l=1;l<o.length;l++){var u=o[s],c=o[l],h=u.start+u.count,d=R(c.start,r.width,4),f=R(u.start,r.width,4);c.start<=h+1&&d===f&&R(c.start+c.count-1,r.width,4)===d?u.count=Math.max(u.count,c.start+c.count-u.start):o[++s]=c}o.length=s+1;var p=e.getParameter(e.UNPACK_ROW_LENGTH),v=e.getParameter(e.UNPACK_SKIP_PIXELS),m=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,r.width);for(var y=0,g=o.length;y<g;y++){var _=o[y],b=Math.floor(_.start/4),x=Math.ceil(_.count/4),S=b%r.width,w=Math.floor(b/r.width),E=x;e.pixelStorei(e.UNPACK_SKIP_PIXELS,S),e.pixelStorei(e.UNPACK_SKIP_ROWS,w),n.texSubImage2D(e.TEXTURE_2D,0,S,w,E,1,i,a,r.data)}t.clearUpdateRanges(),e.pixelStorei(e.UNPACK_ROW_LENGTH,p),e.pixelStorei(e.UNPACK_SKIP_PIXELS,v),e.pixelStorei(e.UNPACK_SKIP_ROWS,m)}}(o,g,w,E)):n.texImage2D(e.TEXTURE_2D,0,M,g.width,g.height,0,w,E,g.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){C&&A&&n.texStorage3D(e.TEXTURE_2D_ARRAY,I,M,T[0].width,T[0].height,g.depth);for(var D=0,U=T.length;D<U;D++)if(S=T[D],o.format!==na)if(null!==w)if(C){if(P)if(o.layerUpdates.size>0){var F,B=lp(S.width,S.height,o.format,o.type),z=yp(o.layerUpdates);try{for(z.s();!(F=z.n()).done;){var j=F.value,G=S.data.subarray(j*B/S.data.BYTES_PER_ELEMENT,(j+1)*B/S.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,D,0,0,j,S.width,S.height,1,w,G)}}catch(e){z.e(e)}finally{z.f()}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,D,0,0,0,S.width,S.height,g.depth,w,S.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,D,M,S.width,S.height,g.depth,0,S.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else C?P&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,D,0,0,0,S.width,S.height,g.depth,w,E,S.data):n.texImage3D(e.TEXTURE_2D_ARRAY,D,M,S.width,S.height,g.depth,0,w,E,S.data)}else{C&&A&&n.texStorage2D(e.TEXTURE_2D,I,M,T[0].width,T[0].height);for(var W=0,X=T.length;W<X;W++)S=T[W],o.format!==na?null!==w?C?P&&n.compressedTexSubImage2D(e.TEXTURE_2D,W,0,0,S.width,S.height,w,S.data):n.compressedTexImage2D(e.TEXTURE_2D,W,M,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage2D(e.TEXTURE_2D,W,0,0,S.width,S.height,w,E,S.data):n.texImage2D(e.TEXTURE_2D,W,M,S.width,S.height,0,w,E,S.data)}else if(o.isDataArrayTexture)if(C){if(A&&n.texStorage3D(e.TEXTURE_2D_ARRAY,I,M,g.width,g.height,g.depth),P)if(o.layerUpdates.size>0){var q,Y=lp(g.width,g.height,o.format,o.type),J=yp(o.layerUpdates);try{for(J.s();!(q=J.n()).done;){var Z=q.value,K=g.data.subarray(Z*Y/g.data.BYTES_PER_ELEMENT,(Z+1)*Y/g.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,Z,g.width,g.height,1,w,E,K)}}catch(e){J.e(e)}finally{J.f()}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,g.width,g.height,g.depth,w,E,g.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,M,g.width,g.height,g.depth,0,w,E,g.data);else if(o.isData3DTexture)C?(A&&n.texStorage3D(e.TEXTURE_3D,I,M,g.width,g.height,g.depth),P&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,g.width,g.height,g.depth,w,E,g.data)):n.texImage3D(e.TEXTURE_3D,0,M,g.width,g.height,g.depth,0,w,E,g.data);else if(o.isFramebufferTexture){if(A)if(C)n.texStorage2D(e.TEXTURE_2D,I,M,g.width,g.height);else for(var $=g.width,Q=g.height,ee=0;ee<I;ee++)n.texImage2D(e.TEXTURE_2D,ee,M,$,Q,0,w,E,null),$>>=1,Q>>=1}else if(T.length>0){if(C&&A){var te=V(T[0]);n.texStorage2D(e.TEXTURE_2D,I,M,te.width,te.height)}for(var ne=0,re=T.length;ne<re;ne++)S=T[ne],C?P&&n.texSubImage2D(e.TEXTURE_2D,ne,0,0,w,E,S):n.texImage2D(e.TEXTURE_2D,ne,M,w,E,S);o.generateMipmaps=!1}else if(C){if(A){var ie=V(g);n.texStorage2D(e.TEXTURE_2D,I,M,ie.width,ie.height)}P&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,w,E,g)}else n.texImage2D(e.TEXTURE_2D,0,M,w,E,g);m(o)&&y(l),h.__version=c.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function N(t,i,o,s,u,c){var h=a.convert(o.format,o.colorSpace),d=a.convert(o.type),f=_(o.internalFormat,h,d,o.colorSpace),p=r.get(i),v=r.get(o);if(v.__renderTarget=i,!p.__hasExternalTextures){var m=Math.max(1,i.width>>c),y=Math.max(1,i.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?n.texImage3D(u,c,f,m,y,i.depth,0,h,d,null):n.texImage2D(u,c,f,m,y,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),j(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,s,u,v.__webglTexture,0,z(i)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,s,u,v.__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function L(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){var i=n.depthTexture,o=i&&i.isDepthTexture?i.type:null,s=b(n.stencilBuffer,o),u=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=z(n);j(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,c,s,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,c,s,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,s,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,u,e.RENDERBUFFER,t)}else for(var h=n.textures,d=0;d<h.length;d++){var f=h[d],p=a.convert(f.format,f.colorSpace),v=a.convert(f.type),m=_(f.internalFormat,p,v,f.colorSpace),y=z(n);r&&!1===j(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,y,m,n.width,n.height):j(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,y,m,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,m,n.width,n.height)}e.bindRenderbuffer(e.RENDERBUFFER,null)}function D(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");var a=r.get(i.depthTexture);a.__renderTarget=i,a.__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),T(i.depthTexture,0);var o=a.__webglTexture,s=z(i);if(i.depthTexture.format===ra)j(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,o,0,s):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,o,0);else{if(i.depthTexture.format!==ia)throw new Error("Unknown depthTexture format");j(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,o,0,s):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,o,0)}}function U(t){var i=r.get(t),a=!0===t.isWebGLCubeRenderTarget;if(i.__boundDepthTexture!==t.depthTexture){var o=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),o){var s=function(){delete i.__boundDepthTexture,delete i.__depthDisposeCallback,o.removeEventListener("dispose",s)};o.addEventListener("dispose",s),i.__depthDisposeCallback=s}i.__boundDepthTexture=o}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");var l=t.texture.mipmaps;l&&l.length>0?D(i.__webglFramebuffer[0],t):D(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(var u=0;u<6;u++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[u]),void 0===i.__webglDepthbuffer[u])i.__webglDepthbuffer[u]=e.createRenderbuffer(),L(i.__webglDepthbuffer[u],t,!1);else{var c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,h=i.__webglDepthbuffer[u];e.bindRenderbuffer(e.RENDERBUFFER,h),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,h)}}else{var d=t.texture.mipmaps;if(d&&d.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),L(i.__webglDepthbuffer,t,!1);else{var f=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,p=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,p),e.framebufferRenderbuffer(e.FRAMEBUFFER,f,e.RENDERBUFFER,p)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}var F=[],B=[];function z(e){return Math.min(i.maxSamples,e.samples)}function j(e){var n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function H(e,t){var n=e.colorSpace,r=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==Ja&&n!==qa&&(No.getTransfer(n)===Ka?r===na&&i===qi||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function V(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){var e=M;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),M+=1,e},this.resetTextureUnits=function(){M=0},this.setTexture2D=T,this.setTexture2DArray=function(t,i){var a=r.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?I(a,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){var a=r.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?I(a,t,i):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){var s=r.get(t);t.version>0&&s.__version!==t.version?function(t,o,s){if(6===o.image.length){var l=O(t,o),u=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);var c=r.get(u);if(u.version!==c.__version||!0===l){n.activeTexture(e.TEXTURE0+s);var h=No.getPrimaries(No.workingColorSpace),d=o.colorSpace===qa?null:No.getPrimaries(o.colorSpace),f=o.colorSpace===qa||h===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);for(var p=o.isCompressedTexture||o.image[0].isCompressedTexture,g=o.image[0]&&o.image[0].isDataTexture,b=[],S=0;S<6;S++)b[S]=p||g?g?o.image[S].image:o.image[S]:v(o.image[S],!0,i.maxCubemapSize),b[S]=H(o,b[S]);var w,E=b[0],M=a.convert(o.format,o.colorSpace),T=a.convert(o.type),C=_(o.internalFormat,M,T,o.colorSpace),A=!0!==o.isVideoTexture,P=void 0===c.__version||!0===l,R=u.dataReady,I=x(o,E);if(k(e.TEXTURE_CUBE_MAP,o),p){A&&P&&n.texStorage2D(e.TEXTURE_CUBE_MAP,I,C,E.width,E.height);for(var N=0;N<6;N++){w=b[N].mipmaps;for(var L=0;L<w.length;L++){var D=w[L];o.format!==na?null!==M?A?R&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+N,L,0,0,D.width,D.height,M,D.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+N,L,C,D.width,D.height,0,D.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):A?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+N,L,0,0,D.width,D.height,M,T,D.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+N,L,C,D.width,D.height,0,M,T,D.data)}}}else{if(w=o.mipmaps,A&&P){w.length>0&&I++;var U=V(b[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,I,C,U.width,U.height)}for(var F=0;F<6;F++)if(g){A?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,b[F].width,b[F].height,M,T,b[F].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,C,b[F].width,b[F].height,0,M,T,b[F].data);for(var B=0;B<w.length;B++){var z=w[B].image[F].image;A?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+F,B+1,0,0,z.width,z.height,M,T,z.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+F,B+1,C,z.width,z.height,0,M,T,z.data)}}else{A?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,M,T,b[F]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,C,M,T,b[F]);for(var j=0;j<w.length;j++){var G=w[j];A?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+F,j+1,0,0,M,T,G.image[F]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+F,j+1,C,M,T,G.image[F])}}}m(o)&&y(e.TEXTURE_CUBE_MAP),c.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}}(s,t,o):n.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,n,i){var a=r.get(t);void 0!==n&&N(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&U(t)},this.setupRenderTarget=function(t){var i=t.texture,s=r.get(t),l=r.get(i);t.addEventListener("dispose",w);var u=t.textures,c=!0===t.isWebGLCubeRenderTarget,h=u.length>1;if(h||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,o.memory.textures++),c){s.__webglFramebuffer=[];for(var d=0;d<6;d++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[d]=[];for(var f=0;f<i.mipmaps.length;f++)s.__webglFramebuffer[d][f]=e.createFramebuffer()}else s.__webglFramebuffer[d]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(var p=0;p<i.mipmaps.length;p++)s.__webglFramebuffer[p]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(h)for(var v=0,g=u.length;v<g;v++){var b=r.get(u[v]);void 0===b.__webglTexture&&(b.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===j(t)){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(var x=0;x<u.length;x++){var S=u[x];s.__webglColorRenderbuffer[x]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[x]);var E=a.convert(S.format,S.colorSpace),M=a.convert(S.type),T=_(S.internalFormat,E,M,S.colorSpace,!0===t.isXRRenderTarget),C=z(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,C,T,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+x,e.RENDERBUFFER,s.__webglColorRenderbuffer[x])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),L(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(c){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),k(e.TEXTURE_CUBE_MAP,i);for(var A=0;A<6;A++)if(i.mipmaps&&i.mipmaps.length>0)for(var P=0;P<i.mipmaps.length;P++)N(s.__webglFramebuffer[A][P],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+A,P);else N(s.__webglFramebuffer[A],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+A,0);m(i)&&y(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){for(var O=0,R=u.length;O<R;O++){var I=u[O],D=r.get(I),F=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(F=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(F,D.__webglTexture),k(F,I),N(s.__webglFramebuffer,t,I,e.COLOR_ATTACHMENT0+O,F,0),m(I)&&y(F)}n.unbindTexture()}else{var B=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(B=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(B,l.__webglTexture),k(B,i),i.mipmaps&&i.mipmaps.length>0)for(var H=0;H<i.mipmaps.length;H++)N(s.__webglFramebuffer[H],t,i,e.COLOR_ATTACHMENT0,B,H);else N(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,B,0);m(i)&&y(B),n.unbindTexture()}t.depthBuffer&&U(t)},this.updateRenderTargetMipmap=function(e){for(var t=e.textures,i=0,a=t.length;i<a;i++){var o=t[i];if(m(o)){var s=g(e),l=r.get(o).__webglTexture;n.bindTexture(s,l),y(s),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0)if(!1===j(t)){var i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=r.get(t),h=i.length>1;if(h)for(var d=0;d<i.length;d++)n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+d,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+d,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,c.__webglMultisampledFramebuffer);var f=t.texture.mipmaps;f&&f.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(var p=0;p<i.length;p++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),h){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,c.__webglColorRenderbuffer[p]);var v=r.get(i[p]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,v,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),!0===u&&(F.length=0,B.length=0,F.push(e.COLOR_ATTACHMENT0+p),t.depthBuffer&&!1===t.resolveDepthBuffer&&(F.push(l),B.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,B)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,F))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),h)for(var m=0;m<i.length;m++){n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+m,e.RENDERBUFFER,c.__webglColorRenderbuffer[m]);var y=r.get(i[m]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+m,e.TEXTURE_2D,y,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&u){var g=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[g])}},this.setupDepthRenderbuffer=U,this.setupFrameBufferTexture=N,this.useMultisampledRTT=j}function Km(e,t){return{convert:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa,a=No.getTransfer(i);if(n===qi)return e.UNSIGNED_BYTE;if(n===Qi)return e.UNSIGNED_SHORT_4_4_4_4;if(n===ea)return e.UNSIGNED_SHORT_5_5_5_1;if(35902===n)return e.UNSIGNED_INT_5_9_9_9_REV;if(35899===n)return e.UNSIGNED_INT_10F_11F_11F_REV;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(n===Yi)return e.UNSIGNED_SHORT;if(n===Ji)return e.INT;if(n===Zi)return e.UNSIGNED_INT;if(n===Ki)return e.FLOAT;if(n===$i)return e.HALF_FLOAT;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(n===na)return e.RGBA;if(n===ra)return e.DEPTH_COMPONENT;if(n===ia)return e.DEPTH_STENCIL;if(n===aa)return e.RED;if(n===oa)return e.RED_INTEGER;if(1030===n)return e.RG;if(n===sa)return e.RG_INTEGER;if(n===la)return e.RGBA_INTEGER;if(n===ua||n===ca||n===ha||n===da)if(a===Ka){if(null===(r=t.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(n===ua)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===ca)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===ha)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===da)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(n===ua)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===ca)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===ha)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===da)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===fa||n===pa||n===va||n===ma){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(n===fa)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===pa)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===va)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ma)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===ya||n===ga||n===_a){if(null===(r=t.get("WEBGL_compressed_texture_etc")))return null;if(n===ya||n===ga)return a===Ka?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===_a)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(n===ba||n===xa||n===Sa||n===wa||n===Ea||n===Ma||n===Ta||n===Ca||n===Aa||n===Pa||n===ka||n===Oa||n===Ra||n===Ia){if(null===(r=t.get("WEBGL_compressed_texture_astc")))return null;if(n===ba)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===xa)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Sa)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===wa)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Ea)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Ma)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ta)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Ca)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Aa)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Pa)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ka)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Oa)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Ra)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ia)return a===Ka?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===Na||n===La||n===Da){if(null===(r=t.get("EXT_texture_compression_bptc")))return null;if(n===Na)return a===Ka?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===La)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Da)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===Ua||n===Fa||n===Ba||n===za){if(null===(r=t.get("EXT_texture_compression_rgtc")))return null;if(n===Ua)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Fa)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Ba)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===za)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===ta?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}var $m=function(){return Sp((function e(){bp(this,e),this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}),[{key:"init",value:function(e,t){if(null===this.texture){var n=new rh(e.texture);e.depthNear===t.depthNear&&e.depthFar===t.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}},{key:"getMesh",value:function(e){if(null!==this.texture&&null===this.mesh){var t=e.cameras[0].viewport,n=new $l({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Gl(new yd(20,20),n)}return this.mesh}},{key:"reset",value:function(){this.texture=null,this.mesh=null}},{key:"getDepthTexture",value:function(){return this.texture}}])}(),Qm=function(e){function t(e,n){var r;bp(this,t);var i,a,o,s=(i=this,a=pp(a=t),r=function(e,t){if(t&&("object"==_p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(i,fp()?Reflect.construct(a,o||[],pp(i).constructor):a.apply(i,o))),l=null,u=1,c=null,h="local-floor",d=1,f=null,p=null,v=null,m=null,y=null,g=null,_="undefined"!=typeof XRWebGLBinding,b=new $m,x={},S=n.getContextAttributes(),w=null,E=null,M=[],T=[],C=new mo,A=null,P=new ru;P.viewport=new Go;var k=new ru;k.viewport=new Go;var O=[P,k],R=new Hf,I=null,N=null;function L(e){var t=T.indexOf(e.inputSource);if(-1!==t){var n=M[t];void 0!==n&&(n.update(e.inputSource,e.frame,f||c),n.dispatchEvent({type:e.type,data:e.inputSource}))}}function D(){l.removeEventListener("select",L),l.removeEventListener("selectstart",L),l.removeEventListener("selectend",L),l.removeEventListener("squeeze",L),l.removeEventListener("squeezestart",L),l.removeEventListener("squeezeend",L),l.removeEventListener("end",D),l.removeEventListener("inputsourceschange",U);for(var t=0;t<M.length;t++){var n=T[t];null!==n&&(T[t]=null,M[t].disconnect(n))}for(var r in I=null,N=null,b.reset(),x)delete x[r];e.setRenderTarget(w),y=null,m=null,v=null,l=null,E=null,H.stop(),s.isPresenting=!1,e.setPixelRatio(A),e.setSize(C.width,C.height,!1),s.dispatchEvent({type:"sessionend"})}function U(e){for(var t=0;t<e.removed.length;t++){var n=e.removed[t],r=T.indexOf(n);r>=0&&(T[r]=null,M[r].disconnect(n))}for(var i=0;i<e.added.length;i++){var a=e.added[i],o=T.indexOf(a);if(-1===o){for(var s=0;s<M.length;s++){if(s>=T.length){T.push(a),o=s;break}if(null===T[s]){T[s]=a,o=s;break}}if(-1===o)break}var l=M[o];l&&l.connect(a)}}r.cameraAutoUpdate=!0,r.enabled=!1,r.isPresenting=!1,r.getController=function(e){var t=M[e];return void 0===t&&(t=new cu,M[e]=t),t.getTargetRaySpace()},r.getControllerGrip=function(e){var t=M[e];return void 0===t&&(t=new cu,M[e]=t),t.getGripSpace()},r.getHand=function(e){var t=M[e];return void 0===t&&(t=new cu,M[e]=t),t.getHandSpace()},r.setFramebufferScaleFactor=function(e){u=e,!0===s.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},r.setReferenceSpaceType=function(e){h=e,!0===s.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},r.getReferenceSpace=function(){return f||c},r.setReferenceSpace=function(e){f=e},r.getBaseLayer=function(){return null!==m?m:y},r.getBinding=function(){return null===v&&_&&(v=new XRWebGLBinding(l,n)),v},r.getFrame=function(){return g},r.getSession=function(){return l},r.setSession=function(){var t=dp(up().m((function t(r){var i,a,o,p,g;return up().w((function(t){for(;;)switch(t.n){case 0:if(null===(l=r)){t.n=3;break}if(w=e.getRenderTarget(),l.addEventListener("select",L),l.addEventListener("selectstart",L),l.addEventListener("selectend",L),l.addEventListener("squeeze",L),l.addEventListener("squeezestart",L),l.addEventListener("squeezeend",L),l.addEventListener("end",D),l.addEventListener("inputsourceschange",U),!0===S.xrCompatible){t.n=1;break}return t.n=1,n.makeXRCompatible();case 1:return A=e.getPixelRatio(),e.getSize(C),_&&"createProjectionLayer"in XRWebGLBinding.prototype?(a=null,o=null,p=null,S.depth&&(p=S.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,a=S.stencil?ia:ra,o=S.stencil?ta:Zi),g={colorFormat:n.RGBA8,depthFormat:p,scaleFactor:u},v=this.getBinding(),m=v.createProjectionLayer(g),l.updateRenderState({layers:[m]}),e.setPixelRatio(1),e.setSize(m.textureWidth,m.textureHeight,!1),E=new Wo(m.textureWidth,m.textureHeight,{format:na,type:qi,depthTexture:new nh(m.textureWidth,m.textureHeight,o,void 0,void 0,void 0,void 0,void 0,void 0,a),stencilBuffer:S.stencil,colorSpace:e.outputColorSpace,samples:S.antialias?4:0,resolveDepthBuffer:!1===m.ignoreDepthValues,resolveStencilBuffer:!1===m.ignoreDepthValues})):(i={antialias:S.antialias,alpha:!0,depth:S.depth,stencil:S.stencil,framebufferScaleFactor:u},y=new XRWebGLLayer(l,n,i),l.updateRenderState({baseLayer:y}),e.setPixelRatio(1),e.setSize(y.framebufferWidth,y.framebufferHeight,!1),E=new Wo(y.framebufferWidth,y.framebufferHeight,{format:na,type:qi,colorSpace:e.outputColorSpace,stencilBuffer:S.stencil,resolveDepthBuffer:!1===y.ignoreDepthValues,resolveStencilBuffer:!1===y.ignoreDepthValues})),E.isXRRenderTarget=!0,this.setFoveation(d),f=null,t.n=2,l.requestReferenceSpace(h);case 2:c=t.v,H.setContext(l),H.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"});case 3:return t.a(2)}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.getEnvironmentBlendMode=function(){if(null!==l)return l.environmentBlendMode},r.getDepthTexture=function(){return b.getDepthTexture()};var F=new go,B=new go;function z(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}r.updateCamera=function(e){if(null!==l){var t=e.near,n=e.far;null!==b.texture&&(b.depthNear>0&&(t=b.depthNear),b.depthFar>0&&(n=b.depthFar)),R.near=k.near=P.near=t,R.far=k.far=P.far=n,I===R.near&&N===R.far||(l.updateRenderState({depthNear:R.near,depthFar:R.far}),I=R.near,N=R.far),R.layers.mask=6|e.layers.mask,P.layers.mask=3&R.layers.mask,k.layers.mask=5&R.layers.mask;var r=e.parent,i=R.cameras;z(R,r);for(var a=0;a<i.length;a++)z(i[a],r);2===i.length?function(e,t,n){F.setFromMatrixPosition(t.matrixWorld),B.setFromMatrixPosition(n.matrixWorld);var r=F.distanceTo(B),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(a[8]+1)/a[0],d=o*c,f=o*h,p=r/(-c+h),v=p*-c;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(v),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===i[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{var m=o+p,y=s+p,g=d-v,_=f+(r-v),b=l*s/y*m,x=u*s/y*m;e.projectionMatrix.makePerspective(g,_,b,x,m,y),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(R,P,k):R.projectionMatrix.copy(P.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*so*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,R,r)}},r.getCamera=function(){return R},r.getFoveation=function(){if(null!==m||null!==y)return d},r.setFoveation=function(e){d=e,null!==m&&(m.fixedFoveation=e),null!==y&&void 0!==y.fixedFoveation&&(y.fixedFoveation=e)},r.hasDepthSensing=function(){return null!==b.texture},r.getDepthSensingMesh=function(){return b.getMesh(R)},r.getCameraTexture=function(e){return x[e]};var j=null,H=new Ep;return H.setAnimationLoop((function(t,n){if(p=n.getViewerPose(f||c),g=n,null!==p){var r=p.views;null!==y&&(e.setRenderTargetFramebuffer(E,y.framebuffer),e.setRenderTarget(E));var i=!1;r.length!==R.cameras.length&&(R.cameras.length=0,i=!0);for(var a=0;a<r.length;a++){var o=r[a],u=null;if(null!==y)u=y.getViewport(o);else{var h=v.getViewSubImage(m,o);u=h.viewport,0===a&&(e.setRenderTargetTextures(E,h.colorTexture,h.depthStencilTexture),e.setRenderTarget(E))}var d=O[a];void 0===d&&((d=new ru).layers.enable(a),d.viewport=new Go,O[a]=d),d.matrix.fromArray(o.transform.matrix),d.matrix.decompose(d.position,d.quaternion,d.scale),d.projectionMatrix.fromArray(o.projectionMatrix),d.projectionMatrixInverse.copy(d.projectionMatrix).invert(),d.viewport.set(u.x,u.y,u.width,u.height),0===a&&(R.matrix.copy(d.matrix),R.matrix.decompose(R.position,R.quaternion,R.scale)),!0===i&&R.cameras.push(d)}var S=l.enabledFeatures;if(S&&S.includes("depth-sensing")&&"gpu-optimized"==l.depthUsage&&_){var w=(v=s.getBinding()).getDepthInformation(r[0]);w&&w.isValid&&w.texture&&b.init(w,l.renderState)}if(S&&S.includes("camera-access")&&_){e.state.unbindTexture(),v=s.getBinding();for(var C=0;C<r.length;C++){var A=r[C].camera;if(A){var P=x[A];P||(P=new rh,x[A]=P);var k=v.getCameraImage(A);P.sourceTexture=k}}}}for(var I=0;I<M.length;I++){var N=T[I],L=M[I];null!==N&&void 0!==L&&L.update(N,n,f||c)}j&&j(t,n),n.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:n}),g=null})),r.setAnimationLoop=function(e){j=e},r.dispose=function(){},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vp(e,t)}(t,e),Sp(t)}(ro),ey=new Os,ty=new xs;function ny(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,1===r.side&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),1===r.side&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);var i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,ey.copy(o),ey.x*=-1,ey.y*=-1,ey.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(ey.y*=-1,ey.z*=-1),e.envMapRotation.value.setFromMatrix4(ty.makeRotationFromEuler(ey)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,Jl(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,a,o,s){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),1===t.side&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,s)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){var r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,a,o):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function ry(e,t,n,r){var i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,n,r){var i=e.value,a=t+"_"+n;if(void 0===r[a])return r[a]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;var o=r[a];if("number"==typeof i||"boolean"==typeof i){if(o!==i)return r[a]=i,!0}else if(!1===o.equals(i))return o.copy(i),!0;return!1}function u(e){var t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function c(t){var n=t.target;n.removeEventListener("dispose",c);var r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(e,t){var n=t.program;r.uniformBlockBinding(e,n)},update:function(n,h){var d=i[n.id];void 0===d&&(function(e){for(var t=e.uniforms,n=0,r=0,i=t.length;r<i;r++)for(var a=Array.isArray(t[r])?t[r]:[t[r]],o=0,s=a.length;o<s;o++)for(var l=a[o],c=Array.isArray(l.value)?l.value:[l.value],h=0,d=c.length;h<d;h++){var f=u(c[h]),p=n%16,v=p%f.boundary,m=p+v;n+=v,0!==m&&16-m<f.storage&&(n+=16-m),l.__data=new Float32Array(f.storage/Float32Array.BYTES_PER_ELEMENT),l.__offset=n,n+=f.storage}var y=n%16;y>0&&(n+=16-y),e.__size=n,e.__cache={}}(n),d=function(t){var n=function(){for(var e=0;e<s;e++)if(-1===o.indexOf(e))return o.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;var r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=d,n.addEventListener("dispose",c));var f=h.program;r.updateUBOMapping(n,f);var p=t.render.frame;a[n.id]!==p&&(function(t){var n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(var o=0,s=r.length;o<s;o++)for(var c=Array.isArray(r[o])?r[o]:[r[o]],h=0,d=c.length;h<d;h++){var f=c[h];if(!0===l(f,o,h,a)){for(var p=f.__offset,v=Array.isArray(f.value)?f.value:[f.value],m=0,y=0;y<v.length;y++){var g=v[y],_=u(g);"number"==typeof g||"boolean"==typeof g?(f.__data[0]=g,e.bufferSubData(e.UNIFORM_BUFFER,p+m,f.__data)):g.isMatrix3?(f.__data[0]=g.elements[0],f.__data[1]=g.elements[1],f.__data[2]=g.elements[2],f.__data[3]=0,f.__data[4]=g.elements[3],f.__data[5]=g.elements[4],f.__data[6]=g.elements[5],f.__data[7]=0,f.__data[8]=g.elements[6],f.__data[9]=g.elements[7],f.__data[10]=g.elements[8],f.__data[11]=0):(g.toArray(f.__data,m),m+=_.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,p,f.__data)}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),a[n.id]=p)},dispose:function(){for(var t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}}}var iy=function(){return Sp((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};bp(this,e);var n,r=t.canvas,i=void 0===r?function(){var e=To("canvas");return e.style.display="block",e}():r,a=t.context,o=void 0===a?null:a,s=t.depth,l=void 0===s||s,u=t.stencil,c=void 0!==u&&u,h=t.alpha,d=void 0!==h&&h,f=t.antialias,p=void 0!==f&&f,v=t.premultipliedAlpha,m=void 0===v||v,y=t.preserveDrawingBuffer,g=void 0!==y&&y,_=t.powerPreference,b=void 0===_?"default":_,x=t.failIfMajorPerformanceCaveat,S=void 0!==x&&x,w=t.reversedDepthBuffer,E=void 0!==w&&w;if(this.isWebGLRenderer=!0,null!==o){if("undefined"!=typeof WebGLRenderingContext&&o instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");n=o.getContextAttributes().alpha}else n=d;var M=new Uint32Array(4),T=new Int32Array(4),C=null,A=null,P=[],k=[];this.domElement=i,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.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;var O=this,R=!1;this._outputColorSpace=Ya;var I=0,N=0,L=null,D=-1,U=null,F=new Go,B=new Go,z=null,j=new fl(0),H=0,V=i.width,G=i.height,W=1,X=null,q=null,Y=new Go(0,0,V,G),J=new Go(0,0,V,G),Z=!1,K=new dc,$=!1,Q=!1,ee=new xs,te=new go,ne=new Go,re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},ie=!1;function ae(){return null===L?W:1}var oe,se,le,ue,ce,he,de,fe,pe,ve,me,ye,ge,_e,be,xe,Se,we,Ee,Me,Te,Ce,Ae,Pe,ke=o;function Oe(e,t){return i.getContext(e,t)}try{var Re={alpha:!0,depth:l,stencil:c,antialias:p,premultipliedAlpha:m,preserveDrawingBuffer:g,powerPreference:b,failIfMajorPerformanceCaveat:S};if("setAttribute"in i&&i.setAttribute("data-engine","three.js r".concat(ki)),i.addEventListener("webglcontextlost",De,!1),i.addEventListener("webglcontextrestored",Ue,!1),i.addEventListener("webglcontextcreationerror",Fe,!1),null===ke){var Ie="webgl2";if(null===(ke=Oe(Ie,Re)))throw Oe(Ie)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function Ne(){(oe=new nv(ke)).init(),Ce=new Km(ke,oe),se=new Lp(ke,oe,t,Ce),le=new Jm(ke,oe),se.reversedDepthBuffer&&E&&le.buffers.depth.setReversed(!0),ue=new av(ke),ce=new Dm,he=new Zm(ke,oe,le,ce,se,Ce,ue),de=new Up(O),fe=new tv(O),pe=new Mp(ke),Ae=new Ip(ke,pe),ve=new rv(ke,pe,ue,Ae),me=new sv(ke,ve,pe,ue),Ee=new ov(ke,se,he),xe=new Dp(ce),ye=new Lm(O,de,fe,oe,se,Ae,xe),ge=new ny(O,ce),_e=new zm,be=new Xm(oe),we=new Rp(O,de,fe,le,me,n,m),Se=new qm(O,me,se),Pe=new ry(ke,ue,se,le),Me=new Np(ke,oe,ue),Te=new iv(ke,oe,ue),ue.programs=ye.programs,O.capabilities=se,O.extensions=oe,O.properties=ce,O.renderLists=_e,O.shadowMap=Se,O.state=le,O.info=ue}Ne();var Le=new Qm(O,ke);function De(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function Ue(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;var e=ue.autoReset,t=Se.enabled,n=Se.autoUpdate,r=Se.needsUpdate,i=Se.type;Ne(),ue.autoReset=e,Se.enabled=t,Se.autoUpdate=n,Se.needsUpdate=r,Se.type=i}function Fe(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function Be(e){var t=e.target;t.removeEventListener("dispose",Be),function(e){(function(e){var t=ce.get(e).programs;void 0!==t&&(t.forEach((function(e){ye.releaseProgram(e)})),e.isShaderMaterial&&ye.releaseShaderCache(e))})(e),ce.remove(e)}(t)}function ze(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,Ze(e,t,n),e.side=0,e.needsUpdate=!0,Ze(e,t,n),e.side=2):Ze(e,t,n)}this.xr=Le,this.getContext=function(){return ke},this.getContextAttributes=function(){return ke.getContextAttributes()},this.forceContextLoss=function(){var e=oe.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=oe.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return W},this.setPixelRatio=function(e){void 0!==e&&(W=e,this.setSize(V,G,!1))},this.getSize=function(e){return e.set(V,G)},this.setSize=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Le.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(V=e,G=t,i.width=Math.floor(e*W),i.height=Math.floor(t*W),!0===n&&(i.style.width=e+"px",i.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(V*W,G*W).floor()},this.setDrawingBufferSize=function(e,t,n){V=e,G=t,W=n,i.width=Math.floor(e*n),i.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(F)},this.getViewport=function(e){return e.copy(Y)},this.setViewport=function(e,t,n,r){e.isVector4?Y.set(e.x,e.y,e.z,e.w):Y.set(e,t,n,r),le.viewport(F.copy(Y).multiplyScalar(W).round())},this.getScissor=function(e){return e.copy(J)},this.setScissor=function(e,t,n,r){e.isVector4?J.set(e.x,e.y,e.z,e.w):J.set(e,t,n,r),le.scissor(B.copy(J).multiplyScalar(W).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(e){le.setScissorTest(Z=e)},this.setOpaqueSort=function(e){X=e},this.setTransparentSort=function(e){q=e},this.getClearColor=function(e){return e.copy(we.getClearColor())},this.setClearColor=function(){var e;(e=we).setClearColor.apply(e,arguments)},this.getClearAlpha=function(){return we.getClearAlpha()},this.setClearAlpha=function(){var e;(e=we).setClearAlpha.apply(e,arguments)},this.clear=function(){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=0;if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]){var r=!1;if(null!==L){var i=L.texture.format;r=i===la||i===sa||i===oa}if(r){var a=L.texture.type,o=a===qi||a===Zi||a===Yi||a===ta||a===Qi||a===ea,s=we.getClearColor(),l=we.getClearAlpha(),u=s.r,c=s.g,h=s.b;o?(M[0]=u,M[1]=c,M[2]=h,M[3]=l,ke.clearBufferuiv(ke.COLOR,0,M)):(T[0]=u,T[1]=c,T[2]=h,T[3]=l,ke.clearBufferiv(ke.COLOR,0,T))}else n|=ke.COLOR_BUFFER_BIT}e&&(n|=ke.DEPTH_BUFFER_BIT),t&&(n|=ke.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ke.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){i.removeEventListener("webglcontextlost",De,!1),i.removeEventListener("webglcontextrestored",Ue,!1),i.removeEventListener("webglcontextcreationerror",Fe,!1),we.dispose(),_e.dispose(),be.dispose(),ce.dispose(),de.dispose(),fe.dispose(),me.dispose(),Ae.dispose(),Pe.dispose(),ye.dispose(),Le.dispose(),Le.removeEventListener("sessionstart",He),Le.removeEventListener("sessionend",Ve),Ge.stop()},this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=re);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=function(e,t,n,r,i){!0!==t.isScene&&(t=re),he.resetTextureUnits();var a=t.fog,o=r.isMeshStandardMaterial?t.environment:null,s=null===L?O.outputColorSpace:!0===L.isXRRenderTarget?L.texture.colorSpace:Ja,l=(r.isMeshStandardMaterial?fe:de).get(r.envMap||o),u=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),h=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,f=!!n.morphAttributes.color,p=0;r.toneMapped&&(null!==L&&!0!==L.isXRRenderTarget||(p=O.toneMapping));var v=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,m=void 0!==v?v.length:0,y=ce.get(r),g=A.state.lights;if(!0===$&&(!0===Q||e!==U)){var _=e===U&&r.id===D;xe.setState(r,e,_)}var b=!1;r.version===y.__version?y.needsLights&&y.lightsStateVersion!==g.state.version||y.outputColorSpace!==s||i.isBatchedMesh&&!1===y.batching?b=!0:i.isBatchedMesh||!0!==y.batching?i.isBatchedMesh&&!0===y.batchingColor&&null===i.colorTexture||i.isBatchedMesh&&!1===y.batchingColor&&null!==i.colorTexture||i.isInstancedMesh&&!1===y.instancing?b=!0:i.isInstancedMesh||!0!==y.instancing?i.isSkinnedMesh&&!1===y.skinning?b=!0:i.isSkinnedMesh||!0!==y.skinning?i.isInstancedMesh&&!0===y.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===y.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===y.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===y.instancingMorph&&null!==i.morphTexture||y.envMap!==l||!0===r.fog&&y.fog!==a?b=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===xe.numPlanes&&y.numIntersection===xe.numIntersection?(y.vertexAlphas!==u||y.vertexTangents!==c||y.morphTargets!==h||y.morphNormals!==d||y.morphColors!==f||y.toneMapping!==p||y.morphTargetsCount!==m)&&(b=!0):b=!0:b=!0:b=!0:b=!0:(b=!0,y.__version=r.version);var x=y.currentProgram;!0===b&&(x=Ze(r,t,i));var S=!1,w=!1,E=!1,M=x.getUniforms(),T=y.uniforms;if(le.useProgram(x.program)&&(S=!0,w=!0,E=!0),r.id!==D&&(D=r.id,w=!0),S||U!==e){le.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),M.setValue(ke,"projectionMatrix",e.projectionMatrix),M.setValue(ke,"viewMatrix",e.matrixWorldInverse);var C=M.map.cameraPosition;void 0!==C&&C.setValue(ke,te.setFromMatrixPosition(e.matrixWorld)),se.logarithmicDepthBuffer&&M.setValue(ke,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&M.setValue(ke,"isOrthographic",!0===e.isOrthographicCamera),U!==e&&(U=e,w=!0,E=!0)}if(i.isSkinnedMesh){M.setOptional(ke,i,"bindMatrix"),M.setOptional(ke,i,"bindMatrixInverse");var P=i.skeleton;P&&(null===P.boneTexture&&P.computeBoneTexture(),M.setValue(ke,"boneTexture",P.boneTexture,he))}i.isBatchedMesh&&(M.setOptional(ke,i,"batchingTexture"),M.setValue(ke,"batchingTexture",i._matricesTexture,he),M.setOptional(ke,i,"batchingIdTexture"),M.setValue(ke,"batchingIdTexture",i._indirectTexture,he),M.setOptional(ke,i,"batchingColorTexture"),null!==i._colorsTexture&&M.setValue(ke,"batchingColorTexture",i._colorsTexture,he));var k=n.morphAttributes;if(void 0===k.position&&void 0===k.normal&&void 0===k.color||Ee.update(i,n,x),(w||y.receiveShadow!==i.receiveShadow)&&(y.receiveShadow=i.receiveShadow,M.setValue(ke,"receiveShadow",i.receiveShadow)),r.isMeshGouraudMaterial&&null!==r.envMap&&(T.envMap.value=l,T.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),r.isMeshStandardMaterial&&null===r.envMap&&null!==t.environment&&(T.envMapIntensity.value=t.environmentIntensity),w&&(M.setValue(ke,"toneMappingExposure",O.toneMappingExposure),y.needsLights&&function(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(T,E),a&&!0===r.fog&&ge.refreshFogUniforms(T,a),ge.refreshMaterialUniforms(T,r,W,G,A.state.transmissionRenderTarget[e.id]),dm.upload(ke,Ke(y),T,he)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(dm.upload(ke,Ke(y),T,he),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&M.setValue(ke,"center",i.center),M.setValue(ke,"modelViewMatrix",i.modelViewMatrix),M.setValue(ke,"normalMatrix",i.normalMatrix),M.setValue(ke,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial)for(var R=r.uniformsGroups,I=0,N=R.length;I<N;I++){var F=R[I];Pe.update(F,x),Pe.bind(F,x)}return x}(e,t,n,r,i);le.setMaterial(r,o);var l=n.index,u=1;if(!0===r.wireframe){if(void 0===(l=ve.getWireframeAttribute(n)))return;u=2}var c=n.drawRange,h=n.attributes.position,d=c.start*u,f=(c.start+c.count)*u;null!==a&&(d=Math.max(d,a.start*u),f=Math.min(f,(a.start+a.count)*u)),null!==l?(d=Math.max(d,0),f=Math.min(f,l.count)):null!=h&&(d=Math.max(d,0),f=Math.min(f,h.count));var p=f-d;if(!(p<0||p===1/0)){var v;Ae.setup(i,r,s,n,l);var m=Me;if(null!==l&&(v=pe.get(l),(m=Te).setIndex(v)),i.isMesh)!0===r.wireframe?(le.setLineWidth(r.wireframeLinewidth*ae()),m.setMode(ke.LINES)):m.setMode(ke.TRIANGLES);else if(i.isLine){var y=r.linewidth;void 0===y&&(y=1),le.setLineWidth(y*ae()),i.isLineSegments?m.setMode(ke.LINES):i.isLineLoop?m.setMode(ke.LINE_LOOP):m.setMode(ke.LINE_STRIP)}else i.isPoints?m.setMode(ke.POINTS):i.isSprite&&m.setMode(ke.TRIANGLES);if(i.isBatchedMesh)if(null!==i._multiDrawInstances)Ao("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),m.renderMultiDrawInstances(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount,i._multiDrawInstances);else if(oe.get("WEBGL_multi_draw"))m.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else for(var g=i._multiDrawStarts,_=i._multiDrawCounts,b=i._multiDrawCount,x=l?pe.get(l).bytesPerElement:1,S=ce.get(r).currentProgram.getUniforms(),w=0;w<b;w++)S.setValue(ke,"_gl_DrawID",w),m.render(g[w]/x,_[w]);else if(i.isInstancedMesh)m.renderInstances(d,p,i.count);else if(n.isInstancedBufferGeometry){var E=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,M=Math.min(n.instanceCount,E);m.renderInstances(d,p,M)}else m.render(d,p)}},this.compile=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=e),(A=be.get(n)).init(t),k.push(A),n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(A.pushLight(e),e.castShadow&&A.pushShadow(e))})),e!==n&&e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(A.pushLight(e),e.castShadow&&A.pushShadow(e))})),A.setupLights();var r=new Set;return e.traverse((function(e){if(e.isMesh||e.isPoints||e.isLine||e.isSprite){var t=e.material;if(t)if(Array.isArray(t))for(var i=0;i<t.length;i++){var a=t[i];ze(a,n,e),r.add(a)}else ze(t,n,e),r.add(t)}})),A=k.pop(),r},this.compileAsync=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.compile(e,t,n);return new Promise((function(t){function n(){r.forEach((function(e){ce.get(e).currentProgram.isReady()&&r.delete(e)})),0!==r.size?setTimeout(n,10):t(e)}null!==oe.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};var je=null;function He(){Ge.stop()}function Ve(){Ge.start()}var Ge=new Ep;function We(e,t,n,r){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)A.pushLight(e),e.castShadow&&A.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||K.intersectsSprite(e)){r&&ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ee);var i=me.update(e),a=e.material;a.visible&&C.push(e,i,a,n,ne.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||K.intersectsObject(e))){var o=me.update(e),s=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),ne.copy(e.boundingSphere.center)):(null===o.boundingSphere&&o.computeBoundingSphere(),ne.copy(o.boundingSphere.center)),ne.applyMatrix4(e.matrixWorld).applyMatrix4(ee)),Array.isArray(s))for(var l=o.groups,u=0,c=l.length;u<c;u++){var h=l[u],d=s[h.materialIndex];d&&d.visible&&C.push(e,o,d,n,ne.z,h)}else s.visible&&C.push(e,o,s,n,ne.z,null)}for(var f=e.children,p=0,v=f.length;p<v;p++)We(f[p],t,n,r)}}function Xe(e,t,n,r){var i=e.opaque,a=e.transmissive,o=e.transparent;A.setupLightsView(n),!0===$&&xe.setGlobalState(O.clippingPlanes,n),r&&le.viewport(F.copy(r)),i.length>0&&Ye(i,t,n),a.length>0&&Ye(a,t,n),o.length>0&&Ye(o,t,n),le.buffers.depth.setTest(!0),le.buffers.depth.setMask(!0),le.buffers.color.setMask(!0),le.setPolygonOffset(!1)}function qe(e,t,n,r){if(null===(!0===n.isScene?n.overrideMaterial:null)){void 0===A.state.transmissionRenderTarget[r.id]&&(A.state.transmissionRenderTarget[r.id]=new Wo(1,1,{generateMipmaps:!0,type:oe.has("EXT_color_buffer_half_float")||oe.has("EXT_color_buffer_float")?$i:qi,minFilter:Xi,samples:4,stencilBuffer:c,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:No.workingColorSpace}));var i=A.state.transmissionRenderTarget[r.id],a=r.viewport||F;i.setSize(a.z*O.transmissionResolutionScale,a.w*O.transmissionResolutionScale);var o=O.getRenderTarget(),s=O.getActiveCubeFace(),l=O.getActiveMipmapLevel();O.setRenderTarget(i),O.getClearColor(j),(H=O.getClearAlpha())<1&&O.setClearColor(16777215,.5),O.clear(),ie&&we.render(n);var u=O.toneMapping;O.toneMapping=0;var h=r.viewport;if(void 0!==r.viewport&&(r.viewport=void 0),A.setupLightsView(r),!0===$&&xe.setGlobalState(O.clippingPlanes,r),Ye(e,n,r),he.updateMultisampleRenderTarget(i),he.updateRenderTargetMipmap(i),!1===oe.has("WEBGL_multisampled_render_to_texture")){for(var d=!1,f=0,p=t.length;f<p;f++){var v=t[f],m=v.object,y=v.geometry,g=v.material,_=v.group;if(2===g.side&&m.layers.test(r.layers)){var b=g.side;g.side=1,g.needsUpdate=!0,Je(m,n,r,y,g,_),g.side=b,g.needsUpdate=!0,d=!0}}!0===d&&(he.updateMultisampleRenderTarget(i),he.updateRenderTargetMipmap(i))}O.setRenderTarget(o,s,l),O.setClearColor(j,H),void 0!==h&&(r.viewport=h),O.toneMapping=u}}function Ye(e,t,n){for(var r=!0===t.isScene?t.overrideMaterial:null,i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,l=o.geometry,u=o.group,c=o.material;!0===c.allowOverride&&null!==r&&(c=r),s.layers.test(n.layers)&&Je(s,t,n,l,c,u)}}function Je(e,t,n,r,i,a){e.onBeforeRender(O,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(O,t,n,r,e,a),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=1,i.needsUpdate=!0,O.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,O.renderBufferDirect(n,t,r,i,e,a),i.side=2):O.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(O,t,n,r,i,a)}function Ze(e,t,n){!0!==t.isScene&&(t=re);var r=ce.get(e),i=A.state.lights,a=A.state.shadowsArray,o=i.state.version,s=ye.getParameters(e,i.state,a,t,n),l=ye.getProgramCacheKey(s),u=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?fe:de).get(e.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===u&&(e.addEventListener("dispose",Be),u=new Map,r.programs=u);var c=u.get(l);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===o)return $e(e,s),c}else s.uniforms=ye.getUniforms(e),e.onBeforeCompile(s,O),c=ye.acquireProgram(s,l),u.set(l,c),r.uniforms=s.uniforms;var h=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(h.clippingPlanes=xe.uniform),$e(e,s),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=o,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotLightMatrix.value=i.state.spotLightMatrix,h.spotLightMap.value=i.state.spotLightMap,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=c,r.uniformsList=null,c}function Ke(e){if(null===e.uniformsList){var t=e.currentProgram.getUniforms();e.uniformsList=dm.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function $e(e,t){var n=ce.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}Ge.setAnimationLoop((function(e){je&&je(e)})),"undefined"!=typeof self&&Ge.setContext(self),this.setAnimationLoop=function(e){je=e,Le.setAnimationLoop(e),null===e?Ge.stop():Ge.start()},Le.addEventListener("sessionstart",He),Le.addEventListener("sessionend",Ve),this.render=function(e,t){if(void 0===t||!0===t.isCamera){if(!0!==R){if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===Le.enabled&&!0===Le.isPresenting&&(!0===Le.cameraAutoUpdate&&Le.updateCamera(t),t=Le.getCamera()),!0===e.isScene&&e.onBeforeRender(O,e,t,L),(A=be.get(e,k.length)).init(t),k.push(A),ee.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),K.setFromProjectionMatrix(ee,to,t.reversedDepth),Q=this.localClippingEnabled,$=xe.init(this.clippingPlanes,Q),(C=_e.get(e,P.length)).init(),P.push(C),!0===Le.enabled&&!0===Le.isPresenting){var n=O.xr.getDepthSensingMesh();null!==n&&We(n,t,-1/0,O.sortObjects)}We(e,t,0,O.sortObjects),C.finish(),!0===O.sortObjects&&C.sort(X,q),(ie=!1===Le.enabled||!1===Le.isPresenting||!1===Le.hasDepthSensing())&&we.addToRenderList(C,e),this.info.render.frame++,!0===$&&xe.beginShadows();var r=A.state.shadowsArray;Se.render(r,e,t),!0===$&&xe.endShadows(),!0===this.info.autoReset&&this.info.reset();var i=C.opaque,a=C.transmissive;if(A.setupLights(),t.isArrayCamera){var o=t.cameras;if(a.length>0)for(var s=0,l=o.length;s<l;s++)qe(i,a,e,o[s]);ie&&we.render(e);for(var u=0,c=o.length;u<c;u++){var h=o[u];Xe(C,e,h,h.viewport)}}else a.length>0&&qe(i,a,e,t),ie&&we.render(e),Xe(C,e,t);null!==L&&0===N&&(he.updateMultisampleRenderTarget(L),he.updateRenderTargetMipmap(L)),!0===e.isScene&&e.onAfterRender(O,e,t),Ae.resetDefaultState(),D=-1,U=null,k.pop(),k.length>0?(A=k[k.length-1],!0===$&&xe.setGlobalState(O.clippingPlanes,A.state.camera)):A=null,P.pop(),C=P.length>0?P[P.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.getActiveCubeFace=function(){return I},this.getActiveMipmapLevel=function(){return N},this.getRenderTarget=function(){return L},this.setRenderTargetTextures=function(e,t,n){var r=ce.get(e);r.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===r.__autoAllocateDepthBuffer&&(r.__useRenderToTexture=!1),ce.get(e.texture).__webglTexture=t,ce.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){var n=ce.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t};var Qe=ke.createFramebuffer();this.setRenderTarget=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;L=e,I=t,N=n;var r=!0,i=null,a=!1,o=!1;if(e){var s=ce.get(e);if(void 0!==s.__useDefaultFramebuffer)le.bindFramebuffer(ke.FRAMEBUFFER,null),r=!1;else if(void 0===s.__webglFramebuffer)he.setupRenderTarget(e);else if(s.__hasExternalTextures)he.rebindTextures(e,ce.get(e.texture).__webglTexture,ce.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){var l=e.depthTexture;if(s.__boundDepthTexture!==l){if(null!==l&&ce.has(l)&&(e.width!==l.image.width||e.height!==l.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");he.setupDepthRenderbuffer(e)}}var u=e.texture;(u.isData3DTexture||u.isDataArrayTexture||u.isCompressedArrayTexture)&&(o=!0);var c=ce.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(c[t])?c[t][n]:c[t],a=!0):i=e.samples>0&&!1===he.useMultisampledRTT(e)?ce.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,F.copy(e.viewport),B.copy(e.scissor),z=e.scissorTest}else F.copy(Y).multiplyScalar(W).floor(),B.copy(J).multiplyScalar(W).floor(),z=Z;if(0!==n&&(i=Qe),le.bindFramebuffer(ke.FRAMEBUFFER,i)&&r&&le.drawBuffers(e,i),le.viewport(F),le.scissor(B),le.setScissorTest(z),a){var h=ce.get(e.texture);ke.framebufferTexture2D(ke.FRAMEBUFFER,ke.COLOR_ATTACHMENT0,ke.TEXTURE_CUBE_MAP_POSITIVE_X+t,h.__webglTexture,n)}else if(o)for(var d=t,f=0;f<e.textures.length;f++){var p=ce.get(e.textures[f]);ke.framebufferTextureLayer(ke.FRAMEBUFFER,ke.COLOR_ATTACHMENT0+f,p.__webglTexture,n,d)}else if(null!==e&&0!==n){var v=ce.get(e.texture);ke.framebufferTexture2D(ke.FRAMEBUFFER,ke.COLOR_ATTACHMENT0,ke.TEXTURE_2D,v.__webglTexture,n)}D=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;if(e&&e.isWebGLRenderTarget){var l=ce.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(l=l[o]),l){le.bindFramebuffer(ke.FRAMEBUFFER,l);try{var u=e.textures[s],c=u.format,h=u.type;if(!se.textureFormatReadable(c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!se.textureTypeReadable(h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&(e.textures.length>1&&ke.readBuffer(ke.COLOR_ATTACHMENT0+s),ke.readPixels(t,n,r,i,Ce.convert(c),Ce.convert(h),a))}finally{var d=null!==L?ce.get(L).__webglFramebuffer:null;le.bindFramebuffer(ke.FRAMEBUFFER,d)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.readRenderTargetPixelsAsync=function(){var e=dp(up().m((function e(t,n,r,i,a,o,s){var l,u,c,h,d,f,p,v,m=arguments;return up().w((function(e){for(;;)switch(e.n){case 0:if(l=m.length>7&&void 0!==m[7]?m[7]:0,t&&t.isWebGLRenderTarget){e.n=1;break}throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");case 1:if(u=ce.get(t).__webglFramebuffer,t.isWebGLCubeRenderTarget&&void 0!==s&&(u=u[s]),!u){e.n=6;break}if(!(n>=0&&n<=t.width-i&&r>=0&&r<=t.height-a)){e.n=5;break}if(le.bindFramebuffer(ke.FRAMEBUFFER,u),c=t.textures[l],h=c.format,d=c.type,se.textureFormatReadable(h)){e.n=2;break}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");case 2:if(se.textureTypeReadable(d)){e.n=3;break}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");case 3:return f=ke.createBuffer(),ke.bindBuffer(ke.PIXEL_PACK_BUFFER,f),ke.bufferData(ke.PIXEL_PACK_BUFFER,o.byteLength,ke.STREAM_READ),t.textures.length>1&&ke.readBuffer(ke.COLOR_ATTACHMENT0+l),ke.readPixels(n,r,i,a,Ce.convert(h),Ce.convert(d),0),p=null!==L?ce.get(L).__webglFramebuffer:null,le.bindFramebuffer(ke.FRAMEBUFFER,p),v=ke.fenceSync(ke.SYNC_GPU_COMMANDS_COMPLETE,0),ke.flush(),e.n=4,Po(ke,v,4);case 4:return ke.bindBuffer(ke.PIXEL_PACK_BUFFER,f),ke.getBufferSubData(ke.PIXEL_PACK_BUFFER,0,o),ke.deleteBuffer(f),ke.deleteSync(v),e.a(2,o);case 5:throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");case 6:return e.a(2)}}),e)})));return function(t,n,r,i,a,o,s){return e.apply(this,arguments)}}(),this.copyFramebufferToTexture=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=null!==t?t.x:0,s=null!==t?t.y:0;he.setTexture2D(e,0),ke.copyTexSubImage2D(ke.TEXTURE_2D,n,0,0,o,s,i,a),le.unbindTexture()};var et=ke.createFramebuffer(),tt=ke.createFramebuffer();this.copyTextureToTexture=function(e,t){var n,r,i,a,o,s,l,u,c,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,p=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;null===p&&(0!==f?(Ao("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),p=f,f=0):p=0);var v=e.isCompressedTexture?e.mipmaps[p]:e.image;if(null!==h)n=h.max.x-h.min.x,r=h.max.y-h.min.y,i=h.isBox3?h.max.z-h.min.z:1,a=h.min.x,o=h.min.y,s=h.isBox3?h.min.z:0;else{var m=Math.pow(2,-f);n=Math.floor(v.width*m),r=Math.floor(v.height*m),i=e.isDataArrayTexture?v.depth:e.isData3DTexture?Math.floor(v.depth*m):1,a=0,o=0,s=0}null!==d?(l=d.x,u=d.y,c=d.z):(l=0,u=0,c=0);var y,g=Ce.convert(t.format),_=Ce.convert(t.type);t.isData3DTexture?(he.setTexture3D(t,0),y=ke.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(he.setTexture2DArray(t,0),y=ke.TEXTURE_2D_ARRAY):(he.setTexture2D(t,0),y=ke.TEXTURE_2D),ke.pixelStorei(ke.UNPACK_FLIP_Y_WEBGL,t.flipY),ke.pixelStorei(ke.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ke.pixelStorei(ke.UNPACK_ALIGNMENT,t.unpackAlignment);var b=ke.getParameter(ke.UNPACK_ROW_LENGTH),x=ke.getParameter(ke.UNPACK_IMAGE_HEIGHT),S=ke.getParameter(ke.UNPACK_SKIP_PIXELS),w=ke.getParameter(ke.UNPACK_SKIP_ROWS),E=ke.getParameter(ke.UNPACK_SKIP_IMAGES);ke.pixelStorei(ke.UNPACK_ROW_LENGTH,v.width),ke.pixelStorei(ke.UNPACK_IMAGE_HEIGHT,v.height),ke.pixelStorei(ke.UNPACK_SKIP_PIXELS,a),ke.pixelStorei(ke.UNPACK_SKIP_ROWS,o),ke.pixelStorei(ke.UNPACK_SKIP_IMAGES,s);var M=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){var C=ce.get(e),A=ce.get(t),P=ce.get(C.__renderTarget),k=ce.get(A.__renderTarget);le.bindFramebuffer(ke.READ_FRAMEBUFFER,P.__webglFramebuffer),le.bindFramebuffer(ke.DRAW_FRAMEBUFFER,k.__webglFramebuffer);for(var O=0;O<i;O++)M&&(ke.framebufferTextureLayer(ke.READ_FRAMEBUFFER,ke.COLOR_ATTACHMENT0,ce.get(e).__webglTexture,f,s+O),ke.framebufferTextureLayer(ke.DRAW_FRAMEBUFFER,ke.COLOR_ATTACHMENT0,ce.get(t).__webglTexture,p,c+O)),ke.blitFramebuffer(a,o,n,r,l,u,n,r,ke.DEPTH_BUFFER_BIT,ke.NEAREST);le.bindFramebuffer(ke.READ_FRAMEBUFFER,null),le.bindFramebuffer(ke.DRAW_FRAMEBUFFER,null)}else if(0!==f||e.isRenderTargetTexture||ce.has(e)){var R=ce.get(e),I=ce.get(t);le.bindFramebuffer(ke.READ_FRAMEBUFFER,et),le.bindFramebuffer(ke.DRAW_FRAMEBUFFER,tt);for(var N=0;N<i;N++)M?ke.framebufferTextureLayer(ke.READ_FRAMEBUFFER,ke.COLOR_ATTACHMENT0,R.__webglTexture,f,s+N):ke.framebufferTexture2D(ke.READ_FRAMEBUFFER,ke.COLOR_ATTACHMENT0,ke.TEXTURE_2D,R.__webglTexture,f),T?ke.framebufferTextureLayer(ke.DRAW_FRAMEBUFFER,ke.COLOR_ATTACHMENT0,I.__webglTexture,p,c+N):ke.framebufferTexture2D(ke.DRAW_FRAMEBUFFER,ke.COLOR_ATTACHMENT0,ke.TEXTURE_2D,I.__webglTexture,p),0!==f?ke.blitFramebuffer(a,o,n,r,l,u,n,r,ke.COLOR_BUFFER_BIT,ke.NEAREST):T?ke.copyTexSubImage3D(y,p,l,u,c+N,a,o,n,r):ke.copyTexSubImage2D(y,p,l,u,a,o,n,r);le.bindFramebuffer(ke.READ_FRAMEBUFFER,null),le.bindFramebuffer(ke.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?ke.texSubImage3D(y,p,l,u,c,n,r,i,g,_,v.data):t.isCompressedArrayTexture?ke.compressedTexSubImage3D(y,p,l,u,c,n,r,i,g,v.data):ke.texSubImage3D(y,p,l,u,c,n,r,i,g,_,v):e.isDataTexture?ke.texSubImage2D(ke.TEXTURE_2D,p,l,u,n,r,g,_,v.data):e.isCompressedTexture?ke.compressedTexSubImage2D(ke.TEXTURE_2D,p,l,u,v.width,v.height,g,v.data):ke.texSubImage2D(ke.TEXTURE_2D,p,l,u,n,r,g,_,v);ke.pixelStorei(ke.UNPACK_ROW_LENGTH,b),ke.pixelStorei(ke.UNPACK_IMAGE_HEIGHT,x),ke.pixelStorei(ke.UNPACK_SKIP_PIXELS,S),ke.pixelStorei(ke.UNPACK_SKIP_ROWS,w),ke.pixelStorei(ke.UNPACK_SKIP_IMAGES,E),0===p&&t.generateMipmaps&&ke.generateMipmap(y),le.unbindTexture()},this.initRenderTarget=function(e){void 0===ce.get(e).__webglFramebuffer&&he.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?he.setTextureCube(e,0):e.isData3DTexture?he.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?he.setTexture2DArray(e,0):he.setTexture2D(e,0),le.unbindTexture()},this.resetState=function(){I=0,N=0,L=null,le.reset(),Ae.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}),[{key:"coordinateSystem",get:function(){return to}},{key:"outputColorSpace",get:function(){return this._outputColorSpace},set:function(e){this._outputColorSpace=e;var t=this.getContext();t.drawingBufferColorSpace=No._getDrawingBufferColorSpace(e),t.unpackColorSpace=No._getUnpackColorSpace()}}])}();function ay(e){return ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ay(e)}function oy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sy(r.key),r)}}function sy(e){var t=function(e){if("object"!=ay(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ay(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ay(t)?t:t+""}function ly(e){var t="function"==typeof Map?new Map:void 0;return ly=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(uy())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&cy(i,n.prototype),i}(e,arguments,hy(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),cy(n,e)},ly(e)}function uy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uy=function(){return!!e})()}function cy(e,t){return cy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cy(e,t)}function hy(e){return hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hy(e)}var dy=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=hy(t),function(e,t){if(t&&("object"==ay(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,uy()?Reflect.construct(t,n||[],hy(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cy(e,t)}(t,e),n=t,(r=[{key:"connectedCallback",value:function(){this.webGLRenderer=new iy({alpha:!0})}}])&&oy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ly(HTMLElement));function fy(e){return fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fy(e)}function py(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,yy(r.key),r)}}function my(e,t,n){return t&&vy(e.prototype,t),n&&vy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yy(e){var t=function(e){if("object"!=fy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fy(t)?t:t+""}function gy(e,t,n){return t=wy(t),function(e,t){if(t&&("object"==fy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _y(e)}(e,by()?Reflect.construct(t,n||[],wy(e).constructor):t.apply(e,n))}function _y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function by(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(by=function(){return!!e})()}function xy(e,t,n,r){var i=Sy(wy(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Sy(){return Sy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=wy(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Sy.apply(null,arguments)}function wy(e){return wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wy(e)}function Ey(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&My(e,t)}function My(e,t){return My=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},My(e,t)}window.customElements.define("avs-renderer",dy);var Ty=new go,Cy=function(e){function t(){var e;return py(this,t),(e=gy(this,t)).scaleFactorX=1,e.scaleFactorY=1,e.scaleFactorZ=1,e}return Ey(t,e),my(t,[{key:"updateMatrix",value:function(){Ty.set(this.scale.x*this.scaleFactorX,this.scale.y*this.scaleFactorY,this.scale.z*this.scaleFactorZ),this.matrix.compose(this.position,this.quaternion,Ty),this.matrixWorldNeedsUpdate=!0}},{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return"{}"!==JSON.stringify(this.internalData)&&(n.object.internalData=this.internalData),n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),n}}])}(lu),Ay=new go,Py=new go,ky=function(e){function t(e,n){var r;return py(this,t),(r=gy(this,t,[e,n])).scaleFactorX=1,r.scaleFactorY=1,r.scaleFactorZ=1,r}return Ey(t,e),my(t,[{key:"updateMatrix",value:function(){Py.set(this.scale.x*this.scaleFactorX,this.scale.y*this.scaleFactorY,this.scale.z*this.scaleFactorZ),this.matrix.compose(this.position,this.quaternion,Py),this.matrixWorldNeedsUpdate=!0}},{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),n}},{key:"raycast",value:function(e,t){var n,r,i,a,o,s,l=this.geometry.attributes,u=l.position.array,c=.5;void 0===this.material.vertexSizes&&(c=this.material.size/2);for(var h=0,d=u.length/3;h<d;h++)Ay.fromArray(u,3*h),Ay.applyMatrix4(this.matrixWorld),Ay.project(e.camera),n=(Ay.x+1)/2*e.landscapeWidth,r=(1-(Ay.y+1)/2)*e.landscapeHeight,this.material.vertexSizes&&(c=l.vsize.array[h]/2),i=n-c,a=n+c,o=r-c,s=r+c,e.x>=i&&e.x<=a&&e.y>=o&&e.y<=s&&t.push({distance:null,distanceToRay:null,point:null,index:h,face:null,object:this})}}])}(eh),Oy=new go,Ry=function(e){function t(e,n){var r;return py(this,t),(r=gy(this,t,[e,n])).scaleFactorX=1,r.scaleFactorY=1,r.scaleFactorZ=1,r}return Ey(t,e),my(t,[{key:"updateMatrix",value:function(){Oy.set(this.scale.x*this.scaleFactorX,this.scale.y*this.scaleFactorY,this.scale.z*this.scaleFactorZ),this.matrix.compose(this.position,this.quaternion,Oy),this.matrixWorldNeedsUpdate=!0}},{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),n}}])}(qc),Iy=new xs,Ny=new xs,Ly=new xs,Dy=[],Uy=new Gl,Fy=new go,By=function(e){function t(e,n){var r;return py(this,t),(r=gy(this,t,[e,n])).scaleFactorX=1,r.scaleFactorY=1,r.scaleFactorZ=1,r}return Ey(t,e),my(t,[{key:"updateMatrix",value:function(){Fy.set(this.scale.x*this.scaleFactorX,this.scale.y*this.scaleFactorY,this.scale.z*this.scaleFactorZ),this.matrix.compose(this.position,this.quaternion,Fy),this.matrixWorldNeedsUpdate=!0}},{key:"raycast",value:function(e,n){if(Uy.geometry=this.geometry,Uy.material=this.material,void 0!==Uy.material&&void 0!==Uy.geometry){if(!Uy.material.glyphs)return xy(t,"raycast",this,3)([e,n]);for(var r,i,a,o=this.matrixWorld,s=Uy.geometry.attributes.glyphOffset.array,l=s.length/3,u=0;u<l;u++){if(r=3*u,Uy.material.vertexGlyphScales?(i=Uy.geometry.attributes.glyphScale.array,Iy.makeScale(i[r],i[r+1],i[r+2])):Iy.makeScale(Uy.material.glyphScale.x,Uy.material.glyphScale.y,Uy.material.glyphScale.z),Uy.material.vertexGlyphOrientations&&(a=Uy.geometry.attributes.glyphOrientation.array,Ly.set(a[r],a[r+3],a[r+6],0,a[r+1],a[r+4],a[r+7],0,a[r+2],a[r+5],a[r+8],0,0,0,0,1),Iy.multiply(Ly)),Iy.setPosition(s[r],s[r+1],s[r+2]),Ny.multiplyMatrices(o,Iy),Uy.matrixWorld=Ny,Uy.raycast(e,Dy),Dy.length>0){var c=Dy[0];c.faceIndex=u,c.object=this,n.push(c)}Dy.length=0}}}},{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),n}}])}(Gl),zy=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.PI;return py(this,t),gy(this,t,[e,n])}return Ey(t,e),my(t,[{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),16777215===this.color.getHex()&&(n.object.color=void 0),this.intensity===Math.PI&&(n.object.intensity=void 0),n.object.shadow=void 0,n}}])}(Tf),jy=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.PI;return py(this,t),gy(this,t,[e,n])}return Ey(t,e),my(t,[{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),16777215===this.color.getHex()&&(n.object.color=void 0),this.intensity===Math.PI&&(n.object.intensity=void 0),n.object.shadow=void 0,n}}])}(Pf),Hy=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.PI;return py(this,t),gy(this,t,[e,n])}return Ey(t,e),my(t,[{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),16777215===this.color.getHex()&&(n.object.color=void 0),this.intensity===Math.PI&&(n.object.intensity=void 0),n}}])}(kf),Vy=function(e){function t(e,n,r,i,a,o){var s;return py(this,t),(s=gy(this,t,[e,n,r,i,a,o])).keepAspectRatio=!1,s.origLeft=e,s.origRight=n,s.origTop=r,s.origBottom=i,s}return Ey(t,e),my(t,[{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),1===this.zoom&&(n.object.zoom=void 0),-1===this.left&&(n.object.left=void 0),1===this.right&&(n.object.right=void 0),1===this.top&&(n.object.top=void 0),-1===this.bottom&&(n.object.bottom=void 0),.1===this.near&&(n.object.near=void 0),2e3===this.far&&(n.object.far=void 0),this.keepAspectRatio&&(n.object.keepAspectRatio=!0),n}}])}(Cf),Gy=function(e){function t(){return py(this,t),gy(this,t,arguments)}return Ey(t,e),my(t,[{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),50===this.fov&&(n.object.fov=void 0),1===this.zoom&&(n.object.zoom=void 0),.1===this.near&&(n.object.near=void 0),2e3===this.far&&(n.object.far=void 0),10===this.focus&&(n.object.focus=void 0),1===this.aspect&&(n.object.aspect=void 0),35===this.filmGauge&&(n.object.filmGauge=void 0),0===this.filmOffset&&(n.object.filmOffset=void 0),n}}])}(ru),Wy=function(e){function t(){return py(this,t),gy(this,t,arguments)}return Ey(t,e),my(t,[{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.metadata=void 0,1===this.layers.mask&&(n.object.layers=void 0),this.matrix.equals(new xs)&&(n.object.matrix=void 0),n}}])}(fu),Xy=function(e){function t(e){var n;return py(this,t),n=gy(this,t),Object.defineProperties(_y(n),{pickState:{get:function(){return this.uniforms.pickState.value},set:function(e){this.uniforms.pickState.value=e}},startCell:{get:function(){return this.uniforms.startCell.value},set:function(e){this.uniforms.startCell.value=e}},glyphs:{get:function(){return this.defines.GLYPH},set:function(e){this.defines.GLYPH=e}},glyphScale:{get:function(){return this.uniforms.uGlyphScale.value},set:function(e){this.uniforms.uGlyphScale.value=e}},glyphScaleFactorX:{get:function(){return this.uniforms.glyphScaleFactorX.value},set:function(e){this.uniforms.glyphScaleFactorX.value=e}},glyphScaleFactorY:{get:function(){return this.uniforms.glyphScaleFactorY.value},set:function(e){this.uniforms.glyphScaleFactorY.value=e}},glyphScaleFactorZ:{get:function(){return this.uniforms.glyphScaleFactorZ.value},set:function(e){this.uniforms.glyphScaleFactorZ.value=e}},vertexGlyphScales:{get:function(){return this.defines.USE_GLYPH_SCALE},set:function(e){this.defines.USE_GLYPH_SCALE=e}},glyphOrientation:{get:function(){return this.uniforms.uGlyphOrientation.value},set:function(e){this.uniforms.uGlyphOrientation.value=e}},vertexGlyphOrientations:{get:function(){return this.defines.USE_GLYPH_ORIENTATION},set:function(e){this.defines.USE_GLYPH_ORIENTATION=e}},opacityFactor:{get:function(){return this.uniforms.opacityFactor.value},set:function(e){this.uniforms.opacityFactor.value=e}}}),n.color=new fl(16777215),n.fog=!0,n.setValues(e),n}return Ey(t,e),my(t,[{key:"copy",value:function(e){return xy(t,"copy",this,3)([e]),this.color.copy(e.color),this}},{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return 3===this.depthFunc&&(n.depthFunc=void 0),!0===this.depthTest&&(n.depthTest=void 0),!0===this.depthWrite&&(n.depthWrite=void 0),!1===this.stencilWrite&&(n.stencilWrite=void 0),255===this.stencilWriteMask&&(n.stencilWriteMask=void 0),519===this.stencilFunc&&(n.stencilFunc=void 0),0===this.stencilRef&&(n.stencilRef=void 0),255===this.stencilFuncMask&&(n.stencilFuncMask=void 0),this.stencilFail===$a&&(n.stencilFail=void 0),this.stencilZFail===$a&&(n.stencilZFail=void 0),this.stencilZPass===$a&&(n.stencilZPass=void 0),this.vertexGlyphScales&&(n.vertexGlyphScales=!0),this.vertexGlyphOrientations&&(n.vertexGlyphOrientations=!0),n.uniforms=void 0,n.fragmentShader=void 0,n.vertexShader=void 0,n}},{key:"equals",value:function(e){return e.color.getHex()===this.color.getHex()&&e.opacity===this.opacity&&e.transparent===this.transparent&&e.side===this.side&&e.vertexColors===this.vertexColors}}])}($l),qy={base:{pickState:{value:new Float32Array(1)},startCell:{value:0},uGlyphScale:{value:new go(1,1,1)},glyphScaleFactorX:{value:1},glyphScaleFactorY:{value:1},glyphScaleFactorZ:{value:1},uGlyphOrientation:{value:new xo},opacityFactor:{value:1}},line:{linePattern:{value:65535},resolution:{value:new mo(1,1)}},mesh:{stipple:{value:0},stippleColor:{value:new fl(0)},stipplePattern:{value:new Float32Array(64)},textureBlending:{value:1}}},Yy="uniform vec3 diffuse;\nuniform float opacity;\nuniform float opacityFactor;\nuniform float linePattern;\nuniform float pickState[ 1 ];\nvarying vec3 vPickColor;\n#ifdef USE_PATTERN\nvarying float vPattern;\n#endif\nvarying float vDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity * opacityFactor );\n\t#include <clipping_planes_fragment>\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tgl_FragColor = vec4( vPickColor, 1.0 );\n\t} else {\n\tfloat pattern;\n#ifdef USE_PATTERN\n\tpattern = floor( vPattern );\n#else\n\tpattern = linePattern;\n#endif\n\tfloat shift = pow( 2.0, floor( mod( vDistance, 16.0 ) ) );\n\tif( mod( floor( pattern / shift ), 2.0 ) < 0.5 ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t}\n}",Jy=Yy,Zy=Yy,Ky={points:{uniforms:Kl.merge([Cp.points,Cp.fog,qy.base]),vertexShader:"attribute float vsize;\nattribute float cellCount;\nattribute vec3 glyphOffset;\nattribute vec3 glyphScale;\nuniform vec3 uGlyphScale;\nuniform float glyphScaleFactorX;\nuniform float glyphScaleFactorY;\nuniform float glyphScaleFactorZ;\nattribute mat3 glyphOrientation;\nuniform mat3 uGlyphOrientation;\nuniform float size;\nuniform float pickState[ 1 ];\nuniform float startCell;\nvarying vec3 vPickColor;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tfloat cellNum = startCell + cellCount;\n\t\t\n\t\tfloat red = fract( cellNum / (255.0*255.0*255.0) );\n\t\tif ( pickState[ 0 ] > 1.5 ) {\n\t\n\t\t\tfloat red2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat green2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat blue2 = fract( cellNum / (255.0*255.0*255.0*255.0) );\n\t\n\t\t\tred2 -= green2 / 255.0;\n\t\t\tgreen2 -= blue2 / 255.0;\n\t\t\tblue2 -= red / 255.0;\n\t\t\tvPickColor = vec3( red2, green2, blue2 );\n\t\t} else {\n\t\t\tfloat green = fract( cellNum / (255.0*255.0) );\n\t\t\tfloat blue = fract( cellNum / 255.0 );\n\t\t\tred -= green / 255.0;\n\t\t\tgreen -= blue / 255.0;\n\t\t\tvPickColor = vec3( red, green, blue );\n\t\t}\n\t}\n\t#include <color_vertex>\n\t#include <begin_vertex>\n#ifdef GLYPH\n#ifdef USE_GLYPH_SCALE\n\ttransformed *= glyphScale;\n#else\n\ttransformed *= uGlyphScale;\n#endif\n\tvec3 glyphScaleFactor = vec3( glyphScaleFactorX, glyphScaleFactorY, glyphScaleFactorZ );\n\ttransformed *= glyphScaleFactor;\n#ifdef USE_GLYPH_ORIENTATION\n\ttransformed = glyphOrientation * transformed;\n#else\n\ttransformed = uGlyphOrientation * transformed;\n#endif\n\ttransformed += glyphOffset;\n#endif\n\t#include <project_vertex>\n#ifdef USE_SIZE\n\tgl_PointSize = vsize;\n#else\n\tgl_PointSize = size;\n#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",fragmentShader:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float opacityFactor;\nuniform float pickState[ 1 ];\nvarying vec3 vPickColor;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity * opacityFactor );\n\t#include <clipping_planes_fragment>\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tgl_FragColor = vec4( vPickColor, 1.0 );\n\t} else {\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t}\n}"},line:{uniforms:Kl.merge([Cp.common,Cp.fog,qy.base,qy.line]),vertexShader:"attribute vec3 otherPosition;\nattribute float pattern;\nattribute float cellCount;\nattribute vec3 glyphOffset;\nattribute vec3 glyphScale;\nuniform vec3 uGlyphScale;\nuniform float glyphScaleFactorX;\nuniform float glyphScaleFactorY;\nuniform float glyphScaleFactorZ;\nattribute mat3 glyphOrientation;\nuniform mat3 uGlyphOrientation;\nuniform float pickState[ 1 ];\nuniform float startCell;\nuniform vec2 resolution;\n#ifdef USE_PATTERN\nvarying float vPattern;\n#endif\nvarying float vDistance;\nvarying vec3 vPickColor;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tfloat cellNum = startCell + cellCount;\n\t\t\n\t\tfloat red = fract( cellNum / (255.0*255.0*255.0) );\n\t\tif ( pickState[ 0 ] > 1.5 ) {\n\t\n\t\t\tfloat red2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat green2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat blue2 = fract( cellNum / (255.0*255.0*255.0*255.0) );\n\t\n\t\t\tred2 -= green2 / 255.0;\n\t\t\tgreen2 -= blue2 / 255.0;\n\t\t\tblue2 -= red / 255.0;\n\t\t\tvPickColor = vec3( red2, green2, blue2 );\n\t\t} else {\n\t\t\tfloat green = fract( cellNum / (255.0*255.0) );\n\t\t\tfloat blue = fract( cellNum / 255.0 );\n\t\t\tred -= green / 255.0;\n\t\t\tgreen -= blue / 255.0;\n\t\t\tvPickColor = vec3( red, green, blue );\n\t\t}\n\t}\n\t#include <color_vertex>\n\tvec3 transformed = vec3( position );\n\tvec3 otherTransformed = vec3( otherPosition );\n#ifdef GLYPH\n#ifdef USE_GLYPH_SCALE\n\ttransformed *= glyphScale;\n\totherTransformed *= glyphScale;\n#else\n\ttransformed *= uGlyphScale;\n\totherTransformed *= uGlyphScale;\n#endif\n\tvec3 glyphScaleFactor = vec3( glyphScaleFactorX, glyphScaleFactorY, glyphScaleFactorZ );\n\ttransformed *= glyphScaleFactor;\n\totherTransformed *= glyphScaleFactor;\n#ifdef USE_GLYPH_ORIENTATION\n\ttransformed = glyphOrientation * transformed;\n\totherTransformed = glyphOrientation * otherTransformed;\n#else\n\ttransformed = uGlyphOrientation * transformed;\n\totherTransformed = uGlyphOrientation * otherTransformed;\n#endif\n\ttransformed += glyphOffset;\n\totherTransformed += glyphOffset;\n#endif\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\tvec2 ndcPos1 = gl_Position.xy / gl_Position.w;\n\tvec4 other_Position = projectionMatrix * modelViewMatrix * vec4( otherTransformed, 1.0 );\n\tvec2 ndcPos2 = other_Position.xy / other_Position.w;\n\tfloat aspect = resolution.x / resolution.y;\n\tvec2 dir = ndcPos2 - ndcPos1;\n\tdir.x *= aspect;\n\tbool end = false;\n\tif ( dir.y < -EPSILON ) {\n\t\tend = true;\n\t}\n\telse if ( dir.y > EPSILON ) {\n\t\tend = false;\n\t}\n\telse if ( dir.x < -EPSILON ) {\n\t\tend = true;\n\t}\n\tvDistance = end ? 0.0 : length( dir * resolution ) / 2.0;\n#ifdef USE_PATTERN\n\tvPattern = pattern + 0.5;\n#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",fragmentShader:Jy},thick:{uniforms:Kl.merge([Cp.common,Cp.fog,qy.base,qy.line,{linewidth:{value:1}}]),vertexShader:"attribute vec3 instanceStart;\nattribute vec3 instanceEnd;\nattribute vec3 instanceColorStart;\nattribute vec3 instanceColorEnd;\nattribute float instancePattern;\nattribute float instanceLinewidthStart;\nattribute float instanceLinewidthEnd;\nattribute float cellCount;\nuniform float pickState[ 1 ];\nuniform float startCell;\nuniform float linewidth;\nuniform vec2 resolution;\n#ifdef USE_PATTERN\nvarying float vPattern;\n#endif\nvarying float vDistance;\nvarying vec3 vPickColor;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tfloat cellNum = startCell + cellCount;\n\t\t\n\t\tfloat red = fract( cellNum / (255.0*255.0*255.0) );\n\t\tif ( pickState[ 0 ] > 1.5 ) {\n\t\n\t\t\tfloat red2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat green2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat blue2 = fract( cellNum / (255.0*255.0*255.0*255.0) );\n\t\n\t\t\tred2 -= green2 / 255.0;\n\t\t\tgreen2 -= blue2 / 255.0;\n\t\t\tblue2 -= red / 255.0;\n\t\t\tvPickColor = vec3( red2, green2, blue2 );\n\t\t} else {\n\t\t\tfloat green = fract( cellNum / (255.0*255.0) );\n\t\t\tfloat blue = fract( cellNum / 255.0 );\n\t\t\tred -= green / 255.0;\n\t\t\tgreen -= blue / 255.0;\n\t\t\tvPickColor = vec3( red, green, blue );\n\t\t}\n\t}\n#ifdef USE_COLOR\n\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart.xyz : instanceColorEnd.xyz;\n#endif\n#ifdef USE_PATTERN\n\tvPattern = instancePattern + 0.5;\n#endif\n\tfloat widthFactor, avgWidthFactor;\n#ifdef USE_LINEWIDTH\n\twidthFactor = ( position.y < 0.5 ) ? instanceLinewidthStart : instanceLinewidthEnd;\n\tavgWidthFactor = ( instanceLinewidthStart + instanceLinewidthEnd ) / 2.0;\n#else\n\twidthFactor = avgWidthFactor = linewidth;\n#endif\n\tfloat aspect = resolution.x / resolution.y;\n\tvec4 localStart = vec4( instanceStart, 1.0 );\n\tvec4 localEnd = vec4( instanceEnd, 1.0 );\n\tvec4 start = modelViewMatrix * localStart;\n\tvec4 end = modelViewMatrix * localEnd;\n\tvec4 clipStart = projectionMatrix * start;\n\tvec4 clipEnd = projectionMatrix * end;\n\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n#ifdef LINEWIDTH_SCALE\n\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\tif ( perspective ) {\n\t\tvec2 xyStart = localStart.xy;\n\t\tvec2 xyEnd = localEnd.xy;\n\t\tvec2 scaleDir = xyEnd - xyStart;\n\t\tscaleDir = normalize( scaleDir );\n\t\tvec2 scaleOffset = vec2( scaleDir.y, -scaleDir.x );\n\t\tscaleOffset.y /= aspect;\n\t\tif ( position.x < 0.5 ) scaleOffset *= -1.0;\n\t\tscaleOffset *= ( widthFactor * 0.5 );\n\t\tvec4 startEnd = ( position.y < 0.5 ) ? localStart : localEnd;\n\t\tvec4 scaleClip = vec4( startEnd );\n\t\tscaleClip.xy += scaleOffset;\n\t\tvec4 scalePosition = projectionMatrix * modelViewMatrix * scaleClip;\n\t\tvec4 scalePosition2 = projectionMatrix * modelViewMatrix * startEnd;\n\t\twidthFactor = avgWidthFactor = length( scalePosition2.xy - scalePosition.xy ) * resolution.y * 2.0;\n\t} else {\n\t\tvec4 localScale = ( position.y < 0.5 ) ? localStart : localEnd;\n\t\tlocalScale.y += widthFactor;\n\t\tvec4 clipScale = projectionMatrix * modelViewMatrix * localScale;\n\t\twidthFactor = avgWidthFactor = length( clipScale.xy - clip.xy ) * resolution.y / 2.0;\n\t}\n#endif\n\tif ( widthFactor < 1.0 ) {\n\t\twidthFactor = 1.0;\n\t}\n\tif ( avgWidthFactor < 1.0 ) {\n\t\tavgWidthFactor = 1.0;\n\t}\n\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\tvec2 dirOrig = dir;\n\tdir.x *= aspect;\n\tdir = normalize( dir );\n\tvec2 offset = vec2( dir.y, -dir.x );\n\tdir.x /= aspect;\n\toffset.x /= aspect;\n\tif ( position.x < 0.5 ) offset *= -1.0;\n\toffset += ( position.y < 0.5 ) ? -dir * 0.3 : dir * 0.3;\n\toffset *= widthFactor;\n\tdir *= widthFactor;\n\toffset /= resolution.y;\n\tdir /= resolution.y;\n\toffset *= clip.w;\n\tclip.xy += offset;\n\tif ( clip.z > -1.0 ) {\n\t\tclip.z -= 5.0e-4;\n\t\tif ( clip.z < -1.0 ) clip.z = -1.0;\n\t}\n\tgl_Position = clip;\n\tvDistance = ( position.y < 0.5 ) ? 0.0 : ( length( dirOrig * resolution ) + 2.0 * length( dir * resolution ) ) / avgWidthFactor / 2.0;\n\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",fragmentShader:Zy},basic:{uniforms:Kl.merge([Cp.common,Cp.fog,qy.base,qy.mesh]),vertexShader:"attribute float cellCount;\nattribute vec3 glyphOffset;\nattribute vec3 glyphScale;\nuniform vec3 uGlyphScale;\nuniform float glyphScaleFactorX;\nuniform float glyphScaleFactorY;\nuniform float glyphScaleFactorZ;\nattribute mat3 glyphOrientation;\nuniform mat3 uGlyphOrientation;\nuniform float pickState[ 1 ];\nuniform float startCell;\nvarying vec3 vPickColor;\n#include <common>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tfloat cellNum = startCell + cellCount;\n\t\t\n\t\tfloat red = fract( cellNum / (255.0*255.0*255.0) );\n\t\tif ( pickState[ 0 ] > 1.5 ) {\n\t\n\t\t\tfloat red2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat green2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat blue2 = fract( cellNum / (255.0*255.0*255.0*255.0) );\n\t\n\t\t\tred2 -= green2 / 255.0;\n\t\t\tgreen2 -= blue2 / 255.0;\n\t\t\tblue2 -= red / 255.0;\n\t\t\tvPickColor = vec3( red2, green2, blue2 );\n\t\t} else {\n\t\t\tfloat green = fract( cellNum / (255.0*255.0) );\n\t\t\tfloat blue = fract( cellNum / 255.0 );\n\t\t\tred -= green / 255.0;\n\t\t\tgreen -= blue / 255.0;\n\t\t\tvPickColor = vec3( red, green, blue );\n\t\t}\n\t}\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n#ifdef GLYPH\n#ifdef USE_GLYPH_SCALE\n\ttransformed *= glyphScale;\n#else\n\ttransformed *= uGlyphScale;\n#endif\n\tvec3 glyphScaleFactor = vec3( glyphScaleFactorX, glyphScaleFactorY, glyphScaleFactorZ );\n\ttransformed *= glyphScaleFactor;\n#ifdef USE_GLYPH_ORIENTATION\n\ttransformed = glyphOrientation * transformed;\n#else\n\ttransformed = uGlyphOrientation * transformed;\n#endif\n\ttransformed += glyphOffset;\n#endif\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",fragmentShader:"uniform float stipple;\nuniform vec3 stippleColor;\nuniform vec4 stipplePattern[ 16 ];\nuniform vec3 diffuse;\nuniform float opacity;\nuniform float opacityFactor;\nuniform float textureBlending;\nuniform float pickState[ 1 ];\nvarying vec3 vPickColor;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity * opacityFactor );\n\t#include <clipping_planes_fragment>\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tgl_FragColor = vec4( vPickColor, 1.0 );\n\t} else {\n\tif ( stipple > 0.5 ) {\n\t\tvec2 coord = floor( mod( gl_FragCoord.xy, 32.0 ) );\n\t\tint index = int( floor( coord.x / 64.0 ) + ( coord.y / 2.0 ) );\n\t\tint comp = int( floor( coord.x / 16.0 ) + mod( coord.y , 2.0 ) * 2.0 );\n\t\tfor ( int i = 0; i < 16; i ++ ) {\n\t\t\tif ( i == index ) {\n\t\t\t\tfloat shift = pow( 2.0, floor( mod( gl_FragCoord.x, 16.0 ) ) );\n\t\t\t\tfloat shortPattern;\n\t\t\t\tif ( comp == 0 ) {\n\t\t\t\t\tshortPattern = stipplePattern[ i ].x;\n\t\t\t\t} else if ( comp == 1 ) {\n\t\t\t\t\tshortPattern = stipplePattern[ i ].y;\n\t\t\t\t} else if ( comp == 2 ) {\n\t\t\t\t\tshortPattern = stipplePattern[ i ].z;\n\t\t\t\t} else {\n\t\t\t\t\tshortPattern = stipplePattern[ i ].w;\n\t\t\t\t}\n\t\t\t\tif ( mod( floor( shortPattern / shift ), 2.0 ) > 0.5 ) {\n\t\t\t\t\tdiffuseColor = vec4( stippleColor, opacity );\n\t\t\t\t} else if ( stipple < 1.5 ) {\n\t\t\t\t\tdiscard;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tif ( textureBlending > 1.5 ) {\n\t\tvec3 temp = mix( diffuseColor.rgb, sampledDiffuseColor.rgb, sampledDiffuseColor.a );\n\t\tdiffuseColor = vec4( temp, diffuseColor.a );\n\t} else if ( textureBlending < 0.5 ) {\n\t\tdiffuseColor = sampledDiffuseColor;\n\t} else {\n\t\tdiffuseColor *= sampledDiffuseColor;\n\t}\n#endif\n\t#include <alphatest_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\t}\n}"},phong:{uniforms:Kl.merge([Cp.common,Cp.fog,Cp.lights,qy.base,qy.mesh,{ambientIntensity:{value:.31},diffuseIntensity:{value:.7},emissive:{value:new fl(0)},specular:{value:new fl(2039583)},shininess:{value:63.8386159788056}}]),vertexShader:"attribute float cellCount;\nattribute vec3 glyphOffset;\nattribute vec3 glyphScale;\nuniform vec3 uGlyphScale;\nuniform float glyphScaleFactorX;\nuniform float glyphScaleFactorY;\nuniform float glyphScaleFactorZ;\nattribute mat3 glyphOrientation;\nuniform mat3 uGlyphOrientation;\nuniform float pickState[ 1 ];\nuniform float startCell;\nvarying vec3 vPickColor;\n#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tfloat cellNum = startCell + cellCount;\n\t\t\n\t\tfloat red = fract( cellNum / (255.0*255.0*255.0) );\n\t\tif ( pickState[ 0 ] > 1.5 ) {\n\t\n\t\t\tfloat red2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat green2 = fract( cellNum / (255.0*255.0*255.0*255.0*255.0) );\n\t\t\tfloat blue2 = fract( cellNum / (255.0*255.0*255.0*255.0) );\n\t\n\t\t\tred2 -= green2 / 255.0;\n\t\t\tgreen2 -= blue2 / 255.0;\n\t\t\tblue2 -= red / 255.0;\n\t\t\tvPickColor = vec3( red2, green2, blue2 );\n\t\t} else {\n\t\t\tfloat green = fract( cellNum / (255.0*255.0) );\n\t\t\tfloat blue = fract( cellNum / 255.0 );\n\t\t\tred -= green / 255.0;\n\t\t\tgreen -= blue / 255.0;\n\t\t\tvPickColor = vec3( red, green, blue );\n\t\t}\n\t}\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n#ifdef GLYPH\n#ifdef USE_GLYPH_SCALE\n\ttransformed *= glyphScale;\n#else\n\ttransformed *= uGlyphScale;\n#endif\n\tvec3 glyphScaleFactor = vec3( glyphScaleFactorX, glyphScaleFactorY, glyphScaleFactorZ );\n\ttransformed *= glyphScaleFactor;\n#ifdef USE_GLYPH_ORIENTATION\n\ttransformed = glyphOrientation * transformed;\n#else\n\ttransformed = uGlyphOrientation * transformed;\n#endif\n\ttransformed += glyphOffset;\n#endif\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",fragmentShader:"uniform float ambientIntensity;\nuniform float diffuseIntensity;\nuniform float stipple;\nuniform vec3 stippleColor;\nuniform vec4 stipplePattern[ 16 ];\nuniform float textureBlending;\nuniform float pickState[ 1 ];\nvarying vec3 vPickColor;\n#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\nuniform float opacityFactor;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity * opacityFactor );\n\t#include <clipping_planes_fragment>\n\tif ( pickState[ 0 ] > 0.5 ) {\n\t\tgl_FragColor = vec4( vPickColor, 1.0 );\n\t} else {\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\tif ( stipple > 0.5 ) {\n\t\tvec2 coord = floor( mod( gl_FragCoord.xy, 32.0 ) );\n\t\tint index = int( floor( coord.x / 64.0 ) + ( coord.y / 2.0 ) );\n\t\tint comp = int( floor( coord.x / 16.0 ) + mod( coord.y , 2.0 ) * 2.0 );\n\t\tfor ( int i = 0; i < 16; i ++ ) {\n\t\t\tif ( i == index ) {\n\t\t\t\tfloat shift = pow( 2.0, floor( mod( gl_FragCoord.x, 16.0 ) ) );\n\t\t\t\tfloat shortPattern;\n\t\t\t\tif ( comp == 0 ) {\n\t\t\t\t\tshortPattern = stipplePattern[ i ].x;\n\t\t\t\t} else if ( comp == 1 ) {\n\t\t\t\t\tshortPattern = stipplePattern[ i ].y;\n\t\t\t\t} else if ( comp == 2 ) {\n\t\t\t\t\tshortPattern = stipplePattern[ i ].z;\n\t\t\t\t} else {\n\t\t\t\t\tshortPattern = stipplePattern[ i ].w;\n\t\t\t\t}\n\t\t\t\tif ( mod( floor( shortPattern / shift ), 2.0 ) > 0.5 ) {\n\t\t\t\t\tdiffuseColor = vec4( stippleColor, opacity );\n\t\t\t\t} else if ( stipple < 1.5 ) {\n\t\t\t\t\tdiscard;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tif ( textureBlending > 1.5 ) {\n\t\tvec3 temp = mix( diffuseColor.rgb, sampledDiffuseColor.rgb, sampledDiffuseColor.a );\n\t\tdiffuseColor = vec4( temp, diffuseColor.a );\n\t} else if ( textureBlending < 0.5 ) {\n\t\tdiffuseColor = sampledDiffuseColor;\n\t} else {\n\t\tdiffuseColor *= sampledDiffuseColor;\n\t}\n#endif\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\tvec3 outgoingLight = ( reflectedLight.directDiffuse * diffuseIntensity ) + ( reflectedLight.indirectDiffuse * ambientIntensity ) + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\t}\n}"}},$y=function(e){function t(e){var n;return py(this,t),(n=gy(this,t,[{uniforms:Kl.clone(Ky.points.uniforms),vertexShader:Ky.points.vertexShader,fragmentShader:Ky.points.fragmentShader}])).isPointsMaterial=!0,Object.defineProperties(_y(n),{vertexSizes:{get:function(){return this.defines.USE_SIZE},set:function(e){this.defines.USE_SIZE=e}}}),n.map=null,n.size=1,n.setValues(e),n}return Ey(t,e),my(t,[{key:"copy",value:function(e){return xy(t,"copy",this,3)([e]),this.map=e.map,this.size=e.size,this}},{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.type="PointsMaterial",this.vertexSizes&&(n.vertexSizes=!0),n}},{key:"equals",value:function(e){return!1!==xy(t,"equals",this,3)([e])&&!!e.isPointsMaterial}}])}(Xy),Qy=function(e){function t(e){var n;return py(this,t),(n=gy(this,t,[{uniforms:Kl.clone(Ky.basic.uniforms),vertexShader:Ky.basic.vertexShader,fragmentShader:Ky.basic.fragmentShader}])).isMeshBasicMaterial=!0,Object.defineProperties(_y(n),{stipple:{get:function(){return this.uniforms.stipple.value},set:function(e){this.uniforms.stipple.value=e}},stippleColor:{get:function(){return this.uniforms.stippleColor.value},set:function(e){this.uniforms.stippleColor.value=e}},stipplePattern:{get:function(){return this.uniforms.stipplePattern.value},set:function(e){this.uniforms.stipplePattern.value=e}},textureBlending:{get:function(){return this.uniforms.textureBlending.value},set:function(e){this.uniforms.textureBlending.value=e}}}),n.map=null,n.setValues(e),n}return Ey(t,e),my(t,[{key:"copy",value:function(e){return xy(t,"copy",this,3)([e]),this.map=e.map,this}},{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.type="MeshBasicMaterial",0!==this.stipple&&(n.stipple=this.stipple),0!==this.stippleColor.getHex()&&(n.stippleColor=this.stippleColor.getHex()),JSON.stringify(this.stipplePattern)!==JSON.stringify(new Float32Array(64))&&(n.stipplePattern=Array.prototype.slice.call(this.stipplePattern)),1!==this.textureBlending&&(n.textureBlending=this.textureBlending),n}},{key:"equals",value:function(e){return!1!==xy(t,"equals",this,3)([e])&&!(!e.isMeshBasicMaterial&&!e.isMeshPhongMaterial)}}])}(Xy),eg=function(e){function t(e){var n;return py(this,t),(n=gy(this,t,[{uniforms:Kl.clone(Ky.phong.uniforms),vertexShader:Ky.phong.vertexShader,fragmentShader:Ky.phong.fragmentShader}])).isMeshPhongMaterial=!0,n.isMeshBasicMaterial=!1,Object.defineProperties(_y(n),{ambientIntensity:{get:function(){return this.uniforms.ambientIntensity.value},set:function(e){this.uniforms.ambientIntensity.value=e}},diffuseIntensity:{get:function(){return this.uniforms.diffuseIntensity.value},set:function(e){this.uniforms.diffuseIntensity.value=e}}}),n.specular=new fl(4737096),n.shininess=63.8386159788056,n.emissive=new fl(0),n.emissiveIntensity=1,n.lights=!0,n.setValues(e),n}return Ey(t,e),my(t,[{key:"copy",value:function(e){return xy(t,"copy",this,3)([e]),this.specular.copy(e.specular),this.shininess=e.shininess,this.flatShading=e.flatShading,this}},{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.type="MeshPhongMaterial",.31!==this.ambientIntensity&&(n.ambientIntensity=this.ambientIntensity),.7!==this.diffuseIntensity&&(n.diffuseIntensity=this.diffuseIntensity),4737096===this.specular.getHex()&&(n.specular=void 0),63.8386159788056===this.shininess&&(n.shininess=void 0),n}},{key:"equals",value:function(e){return!1!==xy(t,"equals",this,3)([e])&&!!e.isMeshPhongMaterial&&e.ambientIntensity===this.ambientIntensity&&e.diffuseIntensity===this.diffuseIntensity&&e.specular.getHex()===this.specular.getHex()&&e.shininess===this.shininess}}])}(Qy),tg=function(e){function t(e){var n;return py(this,t),(n=gy(this,t,[{uniforms:Kl.clone(Ky.line.uniforms),vertexShader:Ky.line.vertexShader,fragmentShader:Ky.line.fragmentShader}])).isLineBasicMaterial=!0,Object.defineProperties(_y(n),{pattern:{get:function(){return this.uniforms.linePattern.value},set:function(e){this.uniforms.linePattern.value=e}},vertexPatterns:{get:function(){return this.defines.USE_PATTERN},set:function(e){this.defines.USE_PATTERN=e}},resolution:{get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value=e}}}),n.setValues(e),n}return Ey(t,e),my(t,[{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.type="LineMaterial",65535!==this.pattern&&(n.pattern=this.pattern),this.vertexPatterns&&(n.vertexPatterns=!0),n}},{key:"equals",value:function(e){return!1!==xy(t,"equals",this,3)([e])&&!!e.isLineBasicMaterial}}])}(Xy),ng=function(e){function t(e){var n;return py(this,t),(n=gy(this,t,[{uniforms:Kl.clone(Ky.thick.uniforms),vertexShader:Ky.thick.vertexShader,fragmentShader:Ky.thick.fragmentShader}])).isThickLineMaterial=!0,Object.defineProperties(_y(n),{linewidth:{get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},vertexLinewidths:{get:function(){return this.defines.USE_LINEWIDTH},set:function(e){this.defines.USE_LINEWIDTH=e}},linewidthScale:{get:function(){return this.defines.LINEWIDTH_SCALE},set:function(e){this.defines.LINEWIDTH_SCALE=e}}}),n.setValues(e),n}return Ey(t,e),my(t,[{key:"toJSON",value:function(e){var n=xy(t,"toJSON",this,3)([e]);return n.type="ThickLineMaterial",this.vertexLinewidths&&(n.vertexLinewidths=!0),this.linewidthScale&&(n.linewidthScale=!0),n}},{key:"equals",value:function(e){return!1!==xy(t,"equals",this,3)([e])&&!!e.isThickLineMaterial&&e.vertexLinewidths===this.vertexLinewidths}}])}(tg);Nf.createMaterialFromType=function(e){return new{PointsMaterial:$y,MeshPhongMaterial:eg,MeshBasicMaterial:Qy,LineMaterial:tg,ThickLineMaterial:ng}[e]};var rg=function(e){function t(){return py(this,t),gy(this,t,arguments)}return Ey(t,e),my(t,[{key:"parse",value:function(e){var n=xy(t,"parse",this,3)([e]);if(void 0!==e.glyphs&&(n.glyphs=e.glyphs),void 0!==e.vertexGlyphScales&&(n.vertexGlyphScales=e.vertexGlyphScales),void 0!==e.glyphScale&&n.glyphScale.fromArray(e.glyphScale),void 0!==e.vertexGlyphOrientations&&(n.vertexGlyphOrientations=e.vertexGlyphOrientations),void 0!==e.glyphOrientation&&n.glyphOrientation.fromArray(e.glyphOrientation),void 0!==e.vertexSizes&&(n.vertexSizes=e.vertexSizes),void 0!==e.pattern&&(n.pattern=e.pattern),void 0!==e.vertexPatterns&&(n.vertexPatterns=e.vertexPatterns),void 0!==e.vertexLinewidths&&(n.vertexLinewidths=e.vertexLinewidths),void 0!==e.linewidthScale&&(n.linewidthScale=e.linewidthScale),void 0!==e.stipple&&(n.stipple=e.stipple),void 0!==e.stippleColor&&void 0!==n.stippleColor&&n.stippleColor.setHex(e.stippleColor),void 0!==e.stipplePattern&&(n.stipplePattern=e.stipplePattern),void 0!==e.textureBlending&&(n.textureBlending=e.textureBlending),void 0!==e.ambientIntensity&&(n.ambientIntensity=e.ambientIntensity),void 0!==e.diffuseIntensity&&(n.diffuseIntensity=e.diffuseIntensity),void 0!==e.clippingPlanes){n.clippingPlanes=[];for(var r=0,i=e.clippingPlanes.length;r<i;r++){var a=e.clippingPlanes[r],o=new lc(new go(a.normal[0],a.normal[1],a.normal[2]),a.constant);n.clippingPlanes.push(o)}}return n.origTransparent=n.transparent,n}}])}(Nf),ig=function(){return my((function e(t){py(this,e),this.bufferGeometryLoader=t}),[{key:"parse",value:function(e){var t=this.bufferGeometryLoader.parse(e),n=t.attributes.position;if(void 0!==n){for(var r=new El(n.array.length,3),i=0,a=n.array.length/6;i<a;i++)r.array[6*i+0]=n.array[6*i+3],r.array[6*i+1]=n.array[6*i+4],r.array[6*i+2]=n.array[6*i+5],r.array[6*i+3]=n.array[6*i+0],r.array[6*i+4]=n.array[6*i+1],r.array[6*i+5]=n.array[6*i+2];t.setAttribute("otherPosition",r)}return t}}])}(),ag=new Yo,og=new go,sg=function(e){function t(){var e;return py(this,t),(e=gy(this,t)).isThickLineSegmentsBufferGeometry=!0,e.type="ThickLineSegmentsBufferGeometry",e.setAttribute("position",new El([0,0,0,1,1,0,0,1,0,0,0,0,1,0,0,1,1,0],3)),e}return Ey(t,e),my(t,[{key:"applyMatrix4",value:function(e){var t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"setPositions",value:function(e){var t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));var n=new rp(t,6,1);return this.setAttribute("instanceStart",new mu(n,3,0)),this.setAttribute("instanceEnd",new mu(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}},{key:"setColors",value:function(e){var t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));var n=new rp(t,6,1);return this.setAttribute("instanceColorStart",new mu(n,3,0)),this.setAttribute("instanceColorEnd",new mu(n,3,3)),this}},{key:"setPatterns",value:function(e){var t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));var n=new rp(t,2,1);return this.setAttribute("instancePattern",new mu(n,1,0)),this}},{key:"setLinewidths",value:function(e){var t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));var n=new rp(t,2,1);return this.setAttribute("instanceLinewidthStart",new mu(n,1,0)),this.setAttribute("instanceLinewidthEnd",new mu(n,1,1)),this}},{key:"computeBoundingBox",value:function(){null===this.boundingBox&&(this.boundingBox=new Yo);var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),ag.setFromBufferAttribute(t),this.boundingBox.union(ag))}},{key:"computeBoundingSphere",value:function(){null===this.boundingSphere&&(this.boundingSphere=new ds),null===this.boundingBox&&this.computeBoundingBox();var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var r=0,i=0,a=e.count;i<a;i++)og.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(og)),og.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(og));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("AVS.Three.ThickLineSegmentsBufferGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}},{key:"applyMatrix",value:function(e){return console.warn("AVS.Three.ThickLineSegmentsBufferGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}])}(Df),lg=function(){return my((function e(){py(this,e)}),[{key:"parse",value:function(e){var t=new sg,n=e.data.attributes;return void 0!==n.position&&t.setPositions(n.position.array),void 0!==n.color&&t.setColors(n.color.array),void 0!==n.pattern&&t.setPatterns(n.pattern.array),void 0!==n.linewidth&&t.setLinewidths(n.linewidth.array),t}}])}(),ug=new xs,cg=new bs,hg=new ds,dg=function(e){function t(e,n){var r;return py(this,t),(r=gy(this,t,[e,n])).isThickLineSegments=!0,r.type="ThickLineSegments",r}return Ey(t,e),my(t,[{key:"raycast",value:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),hg.copy(n.boundingSphere),hg.applyMatrix4(r),hg.radius+=i,!1!==e.ray.intersectsSphere(hg)){ug.copy(r).invert(),cg.copy(e.ray).applyMatrix4(ug);for(var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=new go,u=new go,c=new go,h=new go,d=n.attributes.instanceStart,f=Math.max(0,a.start),p=Math.min(d.count,a.start+a.count)-1;f<p;f+=2)if(l.fromBufferAttribute(d,f),u.fromBufferAttribute(d,f+1),!(cg.distanceSqToSegment(l,u,h,c)>s)){h.applyMatrix4(this.matrixWorld);var v=e.ray.origin.distanceTo(h);v<e.near||v>e.far||t.push({distance:v,point:c.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this})}}}}])}(By),fg=function(){return my((function e(){py(this,e),this.uuid=vo.generateUUID(),this.transparent=!1,this.opacity=1,this.opacityFactor=1}),[{key:"dispose",value:function(){}}])}(),pg=function(e){function t(){var e;return py(this,t),(e=gy(this,t)).isBillboardText=!0,e.type="BillboardText",e.text="Label",e.fontSize=16,e.fontStyle="normal",e.fontWeight="normal",e.textDecoration="",e.fontFamily="sans-serif",e.color=new fl(0),e.textAlign="",e.transform="",e.transformOrigin="",e.material=new fg,e.div=document.createElement("div"),e.div.style.position="absolute",e.div.style.whiteSpace="nowrap",e.div.style.userSelect="none",e.scene=null,e.scaleFactor=1,e.left=0,e.top=0,e.updateStyle(),e}return Ey(t,e),my(t,[{key:"addToScene",value:function(e){null===this.scene&&(this.scene=e,e.labels.push(this),e.landscapeDiv.appendChild(this.div),this.updateStyle())}},{key:"updateStyle",value:function(){this.div.innerHTML=this.text,this.div.style.fontStyle=this.fontStyle,this.div.style.fontWeight=this.fontWeight,this.div.style.textDecoration=this.textDecoration,this.div.style.color="#"+this.color.getHexString(),this.div.style.transform=this.transform,this.div.style.transformOrigin=this.transformOrigin,this.material.transparent?this.div.style.opacity=this.material.opacity*this.material.opacityFactor:this.div.style.opacity=1,this.div.style.visibility=this.visible?"visible":"hidden",void 0!==this.div.firstChild.style&&(this.div.firstChild.style.float="left"),/\s/.test(this.fontFamily)?this.div.style.fontFamily="'"+this.fontFamily+"'":this.div.style.fontFamily=this.fontFamily,this.textScale||(this.div.style.fontSize=this.fontSize+"px")}},{key:"updatePosition",value:function(){this.updateMatrixWorld();var e=(new go).setFromMatrixPosition(this.matrixWorld);if(e.project(this.scene.camera),this.left=(e.x+1)/2*this.scene.landscapeWidth,this.top=(1-(e.y+1)/2)*this.scene.landscapeHeight,this.moveText(),this.textScale){var t=new go(0,1,0).multiplyScalar(this.fontSize).add(this.position);t.applyMatrix4(this.parent.matrixWorld),t.project(this.scene.camera);var n=(1-(t.y+1)/2)*this.scene.landscapeHeight,r=Math.abs(n-this.top);this.div.style.fontSize=r+"px"}this.material.transparent?this.div.style.opacity=this.material.opacity*this.material.opacityFactor:this.div.style.opacity=1,this.div.style.visibility=this.visible?"visible":"hidden"}},{key:"moveText",value:function(){var e,t;this.div.style.left=Math.floor((null!==(e=this.panOffsetX)&&void 0!==e?e:0)+this.left)+"px",this.div.style.top=Math.floor((null!==(t=this.panOffsetY)&&void 0!==t?t:0)+this.top)+"px"}}])}(Ys),vg=function(e){function t(){return py(this,t),gy(this,t,arguments)}return Ey(t,e),my(t,[{key:"parse",value:function(e,t,n,r,i,a,o){var s=this.parseGeometries(e.geometries);a=Object.assign(null!=a?a:{},s);var l=this.parseImages(e.images,(function(){void 0!==t&&t(h)}));n=Object.assign(null!=n?n:{},l);var u=this.parseTextures(e.textures,n);r=Object.assign(null!=r?r:{},u);var c=this.parseMaterials(e.materials,r);i=Object.assign(null!=i?i:{},c);var h=this.parseObject(e.object,a,i,r);if(void 0!==o&&(o.add(h),h.saveVisible=h.visible,h.visible=!1),void 0!==t){var d=!1;for(var f in l)if(l[f].data instanceof HTMLImageElement){d=!0;break}!1===d&&t(h)}return h}},{key:"parseGeometries",value:function(e,t){var n={};if(void 0!==e)for(var r=new Uf,i=new ig(r),a=new lg,o=0,s=e.length;o<s;o++){var l=void 0,u=e[o];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"LinePatternBufferGeometry":l=i.parse(u);break;case"ThickLineBufferGeometry":l=a.parse(u);break;case"SphereGeometry":l=bd.fromJSON(u);break;default:console.warn('AVS.Three.ObjectLoader: Unsupported geometry type "'.concat(u.type,'"'))}l.uuid=u.uuid,void 0!==u.name&&(l.name=u.name),!0===l.isBufferGeometry&&void 0!==u.userData&&(l.userData=u.userData),n[u.uuid]=l}return n}},{key:"parseMaterials",value:function(e,t){var n={};if(void 0!==e){var r=new rg;r.setTextures(t);for(var i=0,a=e.length;i<a;i++){var o=e[i];n[o.uuid]=r.parse(o)}}return n}},{key:"parseObject",value:function(e,t,n,r){var i,a,o;function s(e){return void 0===t[e]&&console.warn("AVS.Three.ObjectLoader: Undefined geometry",e),t[e]}function l(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("AVS.Three.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("AVS.Three.ObjectLoader: Undefined material",e),n[e]}}function u(e){return void 0===r[e]&&console.warn("AVS.Three.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":i=new Wy,void 0!==e.background&&(Number.isInteger(e.background)?i.background=new fl(e.background):i.background=u(e.background)),void 0!==e.environment&&(i.environment=u(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?i.fog=new du(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(i.fog=new hu(e.fog.color,e.fog.density))),void 0!==e.backgroundBlurriness&&(i.backgroundBlurriness=e.backgroundBlurriness);break;case"PerspectiveCamera":i=new Gy(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(i.focus=e.focus),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.filmGauge&&(i.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(i.filmOffset=e.filmOffset),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"OrthographicCamera":i=new Vy(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.view&&(i.view=Object.assign({},e.view)),void 0!==e.keepAspectRatio&&(i.keepAspectRatio=e.keepAspectRatio);break;case"AmbientLight":i=new Hy(e.color,e.intensity);break;case"DirectionalLight":i=new jy(e.color,e.intensity);break;case"PointLight":i=new zy(e.color,e.intensity,e.distance,e.decay);break;case"Mesh":case"Quads":a=s(e.geometry),o=l(e.material),(i=new By(a,o)).cellType="Quads"===e.type?4:3,i.frustumCulled=void 0===o.glyphs;break;case"LineSegments":(i=new Ry(s(e.geometry),l(e.material))).cellType=2,i.frustumCulled=void 0===i.material.glyphs;break;case"ThickLineSegments":(i=new dg(s(e.geometry),l(e.material))).cellType=4,i.frustumCulled=void 0===i.material.glyphs;break;case"PointCloud":case"Points":(i=new ky(s(e.geometry),l(e.material))).cellType=1,i.frustumCulled=void 0===i.material.glyphs;break;case"Group":i=new Cy;break;case"BillboardText":i=new pg,void 0!==e.text&&(i.text=e.text),void 0!==e.fontSize&&(i.fontSize=e.fontSize),void 0!==e.fontStyle&&(i.fontStyle=e.fontStyle),void 0!==e.fontWeight&&(i.fontWeight=e.fontWeight),void 0!==e.fontFamily&&(i.fontFamily=e.fontFamily),void 0!==e.textDecoration&&(i.textDecoration=e.textDecoration),void 0!==e.color&&i.color.setHex(e.color),void 0!==e.transform&&(i.transform=e.transform),void 0!==e.transformOrigin&&(i.transformOrigin=e.transformOrigin),void 0!==e.textScale&&(i.textScale=e.textScale),void 0!==e.width&&(i.width=e.width),void 0!==e.height&&(i.height=e.height);break;default:i=new Ys}if(i.uuid=e.uuid,void 0!==e.name&&(i.name=e.name),void 0!==e.matrix?(i.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(i.matrixAutoUpdate=e.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==e.position&&i.position.fromArray(e.position),void 0!==e.rotation&&i.rotation.fromArray(e.rotation),void 0!==e.quaternion&&i.quaternion.fromArray(e.quaternion),void 0!==e.scale&&i.scale.fromArray(e.scale)),void 0!==e.castShadow&&(i.castShadow=e.castShadow),void 0!==e.receiveShadow&&(i.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(i.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(i.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(i.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&i.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(i.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.frustumCulled&&(i.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(i.renderOrder=e.renderOrder),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.layers&&(i.layers.mask=e.layers),i.internalData={},void 0!==e.internalData&&(i.internalData=e.internalData),void 0!==e.children)for(var c=e.children,h=0;h<c.length;h++)i.add(this.parseObject(c[h],t,n,r));return i}}])}(Ff),mg=function(){return my((function e(t){py(this,e);var n=t;this.getID=function(){return n},this.container=document.createElement("div"),this.container.style.position="relative",this.container.style.outline="none",this.container.style.overflow="hidden",this.container.style.width="100%",this.container.style.height="100%",this.container.id="avsthreeDiv",this.domElement=this.container,this.scenes=[],this.currentScene=null,this.renderNextFrame=!1,this.objectLoader=new vg,this.startCell=1,this.raycaster=new ap,this.raycaster.params.Line.threshold=.001,this.validPick=!1,this.pickType=0,this.pickDepth=1,this.pickRayX=0,this.pickRayY=0,this.pickRectangleLeft=0,this.pickRectangleTop=0,this.pickRectangleRight=1,this.pickRectangleBottom=1,this.selectionListeners=[],this.intersects=[],this.highlightList=[],this.updateHighlight=!1,this.highlightColor=new fl(16711680),this.updatePicking=!1,this.pickState=new Float32Array(1),this.resolution=new mo,this.loading=!1,this.firstChunk=!1,this.animator=null,this.animatedGlyphs=[],this.enableAnimatedGlyphs=!1,this.visibleAnimatedGlyphs=!1,this.displayCanvas=!1,this.animate()}),[{key:"setWebGLRenderer",value:function(e){this.renderer=e,this.renderer.autoClear=!1,this.renderer.localClippingEnabled=!0,this.renderer.sortObjects=!1}},{key:"updateSize",value:function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this.width||t!==this.height){this.width=e,this.height=t,this.updateHighlight=!0,this.updatePicking=!0,this.validPick=!1;for(var n=0;n<this.scenes.length;n++)this.updateSceneSize(this.scenes[n])}}},{key:"updateSceneSize",value:function(e){var t,n,r,i;if(e.windowX=Math.floor(e.windowFractionX*this.width),e.windowWidth=Math.floor(e.windowFractionWidth*this.width),e.windowY=Math.floor(e.windowFractionY*this.height),e.windowHeight=Math.floor(e.windowFractionHeight*this.height),e.windowTop=this.height-e.windowHeight-e.windowY,e.windowDiv.style.left=e.windowX+"px",e.windowDiv.style.width=e.windowWidth+"px",e.windowDiv.style.top=e.windowTop+"px",e.windowDiv.style.height=e.windowHeight+"px",e.panScene||(e.landscapeWidth=e.windowWidth,e.landscapeHeight=e.windowHeight),e.landscapeDiv.style.width=e.landscapeWidth+"px",e.landscapeDiv.style.height=e.landscapeHeight+"px",e.landscapeDiv.style.left=(null!==(t=e.baseLeft)&&void 0!==t?t:0)+(null!==(n=e.panOffsetX)&&void 0!==n?n:0)+"px",e.landscapeDiv.style.top=(null!==(r=e.baseTop)&&void 0!==r?r:0)+(null!==(i=e.panOffsetY)&&void 0!==i?i:0)+"px",e.landscapeGrid&&this.sizeLandscapeGrid(e),e.rectCanvas&&(e.rectCanvas.width=e.windowWidth,e.rectCanvas.height=e.windowHeight),e.camera.isOrthographicCamera&&e.camera.keepAspectRatio){var a=e.landscapeWidth/e.internalData.width,o=e.landscapeHeight/e.internalData.height,s=e.internalData.width/e.internalData.height;e.landscapeWidth,e.landscapeHeight,s<1||(e.camera.left=e.camera.origLeft*a/o,e.camera.right=e.camera.origRight*a/o),e.camera.updateProjectionMatrix()}}},{key:"sizeLandscapeGrid",value:function(e){for(var t=[],n=[],r=Math.floor(e.landscapeHeight/e.landscapeRows),i=0,a=0;a<e.landscapeRows;a++){var o=a==e.landscapeRows-1?e.landscapeHeight-i:r;t.push(i),n.push(o),i+=o}for(var s=[],l=[],u=Math.floor(e.landscapeWidth/e.landscapeColumns),c=0,h=0;h<e.landscapeColumns;h++){var d=h==e.landscapeColumns-1?e.landscapeWidth-c:u;s.push(c),l.push(d),c+=d}for(a=0;a<e.landscapeRows;a++)for(h=0;h<e.landscapeColumns;h++){var f=e.landscapeGrid[a][h];f.left=s[h],f.top=t[a];var p=!1;f.width===l[h]&&f.height===n[a]||(f.width=l[h],f.height=n[a],p=!0),this.isGridItemVisible(f)?f.initialized&&!p||(f.initialized||this.initializeGridItem(f),this.sizeGridItem(f)):f.initialized&&this.disposeGridItem(f)}}},{key:"sizeGridItem",value:function(e){e.initialized&&(e.canvas.style.left=e.left+"px",e.canvas.style.top=e.top+"px",e.canvas.style.width=e.width+"px",e.canvas.style.height=e.height+"px",e.highlightCanvas.style.left=e.left+"px",e.highlightCanvas.style.top=e.top+"px",e.highlightCanvas.style.width=e.width+"px",e.highlightCanvas.style.height=e.height+"px",e.pixelX=Math.floor(e.left*window.devicePixelRatio),e.pixelY=Math.floor(e.top*window.devicePixelRatio),e.pixelWidth=Math.floor(e.width*window.devicePixelRatio),e.pixelHeight=Math.floor(e.height*window.devicePixelRatio),e.canvas.width=e.pixelWidth,e.canvas.height=e.pixelHeight,e.highlightCanvas.width=e.pixelWidth,e.highlightCanvas.height=e.pixelHeight,e.renderTarget.setSize(e.pixelWidth,e.pixelHeight),e.pixelBuffer=new Uint8Array(4*e.pixelWidth*e.pixelHeight),e.pickingRenderTarget.setSize(e.pixelWidth,e.pixelHeight),e.pickingPixelBuffer=new Uint8Array(4*e.pixelWidth*e.pixelHeight))}},{key:"clearGeometry",value:function(){for(;this.container.lastChild;)this.container.removeChild(this.container.lastChild);this.panInteractor&&this.panInteractor.clear();for(var e=0;e<this.scenes.length;e++)this.scenes[e].traverse((function(e){e.material&&(e.material.map&&e.material.map.dispose(),e.material.dispose()),e.geometry&&e.geometry.dispose()}));this.scenes=[],this.currentScene=null,this.startCell=1,null!==this.animator&&this.animator.clear(),this.animatedGlyphs=[]}},{key:"setPickDepth",value:function(e){void 0===e&&(e=1),this.pickDepth!==e&&(this.pickDepth=e)}},{key:"setPickRay",value:function(e,t){if(e<0||t<0||e>this.width||t>this.height)return this.validPick=!1,void console.error("AVS.Three.Viewer: pick ray coordinates out of range.");this.pickType=0,this.pickRayX=e,this.pickRayY=t,this.validPick=!0}},{key:"setPickRectangle",value:function(e,t,n,r){if(e<0||t<0||n>this.width||r>this.height)return this.validPick=!1,void console.error("AVS.Three.Viewer: pick rectangle coordinates out of range.");this.pickType=1,this.pickRectangleLeft=e,this.pickRectangleTop=t,this.pickRectangleRight=n,this.pickRectangleBottom=r,this.validPick=!0}},{key:"interactorUpdate",value:function(e){e===this.transformInteractor&&void 0!==this.zoomRectangleInteractor&&e.object===this.zoomRectangleInteractor.object&&(this.zoomRectangleInteractor.scale.copy(e.object.scale),this.zoomRectangleInteractor.position.copy(e.object.position)),e===this.zoomRectangleInteractor&&void 0!==this.transformInteractor&&e.object===this.transformInteractor.object&&(this.transformInteractor.scale.copy(e.object.scale),this.transformInteractor.position.copy(e.object.position)),this.updatePicking=!0,this.renderNextFrame=!0,void 0!==this.stats&&this.stats.update()}},{key:"panInteractorUpdate",value:function(){for(var e=0;e<this.scenes.length;e++){var t=this.scenes[e];if(t.landscapeGrid)for(var n=0;n<t.landscapeRows;n++)for(var r=0;r<t.landscapeColumns;r++){var i=t.landscapeGrid[n][r];this.isGridItemVisible(i)?i.initialized||(this.initializeGridItem(i),this.sizeGridItem(i),this.renderGridItem(i,!0),this.updatePicking=!0):i.initialized&&this.disposeGridItem(i)}}}},{key:"addInteractor",value:function(e){if(e.isTransformInteractor)this.transformInteractor=e,e.addEventListener("change",this.interactorUpdate.bind(this,e));else if(e.isZoomRectangleInteractor)this.zoomRectangleInteractor=e,e.addEventListener("change",this.interactorUpdate.bind(this,e));else{if(!e.isPanInteractor)return;this.panInteractor=e,e.addEventListener("change",this.panInteractorUpdate.bind(this))}e.domElement=this.domElement}},{key:"removeInteractor",value:function(e){e.isTransformInteractor?(e.removeEventListener("change",this.interactorUpdate.bind(this,this.transformInteractor)),this.transformInteractor=void 0):e.isZoomRectangleInteractor?(e.removeEventListener("change",this.interactorUpdate.bind(this,this.zoomRectangleInteractor)),this.zoomRectangleInteractor=void 0):e.isPanInteractor&&(this.panInteractor=void 0)}},{key:"setAnimator",value:function(e){this.animator=e,e.addEventListener("change",this.interactorUpdate.bind(this))}},{key:"addStats",value:function(){void 0===this.stats&&(this.stats=new Stats,this.container.appendChild(this.stats.dom))}},{key:"addGeometry",value:function(e){e.updateMatrixWorld(),void 0!==e.internalData.background?this.container.style.backgroundColor="#"+e.internalData.background.toString(16).padStart(6,"0"):this.container.style.backgroundColor="transparent",this.processGeometry(e);for(var t=0;t<this.scenes.length;t++){var n=this.scenes[t];n.parent&&n.parent.remove(n)}}},{key:"processGeometry",value:function(e){if(e.isScene){for(var t=0;t<e.children.length;t++){var n=e.children[t];if(n.isPerspectiveCamera||n.isOrthographicCamera){e.camera=n,e.remove(n);break}}null==e.camera&&null!==e.background&&(e.camera=new Cf),void 0!==e.camera&&this.addScene(e)}this.attachInteractors(e),this.addLabels(e),this.createPickingInfo(e),this.addMaterialReferences(e),e.internalData.animatedGlyphs&&this.animatedGlyphs.push(e);var r=e.children,i=r.length;for(t=0;t<i;)this.processGeometry(r[t]),r.length<i?i=r.length:t++}},{key:"addScene",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.scenes.push(e),this.currentScene=e,t||(this.currentRealScene=e),e.labels=[],this.calculateSceneFractions(e);var n=document.createElement("div");n.style.position="absolute",n.style.overflow="hidden",n.id=e.name+"-Window";var r=document.createElement("div");r.style.position="absolute",r.style.overflow="hidden",r.id=e.name+"-Landscape",n.appendChild(r),e.landscapeDiv=r,e.windowDiv=n,this.container.appendChild(n),this.updateSceneSize(e),e.startCell=this.startCell,e.highlightScene=new fu,e.highlightScene.add(new lu);for(var i=0;i<e.children.length;i++)e.children[i].isLight&&e.highlightScene.add(e.children[i].clone())}},{key:"calculateSceneFractions",value:function(e){e.windowFractionX=e.internalData.x?Math.max(0,e.internalData.x/this.width):0,e.windowFractionWidth=e.internalData.width?Math.min(1,e.internalData.width/this.width):1,e.windowFractionY=e.internalData.y?Math.max(0,e.internalData.y/this.height):0,e.windowFractionHeight=e.internalData.height?Math.min(1,e.internalData.height/this.height):1}},{key:"createLandscapeGrid",value:function(e){void 0===e.landscapeRows&&(e.landscapeRows=1),void 0===e.landscapeColumns&&(e.landscapeColumns=1),e.landscapeGrid=[];for(var t=0;t<e.landscapeRows;t++){e.landscapeGrid.push([]);for(var n=0;n<e.landscapeColumns;n++){var r={};r.container=e.landscapeDiv,r.scene=e,r.name=e.name+"-Landscape-Grid-Row"+t+"-Col"+n,r.initialized=!1,e.landscapeGrid[t].push(r)}}this.sizeLandscapeGrid(e)}},{key:"isGridItemVisible",value:function(e){var t,n,r,i,a=e.scene,o=(null!==(t=a.baseLeft)&&void 0!==t?t:0)+(null!==(n=a.panOffsetX)&&void 0!==n?n:0)+e.left,s=o+e.width,l=(null!==(r=a.baseTop)&&void 0!==r?r:0)+(null!==(i=a.panOffsetY)&&void 0!==i?i:0)+e.top,u=l+e.height;return!(s<0||o>a.windowWidth||u<0||l>a.windowHeight)}},{key:"initializeGridItem",value:function(e){var t=document.createElement("canvas");t.style.position="absolute",t.id=e.name,e.container.insertBefore(t,e.container.firstChild),e.canvas=t,e.ctx=t.getContext("2d"),this.displayCanvas&&(t.style.backgroundColor="rgba("+255*Math.random()+","+255*Math.random()+","+255*Math.random()+",0.1)");var n=document.createElement("canvas");n.style.position="absolute",n.id=e.name+"-Highlight",e.container.appendChild(n),e.highlightCanvas=n,e.highlightCtx=n.getContext("2d"),e.renderTarget=new Wo,e.renderTarget.texture.colorSpace=Ya,e.pickingRenderTarget=new Wo,e.initialized=!0}},{key:"disposeGridItem",value:function(e){e.container.removeChild(e.canvas),e.canvas=null,e.ctx=null,e.container.removeChild(e.highlightCanvas),e.highlightCanvas=null,e.highlightCtx=null,e.renderTarget=null,e.pickingRenderTarget=null,e.initialized=!1}},{key:"attachInteractors",value:function(e){if(e.internalData.attachTransformInteractor&&this.transformInteractor&&this.transformInteractor.setObjectScene(e,this.currentScene),e.internalData.attachZoomRectangleInteractor&&this.zoomRectangleInteractor&&this.zoomRectangleInteractor.setObjectScene(e,this.currentScene),e.internalData.attachPanInteractor&&this.panInteractor){var t=this.currentRealScene,n=e.parent;n.matrix.copy(e.parent.matrixWorld),n.matrixAutoUpdate=!1,n.isScene=!0,n.autoUpdate=!0,n.overrideMaterial=null,n.internalData.is3D=!1,n.internalData.pickable=this.isObjectPickable(e.parent),n.name=e.name,n.panScene=!0,t.origCamera||(t.origCamera=t.camera.clone(),t.internalData.origWidth=t.internalData.width,t.internalData.origHeight=t.internalData.height),n.camera=t.origCamera.clone();for(var r=n.camera.right-n.camera.left,i=n.camera.top-n.camera.bottom,a=0;a<t.children.length;a++)t.children[a].isLight&&n.add(t.children[a].clone());var o=new go;o.set(-e.internalData.xSize/2,-e.internalData.ySize/2,0),o.applyMatrix4(n.matrix);var s=new go;s.set(e.internalData.xSize/2,e.internalData.ySize/2,0),s.applyMatrix4(n.matrix);var l=t.internalData.origWidth,u=t.internalData.origHeight,c=Math.floor((o.x-n.camera.left)/r*l),h=Math.floor((1-(s.x-n.camera.left)/r)*l),d=Math.floor((o.y-n.camera.bottom)/i*u),f=Math.floor((1-(s.y-n.camera.bottom)/i)*u);this.panInteractor.leftLimit=(l-this.width)/2,this.panInteractor.rightLimit=-this.panInteractor.leftLimit,this.panInteractor.topLimit=(u-this.height)/2,this.panInteractor.bottomLimit=-this.panInteractor.topLimit,n.baseLeft=this.panInteractor.rightLimit-c,n.baseTop=this.panInteractor.bottomLimit-f,n.landscapeWidth=l,n.landscapeHeight=u,n.landscapeRows=Math.ceil(u/this.height),n.landscapeColumns=Math.ceil(l/this.width),n.centerWidth=l-c-h,n.centerHeight=u-d-f,n.zoomOffsetLeft=2*c+n.baseLeft,n.zoomOffsetTop=2*f+n.baseTop,"center"===e.internalData.attachPanInteractor?(n.internalData.x=c,n.internalData.width=this.width-c-h,n.internalData.y=d,n.internalData.height=this.height-d-f,t.internalData.x=n.internalData.x,t.internalData.width=n.internalData.width,t.internalData.y=n.internalData.y,t.internalData.height=n.internalData.height,t.camera.left=o.x,t.camera.right=s.x,t.camera.bottom=o.y,t.camera.top=s.y,this.calculateSceneFractions(t),this.updateSceneSize(t)):"bottom"===e.internalData.attachPanInteractor?(n.landscapeHeight=this.height,n.landscapeRows=1,n.camera.top=n.camera.bottom+i*this.height/u,n.internalData.x=c,n.internalData.width=this.width-c-h,n.internalData.y=0,n.internalData.height=this.height-f,n.baseTop=-f):"top"===e.internalData.attachPanInteractor?(n.landscapeHeight=this.height,n.landscapeRows=1,n.camera.bottom=n.camera.top-i*this.height/u,n.internalData.x=c,n.internalData.width=this.width-c-h,n.internalData.y=d,n.internalData.height=this.height-d,n.baseTop=0):"left"===e.internalData.attachPanInteractor?(n.landscapeWidth=this.width,n.landscapeColumns=1,n.camera.right=n.camera.left+r*this.width/l,n.internalData.x=0,n.internalData.width=this.width-h,n.internalData.y=d,n.internalData.height=this.height-d-f,n.baseLeft=0):"right"===e.internalData.attachPanInteractor&&(n.landscapeWidth=this.width,n.landscapeColumns=1,n.camera.left=n.camera.right-r*this.width/l,n.internalData.x=c,n.internalData.width=this.width-c,n.internalData.y=d,n.internalData.height=this.height-d-f,n.baseLeft=-c),this.addScene(n,!0),n.parent&&n.parent.remove(n),"center"===e.internalData.attachPanInteractor?this.panInteractor.object=n:"bottom"===e.internalData.attachPanInteractor?this.panInteractor.linkObjectsBottom.push(n):"top"===e.internalData.attachPanInteractor?this.panInteractor.linkObjectsTop.push(n):"left"===e.internalData.attachPanInteractor?this.panInteractor.linkObjectsLeft.push(n):"right"===e.internalData.attachPanInteractor&&this.panInteractor.linkObjectsRight.push(n),this.panInteractor.restorePanOffset(n),this.panInteractor.update()}else if(e.internalData.attachPanInteractorStatic&&this.panInteractor){var p=this;e.traverseAncestors((function(t){"bottom"===t.internalData.attachPanInteractor?(p.panInteractor.linkObjectsBottomStatic.push(e),e.linkBottom=t):"top"===t.internalData.attachPanInteractor?(p.panInteractor.linkObjectsTopStatic.push(e),e.linkTop=t):"left"===t.internalData.attachPanInteractor?(p.panInteractor.linkObjectsLeftStatic.push(e),e.linkLeft=t):"right"===t.internalData.attachPanInteractor&&(p.panInteractor.linkObjectsRightStatic.push(e),e.linkRight=t)}))}}},{key:"createPickingInfo",value:function(e){if(void 0!==e.geometry&&void 0!==e.material){if(void 0===e.geometry.attributes.cellCount){var t,n;if(e.material.glyphs){var r=e.geometry.attributes.glyphOffset.array.length/3;n=r;for(var i=new Float32Array(r),a=0;a<r;a++)i[a]=a;t=new Zu(i,1)}else if(e.isThickLineSegments){for(n=(o=e.geometry.attributes.instanceStart.array.length/3)/2,i=new Float32Array(n),a=0;a<n;a++)i[a]=a;t=new Zu(i,1)}else{var o,s=1;for(e.isPoints?s=1:e.isLineSegments?s=2:e.isMesh&&(s=3),n=(o=e.geometry.attributes.position.array.length/3)/s,t=new El(o,1),a=0;a<n;a++)for(var l=0;l<s;l++)t.array[a*s+l]=a}e.geometry.setAttribute("cellCount",t),e.geometry.nCells=n}e.nCells=e.geometry.nCells,e.startCell=this.startCell,e.onBeforeRender=function(e,t,n,r,i,a){i.uniforms.startCell.value=this.startCell,i.uniformsNeedUpdate=!0},this.startCell+=e.nCells,this.currentScene.landscapeGrid||this.createLandscapeGrid(this.currentScene),!this.pickingRenderTarget2&&this.startCell>16777215&&(this.pickingRenderTarget2=new Wo(this.pixelWidth,this.pixelHeight),this.pickingPixelBuffer2=new Uint8Array(4*this.pixelWidth*this.pixelHeight)),this.updatePicking=!0}}},{key:"addLabels",value:function(e){e.isBillboardText&&e.addToScene(this.currentScene)}},{key:"addMaterialReferences",value:function(e){void 0!==e.material&&(e.material.pickState=this.pickState,void 0!==e.material.isLineBasicMaterial&&(e.material.resolution=this.resolution))}},{key:"loadGeometryAsJson",value:function(e){var t=this;this.objectLoader.parse(e,(function(e){t.clearGeometry(),t.updateSize(),t.addGeometry(e),t.renderNextFrame=!0}))}},{key:"runAnimation",value:function(){if(null!==this.animator){this.animator.clear();for(var e=0;e<this.scenes.length;e++)this.animator.attach(this.scenes[e]);this.animator.hasAnimations()&&this.animator.play()}}},{key:"animate",value:function(e){requestAnimationFrame(this.animate.bind(this)),this.visibleAnimatedGlyphs&&this.updateAnimatedGlyphs(this.enableAnimatedGlyphs?e:0),this.renderNextFrame&&(this.renderNextFrame=!1,this.render()),1===this.pickDepth&&this.updatePicking&&(this.updatePicking=!1,this.pickRender())}},{key:"setVisibleAnimatedGlyphs",value:function(e){this.visibleAnimatedGlyphs=e;for(var t=0;t<this.animatedGlyphs.length;t++)this.animatedGlyphs[t].traverse((function(t){t.visible=e}));this.renderNextFrame=!0}},{key:"setEnableAnimatedGlyphs",value:function(e){this.enableAnimatedGlyphs=e}},{key:"updateAnimatedGlyphs",value:function(e){for(var t=this,n=new go,r=new go,i=new go,a=new go,o=new go,s=new xo,l=new fl,u=function(){var u=t.animatedGlyphs[c];void 0===u.animatedGlyphsInitialized&&(u.animatedGlyphsInfo=JSON.parse(u.internalData.animatedGlyphs));var h=u.animatedGlyphsInfo.colorPalette,d=u.animatedGlyphsInfo.coordinates,f=u.animatedGlyphsInfo.segmentStartCoordIndex,p=u.animatedGlyphsInfo.segmentEndCoordIndex,v=u.animatedGlyphsInfo.segmentSpacing,m=u.animatedGlyphsInfo.segmentSpeed,y=u.animatedGlyphsInfo.segmentSurfaceColorIndex;if(void 0===u.animatedGlyphsInitialized){for(var g=0,_=0;_<f.length;_++)if(!(v[_]<=0||0===m[_])){for(var b=f[_],x=p[_],S=v[_],w=0,E=b;E<x;E++)n.set(d[3*E],d[3*E+1],d[3*E+2]),r.set(d[3*E+3],d[3*E+4],d[3*E+5]),w+=n.distanceTo(r);g+=Math.ceil(w/S)}u.traverse((function(e){var t=e.geometry;if(void 0!==t){var n=t.getAttribute("position");t.dispose();var r=new Df;r.setAttribute("position",n),r.setAttribute("glyphOffset",new Zu(new Float32Array(3*g),3)),r.setAttribute("glyphOrientation",new Zu(new Float32Array(9*g),9)),e.isMesh&&e.material.vertexColors&&r.setAttribute("color",new Zu(new Float32Array(3*g),3)),e.geometry=r}})),u.animatedGlyphsInitialized=!0}for(var M=[],T=[],C=[],A=0,P=0;P<f.length;P++)if(!(v[P]<=0||0===m[P])){var k=y[P];(k<0||k>h.length)&&(k=0),l.set(h[k]);for(var O=m[P]>0?1:-1,R=v[P],I=O<0?p[P]-1:f[P],N=O<0?f[P]-1:p[P],L=R/Math.abs(m[P]),D=R*(e%(1e3*L)/(1e3*L)),U=I;U!=N;U+=O){n.set(d[3*U],d[3*U+1],d[3*U+2]),r.set(d[3*U+3],d[3*U+4],d[3*U+5]);var F=n.distanceTo(r);i.subVectors(r,n).multiplyScalar(O).normalize(),a.copy(i).multiplyScalar(R),o.copy(i).multiplyScalar(D).add(O<0?r:n);var B=Math.atan2(-i.x,i.y);for(s.makeRotation(B);D<F;)M.push(o.x),M.push(o.y),M.push(o.z),T.push(s.elements[0]),T.push(s.elements[1]),T.push(s.elements[2]),T.push(s.elements[3]),T.push(s.elements[4]),T.push(s.elements[5]),T.push(s.elements[6]),T.push(s.elements[7]),T.push(s.elements[8]),C.push(l.r),C.push(l.g),C.push(l.b),o.add(a),D+=R,A++;D-=F}}u.traverse((function(e){var t=e.geometry;if(void 0!==t){var n=t.getAttribute("glyphOffset");n.set(M,0),n.needsUpdate=!0;var r=t.getAttribute("glyphOrientation");if(r.set(T,0),r.needsUpdate=!0,e.material.vertexColors){var i=t.getAttribute("color");i.set(C,0),i.needsUpdate=!0}t.instanceCount=A}})),t.renderNextFrame=!0},c=0;c<this.animatedGlyphs.length;c++)u()}},{key:"loadGeometryAsEvents",value:function(e){var t=this,n=0,r=-1,i=0;function a(e){if(i--,e.layers.set(1),e.visible=e.saveVisible,r>0&&0==i)return t.render(),t.loading=!1,void(t.firstChunk=!1)}function o(e){if("Group"===e.type){var r=t.objectLoader.parse(e);null!==t.curGroup&&t.curGroup.add(r),"SceneRoot"===r.name&&(void 0!==r.internalData.background?t.container.style.backgroundColor="#"+r.internalData.background.toString(16).padStart(6,"0"):t.container.style.backgroundColor="transparent"),r.updateMatrixWorld(!0),t.attachInteractors(r),t.curGroup=r}else if("FinishGroup"===e.type)null!==t.curGroup.parent&&(t.curGroup=t.curGroup.parent);else if("Geometry"===e.type){i++;var o=t.objectLoader.parse(e,a,t.images,t.textures,t.materials,t.geometries,t.curGroup);n++,t.addLabels(o),t.createPickingInfo(o),t.addMaterialReferences(o)}else if("Layout"===e.type){for(var s=t.objectLoader.parse(e),l=0;l<s.children.length;l++){var u=s.children[l];if(u.isPerspectiveCamera||u.isOrthographicCamera){s.camera=u,s.remove(u);break}}null==s.camera&&null!==s.background&&(s.camera=new Cf),void 0!==s.camera&&t.addScene(s),t.curGroup=s}else console.log("ERROR: unknown type: "+e.type)}if(void 0!==this.chunkId&&this.chunkId===e.chunkId||(this.clearGeometry(),this.curGroup=null,this.images=[],this.textures=[],this.materials=[],this.geometries=[],this.firstChunk=!0,this.chunkId=e.chunkId),this.loading=!0,this.updateSize(),void 0!==e&&void 0!==e.events&&0!==e.events.length){for(var s=0;s<e.events.length;s++)o(e.events[s]);!0===e.moreChunks?this.render():(r=n-1,0==i&&(this.render(),this.loading=!1)),this.firstChunk=!1}else console.error("AVS.Three.Viewer.loadGeometryAsEvents: Can't get events")}},{key:"highlightRender",value:function(){if(void 0!==this.renderer)for(var e=0;e<this.scenes.length;e++){var t=this.scenes[e];if(t.landscapeGrid){for(var n=0;n<t.landscapeRows;n++)for(var r=0;r<t.landscapeColumns;r++){var i=t.landscapeGrid[n][r];i.initialized&&(this.resolution.x=i.pixelWidth,this.resolution.y=i.pixelHeight,this.renderer.setSize(i.pixelWidth,i.pixelHeight),this.renderer.setClearColor(0,0),this.renderer.clear(),t.camera.setViewOffset(t.landscapeWidth,t.landscapeHeight,i.left,i.top,i.width,i.height),this.renderer.render(t.highlightScene,t.camera),i.highlightCtx.clearRect(0,0,i.pixelWidth,i.pixelHeight),i.highlightCtx.drawImage(this.renderer.domElement,0,0))}t.camera.clearViewOffset()}}else console.error("AVS.Three.Viewer: WebGLRenderer not set.")}},{key:"pickRender",value:function(){if(void 0!==this.renderer){for(var e=0;e<this.scenes.length;e++){var t=this.scenes[e];if(t.landscapeGrid){t.traverse((function(e){void 0!==e.material&&(e.material.transparent=!1)}));for(var n=0;n<t.landscapeRows;n++)for(var r=0;r<t.landscapeColumns;r++){var i=t.landscapeGrid[n][r];i.initialized&&(this.resolution.x=i.pixelWidth,this.resolution.y=i.pixelHeight,this.renderer.setRenderTarget(i.pickingRenderTarget),this.pickState[0]=1,this.renderer.setClearColor(0,0),this.renderer.clear(),t.camera.setViewOffset(t.landscapeWidth,t.landscapeHeight,i.left,i.top,i.width,i.height),this.renderer.render(t,t.camera),this.renderer.readRenderTargetPixels(i.pickingRenderTarget,0,0,i.pixelWidth,i.pixelHeight,i.pickingPixelBuffer),i.pickingRenderTarget2&&(this.renderer.setRenderTarget(i.pickingRenderTarget2),this.pickState[0]=2,this.renderer.clear(),this.renderer.render(t,t.camera),this.renderer.readRenderTargetPixels(i.pickingRenderTarget2,0,0,i.pixelWidth,i.pixelHeight,i.pickingPixelBuffer2)))}t.camera.clearViewOffset(),t.traverse((function(e){void 0!==e.material&&(e.material.transparent=e.material.origTransparent)}))}}this.pickState[0]=0,this.renderer.setRenderTarget(null)}else console.error("AVS.Three.Viewer: WebGLRenderer not set.")}},{key:"render",value:function(e){if(void 0!==this.renderer){if(null!==this.domElement.offsetParent){this.updateSize();for(var t=this.loading,n=e||!t,r=0;r<this.scenes.length;r++){var i=this.scenes[r];if(i.landscapeGrid){if(!n){i.camera.layers.set(1);for(var a=0;a<i.children.length;a++)i.children[a].isLight&&i.children[a].layers.set(1)}for(var o=0;o<i.landscapeRows;o++)for(var s=0;s<i.landscapeColumns;s++){var l=i.landscapeGrid[o][s];this.renderGridItem(l,n)}n||(i.camera.layers.set(0),i.traverse((function(e){e.layers.set(0)})))}for(a=0;a<i.labels.length;a++)i.labels[a].updatePosition()}this.updateHighlight&&(this.highlightRender(),this.updateHighlight=!1)}}else console.error("AVS.Three.Viewer: WebGLRenderer not set.")}},{key:"renderGridItem",value:function(e,t){if(e.initialized){var n=e.scene;if(this.resolution.x=e.pixelWidth,this.resolution.y=e.pixelHeight,t?this.renderer.setSize(e.pixelWidth,e.pixelHeight):this.renderer.setRenderTarget(e.renderTarget),(t||this.firstChunk)&&(n.internalData.background?this.renderer.setClearColor(n.internalData.background,1):this.renderer.setClearColor(0,0),this.renderer.clear()),n.camera.setViewOffset(n.landscapeWidth,n.landscapeHeight,e.left,e.top,e.width,e.height),this.renderer.render(n,n.camera),t)e.ctx.clearRect(0,0,e.pixelWidth,e.pixelHeight),e.ctx.drawImage(this.renderer.domElement,0,0);else{this.renderer.readRenderTargetPixels(e.renderTarget,0,0,e.pixelWidth,e.pixelHeight,e.pixelBuffer);for(var r,i,a=e.ctx.createImageData(e.pixelWidth,e.pixelHeight),o=4*e.pixelWidth,s=0;s<e.pixelBuffer.length;s++)r=Math.floor(s/o),i=s%o,a.data[(e.pixelHeight-r-1)*o+i]=e.pixelBuffer[s];e.ctx.putImageData(a,0,0),this.renderer.setRenderTarget(null)}n.camera.clearViewOffset()}}},{key:"addSelectionListener",value:function(e){void 0!==e&&this.selectionListeners.push(e)}},{key:"concatObjectsFromCellNums",value:function(e,t,n,r){if(void 0!==n&&0!==n.length&&0!==n[0]){for(void 0===r&&(r=t.startCell,n.sort((function(e,t){return e-t})));void 0!==t.nCells&&n[0]>=r&&n[0]<r+t.nCells;)if(t.material.glyphs||t.isThickLineSegments?e.push({object:t,index:n[0]-r}):t.isMesh?e.push({object:t,faceIndex:n[0]-r}):e.push({object:t,index:(t.isLineSegments?2:1)*(n[0]-r)}),n.splice(0,1),0===n.length)return;void 0!==t.nCells&&(r+=t.nCells);for(var i=0;i<t.children.length&&void 0!==(r=this.concatObjectsFromCellNums(e,t.children[i],n,r));i++);return r}}},{key:"pick",value:function(){if(!1!==this.validPick){this.intersects=[];for(var e=0;e<this.scenes.length;e++){var t=this.scenes[e];if(t.landscapeGrid)if(1===this.pickType){var n,r,i,a,o,s,l,u,c=Math.max(this.pickRectangleLeft,t.windowX),h=Math.max(this.pickRectangleTop,t.windowTop),d=Math.min(this.pickRectangleRight,t.windowX+t.windowWidth),f=Math.min(this.pickRectangleBottom,t.windowTop+t.windowHeight);c-=t.windowX,h-=t.windowTop,d-=t.windowX,f-=t.windowTop,c-=(null!==(n=t.panOffsetX)&&void 0!==n?n:0)+(null!==(r=t.baseLeft)&&void 0!==r?r:0),d-=(null!==(i=t.panOffsetX)&&void 0!==i?i:0)+(null!==(a=t.baseLeft)&&void 0!==a?a:0),h-=(null!==(o=t.panOffsetY)&&void 0!==o?o:0)+(null!==(s=t.baseTop)&&void 0!==s?s:0),f-=(null!==(l=t.panOffsetY)&&void 0!==l?l:0)+(null!==(u=t.baseTop)&&void 0!==u?u:0);for(var p=[],v=c;v<d;v++)for(var m=h;m<f;m++)if(0===this.pickDepth){var y=v/t.landscapeWidth*2-1,g=(t.landscapeHeight-m-1)/t.landscapeHeight*2-1;this.raycaster.setFromCamera(new mo(y,g),t.camera),this.raycaster.landscapeWidth=t.landscapeWidth,this.raycaster.landscapeHeight=t.landscapeHeight,this.raycaster.x=v,this.raycaster.y=m;var _=this.raycaster.intersectObjects(t.children,!0);this.intersects=this.intersects.concat(_)}else for(var b=0;b<t.landscapeRows;b++)for(var x=0;x<t.landscapeColumns;x++)if((k=t.landscapeGrid[b][x]).initialized&&!(v<k.left||v>k.left+k.width||m<k.top||m>k.top+k.height)){var S=Math.floor(v*window.devicePixelRatio),w=Math.floor(m*window.devicePixelRatio),E=4*(S-k.pixelX+(k.pixelHeight-(w-k.pixelY)-1)*k.pixelWidth),M=255*k.pickingPixelBuffer[E]*255+255*k.pickingPixelBuffer[E+1]+k.pickingPixelBuffer[E+2];k.pickingPixelBuffer2&&(M+=255*k.pickingPixelBuffer2[E]*255*255*255*255+255*k.pickingPixelBuffer2[E+1]*255*255*255+255*k.pickingPixelBuffer2[E+2]*255*255),M>0&&-1===p.indexOf(M)&&p.push(M)}1===this.pickDepth&&this.concatObjectsFromCellNums(this.intersects,t,p)}else{var T,C,A,P;if(this.pickRayX<t.windowX||this.pickRayX>t.windowX+t.windowWidth||this.pickRayY<t.windowTop||this.pickRayY>t.windowTop+t.windowHeight)continue;if(v=this.pickRayX-t.windowX,m=this.pickRayY-t.windowTop,v-=(null!==(T=t.panOffsetX)&&void 0!==T?T:0)+(null!==(C=t.baseLeft)&&void 0!==C?C:0),m-=(null!==(A=t.panOffsetY)&&void 0!==A?A:0)+(null!==(P=t.baseTop)&&void 0!==P?P:0),0===this.pickDepth)y=v/t.landscapeWidth*2-1,g=(t.landscapeHeight-m-1)/t.landscapeHeight*2-1,this.raycaster.setFromCamera(new mo(y,g),t.camera),this.raycaster.landscapeWidth=t.landscapeWidth,this.raycaster.landscapeHeight=t.landscapeHeight,this.raycaster.x=v,this.raycaster.y=m,_=this.raycaster.intersectObjects(t.children,!0),this.intersects=this.intersects.concat(_);else for(b=0;b<t.landscapeRows;b++)for(x=0;x<t.landscapeColumns;x++){var k;(k=t.landscapeGrid[b][x]).initialized&&!(v<k.left||v>k.left+k.width||m<k.top||m>k.top+k.height)&&(S=Math.floor(v*window.devicePixelRatio),w=Math.floor(m*window.devicePixelRatio),E=4*(S-k.pixelX+(k.pixelHeight-(w-k.pixelY)-1)*k.pixelWidth),M=255*k.pickingPixelBuffer[E]*255+255*k.pickingPixelBuffer[E+1]+k.pickingPixelBuffer[E+2],k.pickingPixelBuffer2&&(M+=255*k.pickingPixelBuffer2[E]*255*255*255*255+255*k.pickingPixelBuffer2[E+1]*255*255*255+255*k.pickingPixelBuffer2[E+2]*255*255),this.concatObjectsFromCellNums(this.intersects,t,[M]))}}}for(e=0;e<this.selectionListeners.length;e++)this.selectionListeners[e]()}else console.error("AVS.Three.Viewer: invalid pick ray or rectangle.")}},{key:"isObjectPickable",value:function(e){return void 0!==e.internalData.pickable?e.internalData.pickable:null===e.parent||this.isObjectPickable(e.parent)}},{key:"getPickedCells",value:function(){for(var e=[],t=0;t<this.intersects.length;t++){var n=this.intersects[t].object;if(this.isObjectPickable(n)){for(var r=null!==(o=this.intersects[t].faceIndex)&&void 0!==o?o:this.intersects[t].index,i=!1,a=0;a<e.length;a++){var o;if(n===e[a].object){i=!0;for(var s=!1,l=0;l<e[a].indices.length;l++)if(r===e[a].indices[l]){s=!0;break}s||e[a].indices.push(r);break}}i||e.push({object:n,indices:[r]})}}return e}},{key:"getPickedCellSets",value:function(){for(var e=[],t=0;t<this.intersects.length;t++){var n=this.intersects[t].object;if(this.isObjectPickable(n)){for(var r=!1,i=0;i<e.length;i++)if(e[i].object===n){r=!0;break}r||e.push({object:n})}}return e}},{key:"getPickedSceneNodes",value:function(){for(var e=[],t=0;t<this.intersects.length;t++){var n=this.intersects[t].object;if(this.isObjectPickable(n)){for(var r=n.parent,i=!1,a=0;a<e.length;a++)if(e[a].object===r){i=!0;break}i||e.push({object:r})}}return e}},{key:"getSelectionInfo",value:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n].object,i=e[n].indices;if(void 0!==i)for(var a=0;a<i.length;a++)t.push(o(r,{},i[a]));else t.push(o(r,{}))}function o(e,t,n){for(var r in e.userData)void 0===t[r]&&(void 0!==n&&Array.isArray(e.userData[r])?t[r]=decodeURIComponent(e.userData[r][e.isLineSegments&&!e.material.glyphs?n/2:n]):t[r]=decodeURIComponent(e.userData[r]));return e.parent?o(e.parent,t):t}return t}},{key:"highlightObjects",value:function(e,t){for(var n=!1,r=0;r<this.highlightList.length;r++)void 0!==(o=this.highlightList[r]).saveMaterial&&(o.material=o.saveMaterial,o.saveMaterial=void 0,n=!0),void 0!==o.saveGeometry&&(o.geometry=o.saveGeometry,o.saveGeometry=void 0,n=!0);for(r=0;r<this.scenes.length;r++){var i=this.scenes[r].highlightScene.children[0].children;i.length>0&&(i.length=0,this.updateHighlight=!0)}this.highlightList.length=0;var a=this;for(r=0;r<e.length;r++){var o;s(o=e[r].object,e[r].indices)}function s(e,r){if(e.isMesh||e.isLineSegments||e.isPoints){a.highlightList.push(e);var i,o=e.material.clone();if(o.opacity=1,void 0!==r){var l=e.geometry;if(o.vertexColors=!0,o.color=new fl(16777215),e.isThickLineSegments){var u;if(i=new Df,l.attributes.instancedColorStart,void 0===oldColorStart){u=new rp(new Float32Array(l.attributes.instanceStart.array.length),6,1);for(var c=0,h=0;h<u.array.length/3;h++)u.array[c++]=e.material.color.r,u.array[c++]=e.material.color.g,u.array[c++]=e.material.color.b}else u=oldColorStart.data.clone();c=null;var d=null;for(h=0;h<r.length;h++){c=6*Math.floor(r[h]/6),d=2;for(var f=0;f<d;f++)u.array[c++]=a.highlightColor.r,u.array[c++]=a.highlightColor.g,u.array[c++]=a.highlightColor.b}for(var p in i.setAttribute("instancedColorStart",new mu(u,3,0)),i.setAttribute("instancedColorEnd",new mu(u,3,3)),l.attributes)"instancedColorStart"!==p&&"instancedColorEnd"!==p&&i.setAttribute(p,l.attributes[p])}else{i=e.material.glyphs?new Df:new Rl;var v=l.attributes.color,m=null;if(void 0===v)for(m=e.material.glyphs?new Zu(new Float32Array(l.attributes.offset.array.length),3):new El(l.attributes.position.array.length,3),c=0,h=0;h<m.array.length/3;h++)m.array[c++]=e.material.color.r,m.array[c++]=e.material.color.g,m.array[c++]=e.material.color.b;else m=v.clone();for(c=null,d=null,h=0;h<r.length;h++)for(e.material.glyphs||1===e.cellType?(c=3*r[h],d=1):2===e.cellType?(c=3*r[h],d=2):3===e.cellType?(c=9*r[h],d=3):(c=18*Math.floor(r[h]/2),d=6),f=0;f<d;f++)m.array[c++]=a.highlightColor.r,m.array[c++]=a.highlightColor.g,m.array[c++]=a.highlightColor.b;for(var p in i.setAttribute("color",m),l.attributes)"color"!==p&&i.setAttribute(p,l.attributes[p])}}else o.vertexColors=!1,o.color=a.highlightColor,i=e.geometry;var y=a.getObjectScene(e);if(void 0!==y.internalData.is3D&&!1===y.internalData.is3D&&void 0!==t&&!0===t){var g=e.clone();g.material=o,g.geometry=i,g.matrixAutoUpdate=!1,g.matrix.copy(e.matrixWorld),y.highlightScene.children[0].add(g),a.updateHighlight=!0}else e.saveMaterial=e.material,e.material=o,e.saveGeometry=e.geometry,e.geometry=i,n=!0}for(var _=0;_<e.children.length;_++)s(e.children[_])}n?this.render(!0):this.updateHighlight&&(this.highlightRender(),this.updateHighlight=!1)}},{key:"getObjectScene",value:function(e){return e.isScene?e:this.getObjectScene(e.parent)}}])}(),yg={type:"change"},gg={type:"start"},_g={type:"end"},bg=function(e){function t(e){var n;py(this,t),(n=gy(this,t)).isTransformInteractor=!0,n.domElement=e,n.domElement.style.touchAction="none",n.object=new Ys,n.scene=null,n.enabled=!0,n.enableZoom=!0,n.zoomSpeed=1,n.enableRotate=!0,n.enablePan=!0,n.keyPanSpeed=7,n.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},n.touches={ONE:0,TWO:2},n.quaternion=n.object.quaternion.clone(),n.position=n.object.position.clone(),n.scale=n.object.scale.clone(),n.clientOnly=!1,n.fullReset=!1,n.quaternion0=n.object.quaternion.clone(),n.position0=n.object.position.clone(),n.scale0=n.object.scale.clone(),n._domElementKeyEvents=null,n.listenToKeyEvents=function(e){e.addEventListener("keydown",B),this._domElementKeyEvents=e},n.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",B),this._domElementKeyEvents=null},n.setObjectScene=function(e,t){r.object=e,r.scene=t,this.fullReset||e.internalData.transformFullReset?(r.quaternion.copy(r.object.quaternion),r.scale.copy(r.object.scale),r.position.copy(r.object.position),r.quaternion0.copy(r.object.quaternion),r.scale0.copy(r.object.scale),r.position0.copy(r.object.position),this.fullReset=!1):r.clientOnly&&(r.object.quaternion.copy(r.quaternion),r.object.scale.copy(r.scale),r.object.position.copy(r.position)),e.internalData.transformWheelActions&&(o=JSON.parse(e.internalData.transformWheelActions)),e.internalData.transformTriggers&&(s=JSON.parse(e.internalData.transformTriggers))},n.reset=function(){r.quaternion.copy(r.quaternion0),r.scale.copy(r.scale0),r.position.copy(r.position0),r.object.quaternion.copy(r.quaternion0),r.object.scale.copy(r.scale0),r.object.position.copy(r.position0),r.dispatchEvent(yg),a=i.NONE},n.zoomIn=function(){w(1/y(),0,0)&&r.dispatchEvent(yg)},n.zoomOut=function(){w(y(),0,0)&&r.dispatchEvent(yg)},n.panTo=function(e,t,n){var i=r.object.parent.matrixWorld,a=1/i.elements[0],o=1/i.elements[5],s=1/i.elements[10],l=i.elements[12]*a,u=i.elements[13]*o,c=i.elements[14]*s;e*=r.object.scale.x,t*=r.object.scale.y,n*=r.object.scale.z,e+=l,t+=u,n+=c,r.object.position.set(r.position0.x-e,r.position0.y-t,r.position0.z-n),r.position.copy(r.object.position),r.dispatchEvent(yg)},n.dispose=function(){r.domElement.removeEventListener("contextmenu",z),r.domElement.removeEventListener("pointerdown",L),r.domElement.removeEventListener("pointercancel",U),r.domElement.removeEventListener("wheel",F),r.domElement.removeEventListener("pointermove",D),r.domElement.removeEventListener("pointerup",U),null!==r._domElementKeyEvents&&(r._domElementKeyEvents.removeEventListener("keydown",B),r._domElementKeyEvents=null)};var r=n,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},a=i.NONE,o=[{modifiers:0,param:"ZOOM_AT_POINTER"}],s=[{buttons:1,modifiers:0,param:"ROTATE"},{buttons:2,modifiers:0,param:"SCALE"},{buttons:4,modifiers:0,param:"TRANSLATE"}],l=new mo,u=new mo,c=new mo,h=new mo,d=new mo,f=new mo,p=new mo,v=[],m={};function y(){return Math.pow(.95,r.zoomSpeed)}function g(e){return 2*(e-r.scene.windowDiv.getBoundingClientRect().left)/r.scene.windowWidth-1}function _(e){return 1-2*(e-r.scene.windowDiv.getBoundingClientRect().top)/r.scene.windowHeight}var b=function(){var e,t,n=new xs,i=new go,a=new go,o=new go,s=new xs,c=new go,h=new yo;return function(){return null!==r.object&&null!==r.object.parent&&(n.multiplyMatrices(r.scene.camera.matrixWorldInverse,r.object.parent.matrixWorld),i.set(0,0,0),a.set(l.x,l.y,1),o.set(u.x,u.y,1),s.copy(n).invert(),i.applyMatrix4(s),a.applyMatrix4(s),o.applyMatrix4(s),a.sub(i).normalize(),o.sub(i).normalize(),void 0!==r.scene.internalData.is3D&&!1===r.scene.internalData.is3D?(c.set(0,0,1),(e=a.x*o.y-a.y*o.x)<0&&(c.negate(),e=-e)):(c.crossVectors(a,o),e=c.length()),!(e<1e-5||(t=Math.abs(e)<1?2*Math.sin(e):Math.PI,a.dot(o)<0&&(t+=.5*Math.PI),h.setFromAxisAngle(c.normalize(),t),r.object.quaternion.premultiply(h),r.quaternion.copy(r.object.quaternion),0)))}}(),x=function(){var e=new xs,t=new Go,n=new go,i=new xs,a=new Go,o=new Go,s=new go,l=new go,u=new go;return function(){return null!==r.object&&null!==r.object.parent&&(e.multiplyMatrices(r.scene.camera.matrixWorldInverse,r.object.parent.matrixWorld),e.premultiply(r.scene.camera.projectionMatrix),t.set(0,0,0,1).applyMatrix4(e),n.set(t.x/t.w,t.y/t.w,t.z/t.w),i.copy(e).invert(),a.set(c.x,c.y,n.z,1),o.set(h.x,h.y,n.z,1),a.applyMatrix4(i),o.applyMatrix4(i),s.set(a.x/a.w,a.y/a.w,a.z/a.w),l.set(o.x/o.w,o.y/o.w,o.z/o.w),u.subVectors(l,s),r.object.position.add(u),r.position.copy(r.object.position),!0)}}();function S(e){return null!==r.object&&(r.object.scale.multiplyScalar(e),r.scale.copy(r.object.scale),!0)}var w=function(){var e=new xs,t=new xs,n=new Go,i=new Go,a=new go,o=new go;return function(s,l,u){return null!==r.object&&null!==r.object.parent&&(e.multiplyMatrices(r.scene.camera.matrixWorldInverse,r.object.parent.matrixWorld),e.premultiply(r.scene.camera.projectionMatrix),n.set(0,0,0,1).applyMatrix4(e),t.copy(e).invert(),i.set(l,u,n.z/n.w,1).applyMatrix4(t),a.set(i.x/i.w,i.y/i.w,i.z/i.w),a.sub(r.object.position),o.copy(a).multiplyScalar(s).add(a.negate()),r.object.scale.multiplyScalar(s),r.object.position.sub(o),r.scale.copy(r.object.scale),r.position.copy(r.object.position),!0)}}();function E(e){l.set(g(e.clientX),_(e.clientY))}function M(e){d.set(e.clientX,e.clientY)}function T(e){c.set(g(e.clientX),_(e.clientY))}function C(e){S(e.deltaY>0?y():1/y())&&r.dispatchEvent(yg)}function A(e){var t=e.deltaY>0?y():1/y();w(t,g(e.clientX),_(e.clientY))&&r.dispatchEvent(yg)}function P(){if(1===v.length)l.set(g(v[0].clientX),_(v[0].clientY));else{var e=.5*(v[0].clientX+v[1].clientX),t=.5*(v[0].clientY+v[1].clientY);l.set(g(e),_(t))}}function k(){if(1===v.length)c.set(g(v[0].clientX),_(v[0].clientY));else{var e=.5*(v[0].clientX+v[1].clientX),t=.5*(v[0].clientY+v[1].clientY);c.set(g(e),_(t))}}function O(){var e=Math.abs(v[0].clientX-v[1].clientX),t=Math.abs(v[0].clientY-v[1].clientY),n=Math.sqrt(e*e+t*t);d.set(0,n)}function R(e){if(1==v.length)u.set(g(e.clientX),_(e.clientY));else{var t=H(e),n=.5*(e.clientX+t.x),i=.5*(e.clientY+t.y);u.set(g(n),_(i))}b()&&r.dispatchEvent(yg),l.copy(u)}function I(e){if(1===v.length)h.set(g(e.clientX),_(e.clientY));else{var t=H(e),n=.5*(e.clientX+t.x),i=.5*(e.clientY+t.y);h.set(g(n),_(i))}x()&&r.dispatchEvent(yg),c.copy(h)}function N(e){var t=H(e),n=e.clientX-t.x,i=e.clientY-t.y,a=Math.sqrt(n*n+i*i);f.set(0,a),p.set(0,Math.pow(f.y/d.y,r.zoomSpeed)),S(p.y)&&r.dispatchEvent(yg),d.copy(f)}function L(e){!1!==r.enabled&&(0===v.length&&(r.domElement.setPointerCapture(e.pointerId),r.domElement.addEventListener("pointermove",D),r.domElement.addEventListener("pointerup",U)),function(e){v.push(e)}(e),"touch"===e.pointerType?function(e){switch(j(e),v.length){case 1:switch(r.touches.ONE){case 0:if(!1===r.enableRotate)return;P(),a=i.TOUCH_ROTATE;break;case 1:if(!1===r.enablePan)return;k(),a=i.TOUCH_PAN;break;default:a=i.NONE}break;case 2:switch(r.touches.TWO){case 2:if(!1===r.enableZoom&&!1===r.enablePan)return;r.enableZoom&&O(),r.enablePan&&k(),a=i.TOUCH_DOLLY_PAN;break;case 3:if(!1===r.enableZoom&&!1===r.enableRotate)return;r.enableZoom&&O(),r.enableRotate&&P(),a=i.TOUCH_DOLLY_ROTATE;break;default:a=i.NONE}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(gg)}(e):function(e){e.preventDefault();var t=0;t+=e.shiftKey?1:0,t+=e.ctrlKey?2:0,t+=e.metaKey?4:0;var n=0;switch(e.button){case 0:n=1;break;case 1:n=2;break;case 2:n=4}for(var o=0,l=s.length;o<l;o++)if(t===s[o].modifiers&&n&s[o].buttons){switch(s[o].param){case 0:case"ROTATE":if(!1===r.enableRotate)continue;E(e),a=i.ROTATE,r.domElement.ownerDocument.body.style.cursor="move";break;case 1:case"SCALE":if(!1===r.enableZoom)continue;M(e),a=i.DOLLY,r.domElement.ownerDocument.body.style.cursor="ne-resize";break;case 2:case"TRANSLATE":if(!1===r.enablePan)continue;T(e),a=i.PAN,r.domElement.ownerDocument.body.style.cursor="move";break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(gg);break}}(e))}function D(e){!1!==r.enabled&&("touch"===e.pointerType?function(e){switch(j(e),a){case i.TOUCH_ROTATE:if(!1===r.enableRotate)return;R(e);break;case i.TOUCH_PAN:if(!1===r.enablePan)return;I(e);break;case i.TOUCH_DOLLY_PAN:if(!1===r.enableZoom&&!1===r.enablePan)return;!function(e){r.enableZoom&&N(e),r.enablePan&&I(e)}(e);break;case i.TOUCH_DOLLY_ROTATE:if(!1===r.enableZoom&&!1===r.enableRotate)return;!function(e){r.enableZoom&&N(e),r.enableRotate&&R(e)}(e);break;default:a=i.NONE}}(e):function(e){if(!1!==r.enabled)switch(e.preventDefault(),a){case i.ROTATE:if(!1===r.enableRotate)return;!function(e){u.set(g(e.clientX),_(e.clientY)),b()&&r.dispatchEvent(yg),l.copy(u)}(e);break;case i.DOLLY:if(!1===r.enableZoom)return;!function(e){f.set(e.clientX,e.clientY),p.subVectors(f,d),S((Math.abs(p.x)>Math.abs(p.y)?-p.x:p.y)>0?y():1/y())&&r.dispatchEvent(yg),d.copy(f)}(e);break;case i.PAN:if(!1===r.enablePan)return;!function(e){h.set(g(e.clientX),_(e.clientY)),x()&&r.dispatchEvent(yg),c.copy(h)}(e)}}(e))}function U(e){!function(e){delete m[e.pointerId];for(var t=0;t<v.length;t++)if(v[t].pointerId==e.pointerId)return void v.splice(t,1)}(e),0===v.length&&(r.domElement.releasePointerCapture(e.pointerId),r.domElement.removeEventListener("pointermove",D),r.domElement.removeEventListener("pointerup",U)),r.domElement.ownerDocument.body.style.cursor="default",r.dispatchEvent(_g),a=i.NONE}function F(e){if(!1!==r.enabled&&!1!==r.enableZoom&&a===i.NONE){var t=0;t+=e.shiftKey?1:0,t+=e.ctrlKey?2:0,t+=e.metaKey?4:0;for(var n=0,s=o.length;n<s;n++)if(t===o[n].modifiers){switch(e.preventDefault(),o[n].param){case 0:case"ZOOM":r.dispatchEvent(gg),C(e),r.dispatchEvent(_g);break;case 1:case"ZOOM_AT_POINTER":r.dispatchEvent(gg),A(e),r.dispatchEvent(_g)}return}}}function B(e){!1!==r.enabled&&!1!==r.enablePan&&function(e){var t=!1;switch(c.set(0,0),h.set(0,0),e.code){case r.keys.UP:h.y=r.keyPanSpeed/(r.scene.windowHeight/2),t=!0;break;case r.keys.BOTTOM:h.y=-r.keyPanSpeed/(r.scene.windowHeight/2),t=!0;break;case r.keys.LEFT:h.x=-r.keyPanSpeed/(r.scene.windowWidth/2),t=!0;break;case r.keys.RIGHT:h.x=r.keyPanSpeed/(r.scene.windowWidth/2),t=!0}var n=!1;t&&(n=x(),e.preventDefault()),n&&r.dispatchEvent(yg)}(e)}function z(e){!1!==r.enabled&&e.preventDefault()}function j(e){var t=m[e.pointerId];void 0===t&&(t=new mo,m[e.pointerId]=t),t.set(e.clientX,e.clientY)}function H(e){var t=e.pointerId===v[0].pointerId?v[1]:v[0];return m[t.pointerId]}return r.domElement.addEventListener("contextmenu",z),r.domElement.addEventListener("pointerdown",L),r.domElement.addEventListener("pointercancel",U),r.domElement.addEventListener("wheel",F,{passive:!1}),r.listenToKeyEvents(window),n}return Ey(t,e),my(t)}(ro),xg={type:"change"},Sg={type:"zoom"},wg={type:"zoomEnd"},Eg={type:"start"},Mg={type:"end"},Tg=function(e){function t(e){var n;py(this,t),n=gy(this,t),void 0===e&&console.warn('AVS.Three.PanInteractor: The first parameter "domElement" is now mandatory.'),e===document&&console.error('AVS.Three.PanInteractor: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),n.isPanInteractor=!0,n.domElement=e,n.domElement.style.touchAction="none",n.object=new Ys,n.linkObjectsBottom=[],n.linkObjectsTop=[],n.linkObjectsLeft=[],n.linkObjectsRight=[],n.linkObjectsBottomStatic=[],n.linkObjectsTopStatic=[],n.linkObjectsLeftStatic=[],n.linkObjectsRightStatic=[],n.leftLimit=0,n.rightLimit=0,n.topLimit=0,n.bottomLimit=0,n.domElement=e,n.enabled=!0,n.enableZoom=!0,n.zoomSpeed=1,n.enablePan=!0,n.panSpeed=1,n.keyPanSpeed=7,n.enableKeys=!0,n.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},n.mouseButtons={LEFT:Oi.PAN,MIDDLE:Oi.NONE,RIGHT:Oi.NONE},n.touches={ONE:1,TWO:2},n._domElementKeyEvents=null,n.listenToKeyEvents=function(e){e.addEventListener("keydown",N),this._domElementKeyEvents=e},n.saveState=function(){l.copy(s),h.copy(c)},n.reset=function(){c.equals(h)?(s.copy(l),i.update()):(c.copy(h),m.set(-1,-1),s.copy(l),A()),o=a.NONE},n.update=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(void 0!==i.object&&void 0!==i.object.landscapeDiv){s.x>i.leftLimit?s.x=i.leftLimit:s.x<i.rightLimit&&(s.x=i.rightLimit),s.y<i.bottomLimit?s.y=i.bottomLimit:s.y>i.topLimit&&(s.y=i.topLimit),i.object.panOffsetX=s.x,i.object.panOffsetY=s.y,i.object.landscapeDiv.style.left=i.object.baseLeft+s.x+"px",i.object.landscapeDiv.style.top=i.object.baseTop+s.y+"px";for(var t=0,n=i.linkObjectsBottom.length;t<n;t++){var r=i.linkObjectsBottom[t];r.panOffsetX=s.x,r.landscapeDiv.style.left=r.baseLeft+s.x+"px"}for(var a=0,o=i.linkObjectsBottomStatic.length;a<o;a++)i.linkObjectsBottomStatic[a].traverse((function(e){e.isBillboardText&&(e.panOffsetX=-s.x,e.moveText())}));for(var l=0,u=i.linkObjectsTop.length;l<u;l++){var h=i.linkObjectsTop[l];h.panOffsetX=s.x,h.landscapeDiv.style.left=h.baseLeft+s.x+"px"}for(var d=0,f=i.linkObjectsTopStatic.length;d<f;d++)i.linkObjectsTopStatic[d].traverse((function(e){e.isBillboardText&&(e.panOffsetX=-s.x,e.moveText())}));for(var p=0,v=i.linkObjectsLeft.length;p<v;p++){var y=i.linkObjectsLeft[p];y.panOffsetY=s.y,y.landscapeDiv.style.top=y.baseTop+s.y+"px"}for(var g=0,_=i.linkObjectsLeftStatic.length;g<_;g++)i.linkObjectsLeftStatic[g].traverse((function(e){e.isBillboardText&&(e.panOffsetY=-s.y,e.moveText())}));for(var b=0,x=i.linkObjectsRight.length;b<x;b++){var S=i.linkObjectsRight[b];S.panOffsetY=s.y,S.landscapeDiv.style.top=S.baseTop+s.y+"px"}for(var w=0,E=i.linkObjectsRightStatic.length;w<E;w++)i.linkObjectsRightStatic[w].traverse((function(e){e.isBillboardText&&(e.panOffsetY=-s.y,e.moveText())}));e&&(xg.detail={widthZoomLevel:c.x,heightZoomLevel:c.y,panX:-s.x,panY:-s.y},i.dispatchEvent(xg)),m.set(-1,-1)}},n.restorePanOffset=function(e){m.x<0||(s.x=m.x-e.zoomOffsetLeft-Math.floor(e.centerWidth*y.x),s.y=m.y-e.zoomOffsetTop-Math.floor(e.centerHeight*y.y),i.update(!1))},n.clear=function(){this.linkObjectsBottom=[],this.linkObjectsTop=[],this.linkObjectsLeft=[],this.linkObjectsRight=[],this.linkObjectsBottomStatic=[],this.linkObjectsTopStatic=[],this.linkObjectsLeftStatic=[],this.linkObjectsRightStatic=[]},n.setWidthZoomLevel=function(e){if(!(e<100)){var t=c.x;c.x=e,c.x>d&&(c.x=d),c.x!=t&&A()}},n.setHeightZoomLevel=function(e){if(!(e<100)){var t=c.y;c.y=e,c.y>d&&(c.y=d),c.y!=t&&A()}},n.setMaximumZoomLevel=function(e){e<100||(d=e,(c.x>d||c.y>d)&&(c.x>d&&(c.x=d),c.y>d&&(c.y=d),A()))},n.dispose=function(){i.domElement.removeEventListener("contextmenu",L),i.domElement.removeEventListener("pointerdown",P),i.domElement.removeEventListener("pointercancel",R),i.domElement.removeEventListener("wheel",I),i.domElement.removeEventListener("pointermove",k),i.domElement.removeEventListener("pointerup",O),null!==i._domElementKeyEvents&&i._domElementKeyEvents.removeEventListener("keydown",N)};var r,i=n,a={NONE:-1,DOLLY:1,PAN:2,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5},o=a.NONE,s=new go,l=s.clone(),u=new mo,c=new mo(100,100),h=c.clone(),d=1e6,f=new mo,p=new mo,v=new mo,m=new mo(-1,-1),y=new mo,g=new mo,_=new mo,b=new mo,x=[],S={};function w(){return Math.pow(.95,i.zoomSpeed)}function E(){var e=!1;return c.x<100||c.y<100?(c.y<c.x?(c.x=100*c.x/c.y,c.y=100):(c.y=100*c.y/c.x,c.x=100),e=!0):(c.x>d||c.y>d)&&(c.y>c.x?(c.x=d*c.x/c.y,c.y=d):(c.y=d*c.y/c.x,c.x=d),e=!0),e}function M(e,t){var n;n=e,s.x+=n,function(e){s.y+=e}(t)}function T(e){c.multiplyScalar(e)}function C(e,t){if(!c.equals(u)){var n=i.domElement.getBoundingClientRect();m.x=Math.round(e-n.left),m.y=Math.round(t-n.top),m.x<i.object.windowX?m.x=i.object.windowX:m.x>i.object.windowX+i.object.windowWidth&&(m.x=i.object.windowX+i.object.windowWidth),m.y<i.object.windowTop?m.y=i.object.windowTop:m.y>i.object.windowTop+i.object.windowHeight&&(m.y=i.object.windowTop+i.object.windowHeight),y.x=(m.x-i.object.panOffsetX-i.object.zoomOffsetLeft)/i.object.centerWidth,y.y=(m.y-i.object.panOffsetY-i.object.zoomOffsetTop)/i.object.centerHeight,A()}}function A(){wg.detail={widthZoomLevel:c.x,heightZoomLevel:c.y},i.dispatchEvent(wg),u.copy(c)}function P(e){!1!==i.enabled&&(0===x.length&&(i.domElement.setPointerCapture(e.pointerId),i.domElement.addEventListener("pointermove",k),i.domElement.addEventListener("pointerup",O)),function(e){x.push(e)}(e),"touch"===e.pointerType?function(e){switch(U(e),x.length){case 1:if(1===i.touches.ONE){if(!1===i.enablePan)return;f.set(x[0].clientX,x[0].clientY),o=a.TOUCH_PAN}else o=a.NONE;break;case 2:if(2===i.touches.TWO){if(!1===i.enableZoom)return;!function(){var e=x[0].clientX-x[1].clientX,t=x[0].clientY-x[1].clientY,n=Math.sqrt(e*e+t*t);g.set(0,n)}(),o=a.TOUCH_DOLLY_PAN}else o=a.NONE;break;default:o=a.NONE}o!==a.NONE&&i.dispatchEvent(Eg)}(e):function(e){var t;switch(e.preventDefault(),e.button){case 0:t=i.mouseButtons.LEFT;break;case 1:t=i.mouseButtons.MIDDLE;break;case 2:t=i.mouseButtons.RIGHT;break;default:t=-1}if(t===Oi.PAN){if(!1===i.enablePan)return;!function(e){f.set(e.clientX,e.clientY)}(e),o=a.PAN,i.domElement.ownerDocument.body.style.cursor="move"}else o=a.NONE;o!==a.NONE&&i.dispatchEvent(Eg)}(e))}function k(e){!1!==i.enabled&&("touch"===e.pointerType?function(e){switch(U(e),o){case a.TOUCH_PAN:if(!1===i.enablePan)return;!function(e){p.set(e.clientX,e.clientY),v.subVectors(p,f).multiplyScalar(i.panSpeed),M(v.x,v.y),f.copy(p)}(e),i.update();break;case a.TOUCH_DOLLY_PAN:if(!1===i.enableZoom)return;!function(e){clearTimeout(r);var t=function(e){var t=e.pointerId===x[0].pointerId?x[1]:x[0];return S[t.pointerId]}(e),n=e.clientX-t.x,a=e.clientY-t.y,o=Math.sqrt(n*n+a*a);_.set(0,o),b.set(0,Math.pow(_.y/g.y,i.zoomSpeed)),T(b.y),g.copy(_);var s=.5*(e.clientX+t.x),l=.5*(e.clientY+t.y);E()?C(s,l):r=setTimeout(C,300,s,l)}(e);break;default:o=a.NONE}}(e):function(e){if(!1!==i.enabled&&(e.preventDefault(),o===a.PAN)){if(!1===i.enablePan)return;!function(e){p.set(e.clientX,e.clientY),v.subVectors(p,f).multiplyScalar(i.panSpeed),M(v.x,v.y),f.copy(p),i.update()}(e)}}(e))}function O(e){D(e),0===x.length&&(i.domElement.releasePointerCapture(e.pointerId),i.domElement.removeEventListener("pointermove",k),i.domElement.removeEventListener("pointerup",O)),i.domElement.ownerDocument.body.style.cursor="default",i.dispatchEvent(Mg),o=a.NONE}function R(e){D(e)}function I(e){!1!==i.enabled&&!1!==i.enableZoom&&o===a.NONE&&(e.preventDefault(),i.dispatchEvent(Eg),function(e){var t;clearTimeout(r),e.deltaY<0?(t=w(),c.divideScalar(t)):e.deltaY>0&&T(w());var n=E();Sg.detail={widthZoomLevel:c.x,heightZoomLevel:c.y,clientX:e.clientX,clientY:e.clientY},i.dispatchEvent(Sg),n?C(e.clientX,e.clientY):r=setTimeout(C,300,e.clientX,e.clientY)}(e),i.dispatchEvent(Mg))}function N(e){!1!==i.enabled&&!1!==i.enablePan&&function(e){var t=!1;switch(e.code){case i.keys.UP:M(0,i.keyPanSpeed),t=!0;break;case i.keys.BOTTOM:M(0,-i.keyPanSpeed),t=!0;break;case i.keys.LEFT:M(i.keyPanSpeed,0),t=!0;break;case i.keys.RIGHT:M(-i.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),i.update())}(e)}function L(e){!1!==i.enabled&&e.preventDefault()}function D(e){delete S[e.pointerId];for(var t=0;t<x.length;t++)if(x[t].pointerId==e.pointerId)return void x.splice(t,1)}function U(e){var t=S[e.pointerId];void 0===t&&(t=new mo,S[e.pointerId]=t),t.set(e.clientX,e.clientY)}return i.domElement.addEventListener("contextmenu",L),i.domElement.addEventListener("pointerdown",P),i.domElement.addEventListener("pointercancel",R),i.domElement.addEventListener("wheel",I,{passive:!1}),i.listenToKeyEvents(window),n}return Ey(t,e),my(t)}(ro),Cg={type:"change"},Ag={type:"start"},Pg={type:"end"},kg=function(e){function t(e){var n;py(this,t),n=gy(this,t),void 0===e&&console.warn('AVS.Three.ZoomRectangleInteractor: The first parameter "domElement" is now mandatory.'),e===document&&console.error('AVS.Three.ZoomRectangleInteractor: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),n.isZoomRectangleInteractor=!0,n.domElement=e,n.domElement.style.touchAction="none",n.object=new Ys,n.scene=null,n.enabled=!0,n.position=n.object.position.clone(),n.scale=n.object.scale.clone(),n.clientOnly=!1,n.fullReset=!1,n.scale0=n.object.scale.clone(),n.position0=n.object.position.clone(),n.setObjectScene=function(e,t){switch(a.object=e,a.scene=t,this.fullReset||e.internalData.zoomRectangleFullReset?(a.scale.copy(a.object.scale),a.position.copy(a.object.position),a.scale0.copy(a.object.scale),a.position0.copy(a.object.position),this.fullReset=!1):a.clientOnly&&(a.object.scale.copy(a.scale),a.object.position.copy(a.position)),e.internalData.zoomRectangleTriggers&&(l=JSON.parse(e.internalData.zoomRectangleTriggers)),r=e.internalData.zoomInMaxLimit,i=e.internalData.zoomOutMaxLimit,h=void 0!==e.internalData.zoomRectangleColor?"#"+e.internalData.zoomRectangleColor.toString(16).padStart(6,"0"):null,d=e.internalData.zoomRectangleWidth?e.internalData.zoomRectangleWidth:null,e.internalData.zoomRectanglePattern){case 0:f=[];break;case 1:f=[4,4];break;case 2:f=[1,3];break;case 3:f=[5,1,1,1];break;default:f=null}var n=document.createElement("canvas");n.style.position="absolute",n.style.width="100%",n.style.height="100%",n.id=a.scene.name+"RectCanvas",n.width=a.scene.windowWidth,n.height=a.scene.windowHeight,a.scene.windowDiv.appendChild(n),a.scene.rectCanvas=n,a.scene.rectCtx=n.getContext("2d")},n.reset=function(){a.scale.copy(a.scale0),a.position.copy(a.position0),a.object.scale.copy(a.scale0),a.object.position.copy(a.position0),a.dispatchEvent(Cg),s=o.NONE},n.dispose=function(){a.domElement.removeEventListener("contextmenu",T),a.domElement.removeEventListener("pointerdown",S),a.domElement.removeEventListener("pointercancel",M),a.domElement.removeEventListener("pointermove",w),a.domElement.removeEventListener("pointerup",E)};var r,i,a=n,o={NONE:-1,ZOOM_IN:0,ZOOM_OUT:1},s=o.NONE,l=[{buttons:1,modifiers:0,param:"ZOOM_IN"},{buttons:1,modifiers:1,param:"ZOOM_OUT"}],u=0,c=[],h=null,d=null,f=null,p=new mo,v=new mo,m=[],y={};function g(e){return Math.max(0,Math.min(e.clientX-a.scene.windowDiv.getBoundingClientRect().left,a.scene.windowWidth))}function _(e){return Math.max(0,Math.min(e.clientY-a.scene.windowDiv.getBoundingClientRect().top,a.scene.windowHeight))}var b=function(){var e=new xs,t=new xs,n=new Go,l=new Go,u=new go,c=new Go,h=new go;return function(d,f,p,v){var m=a.scene.windowWidth/(f-d),y=a.scene.windowHeight/(v-p);e.multiplyMatrices(a.scene.camera.matrixWorldInverse,a.object.parent.matrixWorld),e.premultiply(a.scene.camera.projectionMatrix),n.set(0,0,0,1).applyMatrix4(e),t.copy(e).invert();var g=1;if(s===o.ZOOM_IN){if(g=y<m?y:m,void 0!==r){var _=Math.max(Math.max(a.object.scale.x,a.object.scale.y),a.object.scale.z);g*_>r&&(g=r/_)}var b=(d+f)/a.scene.windowWidth-1,x=1-(p+v)/a.scene.windowHeight;l.set(b,x,n.z/n.w,1).applyMatrix4(t),u.set(l.x/l.w,l.y/l.w,l.z/l.w),c.set(0,0,n.z/n.w,1).applyMatrix4(t),h.set(c.x/c.w,c.y/c.w,c.z/c.w),u.sub(a.object.position),h.sub(a.object.position),u.multiplyScalar(g).sub(h),a.object.position.sub(u)}else if(s===o.ZOOM_OUT){if(g=y>m?1/y:1/m,void 0!==i){var S=Math.max(Math.max(a.object.scale.x,a.object.scale.y),a.object.scale.z);g*S<1/i&&(g=1/i/S)}l.set(0,0,n.z/n.w,1).applyMatrix4(t),u.set(l.x/l.w,l.y/l.w,l.z/l.w),u.sub(a.object.position),h.copy(u),u.multiplyScalar(g).sub(h),a.object.position.sub(u)}return a.object.scale.multiplyScalar(g),!0}}();function x(e){p.set(g(e),_(e));var t=window.getComputedStyle(a.scene.rectCanvas),n="#ff0000",r=t.getPropertyValue("--avs-drag-rectangle-stroke-style").trim();null!==h?n=h:null!==r&&r.length>0&&(n=r),a.scene.rectCtx.strokeStyle=n;var i=1,o=t.getPropertyValue("--avs-drag-rectangle-line-width").trim();null!==d?i=d:null!==o&&o.length>0&&(i=o),a.scene.rectCtx.lineWidth=i;var s=c,l=t.getPropertyValue("--avs-drag-rectangle-line-dash").trim();null!==f?s=f:null!==l&&l.length>0&&(s=JSON.parse(l)),a.scene.rectCtx.setLineDash(s),u=1}function S(e){!1!==a.enabled&&(0===m.length&&(a.domElement.setPointerCapture(e.pointerId),a.domElement.addEventListener("pointermove",w),a.domElement.addEventListener("pointerup",E)),function(e){m.push(e)}(e),function(e){var t=0;t+=e.shiftKey?1:0,t+=e.ctrlKey?2:0,t+=e.metaKey?4:0;var n=0;switch(e.button){case 0:n=1;break;case 1:n=2;break;case 2:n=4}for(var r=0,i=l.length;r<i;r++)if(t===l[r].modifiers&&n&l[r].buttons){switch(l[r].param){case 1:case"ZOOM_IN":x(e),s=o.ZOOM_IN,a.domElement.ownerDocument.body.style.cursor="zoom-in";break;case 2:case"ZOOM_OUT":x(e),s=o.ZOOM_OUT,a.domElement.ownerDocument.body.style.cursor="zoom-out";break;default:s=o.NONE}s!==o.NONE&&a.dispatchEvent(Ag);break}}(e))}function w(e){!1!==a.enabled&&function(e){!1!==a.enabled&&function(e){if(!(u<1)){if(v.set(g(e),_(e)),a.scene.rectCtx.clearRect(0,0,a.scene.windowWidth,a.scene.windowHeight),1==u){var t=Math.abs(p.x-v.x),n=Math.abs(p.y-v.y);if(t*t+n*n<25)return;u=2}var r=Math.min(p.x,v.x),i=Math.max(p.x,v.x),o=Math.min(p.y,v.y),s=Math.max(p.y,v.y);a.scene.rectCtx.strokeRect(r+.5,o+.5,i-r,s-o)}}(e)}(e)}function E(e){!1!==a.enabled&&(function(e){(function(e){if(!(u<2)){v.set(g(e),_(e)),a.scene.rectCtx.clearRect(0,0,a.scene.windowWidth,a.scene.windowHeight);var t=Math.min(p.x,v.x),n=Math.max(p.x,v.x),r=Math.min(p.y,v.y),i=Math.max(p.y,v.y);b(t,n,r,i)&&(a.scale.copy(a.object.scale),a.position.copy(a.object.position),a.dispatchEvent(Cg)),u=0}})(e),a.domElement.ownerDocument.body.style.cursor="default",a.dispatchEvent(Pg),s=o.NONE}(e),C(e),0===m.length&&(a.domElement.releasePointerCapture(e.pointerId),a.domElement.removeEventListener("pointermove",w),a.domElement.removeEventListener("pointerup",E)))}function M(e){C(e)}function T(e){!1!==a.enabled&&e.preventDefault()}function C(e){delete y[e.pointerId];for(var t=0;t<m.length;t++)if(m[t].pointerId==e.pointerId)return void m.splice(t,1)}return a.domElement.addEventListener("contextmenu",T),a.domElement.addEventListener("pointerdown",S),a.domElement.addEventListener("pointercancel",M),n}return Ey(t,e),my(t)}(ro),Og={type:"change"},Rg={type:"start"},Ig={type:"end"},Ng=function(e){function t(e){var n;return py(this,t),(n=gy(this,t)).hasStyleAnimations=!1,n.hasObjectAnimations=!1,n.createAnimationLibrary(),n.animating=0,n.mixers=[],n}return Ey(t,e),my(t,[{key:"createAnimationLibrary",value:function(){var e=[0,2],t=new Kd(".material.opacityFactor",e,[0,1]),n=new Jd(".material.transparent",e,[!0,!1]);this.fadeInClip=new nf("fade-in",-1,[t,n]),this.fadeInClip.setOnChildren=!0;var r=new Kd(".material.opacityFactor",e,[1,0]),i=new Jd(".material.transparent",e,[!0,!0]);this.fadeOutClip=new nf("fade-out",-1,[r,i]),this.fadeOutClip.setOnChildren=!0;var a=new Kd(".scaleFactorX",e,[0,1]);this.growXClip=new nf("grow-x",-1,[a]);var o=new Kd(".scaleFactorY",e,[0,1]);this.growYClip=new nf("grow-y",-1,[o]);var s=new Kd(".scaleFactorZ",e,[0,1]);this.growZClip=new nf("grow-z",-1,[s]);var l=new Kd(".material.glyphScaleFactorX",e,[0,1]);this.growXGlyphClip=new nf("grow-x-glyph",-1,[l]),this.growXGlyphClip.setOnChildren=!0;var u=new Kd(".material.glyphScaleFactorY",e,[0,1]);this.growYGlyphClip=new nf("grow-y-glyph",-1,[u]),this.growYGlyphClip.setOnChildren=!0;var c=new Kd(".material.glyphScaleFactorZ",e,[0,1]);this.growZGlyphClip=new nf("grow-z-glyph",-1,[c]),this.growZGlyphClip.setOnChildren=!0;var h=new Jd(".visible",e,[!1,!0]);this.enterAfterClip=new nf("enter-after",-1,[h]),this.enterAfterClip.setOnChildren=!0}},{key:"setStyleMap",value:function(e){if(this.hasStyleAnimations=!1,void 0!==e){var t=["scene","sceneTitle","chart","chartTitle","axis","legend","legendTitle","glyph","transform"];this.styleAnimationClips={},this.transformAnimations=void 0;for(var n=0,r=t.length;n<r;n++){var i=t[n];void 0!==e[i]&&(i.startsWith("transform")?this.transformAnimations=JSON.parse(e[i]):this.styleAnimationClips[i]=this.fillStyleClipsArray(e[i].split(","),"glyph"===i))}}}},{key:"fillStyleClipsArray",value:function(e,t){for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r].trim();"fade-in"===a?(n.push(this.fadeInClip),this.hasStyleAnimations=!0):"fade-out"===a?(n.push(this.fadeOutClip),this.hasStyleAnimations=!0):"grow-x"===a?(n.push(t?this.growXGlyphClip:this.growXClip),this.hasStyleAnimations=!0):"grow-y"===a?(n.push(t?this.growYGlyphClip:this.growYClip),this.hasStyleAnimations=!0):"grow-z"===a?(n.push(t?this.growZGlyphClip:this.growZClip),this.hasStyleAnimations=!0):"enter-after"===a&&(n.push(this.enterAfterClip),this.hasStyleAnimations=!0)}return n}},{key:"fillObjectClipsArray",value:function(e,t){var n=[];return!!(1&e)&&(n.push(this.fadeInClip),this.hasObjectAnimations=!0),!!(2&e)&&(n.push(this.fadeOutClip),this.hasObjectAnimations=!0),!!(4&e)&&(n.push(t?this.growXGlyphClip:this.growXClip),this.hasObjectAnimations=!0),!!(8&e)&&(n.push(t?this.growYGlyphClip:this.growYClip),this.hasObjectAnimations=!0),!!(16&e)&&(n.push(t?this.growZGlyphClip:this.growZClip),this.hasObjectAnimations=!0),!!(32&e)&&(n.push(this.enterAfterClip),this.hasObjectAnimations=!0),n}},{key:"hasAnimations",value:function(){return this.hasStyleAnimations||this.hasObjectAnimations||this.transformAnimations}},{key:"clear",value:function(){this.mixers=[],this.hasObjectAnimations=!1}},{key:"attach",value:function(e){var t=this,n=this.createMixers.bind(this);this.createMixers(e,this.styleAnimationClips.scene),e.traverse((function(e){if(e.internalData.animations){var r=t.fillObjectClipsArray(e.internalData.animations,"GLYPH"===e.internalData.visualizationGroup);n(e,r)}if(e.internalData.attachTransformInteractor&&t.transformAnimations){var i=new go,a=new yo,o=new Os,s=new go;e.matrix.decompose(i,a,s);for(var l=[],u=[],c=[],h=[],d=!1,f=0,p=t.transformAnimations.length;f<p;f++){var v=t.transformAnimations[f];void 0===v.time&&(console.error("AVS.Three.Animator: Missing time value from transform animation index "+f),d=!0),l.push(v.time/1e3),void 0!==v.position&&i.set(v.position[0],v.position[1],v.position[2]),u.push(i.x),u.push(i.y),u.push(i.z),void 0!==v.scale&&s.set(v.scale/100,v.scale/100,v.scale/100),h.push(s.x),h.push(s.y),h.push(s.z),void 0!==v.rotation&&(o.set(v.rotation[0]*Math.PI/180,v.rotation[1]*Math.PI/180,v.rotation[2]*Math.PI/180,v.rotation[3]),a.setFromEuler(o)),c.push(a.x),c.push(a.y),c.push(a.z),c.push(a.w)}if(!d){var m=new tf(".position",l,u),y=new Qd(".quaternion",l,c),g=new tf(".scale",l,h),_=new nf("transform",-1,[m,y,g]);n(e,[_])}}"SCENE_TITLE"===e.internalData.visualizationGroup&&n(e,t.styleAnimationClips.sceneTitle),"CHART"===e.internalData.visualizationGroup&&n(e,t.styleAnimationClips.chart),"CHART_TITLE"===e.internalData.visualizationGroup&&n(e,t.styleAnimationClips.chartTitle),"AXIS"===e.internalData.visualizationGroup&&n(e,t.styleAnimationClips.axis),"LEGEND"===e.internalData.visualizationGroup&&n(e,t.styleAnimationClips.legend),"LEGEND_TITLE"===e.internalData.visualizationGroup&&n(e,t.styleAnimationClips.legendTitle),"GLYPH"===e.internalData.visualizationGroup&&n(e,t.styleAnimationClips.glyph)}))}},{key:"createMixers",value:function(e,t){var n=this;if(void 0!==t)for(var r=function(){var r;if(t[i].setOnChildren?e.traverse((function(e){e.material&&(void 0===r&&(r=new Qf),r.add(e))})):r=e,void 0!==r){var a=new np(r);a.clip=t[i],n.mixers.push(a)}},i=0,a=t.length;i<a;i++)r()}},{key:"play",value:function(){this.mixers.length<=0&&(this.dispatchEvent(Rg),this.dispatchEvent(Og),this.dispatchEvent(Ig)),this.animating=0,this.finishedFunc=this.animationFinished.bind(this);for(var e=0,t=this.mixers.length;e<t;e++){var n=this.mixers[e];n.addEventListener("finished",this.finishedFunc);var r=n.clipAction(n.clip);n.action=r,r.repetitions=1,r.clampWhenFinished=!0,r.play(),this.animating++}this.dispatchEvent(Rg),this.clock=new Vf,this.animate()}},{key:"animationFinished",value:function(e){e.target.removeEventListener("finished",this.finishedFunc),this.animating--}},{key:"animate",value:function(){if(this.animating<=0)this.dispatchEvent(Ig);else{requestAnimationFrame(this.animate.bind(this));for(var e=this.clock.getDelta(),t=0,n=this.mixers.length;t<n;t++)this.mixers[t].action.isRunning()&&this.mixers[t].update(e);this.dispatchEvent(Og)}}}])}(ro),Lg=n(939);function Dg(e){return Dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dg(e)}function Ug(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Fg(r.key),r)}}function Fg(e){var t=function(e){if("object"!=Dg(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Dg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Dg(t)?t:t+""}function Bg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bg=function(){return!!e})()}function zg(e){return zg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zg(e)}function jg(e,t){return jg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jg(e,t)}var Hg,Vg=(0,Me.y)((function(e){return function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=zg(t),function(e,t){if(t&&("object"==Dg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Bg()?Reflect.construct(t,n||[],zg(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jg(e,t)}(t,e),n=t,i=[{key:"properties",get:function(){return{streamEnable:{type:Boolean},streamChunkSizeFirst:{type:Number},streamChunkSize:{type:Number}}}}],(r=[{key:"_addStreamProperties",value:function(e){this.streamEnable&&(e.streamProperties={},void 0!==this.streamChunkSizeFirst&&(e.streamProperties.chunkSizeFirst=this.streamChunkSizeFirst),void 0!==this.streamChunkSize&&(e.streamProperties.chunkSize=this.streamChunkSize))}}])&&Ug(n.prototype,r),i&&Ug(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(e)}));function Gg(e){return Gg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gg(e)}function Wg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xg(r.key),r)}}function Xg(e){var t=function(e){if("object"!=Gg(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Gg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gg(t)?t:t+""}function qg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qg=function(){return!!e})()}function Yg(){return Yg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Jg(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Yg.apply(null,arguments)}function Jg(e){return Jg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jg(e)}function Zg(e,t){return Zg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zg(e,t)}var Kg,$g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Jg(t),function(e,t){if(t&&("object"==Gg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qg()?Reflect.construct(t,n||[],Jg(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zg(e,t)}(t,e),n=t,r=[{key:"_rectangleStyle",value:function(){this.rectCtx.setLineDash([3]),this.rectCtx.strokeStyle="#ff0000"}},{key:"_assembleModel",value:function(e){if(void 0!==this.sceneName){var t={},n={name:this.sceneName};void 0!==this.sceneUserProperties&&(n.userProperties=this.sceneUserProperties),t.sceneProperties=n;var r={width:this.width,height:this.height,name:this.rendererName,type:this.renderer};void 0!==this.rendererUserProperties&&(r.userProperties=this.rendererUserProperties),t.rendererProperties=r,void 0!==this.transformInteractor&&(this.transformMatrix=this.transformInteractor.object.matrix.elements.slice(),this.transformClientOnly=this.transformInteractor.clientOnly),void 0===this.transformMatrix||this.transformClientOnly||(r.transformMatrix=this.transformMatrix),void 0!==e&&(this.transformClientOnly&&void 0!==this.transformInteractor?this.transformInteractor.fullReset=e:r.fullReset=!0),this.panEnable&&(r.panProperties={widthZoomLevel:this.panWidthZoomLevel,heightZoomLevel:this.panHeightZoomLevel}),r.themeName=this.themeName;var i=window.getComputedStyle(this,null),a=i.getPropertyValue("background-color").trim(),o=i.getPropertyValue("color").trim(),s=i.getPropertyValue("font-family").trim().replace(/['"]+/g,"");if(r.cssProperties={sceneBackgroundType:"Solid",sceneBackgroundColor:a,sceneLineColor:o,sceneTextColor:o,sceneFontFamily:s,sceneSurfaceColor:o},this._applyCustomCssProperties(r.cssProperties,i,{sceneBackgroundType:"--avs-scene-background-type",sceneBackgroundColor:"--avs-scene-background-color",sceneBackgroundStartColor:"--avs-scene-background-start-color",sceneBackgroundEndColor:"--avs-scene-background-end-color",sceneBackgroundGradientStyle:"--avs-scene-background-gradient-style",sceneBackgroundGradientInterpolation:"--avs-scene-background-gradient-interpolation",sceneBackgroundGradientColorRepeat:"--avs-scene-background-gradient-color-repeat",sceneHighlightColor:"--avs-scene-highlight-color",sceneSurfaceColor:"--avs-scene-surface-color",scenePointColor:"--avs-scene-point-color",sceneLineColor:"--avs-scene-line-color",sceneLineWidth:"--avs-scene-line-width",sceneLineOpacity:"--avs-scene-line-opacity",sceneTextColor:"--avs-scene-text-color",sceneTextRotation:"--avs-scene-text-rotation",sceneFontFamily:"--avs-scene-font-family",sceneFontStyle:"--avs-scene-font-style",sceneFontWeight:"--avs-scene-font-weight",sceneFontSize:"--avs-scene-font-size",sceneTitleTextColor:"--avs-scene-title-text-color",sceneTitleTextRotation:"--avs-scene-title-text-rotation",sceneTitleFontFamily:"--avs-scene-title-font-family",sceneTitleFontStyle:"--avs-scene-title-font-style",sceneTitleFontWeight:"--avs-scene-title-font-weight",sceneTitleFontSize:"--avs-scene-title-font-size",chartBackgroundType:"--avs-chart-background-type",chartBackgroundColor:"--avs-chart-background-color",chartBackgroundStartColor:"--avs-chart-background-start-color",chartBackgroundEndColor:"--avs-chart-background-end-color",chartBackgroundGradientStyle:"--avs-chart-background-gradient-style",chartBackgroundGradientInterpolation:"--avs-chart-background-gradient-interpolation",chartBackgroundGradientColorRepeat:"--avs-chart-background-gradient-color-repeat",chartHighlightColor:"--avs-chart-highlight-color",chartSurfaceColor:"--avs-chart-surface-color",chartPointColor:"--avs-chart-point-color",chartLineColor:"--avs-chart-line-color",chartLineWidth:"--avs-chart-line-width",chartLinePattern:"--avs-chart-line-pattern",chartLineOpacity:"--avs-chart-line-opacity",chartTextColor:"--avs-chart-text-color",chartTextRotation:"--avs-chart-text-rotation",chartFontFamily:"--avs-chart-font-family",chartFontStyle:"--avs-chart-font-style",chartFontWeight:"--avs-chart-font-weight",chartFontSize:"--avs-chart-font-size",chartTitleTextColor:"--avs-chart-title-text-color",chartTitleTextRotation:"--avs-chart-title-text-rotation",chartTitleFontFamily:"--avs-chart-title-font-family",chartTitleFontStyle:"--avs-chart-title-font-style",chartTitleFontWeight:"--avs-chart-title-font-weight",chartTitleFontSize:"--avs-chart-title-font-size",axisLineColor:"--avs-axis-line-color",axisLineWidth:"--avs-axis-line-width",axisLineOpacity:"--avs-axis-line-opacity",axisTextColor:"--avs-axis-text-color",axisTextRotation:"--avs-axis-text-rotation",axisFontFamily:"--avs-axis-font-family",axisFontStyle:"--avs-axis-font-style",axisFontWeight:"--avs-axis-font-weight",axisFontSize:"--avs-axis-font-size",axisAxleColor:"--avs-axis-axle-color",axisAxleWidth:"--avs-axis-axle-width",axisTickMarkColor:"--avs-axis-tick-mark-color",axisTickMarkWidth:"--avs-axis-tick-mark-width",axisTickLineColor:"--avs-axis-tick-line-color",axisTickLineWidth:"--avs-axis-tick-line-width",axisTickLineStyle:"--avs-axis-tick-line-style",axisTitleTextColor:"--avs-axis-title-text-color",axisTitleTextRotation:"--avs-axis-title-text-rotation",axisTitleFontFamily:"--avs-axis-title-font-family",axisTitleFontStyle:"--avs-axis-title-font-style",axisTitleFontWeight:"--avs-axis-title-font-weight",axisTitleFontSize:"--avs-axis-title-font-size",axisUnitTextColor:"--avs-axis-unit-text-color",axisUnitTextRotation:"--avs-axis-unit-text-rotation",axisUnitFontFamily:"--avs-axis-unit-font-family",axisUnitFontStyle:"--avs-axis-unit-font-style",axisUnitFontWeight:"--avs-axis-unit-font-weight",axisUnitFontSize:"--avs-axis-unit-font-size",axisLabelTextColor:"--avs-axis-label-text-color",axisLabelTextRotation:"--avs-axis-label-text-rotation",axisLabelFontFamily:"--avs-axis-label-font-family",axisLabelFontStyle:"--avs-axis-label-font-style",axisLabelFontWeight:"--avs-axis-label-font-weight",axisLabelFontSize:"--avs-axis-label-font-size",legendBackgroundColor:"--avs-legend-background-color",legendTextColor:"--avs-legend-text-color",legendTextRotation:"--avs-legend-text-rotation",legendFontFamily:"--avs-legend-font-family",legendFontStyle:"--avs-legend-font-style",legendFontWeight:"--avs-legend-font-weight",legendFontSize:"--avs-legend-font-size",legendTitleTextColor:"--avs-legend-title-text-color",legendTitleTextRotation:"--avs-legend-title-text-rotation",legendTitleFontFamily:"--avs-legend-title-font-family",legendTitleFontStyle:"--avs-legend-title-font-style",legendTitleFontWeight:"--avs-legend-title-font-weight",legendTitleFontSize:"--avs-legend-title-font-size",defaultPointSize:"--avs-default-point-size",defaultGlyphSize:"--avs-default-glyph-size",minGlyphSize:"--avs-min-glyph-size",maxGlyphSize:"--avs-max-glyph-size"}),this._addDataSourceProperties(t),"THREEJS"===this.renderer){this._addStreamProperties(r);var l={};this._applyCustomCssProperties(l,i,{scene:"--avs-scene-animations",sceneTitle:"--avs-scene-title-animations",chart:"--avs-chart-animations",chartTitle:"--avs-chart-title-animations",axis:"--avs-axis-animations",legend:"--avs-legend-animations",legendTitle:"--avs-legend-title-animations",glyph:"--avs-glyph-animations",transform:"--avs-transform-animation"}),this.animator.setStyleMap(l)}return t}this._logError(JSON.stringify({GoType:1,error:"'scene-name' property must be set to the name of the scene registered in the library map on the server."}))}},{key:"_applyCustomCssProperties",value:function(e,t,n){for(var r in n)if(n.hasOwnProperty(r)){var i=t.getPropertyValue(n[r]).trim();i.length>0&&(e[r]=i)}}},{key:"_onResize",value:function(){!this.urlLoadJsonFile&&!this.manualUpdate&&this.resizeThreshold>0&&(this.clientWidth<this.lowResizeWidth||this.clientWidth>this.highResizeWidth||this.clientHeight<this.lowResizeHeight||this.clientHeight>this.highResizeHeight)?this.updateViewer():this._updateViewerClient()}},{key:"_updateSize",value:function(){this.width=this.clientWidth,this.width<=0?(this.width=200,this.$.container.style.width=this.width+"px"):this.$.container.style.width="100%",this.height=this.clientHeight,this.height<=0?(this.aspectRatio>.1?this.height=this.width/this.aspectRatio:this.height=200,this.$.container.style.height=this.height+"px"):this.$.container.style.height="100%",this.rectCanvas&&(this.rectCanvas.width=this.width,this.rectCanvas.height=this.height)}},{key:"showSpinner",value:function(){var e=this,t=window.getComputedStyle(this,null).getPropertyValue("--avs-spinner").trim().replace(/['"]+/g,"");t.length>0?fetch(t).then((function(e){if(!e.ok)throw new Error(e);return e.text()})).then((function(t){e.$.spinner.innerHTML=t})).catch((function(t){e.$.spinner.innerHTML=""})):this.$.spinner.innerHTML='<svg viewBox="0 0 12.170833 12.170834" height="46" width="46"><path d="M 7.2486073,9.9076469 H 5.2849946 L 8.4704866,6.123394 6.2360101,3.4130208 7.1885217,2.271515 10.424524,6.122616 Z M 6.0677825,8.6164059 3.9785527,6.1181874 6.0843599,3.5947138 8.1676051,6.1217782 Z M 1.7215741,6.1177086 6.5503222,0.33124232 H 8.5047186 L 3.6754319,6.1184268 5.9155339,8.7972611 4.958833,9.9337997 Z M 7.3399924,2.0900614 9.0019205,0.09856041 H 6.441462 L 1.4175556,6.1188457 4.7994028,10.140329 H 7.3569887 L 10.728423,6.122616 Z" style="display:inline;fill:#2e8cbd;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0598462" id="path22" /><path d="M 7.2486073,9.9076469 H 5.2849946 L 8.4704866,6.123394 6.2360101,3.4130208 7.1885217,2.271515 10.424524,6.122616 Z M 6.0677825,8.6164059 3.9785527,6.1181874 6.0843599,3.5947138 8.1676051,6.1217782 Z M 1.7215741,6.1177086 6.5503222,0.33124232 H 8.5047186 L 3.6754319,6.1184268 5.9155339,8.7972611 4.958833,9.9337997 Z M 7.3399924,2.0900614 9.0019205,0.09856041 H 6.441462 L 1.4175556,6.1188457 4.7994028,10.140329 H 7.3569887 L 10.728423,6.122616 Z" style="fill:none;stroke:#2e8cbd;stroke-width:0.179539;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" id="path26" /><g id="g78" class="spinnerBackground"><path d="M 5.0916012,7.2951741 C 4.5581951,6.6568 4.1217726,6.1273448 4.1217726,6.1186069 c 0,-0.022412 1.9511841,-2.3603376 1.9654853,-2.3550616 0.00645,0.00237 0.4481639,0.5337638 0.981573,1.1808488 L 8.0386633,6.1209126 7.7794202,6.4289493 C 7.6368389,6.5983701 7.1955674,7.1235887 6.7988191,7.5961017 6.4020707,8.0686158 6.0738528,8.4553619 6.0694438,8.4555369 6.0650388,8.4557059 5.6250056,7.9335497 5.0916012,7.2951741 Z" id="path39" /><path d="M 5.5264617,9.7764122 C 5.5385577,9.7616559 6.2319291,8.9374956 7.0672769,7.9449584 7.9026265,6.9524246 8.5861155,6.1329723 8.5861409,6.1239554 8.5861681,6.1149485 8.0879549,5.5032753 7.4789997,4.7647 6.8700453,4.0261248 6.3741103,3.4156149 6.3769213,3.4080117 6.3797713,3.4004117 6.562373,3.1774787 6.7827896,2.9126121 7.164399,2.4540426 7.1848936,2.4323657 7.2117806,2.4588741 7.2273026,2.4741751 7.9274525,3.3048587 8.767655,4.3048177 L 10.295296,6.1229243 9.4136171,7.1736012 C 8.9286921,7.751474 8.2336861,8.5795488 7.8691565,9.0137659 L 7.2063776,9.8032561 H 6.3554188 c -0.7939025,0 -0.8494825,-0.00179 -0.8289571,-0.026839 z" id="path41" /><path d="M 3.4382986,7.9881037 C 2.6063322,7.0074024 1.9089456,6.1852746 1.8885531,6.1611518 L 1.8514763,6.1172937 4.2262773,3.2714352 6.6010789,0.42557499 H 7.4490822 8.2970851 L 7.0763447,1.8883334 c -3.0218884,3.6209928 -3.5158893,4.2139972 -3.519859,4.2252855 -0.00231,0.00662 0.4954141,0.6094855 1.1060858,1.3397178 0.6106728,0.7302338 1.1103133,1.3348316 1.1103133,1.3435515 0,0.017734 -0.7956667,0.9718373 -0.8117152,0.9733472 -0.00562,5.108e-4 -0.6909038,-0.80143 -1.522871,-1.7821306 z" id="path43" /></g></svg>',this.$.spinner.style.display="block"}},{key:"hideSpinner",value:function(){this.$.spinner.style.display="none"}},{key:"startSpinner",value:function(){this.$.spinner.className="spin"}},{key:"stopSpinner",value:function(){this.$.spinner.className=""}},{key:"updateViewer",value:function(e){if(this._updateSize(),this.lowResizeWidth=(100-this.resizeThreshold)/100*this.width,this.highResizeWidth=(100+this.resizeThreshold)/100*this.width,this.lowResizeHeight=(100-this.resizeThreshold)/100*this.height,this.highResizeHeight=(100+this.resizeThreshold)/100*this.height,this.showSpinner(),void 0!==this.url&&null!==this.url)if(this.startSpinner(),this.urlLoadJsonFile)this.chunkFile=0,this._httpRequest(this.url,this._handleHttpResponse.bind(this),void 0,this._handleHttpError.bind(this));else{var t=this._assembleModel(e);void 0!==t&&this._httpRequest(this.url,this._handleHttpResponse.bind(this),void 0,this._handleHttpError.bind(this),t)}}},{key:"_handleHttpError",value:function(e){this.hideSpinner()}},{key:"_updateViewerClient",value:function(){this._updateSize(),"THREEJS"===this.renderer&&this.threeViewer.render(!0)}},{key:"clear",value:function(){if("THREEJS"===this.renderer)this.threeViewer.clearGeometry(),this.threeViewer.render();else if("SVG"===this.renderer)for(var e=this.svgDiv;e.firstChild;)e.removeChild(e.firstChild);else this.sceneImage.src="data:,";this.showSpinner()}},{key:"_handleHttpResponse",value:function(e){var t=!0;if(void 0!==e){if(void 0!==e.selectionInfo&&this._dispatchPickEvents(e.selectionInfo),void 0!==e.sceneInfo){var n={detail:e.sceneInfo};if(this.dispatchEvent(new CustomEvent("avs-scene-info",n)),void 0!==e.sceneInfo.backgroundColor){var r=e.sceneInfo.backgroundColor.match(/[0-9.]+/gi),i=window.getComputedStyle(this.parentNode,null).getPropertyValue("background-color").trim().match(/[0-9.]+/gi),a=r[0]*r[3],o=r[1]*r[3],s=r[2]*r[3];i&&(a+=i[0]*(1-r[3]),o+=i[1]*(1-r[3]),s+=i[2]*(1-r[3])),this.$.zoomOverlay.style.color="var(--avs-zoom-overlay-color, rgb("+a+","+o+","+s+"))",this.$.tooltip.style.color="var(--avs-tooltip-color, rgb("+a+","+o+","+s+"))"}void 0!==e.sceneInfo.color&&(r=e.sceneInfo.color.match(/[0-9.]+/gi),this.$.zoomOverlay.style.background="var(--avs-zoom-overlay-background, rgba("+r[0]+","+r[1]+","+r[2]+"))",this.$.tooltip.style.background="var(--avs-tooltip-background, rgb("+r[0]+","+r[1]+","+r[2]+"))"),void 0!==e.sceneInfo.fontFamily&&(this.$.zoomOverlay.style.fontFamily="var(--avs-zoom-overlay-font-family, "+e.sceneInfo.fontFamily+")",this.$.tooltip.style.fontFamily="var(--avs-tooltip-font-family, "+e.sceneInfo.fontFamily+")")}if(void 0!==e.image)e.image.startsWith("?app=image")?this.sceneImage.src=this.url+e.image:this.sceneImage.src=e.image,void 0!==e.imagemap?(this.sceneImageMap.innerHTML=decodeURIComponent(e.imagemap.replace(/\+/g,"%20")),this.imageMapData=Array.from(this.sceneImageMap.querySelectorAll("area")).map((function(e){return{shape:e.getAttribute("shape"),coords:e.getAttribute("coords").split(",").map(Number),seriesIndex:e.getAttribute("series-index"),itemIndex:e.getAttribute("item-index"),componentInfo:e.getAttribute("component-info")}}))):(this.sceneImageMap.innerHTML="",this.imageMapData=void 0);else if(void 0!==e.svg)this.svgDiv.innerHTML=decodeURIComponent(e.svg.replace(/\+/g,"%20"));else if(void 0!==e.threejs)this.threeViewer.loadGeometryAsJson(e.threejs);else if(void 0!==e.chunkId){if(this.threeViewer.loadGeometryAsEvents(e),!0===e.moreChunks){if(this.urlLoadJsonFile){this.chunkFile++;var l=this.url.substring(0,this.url.lastIndexOf("."))||this.url,u=this.url.split(".").pop();this._httpRequest(l+"-"+this.chunkFile+"."+u,this._handleHttpResponse.bind(this),void 0,this._handleHttpError.bind(this))}else{var c=this._assembleModel();void 0!==c&&(c.rendererProperties.streamProperties.chunkId=e.chunkId,this._httpRequest(this.url,this._handleHttpResponse.bind(this),void 0,this._handleHttpError.bind(this),c))}t=!1}}else this.urlLoadJsonFile&&this.threeViewer.loadGeometryAsJson(e)}t&&(this.hideSpinner(),this.stopSpinner(),this.dispatchEvent(new CustomEvent("avs-load-complete")))}},{key:"_handleTap",value:function(e){var t=this._getAdjustedCoords(e.detail.x,e.detail.y),n={type:"TAP",x:t.x,y:t.y};void 0!==this.tapLevel&&(n.level=this.tapLevel),void 0!==this.tapDepth&&(n.depth=this.tapDepth),this.tapHighlightEnable&&(n.highlight=!0),void 0!==this.tapHighlightColor&&(n.highlightColor=this.tapHighlightColor),this.tapHighlightLayerEnable&&(n.highlightLayer=!0),this._processPick(n,this.tapProcessEventOnClient,e.originalTarget)}},{key:"_handleTrack",value:function(e){var t=this._getAdjustedRectangleCoords(e);switch(e.detail.state){case"start":break;case"track":this.rectCtx.clearRect(0,0,this.width,this.height),this._rectangleStyle(),this.rectCtx.strokeRect(t.left,t.top,t.right-t.left,t.bottom-t.top);break;case"end":this.rectCtx.clearRect(0,0,this.width,this.height);var n={type:"TRACK"};n.left=t.left,n.right=t.right,n.top=t.top,n.bottom=t.bottom,void 0!==this.trackLevel&&(n.level=this.trackLevel),void 0!==this.trackDepth&&(n.depth=this.trackDepth),this.trackHighlightEnable&&(n.highlight=!0),void 0!==this.trackHighlightColor&&(n.highlightColor=this.trackHighlightColor),this.trackHighlightLayerEnable&&(n.highlightLayer=!0),this._processPick(n,this.trackProcessEventOnClient)}}},{key:"_handlePointerDown",value:function(e){this.pointerDownX=e.clientX,this.pointerDownY=e.clientY,this.pointerDown=!0,this.tapEnable&&1&e.buttons&&(this.tapping=!0),this.trackEnable&&2&e.buttons&&(this.tracking=1)}},{key:"_handlePointerMove",value:function(e){if(this.tracking>=1){if(1===this.tracking){var t=Math.abs(e.clientX-this.pointerDownX),n=Math.abs(e.clientY-this.pointerDownY);t*t+n*n>=5&&(this.tracking=2,this._handleTrack({detail:{state:"start",x:e.clientX,y:e.clientY,dx:e.clientX-this.pointerDownX,dy:e.clientY-this.pointerDownY}}))}2===this.tracking&&this._handleTrack({detail:{state:"track",x:e.clientX,y:e.clientY,dx:e.clientX-this.pointerDownX,dy:e.clientY-this.pointerDownY}})}if(this.hoverEnable){var r=this._getAdjustedCoords(e.clientX,e.clientY),i={type:"HOVER",x:r.x,y:r.y};this.pointerDown?(i.selected={},this._dispatchPickEvents(i)):(void 0!==this.hoverLevel&&(i.level=this.hoverLevel),void 0!==this.hoverDepth&&(i.depth=this.hoverDepth),this.hoverHighlightEnable&&(i.highlight=!0),void 0!==this.hoverHighlightColor&&(i.highlightColor=this.hoverHighlightColor),this.hoverHighlightLayerEnable&&(i.highlightLayer=!0),this._processPick(i,!0,e.originalTarget))}this._resetTimer()}},{key:"_handlePointerUp",value:function(e){if(this.pointerDown=!1,this.tapping){this.tapping=!1;var t=Math.abs(e.clientX-this.pointerDownX),n=Math.abs(e.clientY-this.pointerDownY);t*t+n*n<25&&this._handleTap({detail:{x:e.clientX,y:e.clientY}})}this.tracking>1&&(this.tracking=0,this._handleTrack({detail:{state:"end",x:e.clientX,y:e.clientY,dx:e.clientX-this.pointerDownX,dy:e.clientY-this.pointerDownY}}))}},{key:"_getAdjustedCoords",value:function(e,t){var n=this.$.dataVizDiv.getBoundingClientRect();return e=Math.round(e-n.left),t=Math.round(t-n.top),{x:Math.max(0,Math.min(e,this.width)),y:Math.max(0,Math.min(t,this.height))}}},{key:"_getAdjustedRectangleCoords",value:function(e){var t=this.$.dataVizDiv.getBoundingClientRect(),n=Math.round(e.detail.x-t.left),r=Math.round(e.detail.y-t.top),i=Math.max(0,Math.min(n,this.width)),a=Math.max(0,Math.min(r,this.height)),o=n-e.detail.dx,s=r-e.detail.dy;return{left:Math.min(o,i),right:Math.max(o,i),top:Math.min(s,a),bottom:Math.max(s,a)}}},{key:"_processPick",value:function(e,t,n){if(t)if("THREEJS"===this.renderer){this.threeViewer.setPickDepth(this._getPickDepth(e.depth)),"TRACK"===e.type?this.threeViewer.setPickRectangle(e.left,e.top,e.right,e.bottom):this.threeViewer.setPickRay(e.x,e.y),this.threeViewer.pick();var r;r="CELL"===e.level?this.threeViewer.getPickedCells():"CELL_SET"===e.level?this.threeViewer.getPickedCellSets():this.threeViewer.getPickedSceneNodes(),e.selected=this.threeViewer.getSelectionInfo(r),this._dispatchPickEvents(e),e.highlight&&(this.threeViewer.highlightColor.set(e.highlightColor),this.threeViewer.highlightObjects(r,e.highlightLayer))}else if("SVG"===this.renderer){if(e.selected=[],"TRACK"!==e.type&&("polygon"===n.nodeName||"circle"===n.nodeName)){for(var i={},a=null,o=n.parentElement;null!==o&&null===(a=o.getAttribute("series-index"));)o=o.parentElement;null!==a&&(i.seriesIndex=parseInt(a));var s=null;for(o=n.parentElement;null!==o&&null===(s=o.getAttribute("item-index"));)o=o.parentElement;null!==s&&(i.itemIndex=parseInt(s));var l=null;for(o=n.parentElement;null!==o&&null===(l=o.getAttribute("component-info"));)o=o.parentElement;null!==l&&(i.componentInfo=decodeURIComponent(l)),e.selected.push(i)}if(this._dispatchPickEvents(e),e.highlight){void 0===this.highlightSvg&&(this.highlightSvg=[]);for(var u=0;u<this.highlightSvg.length;u++)this.highlightSvg[u].setAttribute("fill",this.highlightSvg[u].getAttribute("saveFill"));this.highlightSvg.length=0,"TRACK"===e.type||"polygon"!==n.nodeName&&"circle"!==n.nodeName||(this.highlightSvg.push(n),n.setAttribute("saveFill",n.getAttribute("fill")),n.setAttribute("fill",e.highlightColor))}}else{if(e.selected=[],"TRACK"!==e.type&&void 0!==this.imageMapData)for(u=0;u<this.imageMapData.length;u++){var c=this.imageMapData[u];"poly"===c.shape&&!1!==this._pointInPoly(e.x,e.y,c.coords)&&(i={},null!==c.seriesIndex&&(i.seriesIndex=parseInt(c.seriesIndex)),null!==c.itemIndex&&(i.itemIndex=parseInt(c.itemIndex)),null!==c.componentInfo&&(i.componentInfo=decodeURIComponent(c.componentInfo)),e.selected.push(i))}this._dispatchPickEvents(e)}else if(!this.urlLoadJsonFile&&(this.showSpinner(),void 0!==this.url&&null!==this.url)){this.startSpinner();var h=this._assembleModel();void 0!==h&&(h.rendererProperties.pickProperties=e,this._httpRequest(this.url,this._handleHttpResponse.bind(this),void 0,this._handleHttpError.bind(this),h))}}},{key:"_pointInPoly",value:function(e,t,n){for(var r,i,a,o=n[0]-e,s=n[1]-t,l=0,u=2;u<n.length;u+=2)if(i=n[u+1]-t,s<0&&i<0||s>0&&i>0)s=i,o=n[u]-e;else{if(r=n[u]-e,i>0&&s<=0){if((a=o*i-r*s)>0)l++;else if(0===a)return 0}else if(s>0&&i<=0){if((a=o*i-r*s)<0)l++;else if(0===a)return 0}else if(0===i&&s<0){if(0===(a=o*i-r*s))return 0}else if(0===s&&i<0){if(0===(a=o*i-r*s))return 0}else if(0===s&&0===i){if(r<=0&&o>=0)return 0;if(o<=0&&r>=0)return 0}s=i,o=r}return l%2!=0}},{key:"_getPickDepth",value:function(e){return"ALL"==e?0:1}},{key:"_dispatchPickEvents",value:function(e){var t={detail:{selected:e.selected}};"TRACK"===e.type?(t.detail.left=e.left,t.detail.top=e.top,t.detail.right=e.right,t.detail.bottom=e.bottom,this.dispatchEvent(new CustomEvent("avs-track",t))):(t.detail.x=e.x,t.detail.y=e.y,"HOVER"===e.type?this.dispatchEvent(new CustomEvent("avs-hover",t)):this.dispatchEvent(new CustomEvent("avs-tap",t)))}},{key:"_resetTimer",value:function(){clearTimeout(this.timer),this.timer=setTimeout(function(){this.dispatchEvent(new Event("avs-pointer-timeout"))}.bind(this),1e3*this.pointerTimeout)}},{key:"connectedCallback",value:function(){!function(e,t,n){var r=Yg(Jg(e.prototype),"connectedCallback",n);return"function"==typeof r?function(e){return r.apply(n,e)}:r}(t,0,this)([]),(0,Bt.m)(this,(function(){if(!0!==this.initialized){this._updateSize(),this.manualUpdate||this.updateViewer(!0),this.addEventListener("iron-resize",this._onResize),this._updatePixelRatio(),this.addEventListener("pointerdown",this._handlePointerDown),this.addEventListener("pointerup",this._handlePointerUp),this.addEventListener("pointermove",this._handlePointerMove),this.addEventListener("pointerout",this._handlePointerMove);var e=this;this.addEventListener("contextmenu",(function(t){e.trackEnable&&t.preventDefault()})),this._resetTimer(),this.initialized=!0}}))}},{key:"_updatePixelRatio",value:function(e){var t=window.devicePixelRatio;matchMedia("(resolution: ".concat(t,"dppx)")).addEventListener("change",this._updatePixelRatio.bind(this,!0),{once:!0}),e&&this.updateViewer()}},{key:"_hiddenChanged",value:function(e,t){e?this.$.dataVizDiv.style.display="none":(this.$.dataVizDiv.style.display="",this.threeViewer&&this.threeViewer.render())}},{key:"_transformEnableChanged",value:function(e,t){this.threeViewer&&(e?(void 0===this.transformInteractor&&(this.transformInteractor=new bg(this)),this.threeViewer.addInteractor(this.transformInteractor),this.transformRotateDisable&&(this.transformInteractor.enableRotate=!1),this.transformZoomDisable&&(this.transformInteractor.enableZoom=!1),this.transformPanDisable&&(this.transformInteractor.enablePan=!1),this.transformClientOnly&&(this.transformInteractor.clientOnly=!0)):this.threeViewer.removeInteractor(this.transformInteractor))}},{key:"_transformClientOnlyChanged",value:function(e,t){this.transformInteractor&&(this.transformInteractor.clientOnly=e),this.zoomRectangleInteractor&&(this.zoomRectangleInteractor.clientOnly=e)}},{key:"_transformRotateDisableChanged",value:function(e,t){this.transformInteractor&&(this.transformInteractor.enableRotate=!e)}},{key:"_transformZoomDisableChanged",value:function(e,t){this.transformInteractor&&(this.transformInteractor.enableZoom=!e)}},{key:"_transformPanDisableChanged",value:function(e,t){this.transformInteractor&&(this.transformInteractor.enablePan=!e)}},{key:"resetTransform",value:function(){this.transformInteractor&&this.transformInteractor.reset()}},{key:"zoomIn",value:function(){this.transformInteractor&&this.transformInteractor.zoomIn()}},{key:"zoomOut",value:function(){this.transformInteractor&&this.transformInteractor.zoomOut()}},{key:"panTo",value:function(e,t,n){this.transformInteractor&&this.transformInteractor.panTo(e,t,n)}},{key:"getTransformComponents",value:function(){var e,t=new go,n=new yo,r=new go,i=new Os;return this.transformInteractor&&(e=this.transformInteractor.object.matrix),e.decompose(t,n,r),i.setFromQuaternion(n),{position:t.toArray(),rotation:[180*i.x/Math.PI,180*i.y/Math.PI,180*i.z/Math.PI,i.order],scale:100*r.x}}},{key:"getTransformMatrix",value:function(){if(this.transformInteractor)return this.transformInteractor.object.matrix.elements.slice()}},{key:"runAnimation",value:function(){var e=window.getComputedStyle(this,null);if("THREEJS"===this.renderer){var t={};this._applyCustomCssProperties(t,e,{scene:"--avs-scene-animations",sceneTitle:"--avs-scene-title-animations",chart:"--avs-chart-animations",chartTitle:"--avs-chart-title-animations",axis:"--avs-axis-animations",legend:"--avs-legend-animations",legendTitle:"--avs-legend-title-animations",glyph:"--avs-glyph-animations",transform:"--avs-transform-animation"}),this.animator.setStyleMap(t),this.threeViewer.runAnimation()}}},{key:"_animatedGlyphsVisibleChanged",value:function(e,t){"THREEJS"===this.renderer&&this.threeViewer.setVisibleAnimatedGlyphs(e)}},{key:"_animatedGlyphsEnableChanged",value:function(e,t){"THREEJS"===this.renderer&&this.threeViewer.setEnableAnimatedGlyphs(e)}},{key:"_transformValueChanged",value:function(e,t){var n=void 0!==this.transformTwistAngle?this.transformTwistAngle*Math.PI/180:0,r=void 0!==this.transformTiltAngle?this.transformTiltAngle*Math.PI/180:0,i=void 0!==this.transformScale?this.transformScale/100:1,a=Math.sin(n),o=Math.cos(n),s=Math.sin(r),l=Math.cos(r),u=[o*i,0,l*a*i,0,0,l*i,-s*i,0,-a*i,o*s*i,o*l*i,0,0,0,0,1];this.transformMatrix=u,this.transformInteractor&&this.transformInteractor.object.matrix.fromArray(u)}},{key:"_zoomRectangleEnableChanged",value:function(e,t){this.threeViewer&&(e?(void 0===this.zoomRectangleInteractor&&(this.zoomRectangleInteractor=new kg(this)),this.threeViewer.addInteractor(this.zoomRectangleInteractor),this.transformClientOnly&&(this.zoomRectangleInteractor.clientOnly=!0)):this.threeViewer.removeInteractor(this.zoomRectangleInteractor))}},{key:"_panEnableChanged",value:function(e,t){this.threeViewer&&(e?(void 0===this.panInteractor&&(this.panInteractor=new Tg(this)),this.threeViewer.addInteractor(this.panInteractor),this.panZoomEnable&&(this.panInteractor.addEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.addEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.addEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))),this.panInteractor.setWidthZoomLevel(this.panWidthZoomLevel),this.panInteractor.setHeightZoomLevel(this.panHeightZoomLevel),this.panInteractor.setMaximumZoomLevel(this.panMaximumZoomLevel),this.panInteractor.saveState()):(this.threeViewer.removeInteractor(this.panInteractor),this.panZoomEnable&&(this.panInteractor.removeEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.removeEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.removeEventListener("zoomEnd",this._handlePanZoomEnd.bind(this)))))}},{key:"_panZoomEnableChanged",value:function(e,t){this.threeViewer&&this.panInteractor&&(e?(this.panInteractor.addEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.addEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.addEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))):(this.panInteractor.removeEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.removeEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.removeEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))))}},{key:"_handlePanChanged",value:function(e){this.dispatchEvent(new CustomEvent("avs-pan-info",e))}},{key:"_zoomOverlayTimeout",value:function(){this.$.zoomOverlay.style.opacity=0,this.pointerDown=!1}},{key:"_handlePanZoom",value:function(e){clearTimeout(this.zoomOverlayTimeoutId);var t=Math.round(e.detail.widthZoomLevel),n=Math.round(e.detail.heightZoomLevel);this.$.zoomOverlay.innerHTML=t===n?t+"%":t+"%,"+n+"%";var r=this._getAdjustedCoords(e.detail.clientX,e.detail.clientY);this.$.zoomOverlay.style.left=r.x+"px",this.$.zoomOverlay.style.top=r.y+"px",this.$.zoomOverlay.style.opacity=1,this.pointerDown=!0,this._dispatchPickEvents({type:"HOVER",x:0,y:0,selected:{}}),this.zoomOverlayTimeoutId=setTimeout(this._zoomOverlayTimeout.bind(this),1e3)}},{key:"_handlePanZoomEnd",value:function(e){this.initialized&&(this.panWidthZoomLevel=e.detail.widthZoomLevel,this.panHeightZoomLevel=e.detail.heightZoomLevel,this.updateViewer())}},{key:"_panWidthZoomLevelChanged",value:function(e,t){this.panInteractor&&this.panInteractor.setWidthZoomLevel(e)}},{key:"_panHeightZoomLevelChanged",value:function(e,t){this.panInteractor&&this.panInteractor.setHeightZoomLevel(e)}},{key:"_panMaximumZoomLevelChanged",value:function(e,t){this.panInteractor&&this.panInteractor.setMaximumZoomLevel(e)}},{key:"resetPan",value:function(){this.panInteractor&&this.panInteractor.reset()}},{key:"_rendererChanged",value:function(e,t){if("IMAGE"===t||"IMAGEURL"===t)this.sceneImage.src="data:,",this.$.dataVizDiv.removeChild(this.sceneImage),this.$.dataVizDiv.removeChild(this.sceneImageMap);else if("SVG"===t){for(var n=this.svgDiv;n.firstChild;)n.removeChild(n.firstChild);this.$.dataVizDiv.removeChild(this.svgDiv)}else"THREEJS"===t&&(this.threeViewer.clearGeometry(),this.threeViewer.render(),this.$.dataVizDiv.removeChild(this.threeViewer.domElement));if("IMAGE"===e||"IMAGEURL"===e)void 0===this.sceneImage&&(this.sceneImage=document.createElement("img"),this.sceneImage.setAttribute("id","sceneImage"),this.sceneImage.setAttribute("usemap","#sceneImageMap"),this.sceneImageMap=document.createElement("map"),this.sceneImageMap.setAttribute("id","sceneImageMap"),this.sceneImageMap.setAttribute("name","sceneImageMap")),this.$.dataVizDiv.appendChild(this.sceneImage),this.$.dataVizDiv.appendChild(this.sceneImageMap);else if("SVG"===e)void 0===this.svgDiv&&(this.svgDiv=document.createElement("div"),this.svgDiv.setAttribute("id","svgDiv")),this.$.dataVizDiv.appendChild(this.svgDiv);else if("THREEJS"===e){if(void 0===this.threeViewer){this.threeViewer=new mg;var r="avsDefaultWebGLRenderer",i=document.getElementById(r);null==i&&((i=new dy).setAttribute("id",r),document.body.appendChild(i)),this.threeViewer.setWebGLRenderer(i.webGLRenderer),this.animator=new Ng,this.threeViewer.setAnimator(this.animator)}this.$.dataVizDiv.appendChild(this.threeViewer.domElement)}this.initialized&&!this.manualUpdate&&this.updateViewer()}},{key:"_trackEnableChanged",value:function(e,t){e?(void 0===this.rectCanvas&&(this.rectCanvas=document.createElement("canvas"),this.rectCanvas.setAttribute("id","rectCanvas"),this.rectCtx=this.rectCanvas.getContext("2d")),this.$.container.appendChild(this.rectCanvas)):this.$.container.removeChild(this.rectCanvas)}},{key:"_displayCanvasChanged",value:function(e,t){this.threeViewer&&(this.threeViewer.displayCanvas=e)}},{key:"setTooltipHTML",value:function(e){this.$.tooltip.innerHTML=e}},{key:"showTooltip",value:function(e,t){var n=this._calcTooltipPosition(e,t);this.$.tooltip.style.left=n.x+"px",this.$.tooltip.style.top=n.y+"px",this.$.tooltip.style.opacity=1}},{key:"hideTooltip",value:function(){this.$.tooltip.style.opacity=0}},{key:"_calcTooltipPosition",value:function(e,t){var n=this._getOffset(),r=-Math.min(0,n.top-window.pageYOffset),i=-Math.min(0,n.left-window.pageXOffset),a=-Math.min(0,window.innerHeight-(this.$.dataVizDiv.offsetHeight+n.top-window.pageYOffset)),o=-Math.min(0,window.innerWidth-(this.$.dataVizDiv.offsetWidth+n.left-window.pageXOffset)),s=(this.$.dataVizDiv.offsetHeight-r-a)/2+r,l={x:0,y:0};return e<(this.$.dataVizDiv.offsetWidth-i-o)/2+i?(n=t<s?15:5,l.x=e+n+this.$.dataVizDiv.offsetLeft):l.x=e-10+this.$.dataVizDiv.offsetLeft-this.$.tooltip.offsetWidth,l.y=t<s?t+5+this.$.dataVizDiv.offsetTop:t-10+this.$.dataVizDiv.offsetTop-this.$.tooltip.offsetHeight,l}},{key:"_getOffset",value:function(){var e=this.$.dataVizDiv.getBoundingClientRect(),t=window.pageXOffset||document.documentElement.scrollLeft,n=window.pageYOffset||document.documentElement.scrollTop;return{top:e.top+n,left:e.left+t}}}],i=[{key:"template",get:function(){return(0,a.qy)(Hg||(e=['\n <style>\n :host {\n display:block;\n width:100%;\n height:100%;\n overflow:hidden;\n }\n #container {\n position:relative;\n width:100%;\n height:100%;\n letter-spacing:normal;\n word-spacing:normal;\n line-height:normal;\n text-indent:0;\n text-transform:none;\n direction:ltr;\n }\n #dataVizDiv {\n position:relative;\n width:100%;\n height:100%;\n } \n #sceneImage {\n width:100%;\n height:100%;\n position:absolute;\n outline:none;\n } \n #rectCanvas {\n position:absolute;\n top:0px;\n left:0px;\n }\n #zoomOverlay {\n position:absolute;\n opacity:0;\n transition:opacity ease 0.3s;\n pointer-events:none;\n background:var(--avs-zoom-overlay-background, rgba(80,80,80,0.75));\n color:var(--avs-zoom-overlay-color, #ffffff);\n border-radius:5px;\n padding:5px;\n transform:translate(-50%, -100%);\n font-size:var(--avs-zoom-overlay-font-size, 10pt);\n font-family:var(--avs-zoom-overlay-font-family);\n font-weight:var(--avs-zoom-overlay-font-weight, bold);\n font-style:var(--avs-zoom-overlay-font-style);\n }\n #tooltip {\n position:absolute;\n opacity:0;\n transition:opacity ease 0.3s;\n pointer-events:none;\n padding:5px;\n border-radius:5px;\n background:var(--avs-tooltip-background, rgb(80,80,80));\n color:var(--avs-tooltip-color, #ffffff);\n box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);\n font-size:var(--avs-tooltip-font-size, 10pt);\n font-family:var(--avs-tooltip-font-family);\n font-weight:var(--avs-tooltip-font-weight);\n font-style:var(--avs-tooltip-font-style);\n }\n #spinnerDiv {\n position:absolute;\n left:var(--avs-spinner-left, 50%);\n top:var(--avs-spinner-top, 50%);\n transform:var(--avs-spinner-transform, translate(-50%,-50%));\n }\n #spinner {\n display:none;\n }\n .spin {\n -webkit-animation:spin 2s ease-in-out infinite;\n -moz-animation:spin 2s ease-in-out infinite;\n animation:spin 2s ease-in-out infinite;\n }\n .spinnerBackground {\n fill:var(--avs-spinner-background-color, rgb(0,0,0,0));\n stroke-width:0.0160303\n }\n @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }\n @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }\n @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }\n </style>\n <div id="container">\n <div id="dataVizDiv"></div>\n <div id="zoomOverlay"></div>\n <div id="spinnerDiv">\n <div id="spinner"></div>\n </div>\n <div id="tooltip"></div>\n </div>\n '],t||(t=e.slice(0)),Hg=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))));var e,t}},{key:"properties",get:function(){return{manualUpdate:{type:Boolean},displayCanvas:{type:Boolean,observer:"_displayCanvasChanged"},url:{type:String},urlLoadJsonFile:{type:Boolean},sceneName:{type:String},sceneUserProperties:{type:Object,value:{}},rendererName:{type:String},rendererUserProperties:{type:Object,value:{}},renderer:{type:String,value:"IMAGE",observer:"_rendererChanged"},themeName:{type:String},hidden:{type:Boolean,observer:"_hiddenChanged"},resizeThreshold:{type:Number,value:10},aspectRatio:{type:Number,value:1.777777},pointerTimeout:{type:Number,value:600},tapEnable:{type:Boolean},tapLevel:{type:String},tapDepth:{type:String},tapHighlightEnable:{type:Boolean},tapHighlightColor:{type:String},tapHighlightLayerEnable:{type:Boolean},tapProcessEventOnClient:{type:Boolean},trackEnable:{type:Boolean,observer:"_trackEnableChanged"},trackLevel:{type:String},trackDepth:{type:String},trackHighlightEnable:{type:Boolean},trackHighlightColor:{type:String},trackHighlightLayerEnable:{type:Boolean},trackProcessEventOnClient:{type:Boolean},hoverEnable:{type:Boolean},hoverLevel:{type:String},hoverDepth:{type:String},hoverHighlightEnable:{type:Boolean},hoverHighlightColor:{type:String},hoverHighlightLayerEnable:{type:Boolean},transformEnable:{type:Boolean,observer:"_transformEnableChanged"},transformClientOnly:{type:Boolean,observer:"_transformClientOnlyChanged"},transformRotateDisable:{type:Boolean,observer:"_transformRotateDisableChanged"},transformZoomDisable:{type:Boolean,observer:"_transformZoomDisableChanged"},transformPanDisable:{type:Boolean,observer:"_transformPanDisableChanged"},transformTwistAngle:{type:Number,observer:"_transformValueChanged"},transformTiltAngle:{type:Number,observer:"_transformValueChanged"},transformScale:{type:Number,observer:"_transformValueChanged"},zoomRectangleEnable:{type:Boolean,observer:"_zoomRectangleEnableChanged"},panEnable:{type:Boolean,observer:"_panEnableChanged"},panZoomEnable:{type:Boolean,observer:"_panZoomEnableChanged"},panWidthZoomLevel:{type:Number,observer:"_panWidthZoomLevelChanged"},panHeightZoomLevel:{type:Number,observer:"_panHeightZoomLevelChanged"},panMaximumZoomLevel:{type:Number,observer:"_panMaximumZoomLevelChanged",value:1e3},animatedGlyphsVisible:{type:Boolean,observer:"_animatedGlyphsVisibleChanged"},animatedGlyphsEnable:{type:Boolean,observer:"_animatedGlyphsEnableChanged"}}}}],r&&Wg(n.prototype,r),i&&Wg(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}((0,n(606).B)(Vg((0,Lg.u)((Kg=[ii],ir({},Hn(a.Pu),Kg))))));window.customElements.define("avs-go-dataviz",$g)},9584:(e,t,n)=>{var r=n(7947),i=n(6094),a=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(7102)(Function.call,n(5935).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return a(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:a}},9620:(e,t,n)=>{var r=n(5161);r(r.S,"Math",{fround:n(448)})},9655:(e,t,n)=>{var r=n(5161);r(r.S,"Math",{log1p:n(5387)})},9665:(e,t,n)=>{var r=n(4397),i=n(5935),a=n(2381),o=n(8319),s=n(5161),l=n(9142),u=n(6094),c=n(7947);s(s.S,"Reflect",{set:function e(t,n,s){var h,d,f=arguments.length<4?t:arguments[3],p=i.f(u(t),n);if(!p){if(c(d=a(t)))return e(d,n,s,f);p=l(0)}if(o(p,"value")){if(!1===p.writable||!c(f))return!1;if(h=i.f(f,n)){if(h.get||h.set||!1===h.writable)return!1;h.value=s,r.f(f,n,h)}else r.f(f,n,l(0,s));return!0}return void 0!==p.set&&(p.set.call(f,s),!0)}})},9666:(e,t,n)=>{"use strict";n(6462);var r=n(9337),i=n(6271),a=n(110),o=n(7462),s=n(5440),l=n(1978),u=s("species"),c=!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),h=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var d=s(e),f=!a((function(){var t={};return t[d]=function(){return 7},7!=""[e](t)})),p=f?!a((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[u]=function(){return n}),n[d](""),!t})):void 0;if(!f||!p||"replace"===e&&!c||"split"===e&&!h){var v=/./[d],m=n(o,d,""[e],(function(e,t,n,r,i){return t.exec===l?f&&!i?{done:!0,value:v.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),y=m[0],g=m[1];r(String.prototype,e,y),i(RegExp.prototype,d,2==t?function(e,t){return g.call(e,this,t)}:function(e){return g.call(e,this)})}}},9705:(e,t,n)=>{var r=n(7102),i=n(7295),a=n(5560),o=n(3991),s=n(9450);e.exports=function(e,t){var n=1==e,l=2==e,u=3==e,c=4==e,h=6==e,d=5==e||h,f=t||s;return function(t,s,p){for(var v,m,y=a(t),g=i(y),_=r(s,p,3),b=o(g.length),x=0,S=n?f(t,b):l?f(t,0):void 0;b>x;x++)if((d||x in g)&&(m=_(v=g[x],x,y),e))if(n)S[x]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return x;case 2:S.push(v)}else if(c)return!1;return h?-1:u||c?c:S}}},9746:(e,t,n)=>{var r=n(3991),i=n(6424),a=n(7462);e.exports=function(e,t,n,o){var s=String(a(e)),l=s.length,u=void 0===n?" ":String(n),c=r(t);if(c<=l||""==u)return s;var h=c-l,d=i.call(u,Math.ceil(h/u.length));return d.length>h&&(d=d.slice(0,h)),o?d+s:s+d}},9747:(e,t,n)=>{"use strict";n(262);var r,i=(r=n(7170))&&r.__esModule?r:{default:r};i.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),i.default._babelPolyfill=!0},9787:(e,t,n)=>{var r=n(5161),i=n(3342);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},9788:(e,t,n)=>{var r=n(3134)("keys"),i=n(4317);e.exports=function(e){return r[e]||(r[e]=i(e))}},9815:(e,t,n)=>{"use strict";var r=n(5161),i=n(9705)(1);r(r.P+r.F*!n(938)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},9841:(e,t,n)=>{var r=n(609),i=n(5560),a=n(7295),o=n(3991);e.exports=function(e,t,n,s,l){r(t);var u=i(e),c=a(u),h=o(u.length),d=l?h-1:0,f=l?-1:1;if(n<2)for(;;){if(d in c){s=c[d],d+=f;break}if(d+=f,l?d<0:h<=d)throw TypeError("Reduce of empty array with no initial value")}for(;l?d>=0:h>d;d+=f)d in c&&(s=t(s,c[d],d,u));return s}},9940:(e,t,n)=>{var r=n(2228).navigator;e.exports=r&&r.userAgent||""}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(9747),n(4576),n(5042),n(9549),n(380),n(2105)})();