w-plot-vue 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/w-plot-vue.umd.js +4 -4
- package/dist/w-plot-vue.umd.js.map +1 -1
- package/docs/examples/app.html +65 -0
- package/docs/examples/app.umd.js +18 -0
- package/docs/examples/app.umd.js.map +1 -0
- package/docs/examples/w-bar_horizontal_multi-set(color).html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set(color, gradient).html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set(series color).html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set(series color, gradient).html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set.html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackNormal).html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackPercent).html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set__hide legned.html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set__show labels.html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set_barKpColor(gradient).html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set_barKpColor.html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set_barUseInnerLabelsForHorizontal_barGroupWidthRatio.html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio.html +1 -1
- package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio_barGroupWidthRatio.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set(color).html +1 -1
- package/docs/examples/w-bar_horizontal_one-set(color, gradient).html +1 -1
- package/docs/examples/w-bar_horizontal_one-set.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_barColor(gradient).html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_barColor.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_barKpColor(gradient).html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_barKpColor.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_barUseInnerLabelsForHorizontal.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_barWidthRatio.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_barWidthRatio_barGroupWidthRatio.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_hide labels.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_marginLeft_marginRight.html +1 -1
- package/docs/examples/w-bar_horizontal_one-set_show legned.html +1 -1
- package/docs/examples/w-bar_multi-set(color).html +1 -1
- package/docs/examples/w-bar_multi-set(color, gradient).html +1 -1
- package/docs/examples/w-bar_multi-set(series color).html +1 -1
- package/docs/examples/w-bar_multi-set(series color, gradient).html +1 -1
- package/docs/examples/w-bar_multi-set.html +1 -1
- package/docs/examples/w-bar_multi-set__barDisplay(stackNormal).html +1 -1
- package/docs/examples/w-bar_multi-set__barDisplay(stackNormal)_.html +1 -1
- package/docs/examples/w-bar_multi-set__barDisplay(stackPercent).html +1 -1
- package/docs/examples/w-bar_multi-set__hide legned.html +1 -1
- package/docs/examples/w-bar_multi-set__show labels.html +1 -1
- package/docs/examples/w-bar_multi-set_barKpColor(gradient).html +1 -1
- package/docs/examples/w-bar_multi-set_barKpColor.html +1 -1
- package/docs/examples/w-bar_multi-set_barWidthRatio.html +1 -1
- package/docs/examples/w-bar_multi-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +1 -1
- package/docs/examples/w-bar_one-set(color).html +1 -1
- package/docs/examples/w-bar_one-set(color, gradient).html +1 -1
- package/docs/examples/w-bar_one-set.html +1 -1
- package/docs/examples/w-bar_one-set_barColor(gradient).html +1 -1
- package/docs/examples/w-bar_one-set_barColor.html +1 -1
- package/docs/examples/w-bar_one-set_barKpColor(gradient).html +1 -1
- package/docs/examples/w-bar_one-set_barKpColor.html +1 -1
- package/docs/examples/w-bar_one-set_barWidthRatio.html +1 -1
- package/docs/examples/w-bar_one-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +1 -1
- package/docs/examples/w-bar_one-set_hide labels.html +1 -1
- package/docs/examples/w-bar_one-set_marginLeft_marginRight_marginTop.html +1 -1
- package/docs/examples/w-bar_one-set_show legned.html +1 -1
- package/docs/examples/w-pie_one-set(color).html +1 -1
- package/docs/examples/w-pie_one-set(color, gradient).html +1 -1
- package/docs/examples/w-pie_one-set.html +1 -1
- package/docs/examples/w-pie_one-set_hide labels.html +1 -1
- package/docs/examples/w-pie_one-set_hide legned.html +1 -1
- package/docs/examples/w-pie_one-set_marginLeft_marginRight_marginTop.html +1 -1
- package/docs/examples/w-pie_one-set_pieBorderRadius.html +1 -1
- package/docs/examples/w-pie_one-set_pieBorderWidth_pieBorderRadius.html +1 -1
- package/docs/examples/w-pie_one-set_pieKpColor(gradient).html +1 -1
- package/docs/examples/w-pie_one-set_pieKpColor.html +1 -1
- package/docs/examples/w-pie_one-set_pieThicknessRatio.html +1 -1
- package/docs/examples/w-plot-2d_default.html +1 -1
- package/docs/examples/w-plot-3d_default.html +1 -1
- package/docs/examples/w-rose_multi-set(color).html +1 -1
- package/docs/examples/w-rose_multi-set(color, gradient).html +1 -1
- package/docs/examples/w-rose_multi-set(series color).html +1 -1
- package/docs/examples/w-rose_multi-set(series color, gradient).html +1 -1
- package/docs/examples/w-rose_multi-set.html +1 -1
- package/docs/examples/w-rose_multi-set__hide legned.html +1 -1
- package/docs/examples/w-rose_multi-set__show labels.html +1 -1
- package/docs/examples/w-rose_multi-set_roseBorderWidth.html +1 -1
- package/docs/examples/w-rose_multi-set_roseKpColor(gradient).html +1 -1
- package/docs/examples/w-rose_multi-set_roseKpColor.html +1 -1
- package/docs/examples/w-rose_multi-set_roseWidthRatio.html +1 -1
- package/docs/examples/w-rose_one-set(color).html +1 -1
- package/docs/examples/w-rose_one-set(color, gradient).html +1 -1
- package/docs/examples/w-rose_one-set.html +1 -1
- package/docs/examples/w-rose_one-set_marginLeft_marginRight_marginTop.html +1 -1
- package/docs/examples/w-rose_one-set_roseBorderWidth.html +1 -1
- package/docs/examples/w-rose_one-set_roseKpColor(gradient).html +1 -1
- package/docs/examples/w-rose_one-set_roseKpColor.html +1 -1
- package/docs/examples/w-rose_one-set_roseShowLabels.html +1 -1
- package/docs/examples/w-rose_one-set_roseWidthRatio.html +1 -1
- package/docs/examples/w-rose_one-set_showLegend.html +1 -1
- package/docs/examples/w-rose_one-set_showLegend_legendPosition.html +1 -1
- package/docs/examples/w-set-multi_default.html +1 -1
- package/docs/examples/w-set-multi_hide labels.html +1 -1
- package/docs/examples/w-set-multi_hide legned.html +1 -1
- package/docs/examples/w-set-multi_keySelect.html +1 -1
- package/docs/examples/w-set-multi_slot head.html +1 -1
- package/docs/examples/w-set-multi_textPlotType_kpSelectText_widthSelect.html +1 -1
- package/docs/examples/w-set-one_default.html +1 -1
- package/docs/examples/w-set-one_hide labels.html +1 -1
- package/docs/examples/w-set-one_keySelect.html +1 -1
- package/docs/examples/w-set-one_show legned.html +1 -1
- package/docs/examples/w-set-one_slot head.html +1 -1
- package/docs/examples/w-set-one_textPlotType_kpSelectText_widthSelect.html +1 -1
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/getDefAxis.mjs.html +157 -0
- package/docs/getDefChart.mjs.html +123 -0
- package/docs/getDefLegend.mjs.html +115 -0
- package/docs/getDefOpt.mjs.html +137 -0
- package/docs/global.html +1088 -0
- package/docs/index.html +84 -0
- package/docs/module-WBar.html +250 -0
- package/docs/module-WPie.html +250 -0
- package/docs/module-WPlot2d.html +250 -0
- package/docs/module-WPlot3d.html +250 -0
- package/docs/module-WRose.html +250 -0
- package/docs/module-WSetMulti.html +250 -0
- package/docs/module-WSetOne.html +250 -0
- package/docs/scripts/collapse.js +39 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +99 -0
- package/docs/setLegendLoc.mjs.html +176 -0
- package/docs/styles/jsdoc.css +776 -0
- package/docs/styles/prettify.css +80 -0
- package/package.json +3 -3
- package/toolg/cleanFolder.mjs +1 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* app v1.0.11
|
|
3
|
+
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).app=e(t.Vue)}(this,function(t){"use strict";var e=Array.isArray,n="object"==typeof global&&global&&global.Object===Object&&global,i="object"==typeof self&&self&&self.Object===Object&&self,r=n||i||Function("return this")(),o=r.Symbol,s=Object.prototype,a=s.hasOwnProperty,l=s.toString,c=o?o.toStringTag:void 0;var h=Object.prototype.toString;var u=o?o.toStringTag:void 0;function d(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?function(t){var e=a.call(t,c),n=t[c];try{t[c]=void 0;var i=!0}catch(t){}var r=l.call(t);return i&&(e?t[c]=n:delete t[c]),r}(t):function(t){return h.call(t)}(t)}function p(t){return null!=t&&"object"==typeof t}function f(t){return"symbol"==typeof t||p(t)&&"[object Symbol]"==d(t)}var m=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g=/^\w*$/;function v(t,n){if(e(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!f(t))||(g.test(t)||!m.test(t)||null!=n&&t in Object(n))}function _(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function y(t){if(!_(t))return!1;var e=d(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var b,x=r["__core-js_shared__"],S=(b=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"";var w=Function.prototype.toString;function M(t){if(null!=t){try{return w.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var T=/^\[object .+?Constructor\]$/,A=Function.prototype,E=Object.prototype,C=A.toString,R=E.hasOwnProperty,P=RegExp("^"+C.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function L(t){return!(!_(t)||(e=t,S&&S in e))&&(y(t)?P:T).test(M(t));var e}function I(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return L(n)?n:void 0}var O=I(Object,"create");var k=Object.prototype.hasOwnProperty;var U=Object.prototype.hasOwnProperty;function D(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function N(t,e){return t===e||t!=t&&e!=e}function B(t,e){for(var n=t.length;n--;)if(N(t[n][0],e))return n;return-1}D.prototype.clear=function(){this.__data__=O?O(null):{},this.size=0},D.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},D.prototype.get=function(t){var e=this.__data__;if(O){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return k.call(e,t)?e[t]:void 0},D.prototype.has=function(t){var e=this.__data__;return O?void 0!==e[t]:U.call(e,t)},D.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=O&&void 0===e?"__lodash_hash_undefined__":e,this};var F=Array.prototype.splice;function z(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}z.prototype.clear=function(){this.__data__=[],this.size=0},z.prototype.delete=function(t){var e=this.__data__,n=B(e,t);return!(n<0)&&(n==e.length-1?e.pop():F.call(e,n,1),--this.size,!0)},z.prototype.get=function(t){var e=this.__data__,n=B(e,t);return n<0?void 0:e[n][1]},z.prototype.has=function(t){return B(this.__data__,t)>-1},z.prototype.set=function(t,e){var n=this.__data__,i=B(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};var H=I(r,"Map");function W(t,e){var n,i,r=t.__data__;return("string"==(i=typeof(n=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function V(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}V.prototype.clear=function(){this.size=0,this.__data__={hash:new D,map:new(H||z),string:new D}},V.prototype.delete=function(t){var e=W(this,t).delete(t);return this.size-=e?1:0,e},V.prototype.get=function(t){return W(this,t).get(t)},V.prototype.has=function(t){return W(this,t).has(t)},V.prototype.set=function(t,e){var n=W(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this};function G(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var s=t.apply(this,i);return n.cache=o.set(r,s)||o,s};return n.cache=new(G.Cache||V),n}G.Cache=V;var j,X,$,Y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/\\(\\)?/g,Z=(j=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Y,function(t,n,i,r){e.push(i?r.replace(q,"$1"):n||t)}),e},X=G(j,function(t){return 500===$.size&&$.clear(),t}),$=X.cache,X),K=Z;function J(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}var Q=o?o.prototype:void 0,tt=Q?Q.toString:void 0;function et(t){if("string"==typeof t)return t;if(e(t))return J(t,et)+"";if(f(t))return tt?tt.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function nt(t){return null==t?"":et(t)}function it(t,n){return e(t)?t:v(t,n)?[t]:K(nt(t))}function rt(t){if("string"==typeof t||f(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ot(t,e){for(var n=0,i=(e=it(e,t)).length;null!=t&&n<i;)t=t[rt(e[n++])];return n&&n==i?t:void 0}function st(t,e,n){var i=null==t?void 0:ot(t,e);return void 0===i?n:i}var at,lt=(at={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==at?void 0:at[t]}),ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ht=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var dt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var pt="\\ud800-\\udfff",ft="\\u2700-\\u27bf",mt="a-z\\xdf-\\xf6\\xf8-\\xff",gt="A-Z\\xc0-\\xd6\\xd8-\\xde",vt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_t="["+vt+"]",yt="\\d+",bt="["+ft+"]",xt="["+mt+"]",St="[^"+pt+vt+yt+ft+mt+gt+"]",wt="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",Tt="["+gt+"]",At="(?:"+xt+"|"+St+")",Et="(?:"+Tt+"|"+St+")",Ct="(?:['’](?:d|ll|m|re|s|t|ve))?",Rt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Pt="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Lt="[\\ufe0e\\ufe0f]?",It=Lt+Pt+("(?:\\u200d(?:"+["[^"+pt+"]",wt,Mt].join("|")+")"+Lt+Pt+")*"),Ot="(?:"+[bt,wt,Mt].join("|")+")"+It,kt=RegExp([Tt+"?"+xt+"+"+Ct+"(?="+[_t,Tt,"$"].join("|")+")",Et+"+"+Rt+"(?="+[_t,Tt+At,"$"].join("|")+")",Tt+"?"+At+"+"+Ct,Tt+"+"+Rt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yt,Ot].join("|"),"g");function Ut(t,e,n){return t=nt(t),void 0===(e=n?void 0:e)?function(t){return dt.test(t)}(t)?function(t){return t.match(kt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Dt=RegExp("['’]","g");function Nt(t){return function(e){return function(t,e,n,i){var r=-1,o=null==t?0:t.length;for(i&&o&&(n=t[++r]);++r<o;)n=e(n,t[r],r,t);return n}(Ut(function(t){return(t=nt(t))&&t.replace(ct,lt).replace(ht,"")}(e).replace(Dt,"")),t,"")}}var Bt=Nt(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ft=Bt;function zt(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t}var Ht,Wt=function(t,e,n){for(var i=-1,r=Object(t),o=n(t),s=o.length;s--;){var a=o[Ht?s:++i];if(!1===e(r[a],a,r))break}return t},Vt=Wt;function Gt(t){return p(t)&&"[object Arguments]"==d(t)}var jt=Object.prototype,Xt=jt.hasOwnProperty,$t=jt.propertyIsEnumerable,Yt=Gt(function(){return arguments}())?Gt:function(t){return p(t)&&Xt.call(t,"callee")&&!$t.call(t,"callee")},qt=Yt;var Zt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kt=Zt&&"object"==typeof module&&module&&!module.nodeType&&module,Jt=Kt&&Kt.exports===Zt?r.Buffer:void 0,Qt=(Jt?Jt.isBuffer:void 0)||function(){return!1},te=/^(?:0|[1-9]\d*)$/;function ee(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&te.test(t))&&t>-1&&t%1==0&&t<e}function ne(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var ie={};function re(t){return function(e){return t(e)}}ie["[object Float32Array]"]=ie["[object Float64Array]"]=ie["[object Int8Array]"]=ie["[object Int16Array]"]=ie["[object Int32Array]"]=ie["[object Uint8Array]"]=ie["[object Uint8ClampedArray]"]=ie["[object Uint16Array]"]=ie["[object Uint32Array]"]=!0,ie["[object Arguments]"]=ie["[object Array]"]=ie["[object ArrayBuffer]"]=ie["[object Boolean]"]=ie["[object DataView]"]=ie["[object Date]"]=ie["[object Error]"]=ie["[object Function]"]=ie["[object Map]"]=ie["[object Number]"]=ie["[object Object]"]=ie["[object RegExp]"]=ie["[object Set]"]=ie["[object String]"]=ie["[object WeakMap]"]=!1;var oe="object"==typeof exports&&exports&&!exports.nodeType&&exports,se=oe&&"object"==typeof module&&module&&!module.nodeType&&module,ae=se&&se.exports===oe&&n.process,le=function(){try{var t=se&&se.require&&se.require("util").types;return t||ae&&ae.binding&&ae.binding("util")}catch(t){}}(),ce=le&&le.isTypedArray,he=ce?re(ce):function(t){return p(t)&&ne(t.length)&&!!ie[d(t)]},ue=Object.prototype.hasOwnProperty;function de(t,n){var i=e(t),r=!i&&qt(t),o=!i&&!r&&Qt(t),s=!i&&!r&&!o&&he(t),a=i||r||o||s,l=a?function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}(t.length,String):[],c=l.length;for(var h in t)!n&&!ue.call(t,h)||a&&("length"==h||o&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||ee(h,c))||l.push(h);return l}var pe=Object.prototype;function fe(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||pe)}function me(t,e){return function(n){return t(e(n))}}var ge=me(Object.keys,Object),ve=Object.prototype.hasOwnProperty;function _e(t){if(!fe(t))return ge(t);var e=[];for(var n in Object(t))ve.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ye(t){return null!=t&&ne(t.length)&&!y(t)}function be(t){return ye(t)?de(t):_e(t)}var xe=function(t,e){return function(n,i){if(null==n)return n;if(!ye(n))return t(n,i);for(var r=n.length,o=e?r:-1,s=Object(n);(e?o--:++o<r)&&!1!==i(s[o],o,s););return n}}(function(t,e){return t&&Vt(t,e,be)}),Se=xe;function we(t){return t}function Me(t,n){var i;return(e(t)?zt:Se)(t,"function"==typeof(i=n)?i:we)}function Te(t){return"[object String]"===Object.prototype.toString.call(t)}function Ae(t){return!(!Te(t)||""===t)}var Ee=/\s/;var Ce=/^\s+/;function Re(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Ee.test(t.charAt(e)););return e}(t)+1).replace(Ce,""):t}var Pe=/^[-+]0x[0-9a-f]+$/i,Le=/^0b[01]+$/i,Ie=/^0o[0-7]+$/i,Oe=parseInt;function ke(t){if("number"==typeof t)return t;if(f(t))return NaN;if(_(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=_(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Re(t);var n=Le.test(t);return n||Ie.test(t)?Oe(t.slice(2),n?2:8):Pe.test(t)?NaN:+t}var Ue=1/0;function De(t){return t?(t=ke(t))===Ue||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Ne(t){var e=De(t),n=e%1;return e==e?n?e-n:e:0}function Be(t){return t!=t}function Fe(t){let e=!1;if(Ae(t))e=!isNaN(Number(t));else if(function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)){if(Be(t))return!1;e=!0}return e}function ze(t){if(!Fe(t))return 0;return De(t)}function He(t){return!!Fe(t)&&(t=ze(t),"number"==typeof(e=t)&&e==Ne(e));var e}var We=r.isFinite,Ve=Math.min;var Ge=function(t){var e=Math[t];return function(t,n){if(t=ke(t),(n=null==n?0:Ve(Ne(n),292))&&We(t)){var i=(nt(t)+"e").split("e");return+((i=(nt(e(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return e(t)}}("round"),je=Ge;function Xe(t){if(!Fe(t))return 0;t=ze(t);let e=je(t);return"0"===String(e)?0:e}function $e(t){if(!He(t))return!1;return Xe(t)>=0}function Ye(t,e){if(!Ae(t))return"";if(!$e(e))return"";if(0===(e=Xe(e)))return"";let n=t.length-e;return n<0&&(n=0),t.substring(n,n+e)}function qe(t,e){return Ae(t)&&$e(e)?0===(e=Xe(e))?"":t.substring(0,e):""}function Ze(t,e){return Ae(t)&&$e(e)?0===(e=Xe(e))?t:qe(t,t.length-e):""}function Ke(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(r);++i<r;)o[i]=t[i+e];return o}function Je(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:Ke(t,e,n)}var Qe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function tn(t){return Qe.test(t)}function en(t,e,n){if(!_(n))return!1;var i=typeof e;return!!("number"==i?ye(n)&&ee(e,n.length):"string"==i&&e in n)&&N(n[e],t)}var nn=le&&le.isRegExp,rn=nn?re(nn):function(t){return p(t)&&"[object RegExp]"==d(t)};var on="\\ud800-\\udfff",sn="["+on+"]",an="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ln="\\ud83c[\\udffb-\\udfff]",cn="[^"+on+"]",hn="(?:\\ud83c[\\udde6-\\uddff]){2}",un="[\\ud800-\\udbff][\\udc00-\\udfff]",dn="(?:"+an+"|"+ln+")"+"?",pn="[\\ufe0e\\ufe0f]?",fn=pn+dn+("(?:\\u200d(?:"+[cn,hn,un].join("|")+")"+pn+dn+")*"),mn="(?:"+[cn+an+"?",an,hn,un,sn].join("|")+")",gn=RegExp(ln+"(?="+ln+")|"+mn+fn,"g");function vn(t){return tn(t)?function(t){return t.match(gn)||[]}(t):function(t){return t.split("")}(t)}function _n(t,e,n){return n&&"number"!=typeof n&&en(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=nt(t))&&("string"==typeof e||null!=e&&!rn(e))&&!(e=et(e))&&tn(t)?Je(vn(t),0,n):t.split(e,n):[]}function yn(t){var e=this.__data__=new z(t);this.size=e.size}yn.prototype.clear=function(){this.__data__=new z,this.size=0},yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},yn.prototype.get=function(t){return this.__data__.get(t)},yn.prototype.has=function(t){return this.__data__.has(t)},yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof z){var i=n.__data__;if(!H||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new V(i)}return n.set(t,e),this.size=n.size,this};function bn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new V;++e<n;)this.add(t[e])}function xn(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}function Sn(t,e){return t.has(e)}bn.prototype.add=bn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},bn.prototype.has=function(t){return this.__data__.has(t)};function wn(t,e,n,i,r,o){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),h=o.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,p=2&n?new bn:void 0;for(o.set(t,e),o.set(e,t);++u<a;){var f=t[u],m=e[u];if(i)var g=s?i(m,f,u,e,t,o):i(f,m,u,t,e,o);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!xn(e,function(t,e){if(!Sn(p,e)&&(f===t||r(f,t,n,i,o)))return p.push(e)})){d=!1;break}}else if(f!==m&&!r(f,m,n,i,o)){d=!1;break}}return o.delete(t),o.delete(e),d}var Mn=r.Uint8Array;function Tn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,i){n[++e]=[i,t]}),n}function An(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var En=o?o.prototype:void 0,Cn=En?En.valueOf:void 0;function Rn(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}function Pn(t,n,i){var r=n(t);return e(t)?r:Rn(r,i(t))}function Ln(t,e){for(var n=-1,i=null==t?0:t.length,r=0,o=[];++n<i;){var s=t[n];e(s,n,t)&&(o[r++]=s)}return o}function In(){return[]}var On=Object.prototype.propertyIsEnumerable,kn=Object.getOwnPropertySymbols,Un=kn?function(t){return null==t?[]:(t=Object(t),Ln(kn(t),function(e){return On.call(t,e)}))}:In,Dn=Un;function Nn(t){return Pn(t,be,Dn)}var Bn=Object.prototype.hasOwnProperty;var Fn=I(r,"DataView"),zn=I(r,"Promise"),Hn=I(r,"Set"),Wn=I(r,"WeakMap"),Vn="[object Map]",Gn="[object Promise]",jn="[object Set]",Xn="[object WeakMap]",$n="[object DataView]",Yn=M(Fn),qn=M(H),Zn=M(zn),Kn=M(Hn),Jn=M(Wn),Qn=d;(Fn&&Qn(new Fn(new ArrayBuffer(1)))!=$n||H&&Qn(new H)!=Vn||zn&&Qn(zn.resolve())!=Gn||Hn&&Qn(new Hn)!=jn||Wn&&Qn(new Wn)!=Xn)&&(Qn=function(t){var e=d(t),n="[object Object]"==e?t.constructor:void 0,i=n?M(n):"";if(i)switch(i){case Yn:return $n;case qn:return Vn;case Zn:return Gn;case Kn:return jn;case Jn:return Xn}return e});var ti=Qn,ei="[object Arguments]",ni="[object Array]",ii="[object Object]",ri=Object.prototype.hasOwnProperty;function oi(t,n,i,r,o,s){var a=e(t),l=e(n),c=a?ni:ti(t),h=l?ni:ti(n),u=(c=c==ei?ii:c)==ii,d=(h=h==ei?ii:h)==ii,p=c==h;if(p&&Qt(t)){if(!Qt(n))return!1;a=!0,u=!1}if(p&&!u)return s||(s=new yn),a||he(t)?wn(t,n,i,r,o,s):function(t,e,n,i,r,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Mn(t),new Mn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return N(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Tn;case"[object Set]":var l=1&i;if(a||(a=An),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;i|=2,s.set(t,e);var h=wn(a(t),a(e),i,r,o,s);return s.delete(t),h;case"[object Symbol]":if(Cn)return Cn.call(t)==Cn.call(e)}return!1}(t,n,c,i,r,o,s);if(!(1&i)){var f=u&&ri.call(t,"__wrapped__"),m=d&&ri.call(n,"__wrapped__");if(f||m){var g=f?t.value():t,v=m?n.value():n;return s||(s=new yn),o(g,v,i,r,s)}}return!!p&&(s||(s=new yn),function(t,e,n,i,r,o){var s=1&n,a=Nn(t),l=a.length;if(l!=Nn(e).length&&!s)return!1;for(var c=l;c--;){var h=a[c];if(!(s?h in e:Bn.call(e,h)))return!1}var u=o.get(t),d=o.get(e);if(u&&d)return u==e&&d==t;var p=!0;o.set(t,e),o.set(e,t);for(var f=s;++c<l;){var m=t[h=a[c]],g=e[h];if(i)var v=s?i(g,m,h,e,t,o):i(m,g,h,t,e,o);if(!(void 0===v?m===g||r(m,g,n,i,o):v)){p=!1;break}f||(f="constructor"==h)}if(p&&!f){var _=t.constructor,y=e.constructor;_==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(t),o.delete(e),p}(t,n,i,r,o,s))}function si(t,e,n,i,r){return t===e||(null==t||null==e||!p(t)&&!p(e)?t!=t&&e!=e:oi(t,e,n,i,si,r))}function ai(t){return t==t&&!_(t)}function li(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function ci(t){var e=function(t){for(var e=be(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,ai(r)]}return e}(t);return 1==e.length&&e[0][2]?li(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,i){var r=n.length,o=r,s=!i;if(null==t)return!o;for(t=Object(t);r--;){var a=n[r];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++r<o;){var l=(a=n[r])[0],c=t[l],h=a[1];if(s&&a[2]){if(void 0===c&&!(l in t))return!1}else{var u=new yn;if(i)var d=i(c,h,l,t,e,u);if(!(void 0===d?si(h,c,3,i,u):d))return!1}}return!0}(n,t,e)}}function hi(t,e){return null!=t&&e in Object(t)}function ui(t,n){return null!=t&&function(t,n,i){for(var r=-1,o=(n=it(n,t)).length,s=!1;++r<o;){var a=rt(n[r]);if(!(s=null!=t&&i(t,a)))break;t=t[a]}return s||++r!=o?s:!!(o=null==t?0:t.length)&&ne(o)&&ee(a,o)&&(e(t)||qt(t))}(t,n,hi)}function di(t){return function(e){return null==e?void 0:e[t]}}function pi(t){return v(t)?di(rt(t)):function(t){return function(e){return ot(e,t)}}(t)}function fi(t){return"function"==typeof t?t:null==t?we:"object"==typeof t?e(t)?(n=t[0],i=t[1],v(n)&&ai(i)?li(rt(n),i):function(t){var e=st(t,n);return void 0===e&&e===i?ui(t,n):si(i,e,3)}):ci(t):pi(t);var n,i}function mi(t,e){var n=-1,i=ye(t)?Array(t.length):[];return Se(t,function(t,r,o){i[++n]=e(t,r,o)}),i}function gi(t,n){return(e(t)?J:mi)(t,fi(n))}var vi=function(){try{var t=I(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),_i=vi;function yi(t,e,n){"__proto__"==e&&_i?_i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function bi(t){if(!Ae(t))return{};if(!Ae(t=st(t=_n(t,"?"),"[1]")))return{};let e=_n(t,"&");return e=gi(e,function(t){return _n(t,"=")}),e=function(t){for(var e=-1,n=null==t?0:t.length,i={};++e<n;){var r=t[e];yi(i,r[0],r[1])}return i}(e),e}var xi=di("length"),Si="\\ud800-\\udfff",wi="["+Si+"]",Mi="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ti="\\ud83c[\\udffb-\\udfff]",Ai="[^"+Si+"]",Ei="(?:\\ud83c[\\udde6-\\uddff]){2}",Ci="[\\ud800-\\udbff][\\udc00-\\udfff]",Ri="(?:"+Mi+"|"+Ti+")"+"?",Pi="[\\ufe0e\\ufe0f]?",Li=Pi+Ri+("(?:\\u200d(?:"+[Ai,Ei,Ci].join("|")+")"+Pi+Ri+")*"),Ii="(?:"+[Ai+Mi+"?",Mi,Ei,Ci,wi].join("|")+")",Oi=RegExp(Ti+"(?="+Ti+")|"+Ii+Li,"g");function ki(t){return tn(t)?function(t){for(var e=Oi.lastIndex=0;Oi.test(t);)++e;return e}(t):xi(t)}function Ui(t){if(null==t)return 0;if(ye(t))return"string"==typeof(n=t)||!e(n)&&p(n)&&"[object String]"==d(n)?ki(t):t.length;var n,i=ti(t);return"[object Map]"==i||"[object Set]"==i?t.size:_e(t).length}function Di(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(!e(t[n],n,t))return!1;return!0}function Ni(t,e){var n=!0;return Se(t,function(t,i,r){return n=!!e(t,i,r)}),n}function Bi(t,e){return si(t,e)}function Fi(t){return"[object Object]"===Object.prototype.toString.call(t)}function zi(t){if(!He(t))return!1;return Xe(t)>0}let Hi="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Wi=Hi.length;function Vi(t=32){let e=[];t=zi(t)?Xe(t):32;for(let n=0;n<t;n++)e[n]=Hi[0|Math.random()*Wi];return e.join("")}var Gi=Object.prototype.hasOwnProperty;function ji(t,e,n){var i=t[e];Gi.call(t,e)&&N(i,n)&&(void 0!==n||e in t)||yi(t,e,n)}function Xi(t,e,n,i){var r=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=i?i(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),r?yi(n,a,l):ji(n,a,l)}return n}var $i=Object.prototype.hasOwnProperty;function Yi(t){if(!_(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=fe(t),n=[];for(var i in t)("constructor"!=i||!e&&$i.call(t,i))&&n.push(i);return n}function qi(t){return ye(t)?de(t,!0):Yi(t)}var Zi="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ki=Zi&&"object"==typeof module&&module&&!module.nodeType&&module,Ji=Ki&&Ki.exports===Zi?r.Buffer:void 0,Qi=Ji?Ji.allocUnsafe:void 0;function tr(t,e){if(e)return t.slice();var n=t.length,i=Qi?Qi(n):new t.constructor(n);return t.copy(i),i}function er(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}var nr=me(Object.getPrototypeOf,Object),ir=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Rn(e,Dn(t)),t=nr(t);return e}:In,rr=ir;function or(t){return Pn(t,qi,rr)}var sr=Object.prototype.hasOwnProperty;function ar(t){var e=new t.constructor(t.byteLength);return new Mn(e).set(new Mn(t)),e}var lr=/\w*$/;var cr=o?o.prototype:void 0,hr=cr?cr.valueOf:void 0;function ur(t,e){var n=e?ar(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function dr(t,e,n){var i,r=t.constructor;switch(e){case"[object ArrayBuffer]":return ar(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return function(t,e){var n=e?ar(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ur(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,lr.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return i=t,hr?Object(hr.call(i)):{}}}var pr=Object.create,fr=function(){function t(){}return function(e){if(!_(e))return{};if(pr)return pr(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),mr=fr;function gr(t){return"function"!=typeof t.constructor||fe(t)?{}:mr(nr(t))}var vr=le&&le.isMap,_r=vr?re(vr):function(t){return p(t)&&"[object Map]"==ti(t)};var yr=le&&le.isSet,br=yr?re(yr):function(t){return p(t)&&"[object Set]"==ti(t)},xr="[object Arguments]",Sr="[object Function]",wr="[object Object]",Mr={};function Tr(t,n,i,r,o,s){var a,l=1&n,c=2&n,h=4&n;if(i&&(a=o?i(t,r,o,s):i(t)),void 0!==a)return a;if(!_(t))return t;var u=e(t);if(u){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&sr.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return er(t,a)}else{var d=ti(t),p=d==Sr||"[object GeneratorFunction]"==d;if(Qt(t))return tr(t,l);if(d==wr||d==xr||p&&!o){if(a=c||p?{}:gr(t),!l)return c?function(t,e){return Xi(t,rr(t),e)}(t,function(t,e){return t&&Xi(e,qi(e),t)}(a,t)):function(t,e){return Xi(t,Dn(t),e)}(t,function(t,e){return t&&Xi(e,be(e),t)}(a,t))}else{if(!Mr[d])return o?t:{};a=dr(t,d,l)}}s||(s=new yn);var f=s.get(t);if(f)return f;s.set(t,a),br(t)?t.forEach(function(e){a.add(Tr(e,n,i,e,t,s))}):_r(t)&&t.forEach(function(e,r){a.set(r,Tr(e,n,i,r,t,s))});var m=u?void 0:(h?c?or:Nn:c?qi:be)(t);return zt(m||t,function(e,r){m&&(e=t[r=e]),ji(a,r,Tr(e,n,i,r,t,s))}),a}Mr[xr]=Mr["[object Array]"]=Mr["[object ArrayBuffer]"]=Mr["[object DataView]"]=Mr["[object Boolean]"]=Mr["[object Date]"]=Mr["[object Float32Array]"]=Mr["[object Float64Array]"]=Mr["[object Int8Array]"]=Mr["[object Int16Array]"]=Mr["[object Int32Array]"]=Mr["[object Map]"]=Mr["[object Number]"]=Mr[wr]=Mr["[object RegExp]"]=Mr["[object Set]"]=Mr["[object String]"]=Mr["[object Symbol]"]=Mr["[object Uint8Array]"]=Mr["[object Uint8ClampedArray]"]=Mr["[object Uint16Array]"]=Mr["[object Uint32Array]"]=!0,Mr["[object Error]"]=Mr[Sr]=Mr["[object WeakMap]"]=!1;function Ar(t){return Tr(t,5)}function Er(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Cr={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,o||t,s),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function s(t,e){0===--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,r,o,s){var a=n?n+t:t;if(!this._events[a])return!1;var l,c,h=this._events[a],u=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),u){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,i),!0;case 4:return h.fn.call(h.context,e,i,r),!0;case 5:return h.fn.call(h.context,e,i,r,o),!0;case 6:return h.fn.call(h.context,e,i,r,o,s),!0}for(c=1,l=new Array(u-1);c<u;c++)l[c-1]=arguments[c];h.fn.apply(h.context,l)}else{var d,p=h.length;for(c=0;c<p;c++)switch(h[c].once&&this.removeListener(t,h[c].fn,void 0,!0),u){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,e);break;case 3:h[c].fn.call(h[c].context,e,i);break;case 4:h[c].fn.call(h[c].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];h[c].fn.apply(h[c].context,l)}}return!0},a.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,r){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||r&&!a.once||i&&a.context!==i||s(this,o);else{for(var l=0,c=[],h=a.length;l<h;l++)(a[l].fn!==e||r&&!a[l].once||i&&a[l].context!==i)&&c.push(a[l]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(Cr);var Rr=Er(Cr.exports);function Pr(){return new Rr}function Lr(t){let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e}function Ir(){let t={};return{bind:function(e,n,i){let r=`r${Vi()}`;e.setAttribute("ev-resize",r);let o=function(t,e={}){let n=st(e,"timeInterval",null);zi(n)||(n=20);let i=st(e,"tolerancePixel",null);zi(i)||(i=1);let r,o=Pr(),s={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0},a=Ar(s),l={width:"",height:""};if(!Lr(t))return console.log("invalid f",t),null;r=setInterval(()=>{let e=t();if(e){let t={offsetWidth:e.offsetWidth,offsetHeight:e.offsetHeight,clientWidth:e.clientWidth,clientHeight:e.clientHeight,windowWidth:window.innerWidth,windowHeight:window.innerHeight},n=a.offsetWidth-t.offsetWidth,r=a.offsetHeight-t.offsetHeight,c=Math.abs(n)>i,h=Math.abs(r)>i,u="";n>0?u="smaller":n<0&&(u="larger");let d="";if(r>0?d="smaller":r<0&&(d="larger"),l={width:u,height:d},c||h){let n={...a};setTimeout(()=>{t.offsetWidth>0&&t.offsetHeight>0&&(o.emit("resize",{sold:n,snew:t,smode:l,ele:e}),o.emit("resizeWithWindow",{sold:n,snew:t,smode:l,ele:e,from:"dom"}))},1)}s=a,a=t}},n);let c=t=>{o.emit("resizeWithWindow",{sold:s,snew:a,smode:l,from:"window"})};return window.addEventListener("resize",c),o.clear=()=>{clearInterval(r),window.removeEventListener("resize",c)},o}(()=>e);o.on("resizeWithWindow",t=>{!function(t,e,n){let i=t.data&&t.data.on||t.componentOptions&&t.componentOptions.listeners;i&&i[e]&&i[e].fns(n)}(i,"domresize",t)}),t[r]=o},unbind:function(e){let n=e.getAttribute("ev-resize");e.setAttribute("ev-resize",null),t[n]&&(t[n].clear(),t[n]=null,delete t[n])}}}var Or,kr=(Or="toUpperCase",function(t){var e=tn(t=nt(t))?vn(t):void 0,n=e?e[0]:t.charAt(0),i=e?Je(e,1).join(""):t.slice(1);return n[Or]()+i});function Ur(t){return kr(nt(t).toLowerCase())}var Dr=Nt(function(t,e,n){return e=e.toLowerCase(),t+(n?Ur(e):e)}),Nr=Dr;let Br={default:{red:{base:"#f44336",lighten5:"#ffebee",lighten4:"#ffcdd2",lighten3:"#ef9a9a",lighten2:"#e57373",lighten1:"#ef5350",darken1:"#e53935",darken2:"#d32f2f",darken3:"#c62828",darken4:"#b71c1c",accent1:"#ff8a80",accent2:"#ff5252",accent3:"#ff1744",accent4:"#d50000"},pink:{base:"#e91e63",lighten5:"#fce4ec",lighten4:"#f8bbd0",lighten3:"#f48fb1",lighten2:"#f06292",lighten1:"#ec407a",darken1:"#d81b60",darken2:"#c2185b",darken3:"#ad1457",darken4:"#880e4f",accent1:"#ff80ab",accent2:"#ff4081",accent3:"#f50057",accent4:"#c51162"},purple:{base:"#9c27b0",lighten5:"#f3e5f5",lighten4:"#e1bee7",lighten3:"#ce93d8",lighten2:"#ba68c8",lighten1:"#ab47bc",darken1:"#8e24aa",darken2:"#7b1fa2",darken3:"#6a1b9a",darken4:"#4a148c",accent1:"#ea80fc",accent2:"#e040fb",accent3:"#d500f9",accent4:"#aa00ff"},deepPurple:{base:"#673ab7",lighten5:"#ede7f6",lighten4:"#d1c4e9",lighten3:"#b39ddb",lighten2:"#9575cd",lighten1:"#7e57c2",darken1:"#5e35b1",darken2:"#512da8",darken3:"#4527a0",darken4:"#311b92",accent1:"#b388ff",accent2:"#7c4dff",accent3:"#651fff",accent4:"#6200ea"},indigo:{base:"#3f51b5",lighten5:"#e8eaf6",lighten4:"#c5cae9",lighten3:"#9fa8da",lighten2:"#7986cb",lighten1:"#5c6bc0",darken1:"#3949ab",darken2:"#303f9f",darken3:"#283593",darken4:"#1a237e",accent1:"#8c9eff",accent2:"#536dfe",accent3:"#3d5afe",accent4:"#304ffe"},blue:{base:"#2196f3",lighten5:"#e3f2fd",lighten4:"#bbdefb",lighten3:"#90caf9",lighten2:"#64b5f6",lighten1:"#42a5f5",darken1:"#1e88e5",darken2:"#1976d2",darken3:"#1565c0",darken4:"#0d47a1",accent1:"#82b1ff",accent2:"#448aff",accent3:"#2979ff",accent4:"#2962ff"},lightBlue:{base:"#03a9f4",lighten5:"#e1f5fe",lighten4:"#b3e5fc",lighten3:"#81d4fa",lighten2:"#4fc3f7",lighten1:"#29b6f6",darken1:"#039be5",darken2:"#0288d1",darken3:"#0277bd",darken4:"#01579b",accent1:"#80d8ff",accent2:"#40c4ff",accent3:"#00b0ff",accent4:"#0091ea"},cyan:{base:"#00bcd4",lighten5:"#e0f7fa",lighten4:"#b2ebf2",lighten3:"#80deea",lighten2:"#4dd0e1",lighten1:"#26c6da",darken1:"#00acc1",darken2:"#0097a7",darken3:"#00838f",darken4:"#006064",accent1:"#84ffff",accent2:"#18ffff",accent3:"#00e5ff",accent4:"#00b8d4"},teal:{base:"#009688",lighten5:"#e0f2f1",lighten4:"#b2dfdb",lighten3:"#80cbc4",lighten2:"#4db6ac",lighten1:"#26a69a",darken1:"#00897b",darken2:"#00796b",darken3:"#00695c",darken4:"#004d40",accent1:"#a7ffeb",accent2:"#64ffda",accent3:"#1de9b6",accent4:"#00bfa5"},green:{base:"#4caf50",lighten5:"#e8f5e9",lighten4:"#c8e6c9",lighten3:"#a5d6a7",lighten2:"#81c784",lighten1:"#66bb6a",darken1:"#43a047",darken2:"#388e3c",darken3:"#2e7d32",darken4:"#1b5e20",accent1:"#b9f6ca",accent2:"#69f0ae",accent3:"#00e676",accent4:"#00c853"},lightGreen:{base:"#8bc34a",lighten5:"#f1f8e9",lighten4:"#dcedc8",lighten3:"#c5e1a5",lighten2:"#aed581",lighten1:"#9ccc65",darken1:"#7cb342",darken2:"#689f38",darken3:"#558b2f",darken4:"#33691e",accent1:"#ccff90",accent2:"#b2ff59",accent3:"#76ff03",accent4:"#64dd17"},lime:{base:"#cddc39",lighten5:"#f9fbe7",lighten4:"#f0f4c3",lighten3:"#e6ee9c",lighten2:"#dce775",lighten1:"#d4e157",darken1:"#c0ca33",darken2:"#afb42b",darken3:"#9e9d24",darken4:"#827717",accent1:"#f4ff81",accent2:"#eeff41",accent3:"#c6ff00",accent4:"#aeea00"},yellow:{base:"#ffeb3b",lighten5:"#fffde7",lighten4:"#fff9c4",lighten3:"#fff59d",lighten2:"#fff176",lighten1:"#ffee58",darken1:"#fdd835",darken2:"#fbc02d",darken3:"#f9a825",darken4:"#f57f17",accent1:"#ffff8d",accent2:"#ffff00",accent3:"#ffea00",accent4:"#ffd600"},amber:{base:"#ffc107",lighten5:"#fff8e1",lighten4:"#ffecb3",lighten3:"#ffe082",lighten2:"#ffd54f",lighten1:"#ffca28",darken1:"#ffb300",darken2:"#ffa000",darken3:"#ff8f00",darken4:"#ff6f00",accent1:"#ffe57f",accent2:"#ffd740",accent3:"#ffc400",accent4:"#ffab00"},orange:{base:"#ff9800",lighten5:"#fff3e0",lighten4:"#ffe0b2",lighten3:"#ffcc80",lighten2:"#ffb74d",lighten1:"#ffa726",darken1:"#fb8c00",darken2:"#f57c00",darken3:"#ef6c00",darken4:"#e65100",accent1:"#ffd180",accent2:"#ffab40",accent3:"#ff9100",accent4:"#ff6d00"},deepOrange:{base:"#ff5722",lighten5:"#fbe9e7",lighten4:"#ffccbc",lighten3:"#ffab91",lighten2:"#ff8a65",lighten1:"#ff7043",darken1:"#f4511e",darken2:"#e64a19",darken3:"#d84315",darken4:"#bf360c",accent1:"#ff9e80",accent2:"#ff6e40",accent3:"#ff3d00",accent4:"#dd2c00"},brown:{base:"#795548",lighten5:"#efebe9",lighten4:"#d7ccc8",lighten3:"#bcaaa4",lighten2:"#a1887f",lighten1:"#8d6e63",darken1:"#6d4c41",darken2:"#5d4037",darken3:"#4e342e",darken4:"#3e2723"},blueGrey:{base:"#607d8b",lighten5:"#eceff1",lighten4:"#cfd8dc",lighten3:"#b0bec5",lighten2:"#90a4ae",lighten1:"#78909c",darken1:"#546e7a",darken2:"#455a64",darken3:"#37474f",darken4:"#263238"},grey:{base:"#9e9e9e",lighten5:"#fafafa",lighten4:"#f5f5f5",lighten3:"#eeeeee",lighten2:"#e0e0e0",lighten1:"#bdbdbd",darken1:"#757575",darken2:"#616161",darken3:"#424242",darken4:"#212121"},shades:{black:"#000000",white:"#ffffff",transparent:"transparent"}}};function Fr(t){if("white"===t)return"#fff";if("black"===t)return"#000";if("transparent"===t)return"rgba(0,0,0,0)";let e=function(t){let e=_n(t," ");return 1===Ui(e)&&(e[1]=null),e}(t),n=function(t,e,n){let i=st(Br,`default.${t}.${e}`,null);return null===i&&(i=n),i}(function(t){let e=t.trim();return e=Nr(e),e}(e[0]),function(t){Ae(t)||(t="base");let e=t.trim();return e=e.replace("-","").trim(),e}(e[1]),t);return n}function zr(t,e,n){if(!Ae(t))return"";if(!Ae(e))return"";if(!Te(n))return"";return String(t).replaceAll(e,n)}function Hr(t){if(Fi(t)){for(let e in t)return!0;return!1}return!1}var Wr=Function.prototype,Vr=Object.prototype,Gr=Wr.toString,jr=Vr.hasOwnProperty,Xr=Gr.call(Object);function $r(t){if(!p(t)||"[object Object]"!=d(t))return!1;var e=nr(t);if(null===e)return!0;var n=jr.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Gr.call(n)==Xr}function Yr(t){return p(e=t)&&1===e.nodeType&&!$r(e);var e}function qr(t){function e(t){t.parentNode.removeChild(t)}if(Yr(t)){return void e(t)}if(!Ae(t))return;let n=function(t){return document.querySelectorAll(t)}(t);Me(n,function(t){e(t)})}function Zr(t,e,n={}){let i=st(n,"timeDuration",null);zi(i)||(i=1e3);let r=st(n,"color",null);if(Ae(r)||(r="rgba(255, 255, 255, 0.5)"),!Yr(t))return;t.style.position="relative",t.style.overflow="hidden";let o=t.getBoundingClientRect(),s=e.clientX-o.left,a=e.clientY-o.top,l=2*Math.max(t.clientWidth,t.clientHeight),c=document.createElement("div");c.style.width=`${l}px`,c.style.height=`${l}px`,c.style.transition=`all ${i/1e3}s linear`,c.style.position="absolute",c.style.zIndex=1,c.style.left=`${s}px`,c.style.top=`${a}px`,c.style.borderRadius="50%",c.style.transformOrigin="center",c.style.transform="translate(-50%,-50%) scale(0)",c.style.background=r,c.style.userSelect="none",c.style.pointerEvents="none",t.appendChild(c),setTimeout(()=>{c.style.transform="translate(-50%,-50%) scale(2)",c.style.opacity=0},1),setTimeout(()=>{qr(c)},i)}function Kr(t){return!0===(e=t)||!1===e||p(e)&&"[object Boolean]"==d(e);var e}function Jr(t){return"number"==typeof t||p(t)&&"[object Number]"==d(t)}function Qr(t,e={}){let n=st(e,"parse");Kr(n)||(n=!0);let i=st(e,"ext");Hr(i)||(i={});let r=st(e,"semicolon");Kr(r)||(r=!0);let o=st(e,"returnObj");Kr(o)||(o=!1);let s=0,a=0,l=0,c=0;if(n){let e=function(t,e={}){let n,i=st(e,"def",""),r=st(e,"type","");"num"!==r&&"text"!==r&&(r="num"),"num"===r?n=Jr:"text"===r&&(n=Te);let o=i,s=i,a=i,l=i;return n(st(t,"h"))&&(o=st(t,"h"),s=o),n(st(t,"v"))&&(a=st(t,"v"),l=a),n(st(t,"left"))&&(o=st(t,"left")),n(st(t,"right"))&&(s=st(t,"right")),n(st(t,"top"))&&(a=st(t,"top")),n(st(t,"bottom"))&&(l=st(t,"bottom")),{left:o,right:s,top:a,bottom:l}}(t);s=e.left,a=e.right,l=e.top,c=e.bottom}s+=st(i,"left",0),a+=st(i,"right",0),l+=st(i,"top",0),c+=st(i,"bottom",0);let h=null;return o?h={left:s,right:a,top:l,bottom:c}:(h=`${l}px ${a}px ${c}px ${s}px`,r&&(h=`${h};`)),h}function to(t){return"[object Array]"===Object.prototype.toString.call(t)}function eo(t){return"[object Undefined]"===Object.prototype.toString.call(t)}function no(t){return!!eo(t)||(!!function(t){return"[object Null]"===Object.prototype.toString.call(t)}(t)||(!!function(t){if(Fi(t)){for(let e in t)return!1;return!0}return!1}(t)||(!!function(t){return!(!Te(t)||""!==t)}(t)||(!!function(t){return!!to(t)&&0===t.length}(t)||!!Be(t)))))}function io(t){return!!to(t)&&(0!==t.length&&(1!==t.length||!no(t[0])))}var ro={components:{},props:{icon:{type:[String,Array],default:""},color:{type:String,default:"grey darken-1"},colorHover:{type:String,default:"grey darken-3"},sizeOriginal:{type:Number,default:24},size:{type:Number,default:24},timeTransition:{type:Number,default:.15}},data:function(){return{mouseEnter:!1,r:.83,paths:[]}},computed:{hasIcon:function(){return Ae(this.icon)},isMdi:function(){return!!this.hasIcon&&this.icon.indexOf("mdi-")>=0},isFa:function(){return!!this.hasIcon&&this.icon.indexOf(" fa-")>=0},isSvg:function(){let t=this;if(t.isMdi||t.isFa)return!1;let e=Ae(t.icon),n=io(t.icon);return e||n},usePaths:function(){let t=this;if(!t.isSvg)return[];let e=t.icon;return Ae(t.icon)&&(e=[t.icon]),e},useIconColor:function(){let t=this;return t.mouseEnter?Fr(t.colorHover):Fr(t.color)},useStyleSize:function(){let t=this;return{width:`${t.size}px`,height:`${t.size}px`,"line-height":`${t.size}px`,"max-height":`${t.size}px`,"min-height":`${t.size}px`}}},methods:{}};function oo(t,e,n,i,r,o,s,a,l,c){"boolean"!=typeof s&&(l=a,a=s,s=!1);const h="function"==typeof n?n.options:n;let u;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,r&&(h.functional=!0)),i&&(h._scopeId=i),o?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},h._ssrRegister=u):e&&(u=s?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),u)if(h.functional){const t=h.render;h.render=function(e,n){return u.call(n),t(e,n)}}else{const t=h.beforeCreate;h.beforeCreate=t?[].concat(t,u):[u]}return n}const so="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function ao(t){return(t,e)=>function(t,e){const n=so?e.media||"default":t,i=co[n]||(co[n]={ids:new Set,styles:[]});if(!i.ids.has(t)){i.ids.add(t);let n=e.source;if(e.map&&(n+="\n/*# sourceURL="+e.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",e.media&&i.element.setAttribute("media",e.media),void 0===lo&&(lo=document.head||document.getElementsByTagName("head")[0]),lo.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(n),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{const t=i.ids.size-1,e=document.createTextNode(n),r=i.element.childNodes;r[t]&&i.element.removeChild(r[t]),r.length?i.element.insertBefore(e,r[t]):i.element.appendChild(e)}}}(t,e)}let lo;const co={};const ho=ro;var uo=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.icon?n("div",{style:[t.useStyleSize,{display:"flex","align-items":"center","user-select":"none",border:"0px solid #ddd"}],on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:function(e){t.$emit("click",e)}.apply(null,arguments)},click:function(e){t.$emit("click",e)}}},[t.isSvg?n("svg",{style:"transition:all "+t.timeTransition+"s linear; fill:"+t.useIconColor+";",attrs:{width:t.size,height:t.size,viewBox:"0 0 "+t.sizeOriginal+" "+t.sizeOriginal},on:{mouseenter:function(e){t.mouseEnter=!0},mouseleave:function(e){t.mouseEnter=!1}}},t._l(t.usePaths,function(e,i){return n("path",{key:i,attrs:{d:t.icon}})}),0):t._e(),t._v(" "),t.isMdi?n("div",{style:"transition:all "+t.timeTransition+"s linear; width:"+t.size+"px; height:"+t.size+"px; color:"+t.useIconColor+"; display:flex; align-items:center; justify-content:center;",on:{mouseenter:function(e){t.mouseEnter=!0},mouseleave:function(e){t.mouseEnter=!1}}},[n("span",{class:"mdi "+t.icon,style:"font-size:"+t.size+"px;"})]):t._e(),t._v(" "),t.isFa?n("div",{style:"transition:all "+t.timeTransition+"s linear; width:"+t.size+"px; height:"+t.size+"px; color:"+t.useIconColor+"; display:flex; align-items:center; justify-content:center;",on:{mouseenter:function(e){t.mouseEnter=!0},mouseleave:function(e){t.mouseEnter=!1}}},[n("div",{style:"width:"+t.size+"px; height:"+t.size+"px; _transform-origin:center; transform:translateX(0px) translateY(0px) scale("+t.r+");"},[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("i",{class:"fas "+t.icon,style:"font-size:"+t.size+"px;"})])])]):t._e()]):t._e()};uo._withStripped=!0;const po=oo({render:uo,staticRenderFns:[]},function(t){t&&t("data-v-3aa6fba6_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WIcon.vue"},media:void 0})},ho,"data-v-3aa6fba6",false,void 0,!1,ao,void 0,void 0);var fo={directives:{domripple:function(){let t={};return{bind:function(e,n,i){let r=`r${Vi()}`;e.setAttribute("ev-ripple",r),function(e,n){let i=e.getAttribute("ev-ripple"),r=st(n,"value");if(r=Hr(r),!r)return;let o=st(n,"value.color");if(!Ae(o))return;o=Fr(o);let s=st(n,"value.timeDuration");Fe(s)||(s=1e3);function a(t){Zr(t.currentTarget,t,{color:o,timeDuration:s})}s=ze(s),e.addEventListener("click",a,!1),t[i]=a}(e,n)},unbind:function(e){!function(e){let n=e.getAttribute("ev-ripple");if(t[n]){let i=t[n];e.removeEventListener("click",i,!1),delete t[n]}}(e),e.setAttribute("ev-ripple",null)}}}()},components:{WIcon:po},props:{text:{type:String,default:""},textFontSize:{type:String,default:"1rem"},active:{type:Boolean,default:!1},paddingStyle:{type:Object,default:()=>({v:10,h:12})},borderRadius:{type:Number,default:0},backgroundColor:{type:String,default:"white"},backgroundColorHover:{type:String,default:"rgba(200,200,200,0.2)"},backgroundColorActive:{type:String,default:"orange lighten-1"},backgroundColorDisabled:{type:String,default:"white"},textColor:{type:String,default:"#444"},textColorHover:{type:String,default:"#222"},textColorActive:{type:String,default:"white"},textColorDisabled:{type:String,default:"#444"},icon:{type:String,default:""},iconSize:{type:Number,default:22},iconColor:{type:String,default:"#444"},iconColorHover:{type:String,default:"#222"},iconColorActive:{type:String,default:"white"},iconColorDisabled:{type:String,default:"#444"},rippleColor:{type:String,default:"rgba(255,255,255,0.4)"},editable:{type:Boolean,default:!0},disabledColor:{type:String,default:"rgba(255,255,255,0.5)"},cursorPointer:{type:Boolean,default:!0}},data:function(){return{mouseEnter:!1}},computed:{useTextFontSize:function(){let t=this.textFontSize;return t=zr(t,";",""),`font-size:${t};`},hasIcon:function(){return""!==this.icon},usePadding:function(){return`padding:${Qr(this.paddingStyle,{ext:{}})};`},effBackgroundColor:function(){return Fr(this.backgroundColor)},effBackgroundColorHover:function(){return Fr(this.backgroundColorHover)},effBackgroundActive:function(){return Fr(this.backgroundColorActive)},effBackgroundColorDisabled:function(){return Fr(this.backgroundColorDisabled)},useBackgroundColor:function(){let t=this;return t.editable?t.active?t.effBackgroundActive:t.mouseEnter?t.effBackgroundColorHover:t.effBackgroundColor:t.effBackgroundColorDisabled},effTextColor:function(){return Fr(this.textColor)},effTextColorHover:function(){return Fr(this.textColorHover)},effTextActive:function(){return Fr(this.textColorActive)},effTextColorDisabled:function(){return Fr(this.textColorDisabled)},useTextColor:function(){let t=this;return t.editable?t.active?t.effTextActive:t.mouseEnter?t.effTextColorHover:t.effTextColor:t.effTextColorDisabled},effIconColor:function(){return Fr(this.iconColor)},effIconColorHover:function(){return Fr(this.iconColorHover)},effIconActive:function(){return Fr(this.iconColorActive)},effIconColorDisabled:function(){return Fr(this.iconColorDisabled)},useIconColor:function(){let t=this;return t.editable?t.active?t.effIconActive:t.mouseEnter?t.effIconColorHover:t.effIconColor:t.effIconColorDisabled},effDisabledColor:function(){return Fr(this.disabledColor)}},methods:{clickItem:function(){let t=this;t.editable&&t.$emit("click",{icon:t.icon,text:t.text})}}};const mo=fo;var go=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"domripple",rawName:"v-domripple",value:{color:t.rippleColor},expression:"{color:rippleColor}"}],style:"position:relative; transition:all 0.3s; border-top-left-radius:"+t.borderRadius+"px; border-top-right-radius:"+t.borderRadius+"px; "+t.usePadding+" background:"+t.useBackgroundColor+"; "+(t.editable&&t.cursorPointer?"cursor:pointer;":"cursor:context-menu;"),on:{mouseenter:function(e){t.mouseEnter=!0},mouseleave:function(e){t.mouseEnter=!1},click:t.clickItem}},[n("div",{style:"transition:all 0.3s; color:"+t.useTextColor+"; "+t.useTextFontSize},[t._t("item",function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[t._t("item-left",null,{isHover:t.mouseEnter,isActive:t.active}),t._v(" "),t._t("item-content",function(){return[t.hasIcon?n("WIcon",{staticStyle:{"margin-right":"8px"},attrs:{icon:t.icon,color:t.useIconColor,colorHover:t.useIconColor,size:t.iconSize}}):t._e(),t._v(" "),n("div",[t._v("\n "+t._s(t.text)+"\n ")])]},{isHover:t.mouseEnter,isActive:t.active}),t._v(" "),t._t("item-right",null,{isHover:t.mouseEnter,isActive:t.active})],2)]},{isHover:t.mouseEnter,isActive:t.active}),t._v(" "),t.editable?t._e():n("div",{staticStyle:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}},[n("div",{style:"overflow:hidden; width:100%; height:100%;"},[n("div",{style:"background:"+t.effDisabledColor+"; height:100%;"})])])],2)])};go._withStripped=!0;const vo=oo({render:go,staticRenderFns:[]},function(t){t&&t("data-v-374fc012_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WListItem.vue"},media:void 0})},mo,"data-v-374fc012",false,void 0,!1,ao,void 0,void 0);var _o={directives:{domresize:Ir()},components:{WListItem:vo},props:{items:{type:Array,default:()=>[]},enableActive:{type:Boolean,default:!0},itemActive:{type:[String,Object],default:null},itemTextFontSize:{type:String,default:"1rem"},keyText:{type:String,default:"text"},keyIcon:{type:String,default:"icon"},space:{type:Number,default:0},paddingStyle:{type:Object,default:()=>({v:10,h:12})},itemBorderRadius:{type:Number,default:0},itemBackgroundColor:{type:String,default:"transparent"},itemBackgroundColorHover:{type:String,default:"rgba(200,200,200,0.2)"},itemBackgroundColorActive:{type:String,default:"white"},itemBackgroundColorDisabled:{type:String,default:"white"},itemTextColor:{type:String,default:"#444"},itemTextColorHover:{type:String,default:"#222"},itemTextColorActive:{type:String,default:"orange darken-3"},itemTextColorDisabled:{type:String,default:"#444"},itemIconSize:{type:Number,default:22},itemIconColor:{type:String,default:"#444"},itemIconColorHover:{type:String,default:"#222"},itemIconColorActive:{type:String,default:"orange darken-3"},itemIconColorDisabled:{type:String,default:"#444"},itemRippleColor:{type:String,default:"rgba(245,124,0,0.4)"},borderBottom:{type:Boolean,default:!0},borderBottomSize:{type:Number,default:2},borderBottomColor:{type:String,default:"rgba(245,124,0,0.8)"},itemDisabledColor:{type:String,default:"transparent"},itemCursorPointer:{type:Boolean,default:!0}},data:function(){return{borderBottomLeft:0,borderBottomWidth:0,itemActiveTrans:null}},watch:{itemActiveTrans:{handler(t,e){this.updateBorderBottom()},immediate:!0}},computed:{changeItemActive:function(){let t=this;return t.enableActive&&(t.itemActiveTrans=t.itemActive),""},isObjValue:function(){return 0!==Ui(this.items)&&function(t,n,i){var r=e(t)?Di:Ni;return i&&en(t,n,i)&&(n=void 0),r(t,fi(n))}(this.items,t=>Fi(t))},effBorderBottomColor:function(){return Fr(this.borderBottomColor)}},methods:{resize:function(t){this.updateBorderBottom()},getIcon:function(t){let e=this;return e.isObjValue?st(t,e.keyIcon,""):""},getText:function(t){let e=this;if(e.isObjValue){return st(t,e.keyText,"")}return t},getActive:function(t){let e=this,n=!1;return e.enableActive&&(n=Bi(t,e.itemActiveTrans)),n},getEditable:function(t){return st(t,"editable",!0)},updateBorderBottom:function(){let t=this;if(null==t.itemActiveTrans)return;let e=0,n=[];Me(st(t,"$refs.wli",[]),(i,r)=>{let o=i,s=st(o,"clientWidth",0),a=st(o,"clientHeight",0),l=e,c=s,h=a;r>0&&t.space>0&&(l+=t.space,c-=t.space),n.push({left:l,bottom:0,width:c,heiht:h}),e+=s});let i=-1;if(Me(t.items,(e,n)=>{if(Bi(e,t.itemActiveTrans))return i=n,!1}),-1===i)return;let r=n[i];t.borderBottomLeft=r.left,t.borderBottomWidth=r.width},ckItem:function(t,e){let n=this;if(!n.getEditable(t))return;n.itemActiveTrans=t;let i=null;i=n.isObjValue?{...t}:t,n.$emit("click",i,e),n.$emit("update:itemActive",i)}}};const yo=_o;var bo=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],attrs:{changeItemActive:t.changeItemActive},on:{domresize:t.resize}},[n("div",{staticStyle:{position:"relative",display:"flex","align-items":"center","white-space":"nowrap"}},[t.borderBottom?n("div",{style:"transition:all 0.3s; position:absolute; z-index:1; bottom:0px; left:"+t.borderBottomLeft+"px; padding-left:"+t.borderBottomWidth+"px; border-bottom:"+t.borderBottomSize+"px solid "+t.effBorderBottomColor+";"}):t._e(),t._v(" "),t._l(t.items,function(e,i){return n("div",{key:i},[n("div",{ref:"wli",refInFor:!0,style:t.space>0&&i>0?"padding-left:"+t.space+"px;":""},[n("WListItem",{attrs:{icon:t.getIcon(e),text:t.getText(e),textFontSize:t.itemTextFontSize,active:t.getActive(e),paddingStyle:t.paddingStyle,borderRadius:t.itemBorderRadius,backgroundColor:t.itemBackgroundColor,backgroundColorHover:t.itemBackgroundColorHover,backgroundColorActive:t.itemBackgroundColorActive,backgroundColorDisabled:t.itemBackgroundColorDisabled,textColor:t.itemTextColor,textColorHover:t.itemTextColorHover,textColorActive:t.itemTextColorActive,textColorDisabled:t.itemTextColorDisabled,iconSize:t.itemIconSize,iconColor:t.itemIconColor,iconColorHover:t.itemIconColorHover,iconColorActive:t.itemIconColorActive,iconColorDisabled:t.itemIconColorDisabled,rippleColor:t.getEditable(e)?t.itemRippleColor:null,editable:t.getEditable(e),disabledColor:t.itemDisabledColor,cursorPointer:!t.getActive(e)&&t.itemCursorPointer},on:{click:function(n){return t.ckItem(e,i)}},scopedSlots:t._u([{key:"item",fn:function(n){return[t._t("item",null,{item:e,kitem:i,isHover:n.isHover,isActive:n.isActive})]}},{key:"item-left",fn:function(n){return[t._t("item-left",null,{item:e,kitem:i,isHover:n.isHover,isActive:n.isActive})]}},{key:"item-content",fn:function(n){return[t._t("item-content",null,{item:e,kitem:i,isHover:n.isHover,isActive:n.isActive})]}},{key:"item-right",fn:function(n){return[t._t("item-right",null,{item:e,kitem:i,isHover:n.isHover,isActive:n.isActive})]}}],null,!0)})],1)])})],2)])};bo._withStripped=!0;const xo=oo({render:bo,staticRenderFns:[]},function(t){t&&t("data-v-8517fc2a_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WListHorizontal.vue"},media:void 0})},yo,"data-v-8517fc2a",false,void 0,!1,ao,void 0,void 0);function So(t){return t!=t}function wo(t,e,n){return e==e?function(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}(t,e,n):function(t,e,n,i){for(var r=t.length,o=n+(i?1:-1);i?o--:++o<r;)if(e(t[o],o,t))return o;return-1}(t,So,n)}function Mo(t,e,n){if((t=nt(t))&&(n||void 0===e))return Re(t);if(!t||!(e=et(e)))return t;var i=vn(t),r=vn(e),o=function(t,e){for(var n=-1,i=t.length;++n<i&&wo(e,t[n],0)>-1;);return n}(i,r),s=function(t,e){for(var n=t.length;n--&&wo(e,t[n],0)>-1;);return n}(i,r)+1;return Je(i,o,s).join("")}function To(t,e){var n=[];return Se(t,function(t,i,r){e(t,i,r)&&n.push(t)}),n}function Ao(t,n){return(e(t)?Ln:To)(t,fi(n))}function Eo(t){return nt(t).toUpperCase()}var Co=Array.prototype.join;function Ro(t,e){return null==t?"":Co.call(t,e)}function Po(t){return function(t){let e=_n(t,"&");e=gi(e,function(t){return Mo(t)});let n=Ui(e);n=Math.min(4,n);let i=[];for(let t=0;t<n;t++)i.push(e[t]);return Ro(i,"_")}(t)}function Lo(t,e){if(!Ae(t))return[];if(!Ae(e))return[];let n=function(t,e){return Ae(t)&&Ae(e)?t.split(e):[]}(t,e);n=gi(n,Mo);let i=[];return Me(n,function(t){Ae(t)&&i.push(t)}),i}function Io(){let t,e,n=new Promise(function(){t=arguments[0],e=arguments[1]});return n.resolve=t,n.reject=e,n}var Oo=o?o.isConcatSpreadable:void 0;function ko(t){return e(t)||qt(t)||!!(Oo&&t&&t[Oo])}function Uo(t,e,n,i,r){var o=-1,s=t.length;for(n||(n=ko),r||(r=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?Uo(a,e-1,n,i,r):Rn(r,a):i||(r[r.length]=a)}return r}function Do(t,e){if(t!==e){var n=void 0!==t,i=null===t,r=t==t,o=f(t),s=void 0!==e,a=null===e,l=e==e,c=f(e);if(!a&&!c&&!o&&t>e||o&&s&&l&&!a&&!c||i&&s&&l||!n&&l||!r)return 1;if(!i&&!o&&!c&&t<e||c&&n&&r&&!i&&!o||a&&n&&r||!s&&r||!l)return-1}return 0}function No(t,n,i){n=n.length?J(n,function(t){return e(t)?function(e){return ot(e,1===t.length?t[0]:t)}:t}):[we];var r=-1;return n=J(n,re(fi)),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(mi(t,function(t,e,i){return{criteria:J(n,function(e){return e(t)}),index:++r,value:t}}),function(t,e){return function(t,e,n){for(var i=-1,r=t.criteria,o=e.criteria,s=r.length,a=n.length;++i<s;){var l=Do(r[i],o[i]);if(l)return i>=a?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,i)})}var Bo=Math.max;var Fo=_i?function(t,e){return _i(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:we,zo=Fo,Ho=Date.now;var Wo=function(t){var e=0,n=0;return function(){var i=Ho(),r=16-(i-n);if(n=i,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(zo),Vo=Wo;function Go(t,e){return Vo(function(t,e,n){return e=Bo(void 0===e?t.length-1:e,0),function(){for(var i=arguments,r=-1,o=Bo(i.length-e,0),s=Array(o);++r<o;)s[r]=i[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=i[r];return a[e]=n(s),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,a)}}(t,e,we),t+"")}var jo=Go(function(t,e){if(null==t)return[];var n=e.length;return n>1&&en(t,e[0],e[1])?e=[]:n>2&&en(e[0],e[1],e[2])&&(e=[e[0]]),No(t,Uo(e,1),[])});function Xo(t){return nt(t).toLowerCase()}function $o(t,e){return Ae(t)&&$e(e)?0===(e=Xe(e))?t:Ye(t,t.length-e):""}function Yo(t){if(!(Ae(t)||Fe(t)||f(t)||function(t){return"[object BigInt]"===Object.prototype.toString.call(t)}(t)))return"";let e="";try{e=String(t)}catch(t){}try{e=t.toString()}catch(t){}return e}function qo(t,e){return!!Fi(t)&&(!(!Ae(e)&&!Fe(e))&&e in t)}function Zo(t,e,n=1){return Ae(t)&&$e(e)?(n=zi(n)?Xe(n):1,t.substring(e,e+n)):""}let Ko={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function Jo(t){return ts(t,1)}function Qo(t){return ts(t,360)}function ts(t,e=1){if(t.indexOf("%")>=0){if(!Fe(t=zr(t,"%","")))throw new Error("invalid color: value is not a number");t=ze(t)/100}else{if(!Fe(t))throw new Error("invalid color: value is not a number");t=ze(t)/e}if(t>1)throw new Error("invalid color: value > 1");if(t<0)throw new Error("invalid color: value < 0");return t}function es(t){if(!Fe(t))throw new Error("invalid color: value is not a number");if((t=ze(t))>1)throw new Error("invalid color: value > 1");if(t<0)throw new Error("invalid color: value < 0");return t}function ns(t,e="rgba"){if(!to(t))throw new Error("invalid colors array");let n=st(t,0,0),i=st(t,1,0),r=st(t,2,0),o=st(t,3,1);if(4!==Ui(e=e.split("")))throw new Error("tar.length !== 4");let s=st(e,0),a=st(e,1),l=st(e,2),c=st(e,3);return{[s]:n,[a]:i,[l]:r,[c]:o}}function is(t){let e=(t=$o(t,1)).length;if(2===e)t=`${t}${t}${t}ff`;else if(3===e){let e=Zo(t,0,1),n=Zo(t,1,1),i=Zo(t,2,1);t=`${e}${e}${n}${n}${i}${i}ff`}else if(6===e)t=`${t}ff`;else if(8!==e)throw new Error("invalid hex color");function n(t){if(2!==t.length)throw new Error("hex.length of color is not equal to 2");if(!Fe(t=parseInt(t,16)))throw new Error("invalid hex of color");return(t=ze(t))/255}return{r:n(Zo(t,0,2)),g:n(Zo(t,2,2)),b:n(Zo(t,4,2)),a:n(Zo(t,6,2))}}function rs(t){return t=ns(t=gi(t,(t,e)=>e<=2?ts(t,255):3===e?es(t):null),"rgba")}function os(t){return t=ps(t=ns(t=gi(t,(t,e)=>0===e?Qo(t):1===e||2===e?Jo(t):3===e?es(t):null),"hsla"))}function ss(t){return t=fs(t=ns(t=gi(t,(t,e)=>0===e?Qo(t):1===e||2===e?Jo(t):3===e?es(t):null),"hsva"))}function as(t){if("transparent"===t)return{r:0,g:0,b:0,a:0};if(function(t){return qo(Ko,t)}(t))return is(t=`#${Ko[t]}`);if(function(t){return"#"===qe(t,1)&&(!!/[0-9A-Fa-f]{2}/g.test(t)||(!!/[0-9A-Fa-f]{3}/g.test(t)||(!!/[0-9A-Fa-f]{6}/g.test(t)||!!/[0-9A-Fa-f]{8}/g.test(t))))}(t))return is(t);if(function(t){return"rgb"===qe(t,3)||"rgba"===qe(t,4)}(t))return function(t){return t=zr(t,"rgba",""),t=zr(t,"rgb",""),rs(Lo(t=zr(t=t.replace(/[()]/g,""),","," ")," "))}(t);if(function(t){return"hsl"===qe(t,3)||"hsla"===qe(t,4)}(t))return function(t){return t=zr(t,"hsla",""),t=zr(t,"hsl",""),os(Lo(t=zr(t=t.replace(/[()]/g,""),","," ")," "))}(t);if(function(t){return"hsv"===qe(t,3)||"hsva"===qe(t,4)}(t))return function(t){return t=zr(t,"hsva",""),t=zr(t,"hsv",""),ss(Lo(t=zr(t=t.replace(/[()]/g,""),","," ")," "))}(t);throw new Error("format of color string is not hex-color, name-color, rgba, hsla, hsva")}function ls(t,e){return!!qo(t,e=Xo(e))||!!qo(t,e=Eo(e))}function cs(t,e,n){let i;return i=st(t,e,null),null!==i?i:(i=st(t,e=Eo(e),null),null!==i?i:n)}function hs(t){if(function(t){let e=ls(t,"r"),n=ls(t,"g"),i=ls(t,"b");return e&&n&&i}(t))return function(t){let e=[cs(t,"r",null),cs(t,"g",null),cs(t,"b",null),cs(t,"a",1)];return e=gi(e,Yo),rs(e)}(t);if(function(t){let e=ls(t,"h"),n=ls(t,"s"),i=ls(t,"l");return e&&n&&i}(t))return function(t){let e=[cs(t,"h",null),cs(t,"s",null),cs(t,"l",null),cs(t,"a",1)];return e=gi(e,Yo),os(e)}(t);if(function(t){let e=ls(t,"h"),n=ls(t,"s"),i=ls(t,"v");return e&&n&&i}(t))return function(t){let e=[cs(t,"h",null),cs(t,"s",null),cs(t,"v",null),cs(t,"a",1)];return e=gi(e,Yo),ss(e)}(t);throw new Error("color object is not one of rgba, hsla, hsva")}function us(t){let e,n,i=t.r,r=t.g,o=t.b,s=Math.max(i,r,o),a=Math.min(i,r,o),l=(s+a)/2;if(s===a)e=n=0;else{let t=s-a;switch(n=l>.5?t/(2-s-a):t/(s+a),s){case i:e=(r-o)/t+(r<o?6:0);break;case r:e=(o-i)/t+2;break;case o:e=(i-r)/t+4}e/=6}return{h:e,s:n,l:l,a:t.a}}function ds(t){let e,n,i=t.r,r=t.g,o=t.b,s=Math.max(i,r,o),a=Math.min(i,r,o),l=s,c=s-a;if(n=0===s?0:c/s,s===a)e=0;else{switch(s){case i:e=(r-o)/c+(r<o?6:0);break;case r:e=(o-i)/c+2;break;case o:e=(i-r)/c+4}e/=6}return{h:e,s:n,v:l,a:t.a}}function ps(t){let e,n,i,r=t.h,o=t.s,s=t.l;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(0===o)e=n=i=s;else{let t=s<.5?s*(1+o):s+o-s*o,l=2*s-t;e=a(l,t,r+1/3),n=a(l,t,r),i=a(l,t,r-1/3)}return{r:e,g:n,b:i,a:t.a}}function fs(t){let e,n,i,r=t.h,o=t.s,s=t.v,a=Math.floor(6*r),l=6*r-a,c=s*(1-o),h=s*(1-l*o),u=s*(1-(1-l)*o);switch(a%6){case 0:e=s,n=u,i=c;break;case 1:e=h,n=s,i=c;break;case 2:e=c,n=s,i=u;break;case 3:e=c,n=h,i=s;break;case 4:e=u,n=c,i=s;break;case 5:e=s,n=c,i=h}return{r:e,g:n,b:i,a:t.a}}function ms(t){let e=Math.round(255*t).toString(16);if(1===e.length)return`0${e}`;if(2===e.length)return e;throw new Error("invalid value")}function gs(t,e=!0){let n=t.r,i=t.g,r=t.b,o=t.a,s=`${ms(n)}${ms(i)}${ms(r)}`;return e&&(s=`${s}${ms(o)}`),s}function vs(t){return Math.min(1,Math.max(0,t))}function _s(t,e){if(!Ae(e))throw new Error("fmtOutput is not a string");if(!Js[e])throw console.log(`fmtOutput must be [${be(Js)}]`),new Error("invalid fmtOutput");return t=Js[e](t)}function ys(t,e,n="toRgbString"){if(e<0||e>1)throw new Error("amount < 0 or > 1");let i=us(t);return i.h+=e,i.h=i.h%1,_s(ps(i),n)}function bs(t,e,n,i,r="toRgbString"){if(e<0||e>1)throw new Error("w1 < 0 or > 1");if(i<0||i>1)throw new Error("w1 < 0 or > 1");return _s({r:t.r*e+n.r*i,g:t.g*e+n.g*i,b:t.b*e+n.b*i,a:t.a*e+n.a*i},r)}function xs(t){return`${je(100*t,1)}%`}function Ss(t){return je(t,0)}function ws(t){return je(t,3)}function Ms(t){return{r:Ss(255*t.r),g:Ss(255*t.g),b:Ss(255*t.b)}}function Ts(t){return`rgb(${Ss(255*t.r)}, ${Ss(255*t.g)}, ${Ss(255*t.b)})`}function As(t){return{r:Ss(255*t.r),g:Ss(255*t.g),b:Ss(255*t.b),a:ws(t.a)}}function Es(t){return`rgba(${Ss(255*t.r)}, ${Ss(255*t.g)}, ${Ss(255*t.b)}, ${ws(t.a)})`}function Cs(t){let e=us(t);return{h:Ss(360*e.h),s:ws(e.s),l:ws(e.l)}}function Rs(t){let e=us(t);return`hsl(${Ss(360*e.h)}, ${ws(e.s)}, ${ws(e.l)})`}function Ps(t){let e=us(t);return{h:Ss(360*e.h),s:ws(e.s),l:ws(e.l),a:ws(e.a)}}function Ls(t){let e=us(t);return`hsla(${Ss(360*e.h)}, ${ws(e.s)}, ${ws(e.l)}, ${ws(e.a)})`}function Is(t){let e=ds(t);return{h:Ss(360*e.h),s:ws(e.s),v:ws(e.v)}}function Os(t){let e=ds(t);return`hsv(${Ss(360*e.h)}, ${ws(e.s)}, ${ws(e.v)})`}function ks(t){let e=ds(t);return{h:Ss(360*e.h),s:ws(e.s),v:ws(e.v),a:ws(e.a)}}function Us(t){let e=ds(t);return`hsva(${Ss(360*e.h)}, ${ws(e.s)}, ${ws(e.v)}, ${ws(e.a)})`}function Ds(t){return{r:xs(t.r),g:xs(t.g),b:xs(t.b)}}function Ns(t){return`rgb(${xs(t.r)}, ${xs(t.g)}, ${xs(t.b)})`}function Bs(t){return{r:xs(t.r),g:xs(t.g),b:xs(t.b),a:ws(t.a)}}function Fs(t){return`rgba(${xs(t.r)}, ${xs(t.g)}, ${xs(t.b)}, ${ws(t.a)})`}function zs(t){let e=us(t);return{h:Ss(360*e.h),s:xs(e.s),l:xs(e.l)}}function Hs(t){let e=us(t);return`hsl(${Ss(360*e.h)}, ${xs(e.s)}, ${xs(e.l)})`}function Ws(t){let e=us(t);return{h:Ss(360*e.h),s:xs(e.s),l:xs(e.l),a:ws(e.a)}}function Vs(t){let e=us(t);return`hsla(${Ss(360*e.h)}, ${xs(e.s)}, ${xs(e.l)}, ${ws(e.a)})`}function Gs(t){let e=ds(t);return{h:Ss(360*e.h),s:xs(e.s),v:xs(e.v)}}function js(t){let e=ds(t);return`hsv(${Ss(360*e.h)}, ${xs(e.s)}, ${xs(e.v)})`}function Xs(t){let e=ds(t);return{h:Ss(360*e.h),s:xs(e.s),v:xs(e.v),a:ws(e.a)}}function $s(t){let e=ds(t);return`hsva(${Ss(360*e.h)}, ${xs(e.s)}, ${xs(e.v)}, ${ws(e.a)})`}function Ys(t){let e=function(t){return gs(t,!1)}(t);return`#${e}`}function qs(t){return`#${gs(t)}`}function Zs(t){let e=null,n=null,i=null;if(Ae(t))e=Xo(Mo(t));else{if(!Hr(t))throw console.log("color=",t),new Error("color is not a string or an object");n=t}if(null!==e)try{i=as(e)}catch(t){throw console.log(t),new Error(`can not parse color: ${e}`)}else if(null!==n)try{i=hs(n)}catch(t){throw console.log(t),new Error(`can not parse color: ${JSON.stringify(n)}`)}return i}function Ks(t){if(!Hr(t))return console.log("gradient is not an effective object"),t=>`rgb(${255*(t=Math.min(Math.max(t,0),1))},${255*t},${255*t})`;let e=[];return Me(t,(t,n)=>{e.push([ze(n),As(Zs(t)),t])}),e=jo(e,0),function(t){let n=null;for(let i=1;i<e.length;i++){let r=e[i-1][0],o=e[i-1][1],s=e[i][0],a=e[i][1];if(r<=t&&s>=t){let e=(s-t)/(s-r),i=(t-r)/(s-r);n=bs(Zs(o),e,Zs(a),i,"toRgbaString");break}}return n}}let Js={toRgb:Ms,toRgbString:Ts,toRgba:As,toRgbaString:Es,toHsl:Cs,toHslString:Rs,toHsla:Ps,toHslaString:Ls,toHsv:Is,toHsvString:Os,toHsva:ks,toHsvaString:Us,toRgbP:Ds,toRgbPString:Ns,toRgbaP:Bs,toRgbaPString:Fs,toHslP:zs,toHslPString:Hs,toHslaP:Ws,toHslaPString:Vs,toHsvP:Gs,toHsvPString:js,toHsvaP:Xs,toHsvaPString:$s,toHexString:Ys,toHex8String:qs};var Qs={toRgb:t=>Ms(Zs(t)),toRgbString:t=>Ts(Zs(t)),toRgba:t=>As(Zs(t)),toRgbaString:t=>Es(Zs(t)),toHsl:t=>Cs(Zs(t)),toHslString:t=>Rs(Zs(t)),toHsla:t=>Ps(Zs(t)),toHslaString:t=>Ls(Zs(t)),toHsv:t=>Is(Zs(t)),toHsvString:t=>Os(Zs(t)),toHsva:t=>ks(Zs(t)),toHsvaString:t=>Us(Zs(t)),toRgbP:t=>Ds(Zs(t)),toRgbPString:t=>Ns(Zs(t)),toRgbaP:t=>Bs(Zs(t)),toRgbaPString:t=>Fs(Zs(t)),toHslP:t=>zs(Zs(t)),toHslPString:t=>Hs(Zs(t)),toHslaP:t=>Ws(Zs(t)),toHslaPString:t=>Vs(Zs(t)),toHsvP:t=>Gs(Zs(t)),toHsvPString:t=>js(Zs(t)),toHsvaP:t=>Xs(Zs(t)),toHsvaPString:t=>$s(Zs(t)),toHexString:t=>Ys(Zs(t)),toHex8String:t=>qs(Zs(t)),modSaturate:(t,e,n)=>function(t,e,n="toRgbString"){if(e<0||e>1)throw new Error("amount < 0 or > 1");let i=us(t);return i.s+=e,i.s=vs(i.s),_s(ps(i),n)}(Zs(t),e,n),modGrey:(t,e)=>function(t,e="toRgbString"){let n=us(t);return n.s=0,_s(ps(n),e)}(Zs(t),e),modLighten:(t,e,n)=>function(t,e,n="toRgbString"){if(e<0||e>1)throw new Error("amount < 0 or > 1");let i=us(t);return i.l+=e,i.l=vs(i.l),_s(ps(i),n)}(Zs(t),e,n),modBrighten:(t,e,n)=>function(t,e,n="toRgbString"){if(e<0||e>1)throw new Error("amount < 0 or > 1");return t.r+=e,t.r=vs(t.r),t.g+=e,t.g=vs(t.g),t.b+=e,t.b=vs(t.b),_s(t,n)}(Zs(t),e,n),modHue:(t,e,n)=>ys(Zs(t),e,n),modComplement:(t,e)=>function(t,e="toRgbString"){return ys(t,.5,e)}(Zs(t),e),spreadHue:(t,e,n)=>function(t,e,n="toRgbString"){if(!He(e))throw new Error("num is not an integer");if((e=Xe(e))<=1)return[t];let i=us(t),r=1/e,o=[];for(let t=0;t<e;t++)o.push(_s(ps(i),n)),i.h+=r,i.h=i.h%1;return o}(Zs(t),e,n),spreadMonochromatic:(t,e,n)=>function(t,e,n="toRgbString"){if(!He(e))throw new Error("num is not an integer");if((e=Xe(e))<=1)return[t];let i=ds(t);i.s=1,i.l=1;let r=1/e,o=[];for(let t=0;t<e;t++)o.push(_s(fs(i),n)),i.h-=r,i.l-=r;return o}(Zs(t),e,n),mix:(t,e,n,i,r)=>bs(Zs(t),e,Zs(n),i,r),getBrightness:t=>function(t){if(1!==t.a)throw new Error("alpha of color can not be equal to 1");return(299*t.r+587*t.g+114*t.b)/1e3}(Zs(t)),getLuminance:t=>function(t){if(1!==t.a)throw new Error("alpha of color can not be equal to 1");let e,n,i,r=t.r,o=t.g,s=t.b;return e=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4),n=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),i=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),.2126*e+.7152*n+.0722*i}(Zs(t)),interp:Ks};const ta={components:{},props:{name:{type:String,default:"cir-wave"},size:{type:Number,default:48},color:{type:String,default:"#666"}},data:function(){return{}},computed:{effColor:function(){return Fr(this.color)}},methods:{}};var ea=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{style:"display:inline-block; vertical-align:middle; outline:none; user-select:none; height:"+t.size+"px; width:"+t.size+"px;",attrs:{cmp:"loading",loadtype:t.name}},["cir-wave"===t.name?[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",width:t.size,height:t.size}},[n("circle",{attrs:{cx:"50",cy:"50",r:"14.6699",fill:"none",stroke:"#420457","stroke-width":"10"}},[n("animate",{attrs:{attributeName:"r",repeatCount:"indefinite",dur:"1s",values:"0;40",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:"-0.5s"}}),t._v(" "),n("animate",{attrs:{attributeName:"opacity",repeatCount:"indefinite",dur:"1s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:"-0.5s"}})]),t._v(" "),n("circle",{attrs:{cx:"50",cy:"50",r:"33.9915",fill:"none",stroke:"#5a3faa","stroke-width":"10"}},[n("animate",{attrs:{attributeName:"r",repeatCount:"indefinite",dur:"1s",values:"0;40",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline"}}),t._v(" "),n("animate",{attrs:{attributeName:"opacity",repeatCount:"indefinite",dur:"1s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline"}})])])]:"cir-rotate"===t.name?[n("div",{style:"position:relative; display:inline-flex; align-items:center; justify-content:center; height:"+t.size+"px; width:"+t.size+"px;"},[n("svg",{staticClass:"pgc-rotate",staticStyle:{transform:"rotate(0deg)"},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"21.904761904761905 21.904761904761905 43.80952380952381 43.80952380952381"}},[n("circle",{staticClass:"pgc-dash",attrs:{fill:"transparent",cx:"43.80952380952381",cy:"43.80952380952381",r:"20","stroke-width":"4","stroke-dasharray":"100","stroke-dashoffset":"50px",stroke:t.effColor}})])])]:t._e()],2)};ea._withStripped=!0;const na=oo({render:ea,staticRenderFns:[]},function(t){t&&t("data-v-3e122b76_0",{source:"\n.pgc-rotate[data-v-3e122b76] {\r\n width: 100%;\r\n height: 100%;\r\n margin: auto;\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n z-index: 1;\r\n transition: all .6s ease-in-out;\r\n animation: progress-circular-rotate-data-v-3e122b76 1.4s linear infinite;\r\n transform-origin: center center;\n}\n.pgc-dash[data-v-3e122b76] {\r\n animation: progress-circular-dash-data-v-3e122b76 1.4s ease-in-out infinite;\r\n stroke-linecap: round;\r\n stroke-dasharray: 80,200;\r\n stroke-dashoffset: 0px;\n}\n@-webkit-keyframes progress-circular-dash-data-v-3e122b76 {\n0% {\r\n stroke-dasharray: 1,200;\r\n stroke-dashoffset: 0px\n}\n50% {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -15px\n}\nto {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -124px\n}\n}\n@keyframes progress-circular-dash-data-v-3e122b76 {\n0% {\r\n stroke-dasharray: 1,200;\r\n stroke-dashoffset: 0px\n}\n50% {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -15px\n}\nto {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -124px\n}\n}\n@-webkit-keyframes progress-circular-rotate-data-v-3e122b76 {\nto {\r\n transform: rotate(1turn)\n}\n}\n@keyframes progress-circular-rotate-data-v-3e122b76 {\nto {\r\n transform: rotate(1turn)\n}\n}\r\n\r\n",map:{version:3,sources:["C:\\opensrc\\開源-JS-106-7-w-plot-vue\\w-plot-vue\\node_modules\\w-component-vue\\src\\components\\WIconLoading.vue"],names:[],mappings:";AAmGA;IACA,WAAA;IACA,YAAA;IACA,YAAA;IACA,kBAAA;IACA,MAAA;IACA,SAAA;IACA,OAAA;IACA,QAAA;IACA,UAAA;IACA,+BAAA;IACA,wEAAA;IACA,+BAAA;AACA;AAEA;IACA,2EAAA;IACA,qBAAA;IACA,wBAAA;IACA,sBAAA;AACA;AAEA;AACA;QACA,uBAAA;QACA;AACA;AAEA;QACA,yBAAA;QACA;AACA;AAEA;QACA,yBAAA;QACA;AACA;AACA;AAEA;AACA;QACA,uBAAA;QACA;AACA;AAEA;QACA,yBAAA;QACA;AACA;AAEA;QACA,yBAAA;QACA;AACA;AACA;AAEA;AACA;QACA;AACA;AACA;AAEA;AACA;QACA;AACA;AACA",file:"WIconLoading.vue",sourcesContent:['<template>\r\n <div\r\n :style="`display:inline-block; vertical-align:middle; outline:none; user-select:none; height:${size}px; width:${size}px;`"\r\n :cmp="\'loading\'"\r\n :loadtype="name"\r\n >\r\n\r\n <template v-if="name===\'cir-wave\'">\r\n\r\n <svg\r\n xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"\r\n :width="size"\r\n :height="size"\r\n >\r\n <circle cx="50" cy="50" r="14.6699" fill="none" stroke="#420457" stroke-width="10">\r\n <animate attributeName="r" repeatCount="indefinite" dur="1s" values="0;40" keyTimes="0;1" keySplines="0 0.2 0.8 1" calcMode="spline" begin="-0.5s"></animate>\r\n <animate attributeName="opacity" repeatCount="indefinite" dur="1s" values="1;0" keyTimes="0;1" keySplines="0.2 0 0.8 1" calcMode="spline" begin="-0.5s"></animate>\r\n </circle>\r\n <circle cx="50" cy="50" r="33.9915" fill="none" stroke="#5a3faa" stroke-width="10">\r\n <animate attributeName="r" repeatCount="indefinite" dur="1s" values="0;40" keyTimes="0;1" keySplines="0 0.2 0.8 1" calcMode="spline"></animate>\r\n <animate attributeName="opacity" repeatCount="indefinite" dur="1s" values="1;0" keyTimes="0;1" keySplines="0.2 0 0.8 1" calcMode="spline"></animate>\r\n </circle>\r\n </svg>\r\n\r\n </template>\r\n\r\n <template v-else-if="name===\'cir-rotate\'">\r\n\r\n <div :style="`position:relative; display:inline-flex; align-items:center; justify-content:center; height:${size}px; width:${size}px;`">\r\n <svg\r\n class="pgc-rotate"\r\n style="transform: rotate(0deg);"\r\n xmlns="http://www.w3.org/2000/svg"\r\n viewBox="21.904761904761905 21.904761904761905 43.80952380952381 43.80952380952381"\r\n >\r\n <circle\r\n class="pgc-dash"\r\n fill="transparent"\r\n cx="43.80952380952381"\r\n cy="43.80952380952381"\r\n r="20"\r\n stroke-width="4"\r\n stroke-dasharray="100"\r\n stroke-dashoffset="50px"\r\n :stroke="effColor"\r\n ></circle>\r\n </svg>\r\n </div>\r\n\r\n </template>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport convertColor from \'../js/convertColor.mjs\'\r\n\r\n\r\n/**\r\n * @vue-prop {String} [name=\'cir-wave\'] 輸入動畫名稱字串,預設\'cir-wave\'\r\n * @vue-prop {Number} [size=48] 輸入圖標欲顯示的尺寸浮點數,預設48\r\n * @vue-prop {String} [color=\'#666\'] 輸入圖標顏色字串,預設\'#666\'\r\n */\r\nexport default {\r\n components: {\r\n },\r\n props: {\r\n name: {\r\n type: String,\r\n default: \'cir-wave\',\r\n },\r\n size: {\r\n type: Number,\r\n default: 48,\r\n },\r\n color: {\r\n type: String,\r\n default: \'#666\',\r\n },\r\n },\r\n data: function() {\r\n return {\r\n }\r\n },\r\n computed: {\r\n\r\n effColor: function() {\r\n let vo = this\r\n return convertColor(vo.color)\r\n },\r\n\r\n },\r\n methods: {\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n\r\n.pgc-rotate {\r\n width: 100%;\r\n height: 100%;\r\n margin: auto;\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n z-index: 1;\r\n transition: all .6s ease-in-out;\r\n animation: progress-circular-rotate 1.4s linear infinite;\r\n transform-origin: center center;\r\n}\r\n\r\n.pgc-dash {\r\n animation: progress-circular-dash 1.4s ease-in-out infinite;\r\n stroke-linecap: round;\r\n stroke-dasharray: 80,200;\r\n stroke-dashoffset: 0px;\r\n}\r\n\r\n@-webkit-keyframes progress-circular-dash {\r\n 0% {\r\n stroke-dasharray: 1,200;\r\n stroke-dashoffset: 0px\r\n }\r\n\r\n 50% {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -15px\r\n }\r\n\r\n to {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -124px\r\n }\r\n}\r\n\r\n@keyframes progress-circular-dash {\r\n 0% {\r\n stroke-dasharray: 1,200;\r\n stroke-dashoffset: 0px\r\n }\r\n\r\n 50% {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -15px\r\n }\r\n\r\n to {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -124px\r\n }\r\n}\r\n\r\n@-webkit-keyframes progress-circular-rotate {\r\n to {\r\n transform: rotate(1turn)\r\n }\r\n}\r\n\r\n@keyframes progress-circular-rotate {\r\n to {\r\n transform: rotate(1turn)\r\n }\r\n}\r\n\r\n</style>\r\n']},media:void 0})},ta,"data-v-3e122b76",false,void 0,!1,ao,void 0,void 0);function ia(t,e,n,i){for(var r=n-1,o=t.length;++r<o;)if(i(t[r],e))return r;return-1}var ra=Array.prototype.splice;var oa=Go(function(t,e){return t&&t.length&&e&&e.length?function(t,e,n,i){var r=i?ia:wo,o=-1,s=e.length,a=t;for(t===e&&(e=er(e)),n&&(a=J(t,re(n)));++o<s;)for(var l=0,c=e[o],h=n?n(c):c;(l=r(a,h,l,i))>-1;)a!==t&&ra.call(a,l,1),ra.call(t,l,1);return t}(t,e):t}),sa=oa;const aa={props:{to:{type:String,default:null}},computed:{toEl:function(){let t=this,e=null;try{e=document.querySelector(t.to)}catch(t){}return e}},watch:{toEl:function(t){this.teleport()}},mounted:function(){this.teleport()},destroyed:function(){let t=this;try{t.$el.remove()}catch(t){}},methods:{teleport:function(){let t=this;try{t.$el&&t.$el.parentElement!==t.toEl&&t.toEl.appendChild(t.$el)}catch(t){}}}};var la=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",[t._t("default")],2)};la._withStripped=!0;const ca=oo({render:la,staticRenderFns:[]},function(t){t&&t("data-v-a36a5392_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"Teleport.vue"},media:void 0})},aa,"data-v-a36a5392",false,void 0,!1,ao,void 0,void 0);function ha(t,e,n){if(!Jr(t))return void console.log("clientX is not a number",t);if(!Jr(e))return void console.log("clientY is not a number",e);if(!Yr(n))return void console.log("ele is not a HTMLElement",n);let i;try{i=n.getBoundingClientRect()}catch(t){return void console.log("invalid ele for getBoundingClientRect",t)}let r=!1;try{r=t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom}catch(t){console.log("catch when calculating page information of element",t)}return r}function ua(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function da(t){return t instanceof ua(t).Element||t instanceof Element}function pa(t){return t instanceof ua(t).HTMLElement||t instanceof HTMLElement}function fa(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ua(t).ShadowRoot||t instanceof ShadowRoot)}var ma=Math.max,ga=Math.min,va=Math.round;function _a(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ya(){return!/^((?!chrome|android).)*safari/i.test(_a())}function ba(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),r=1,o=1;e&&pa(t)&&(r=t.offsetWidth>0&&va(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&va(i.height)/t.offsetHeight||1);var s=(da(t)?ua(t):window).visualViewport,a=!ya()&&n,l=(i.left+(a&&s?s.offsetLeft:0))/r,c=(i.top+(a&&s?s.offsetTop:0))/o,h=i.width/r,u=i.height/o;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function xa(t){var e=ua(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Sa(t){return t?(t.nodeName||"").toLowerCase():null}function wa(t){return((da(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ma(t){return ba(wa(t)).left+xa(t).scrollLeft}function Ta(t){return ua(t).getComputedStyle(t)}function Aa(t){var e=Ta(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function Ea(t,e,n){void 0===n&&(n=!1);var i,r,o=pa(e),s=pa(e)&&function(t){var e=t.getBoundingClientRect(),n=va(e.width)/t.offsetWidth||1,i=va(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),a=wa(e),l=ba(t,s,n),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!n)&&(("body"!==Sa(e)||Aa(a))&&(c=(i=e)!==ua(i)&&pa(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:xa(i)),pa(e)?((h=ba(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Ma(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Ca(t){var e=ba(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function Ra(t){return"html"===Sa(t)?t:t.assignedSlot||t.parentNode||(fa(t)?t.host:null)||wa(t)}function Pa(t){return["html","body","#document"].indexOf(Sa(t))>=0?t.ownerDocument.body:pa(t)&&Aa(t)?t:Pa(Ra(t))}function La(t,e){var n;void 0===e&&(e=[]);var i=Pa(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=ua(i),s=r?[o].concat(o.visualViewport||[],Aa(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(La(Ra(s)))}function Ia(t){return["table","td","th"].indexOf(Sa(t))>=0}function Oa(t){return pa(t)&&"fixed"!==Ta(t).position?t.offsetParent:null}function ka(t){for(var e=ua(t),n=Oa(t);n&&Ia(n)&&"static"===Ta(n).position;)n=Oa(n);return n&&("html"===Sa(n)||"body"===Sa(n)&&"static"===Ta(n).position)?e:n||function(t){var e=/firefox/i.test(_a());if(/Trident/i.test(_a())&&pa(t)&&"fixed"===Ta(t).position)return null;var n=Ra(t);for(fa(n)&&(n=n.host);pa(n)&&["html","body"].indexOf(Sa(n))<0;){var i=Ta(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}var Ua="top",Da="bottom",Na="right",Ba="left",Fa="auto",za=[Ua,Da,Na,Ba],Ha="start",Wa="end",Va="viewport",Ga="popper",ja=za.reduce(function(t,e){return t.concat([e+"-"+Ha,e+"-"+Wa])},[]),Xa=[].concat(za,[Fa]).reduce(function(t,e){return t.concat([e,e+"-"+Ha,e+"-"+Wa])},[]),$a=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Ya(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}}),i.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||r(t)}),i}function qa(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Za(t,e,n){return e===Va?qa(function(t,e){var n=ua(t),i=wa(t),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=ya();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+Ma(t),y:l}}(t,n)):da(e)?function(t,e){var n=ba(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):qa(function(t){var e,n=wa(t),i=xa(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=ma(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=ma(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Ma(t),l=-i.scrollTop;return"rtl"===Ta(r||n).direction&&(a+=ma(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(wa(t)))}function Ka(t){var e=La(Ra(t)),n=["absolute","fixed"].indexOf(Ta(t).position)>=0&&pa(t)?ka(t):t;return da(n)?e.filter(function(t){return da(t)&&function(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&fa(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}(t,n)&&"body"!==Sa(t)}):[]}function Ja(t){return t.split("-")[0]}function Qa(t){return t.split("-")[1]}function tl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function el(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?Ja(r):null,s=r?Qa(r):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case Ua:e={x:a,y:n.y-i.height};break;case Da:e={x:a,y:n.y+n.height};break;case Na:e={x:n.x+n.width,y:l};break;case Ba:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var c=o?tl(o):null;if(null!=c){var h="y"===c?"height":"width";switch(s){case Ha:e[c]=e[c]-(n[h]/2-i[h]/2);break;case Wa:e[c]=e[c]+(n[h]/2-i[h]/2)}}return e}function nl(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.strategy,s=void 0===o?t.strategy:o,a=n.boundary,l=void 0===a?"clippingParents":a,c=n.rootBoundary,h=void 0===c?Va:c,u=n.elementContext,d=void 0===u?Ga:u,p=n.altBoundary,f=void 0!==p&&p,m=n.padding,g=void 0===m?0:m,v=function(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}("number"!=typeof g?g:function(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}(g,za)),_=d===Ga?"reference":Ga,y=t.rects.popper,b=t.elements[f?_:d],x=function(t,e,n,i){var r="clippingParents"===e?Ka(t):[].concat(e),o=[].concat(r,[n]),s=o[0],a=o.reduce(function(e,n){var r=Za(t,n,i);return e.top=ma(r.top,e.top),e.right=ga(r.right,e.right),e.bottom=ga(r.bottom,e.bottom),e.left=ma(r.left,e.left),e},Za(t,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(da(b)?b:b.contextElement||wa(t.elements.popper),l,h,s),S=ba(t.elements.reference),w=el({reference:S,element:y,strategy:"absolute",placement:r}),M=qa(Object.assign({},y,w)),T=d===Ga?M:S,A={top:x.top-T.top+v.top,bottom:T.bottom-x.bottom+v.bottom,left:x.left-T.left+v.left,right:T.right-x.right+v.right},E=t.modifiersData.offset;if(d===Ga&&E){var C=E[r];Object.keys(A).forEach(function(t){var e=[Na,Da].indexOf(t)>=0?1:-1,n=[Ua,Da].indexOf(t)>=0?"y":"x";A[t]+=C[n]*e})}return A}var il={placement:"bottom",modifiers:[],strategy:"absolute"};function rl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function ol(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,r=e.defaultOptions,o=void 0===r?il:r;return function(t,e,n){void 0===n&&(n=o);var r,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},il,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,h={state:a,setOptions:function(n){var r="function"==typeof n?n(a.options):n;u(),a.options=Object.assign({},o,a.options,r),a.scrollParents={reference:da(t)?La(t):t.contextElement?La(t.contextElement):[],popper:La(e)};var s,c,d=function(t){var e=Ya(t);return $a.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((s=[].concat(i,a.options.modifiers),c=s.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(c).map(function(t){return c[t]})));return a.orderedModifiers=d.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,r=t.effect;if("function"==typeof r){var o=r({state:a,name:e,instance:h,options:i}),s=function(){};l.push(o||s)}}),h.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(rl(e,n)){a.rects={reference:Ea(e,ka(n),"fixed"===a.options.strategy),popper:Ca(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var r=a.orderedModifiers[i],o=r.fn,s=r.options,l=void 0===s?{}:s,u=r.name;"function"==typeof o&&(a=o({state:a,options:l,name:u,instance:h})||a)}else a.reset=!1,i=-1}}},update:(r=function(){return new Promise(function(t){h.forceUpdate(),t(a)})},function(){return s||(s=new Promise(function(t){Promise.resolve().then(function(){s=void 0,t(r())})})),s}),destroy:function(){u(),c=!0}};if(!rl(t,e))return h;function u(){l.forEach(function(t){return t()}),l=[]}return h.setOptions(n).then(function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)}),h}}var sl={passive:!0};var al={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ll(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,u=t.isFixed,d=s.x,p=void 0===d?0:d,f=s.y,m=void 0===f?0:f,g="function"==typeof h?h({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var v=s.hasOwnProperty("x"),_=s.hasOwnProperty("y"),y=Ba,b=Ua,x=window;if(c){var S=ka(n),w="clientHeight",M="clientWidth";if(S===ua(n)&&"static"!==Ta(S=wa(n)).position&&"absolute"===a&&(w="scrollHeight",M="scrollWidth"),r===Ua||(r===Ba||r===Na)&&o===Wa)b=Da,m-=(u&&S===x&&x.visualViewport?x.visualViewport.height:S[w])-i.height,m*=l?1:-1;if(r===Ba||(r===Ua||r===Da)&&o===Wa)y=Na,p-=(u&&S===x&&x.visualViewport?x.visualViewport.width:S[M])-i.width,p*=l?1:-1}var T,A=Object.assign({position:a},c&&al),E=!0===h?function(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:va(n*r)/r||0,y:va(i*r)/r||0}}({x:p,y:m},ua(n)):{x:p,y:m};return p=E.x,m=E.y,l?Object.assign({},A,((T={})[b]=_?"0":"",T[y]=v?"0":"",T.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",T)):Object.assign({},A,((e={})[b]=_?m+"px":"",e[y]=v?p+"px":"",e.transform="",e))}var cl={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:Ja(e.placement),variation:Qa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,ll(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,ll(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var hl={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];pa(r)&&Sa(r)&&(Object.assign(r.style,n),Object.keys(i).forEach(function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});pa(i)&&Sa(i)&&(Object.assign(i.style,o),Object.keys(r).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]},ul=ol({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,s=i.resize,a=void 0===s||s,l=ua(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",n.update,sl)}),a&&l.addEventListener("resize",n.update,sl),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",n.update,sl)}),a&&l.removeEventListener("resize",n.update,sl)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=el({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},cl,hl]}),dl={left:"right",right:"left",bottom:"top",top:"bottom"};function pl(t){return t.replace(/left|right|bottom|top/g,function(t){return dl[t]})}var fl={start:"end",end:"start"};function ml(t){return t.replace(/start|end/g,function(t){return fl[t]})}function gl(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Xa:l,h=Qa(i),u=h?a?ja:ja.filter(function(t){return Qa(t)===h}):za,d=u.filter(function(t){return c.indexOf(t)>=0});0===d.length&&(d=u);var p=d.reduce(function(e,n){return e[n]=nl(t,{placement:n,boundary:r,rootBoundary:o,padding:s})[Ja(n)],e},{});return Object.keys(p).sort(function(t,e){return p[t]-p[e]})}var vl={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,h=n.boundary,u=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,f=void 0===p||p,m=n.allowedAutoPlacements,g=e.options.placement,v=Ja(g),_=l||(v===g||!f?[pl(g)]:function(t){if(Ja(t)===Fa)return[];var e=pl(t);return[ml(t),e,ml(e)]}(g)),y=[g].concat(_).reduce(function(t,n){return t.concat(Ja(n)===Fa?gl(e,{placement:n,boundary:h,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)},[]),b=e.rects.reference,x=e.rects.popper,S=new Map,w=!0,M=y[0],T=0;T<y.length;T++){var A=y[T],E=Ja(A),C=Qa(A)===Ha,R=[Ua,Da].indexOf(E)>=0,P=R?"width":"height",L=nl(e,{placement:A,boundary:h,rootBoundary:u,altBoundary:d,padding:c}),I=R?C?Na:Ba:C?Da:Ua;b[P]>x[P]&&(I=pl(I));var O=pl(I),k=[];if(o&&k.push(L[E]<=0),a&&k.push(L[I]<=0,L[O]<=0),k.every(function(t){return t})){M=A,w=!1;break}S.set(A,k)}if(w)for(var U=function(t){var e=y.find(function(e){var n=S.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return M=e,"break"},D=f?3:1;D>0;D--){if("break"===U(D))break}e.placement!==M&&(e.modifiersData[i]._skip=!0,e.placement=M,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};var _l={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,s=Xa.reduce(function(t,n){return t[n]=function(t,e,n){var i=Ja(t),r=[Ba,Ua].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[Ba,Na].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,o),t},{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=s}};function yl(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function bl(t){return[Ua,Na,Da,Ba].some(function(e){return t[e]>=0})}var xl={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=nl(e,{elementContext:"reference"}),a=nl(e,{altBoundary:!0}),l=yl(s,i),c=yl(a,r,o),h=bl(l),u=bl(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}};function Sl(t,e,n){return ma(t,ga(e,n))}var wl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,h=n.altBoundary,u=n.padding,d=n.tether,p=void 0===d||d,f=n.tetherOffset,m=void 0===f?0:f,g=nl(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),v=Ja(e.placement),_=Qa(e.placement),y=!_,b=tl(v),x="x"===b?"y":"x",S=e.modifiersData.popperOffsets,w=e.rects.reference,M=e.rects.popper,T="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,A="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,C={x:0,y:0};if(S){if(o){var R,P="y"===b?Ua:Ba,L="y"===b?Da:Na,I="y"===b?"height":"width",O=S[b],k=O+g[P],U=O-g[L],D=p?-M[I]/2:0,N=_===Ha?w[I]:M[I],B=_===Ha?-M[I]:-w[I],F=e.elements.arrow,z=p&&F?Ca(F):{width:0,height:0},H=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=H[P],V=H[L],G=Sl(0,w[I],z[I]),j=y?w[I]/2-D-G-W-A.mainAxis:N-G-W-A.mainAxis,X=y?-w[I]/2+D+G+V+A.mainAxis:B+G+V+A.mainAxis,$=e.elements.arrow&&ka(e.elements.arrow),Y=$?"y"===b?$.clientTop||0:$.clientLeft||0:0,q=null!=(R=null==E?void 0:E[b])?R:0,Z=O+X-q,K=Sl(p?ga(k,O+j-q-Y):k,O,p?ma(U,Z):U);S[b]=K,C[b]=K-O}if(a){var J,Q="x"===b?Ua:Ba,tt="x"===b?Da:Na,et=S[x],nt="y"===x?"height":"width",it=et+g[Q],rt=et-g[tt],ot=-1!==[Ua,Ba].indexOf(v),st=null!=(J=null==E?void 0:E[x])?J:0,at=ot?it:et-w[nt]-M[nt]-st+A.altAxis,lt=ot?et+w[nt]+M[nt]-st-A.altAxis:rt,ct=p&&ot?function(t,e,n){var i=Sl(t,e,n);return i>n?n:i}(at,et,lt):Sl(p?at:it,et,p?lt:rt);S[x]=ct,C[x]=ct-et}e.modifiersData[i]=C}},requiresIfExists:["offset"]};function Ml(t,e,n,i,r,o={}){let s=Pr();if(Me(["mode","mmkey",i,"triggerWidth","placement","placementDistX","placementDistY","transitionTime","isolated","editable","contentStyle"],e=>{if(!qo(t,e))throw new Error(`invalid vo.${e}`)}),!Lr(e))throw new Error("funGetDivTrigger is not a function");if(!Lr(n))throw new Error("funGetDivContent is not a function");let a=st(o,"funAddTrigger"),l=st(o,"funCheckTrigger"),c=st(o,"funRemoveTrigger"),h=st(o,"modeHide",null);"click"!==h&&"mousedown"!==h&&(h="click");let u={mouseClientX:0,mouseClientY:0,cursorTriggerInner:!1,clickContentInner:!1,popperShow:!1,popperInstance:null,removeTriggerTimer:null},d=()=>!Lr(l)||l(t.mode,t.mmkey),p=i=>{let r=e();if(!Yr(r))return;t.$nextTick(()=>{t.triggerWidth=r.offsetWidth});let o=n();if(!Yr(o))return;null!==u.removeTriggerTimer&&(clearTimeout(u.removeTriggerTimer),u.removeTriggerTimer=null),Lr(a)&&a(t.mode,t.mmkey);let l={strategy:"fixed",placement:t.placement,modifiers:[wl,cl,{name:"computeStyles",options:{gpuAcceleration:!1}},vl,{name:"flip",options:{}},_l,{name:"offset",options:{offset:[t.placementDistX,t.placementDistY]}},xl,{name:"emitPlacement",enabled:!0,phase:"afterWrite",fn:({state:e})=>{let n=st(e,"placement",null);null!==n&&(t.$emit("placement-change",n),s.emit("placement-change",n))}}]};u.popperInstance=ul(r,o,l)},f=e=>{u.popperInstance&&(u.popperInstance.destroy(),u.popperInstance=null),u.removeTriggerTimer=setTimeout(()=>{u.removeTriggerTimer=null,Lr(c)&&c(t.mode,t.mmkey)},20)},m=e=>{t.$nextTick(()=>{let e=t.editable&&t[i];if(e&&!u.popperShow){let e=-15;t.contentStyle=`opacity:0; pointer-events:none; transform:translateY(${e}px);`,p(),u.popperShow=!0,t.$emit("show"),s.emit("show"),setTimeout(()=>{t.contentStyle=`transition:all ${t.transitionTime}ms ease-out; opacity:1; pointer-events:none;`},1),setTimeout(()=>{t.contentStyle=""},t.transitionTime)}else!e&&u.popperShow&&(f(),u.popperShow=!1,t.$emit("hide"),s.emit("hide"))})},g=(e,n)=>{t.editable&&(t[i]=e,m())},v=(e,n)=>{t.editable&&(t.isolated&&g(e),t.$nextTick(()=>{t.$emit(r,e),s.emit(r,e)}))},_=(e,n)=>{t.editable&&(t[i]||t.mode===e&&v(!0))},y=(e,n)=>{t.editable&&t[i]&&t.mode===e&&v(!1)};return s.mounted=()=>{u.windowMousemove=t=>{u.mouseClientX=t.clientX,u.mouseClientY=t.clientY},window.addEventListener("mousemove",u.windowMousemove,!1),u.windowMousedown=r=>{let o=e();Yr(o)?u.cursorTriggerInner=ha(r.clientX,r.clientY,o):u.cursorTriggerInner=!1;let s=n();if(t[i]&&s?u.clickContentInner=ha(r.clientX,r.clientY,s):u.clickContentInner=!1,"mousedown"===h){if(!d())return;!t[i]||u.cursorTriggerInner||u.clickContentInner||t.evHide("popup","windowMousedown")}},window.addEventListener("mousedown",u.windowMousedown,!1),u.windowMouseup=e=>{d()&&(!t[i]||u.cursorTriggerInner||u.clickContentInner?(u.cursorTriggerInner=!1,u.clickContentInner=!1):t.evHide("popup","windowMouseup"))},window.addEventListener("mouseup",u.windowMouseup,!1),u.windowScroll=n=>{if("tooltip"!==t.mode)return;let r=e();Yr(r)&&(u.cursorTriggerInner=!!r&&ha(u.mouseClientX,u.mouseClientY,r),u.cursorTriggerInner?t[i]||_("tooltip"):t[i]&&y("tooltip"))},window.addEventListener("scroll",u.windowScroll,!1)},s.destroy=()=>{window.removeEventListener("mousemove",u.windowMousemove,!1),window.removeEventListener("mousedown",u.windowMousedown,!1),window.removeEventListener("mouseup",u.windowMouseup,!1),window.removeEventListener("scroll",u.windowMouseup,!1),v(!1)},s.showPopper=p,s.hidePopper=f,s.updatePopper=(e,n)=>{u.popperInstance&&u.popperInstance.update(),t.$emit("resize",e),s.emit("resize",e)},s.displayPopper=m,s.updateValue=g,s.triggerEvent=v,s.evShow=_,s.evHide=y,s}let Tl={tooltip:[],popup:[]};function Al(t,e){Tl[t].push(e)}function El(t,e){return n=Tl[t],((i=null==n?0:n.length)?n[i-1]:void 0)===e;var n,i}function Cl(t,e){sa(Tl[t],e)}const Rl={directives:{domresize:Ir()},components:{Teleport:ca},props:{mode:{type:String,default:"tooltip"},value:{type:Boolean,default:!1},displayType:{type:String,default:"block"},cmpZIndex:{type:Number,default:3e3},isolated:{type:Boolean,default:!1},minWidth:{type:Number,default:null},maxWidth:{type:Number,default:null},autoFitMinWidth:{type:Boolean,default:!1},autoFitMaxWidth:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},placementDistX:{type:Number,default:0},placementDistY:{type:Number,default:5},borderRadius:{type:Number,default:4},textFontSize:{type:String,default:"0.85rem"},textColor:{type:String,default:"white"},backgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},paddingStyle:{type:Object,default:()=>({v:2,h:10})},modeHide:{type:String,default:"click"},shadow:{type:Boolean,default:!0},shadowStyle:{type:String,default:"0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12)"},transitionTime:{type:Number,default:200},labelContent:{type:String,default:null},editable:{type:Boolean,default:!0}},data:function(){return{mmkey:Vi(),valueTrans:!1,triggerWidth:null,contentStyle:"",bp:null}},mounted:function(){let t=this;t.bp=new Ml(t,t.funGetDivTrigger,t.funGetDivContent,"valueTrans","input",{funAddTrigger:Al,funCheckTrigger:El,funRemoveTrigger:Cl,modeHide:t.modeHide}),t.bp.mounted()},beforeDestroy:function(){this.bp.destroy()},computed:{changeValue:function(){let t=this,e=t.value;return t.isolated||t.updateValue(e,"changeValue"),""},useDisplayType:function(){return"line"===this.displayType?"display:block;":"display:inline-block;"},useMinWidth:function(){let t=this;return Jr(t.minWidth)?`min-width:${t.minWidth}px;`:t.autoFitMinWidth?`min-width:${t.triggerWidth}px;`:""},useMaxWidth:function(){let t=this;return Jr(t.maxWidth)?`max-width:${t.maxWidth}px;`:t.autoFitMaxWidth?`max-width:${t.triggerWidth}px;`:""},useBorderRadius:function(){let t=this;return Jr(t.borderRadius)?`border-radius:${t.borderRadius}px;`:""},useTextFontSize:function(){let t=this.textFontSize;return t=zr(t,";",""),`font-size:${t};`},useTextColor:function(){return Fr(this.textColor)},useBackgroundColor:function(){return Fr(this.backgroundColor)},usePadding:function(){return`padding:${Qr(this.paddingStyle)};`},useShadow:function(){if(!this.shadow)return"";let t=zr(this.shadowStyle,";","");return""!==t?`box-shadow:${t};`:""}},methods:{funGetDivTrigger:function(){return st(this,"$refs.divTrigger",null)},funGetDivContent:function(){return st(this,"$refs.divContent",null)},evShow:function(t,e){let n=this;Lr(st(n,"bp.evShow"))&&n.bp.evShow(t,e)},evHide:function(t,e){let n=this;Lr(st(n,"bp.evHide"))&&n.bp.evHide(t,e)},updatePopper:function(t,e){let n=this;Lr(st(n,"bp.updatePopper"))&&n.bp.updatePopper(t,e)},updateValue:function(t,e){let n=this;Lr(st(n,"bp.updateValue"))&&n.bp.updateValue(t,e)}}};var Pl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{style:""+t.useDisplayType,attrs:{changeValue:t.changeValue}},[n("div",{ref:"divTrigger",staticStyle:{outline:"none"},attrs:{tabindex:"0"},on:{click:function(e){return t.evShow("popup","click")},mouseenter:function(e){return t.evShow("tooltip","mouseenter")},mouseleave:function(e){return t.evHide("tooltip","mouseleave")}}},[t._t("trigger")],2),t._v(" "),n("Teleport",{attrs:{to:"body"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.valueTrans,expression:"valueTrans"},{name:"domresize",rawName:"v-domresize"}],ref:"divContent",staticClass:"WPopperFix",style:"z-index:"+t.cmpZIndex+";",attrs:{wtlp:t.labelContent},on:{domresize:t.updatePopper}},[t.valueTrans?n("div",{style:t.contentStyle+" "+t.usePadding+" "+t.useTextFontSize+" color:"+t.useTextColor+"; background:"+t.useBackgroundColor+"; "+t.useMinWidth+" "+t.useMaxWidth+" "+t.useBorderRadius+" "+t.useShadow},[t._t("content",null,{funHide:function(){t.updateValue(!1,"slot")}})],2):t._e()])])],1)};Pl._withStripped=!0;const Ll=oo({render:Pl,staticRenderFns:[]},function(t){t&&t("data-v-5ce5fda2_0",{source:"\n.WPopperFix[data-popper-reference-hidden][data-v-5ce5fda2] {\r\n visibility: hidden;\r\n pointer-events: none;\n}\r\n",map:{version:3,sources:["C:\\opensrc\\開源-JS-106-7-w-plot-vue\\w-plot-vue\\node_modules\\w-component-vue\\src\\components\\WTooltip.vue"],names:[],mappings:";AAkbA;IACA,kBAAA;IACA,oBAAA;AACA",file:"WTooltip.vue",sourcesContent:["<template>\r\n <div\r\n :style=\"`${useDisplayType}`\"\r\n :changeValue=\"changeValue\"\r\n >\r\n\r\n <div\r\n ref=\"divTrigger\"\r\n style=\"outline:none;\"\r\n tabindex=\"0\"\r\n @click=\"evShow('popup','click')\"\r\n @mouseenter=\"evShow('tooltip','mouseenter')\"\r\n @mouseleave=\"evHide('tooltip','mouseleave')\"\r\n >\r\n\r\n <slot name=\"trigger\"></slot>\r\n\r\n </div>\r\n\r\n \x3c!-- 不能給予position因會被popupjs洗掉, 但可給z-index, 且popupjs會改用transform:translate定位 --\x3e\r\n \x3c!-- 若使用minWidth, 會使popupjs重算給予minWidth用以自動撐開彈窗寬度失效, 若於其內slot外添加div給予minWidth, 亦會使popupjs給予minWidth機制失效, 待研究 --\x3e\r\n <Teleport to=\"body\">\r\n <div\r\n ref=\"divContent\"\r\n class=\"WPopperFix\"\r\n :style=\"`z-index:${cmpZIndex};`\"\r\n :wtlp=\"labelContent\"\r\n v-show=\"valueTrans\"\r\n v-domresize\r\n @domresize=\"updatePopper\"\r\n >\r\n <div\r\n :style=\"`${contentStyle} ${usePadding} ${useTextFontSize} color:${useTextColor}; background:${useBackgroundColor}; ${useMinWidth} ${useMaxWidth} ${useBorderRadius} ${useShadow}`\"\r\n v-if=\"valueTrans\"\r\n >\r\n <slot\r\n name=\"content\"\r\n :funHide=\"()=>{updateValue(false,'slot')}\"\r\n ></slot>\r\n </div>\r\n </div>\r\n </Teleport>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport get from 'lodash-es/get.js'\r\nimport last from 'lodash-es/last.js'\r\nimport pull from 'lodash-es/pull.js'\r\nimport isNumber from 'lodash-es/isNumber.js'\r\nimport genID from 'wsemi/src/genID.mjs'\r\nimport replace from 'wsemi/src/replace.mjs'\r\nimport isfun from 'wsemi/src/isfun.mjs'\r\nimport Teleport from './Teleport.vue'\r\nimport convertColor from '../js/convertColor.mjs'\r\nimport parseSpace from '../js/parseSpace.mjs'\r\nimport domResize from '../js/domResize.mjs'\r\nimport BuildPopper from '../js/buildPopper.mjs'\r\n\r\n\r\n//tootip與popup不共用已出現項目清單, 避免互相影響\r\nlet kpRespList = {\r\n tooltip: [],\r\n popup: [],\r\n}\r\nfunction funAddTrigger(mode, mmkey) {\r\n kpRespList[mode].push(mmkey)\r\n}\r\nfunction funCheckTrigger(mode, mmkey) {\r\n return last(kpRespList[mode]) === mmkey\r\n}\r\nfunction funRemoveTrigger(mode, mmkey) {\r\n pull(kpRespList[mode], mmkey)\r\n}\r\n\r\n\r\n/**\r\n * @vue-prop {String} [mode='tooltip'] 輸入組件模式字串,可選'tooltip'與'popup',預設'tooltip'\r\n * @vue-prop {Boolean} [value=false] 輸入是否顯示布林值,預設false\r\n * @vue-prop {String} [displayType='block'] 輸入display設定字串,可選'block'與'line',預設'block'\r\n * @vue-prop {Number} [cmpZIndex=3000] 輸入提示窗或彈窗使用z-index數字,預設3000\r\n * @vue-prop {Boolean} [isolated=false] 輸入提示窗或彈窗當mode為'popup'時是否為獨立顯引狀態布林值,也就是可不接收外部傳入value值,預設false\r\n * @vue-prop {Number} [minWidth=null] 輸入提示窗或彈窗最小寬度數字,不含paddingStyle的寬度,單位為px,預設null\r\n * @vue-prop {Number} [maxWidth=null] 輸入提示窗或彈窗最大寬度數字,不含paddingStyle的寬度,單位為px,預設null\r\n * @vue-prop {Boolean} [autoFitMinWidth=false] 輸入是否使用驅動區寬度作為提示窗或彈窗之最小寬度布林值,不含paddingStyle的寬度,預設false\r\n * @vue-prop {Boolean} [autoFitMaxWidth=false] 輸入是否使用驅動區寬度作為提示窗或彈窗之最大寬度布林值,不含paddingStyle的寬度,預設false\r\n * @vue-prop {String} [placement='bottom'] 輸入提示窗或彈窗出現位置字串,可選'top-start'、'top'、'top-end'、'bottom-start'、'bottom'、'bottom-end'、'left-start'、'left'、'left-end'、'right-start'、'right'、'right-end'、,預設'bottom'\r\n * @vue-prop {Number} [placementDistX=0] 輸入提示窗或彈窗距離觸發元素之水平向右平移數字,單位為px,預設0\r\n * @vue-prop {Number} [placementDistY=5] 輸入提示窗或彈窗距離觸發元素之垂直向下平移數字,單位為px,預設5\r\n * @vue-prop {Number} [borderRadius=4] 輸入提示窗或彈窗框圓角度數字,單位為px,預設4\r\n * @vue-prop {String} [textFontSize='0.85rem'] 輸入提示窗或彈窗文字字型大小字串,預設'0.85rem'\r\n * @vue-prop {String} [textColor='white'] 輸入提示窗或彈窗文字顏色字串,預設'white'\r\n * @vue-prop {String} [backgroundColor='rgba(60,60,60,0.75)'] 輸入提示窗或彈窗背景顏色字串,預設'rgba(60,60,60,0.75)'\r\n * @vue-prop {Object} [paddingStyle={v:2,h:10}] 輸入提示窗或彈窗內寬距離設定物件,可用鍵值為v、h、left、right、top、bottom,v代表同時設定top與bottom,h代表設定left與right,若有重複設定時後面鍵值會覆蓋前面,各鍵值為寬度數字,單位為px,預設{v:2,h:10}\r\n * @vue-prop {String} [modeHide='click'] 輸入點擊外部關閉模式字串,可選'click'與'mousedown','click'為mouseup時才關閉,'mousedown'為mousedown時關閉,預設'click'\r\n * @vue-prop {Boolean} [shadow=true] 輸入提示窗或彈窗是否顯示陰影布林值,預設true\r\n * @vue-prop {String} [shadowStyle=''] 輸入提示窗或彈窗陰影顏色字串,預設值詳見props\r\n * @vue-prop {Number} [transitionTime=200] 輸入提示窗或彈窗淡入出現時間數字,單位為ms,預設200\r\n * @vue-prop {String} [labelContent=null] 輸入針對teleport至body內之內容div所給予之wtlp屬性值字串,供查找使用,預設null\r\n * @vue-prop {Boolean} [editable=true] 輸入是否為編輯模式布林值,預設true\r\n */\r\nexport default {\r\n directives: {\r\n domresize: domResize(),\r\n },\r\n components: {\r\n Teleport,\r\n },\r\n props: {\r\n mode: {\r\n type: String,\r\n default: 'tooltip', //tooltip, popup\r\n },\r\n value: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n displayType: {\r\n type: String,\r\n default: 'block', //line, block\r\n },\r\n cmpZIndex: {\r\n type: Number,\r\n default: 3000,\r\n },\r\n isolated: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n minWidth: {\r\n type: Number,\r\n default: null,\r\n },\r\n maxWidth: {\r\n type: Number,\r\n default: null,\r\n },\r\n autoFitMinWidth: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n autoFitMaxWidth: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n placement: {\r\n type: String,\r\n default: 'bottom',\r\n },\r\n placementDistX: {\r\n type: Number,\r\n default: 0,\r\n },\r\n placementDistY: {\r\n type: Number,\r\n default: 5,\r\n },\r\n borderRadius: {\r\n type: Number,\r\n default: 4,\r\n },\r\n textFontSize: {\r\n type: String,\r\n default: '0.85rem',\r\n },\r\n textColor: {\r\n type: String,\r\n default: 'white',\r\n },\r\n backgroundColor: {\r\n type: String,\r\n default: 'rgba(60,60,60,0.75)',\r\n },\r\n paddingStyle: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n v: 2,\r\n h: 10,\r\n }\r\n },\r\n },\r\n modeHide: {\r\n type: String,\r\n default: 'click',\r\n },\r\n shadow: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n shadowStyle: {\r\n type: String,\r\n default: '0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12)',\r\n },\r\n transitionTime: {\r\n type: Number,\r\n default: 200,\r\n },\r\n labelContent: {\r\n type: String,\r\n default: null,\r\n },\r\n editable: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n },\r\n data: function() {\r\n return {\r\n\r\n mmkey: genID(), //beforeMount內無法變更data, mounted內會晚於computed, 故優先放於data生成\r\n // mmkey: (() => {\r\n // let id = genID()\r\n // console.log('data gen mmkey', id)\r\n // return id\r\n // })(),\r\n\r\n valueTrans: false,\r\n\r\n triggerWidth: null, //會由BuildPopper內更新\r\n contentStyle: '',\r\n\r\n bp: null,\r\n\r\n }\r\n },\r\n mounted: function() {\r\n //console.log('mounted')\r\n\r\n let vo = this\r\n\r\n //BuildPopper\r\n let keyShow = 'valueTrans'\r\n let evNameValue = 'input'\r\n vo.bp = new BuildPopper(vo,\r\n vo.funGetDivTrigger,\r\n vo.funGetDivContent,\r\n keyShow,\r\n evNameValue,\r\n {\r\n funAddTrigger,\r\n funCheckTrigger,\r\n funRemoveTrigger,\r\n modeHide: vo.modeHide,\r\n })\r\n\r\n //mounted\r\n vo.bp.mounted()\r\n\r\n },\r\n beforeDestroy: function() {\r\n //console.log('beforeDestroy')\r\n\r\n let vo = this\r\n\r\n //destroy\r\n vo.bp.destroy()\r\n\r\n },\r\n computed: {\r\n\r\n changeValue: function () {\r\n //console.log('computed changeValue')\r\n\r\n let vo = this\r\n\r\n //trigger\r\n let value = vo.value\r\n let isolated = vo.isolated\r\n\r\n //updateValue\r\n if (!isolated) {\r\n vo.updateValue(value, 'changeValue')\r\n }\r\n\r\n return ''\r\n },\r\n\r\n useDisplayType: function() {\r\n let vo = this\r\n if (vo.displayType === 'line') {\r\n return 'display:block;'\r\n }\r\n return 'display:inline-block;'\r\n },\r\n\r\n useMinWidth: function() {\r\n //console.log('computed useMinWidth')\r\n\r\n let vo = this\r\n\r\n if (isNumber(vo.minWidth)) {\r\n return `min-width:${vo.minWidth}px;`\r\n }\r\n else if (vo.autoFitMinWidth) {\r\n return `min-width:${vo.triggerWidth}px;`\r\n }\r\n return ''\r\n },\r\n\r\n useMaxWidth: function() {\r\n //console.log('computed useMaxWidth')\r\n\r\n let vo = this\r\n\r\n if (isNumber(vo.maxWidth)) {\r\n return `max-width:${vo.maxWidth}px;`\r\n }\r\n else if (vo.autoFitMaxWidth) {\r\n return `max-width:${vo.triggerWidth}px;`\r\n }\r\n return ''\r\n },\r\n\r\n useBorderRadius: function() {\r\n //console.log('computed useBorderRadius')\r\n\r\n let vo = this\r\n\r\n if (isNumber(vo.borderRadius)) {\r\n return `border-radius:${vo.borderRadius}px;`\r\n }\r\n return ''\r\n },\r\n\r\n useTextFontSize: function() {\r\n let vo = this\r\n let s = vo.textFontSize\r\n s = replace(s, ';', '')\r\n return `font-size:${s};`\r\n },\r\n\r\n useTextColor: function() {\r\n //console.log('computed useTextColor')\r\n\r\n let vo = this\r\n\r\n return convertColor(vo.textColor)\r\n },\r\n\r\n useBackgroundColor: function() {\r\n //console.log('computed useBackgroundColor')\r\n\r\n let vo = this\r\n\r\n return convertColor(vo.backgroundColor)\r\n },\r\n\r\n usePadding: function() {\r\n //console.log('computed usePadding')\r\n\r\n let vo = this\r\n\r\n //parseSpace\r\n let cs = parseSpace(vo.paddingStyle)\r\n\r\n //padding\r\n let padding = `padding:${cs};`\r\n\r\n return padding\r\n },\r\n\r\n useShadow: function() {\r\n //console.log('computed useShadow')\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.shadow) {\r\n return ''\r\n }\r\n\r\n //shadowStyle\r\n let s = replace(vo.shadowStyle, ';', '')\r\n if (s !== '') {\r\n return `box-shadow:${s};`\r\n }\r\n\r\n return ''\r\n },\r\n\r\n },\r\n methods: {\r\n\r\n funGetDivTrigger: function() {\r\n let vo = this\r\n let divTrigger = get(vo, '$refs.divTrigger', null)\r\n return divTrigger\r\n },\r\n\r\n funGetDivContent: function() {\r\n let vo = this\r\n let divContent = get(vo, '$refs.divContent', null)\r\n return divContent\r\n },\r\n\r\n evShow: function(kind, from) {\r\n let vo = this\r\n let f = get(vo, 'bp.evShow')\r\n if (isfun(f)) {\r\n vo.bp.evShow(kind, from)\r\n }\r\n },\r\n\r\n evHide: function(kind, from) {\r\n let vo = this\r\n let f = get(vo, 'bp.evHide')\r\n if (isfun(f)) {\r\n vo.bp.evHide(kind, from)\r\n }\r\n },\r\n\r\n updatePopper: function(msg, from) {\r\n let vo = this\r\n let f = get(vo, 'bp.updatePopper')\r\n if (isfun(f)) {\r\n vo.bp.updatePopper(msg, from)\r\n }\r\n },\r\n\r\n updateValue: function(value, from) {\r\n let vo = this\r\n let f = get(vo, 'bp.updateValue')\r\n if (isfun(f)) {\r\n vo.bp.updateValue(value, from)\r\n }\r\n },\r\n\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n.WPopperFix[data-popper-reference-hidden] {\r\n visibility: hidden;\r\n pointer-events: none;\r\n}\r\n</style>\r\n\r\n"]},media:void 0})},Rl,"data-v-5ce5fda2",false,void 0,!1,ao,void 0,void 0);var Il={components:{WIcon:po,WIconLoading:na,WTooltip:Ll},props:{tooltip:{type:String,default:""},icon:{type:String,default:""},iconSize:{type:Number,default:22},iconColor:{type:String,default:"grey darken-1"},iconColorHover:{type:String,default:"grey darken-2"},iconColorFocus:{type:String,default:"grey darken-3"},iconColorActive:{type:String,default:"grey darken-3"},borderRadius:{type:[Number,String],default:"50%"},borderRadiusStyle:{type:Object,default:()=>({left:!0,right:!0})},borderWidth:{type:Number,default:0},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorFocus:{type:String,default:"transparent"},borderColorActive:{type:String,default:"transparent"},backgroundColor:{type:String,default:"rgb(241,241,241)"},backgroundColorHover:{type:String,default:"rgb(236,236,236)"},backgroundColorFocus:{type:String,default:"rgb(230,230,230)"},backgroundColorActive:{type:String,default:"rgb(230,230,230)"},tooltipBorderRadius:{type:Number,default:4},tooltipPaddingStyle:{type:Object,default:()=>({v:5,h:8})},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},rippleColor:{type:String,default:"rgba(255, 255, 255, 0.5)"},paddingStyle:{type:Object,default:()=>({v:4,h:4})},shadow:{type:Boolean,default:!0},shadowStyle:{type:String,default:"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)"},active:{type:Boolean,default:!1},cursorPointer:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingColor:{type:String,default:"grey darken-2"},promiseUnlock:{type:Boolean,default:!1},role:{type:String,default:"button"},editable:{type:Boolean,default:!0},disabledColor:{type:String,default:"rgba(255,255,255,0.5)"}},data:function(){return{activeTrans:!1,hoverTrans:!1,focusTrans:!1,loadingTrans:!1}},mounted:function(){},computed:{changeActive:function(){return this.activeTrans=this.active,""},changeLoading:function(){return this.loadingTrans=this.loading,""},effIconColor:function(){return Fr(this.iconColor)},effIconColorHover:function(){return Fr(this.iconColorHover)},effIconColorFocus:function(){return Fr(this.iconColorFocus)},effIconColorActive:function(){return Fr(this.iconColorActive)},useIconColor:function(){let t,e=this;return e.loadingTrans?e.effIconColor:(t=e.activeTrans?e.effIconColorActive:e.focusTrans?e.effIconColorFocus:e.hoverTrans?e.effIconColorHover:e.effIconColor,e.editable||(t=e.activeTrans?e.effIconColorActive:e.effIconColor),t)},useBorderRadius:function(){let t=this,e="0px";if(Fe(t.borderRadius)){e=`${ze(t.borderRadius)}px;`}else Ae(t.borderRadius)&&(e=t.borderRadius);let n="0px",i="0px",r="0px",o="0px";return!0===st(t,"borderRadiusStyle.left")&&(n=e,r=e),!0===st(t,"borderRadiusStyle.right")&&(i=e,o=e),!0===st(t,"borderRadiusStyle.top")&&(n=e,i=e),!0===st(t,"borderRadiusStyle.bottom")&&(r=e,o=e),!0!==st(t,"borderRadiusStyle.topLeft")&&!0!==st(t,"borderRadiusStyle.top-left")||(n=e),!0!==st(t,"borderRadiusStyle.topRight")&&!0!==st(t,"borderRadiusStyle.top-right")||(i=e),!0!==st(t,"borderRadiusStyle.bottomLeft")&&!0!==st(t,"borderRadiusStyle.bottom-left")||(r=e),!0!==st(t,"borderRadiusStyle.bottomRight")&&!0!==st(t,"borderRadiusStyle.bottom-right")||(o=e),`border-top-left-radius:${n}; border-top-right-radius:${i}; border-bottom-left-radius:${r}; border-bottom-right-radius:${o};`},effBorderColor:function(){return Fr(this.borderColor)},effBorderColorHover:function(){return Fr(this.borderColorHover)},effBorderColorFocus:function(){return Fr(this.borderColorFocus)},effBorderColorActive:function(){return Fr(this.borderColorActive)},useBorderColor:function(){let t,e=this;return e.loadingTrans?e.effBorderColor:(t=e.activeTrans?e.effBorderColorActive:e.focusTrans?e.effBorderColorFocus:e.hoverTrans?e.effBorderColorHover:e.effBorderColor,e.editable||(t=e.activeTrans?e.effBorderColorActive:e.effBorderColor),t)},effBackgroundColor:function(){return Fr(this.backgroundColor)},effBackgroundColorHover:function(){return Fr(this.backgroundColorHover)},effBackgroundColorFocus:function(){return Fr(this.backgroundColorFocus)},effBackgroundColorActive:function(){return Fr(this.backgroundColorActive)},useBackgroundColor:function(){let t,e=this;return e.loadingTrans?e.effBackgroundColor:(t=e.activeTrans?e.effBackgroundColorActive:e.focusTrans?e.effBackgroundColorFocus:e.hoverTrans?e.effBackgroundColorHover:e.effBackgroundColor,e.editable||(t=e.activeTrans?e.effBackgroundColorActive:e.effBackgroundColor),t)},effRippleColor:function(){return Fr(this.rippleColor)},effLoadingColor:function(){return Fr(this.loadingColor)},effDisabledColor:function(){return Fr(this.disabledColor)},usePadding:function(){return`padding:${Qr(this.paddingStyle,{ext:{}})};`},useShadow:function(){let t=this;return t.shadow&&Ae(t.shadowStyle)?"box-shadow:"+function(t,e,n){let i=_n(t=zr(t,"}","{"),"{");return i=gi(i,t=>{if(t.indexOf(e)>=0){let e=Lo(t,"=")[1];return e=Fe(e)?ze(e):.2,function(t,e){let n=Fr(t),i=Qs.toRgba(n);return i.a=e,Qs.toRgbaString(i)}(n,e)}return t}),Ro(i,"")}(t.shadowStyle,"backgroundColorAlpha",t.backgroundColor):""},hasTooltop:function(){return Ae(this.tooltip)}},methods:{ripple:function(t){let e=this;e.editable&&(e.loadingTrans||e.$nextTick(()=>{Zr(t.currentTarget,t,{color:e.effRippleColor,timeDuration:500})}))},clickBtn:function(t){let e=this;if(e.editable&&!e.loadingTrans)if(e.promiseUnlock){e.loadingTrans=!0,e.$nextTick(()=>{e.$emit("update:loading",e.loadingTrans)});let t=Io();e.$nextTick(()=>{e.$emit("click",{pm:t})}),t.catch().finally(()=>{e.loadingTrans=!1,e.$nextTick(()=>{e.$emit("update:loading",e.loadingTrans)})})}else e.$nextTick(()=>{e.$emit("click")})}}};const Ol=Il;var kl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{display:"inline-block","vertical-align":"middle",outline:"none","user-select":"none"},attrs:{role:t.editable?t.role:"",changeActive:t.changeActive,changeLoading:t.changeLoading}},[n("WTooltip",{attrs:{displayType:"line",isolated:!0,borderRadius:t.tooltipBorderRadius,paddingStyle:t.tooltipPaddingStyle,textFontSize:t.tooltipTextFontSize,textColor:t.tooltipTextColor,backgroundColor:t.tooltipBackgroundColor,editable:t.hasTooltop},scopedSlots:t._u([{key:"trigger",fn:function(){return[n("div",{style:"position:relative; transition:all 0.3s; "+t.usePadding+" "+t.useBorderRadius+" border:"+t.borderWidth+"px solid "+t.useBorderColor+"; background:"+t.useBackgroundColor+"; "+(t.editable&&t.cursorPointer?"cursor:pointer;":"")+" "+t.useShadow+"; outline:none; user-select:none; overflow:hidden;",attrs:{tabindex:"0"},on:{mouseenter:function(e){t.hoverTrans=!0,t.$emit("mouseenter",e)},mouseleave:function(e){t.hoverTrans=!1,t.$emit("mouseleave",e)},focus:function(e){t.focusTrans=!0},blur:function(e){t.focusTrans=!1},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.clickBtn(e)},click:function(e){t.ripple(e),t.clickBtn(e)}}},[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[t.loadingTrans?t._e():n("WIcon",{attrs:{icon:t.icon,color:t.useIconColor,colorHover:t.useIconColor,size:t.iconSize}}),t._v(" "),t.loadingTrans?n("WIconLoading",{attrs:{name:"cir-rotate",color:t.effLoadingColor,size:t.iconSize}}):t._e()],1),t._v(" "),t.editable?t._e():n("div",{staticStyle:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}},[n("div",{style:t.useBorderRadius+" overflow:hidden; width:100%; height:100%;"},[n("div",{style:"background:"+t.effDisabledColor+"; height:100%;"})])])])]},proxy:!0},{key:"content",fn:function(){return[t._v("\n "+t._s(t.tooltip)+"\n ")]},proxy:!0}])})],1)};kl._withStripped=!0;const Ul={components:{WButtonCircle:oo({render:kl,staticRenderFns:[]},function(t){t&&t("data-v-13f1b94c_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WButtonCircle.vue"},media:void 0})},Ol,"data-v-13f1b94c",false,void 0,!1,ao,void 0,void 0)},props:{kbname:{type:String},casename:{type:String}},data:function(){return{mdiLaunch:"M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",mdiUnfoldMoreVertical:"M18.17,12L15,8.83L16.41,7.41L21,12L16.41,16.58L15,15.17L18.17,12M5.83,12L9,15.17L7.59,16.59L3,12L7.59,7.42L9,8.83L5.83,12Z"}},mounted:function(){},computed:{fn:function(){let t=`${this.casename}`;return`${this.kbname}_${Po(t)}`}},methods:{ckExample:function(){let t="https://yuda-lyu.github.io/w-plot-vue/examples/"+this.fn+".html";window.open(t,"_blank")},ckCode:function(){let t="https://github.com/yuda-lyu/w-plot-vue/blob/master/docs/examples/"+this.fn+".html";window.open(t,"_blank")}}};var Dl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"item"},[n("div",{staticStyle:{display:"inline-block"}},[t._v("\n "+t._s(t.casename)+"\n ")]),t._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),t._v(" "),n("w-button-circle",{attrs:{paddingStyle:{v:3,h:3},icon:t.mdiLaunch,iconSize:16,iconColor:"red darken-1",iconColorHover:"red darken-1",iconColorFocus:"red darken-1",backgroundColor:"#fff",backgroundColorHover:"#fff5f5",backgroundColorFocus:"#fff2f2",tooltip:"example"},on:{click:t.ckExample}}),t._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),t._v(" "),n("w-button-circle",{attrs:{paddingStyle:{v:3,h:3},icon:t.mdiUnfoldMoreVertical,iconSize:16,iconColor:"red darken-1",iconColorHover:"red darken-1",iconColorFocus:"red darken-1",backgroundColor:"#fff",backgroundColorHover:"#fff5f5",backgroundColorFocus:"#fff2f2",tooltip:"code"},on:{click:t.ckCode}})],1)};Dl._withStripped=!0;const Nl=oo({render:Dl,staticRenderFns:[]},function(t){t&&t("data-v-eeb9dfb0_0",{source:"\n.item[data-v-eeb9dfb0] {\r\n border-left: 3px solid #ffba75;\r\n margin: 5px 5px 8px 0px;\r\n padding: 3px 3px 5px 10px;\r\n font-size: 0.9rem;\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\n}\r\n",map:{version:3,sources:["C:\\opensrc\\開源-JS-106-7-w-plot-vue\\w-plot-vue\\src\\components\\demolink.vue"],names:[],mappings:";AA+FA;IACA,8BAAA;IACA,uBAAA;IACA,yBAAA;IACA,iBAAA;IACA,aAAA;IACA,2BAAA;IACA,mBAAA;AACA",file:"demolink.vue",sourcesContent:['<template>\r\n <div class="item">\r\n\r\n <div style="display:inline-block;">\r\n {{casename}}\r\n </div>\r\n\r\n <div style="padding-left:5px;"></div>\r\n\r\n <w-button-circle\r\n :paddingStyle="{v:3,h:3}"\r\n :icon="mdiLaunch"\r\n :iconSize="16"\r\n :iconColor="\'red darken-1\'"\r\n :iconColorHover="\'red darken-1\'"\r\n :iconColorFocus="\'red darken-1\'"\r\n :backgroundColor="\'#fff\'"\r\n :backgroundColorHover="\'#fff5f5\'"\r\n :backgroundColorFocus="\'#fff2f2\'"\r\n :tooltip="\'example\'"\r\n @click="ckExample"\r\n ></w-button-circle>\r\n\r\n <div style="padding-left:5px;"></div>\r\n\r\n <w-button-circle\r\n :paddingStyle="{v:3,h:3}"\r\n :icon="mdiUnfoldMoreVertical"\r\n :iconSize="16"\r\n :iconColor="\'red darken-1\'"\r\n :iconColorHover="\'red darken-1\'"\r\n :iconColorFocus="\'red darken-1\'"\r\n :backgroundColor="\'#fff\'"\r\n :backgroundColorHover="\'#fff5f5\'"\r\n :backgroundColorFocus="\'#fff2f2\'"\r\n :tooltip="\'code\'"\r\n @click="ckCode"\r\n ></w-button-circle>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { mdiLaunch, mdiUnfoldMoreVertical } from \'@mdi/js\'\r\nimport cvCasename from \'../../toolg/cvCasename.mjs\'\r\nimport WButtonCircle from \'w-component-vue/src/components/WButtonCircle.vue\'\r\n\r\n\r\nexport default {\r\n components: {\r\n WButtonCircle,\r\n },\r\n props: {\r\n kbname: {\r\n type: String,\r\n },\r\n casename: {\r\n type: String,\r\n },\r\n },\r\n data: function() {\r\n return {\r\n mdiLaunch,\r\n mdiUnfoldMoreVertical\r\n }\r\n },\r\n mounted: function() {\r\n },\r\n computed: {\r\n\r\n fn: function() {\r\n let fnc = `${this.casename}`\r\n return `${this.kbname}_${cvCasename(fnc)}`\r\n },\r\n\r\n },\r\n methods: {\r\n\r\n ckExample: function() {\r\n let vo = this\r\n let url = \'https://yuda-lyu.github.io/w-plot-vue/examples/\' + vo.fn + \'.html\'\r\n window.open(url, \'_blank\')\r\n },\r\n\r\n ckCode: function() {\r\n let vo = this\r\n let url = \'https://github.com/yuda-lyu/w-plot-vue/blob/master/docs/examples/\' + vo.fn + \'.html\'\r\n window.open(url, \'_blank\')\r\n },\r\n\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n.item {\r\n border-left: 3px solid #ffba75;\r\n margin: 5px 5px 8px 0px;\r\n padding: 3px 3px 5px 10px;\r\n font-size: 0.9rem;\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n}\r\n</style>\r\n']},media:void 0})},Ul,"data-v-eeb9dfb0",false,void 0,!1,ao,void 0,void 0);function Bl(t,e){let n=Io();if(!to(t)&&!Fi(t))return n.reject("rs is not an array or object"),n;let i=!1;if(Fi(t)){i=!0;let e=[];Me(t,(t,n)=>{e.push({k:n,v:t})}),t=e}Lr(e)||(e=function(t){return t});let r=-1,o=[];return t.reduce(function(t,n){return t.then(function(t){o.push(t),r+=1;let s=r,a=n;return i&&(s=n.k,a=n.v),Lr(e)?e(a,s):a})},Promise.resolve()).then(function(t){var e,i,r,s;o.push(t),s=null==(e=o)?0:e.length,o=s?Ke(e,(i=r||void 0===i?1:Ne(i))<0?0:i,s):[],n.resolve(o)}).catch(function(t){n.reject(t)}),n}function Fl(t){let e,n=Object.prototype.toString.call(t);if(e="[object Promise]"===n,e)return!0;if("[object Function]"!==n)return!1;try{e="function"!=typeof t.subscribe&&"function"==typeof t.then}catch(t){}return e}async function zl(t,e={}){let n=null,i=Io();if(!Lr(t))return i.reject("waitfunction需輸入函數f"),i;let r=async()=>{let e=t();return Fl(e)&&(e=await e),e};if(n=await r(),!0===n)return i.resolve(),i;let o=st(e,"attemptNum",null);zi(o)||(o=200);let s=st(e,"timeInterval",null);zi(s)||(s=1e3);let a=0,l=setInterval(async()=>{a+=1,n=await r(),!0===n&&(clearInterval(l),i.resolve()),a>o&&(clearInterval(l),i.reject(`exceeded attemptNum[${o}]`))},s);return i}function Hl(t=10){Fe(t)||(t=10);let e=Io();return setTimeout(function(){e.resolve()},t),e}let Wl={},Vl={};function Gl({tagName:t,path:e,attributes:n={},func:i}){let r=Io();if("done"===Wl[e])return r.resolve("loaded"),r;if("loading"===Wl[e])return zl(()=>"done"===Wl[e]).then(function(){r.resolve("loaded")}),r;Wl[e]="loading";let o=document.createElement(t);return Me(n,(t,e)=>{o.setAttribute(e,t)}),n.rel&&"stylesheet"===n.rel?(o.setAttribute("href",e),setTimeout(()=>{r.resolve(o),Wl[e]="done"},1)):(o.src=e,o.addEventListener("load",()=>{let t;Lr(i)?t=zl(i):(t=Io(),t.resolve()),t.then(()=>Hl(500)).then(function(){r.resolve(o),Wl[e]="done"})}),o.addEventListener("error",()=>{r.reject(o),Wl[e]="done"})),document.getElementsByTagName("head")[0].appendChild(o),r}let jl={},Xl={},$l=async(t,e="")=>{let n=`${t}|${e}`;if(qo(Xl,n)){return await Xl[n]}let i=Io();Xl[n]=i;let r=`https://raw.githubusercontent.com/yuda-lyu/${t}/refs/heads/master/package.json`,o=`https://cdn.jsdelivr.net/npm/${t}@{version}/dist/{fn}`,s=await(async(t,e={})=>{if(qo(jl,t))return await jl[t];let n=st(e,"useCache");Kr(n)||(n=!1);let i=Io();jl[t]=i;let r={cache:n?"force-cache":"reload"},o=await fetch(t,r);if(!o.ok)throw new Error(`can not get res from url[${t}]`);let s=await o.json();return i.resolve(s),s})(r),a=st(s,"version");if(!Ae(a))throw new Error("找不到 version");let l=`${t}.umd.js`;Ae(e)&&(l=e);let c=o;return c=zr(c,"{version}",a),c=zr(c,"{fn}",l),i.resolve(c),c},Yl=async t=>{let e=await Bl(t,async t=>{let e="",n="",i=t.indexOf("base:")>=0,r=t.indexOf("file:")>=0,o=Lo(t,"|"),s=st(o,0,""),a=st(o,1,"");if(i&&r&&(e=$o(s,5),n=$o(a,5)),i&&!r&&(e=$o(t,5)),!i&&!r)return t;let l=t;if(Ae(e)&&!Ae(n))l=await $l(e);else{if(!Ae(e)||!Ae(n))throw console.log("url",l),new Error("invalid url");l=await $l(e,n)}return l}),n=await function(t){let e=Io();to(t)||(t=[t]),Me(t,(e,n)=>{Te(e)&&(t[n]={path:e})});let n=Ro(gi(t,"path"),"|");return"done"===Vl[n]?(e.resolve("loaded"),e):"loading"===Vl[n]?(zl(()=>"done"===Vl[n]).then(function(){e.resolve("loaded")}),e):(Vl[n]="loading",Me(t,(t,e)=>{t.type||(".js"===Ye(t.path,3)?t.type="js":".css"===Ye(t.path,4)?t.type="css":t.type="unknow")}),Bl(t,t=>{let e=Io();if("js"===t.type)e=Gl({tagName:"script",path:t.path,attributes:{type:"text/javascript"},func:t.func});else if("css"===t.type)e=Gl({tagName:"link",path:t.path,attributes:{rel:"stylesheet"}});else{let n="invalid pathItem.type: "+t.type;console.log(n),e.reject(n)}return e}).finally(()=>{Vl[n]="done"}))}(e);return n};function ql(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}t&&!window.Vue&&(window.Vue=t);const Zl={components:{WIconLoading:na},props:{pathItems:{type:Array,default:()=>["https://cdn.jsdelivr.net/npm/highcharts@11.4.8/highcharts.js","https://cdn.jsdelivr.net/npm/highcharts@11.4.8/highcharts-more.js","https://cdn.jsdelivr.net/npm/highcharts@11.4.8/modules/stock.js","https://cdn.jsdelivr.net/npm/highcharts@11.4.8/modules/annotations.js","https://cdn.jsdelivr.net/npm/highcharts@11.4.8/modules/heatmap.js","https://cdn.jsdelivr.net/npm/highcharts@11.4.8/modules/boost.js","https://cdn.jsdelivr.net/npm/highcharts@11.4.8/modules/boost-canvas.js","https://cdn.jsdelivr.net/npm/vue-highcharts@0.1.0/dist/vue-highcharts.min.js","base:w-highcharts"]},options:{type:Object,default:()=>{}}},data:function(){return{cmpName:"WIconLoading"}},mounted:function(){let e=this;Yl(e.pathItems).then(n=>{if("loaded"!==n){let e=window.Highcharts,n=window["w-highcharts"];n.iniMarkers(e),e.setOptions(n.getDefOpt());let i=window.VueHighcharts;i.default&&(i=i.default),function(){let e=ql();return t||e.Vue}().use(i,{Highcharts:e})}e.cmpName="Highcharts"})},computed:{},methods:{}};var Kl=function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.cmpName,{ref:"$self",tag:"component",attrs:{options:t.options}})};Kl._withStripped=!0;const Jl={components:{WHighchartsVueDyn:oo({render:Kl,staticRenderFns:[]},function(t){t&&t("data-v-37651efa_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WHighchartsVueDyn.vue"},media:void 0})},Zl,"data-v-37651efa",false,void 0,!1,ao,void 0,void 0)},props:{options:{type:Object,default:()=>{}},width:{type:Number,default:400},height:{type:Number,default:400}},data:function(){return{}},computed:{widthInp:function(){let t=this.width,e=st(this,"options.chart.width","");return Fe(e)&&(t=ze(e)),t},heightInp:function(){let t=this.height,e=st(this,"options.chart.height","");return Fe(e)&&(t=ze(e)),t}},methods:{}};var Ql=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.options?n("div",{style:"display:inline-block; width:"+t.widthInp+"px; min-width:"+t.widthInp+"px; height:"+t.heightInp+"px; overflow-y:hidden;"},[n("WHighchartsVueDyn",{attrs:{options:t.options}})],1):t._e()};Ql._withStripped=!0;const tc=oo({render:Ql,staticRenderFns:[]},function(t){t&&t("data-v-66a43b30_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WPlot2d.vue"},media:void 0})},Jl,"data-v-66a43b30",false,void 0,!1,ao,void 0,void 0);const ec={components:{demolink:Nl,WPlot2d:tc},props:{},data:function(){return{WPlot2d:{option1:{title:{text:"AAPL Stock Price"},xAxis:{type:"datetime"},yAxis:{title:{text:"Price"}},tooltip:{headerFormat:'<div style="font-size:8pt;">{point.x:%Y/%m/%d %H:%M}</div><br/>',pointFormat:" Price: <b>{point.y}</b>"},series:[{name:"AAPL",data:window.dataAAPL,tooltip:{valueDecimals:2}}]}}}},methods:{}};var nc=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"bkh"},[t._m(0),t._v(" "),n("div",{staticStyle:{padding:"0px"}},[n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-plot-2d",casename:"default"}}),t._v(" "),n("w-plot-2d",{attrs:{options:t.WPlot2d.option1}})],1)])])};nc._withStripped=!0;const ic=oo({render:nc,staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"head1"},[n("span",{staticStyle:{cursor:"pointer"},attrs:{title:"open for copy link to view component",onclick:"window.open('//yuda-lyu.github.io/w-plot-vue/examples/app.html?cmp='+this.innerText,'_blank')"}},[t._v("w-plot-2d")])])}]},function(t){t&&t("data-v-1c1e5d0c_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"AppZoneWPlot2d.vue"},media:void 0})},ec,"data-v-1c1e5d0c",false,void 0,!1,ao,void 0,void 0);function rc(t,e,n){(void 0!==n&&!N(t[e],n)||void 0===n&&!(e in t))&&yi(t,e,n)}function oc(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function sc(t,n,i,r,o,s,a){var l=oc(t,i),c=oc(n,i),h=a.get(c);if(h)rc(t,i,h);else{var u,d=s?s(l,c,i+"",t,n,a):void 0,f=void 0===d;if(f){var m=e(c),g=!m&&Qt(c),v=!m&&!g&&he(c);d=c,m||g||v?e(l)?d=l:p(u=l)&&ye(u)?d=er(l):g?(f=!1,d=tr(c,!0)):v?(f=!1,d=ur(c,!0)):d=[]:$r(c)||qt(c)?(d=l,qt(l)?d=function(t){return Xi(t,qi(t))}(l):_(l)&&!y(l)||(d=gr(c))):f=!1}f&&(a.set(c,d),o(d,c,r,s,a),a.delete(c)),rc(t,i,d)}}function ac(t,e,n,i,r){t!==e&&Vt(e,function(o,s){if(r||(r=new yn),_(o))sc(t,e,s,n,ac,i,r);else{var a=i?i(oc(t,s),o,s+"",t,e,r):void 0;void 0===a&&(a=o),rc(t,s,a)}},qi)}var lc,cc=(lc=function(t,e,n){ac(t,e,n)},Go(function(t,e){var n=-1,i=e.length,r=i>1?e[i-1]:void 0,o=i>2?e[2]:void 0;for(r=lc.length>3&&"function"==typeof r?(i--,r):void 0,o&&en(e[0],e[1],o)&&(r=i<3?void 0:r,i=1),t=Object(t);++n<i;){var s=e[n];s&&lc(t,s,n,r)}return t})),hc=cc;function uc(t={}){return{credits:{enabled:!1},navigation:{buttonOptions:{enabled:!1}},boost:{enabled:!0},plotOptions:{series:{animation:!1}},title:{text:""},subtitle:{text:""},tooltip:{useHTML:!0,enabled:st(t,"useTooltip",!0)},legend:{useHTML:!0,enabled:st(t,"useLegend",!0)}}}function dc(t={}){let e=st(t,"marginLeftShift",60),n=st(t,"marginRightShift",0),i=st(t,"marginTopShift",10),r=st(t,"marginBottomShift",60),o=st(t,"spacingLeft",0),s=st(t,"spacingRight",0),a=st(t,"spacingTop",0),l=st(t,"spacingBottom",0),c=st(t,"plotBorderColor","#666"),h=st(t,"plotBorderWidth",1),u=st(t,"space",5);return{animation:!1,plotBorderColor:c,plotBorderWidth:h,marginLeft:u+e,marginRight:u+n,marginTop:u+i,marginBottom:u+r,spacingLeft:o,spacingRight:s,spacingTop:a,spacingBottom:l}}function pc(t={}){let e=st(t,"softMax"),n=st(t,"vDig");return{crosshair:!0,title:{useHTML:!0,text:"",style:{fontFamily:st(t,"titleFontFamily","微軟正黑體"),fontSize:st(t,"titleFontSize","12pt"),color:st(t,"titleColor","#000")}},softMax:e,labels:{autoRotation:!1,style:{fontFamily:st(t,"labelFontFamily","微軟正黑體"),fontSize:st(t,"labelFontSize","9pt"),color:st(t,"labelColor","#222")},formatter:function(t){return n?function(t,e=0){return Fe(t)&&$e(e)?(t=ze(t),je(t,e).toFixed(e)):""}(t.value,n):t.value}},lineColor:"#666",lineWidth:1,gridLineColor:"#eeeeee",gridLineWidth:1,minorGridLineColor:"#eeeeee",minorGridLineWidth:1,tickPosition:"inside",tickColor:"#222222",tickWidth:1,tickLength:5,minorTickPosition:"inside",minorTickColor:"#222222",minorTickWidth:1,minorTickLength:5}}function fc(t={}){let e=st(t,"legnedFontFamily","微軟正黑體"),n=st(t,"legnedFontSize","9pt"),i=st(t,"legnedColor","#222");return{useHTML:!0,enabled:!0,shared:!0,floating:!0,layout:"vertical",backgroundColor:st(t,"legendBackgroundColor","rgba(255,255,255,0.75)"),borderColor:st(t,"legnedBorderColor","#aaa"),borderWidth:1,itemStyle:{fontFamily:e,fontSize:n,color:i}}}function mc(t,e={}){let n=st(e,"legendPosition","topright"),i=st(t,"chart.marginLeft")||st(t,"chart.margin-left");i=ze(i);let r=st(t,"chart.marginRight")||st(t,"chart.margin-right");r=ze(r);let o=st(t,"chart.marginTop")||st(t,"chart.margin-top");o=ze(o);let s=st(t,"chart.marginBottom")||st(t,"chart.margin-bottom");s=ze(s),st(e,"legendIgnoreMargin",!1)&&(i=0,r=0,o=0,s=0);let a=st(t,"chart.spacingLeft")||st(t,"chart.spacing-left");a=ze(a);let l=st(t,"chart.spacingRight")||st(t,"chart.spacing-right");l=ze(l);let c=st(t,"chart.spacingTop")||st(t,"chart.spacing-top");c=ze(c);let h=st(t,"chart.spacingBottom")||st(t,"chart.spacing-bottom");h=ze(h),st(e,"legendIgnoreSpacing",!1)&&(a=0,l=0,c=0,h=0);let u=st(t,"legend",{});if(t.legend=u,"topleft"===n){t.legend.align="left",t.legend.verticalAlign="top";let e=5,n=5;t.legend.x=i-a+e,t.legend.y=o-c+n}else if("bottomleft"===n){t.legend.align="left",t.legend.verticalAlign="bottom";let e=5,n=-5;t.legend.x=i-a+e,t.legend.y=-s+h+n}else if("bottomright"===n){t.legend.align="right",t.legend.verticalAlign="bottom";let e=-5,n=-5;t.legend.x=-r+l+e,t.legend.y=-s+h+n}else{t.legend.align="right",t.legend.verticalAlign="top";let e=-5,n=5;t.legend.x=-r+l+e,t.legend.y=o-c+n}return t}function gc(t,e,n,i,r={}){let o=st(r,"marginLeft",null),s=st(r,"marginRight",null),a=st(r,"marginTop",null),l=st(r,"marginBottom",null),c=st(r,"direction","vertical");"vertical"!==c&&"horizontal"!==c&&(c="vertical");let h,u=st(r,"xTitle",""),d=st(r,"yTitle",""),p=st(r,"barColor",void 0),f=st(r,"barKpColor",void 0),m=st(r,"barGroupWidthRatio",.2),g=st(r,"barWidthRatio",.2),v=st(r,"barBorderWidth",1),_=st(r,"barDisplay","separate");"separate"!==_&&"stackNormal"!==_&&"stackPercent"!==_&&(_="separate"),"stackNormal"===_?h="normal":"stackPercent"===_&&(h="percent");let y=st(r,"barBorderRadius",4),b=st(r,"barShowLabels",!0),x=st(r,"barUseInnerLabelsForHorizontal",!1),S=st(r,"showLegend",!1),w=n,M=[];Me(i,(t,e)=>{let i=st(t,"name",""),r=p,o=st(t,"color",void 0),s=st(t,"data",{}),a=null,l=[];Me(n,t=>{let n=st(s,t,null),i=n;if(Hr(i)){if(!qo(i,"value"))throw new Error("bar data is an object but no value");i=st(i,"value",null)}let c=st(f,t,void 0),h=st(f,`${e}.${t}`,void 0),u=st(n,"color",void 0),d=(t=>{if(io(t)){let e=Ui(t);t=1===e?t[0]:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:gi(t,(t,n)=>[n/(e-1),t])}}return t})(r||o||c||h||u);null===a&&(a=d),l.push({name:t,y:i,color:d})}),M.push({name:i,data:l,color:a})});let T=uc(r),A=dc(r),E=pc(r),C=hc(E,{categories:w,labels:{allowOverlap:!0}});C.title.text=u;let R=pc(r),P=hc(R,{});P.title.text=d,P.min=0;let L={...T,chart:{...A,type:"vertical"===c?"column":"bar",width:t,height:e},xAxis:C,yAxis:P,legend:fc(r),series:M};return Jr(o)&&(L.chart.marginLeft=o),Jr(s)&&(L.chart.marginRight=s),Jr(a)&&(L.chart.marginTop=a),Jr(l)&&(L.chart.marginBottom=l),"stackPercent"===_&&("vertical"===c&&(L.chart.marginLeft+=11),L.yAxis.labels.formatter=t=>`${t.value}%`),"horizontal"===c&&x&&(L.chart.marginLeft=40,L.xAxis.title.margin=21,L.xAxis.labels.enabled=!1,L.xAxis.tickWidth=0,L.xAxis.min=-.25,L.xAxis.tickInterval=1,L.xAxis.plotLines=[{color:L.xAxis.gridLineColor,width:L.xAxis.gridLineWidth,value:-.5}]),L.plotOptions={...L.plotOptions,series:{groupPadding:m,pointPadding:g,borderWidth:v,grouping:!0,borderRadius:y,stacking:h,dataLabels:{enabled:b,allowOverlap:!0}}},L=mc(L,r),L.legend.enabled=S,L}const vc={components:{WPlot2d:tc},props:{opt:{type:Object,default:()=>{}}},data:function(){return{}},computed:{picWidth:function(){return st(this,"opt.width",0)},picHeight:function(){return st(this,"opt.height",0)},ks:function(){return st(this,"opt.keys",[])},hasOptBar:function(){return Hr(this.optBar)},optBar:function(){let t=this,e=null;try{let n=st(t,"opt.rds",[]);e=gc(t.picWidth,t.picHeight,t.ks,n,t.opt)}catch(t){console.log(t)}return e},useInnerLabels:function(){let t="horizontal"===st(this,"opt.direction",""),e=st(this,"opt.barUseInnerLabelsForHorizontal",!1);return t&&e},locLeft:function(){return st(this,"optBar.chart.marginLeft",0)},locTop:function(){return st(this,"optBar.chart.marginTop",0)},locBottom:function(){return st(this,"optBar.chart.marginBottom",0)},hTickLableFontFamily:function(){return st(this,"optBar.xAxis.labels.style.fontFamily","")},hTickLableFontSize:function(){return st(this,"optBar.xAxis.labels.style.fontSize","")},hTickLableColor:function(){return st(this,"optBar.xAxis.labels.style.color","")},hAxisMin:function(){return st(this,"optBar.xAxis.min",0)},hTickLabels:function(){let t=this,e=t.picHeight-t.locTop-t.locBottom;e=Math.max(e,0);let n=Ui(t.ks)-t.hAxisMin,i=0;return n>0&&(i=e/n),gi(t.ks,(e,n)=>({name:e,y:t.locTop+i*(n-t.hAxisMin)}))}},methods:{}};var _c=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.hasOptBar?n("div",{staticStyle:{display:"inline-block"}},[n("div",{style:"width:"+t.picWidth+"px; max-width:"+t.picWidth+"px;"},[t._t("top",null,{opt:t.optBar})],2),t._v(" "),n("div",{staticStyle:{position:"relative"}},[n("WPlot2d",{attrs:{options:t.optBar}}),t._v(" "),t.useInnerLabels?t._l(t.hTickLabels,function(e,i){return n("div",{key:"ktk-"+i,style:"position:absolute; left:"+t.locLeft+"px; top:"+e.y+"px; font-family:"+t.hTickLableFontFamily+"; font-size:"+t.hTickLableFontSize+"; color:"+t.hTickLableColor+";"},[t._v("\n "+t._s(e.name)+"\n ")])}):t._e()],2),t._v(" "),n("div",{style:"width:"+t.picWidth+"px; max-width:"+t.picWidth+"px;"},[t._t("bottom",null,{opt:t.optBar})],2)]):t._e()};_c._withStripped=!0;const yc=oo({render:_c,staticRenderFns:[]},function(t){t&&t("data-v-5fb84f54_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WBar.vue"},media:void 0})},vc,"data-v-5fb84f54",false,void 0,!1,ao,void 0,void 0);var bc={components:{demolink:Nl,WBar:yc},props:{},data:function(){let t=["USA","China","Brazil","EU","India","Russia"];return{WBar:{opt1a:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt1b:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:"#F44336"},China:{value:260,color:"#E91E63"},Brazil:{value:107,color:"#9C27B0"},EU:{value:68.3,color:"#673AB7"},India:{value:27.5,color:"#3F51B5"},Russia:{value:14.5,color:"#2196F3"}}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt1c:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:["#EF9A9A","#F44336"]},China:{value:260,color:["#F48FB1","#E91E63"]},Brazil:{value:107,color:["#CE93D8","#9C27B0"]},EU:{value:68.3,color:["#B39DDB","#673AB7"]},India:{value:27.5,color:["#9FA8DA","#3F51B5"]},Russia:{value:14.5,color:["#90CAF9","#2196F3"]}}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2a:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}},{name:"Wheat",data:{USA:51.086,China:136,Brazil:5.5,EU:141,India:107.18,Russia:77}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2b:{width:400,height:400,keys:t,rds:[{name:"Corn",color:"#E91E63",data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}},{name:"Wheat",color:"#9C27B0",data:{USA:51.086,China:136,Brazil:5.5,EU:141,India:107.18,Russia:77}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2c:{width:400,height:400,keys:t,rds:[{name:"Corn",color:["rgb(243, 150, 199)","rgb(233, 30, 99)"],data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}},{name:"Wheat",color:["rgb(206, 159, 236)","rgb(156, 39, 176)"],data:{USA:51.086,China:136,Brazil:5.5,EU:141,India:107.18,Russia:77}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2d:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:"#FF8A80"},China:{value:260,color:"#FF80AB"},Brazil:{value:107,color:"#EA80FC"},EU:{value:68.3,color:"#B388FF"},India:{value:27.5,color:"#8C9EFF"},Russia:{value:14.5,color:"#82B1FF"}}},{name:"Wheat",data:{USA:{value:51.086,color:"#F44336"},China:{value:136,color:"#E91E63"},Brazil:{value:5.5,color:"#9C27B0"},EU:{value:141,color:"#673AB7"},India:{value:107.18,color:"#3F51B5"},Russia:{value:77,color:"#2196F3"}}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2e:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:["rgb(255, 205, 210)","rgb(229, 115, 115)"]},China:{value:260,color:["rgb(255, 185, 210)","rgb(229, 95, 115)"]},Brazil:{value:107,color:["rgb(255, 165, 210)","rgb(229, 75, 115)"]},EU:{value:68.3,color:["rgb(255, 145, 210)","rgb(229, 55, 115)"]},India:{value:27.5,color:["rgb(255, 125, 210)","rgb(229, 35, 115)"]},Russia:{value:14.5,color:["rgb(255, 105, 210)","rgb(229, 15, 115)"]}}},{name:"Wheat",data:{USA:{value:51.086,color:["rgb(210, 205, 255)","rgb(115, 115, 229)"]},China:{value:136,color:["rgb(210, 185, 255)","rgb(115, 95, 229)"]},Brazil:{value:5.5,color:["rgb(210, 165, 255)","rgb(115, 75, 229)"]},EU:{value:141,color:["rgb(210, 145, 255)","rgb(115, 55, 229)"]},India:{value:107.18,color:["rgb(210, 125, 255)","rgb(115, 35, 229)"]},Russia:{value:77,color:["rgb(210, 105, 255)","rgb(115, 15, 229)"]}}}],xTitle:"Countries",yTitle:"Weight (MT)"}}}},methods:{}};const xc=bc;var Sc=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"bkh"},[t._m(0),t._v(" "),n("div",{staticStyle:{padding:"0px"}},[n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & marginLeft & marginRight & marginTop & marginBottom"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{marginLeft:85,marginRight:25,marginTop:35,marginBottom:75})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & barWidthRatio"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{barWidthRatio:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & barWidthRatio & barGroupWidthRatio & barBorderRadius"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{barWidthRatio:0,barGroupWidthRatio:0,barBorderRadius:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & barWidthRatio & barGroupWidthRatio & barBorderRadius & barBorderWidth"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{barWidthRatio:0,barGroupWidthRatio:0,barBorderRadius:0,barBorderWidth:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & barColor"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{barColor:"#FF9800"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & barColor(gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{barColor:["#4f95d8","#0058a5"]})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set(color)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1b)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set(color, gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1c)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & barKpColor"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{barKpColor:{USA:"#F44336",China:"#E91E63",Brazil:"#9C27B0",EU:"#673AB7",India:"#3F51B5",Russia:"#2196F3"}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & barKpColor(gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{barKpColor:{USA:["#EF9A9A","#F44336"],China:["#F48FB1","#E91E63"],Brazil:["#CE93D8","#9C27B0"],EU:["#B39DDB","#673AB7"],India:["#9FA8DA","#3F51B5"],Russia:["#90CAF9","#2196F3"]}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & hide labels"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{barShowLabels:!1})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"one-set & show legned"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set & barWidthRatio"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!0,barWidthRatio:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set & barWidthRatio & barGroupWidthRatio & barBorderRadius"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!0,barWidthRatio:0,barGroupWidthRatio:0,barBorderRadius:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set & barWidthRatio & barGroupWidthRatio & barBorderRadius & barBorderWidth"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!0,barWidthRatio:0,barGroupWidthRatio:0,barBorderRadius:0,barBorderWidth:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set(series color)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2b,{barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set(series color, gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2c,{barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set(color)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2d,{barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set(color, gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2e,{barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set & barKpColor"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!0,barKpColor:{"0.USA":"#FF8A80","1.USA":"#F44336","0.China":"#FF80AB","1.China":"#E91E63","0.Brazil":"#EA80FC","1.Brazil":"#9C27B0","0.EU":"#B388FF","1.EU":"#673AB7","0.India":"#8C9EFF","1.India":"#3F51B5","0.Russia":"#82B1FF","1.Russia":"#2196F3"}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set & barKpColor(gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!0,barKpColor:{"0.USA":["rgb(255, 205, 210)","rgb(229, 115, 115)"],"1.USA":["rgb(210, 205, 255)","rgb(115, 115, 229)"],"0.China":["rgb(255, 185, 210)","rgb(229, 95, 115)"],"1.China":["rgb(210, 185, 255)","rgb(115, 95, 229)"],"0.Brazil":["rgb(255, 165, 210)","rgb(229, 75, 115)"],"1.Brazil":["rgb(210, 165, 255)","rgb(115, 75, 229)"],"0.EU":["rgb(255, 145, 210)","rgb(229, 55, 115)"],"1.EU":["rgb(210, 145, 255)","rgb(115, 55, 229)"],"0.India":["rgb(255, 125, 210)","rgb(229, 35, 115)"],"1.India":["rgb(210, 125, 255)","rgb(115, 35, 229)"],"0.Russia":["rgb(255, 105, 210)","rgb(229, 15, 115)"],"1.Russia":["rgb(210, 105, 255)","rgb(115, 15, 229)"]}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set && show labels"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!0,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set && hide legned"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!1})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set && barDisplay(stackNormal)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!0,barDisplay:"stackNormal"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set && barDisplay(stackNormal) && barShowLabels"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!0,showLegend:!0,barDisplay:"stackNormal"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"multi-set && barDisplay(stackPercent)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{barShowLabels:!1,showLegend:!0,barDisplay:"stackPercent",yTitle:"Percent of Weight (%)"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & marginLeft & marginRight & marginTop & marginBottom"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:85,marginRight:25,marginTop:35,marginBottom:75,legendPosition:"bottomright"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & barUseInnerLabelsForHorizontal"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barUseInnerLabelsForHorizontal:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & barWidthRatio"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barWidthRatio:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & barWidthRatio & barGroupWidthRatio & barBorderRadius"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barWidthRatio:0,barGroupWidthRatio:0,barBorderRadius:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & barWidthRatio & barGroupWidthRatio & barBorderRadius & barBorderWidth"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barWidthRatio:0,barGroupWidthRatio:0,barBorderRadius:0,barBorderWidth:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & barColor"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barColor:"#FF9800"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & barColor(gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barColor:["#4f95d8","#0058a5"]})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set(color)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1b,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set(color, gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1c,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & barKpColor"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barKpColor:{USA:"#F44336",China:"#E91E63",Brazil:"#9C27B0",EU:"#673AB7",India:"#3F51B5",Russia:"#2196F3"}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & barKpColor(gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barKpColor:{USA:["#EF9A9A","#F44336"],China:["#F48FB1","#E91E63"],Brazil:["#CE93D8","#9C27B0"],EU:["#B39DDB","#673AB7"],India:["#9FA8DA","#3F51B5"],Russia:["#90CAF9","#2196F3"]}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & hide labels"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & one-set & show legned"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt1a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set & barUseInnerLabelsForHorizontal & barGroupWidthRatio"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0,barUseInnerLabelsForHorizontal:!0,barGroupWidthRatio:.25})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set & barWidthRatio"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0,barWidthRatio:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set & barWidthRatio & barGroupWidthRatio & barBorderRadius"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0,barWidthRatio:0,barGroupWidthRatio:0,barBorderRadius:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set & barWidthRatio & barGroupWidthRatio & barBorderRadius & barBorderWidth"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0,barWidthRatio:0,barGroupWidthRatio:0,barBorderRadius:0,barBorderWidth:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set(series color)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2b,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set(series color, gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2c,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set(color)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2d,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set(color, gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2e,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set & barKpColor"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0,barKpColor:{"0.USA":"#FF8A80","1.USA":"#F44336","0.China":"#FF80AB","1.China":"#E91E63","0.Brazil":"#EA80FC","1.Brazil":"#9C27B0","0.EU":"#B388FF","1.EU":"#673AB7","0.India":"#8C9EFF","1.India":"#3F51B5","0.Russia":"#82B1FF","1.Russia":"#2196F3"}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set & barKpColor(gradient)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0,barKpColor:{"0.USA":["rgb(255, 205, 210)","rgb(229, 115, 115)"],"1.USA":["rgb(210, 205, 255)","rgb(115, 115, 229)"],"0.China":["rgb(255, 185, 210)","rgb(229, 95, 115)"],"1.China":["rgb(210, 185, 255)","rgb(115, 95, 229)"],"0.Brazil":["rgb(255, 165, 210)","rgb(229, 75, 115)"],"1.Brazil":["rgb(210, 165, 255)","rgb(115, 75, 229)"],"0.EU":["rgb(255, 145, 210)","rgb(229, 55, 115)"],"1.EU":["rgb(210, 145, 255)","rgb(115, 55, 229)"],"0.India":["rgb(255, 125, 210)","rgb(229, 35, 115)"],"1.India":["rgb(210, 125, 255)","rgb(115, 35, 229)"],"0.Russia":["rgb(255, 105, 210)","rgb(229, 15, 115)"],"1.Russia":["rgb(210, 105, 255)","rgb(115, 15, 229)"]}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set && show labels"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!0,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set && hide legned"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!1})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set && barDisplay(stackNormal)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0,barDisplay:"stackNormal"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set && barDisplay(stackNormal) && barShowLabels"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!0,showLegend:!0,barDisplay:"stackNormal"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-bar",casename:"horizontal & multi-set && barDisplay(stackPercent)"}}),t._v(" "),n("w-bar",{attrs:{opt:Object.assign({},t.WBar.opt2a,{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barShowLabels:!1,showLegend:!0,barDisplay:"stackPercent",yTitle:"Percent of Weight (%)"})}})],1)])])};Sc._withStripped=!0;const wc=oo({render:Sc,staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"head1"},[n("span",{staticStyle:{cursor:"pointer"},attrs:{title:"open for copy link to view component",onclick:"window.open('//yuda-lyu.github.io/w-plot-vue/examples/app.html?cmp='+this.innerText,'_blank')"}},[t._v("w-bar")])])}]},function(t){t&&t("data-v-067763ff_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"AppZoneWBar.vue"},media:void 0})},xc,"data-v-067763ff",false,void 0,!1,ao,void 0,void 0);function Mc(t,e,n,i,r={}){let o=st(r,"marginLeft",null),s=st(r,"marginRight",null),a=st(r,"marginTop",null),l=st(r,"marginBottom",null),c=st(r,"pieThicknessRatio",.6);c=Math.min(c,1),c=Math.max(c,0);let h=st(r,"pieBorderRadius",4),u=st(r,"pieKpColor",void 0),d=st(r,"pieBorderWidth",1),p=st(r,"pieShowLabels",!0),f=st(r,"showLegend",!0),m=[];Me(i,(t,e)=>{let i=st(t,"name",""),r=st(t,"color",void 0),o=st(t,"data",{}),s=null,a=[];Me(n,t=>{let n=st(o,t,null),i=n;if(Hr(i)){if(!qo(i,"value"))throw new Error("pie data is an object but no value");i=st(i,"value",null)}let l=st(u,t,void 0),c=st(u,`${e}.${t}`,void 0),h=st(n,"color",void 0),d=(t=>{if(io(t)){let e=Ui(t);t=1===e?t[0]:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:gi(t,(t,n)=>[n/(e-1),t])}}return t})(r||l||c||h);null===s&&(s=d),a.push({name:t,y:i,color:d})}),m.push({name:i,data:a,color:s})});let g={...uc(r),chart:{...dc({...r,marginLeftShift:0,marginRightShift:0,marginTopShift:0,marginBottomShift:0,plotBorderColor:"transparent"}),type:"pie",width:t,height:e},legend:fc(r),series:m};return Jr(o)&&(g.chart.marginLeft=o),Jr(s)&&(g.chart.marginRight=s),Jr(a)&&(g.chart.marginTop=a),Jr(l)&&(g.chart.marginBottom=l),g.plotOptions={...g.plotOptions,series:{borderWidth:d,dataLabels:{enabled:p,allowOverlap:!0,format:'\n <div style="width:50px;">\n <div style="font-weight:bold;">{point.name}</div>\n <div style="opacity:0.6;">{point.percentage:.1f}%</div>\n </div>\n '},innerSize:100*(1-c)+"%",borderRadius:h,showInLegend:f}},g=mc(g,{...r,legendIgnoreMargin:!0}),g.legend.enabled=f,g}const Tc={components:{WPlot2d:tc},props:{opt:{type:Object,default:()=>{}}},data:function(){return{}},computed:{picWidth:function(){return st(this,"opt.width",0)},picHeight:function(){return st(this,"opt.height",0)},ks:function(){return st(this,"opt.keys",[])},hasOptPie:function(){return Hr(this.optPie)},optPie:function(){let t=this,e=null;try{let n=st(t,"opt.rds",[]);e=Mc(t.picWidth,t.picHeight,t.ks,n,t.opt)}catch(t){console.log(t)}return e}},methods:{}};var Ac=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.hasOptPie?n("div",{staticStyle:{display:"inline-block"}},[n("div",{style:"width:"+t.picWidth+"px; max-width:"+t.picWidth+"px;"},[t._t("top",null,{opt:t.optPie})],2),t._v(" "),n("WPlot2d",{attrs:{options:t.optPie}}),t._v(" "),n("div",{style:"width:"+t.picWidth+"px; max-width:"+t.picWidth+"px;"},[t._t("bottom",null,{opt:t.optPie})],2)],1):t._e()};Ac._withStripped=!0;const Ec=oo({render:Ac,staticRenderFns:[]},function(t){t&&t("data-v-66d244ef_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WPie.vue"},media:void 0})},Tc,"data-v-66d244ef",false,void 0,!1,ao,void 0,void 0);var Cc={components:{demolink:Nl,WPie:Ec},props:{},data:function(){let t=["USA","China","Brazil","EU","India","Russia"];return{WPie:{opt1a:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt1b:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:"#F44336"},China:{value:260,color:"#E91E63"},Brazil:{value:107,color:"#9C27B0"},EU:{value:68.3,color:"#673AB7"},India:{value:27.5,color:"#3F51B5"},Russia:{value:14.5,color:"#2196F3"}}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt1c:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:["#EF9A9A","#F44336"]},China:{value:260,color:["#F48FB1","#E91E63"]},Brazil:{value:107,color:["#CE93D8","#9C27B0"]},EU:{value:68.3,color:["#B39DDB","#673AB7"]},India:{value:27.5,color:["#9FA8DA","#3F51B5"]},Russia:{value:14.5,color:["#90CAF9","#2196F3"]}}}],xTitle:"Countries",yTitle:"Weight (MT)"}}}},methods:{}};const Rc=Cc;var Pc=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"bkh"},[t._m(0),t._v(" "),n("div",{staticStyle:{padding:"0px"}},[n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set & marginLeft & marginRight & marginTop & marginBottom"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a,{marginLeft:50,marginRight:50,marginTop:50,marginBottom:50})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set & pieThicknessRatio"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a,{pieThicknessRatio:.05})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set & pieBorderRadius"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a,{pieBorderRadius:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set & pieBorderWidth & pieBorderRadius"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a,{pieBorderWidth:0,pieBorderRadius:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set(color)"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1b)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set(color, gradient)"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1c)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set & pieKpColor"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a,{pieKpColor:{USA:"#F44336",China:"#E91E63",Brazil:"#9C27B0",EU:"#673AB7",India:"#3F51B5",Russia:"#2196F3"}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set & pieKpColor(gradient)"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a,{pieKpColor:{USA:["#EF9A9A","#F44336"],China:["#F48FB1","#E91E63"],Brazil:["#CE93D8","#9C27B0"],EU:["#B39DDB","#673AB7"],India:["#9FA8DA","#3F51B5"],Russia:["#90CAF9","#2196F3"]}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set & hide labels"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a,{pieShowLabels:!1})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-pie",casename:"one-set & hide legned"}}),t._v(" "),n("w-pie",{attrs:{opt:Object.assign({},t.WPie.opt1a,{showLegend:!1})}})],1)])])};Pc._withStripped=!0;const Lc=oo({render:Pc,staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"head1"},[n("span",{staticStyle:{cursor:"pointer"},attrs:{title:"open for copy link to view component",onclick:"window.open('//yuda-lyu.github.io/w-plot-vue/examples/app.html?cmp='+this.innerText,'_blank')"}},[t._v("w-pie")])])}]},function(t){t&&t("data-v-a9cf5f2c_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"AppZoneWPie.vue"},media:void 0})},Rc,"data-v-a9cf5f2c",false,void 0,!1,ao,void 0,void 0);function Ic(t,e,n,i,r={}){let o=st(r,"marginLeft",null),s=st(r,"marginRight",null),a=st(r,"marginTop",null),l=st(r,"marginBottom",null),c=st(r,"xLabelFontSize","10pt"),h=st(r,"yTitle",""),u=st(r,"yTitleFontSize","10pt"),d=st(r,"yTitleColor","#444"),p=st(r,"yLabelFontSize","8pt"),f=st(r,"yLabelColor","#888"),m=st(r,"roseKpColor",void 0),g=st(r,"roseWidthRatio",.25),v=st(r,"roseBorderWidth",1),_=st(r,"roseShowLabels",!1),y=st(r,"showLegend",!1),b=n,x=[];Me(i,(t,e)=>{let i=st(t,"name",""),r=st(t,"color",void 0),o=st(t,"data",{}),s=null,a=[];Me(n,t=>{let n=st(o,t,null),i=n;if(Hr(i)){if(!qo(i,"value"))throw new Error("rose data is an object but no value");i=st(i,"value",null)}let l=st(m,t,void 0),c=st(m,`${e}.${t}`,void 0),h=st(n,"color",void 0),u=(t=>{if(io(t)){let e=Ui(t);t=1===e?t[0]:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:gi(t,(t,n)=>[n/(e-1),t])}}return t})(r||l||c||h);null===s&&(s=u),a.push({name:t,y:i,color:u})}),x.push({name:i,data:a,color:s})});let S=uc(r),w=dc({...r,space:40,marginLeftShift:0,marginRightShift:0,marginTopShift:0,marginBottomShift:0,plotBorderColor:"transparent"}),M=pc({...r,labelFontSize:c}),T=hc(M,{categories:b,labels:{allowOverlap:!0}}),A=pc({...r,titleFontSize:u,titleColor:d,labelFontSize:p,labelColor:f}),E=hc(A,{});E.title.text=h,E.min=0;let C={...S,chart:{...w,polar:!0,type:"column",width:t,height:e},xAxis:T,yAxis:E,legend:fc(r),series:x};return Jr(o)&&(C.chart.marginLeft=o),Jr(s)&&(C.chart.marginRight=s),Jr(a)&&(C.chart.marginTop=a),Jr(l)&&(C.chart.marginBottom=l),C.plotOptions={...C.plotOptions,series:{stacking:"normal",groupPadding:0,pointPadding:g,borderWidth:v,dataLabels:{enabled:_,allowOverlap:!0,align:"center",y:-10}}},C=mc(C,{...r,legendIgnoreMargin:!0}),C.legend.enabled=y,C}const Oc={components:{WPlot2d:tc},props:{opt:{type:Object,default:()=>{}}},data:function(){return{}},computed:{picWidth:function(){return st(this,"opt.width",0)},picHeight:function(){return st(this,"opt.height",0)},ks:function(){return st(this,"opt.keys",[])},hasOptRose:function(){return Hr(this.optRose)},optRose:function(){let t=this,e=null;try{let n=st(t,"opt.rds",[]);e=Ic(t.picWidth,t.picHeight,t.ks,n,t.opt)}catch(t){console.log(t)}return e}},methods:{}};var kc=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.hasOptRose?n("div",{staticStyle:{display:"inline-block"}},[n("div",{style:"width:"+t.picWidth+"px; max-width:"+t.picWidth+"px;"},[t._t("top",null,{opt:t.optRose})],2),t._v(" "),n("WPlot2d",{attrs:{options:t.optRose}}),t._v(" "),n("div",{style:"width:"+t.picWidth+"px; max-width:"+t.picWidth+"px;"},[t._t("bottom",null,{opt:t.optRose})],2)],1):t._e()};kc._withStripped=!0;const Uc=oo({render:kc,staticRenderFns:[]},function(t){t&&t("data-v-4d726c8e_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WRose.vue"},media:void 0})},Oc,"data-v-4d726c8e",false,void 0,!1,ao,void 0,void 0);var Dc={components:{demolink:Nl,WRose:Uc},props:{},data:function(){let t=["USA","China","Brazil","EU","India","Russia"];return{WRose:{opt1a:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt1b:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:"#F44336"},China:{value:260,color:"#E91E63"},Brazil:{value:107,color:"#9C27B0"},EU:{value:68.3,color:"#673AB7"},India:{value:27.5,color:"#3F51B5"},Russia:{value:14.5,color:"#2196F3"}}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt1c:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:["#EF9A9A","#F44336"]},China:{value:260,color:["#F48FB1","#E91E63"]},Brazil:{value:107,color:["#CE93D8","#9C27B0"]},EU:{value:68.3,color:["#B39DDB","#673AB7"]},India:{value:27.5,color:["#9FA8DA","#3F51B5"]},Russia:{value:14.5,color:["#90CAF9","#2196F3"]}}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2a:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}},{name:"Wheat",data:{USA:51.086,China:136,Brazil:5.5,EU:141,India:107.18,Russia:77}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2b:{width:400,height:400,keys:t,rds:[{name:"Corn",color:"#E91E63",data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}},{name:"Wheat",color:"#9C27B0",data:{USA:51.086,China:136,Brazil:5.5,EU:141,India:107.18,Russia:77}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2c:{width:400,height:400,keys:t,rds:[{name:"Corn",color:["rgb(243, 150, 199)","rgb(233, 30, 99)"],data:{USA:406.292,China:260,Brazil:107,EU:68.3,India:27.5,Russia:14.5}},{name:"Wheat",color:["rgb(206, 159, 236)","rgb(156, 39, 176)"],data:{USA:51.086,China:136,Brazil:5.5,EU:141,India:107.18,Russia:77}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2d:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:"#FF8A80"},China:{value:260,color:"#FF80AB"},Brazil:{value:107,color:"#EA80FC"},EU:{value:68.3,color:"#B388FF"},India:{value:27.5,color:"#8C9EFF"},Russia:{value:14.5,color:"#82B1FF"}}},{name:"Wheat",data:{USA:{value:51.086,color:"#F44336"},China:{value:136,color:"#E91E63"},Brazil:{value:5.5,color:"#9C27B0"},EU:{value:141,color:"#673AB7"},India:{value:107.18,color:"#3F51B5"},Russia:{value:77,color:"#2196F3"}}}],xTitle:"Countries",yTitle:"Weight (MT)"},opt2e:{width:400,height:400,keys:t,rds:[{name:"Corn",data:{USA:{value:406.292,color:["rgb(255, 205, 210)","rgb(229, 115, 115)"]},China:{value:260,color:["rgb(255, 185, 210)","rgb(229, 95, 115)"]},Brazil:{value:107,color:["rgb(255, 165, 210)","rgb(229, 75, 115)"]},EU:{value:68.3,color:["rgb(255, 145, 210)","rgb(229, 55, 115)"]},India:{value:27.5,color:["rgb(255, 125, 210)","rgb(229, 35, 115)"]},Russia:{value:14.5,color:["rgb(255, 105, 210)","rgb(229, 15, 115)"]}}},{name:"Wheat",data:{USA:{value:51.086,color:["rgb(210, 205, 255)","rgb(115, 115, 229)"]},China:{value:136,color:["rgb(210, 185, 255)","rgb(115, 95, 229)"]},Brazil:{value:5.5,color:["rgb(210, 165, 255)","rgb(115, 75, 229)"]},EU:{value:141,color:["rgb(210, 145, 255)","rgb(115, 55, 229)"]},India:{value:107.18,color:["rgb(210, 125, 255)","rgb(115, 35, 229)"]},Russia:{value:77,color:["rgb(210, 105, 255)","rgb(115, 15, 229)"]}}}],xTitle:"Countries",yTitle:"Weight (MT)"}}}},methods:{}};const Nc=Dc;var Bc=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"bkh"},[t._m(0),t._v(" "),n("div",{staticStyle:{padding:"0px"}},[n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set & marginLeft & marginRight & marginTop & marginBottom"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a,{marginLeft:50,marginRight:50,marginTop:50,marginBottom:50})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set & roseBorderWidth"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a,{roseBorderWidth:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set & roseWidthRatio"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a,{roseWidthRatio:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set & showLegend"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a,{showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set & showLegend & legendPosition"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a,{showLegend:!0,legendPosition:"topleft"})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set(color)"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1b)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set(color, gradient)"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1c)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set & roseKpColor"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a,{roseKpColor:{USA:"#F44336",China:"#E91E63",Brazil:"#9C27B0",EU:"#673AB7",India:"#3F51B5",Russia:"#2196F3"}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set & roseKpColor(gradient)"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a,{roseKpColor:{USA:["#EF9A9A","#F44336"],China:["#F48FB1","#E91E63"],Brazil:["#CE93D8","#9C27B0"],EU:["#B39DDB","#673AB7"],India:["#9FA8DA","#3F51B5"],Russia:["#90CAF9","#2196F3"]}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"one-set & roseShowLabels"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt1a,{roseShowLabels:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2a,{roseShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set & roseBorderWidth"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2a,{roseShowLabels:!1,showLegend:!0,roseBorderWidth:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set & roseWidthRatio"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2a,{roseShowLabels:!1,showLegend:!0,roseWidthRatio:0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set(series color)"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2b,{roseShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set(series color, gradient)"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2c,{roseShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set(color)"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2d,{roseShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set(color, gradient)"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2e,{roseShowLabels:!1,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set & roseKpColor"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2a,{roseShowLabels:!1,showLegend:!0,roseKpColor:{"0.USA":"#FF8A80","1.USA":"#F44336","0.China":"#FF80AB","1.China":"#E91E63","0.Brazil":"#EA80FC","1.Brazil":"#9C27B0","0.EU":"#B388FF","1.EU":"#673AB7","0.India":"#8C9EFF","1.India":"#3F51B5","0.Russia":"#82B1FF","1.Russia":"#2196F3"}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set & roseKpColor(gradient)"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2a,{roseShowLabels:!1,showLegend:!0,roseKpColor:{"0.USA":["rgb(255, 205, 210)","rgb(229, 115, 115)"],"1.USA":["rgb(210, 205, 255)","rgb(115, 115, 229)"],"0.China":["rgb(255, 185, 210)","rgb(229, 95, 115)"],"1.China":["rgb(210, 185, 255)","rgb(115, 95, 229)"],"0.Brazil":["rgb(255, 165, 210)","rgb(229, 75, 115)"],"1.Brazil":["rgb(210, 165, 255)","rgb(115, 75, 229)"],"0.EU":["rgb(255, 145, 210)","rgb(229, 55, 115)"],"1.EU":["rgb(210, 145, 255)","rgb(115, 55, 229)"],"0.India":["rgb(255, 125, 210)","rgb(229, 35, 115)"],"1.India":["rgb(210, 125, 255)","rgb(115, 35, 229)"],"0.Russia":["rgb(255, 105, 210)","rgb(229, 15, 115)"],"1.Russia":["rgb(210, 105, 255)","rgb(115, 15, 229)"]}})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set && show labels"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2a,{roseShowLabels:!0,showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-rose",casename:"multi-set && hide legned"}}),t._v(" "),n("w-rose",{attrs:{opt:Object.assign({},t.WRose.opt2a,{roseShowLabels:!1,showLegend:!1})}})],1)])])};Bc._withStripped=!0;const Fc=oo({render:Bc,staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"head1"},[n("span",{staticStyle:{cursor:"pointer"},attrs:{title:"open for copy link to view component",onclick:"window.open('//yuda-lyu.github.io/w-plot-vue/examples/app.html?cmp='+this.innerText,'_blank')"}},[t._v("w-rose")])])}]},function(t){t&&t("data-v-59bdbdf7_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"AppZoneWRose.vue"},media:void 0})},Nc,"data-v-59bdbdf7",false,void 0,!1,ao,void 0,void 0);const zc={components:{WIcon:po,WTooltip:Ll},props:{paddingStyle:{type:Object,default:()=>({v:0,h:15})},backgroundColor:{type:String,default:"transparent"},backgroundColorHover:{type:String,default:"transparent"},backgroundColorFocus:{type:String,default:"transparent"},borderWidth:{type:Number,default:1},borderRadius:{type:Number,default:30},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorFocus:{type:String,default:"transparent"},shadow:{type:Boolean,default:!0},leftIcon:{type:String,default:""},leftIconSize:{type:Number,default:24},leftIconColor:{type:String,default:"deep-orange lighten-2"},leftIconColorHover:{type:String,default:"deep-orange lighten-1"},leftIconColorFocus:{type:String,default:"deep-orange lighten-1"},leftIconTooltip:{type:String,default:""},rightIcon:{type:String,default:""},rightIconSize:{type:Number,default:24},rightIconColor:{type:String,default:"deep-orange lighten-2"},rightIconColorHover:{type:String,default:"deep-orange lighten-2"},rightIconColorFocus:{type:String,default:"deep-orange lighten-1"},rightIconTooltip:{type:String,default:""},iconShiftOuter:{type:Number,default:-10},iconShiftInner:{type:Number,default:5},tooltipBorderRadius:{type:Number,default:4},tooltipPaddingStyle:{type:Object,default:()=>({v:5,h:8})},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},verticalAlign:{type:String,default:"center"},editable:{type:Boolean,default:!0},hovered:{type:Boolean,default:!1},focused:{type:Boolean,default:!1}},data:function(){return{hoveredTrans:!1,focusedTrans:!1}},computed:{changeParam:function(){let t=this;return t.hoveredTrans=t.hovered,t.focusedTrans=t.focused,""},useBackgroundColor:function(){let t=this,e={};return t.focusedTrans?(e["background-color"]=Fr(t.backgroundColorFocus),e):t.hoveredTrans?(e["background-color"]=Fr(t.backgroundColorHover),e):(e["background-color"]=Fr(t.backgroundColor),e)},useBorder:function(){let t=this,e={};return t.focusedTrans?(e.border=`${t.borderWidth}px solid ${Fr(t.borderColorFocus)}`,e):t.hoveredTrans?(e.border=`${t.borderWidth}px solid ${Fr(t.borderColorHover)}`,e):(e.border=`${t.borderWidth}px solid ${Fr(t.borderColor)}`,e)},useShadow:function(){let t={};return this.shadow&&(t["box-shadow"]="0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12)"),t},useLeftIconColor:function(){let t=this;return t.hoveredTrans?Fr(t.leftIconColorHover):t.focusedTrans?Fr(t.leftIconColorFocus):Fr(t.leftIconColor)},useRightIconColor:function(){let t=this;return t.hoveredTrans?Fr(t.rightIconColorHover):t.focusedTrans?Fr(t.rightIconColorFocus):Fr(t.rightIconColor)},useTitleColor:function(){let t={};return t.color=Fr(this.titleColor),t},usePadding:function(){return{padding:Qr(this.paddingStyle,{semicolon:!1})}},hasLeftIconTooltop:function(){return Ae(this.leftIconTooltip)},hasRightIconTooltop:function(){return Ae(this.rightIconTooltip)},useVerticalAlign:function(){let t=this,e={};return"center"===t.verticalAlign?e["align-items"]="center":"top"===t.verticalAlign?e["align-items"]="flex-start":"bottom"===t.verticalAlign&&(e["align-items"]="flex-end"),e}},methods:{clickIcon:function(t){let e=this;!1!==e.editable&&e.$nextTick(()=>{e.$emit("click-"+t)})},mouseenter:function(){let t=this;t.hoveredTrans=!0,t.$nextTick(()=>{t.$emit("update:hovered",!0)})},mouseleave:function(){let t=this;t.hoveredTrans=!1,t.$nextTick(()=>{t.$emit("update:hovered",!1)})}}};var Hc=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{changeParam:t.changeParam}},[n("div",{style:[{transition:"all 0.3s",display:"flex","justify-content":"flex-start","border-radius":t.borderRadius+"px",opacity:t.editable?1:.6},t.usePadding,t.useBackgroundColor,t.useBorder,t.useShadow,t.useVerticalAlign],on:{mouseenter:t.mouseenter,mouseleave:t.mouseleave}},[t.leftIcon?n("div",{style:"margin-left:"+t.iconShiftOuter+"px; margin-right:"+t.iconShiftInner+"px; user-select:none; cursor:pointer; outline:none;",attrs:{tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.clickIcon("left")},click:function(e){return t.clickIcon("left")}}},[n("WTooltip",{attrs:{displayType:"line",isolated:!0,borderRadius:t.tooltipBorderRadius,paddingStyle:t.tooltipPaddingStyle,textFontSize:t.tooltipTextFontSize,textColor:t.tooltipTextColor,backgroundColor:t.tooltipBackgroundColor,editable:t.hasLeftIconTooltop},scopedSlots:t._u([{key:"trigger",fn:function(){return[n("div",{attrs:{ShellEllipse:"leftIcon"}},[n("WIcon",{attrs:{icon:t.leftIcon,size:t.leftIconSize,color:t.useLeftIconColor,colorHover:t.useLeftIconColor}})],1)]},proxy:!0},{key:"content",fn:function(){return[t._v("\n "+t._s(t.leftIconTooltip)+"\n ")]},proxy:!0}],null,!1,3849071383)})],1):t._e(),t._v(" "),n("div",{style:[{width:"100%"}]},[t._t("default")],2),t._v(" "),t.rightIcon?n("div",{style:"margin-right:"+t.iconShiftOuter+"px; margin-left:"+t.iconShiftInner+"px; user-select:none; cursor:pointer; outline:none;",attrs:{tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.clickIcon("right")},click:function(e){return t.clickIcon("right")}}},[n("WTooltip",{attrs:{displayType:"line",isolated:!0,borderRadius:t.tooltipBorderRadius,paddingStyle:t.tooltipPaddingStyle,textFontSize:t.tooltipTextFontSize,textColor:t.tooltipTextColor,backgroundColor:t.tooltipBackgroundColor,editable:t.hasRightIconTooltop},scopedSlots:t._u([{key:"trigger",fn:function(){return[n("div",{attrs:{ShellEllipse:"rightIcon"}},[n("WIcon",{attrs:{icon:t.rightIcon,size:t.rightIconSize,color:t.useRightIconColor,colorHover:t.useRightIconColor}})],1)]},proxy:!0},{key:"content",fn:function(){return[t._v("\n "+t._s(t.rightIconTooltip)+"\n ")]},proxy:!0}],null,!1,1563142679)})],1):t._e()])])};Hc._withStripped=!0;const Wc=oo({render:Hc,staticRenderFns:[]},function(t){t&&t("data-v-fab4178a_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WShellEllipse.vue"},media:void 0})},zc,"data-v-fab4178a",false,void 0,!1,ao,void 0,void 0);const Vc={components:{WTooltip:Ll},props:{value:{type:Boolean,default:!1},displayType:{type:String,default:"block"},cmpZIndex:{type:Number,default:3e3},isolated:{type:Boolean,default:!1},minWidth:{type:Number,default:null},maxWidth:{type:Number,default:null},autoFitMinWidth:{type:Boolean,default:!1},autoFitMaxWidth:{type:Boolean,default:!1},placement:{type:String,default:"bottom-start"},placementDistX:{type:Number,default:0},placementDistY:{type:Number,default:5},borderRadius:{type:Number,default:4},textFontSize:{type:String,default:"inherit"},textColor:{type:String,default:"black"},backgroundColor:{type:String,default:"white"},paddingStyle:{type:Object,default:()=>({v:0,h:0})},modeHide:{type:String,default:"click"},shadow:{type:Boolean,default:!0},shadowStyle:{type:String,default:"0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12)"},transitionTime:{type:Number,default:200},labelContent:{type:String,default:null},editable:{type:Boolean,default:!0}},data:function(){return{}},mounted:function(){},computed:{},methods:{}};var Gc=function(){var t=this,e=t.$createElement;return(t._self._c||e)("WTooltip",t._g(t._b({scopedSlots:t._u([{key:"trigger",fn:function(){return[t._t("trigger")]},proxy:!0},{key:"content",fn:function(e){return[t._t("content",null,{funHide:e.funHide})]}}],null,!0)},"WTooltip",Object.assign({},t.$props,{mode:"popup"}),!1),t.$listeners))};Gc._withStripped=!0;const jc=oo({render:Gc,staticRenderFns:[]},function(t){t&&t("data-v-fc4fb814_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WPopup.vue"},media:void 0})},Vc,"data-v-fc4fb814",false,void 0,!1,ao,void 0,void 0);function Xc(t,e,n={}){let i=!1,r="";if("isstr"===e)Te(t)||(i=!0,r="需要為字串",t="");else if("isnum"===e)Fe(t)||(i=!0,r="需要為數字",t=0);else if("isp0num"===e)Fe(o=t)&&ze(o)>=0||(i=!0,r="需要為含0的正浮點數",t=0);else if("isn0num"===e)(function(t){return!!Fe(t)&&ze(t)<=0})(t)||(i=!0,r="需要為含0的負浮點數",t=0);else if("isint"===e)He(t)||(i=!0,r="需要為整數",t=0);else if("ispint"===e)zi(t)||(i=!0,r="需要為不含0正整數",t=0);else if("isp0int"===e)$e(t)||(i=!0,r="需要為含0正整數",t=0);else if("isnint"===e)(function(t){return!!He(t)&&Xe(t)<0})(t)||(i=!0,r="需要為不含0負整數",t=0);else if("isn0int"===e)(function(t){return!!He(t)&&Xe(t)<=0})(t)||(i=!0,r="需要為含0負整數",t=0);else if("custom"===e){let e=st(n,"funCustom");if(!Lr(e))throw new Error("invalid opt.funCustom when type='custom'");let o=e(t);if(!Kr(o.err))throw new Error("invalid return.err for type='custom'");if(o.err&&!Ae(o.errmsg))throw new Error("invalid return.errmsg when return.err=true for type='custom'");if(!Fe(o.value)&!Te(o.value))throw new Error("invalid return.value for type='custom'");i=o.err,r=o.errmsg,t=o.value}else if(Lr(e)){t=e(t)}else"any"===e?Fe(t)||Te(t)||(i=!0,r="需要為字串或數字",t=""):(i=!0,r="需要指定驗證類型",t=null);var o;return{value:t,err:i,errmsg:r}}const $c={props:{type:{type:String,default:"any"},funVerify:{type:Function,default:null},value:{type:[String,Number],default:""},textFontSize:{type:String,default:"1rem"},textColor:{type:String,default:"black"},textAlign:{type:String,default:"left"},placeholder:{type:String,default:""},height:{type:[Number,String],default:""},password:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},focused:{type:Boolean,default:!1}},data:function(){return{valueTrans:"",errmsg:""}},mounted:function(){},computed:{changeValue:function(){return this.valueTrans=this.value,""},useHeight:function(){let t=this,e="";return Fe(t.height)?e=`height:${t.height}px;`:Ae(t.height)&&(e=`height:${t.height}; line-height:${t.height};`),e},useTextFontSize:function(){let t=this.textFontSize;return t=zr(t,";",""),`font-size:${t};`},useTextColor:function(){return Fr(this.textColor)}},methods:{setValue:function(t){this.valueTrans=t},setFocus:function(){this.$refs.inp.focus()},updateFocused:function(t){let e=this;e.focused!==t&&e.$nextTick(()=>{e.$emit("update:focused",t)})},updateValue:function(t){let e=this,n=Xc(e.valueTrans,e.type,{funCustom:e.funVerify});e.valueTrans=n.value,e.errmsg=n.errmsg},trigger:function(t,e){let n=this;n.$nextTick(()=>{n.$emit(t,n.valueTrans,n.errmsg,e)})}}};var Yc=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{changeValue:t.changeValue}},["checkbox"==(t.password?"password":"text")?n("input",{directives:[{name:"model",rawName:"v-model",value:t.valueTrans,expression:"valueTrans"}],ref:"inp",style:"transition:all 0.3s; display:block; outline:none; width:100%; box-sizing:border-box; border-style:none; background:transparent; color:"+t.useTextColor+"; "+t.useHeight+" text-align:"+t.textAlign+"; "+t.useTextFontSize+" opacity:"+(""!==t.valueTrans||t.focused?1:.6)+";",attrs:{readonly:!t.editable,placeholder:t.placeholder,type:"checkbox"},domProps:{checked:Array.isArray(t.valueTrans)?t._i(t.valueTrans,null)>-1:t.valueTrans},on:{input:function(e){t.updateValue(e),t.trigger("input",e),t.updateFocused(!0)},change:[function(e){var n=t.valueTrans,i=e.target,r=!!i.checked;if(Array.isArray(n)){var o=t._i(n,null);i.checked?o<0&&(t.valueTrans=n.concat([null])):o>-1&&(t.valueTrans=n.slice(0,o).concat(n.slice(o+1)))}else t.valueTrans=r},function(e){t.trigger("change",e)}],focus:function(e){return t.updateFocused(!0)},blur:function(e){t.trigger("blur",e),t.updateFocused(!1)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:function(e){t.trigger("enter",e)}.apply(null,arguments)},select:function(e){t.trigger("select",e)}}}):"radio"==(t.password?"password":"text")?n("input",{directives:[{name:"model",rawName:"v-model",value:t.valueTrans,expression:"valueTrans"}],ref:"inp",style:"transition:all 0.3s; display:block; outline:none; width:100%; box-sizing:border-box; border-style:none; background:transparent; color:"+t.useTextColor+"; "+t.useHeight+" text-align:"+t.textAlign+"; "+t.useTextFontSize+" opacity:"+(""!==t.valueTrans||t.focused?1:.6)+";",attrs:{readonly:!t.editable,placeholder:t.placeholder,type:"radio"},domProps:{checked:t._q(t.valueTrans,null)},on:{input:function(e){t.updateValue(e),t.trigger("input",e),t.updateFocused(!0)},change:[function(e){t.valueTrans=null},function(e){t.trigger("change",e)}],focus:function(e){return t.updateFocused(!0)},blur:function(e){t.trigger("blur",e),t.updateFocused(!1)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:function(e){t.trigger("enter",e)}.apply(null,arguments)},select:function(e){t.trigger("select",e)}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.valueTrans,expression:"valueTrans"}],ref:"inp",style:"transition:all 0.3s; display:block; outline:none; width:100%; box-sizing:border-box; border-style:none; background:transparent; color:"+t.useTextColor+"; "+t.useHeight+" text-align:"+t.textAlign+"; "+t.useTextFontSize+" opacity:"+(""!==t.valueTrans||t.focused?1:.6)+";",attrs:{readonly:!t.editable,placeholder:t.placeholder,type:t.password?"password":"text"},domProps:{value:t.valueTrans},on:{input:[function(e){e.target.composing||(t.valueTrans=e.target.value)},function(e){t.updateValue(e),t.trigger("input",e),t.updateFocused(!0)}],change:function(e){t.trigger("change",e)},focus:function(e){return t.updateFocused(!0)},blur:function(e){t.trigger("blur",e),t.updateFocused(!1)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:function(e){t.trigger("enter",e)}.apply(null,arguments)},select:function(e){t.trigger("select",e)}}})])};Yc._withStripped=!0;const qc=oo({render:Yc,staticRenderFns:[]},function(t){t&&t("data-v-261fd450_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WTextCore.vue"},media:void 0})},$c,"data-v-261fd450",false,void 0,!1,ao,void 0,void 0);function Zc(t){return null==t?[]:function(t,e){return J(e,function(e){return t[e]})}(t,be(t))}function Kc(t,e){if(!io(t))return[];if(!Ae(e)&&!io(e))return[];let n=null;n=Ae(e)?Lo(e," "):e;let i=Ui(n);return gi(t,t=>function(t){let e=!1,r=0;for(let o=0;o<i;o++){let s=n[o],a=s,l="+"===qe(s,1),c="-"===qe(s,1);if((l||c)&&(a=$o(s,1)),""===Mo(a))continue;let h=t.indexOf(a)>=0;if(l){if(h){e=!0,r=1;break}e=!1,r=0;break}if(c){if(h){e=!1,r=0;break}e=!0,r=1;break}if(h){e=!0;let t=1-o/i;t=t**2,r+=t}}return{hasKeyword:e,weight:r}}(t))}function Jc(t=300){return new function(t){let e=[],n=null,i=Date.now();return zi(t)||(t=300),t=Xe(t),function(r,...o){Lr(r)?(i=Date.now(),e.push({func:r,input:o}),null===n&&(n=setInterval(()=>{if(0===Ui(e))return clearInterval(n),void(n=null);if(Date.now()-i>t){let t=e.pop();e=[];try{t.func(...t.input)}catch(t){console.log("m.func catch",t)}}},10))):console.log("func is not a function")}}(t)}let Qc=function(t){if(!Lr(t))throw new Error("fn is not a function");return function(){let e=Io(),n=null,i=null;try{n=t.apply(this,arguments)}catch(t){i=t}return null!==i?e.resolve({state:"error",msg:i}):Fl(n)?n.then(t=>{e.resolve({state:"success",msg:t})}).catch(t=>{"cancelled"===st(t,"reason")?e.resolve({state:"cancelled",msg:""}):e.resolve({state:"error",msg:t})}):e.resolve({state:"success",msg:n}),e}};function th(){let t=Pr(),e=[],n=null,i=!1;return function(r,...o){let s=Io();if(!Lr(r))return void console.log("func is not a function");let a=Vi();return e.push({id:a,func:r,input:o}),null===n&&(n=setInterval(async()=>{if(i)return;i=!0;let r=e.pop();for(let n=0;n<e.length;n++){let i=e[n].id,r={state:"cancelled"};t.emit(i,r)}if(e=[],r){let e,n=r.id;e=Lr(r.func)?await Qc(r.func)(...r.input):{state:"error",msg:"fun is not a function"},t.emit(n,e)}i=!1,i||0!==e.length||(clearInterval(n),n=null)},20)),t.once(a,t=>{"success"===t.state?s.resolve(t.msg):"cancelled"===t.state?s.reject({reason:"cancelled"}):s.reject(t.msg)}),s}}function eh(t,e,n){for(var i=-1,r=t.length;++i<r;){var o=t[i],s=e(o);if(null!=s&&(void 0===a?s==s&&!f(s):n(s,a)))var a=s,l=o}return l}function nh(t,e){return t>e}function ih(t,e){return t&&t.length?eh(t,fi(e),nh):void 0}function rh(t,e){let n=Ui(t),i=0,r=e(i),o=n-1,s=e(o),a=!0,l=null;for(;a;){let t=Math.floor((o+i)/2),n=e(t);if(r<0&&n<0&&s<0){l=null,a=!1;break}if(r>0&&n>0&&s>0){l=null,a=!1;break}if(0===r){l=i,a=!1;break}if(0===n){l=t,a=!1;break}if(0===s){l=o,a=!1;break}if(t===i||t===o){let e=[{i:i,v:r},{i:t,v:n},{i:o,v:s}];e=Ao(e,t=>t.v<=0),l=ih(e,"v").i,a=!1;break}r*n>0?(i=t,r=n):(o=t,s=n)}return l}let oh={};function sh(){return!function(){try{return"IntersectionObserver"in window}catch(t){return!1}}()||!function(){try{return"IntersectionObserverEntry"in window}catch(t){return!1}}()||!(function(){try{return"intersectionRatio"in window.IntersectionObserverEntry.prototype}catch(t){return!1}}()||Lr(window.IntersectionObserverEntry))}function ah(t,e={}){if(!Yr(t))return Promise.reject("invalid element");if(sh())return Promise.reject("invalid IntersectionObserver");let n=st(e,"mode","");"promise"!==n&&"event"!==n&&(n="promise");let i=()=>{let e=Pr(),n=!1,i=null,r=!1,o=new IntersectionObserver(t=>{if(r)return;let n=t[0].isIntersecting;e.emit("visible",n)});return e.create=()=>{i=setInterval(()=>{r?clearInterval(i):(n=(t=>{let e=!1;if(!Yr(t))return e;try{o.observe(t),e=!0}catch(t){}return e})(t),n&&clearInterval(i))},50)},e.dispose=()=>{let t=!1;try{clearInterval(i),o.disconnect(),r=!0,t=!0}catch(t){}return t},e},r=null;return"promise"===n?r=(()=>{let e=Io();try{let n=new IntersectionObserver(t=>{e.resolve(t[0].isIntersecting),n.disconnect()});n.observe(t)}catch(t){e.reject(t)}return e})():"event"===n&&(r=i()),r}const lh={directives:{domresize:Ir(),dommutation:function(){let t={};return{bind:function(e,n,i){let r=`r${Vi()}`;e.setAttribute("ev-mutation",r);let o=new MutationObserver(function(t){!function(t,e,n){let i=t.data&&t.data.on||t.componentOptions&&t.componentOptions.listeners;i&&i[e]&&i[e].fns(n)}(i,"dommutation",{ele:e,mutations:t})});o.observe(e,{attributes:!0,childList:!0,subtree:!0}),t[r]=o},unbind:function(e){let n=e.getAttribute("ev-mutation");e.setAttribute("ev-mutation",null),t[n]&&(t[n].disconnect(),delete t[n])}}}(),domvisible:function(){let t={};return{bind:function(e,n,i){let r=`r${Vi()}`;e.setAttribute("ev-visible",r);let o=!1,s=setInterval(()=>{ah(e).then(t=>{o!==t&&(o=t,function(t,e,n){let i=t.data&&t.data.on||t.componentOptions&&t.componentOptions.listeners;i&&i[e]&&i[e].fns(n)}(i,"domvisible",t))}).catch(()=>{})},50);t[r]=s},unbind:function(e){let n=e.getAttribute("ev-visible");e.setAttribute("ev-visible",null),t[n]&&(clearInterval(t[n]),t[n]=null,delete t[n])}}}()},components:{},props:{viewHeightMax:{type:Number,default:400},scrollTop:{type:Number,default:0},barOpacity:{type:Number,default:.6},barOpacityHover:{type:Number,default:1}},data:function(){return{dbc:Jc(),nativeBarWidth:16,useEmitEvent:!0,mouseEntering:!1,mouseLoc:"",viewHeight:0,contentHeight:2,ratio:0,scrollInfor:null}},computed:{changeScrollTop:function(){return this.updateScrollTop(this.scrollTop),""},panelHeight:function(){return Math.min(this.contentHeight,this.viewHeightMax)},isMobile:function(){return this.nativeBarWidth<=0},contentHeightEff:function(){return Math.max(this.contentHeight-this.panelHeight,0)},viewTop:function(){return this.ratio*this.contentHeightEff},viewBottom:function(){return this.viewTop+this.viewHeightMax}},methods:{resizePanel:function(t){let e=this,n=st(e,"$refs.divDetect");if(n){let t=n.offsetWidth-n.clientWidth;e.nativeBarWidth!==t&&(e.nativeBarWidth=t)}e.viewHeight!==t.snew.offsetHeight&&(e.viewHeight=t.snew.offsetHeight);let i=st(e,"$refs.divShell");i&&e.$emit("update:scrollTop",i.scrollTop),e.triggerEvent("resize",{...t,from:"panel"})},resizeShell:function(t){let e=this,n=st(e,"$refs.divContent");n&&0!==n.offsetHeight&&e.contentHeight!==n.offsetHeight&&(e.contentHeight=n.offsetHeight);let i=st(e,"$refs.divShell");i&&e.$emit("update:scrollTop",i.scrollTop),e.triggerEvent("resize",{...t,from:"shell"})},mutation:function(t){let e=this,n=st(e,"$refs.divContent");n&&0!==n.offsetHeight&&e.contentHeight!==n.offsetHeight&&(e.contentHeight=n.offsetHeight),e.updateRatio(),e.triggerEvent("mutation",{...t,from:"content"})},visible:function(t){let e=this,n=st(e,"$refs.divContent");n&&0!==n.offsetHeight&&e.contentHeight!==n.offsetHeight&&(e.contentHeight=n.offsetHeight),e.updateRatio(),e.triggerEvent("visible",{visible:t,from:"content"})},updateRatio:function(){let t=this;if(!t.$refs.divShell)return;let e=0;t.contentHeightEff>0&&(e=t.$refs.divShell.scrollTop/t.contentHeightEff),t.ratio=e},updateScrollTop:function(t){let e=this;(async function(){await zl(()=>void 0!==e.$refs.divShell&&void 0!==e.$refs.divBar,{timeInterval:20}),e.$refs.divShell&&(e.$refs.divShell.scrollTop=t),e.$refs.divBar&&(e.$refs.divBar.scrollTop=t)})().catch(t=>{console.log(t)})},updateScrollInfor:function(){let t=this;if(!t.$refs.divShell)return;let e={r:t.ratio,sti:t.scrollTop,stn:t.$refs.divShell.scrollTop,dir:t.scrollTop>t.$refs.divShell.scrollTop?"up":"down",t:t.viewTop,b:t.viewBottom,ch:t.contentHeight,che:t.contentHeightEff};Bi(t.scrollInfor,e)||(t.scrollInfor=e)},scrollShell:function(t){let e=this;""===e.mouseLoc&&(e.mouseLoc="enter shell"),"enter shell"===e.mouseLoc&&st(e,"$refs.divShell")&&st(e,"$refs.divBar")&&(e.$refs.divBar.scrollTop=e.$refs.divShell.scrollTop,e.$emit("update:scrollTop",e.$refs.divShell.scrollTop),e.updateRatio(),e.triggerEvent("scroll",{ev:t,from:"shell"}),e.dbc(()=>{e.mouseLoc=""}))},scrollBar:function(t){let e=this;""===e.mouseLoc&&(e.mouseLoc="enter bar"),"enter bar"===e.mouseLoc&&st(e,"$refs.divShell")&&st(e,"$refs.divBar")&&(e.$refs.divShell.scrollTop=e.$refs.divBar.scrollTop,e.$emit("update:scrollTop",e.$refs.divShell.scrollTop),e.updateRatio(),e.triggerEvent("scroll",{ev:t,from:"bar"}),e.dbc(()=>{e.mouseLoc=""}))},triggerEvent:function(t,e){let n=this;n.useEmitEvent&&(n.$emit(t,e),n.updateScrollInfor(),n.$emit("change-infor",{evName:t,evMsg:e,...n.scrollInfor}))}}};var ch=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],style:"box-sizing:content-box;",attrs:{changeScrollTop:t.changeScrollTop},on:{domresize:t.resizePanel,mouseenter:function(e){t.mouseEntering=!0},mouseleave:function(e){t.mouseEntering=!1}}},[n("div",{staticStyle:{position:"relative",width:"0px",height:"0px",opacity:"0"}},[n("div",{staticStyle:{position:"absolute",left:"0",top:"0"}},[n("div",{ref:"divDetect",staticStyle:{width:"50px",height:"50px",overflow:"scroll"}},[n("div",{staticStyle:{width:"100px",height:"100px"}})])])]),t._v(" "),n("div",{style:"position:relative; width:100%; overflow-x:hidden;"},[n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],ref:"divShell",style:"\n position:relative;\n width:calc( 100% + "+(t.nativeBarWidth+1)+"px ); height:"+t.panelHeight+"px;\n box-sizing:content-box;\n overflow-x:hidden; overflow-y:scroll;\n ",on:{domresize:t.resizeShell,scroll:t.scrollShell}},[n("div",{directives:[{name:"dommutation",rawName:"v-dommutation"},{name:"domvisible",rawName:"v-domvisible"}],ref:"divContent",style:"",on:{dommutation:t.mutation,domvisible:t.visible}},[t._t("default")],2)]),t._v(" "),n("div",{style:"\n position:absolute; top:0px; right:"+(t.isMobile?-8:0)+"px;\n width:"+(t.contentHeightEff>0?8:0)+"px;\n overflow-x:hidden;\n "},[n("div",{ref:"divBar",staticClass:"sb",style:"\n width:8px; height:"+t.panelHeight+"px;\n box-sizing:content-box;\n overflow-x:hidden; overflow-y:auto;\n opacity:"+(t.mouseEntering?t.barOpacityHover:t.barOpacity)+";\n ",on:{scroll:t.scrollBar}},[n("div",{style:"width:1px; height:"+t.contentHeight+"px;"})])])])])};ch._withStripped=!0;let hh={set:function(t,e){oh[t]=e},get:function(t){return oh[t]},remove:function(t){delete oh[t]}};const uh={components:{WPanelScrollyCore:oo({render:ch,staticRenderFns:[]},function(t){t&&t("data-v-f9b1bfb2_0",{source:"\n.sb[data-v-f9b1bfb2] {\r\n transition: opacity 0.3s;\r\n /* Works on Firefox */\r\n scrollbar-width: thin;\r\n scrollbar-color: rgba(0,0,0,0.3) transparent;\n}\r\n/* Works on Chrome, Edge, and Safari */\n.sb[data-v-f9b1bfb2]::-webkit-scrollbar {\r\n width: 8px;\r\n height: 8px;\n}\n.sb[data-v-f9b1bfb2]::-webkit-scrollbar-track {\r\n background: transparent;\n}\n.sb[data-v-f9b1bfb2]::-webkit-scrollbar-thumb {\r\n background: rgba(0,0,0,0.3);\r\n border-radius: 20px;\r\n border: 3px solid transparent;\n}\r\n",map:{version:3,sources:["C:\\opensrc\\開源-JS-106-7-w-plot-vue\\w-plot-vue\\node_modules\\w-component-vue\\src\\components\\WPanelScrollyCore.vue"],names:[],mappings:";AAujBA;IACA,wBAAA;IACA,qBAAA;IACA,qBAAA;IACA,4CAAA;AACA;AACA,sCAAA;AACA;IACA,UAAA;IACA,WAAA;AACA;AACA;IACA,uBAAA;AACA;AACA;IACA,2BAAA;IACA,mBAAA;IACA,6BAAA;AACA",file:"WPanelScrollyCore.vue",sourcesContent:["<template>\r\n <div\r\n :style=\"`box-sizing:content-box;`\"\r\n v-domresize\r\n @domresize=\"resizePanel\"\r\n @mouseenter=\"mouseEntering=true\"\r\n @mouseleave=\"mouseEntering=false\"\r\n :changeScrollTop=\"changeScrollTop\"\r\n >\r\n\r\n \x3c!-- 計算nativeBarWidth, 需使用overflow:scroll否則firefox無法順利顯示右側捲軸 --\x3e\r\n <div style=\"position:relative; width:0px; height:0px; opacity:0;\">\r\n <div style=\"position:absolute; left:0; top:0;\">\r\n <div ref=\"divDetect\" style=\"width:50px; height:50px; overflow:scroll;\">\r\n <div style=\"width:100px; height:100px;\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div\r\n :style=\"`position:relative; width:100%; overflow-x:hidden;`\"\r\n >\r\n\r\n \x3c!-- 因瀏覽器計算誤差100%+nativeBarWidth仍會出現捲軸邊界, 故需+1px使捲軸能完全隱藏 --\x3e\r\n <div\r\n ref=\"divShell\"\r\n :style=\"`\r\n position:relative;\r\n width:calc( 100% + ${nativeBarWidth+1}px ); height:${panelHeight}px;\r\n box-sizing:content-box;\r\n overflow-x:hidden; overflow-y:scroll;\r\n `\"\r\n v-domresize\r\n @domresize=\"resizeShell\"\r\n @scroll=\"scrollShell\"\r\n >\r\n\r\n <div\r\n ref=\"divContent\"\r\n :style=\"``\"\r\n v-dommutation\r\n @dommutation=\"mutation\"\r\n v-domvisible\r\n @domvisible=\"visible\"\r\n >\r\n <slot></slot>\r\n </div>\r\n\r\n </div>\r\n\r\n \x3c!-- isMobile時divBar仍要存在, 因通用檢測時才會有效, 故isMobile時需於移至右側之外 --\x3e\r\n <div :style=\"`\r\n position:absolute; top:0px; right:${isMobile?-8:0}px;\r\n width:${contentHeightEff>0?8:0}px;\r\n overflow-x:hidden;\r\n `\">\r\n\r\n <div\r\n ref=\"divBar\"\r\n class=\"sb\"\r\n :style=\"`\r\n width:8px; height:${panelHeight}px;\r\n box-sizing:content-box;\r\n overflow-x:hidden; overflow-y:auto;\r\n opacity:${mouseEntering?barOpacityHover:barOpacity};\r\n `\"\r\n @scroll=\"scrollBar\"\r\n >\r\n\r\n <div :style=\"`width:1px; height:${contentHeight}px;`\"></div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport get from 'lodash-es/get.js'\r\nimport isEqual from 'lodash-es/isEqual.js'\r\n// import cloneDeep from 'lodash-es/cloneDeep.js'\r\nimport waitFun from 'wsemi/src/waitFun.mjs'\r\nimport debounce from 'wsemi/src/debounce.mjs'\r\nimport domResize from '../js/domResize.mjs'\r\nimport domMutation from '../js/domMutation.mjs'\r\nimport domVisible from '../js/domVisible.mjs'\r\n\r\n\r\n/**\r\n * @vue-prop {Number} [viewHeightMax=400] 輸入顯示區最大高度,單位為px,預設400\r\n * @vue-prop {Number} [scrollTop=0] 輸入目前捲動值數字,預設0\r\n * @vue-prop {Number} [barOpacity=0.6] 輸入捲軸透明度數字,預設0.6\r\n * @vue-prop {Number} [barOpacityHover=1] 輸入滑鼠移入時捲軸透明度數字,預設1\r\n */\r\nexport default {\r\n directives: {\r\n domresize: domResize(),\r\n dommutation: domMutation(),\r\n domvisible: domVisible(),\r\n },\r\n components: {\r\n },\r\n props: {\r\n viewHeightMax: {\r\n type: Number,\r\n default: 400,\r\n },\r\n scrollTop: {\r\n type: Number,\r\n default: 0,\r\n },\r\n barOpacity: {\r\n type: Number,\r\n default: 0.6,\r\n },\r\n barOpacityHover: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n data: function() {\r\n return {\r\n dbc: debounce(),\r\n\r\n nativeBarWidth: 16, //預設bar寬度, 先給大值避免初始化時會顯示原本bar條\r\n\r\n useEmitEvent: true, //是否可觸發事件\r\n mouseEntering: false,\r\n mouseLoc: '',\r\n\r\n viewHeight: 0, //外框區高度px\r\n contentHeight: 2, //內容區高度px, 一定要給>=2值(至少可能渲染2border)才能避免初始化無高度導致無法觸發後續事件\r\n\r\n ratio: 0,\r\n scrollInfor: null,\r\n\r\n }\r\n },\r\n computed: {\r\n\r\n changeScrollTop: function () {\r\n //console.log('computed changeScrollTop')\r\n\r\n let vo = this\r\n\r\n //updateScrollTop\r\n vo.updateScrollTop(vo.scrollTop)\r\n\r\n return ''\r\n },\r\n\r\n panelHeight: function () {\r\n //console.log('computed panelHeight')\r\n\r\n let vo = this\r\n\r\n return Math.min(vo.contentHeight, vo.viewHeightMax)\r\n },\r\n\r\n isMobile: function() {\r\n //console.log('computed isMobile')\r\n\r\n let vo = this\r\n\r\n return vo.nativeBarWidth <= 0\r\n },\r\n\r\n contentHeightEff: function() {\r\n let vo = this\r\n return Math.max(vo.contentHeight - vo.panelHeight, 0)\r\n },\r\n\r\n viewTop: function() {\r\n let vo = this\r\n return vo.ratio * vo.contentHeightEff\r\n },\r\n\r\n viewBottom: function() {\r\n let vo = this\r\n return vo.viewTop + vo.viewHeightMax\r\n },\r\n\r\n },\r\n methods: {\r\n\r\n resizePanel: function(msg) {\r\n // console.log('methods resizePanel', msg)\r\n\r\n let vo = this\r\n\r\n //nativeBarWidth\r\n let divDetect = get(vo, '$refs.divDetect')\r\n if (divDetect) {\r\n\r\n //save nativeBarWidth\r\n let w = divDetect.offsetWidth - divDetect.clientWidth\r\n if (vo.nativeBarWidth !== w) {\r\n // console.log('resizePanel 需更新nativeBarWidth', w, '<-', vo.nativeBarWidth)\r\n vo.nativeBarWidth = w\r\n }\r\n\r\n }\r\n\r\n //save\r\n if (vo.viewHeight !== msg.snew.offsetHeight) {\r\n // console.log('resizePanel 需更新viewHeight', msg.snew.offsetHeight, '<-', vo.viewHeight)\r\n vo.viewHeight = msg.snew.offsetHeight\r\n }\r\n\r\n //divShell\r\n let divShell = get(vo, '$refs.divShell')\r\n if (divShell) {\r\n\r\n //emit scrollTop\r\n vo.$emit('update:scrollTop', divShell.scrollTop)\r\n\r\n }\r\n\r\n //emit\r\n vo.triggerEvent('resize', { ...msg, from: 'panel' })\r\n\r\n },\r\n\r\n resizeShell: function(msg) {\r\n // console.log('methods resizeShell', msg)\r\n\r\n let vo = this\r\n\r\n //divContent\r\n let divContent = get(vo, '$refs.divContent')\r\n if (divContent) {\r\n // console.log('resizeShell divContent.offsetHeight', divContent.offsetHeight)\r\n\r\n //check, 若為隱藏則不偵測與更新\r\n if (divContent.offsetHeight !== 0 && vo.contentHeight !== divContent.offsetHeight) {\r\n // console.log('resizeShell 需更新contentHeight', divContent.offsetHeight, '<-', vo.contentHeight)\r\n vo.contentHeight = divContent.offsetHeight\r\n }\r\n\r\n }\r\n\r\n //divShell\r\n let divShell = get(vo, '$refs.divShell')\r\n if (divShell) {\r\n\r\n //emit scrollTop\r\n vo.$emit('update:scrollTop', divShell.scrollTop)\r\n\r\n }\r\n\r\n //emit\r\n vo.triggerEvent('resize', { ...msg, from: 'shell' })\r\n\r\n },\r\n\r\n mutation: function(msg) {\r\n // console.log('methods mutation', msg)\r\n\r\n let vo = this\r\n\r\n //divContent\r\n let divContent = get(vo, '$refs.divContent')\r\n if (divContent) {\r\n // console.log('mutation divContent.offsetHeight', divContent.offsetHeight)\r\n\r\n //check, 若為隱藏則不偵測與更新\r\n if (divContent.offsetHeight !== 0 && vo.contentHeight !== divContent.offsetHeight) {\r\n // console.log('mutation 需更新contentHeight', divContent.offsetHeight, '<-', vo.contentHeight)\r\n vo.contentHeight = divContent.offsetHeight\r\n }\r\n\r\n }\r\n\r\n //updateRatio\r\n vo.updateRatio()\r\n\r\n //emit\r\n vo.triggerEvent('mutation', { ...msg, from: 'content' })\r\n\r\n },\r\n\r\n visible: function(v) {\r\n // console.log('methods visible', v)\r\n\r\n let vo = this\r\n\r\n //divContent\r\n let divContent = get(vo, '$refs.divContent')\r\n if (divContent) {\r\n // console.log('visible divContent.offsetHeight', divContent.offsetHeight)\r\n\r\n //check, 若為隱藏則不偵測與更新\r\n if (divContent.offsetHeight !== 0 && vo.contentHeight !== divContent.offsetHeight) {\r\n // console.log('visible 需更新contentHeight', divContent.offsetHeight, '<-', vo.contentHeight)\r\n vo.contentHeight = divContent.offsetHeight\r\n }\r\n\r\n }\r\n\r\n //updateRatio\r\n vo.updateRatio()\r\n\r\n //emit\r\n vo.triggerEvent('visible', { visible: v, from: 'content' })\r\n\r\n },\r\n\r\n updateRatio: function() {\r\n // console.log('methods updateRatio')\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.$refs.divShell) { //於async中組件切換時還是有可能消失\r\n return\r\n }\r\n\r\n //ratio\r\n let ratio = 0\r\n if (vo.contentHeightEff > 0) {\r\n ratio = vo.$refs.divShell.scrollTop / vo.contentHeightEff\r\n }\r\n\r\n //save\r\n vo.ratio = ratio\r\n\r\n },\r\n\r\n // updateScrollTopByRatio: function(r) {\r\n // // console.log('methods updateScrollTopByRatio', r)\r\n\r\n // let vo = this\r\n\r\n // //divShell\r\n // let divShell = get(vo, '$refs.divShell')\r\n\r\n // //check\r\n // if (!divShell) {\r\n // return\r\n // }\r\n\r\n // //divBar\r\n // let divBar = get(vo, '$refs.divBar')\r\n\r\n // //check\r\n // if (!divBar) {\r\n // return\r\n // }\r\n\r\n // //scrollTop\r\n // let h = vo.contentHeight - vo.panelHeight\r\n // let scrollTop = 0\r\n // if (h > 0) {\r\n // scrollTop = r * h\r\n // }\r\n\r\n // //update scrollTop\r\n // vo.$refs.divShell.scrollTop = scrollTop\r\n // vo.$refs.divBar.scrollTop = scrollTop\r\n\r\n // },\r\n\r\n updateScrollTop: function(scrollTop) {\r\n // console.log('methods updateScrollTop', scrollTop)\r\n\r\n let vo = this\r\n\r\n async function core() {\r\n\r\n //wait divShell與divBar, 組件初始化時會先觸發computed才會有實體元素出現, 故得用waitFun等待\r\n await waitFun(() => {\r\n return vo.$refs.divShell !== undefined && vo.$refs.divBar !== undefined\r\n }, { timeInterval: 20 })\r\n\r\n //update scrollTop\r\n if (vo.$refs.divShell) { //於async中組件切換時還是有可能消失\r\n vo.$refs.divShell.scrollTop = scrollTop\r\n }\r\n if (vo.$refs.divBar) { //於async中組件切換時還是有可能消失\r\n vo.$refs.divBar.scrollTop = scrollTop\r\n }\r\n\r\n }\r\n\r\n //core\r\n core()\r\n .catch((err) => {\r\n console.log(err)\r\n })\r\n\r\n },\r\n\r\n updateScrollInfor: function() {\r\n //console.log('methods updateScrollInfor')\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.$refs.divShell) { //於async中組件切換時還是有可能消失\r\n return\r\n }\r\n\r\n //scrollInfor\r\n let scrollInfor = {\r\n r: vo.ratio,\r\n sti: vo.scrollTop, //輸入給予scrollTop\r\n stn: vo.$refs.divShell.scrollTop, //目前scrollTop, 要等emit scrollTop出去後才會與sti同值\r\n dir: vo.scrollTop > vo.$refs.divShell.scrollTop ? 'up' : 'down', //判斷是往上還往下捲\r\n t: vo.viewTop,\r\n b: vo.viewBottom,\r\n ch: vo.contentHeight,\r\n che: vo.contentHeightEff,\r\n // ph: vo.panelHeight,\r\n }\r\n\r\n //save\r\n if (!isEqual(vo.scrollInfor, scrollInfor)) {\r\n vo.scrollInfor = scrollInfor\r\n }\r\n\r\n },\r\n\r\n scrollShell: function(ev) {\r\n // console.log('methods scrollShell', ev)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (vo.mouseLoc === '') {\r\n vo.mouseLoc = 'enter shell'\r\n }\r\n if (vo.mouseLoc !== 'enter shell') {\r\n return\r\n }\r\n // console.log('scrollShell')\r\n\r\n //divShell\r\n let divShell = get(vo, '$refs.divShell')\r\n\r\n //check\r\n if (!divShell) {\r\n return\r\n }\r\n\r\n //divBar\r\n let divBar = get(vo, '$refs.divBar')\r\n\r\n //check\r\n if (!divBar) {\r\n return\r\n }\r\n\r\n //sync divBar\r\n vo.$refs.divBar.scrollTop = vo.$refs.divShell.scrollTop\r\n\r\n //emit scrollTop\r\n vo.$emit('update:scrollTop', vo.$refs.divShell.scrollTop)\r\n\r\n //updateRatio\r\n vo.updateRatio()\r\n\r\n //emit\r\n vo.triggerEvent('scroll', { ev, from: 'shell' })\r\n\r\n // //updateScrollInfor\r\n // vo.updateScrollInfor()\r\n\r\n // //emit\r\n // vo.triggerEvent('scroll-infor', { ...vo.scrollInfor, from: 'shell' })\r\n\r\n //clear mouseLoc\r\n vo.dbc(() => {\r\n // console.log('scrollShell clear mouseLoc')\r\n vo.mouseLoc = ''\r\n })\r\n\r\n },\r\n\r\n scrollBar: function(ev) {\r\n // console.log('methods scrollBar', ev)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (vo.mouseLoc === '') {\r\n vo.mouseLoc = 'enter bar'\r\n }\r\n if (vo.mouseLoc !== 'enter bar') {\r\n return\r\n }\r\n // console.log('scrollBar')\r\n\r\n //divShell\r\n let divShell = get(vo, '$refs.divShell')\r\n\r\n //check\r\n if (!divShell) {\r\n return\r\n }\r\n\r\n //divBar\r\n let divBar = get(vo, '$refs.divBar')\r\n\r\n //check\r\n if (!divBar) {\r\n return\r\n }\r\n\r\n //sync divShell\r\n vo.$refs.divShell.scrollTop = vo.$refs.divBar.scrollTop\r\n\r\n //emit scrollTop\r\n vo.$emit('update:scrollTop', vo.$refs.divShell.scrollTop)\r\n\r\n //updateRatio\r\n vo.updateRatio()\r\n\r\n //emit\r\n vo.triggerEvent('scroll', { ev, from: 'bar' })\r\n\r\n // //updateScrollInfor\r\n // vo.updateScrollInfor()\r\n\r\n // //emit\r\n // vo.triggerEvent('scroll-infor', { ...vo.scrollInfor, from: 'bar' })\r\n\r\n //clear mouseLoc\r\n vo.dbc(() => {\r\n // console.log('scrollBar clear mouseLoc')\r\n vo.mouseLoc = ''\r\n })\r\n\r\n },\r\n\r\n triggerEvent: function(name, msg) {\r\n // console.log('methods triggerEvent', name, msg)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.useEmitEvent) {\r\n return\r\n }\r\n\r\n //emit\r\n vo.$emit(name, msg)\r\n\r\n //updateScrollInfor\r\n vo.updateScrollInfor()\r\n\r\n //emit\r\n vo.$emit('change-infor', {\r\n evName: name,\r\n evMsg: msg,\r\n ...vo.scrollInfor,\r\n })\r\n\r\n },\r\n\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n.sb {\r\n transition: opacity 0.3s;\r\n /* Works on Firefox */\r\n scrollbar-width: thin;\r\n scrollbar-color: rgba(0,0,0,0.3) transparent;\r\n}\r\n/* Works on Chrome, Edge, and Safari */\r\n.sb::-webkit-scrollbar {\r\n width: 8px;\r\n height: 8px;\r\n}\r\n.sb::-webkit-scrollbar-track {\r\n background: transparent;\r\n}\r\n.sb::-webkit-scrollbar-thumb {\r\n background: rgba(0,0,0,0.3);\r\n border-radius: 20px;\r\n border: 3px solid transparent;\r\n}\r\n</style>\r\n\r\n"]},media:void 0})},lh,"data-v-f9b1bfb2",false,void 0,!1,ao,void 0,void 0)},props:{rows:{type:Array,default:()=>[]},filterKeywords:{type:String,default:""},viewHeightMax:{type:Number,default:400},itemMinHeight:{type:Number,default:24},itemsPreload:{type:Number,default:5},loadingText:{type:String,default:"Loading..."},noResultsText:{type:String,default:"No results"},searchingText:{type:String,default:"Searching..."},statePaddingStyle:{type:Object,default:()=>({v:12,h:12})},show:{type:Boolean,default:!0}},data:function(){return{pmtRefresh:th(),dbcRefresh:Jc(),mmkey:Vi(),changeHeight:!0,changeDisplay:!1,changeFilter:!1,lockFromSetRows:!1,lockFromProcess:!1,lockFromRefreshUseItems:!1,disableLoadingText:!1,searchingResults:-1,scrollTop:0,scrollInfor:null,lockedAnchorIdx:null,filterKeywordsTemp:"",rowsTemp:null,itemsHeight:0,itemsHeightPre:0,itemsHeightAft:0,useItems:[],emItemsTemp:[]}},mounted:function(){this.refresh("mounted")},beforeDestroy:function(){let t=this;null!==t.mmkey&&hh.remove(t.mmkey),t.rowsTemp=null},watch:{rows:{immediate:!0,deep:!0,handler(t){this.setRows(t)}}},computed:{changeFilterKeyWords:function(){let t=this.filterKeywords;return this.filterDebounce(),t},useStatePadding:function(){return`padding:${Qr(this.statePaddingStyle,{ext:{}})};`}},methods:{getRows:function(){return hh.get(this.mmkey)},setRowsCore:function(t){let e=this;if(e.lockFromProcess){return e.rowsTemp=t,"deferred"}if(!to(t)){return e.rowsTemp=null,"rows is not array"}e.rowsTemp=null,null!==e.mmkey&&hh.remove(e.mmkey);let n=gi(t,(t,n)=>({index:n,height:e.itemMinHeight,displayShow:!0,filterShow:!0,y:n*e.itemMinHeight,row:t}));hh.set(e.mmkey,n),e.changeDisplay=!0,e.lockedAnchorIdx=null},setRows:async function(t){let e=this;await async function(){e.lockFromSetRows=!0,e.disableLoadingText=Ui(t)<=1e4,e.setRowsCore(t),await e.refreshCore("setRows")}().catch(t=>{console.log(t)}).finally(()=>{e.lockFromSetRows=!1,e.disableLoadingText=!1})},genUseItems:function(){let t=this;if(null===t.mmkey)return;let e=hh.get(t.mmkey),n=Ui(e),i=[],r=!1,o=!1;if(n>0){let o=rh(e,n=>{let i=e[n];return t.scrollInfor.t-(i.y+i.height)});null===o&&(o=0);let s=Math.max(o-1,0);null!==t.lockedAnchorIdx&&(s=Math.min(Math.max(t.lockedAnchorIdx,0),n-1));let a=rh(e,n=>{let i=e[n];return t.scrollInfor.b-i.y});null===a&&(a=n-1);let l=Math.min(a+t.itemsPreload,n-1),c=0;for(let t=0;t<s;t++){let n=e[t];n.displayShow&&n.filterShow&&(c+=n.height)}let h=0;for(let t=l+1;t<=n-1;t++){let n=e[t];n.displayShow&&n.filterShow&&(h+=n.height)}for(let n=s;n<=l;n++){let r=Ar(e[n]);r.displayShow&&r.filterShow&&(r.nowShow=!0,r.top=r.y-t.scrollInfor.t,i.push(r))}t.itemsHeightPre!==c&&(r=!0,t.itemsHeightPre=c),t.itemsHeightAft!==h&&(r=!0,t.itemsHeightAft=h)}Bi(t.useItems,i)||(o=!0,t.useItems=i);let s=r||o;if(t.$refs.wdsDiv){let e=gi(i,"row"),n=gi(i,"row.item");s&&t.$emit("render",{eles:t.$refs.wdsDiv,rows:e,items:n}),Bi(t.emItemsTemp,n)||(t.$emit("change-view-items",{eles:t.$refs.wdsDiv,rows:e,items:n}),t.emItemsTemp=n)}return{change:s}},syncItemsHeight:function(t,e){let n=!1;return 0===Ui(t)||Me(st(this,"$refs.wdsDiv",[]),(i,r)=>{if(!i.getAttribute)return console.log("找不到getAttribute"),!0;let o=i.getAttribute("index");if(!$e(o))return console.log("!isp0int(index)",o),!0;o=Xe(o);let s=st(i,"children.0");if(!Yr(s))return console.log("!isEle(cnode)",s),!0;let a=s.offsetHeight;t[o].height!==a&&(Lr(e)&&e(o,a),n=!0)}),n},updateItemsHeight:function(){let t=this;if(null===t.mmkey)return!1;let e=hh.get(t.mmkey),n=Ui(e);t.changeHeight=t.syncItemsHeight(e,(t,n)=>{e[t].height=n}),t.show||(t.changeHeight=!1);let i=null,r=t.changeHeight||t.changeDisplay||t.changeFilter;if(r){let r=0;for(let t=0;t<n;t++){let n=e[t];n.y!==r&&(e[t].y=r),n.displayShow&&n.filterShow&&(r+=n.height)}i=t.itemsHeight,i!==r&&(i=r),0===i&&(i=43),t.changeHeight=!1,t.changeDisplay=!1,t.changeFilter=!1}return{change:r,itemsHeight:i}},refreshCore:async function(t){let e=this;if(null===e.mmkey)return;if(!e.show)return;null===e.scrollInfor&&(e.scrollInfor={r:0,t:0,b:e.viewHeightMax,ch:e.itemsHeight});await(async()=>{e.lockFromRefreshUseItems=!0;let t=Ar(e.scrollInfor),n=await(async()=>{e.filterItems();let t=e.genUseItems();return await Hl(20),{genUseItems:t,updateItemsHeight:e.updateItemsHeight()}})(),i=st(n,"genUseItems.change",!1)||st(n,"updateItemsHeight.change",!1),r=st(n,"updateItemsHeight.itemsHeight",null);if(Jr(r))if(r<=e.viewHeightMax)e.scrollTop>0&&(e.scrollTop=0);else{let n=0;"up"===t.dir&&(n=r-t.ch);let i=e.scrollTop+n;e.scrollTop!==i&&(e.scrollTop=i),e.itemsHeight=r,e.$emit("change-height-of-items",{height:r})}i&&(e.lockFromRefreshUseItems=!1,e.triggerEvent("mutation",{from:"wdl-refreshCore"}))})().catch(t=>{console.log(t)}).finally(()=>{e.lockFromRefreshUseItems=!1})},refresh:function(t){this.pmtRefresh(this.refreshCore,t).catch(()=>{})},filterDebounce:function(){let t=this;t.dbcRefresh(()=>{t.refreshCore("filterDebounce")})},changeInfor:function(t){let e=this;null!==e.mmkey&&(e.lockFromProcess||e.lockFromSetRows||e.lockFromRefreshUseItems||e.dbcRefresh(()=>{e.scrollInfor=t;let n=st(t,"evMsg.from","");if("scroll"===t.evName&&"bar"===n){let t=hh.get(e.mmkey);if(io(t)){let n=rh(t,n=>{let i=t[n];return e.scrollInfor.t-(i.y+i.height)});null===n&&(n=0),e.lockedAnchorIdx=Math.max(n,0)}}else"wdl-refreshCore"===n||(e.lockedAnchorIdx=null);e.refresh("changeInfor")}))},processItems:async function(t={}){let e=this;await async function(){if(null===e.mmkey)return;e.lockFromProcess=!0;let n=hh.get(e.mmkey);if(!to(n))return;let i=st(t,"fun",null);if(Lr(i)){let t=i(n);Fl(t)&&(t=await t),e.changeDisplay=!0,e.changeFilter=!0}let r=st(t,"indStart",null),o=st(t,"indEnd",null);if(He(r)&&He(o)){let i=st(t,"displayShow",null);if(Kr(i)){for(let t=r;t<=o;t++){st(n,t,null)&&(n[t].displayShow=i)}e.changeDisplay=!0}let s=st(t,"filterShow",null);if(Kr(s)){for(let t=r;t<=o;t++){st(n,t,null)&&(n[t].filterShow=s)}e.changeFilter=!0}}await e.refreshCore("processItems"),e.lockFromProcess=!1,e.triggerEvent("mutation",{from:"wdl-processItems"})}().catch(t=>{console.log(t)}).finally(()=>{if(e.lockFromProcess=!1,to(e.rowsTemp)){let t=e.rowsTemp;e.rowsTemp=null,e.setRows(t)}})},setSearchingResults:function(t){this.searchingResults=t},filterItems:function(){let t=this;if(null===t.mmkey)return;if(t.filterKeywordsTemp===t.filterKeywords)return;t.filterKeywordsTemp=t.filterKeywords;let e=hh.get(t.mmkey),n=Ui(e);if(t.searchingResults=-1,0===Ui(t.filterKeywords)){for(let t=0;t<n;t++)e[t].filterShow=!0;t.searchingResults=1}else{let n=t.filterKeywords.toLowerCase(),i=Kc(gi(e,t=>{let e=t.row,n="";return n=Te(e)?e:Fe(e)?nt(e):Hr(e)?Ro(Zc(e)," "):function(t,e=!1){if(eo(t))return"";let n="";try{n=e?JSON.stringify(t,null,2):JSON.stringify(t)}catch(t){n=""}return n}(e),n=n.toLowerCase(),n}),n),r=0;Me(e,(t,n)=>{let o=i[n];e[n].filterShow=o.hasKeyword,o.hasKeyword&&r++}),t.searchingResults=r}t.changeFilter=!0},triggerEvent:function(t,e){let n=st(this,"$refs.wpsc.triggerEvent",null);n&&n(t,e)}}};var dh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("WPanelScrollyCore",{ref:"wpsc",attrs:{scrollTop:t.scrollTop,viewHeightMax:t.viewHeightMax,changeFilterKeyWords:t.changeFilterKeyWords},on:{"update:scrollTop":function(e){t.scrollTop=e},"update:scroll-top":function(e){t.scrollTop=e},"change-infor":t.changeInfor}},[n("div",{style:"padding-top:"+t.itemsHeightPre+"px; padding-bottom:"+t.itemsHeightAft+"px;"},[t._l(t.useItems,function(e,i){return[n("div",{key:"kitem-"+i,ref:"wdsDiv",refInFor:!0,style:"_opacity:"+(e.nowShow?1:.001)+";",attrs:{kitem:i,index:e.index,nowShow:"c:"+e.nowShow,y:e.y,h:e.height,top:e.top}},[t._t("default",null,{row:e.row,index:e.index})],2)]})],2),t._v(" "),!t.disableLoadingText&&t.lockFromSetRows?n("div",{style:t.useStatePadding+" font-size:0.8rem;"},[t._v("\n "+t._s(t.loadingText)+"\n ")]):[0===t.useItems.length&&t.searchingResults>0?n("div",{style:t.useStatePadding+" font-size:0.8rem;"},[t._v("\n "+t._s(t.searchingText)+"\n ")]):[0===t.searchingResults&&""!==t.noResultsText?n("div",{style:t.useStatePadding+" font-size:0.8rem;"},[t._v("\n "+t._s(t.noResultsText)+"\n ")]):t._e()]]],2)};dh._withStripped=!0;const ph={components:{WPopup:jc,WTextCore:qc,WDynamicList:oo({render:dh,staticRenderFns:[]},function(t){t&&t("data-v-485284e9_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WDynamicList.vue"},media:void 0})},uh,"data-v-485284e9",false,void 0,!1,ao,void 0,void 0),WIcon:po},props:{mode:{type:String,default:"suggest"},value:{type:[Object,String,Number],default:null},items:{type:Array,default:()=>[]},height:{type:[Number,String],default:""},keyText:{type:String,default:"text"},textFontSize:{type:String,default:"0.85rem"},textColor:{type:String,default:"black"},textAlign:{type:String,default:"left"},itemTextFontSize:{type:String,default:"0.8rem"},itemTextColor:{type:String,default:"#444"},itemTextColorHover:{type:String,default:"#333"},itemBackgroundColor:{type:String,default:"white"},itemBackgroundColorHover:{type:String,default:"#f2f2f2"},itemPaddingStyle:{type:Object,default:()=>({v:10,h:14})},expansionIcon:{type:String,default:"M8,5.14V19.14L19,12.14L8,5.14Z"},expansionIconSize:{type:Number,default:18},expansionIconColor:{type:String,default:"grey"},maxHeight:{type:Number,default:200},minWidth:{type:Number,default:null},maxWidth:{type:Number,default:null},autoFitMinWidth:{type:Boolean,default:!0},autoFitMaxWidth:{type:Boolean,default:!0},placementDistX:{type:Number,default:0},placementDistY:{type:Number,default:5},placeholder:{type:String,default:""},loadingText:{type:String,default:"Loading..."},noResultsText:{type:String,default:"No results"},searchingText:{type:String,default:"Searching..."},defItemHeight:{type:Number,default:43},labelContent:{type:String,default:null},editable:{type:Boolean,default:!0},focused:{type:Boolean,default:!1},showPanel:{type:Boolean,default:!1}},data:function(){return{focusedTrans:!1,showPanelTrans:!1,valueTrans:null}},computed:{changeFocusedFromPopup:function(){return this.focusedTrans=this.focused,""},changeShowPanelFromPopup:function(){let t=this;return Ui(t.items)>0?t.showPanelTrans=t.showPanel:t.showPanelTrans=!1,""},changeValueFromPopup:function(){let t=this;return Fi(t.value)?t.valueTrans=t.value[t.keyText]:t.valueTrans=t.value,""},useTextFontSize:function(){let t=this.textFontSize;return t=zr(t,";",""),`font-size:${t};`},useTextColor:function(){return Fr(this.textColor)},useItemBackgroundColor:function(){return Fr(this.itemBackgroundColor)},useItemBackgroundColorHover:function(){return Fr(this.itemBackgroundColorHover)},useItemTextFontSize:function(){let t=this.itemTextFontSize;return t=zr(t,";",""),`font-size:${t};`},useItemTextColor:function(){return Fr(this.itemTextColor)},useItemTextColorHover:function(){return Fr(this.itemTextColorHover)},useItemPadding:function(){return`padding:${Qr(this.itemPaddingStyle)};`},uesExpansionIconColor:function(){return Fr(this.expansionIconColor)},useRotateDeg:function(){return this.showPanelTrans?180:0}},methods:{getText:function(t){let e=this;return Fi(t)?t[e.keyText]:t},selectText:function(){let t=this;t.editable&&(t.showPanelTrans||t.triggerAll({showPanel:!0,focused:!0},"selectText"))},focusText:function(){let t=this;t.editable&&(t.showPanelTrans||t.triggerAll({showPanel:!0,focused:!0},"focusText"))},updateFocused:function(t,e){this.editable&&this.triggerAll({focused:t},"updateFocused")},updateShowPanel:function(t,e){this.editable&&this.triggerAll({showPanel:t,focused:t},"updateShowPanel")},updateValue:function(t){let e=this;e.editable&&(e.valueTrans=t,e.triggerEvent("input",t,null,"updateValue"),e.triggerAll({showPanel:!0,focused:!0},"updateValue"))},clickItem:function(t,e){let n=this;n.editable&&(n.triggerEvent("input",t,e,"clickItem"),n.triggerEvent("click-item",t,e,"clickItem"),n.triggerAll({showPanel:!1,focused:!1},"clickItem"))},triggerEvent:function(t,e,n,i){let r=this;r.editable&&r.$nextTick(()=>{r.$emit(t,e,n)})},triggerAll:function(t,e){let n=this;if(!n.editable)return;let i=st(t,"showPanel",null),r=st(t,"focused",null);setTimeout(()=>{Kr(r)&&n.focusedTrans!==r&&(n.focusedTrans=r,n.triggerEvent("update:focused",r,null,"triggerAll")),Kr(i)&&n.showPanelTrans!==i&&(Ui(n.items)>0?n.showPanelTrans=i:n.showPanelTrans=!1,n.triggerEvent("update:showPanel",i,null,"triggerAll"))},20)}}};var fh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("WPopup",{attrs:{displayType:"line",minWidth:t.minWidth,maxWidth:t.maxWidth,autoFitMinWidth:t.autoFitMinWidth,autoFitMaxWidth:t.autoFitMaxWidth,placementDistX:t.placementDistX,placementDistY:t.placementDistY,labelContent:t.labelContent,editable:t.editable,value:t.showPanelTrans,changeValueFromPopup:t.changeValueFromPopup,changeFocusedFromPopup:t.changeFocusedFromPopup,changeShowPanelFromPopup:t.changeShowPanelFromPopup},on:{input:function(e){t.updateShowPanel(e,"WPopup")}},scopedSlots:t._u([{key:"trigger",fn:function(){return[n("div",[n("div",{staticStyle:{display:"flex","align-items":"center"}},["select"===t.mode?n("div",{style:"width:100%; color:"+t.useTextColor+"; "+t.useTextFontSize+" vertical-align:middle; white-space:nowrap; text-overflow:ellipsis; cursor:pointer; outline:none;",attrs:{_tabindex:"0"},on:{focus:t.focusText}},[t._t("select",function(){return[t._v("\n "+t._s(t.valueTrans)+"\n ")]},{item:t.value,text:t.valueTrans})],2):t._e(),t._v(" "),"suggest"===t.mode?n("WTextCore",{staticStyle:{width:"100%"},attrs:{textFontSize:t.textFontSize,textColor:t.useTextColor,textAlign:t.textAlign,placeholder:t.placeholder,height:t.height,editable:t.editable,focused:t.focusedTrans,value:t.valueTrans},on:{"update:focused":function(e){t.updateFocused(e,"update:focused"),t.triggerEvent("blur",t.value,null,"blur")},enter:function(e){return t.triggerEvent("enter",t.value,null,"enter")},input:t.updateValue,select:t.selectText}}):t._e(),t._v(" "),n("div",{},[n("div",{style:"transform:rotate("+(t.useRotateDeg+90)+"deg); transition:all 0.25s; cursor:pointer;"},[n("WIcon",{attrs:{icon:t.expansionIcon,color:t.uesExpansionIconColor,colorHover:t.uesExpansionIconColor,size:t.expansionIconSize}})],1)])],1)])]},proxy:!0},{key:"content",fn:function(){return[n("div",[n("WDynamicList",{attrs:{rows:t.items,filterKeywords:"suggest"===t.mode?t.valueTrans:"",viewHeightMax:t.maxHeight,itemMinHeight:t.defItemHeight,loadingText:t.loadingText,noResultsText:t.noResultsText,searchingText:t.searchingText,show:t.showPanelTrans},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:"transition:all 0.2s; cursor:pointer; outline:none; background:"+t.useItemBackgroundColor+"; color:"+t.useItemTextColor+"; "+t.useItemTextFontSize+" "+t.useItemPadding,attrs:{tabindex:"0"},on:{keyup:function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"enter",13,n.key,"Enter")?null:t.clickItem(e.row,e.index)},click:function(n){return t.clickItem(e.row,e.index)},mouseenter:function(e){var n=e.currentTarget.style;n.backgroundColor=t.useItemBackgroundColorHover,n.color=t.useItemTextColorHover},mouseleave:function(e){var n=e.currentTarget.style;n.backgroundColor=t.useItemBackgroundColor,n.color=t.useItemTextColor},focus:function(e){var n=e.currentTarget.style;n.backgroundColor=t.useItemBackgroundColorHover,n.color=t.useItemTextColorHover},blur:function(e){var n=e.currentTarget.style;n.backgroundColor=t.useItemBackgroundColor,n.color=t.useItemTextColor}}},[t._t("item",function(){return[n("div",[t._v(t._s(t.getText(e.row)))])]},{item:e.row,index:e.index})],2)]}}],null,!0)})],1)]},proxy:!0}],null,!0)})};fh._withStripped=!0;const mh=oo({render:fh,staticRenderFns:[]},function(t){t&&t("data-v-703e3c01_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WTextSuggestCore.vue"},media:void 0})},ph,"data-v-703e3c01",false,void 0,!1,ao,void 0,void 0);const gh={directives:{domresize:Ir()},components:{WShellEllipse:Wc,WTextSuggestCore:mh},props:{paddingStyle:{type:Object,default:()=>({v:2,h:15})},borderRadius:{type:Number,default:30},shadow:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},value:{type:[Object,String,Number],default:null},keyText:{type:String,default:"text"},textFontSize:{type:String,default:"0.85rem"},textColor:{type:String,default:"black"},itemTextFontSize:{type:String,default:"0.8rem"},itemTextColor:{type:String,default:"#444"},itemTextColorHover:{type:String,default:"#333"},itemBackgroundColor:{type:String,default:"white"},itemBackgroundColorHover:{type:String,default:"#f2f2f2"},itemPaddingStyle:{type:Object,default:()=>({v:10,h:14})},leftIcon:{type:String,default:""},leftIconSize:{type:Number,default:24},leftIconColor:{type:String,default:"deep-orange lighten-2"},leftIconColorHover:{type:String,default:"deep-orange lighten-1"},leftIconColorFocus:{type:String,default:"deep-orange lighten-1"},leftIconTooltip:{type:String,default:""},rightIcon:{type:String,default:""},rightIconSize:{type:Number,default:24},rightIconColor:{type:String,default:"deep-orange lighten-2"},rightIconColorHover:{type:String,default:"deep-orange lighten-1"},rightIconColorFocus:{type:String,default:"deep-orange lighten-1"},rightIconTooltip:{type:String,default:""},iconShiftOuter:{type:Number,default:-10},iconShiftInner:{type:Number,default:5},backgroundColor:{type:String,default:"white"},backgroundColorHover:{type:String,default:"white"},backgroundColorFocus:{type:String,default:"white"},borderColor:{type:String,default:"white"},borderColorHover:{type:String,default:"white"},borderColorFocus:{type:String,default:"white"},showExpansionIcon:{type:Boolean,default:!0},expansionIconSize:{type:Number,default:18},expansionIconColor:{type:String,default:"grey"},placementDistX:{type:Number,default:0},maxHeight:{type:Number,default:200},minWidth:{type:Number,default:null},maxWidth:{type:Number,default:null},autoFitMinWidth:{type:Boolean,default:!0},autoFitMaxWidth:{type:Boolean,default:!0},defItemHeight:{type:Number,default:43},labelContent:{type:String,default:null},editable:{type:Boolean,default:!0},focused:{type:Boolean,default:!1},showPanel:{type:Boolean,default:!1}},data:function(){return{constBorderWidth:1,focusedTrans:!1,showPanelTrans:!1,useDistY:0}},mounted:function(){},computed:{changeParam:function(){return this.focusedTrans=this.focused,""}},methods:{resize:function(t){let e=this,n=Qr(e.paddingStyle,{returnObj:!0}).bottom-2,i=st(e,"$el.offsetHeight",0)-26-2*n;i/=2;e.useDistY=n+i+5},getText:function(t){let e=this;return Fi(t)?t[e.keyText]:t},updateFocused:function(t){let e=this;e.focusedTrans=t,e.$nextTick(()=>{e.$emit("update:focused",t)})},updateShowPanel:function(t){let e=this;e.showPanelTrans=t,e.$nextTick(()=>{e.$emit("update:showPanel",t)})}}};var vh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],attrs:{changeParam:t.changeParam},on:{domresize:t.resize}},[n("WShellEllipse",{attrs:{paddingStyle:t.paddingStyle,borderWidth:t.constBorderWidth,borderRadius:t.borderRadius,shadow:t.shadow,leftIcon:t.leftIcon,leftIconSize:t.leftIconSize,leftIconColor:t.leftIconColor,leftIconColorHover:t.leftIconColorHover,leftIconColorFocus:t.leftIconColorFocus,leftIconTooltip:t.leftIconTooltip,rightIcon:t.rightIcon,rightIconSize:t.rightIconSize,rightIconColor:t.rightIconColor,rightIconColorHover:t.rightIconColorHover,rightIconColorFocus:t.rightIconColorFocus,rightIconTooltip:t.rightIconTooltip,iconShiftOuter:t.iconShiftOuter,iconShiftInner:t.iconShiftInner,backgroundColor:t.backgroundColor,backgroundColorHover:t.backgroundColorHover,backgroundColorFocus:t.backgroundColorFocus,borderColor:t.borderColor,borderColorHover:t.borderColorHover,borderColorFocus:t.borderColorFocus,editable:t.editable,focused:t.focusedTrans},on:{"click-left":function(e){return t.$emit("click-left")},"click-right":function(e){return t.$emit("click-right")}}},[n("div",{staticStyle:{"margin-right":"-5px"}},[n("WTextSuggestCore",{attrs:{mode:"select",items:t.items,value:t.value,keyText:t.keyText,textFontSize:t.textFontSize,textColor:t.textColor,itemTextFontSize:t.itemTextFontSize,itemTextColor:t.itemTextColor,itemTextColorHover:t.itemTextColorHover,itemBackgroundColor:t.itemBackgroundColor,itemBackgroundColorHover:t.itemBackgroundColorHover,itemPaddingStyle:t.itemPaddingStyle,expansionIcon:t.showExpansionIcon?void 0:"",expansionIconSize:t.expansionIconSize,expansionIconColor:t.expansionIconColor,maxHeight:t.maxHeight,minWidth:t.minWidth,maxWidth:t.maxWidth,autoFitMinWidth:t.autoFitMinWidth,autoFitMaxWidth:t.autoFitMaxWidth,placementDistX:t.placementDistX,placementDistY:t.useDistY,defItemHeight:t.defItemHeight,labelContent:t.labelContent,editable:t.editable,focused:t.focusedTrans,showPanel:t.showPanelTrans},on:{"update:focused":function(e){t.updateFocused(e),t.$emit("blur",null,null)},"update:showPanel":t.updateShowPanel,input:function(e,n){t.$emit("input",e,n)},"click-item":function(e,n){t.$emit("click-item",e,n)}},scopedSlots:t._u([{key:"select",fn:function(e){return[t._t("select",function(){return[t._v("\n "+t._s(e.text)+"\n ")]},{item:e.item,text:e.text})]}},{key:"item",fn:function(e){return[t._t("item",function(){return[n("div",[t._v(t._s(t.getText(e.item)))])]},{item:e.item,index:e.index})]}}],null,!0)})],1)])],1)};vh._withStripped=!0;const _h={components:{WTextSelect:oo({render:vh,staticRenderFns:[]},function(t){t&&t("data-v-52053214_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WTextSelect.vue"},media:void 0})},gh,"data-v-52053214",false,void 0,!1,ao,void 0,void 0),WBar:yc,WPie:Ec,WRose:Uc},props:{mode:{type:String,default:"multi"},opt:{type:Object,default:()=>{}},textPlotType:{type:String,default:"Plot type"},widthSelect:{type:Number,default:260},keySelect:{type:String,default:"bar-v-normal"},kpSelectText:{type:Object,default:()=>{}}},data:function(){return{typeItemsDefOne:[{key:"bar-v-normal",type:"bar",text:"Vertical bars",optExt:{}},{key:"bar-h-normal",type:"bar",text:"Horizontal bars",optExt:{direction:"horizontal",marginLeft:80,legendPosition:"bottomright"}},{key:"bar-h-normal-dense",type:"bar",text:"Horizontal bars with dense",optExt:{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barUseInnerLabelsForHorizontal:!0}},{key:"pie-normal",type:"pie",text:"Pies",optExt:{}},{key:"rose-normal",type:"rose",text:"Roses",optExt:{}}],typeItemsDefMulti:[{key:"bar-v-normal",type:"bar",text:"Vertical bars",optExt:{}},{key:"bar-v-stack-normal",type:"bar",text:"Vertical bars with normal stack",optExt:{barDisplay:"stackNormal"}},{key:"bar-v-stack-percent",type:"bar",text:"Vertical bars with percent stack",optExt:{barDisplay:"stackPercent"}},{key:"bar-h-normal",type:"bar",text:"Horizontal bars",optExt:{direction:"horizontal",marginLeft:80,legendPosition:"bottomright"}},{key:"bar-h-normal-dense",type:"bar",text:"Horizontal bars with dense",optExt:{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barUseInnerLabelsForHorizontal:!0,barGroupWidthRatio:.25}},{key:"bar-h-stack-normal",type:"bar",text:"Horizontal bars with normal stack",optExt:{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barDisplay:"stackNormal"}},{key:"bar-h-stack-percent",type:"bar",text:"Horizontal bars with percent stack",optExt:{direction:"horizontal",marginLeft:80,legendPosition:"bottomright",barDisplay:"stackPercent"}},{key:"rose-normal",type:"rose",text:"Roses",optExt:{}}],typeItems:[],keySelectTrans:null,typeSelect:null}},computed:{typeItemsDef:function(){let t=this;return"one"===t.mode?t.typeItemsDefOne:t.typeItemsDefMulti},changeTypeItems:function(){let t=this,e=[];return Hr(t.kpSelectText)?Me(t.typeItemsDef,n=>{if(!qo(t.kpSelectText,n.key))return!0;let i=t.kpSelectText[n.key];e.push({...n,text:i})}):e=t.typeItemsDef,t.typeItems=e,""},changeKeySelect:function(){return this.updateTypeSelectByKey(this.keySelect),""},picWidth:function(){return st(this,"opt.width",0)},picHeight:function(){return st(this,"opt.height",0)},ks:function(){return st(this,"opt.keys",[])},hasOptTar:function(){return Hr(this.optTar)},cmp:function(){let t=st(this,"typeSelect.type","");return t=Ur(t),`W${t}`},optTar:function(){let t=this,e=st(t,"opt.showLabels",!0),n=e,i=e,r=e,o=st(t,"opt.showLegend",!1),s=st(t,"opt.rds",[]),a=Ui(s);if(0===a)return console.log("no data, size(opt.rds)=0"),null;"one"===t.mode&&a>1&&(console.log("size(opt.rds)>1"),s=[s[0]]);let l=null;try{l=t.opt,l=Ar(l);let e=st(t,"typeSelect.optExt",{});e=Ar(e);let s={barShowLabels:n,pieShowLabels:i,roseShowLabels:r,showLegend:o};l=hc(l,e),l=hc(l,s)}catch(t){console.log(t)}return l}},methods:{updateTypeSelectByKey:function(t){let e=this;e.keySelectTrans=t;let n=null;Me(e.typeItems,e=>{if(e.key===t)return n=e,!1}),e.typeSelect=n},updateTypeSelectAndEmitKeySelect:function(t){let e=this;e.typeSelect=t;let n=st(t,"key","");e.updateTypeSelectByKey(n),e.$emit("update:keySelect",n)}}};var yh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{display:"inline-block"},attrs:{changeTypeItems:t.changeTypeItems,changeKeySelect:t.changeKeySelect}},[n("div",{staticStyle:{"padding-bottom":"5px"}},[n("div",{staticStyle:{display:"flex","align-items":"flex-end"}},[n("div",{style:""},[t._t("head")],2),t._v(" "),n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("div",{staticStyle:{"padding-right":"10px","font-size":"0.85rem",color:"#666"}},[t._v("\n "+t._s(t.textPlotType)+":\n ")]),t._v(" "),n("WTextSelect",{style:"width:"+t.widthSelect+"px;",attrs:{paddingStyle:{v:3,h:10},borderRadius:4,items:t.typeItems,value:t.typeSelect},on:{input:t.updateTypeSelectAndEmitKeySelect}})],1)])]),t._v(" "),t.hasOptTar?n("div",{attrs:{name:"tarp"}},[n(t.cmp,{tag:"component",attrs:{opt:t.optTar}})],1):t._e()])};yh._withStripped=!0;const bh=oo({render:yh,staticRenderFns:[]},function(t){t&&t("data-v-8f03fd34_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WSetMulti.vue"},media:void 0})},_h,"data-v-8f03fd34",false,void 0,!1,ao,void 0,void 0);const xh={components:{WSetMulti:bh},props:{opt:{type:Object,default:()=>{}},textPlotType:{type:String,default:"Plot type"},widthSelect:{type:Number,default:215},keySelect:{type:String,default:"bar-v-normal"},kpSelectText:{type:Object,default:()=>{}}},data:function(){return{}},computed:{},methods:{}};var Sh=function(){var t=this,e=t.$createElement;return(t._self._c||e)("WSetMulti",t._g(t._b({scopedSlots:t._u([{key:"head",fn:function(){return[t._t("head")]},proxy:!0}],null,!0)},"WSetMulti",Object.assign({},t.$props,{mode:"one"}),!1),t.$listeners))};Sh._withStripped=!0;const wh={components:{demolink:Nl,WSetOne:oo({render:Sh,staticRenderFns:[]},function(t){t&&t("data-v-6b390c16_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WSetOne.vue"},media:void 0})},xh,"data-v-6b390c16",false,void 0,!1,ao,void 0,void 0)},props:{},data:function(){return{WSetOne:{keySelect:"bar-v-normal",opt1c:{width:400,height:400,keys:["USA","China","Brazil","EU","India","Russia"],rds:[{name:"Corn",data:{USA:{value:406.292,color:["#EF9A9A","#F44336"]},China:{value:260,color:["#F48FB1","#E91E63"]},Brazil:{value:107,color:["#CE93D8","#9C27B0"]},EU:{value:68.3,color:["#B39DDB","#673AB7"]},India:{value:27.5,color:["#9FA8DA","#3F51B5"]},Russia:{value:14.5,color:["#90CAF9","#2196F3"]}}}],xTitle:"Countries",yTitle:"Weight (MT)"}}}},methods:{}};var Mh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"bkh"},[t._m(0),t._v(" "),n("div",{staticStyle:{padding:"0px"}},[n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-one",casename:"default"}}),t._v(" "),n("w-set-one",{attrs:{opt:Object.assign({},t.WSetOne.opt1c)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-one",casename:"keySelect"}}),t._v(" "),n("div",{staticStyle:{"padding-bottom":"5px","font-size":"0.8rem"}},[t._v("\n keySelect: "+t._s(t.WSetOne.keySelect)+"\n ")]),t._v(" "),n("w-set-one",{attrs:{opt:Object.assign({},t.WSetOne.opt1c),keySelect:t.WSetOne.keySelect},on:{"update:keySelect":function(e){return t.$set(t.WSetOne,"keySelect",e)},"update:key-select":function(e){return t.$set(t.WSetOne,"keySelect",e)}}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-one",casename:"textPlotType & kpSelectText & widthSelect"}}),t._v(" "),n("w-set-one",{attrs:{opt:Object.assign({},t.WSetOne.opt1c),textPlotType:"繪圖類型",kpSelectText:{"bar-v-normal":"垂直直條圖","bar-h-normal":"水平直條圖","bar-h-normal-dense":"水平直條圖(緊密)","pie-normal":"圓餅圖","rose-normal":"玫瑰圖"},widthSelect:160}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-one",casename:"hide labels"}}),t._v(" "),n("w-set-one",{attrs:{opt:Object.assign({},t.WSetOne.opt1c,{showLabels:!1})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-one",casename:"show legned"}}),t._v(" "),n("w-set-one",{attrs:{opt:Object.assign({},t.WSetOne.opt1c,{showLegend:!0})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-one",casename:"slot head"}}),t._v(" "),n("w-set-one",{attrs:{opt:Object.assign({},t.WSetOne.opt1c)},scopedSlots:t._u([{key:"head",fn:function(){return[n("div",{staticStyle:{"padding-right":"8px","font-size":"1.3rem"}},[t._v("\n 🌿\n ")])]},proxy:!0}])})],1)])])};Mh._withStripped=!0;const Th=oo({render:Mh,staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"head1"},[n("span",{staticStyle:{cursor:"pointer"},attrs:{title:"open for copy link to view component",onclick:"window.open('//yuda-lyu.github.io/w-plot-vue/examples/app.html?cmp='+this.innerText,'_blank')"}},[t._v("w-set-one")])])}]},function(t){t&&t("data-v-ae132bf8_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"AppZoneWSetOne.vue"},media:void 0})},wh,"data-v-ae132bf8",false,void 0,!1,ao,void 0,void 0);const Ah={components:{demolink:Nl,WSetMulti:bh},props:{},data:function(){return{WSetMulti:{keySelect:"bar-v-normal",opt2e:{width:400,height:400,keys:["USA","China","Brazil","EU","India","Russia"],rds:[{name:"Corn",data:{USA:{value:406.292,color:["rgb(255, 205, 210)","rgb(229, 115, 115)"]},China:{value:260,color:["rgb(255, 185, 210)","rgb(229, 95, 115)"]},Brazil:{value:107,color:["rgb(255, 165, 210)","rgb(229, 75, 115)"]},EU:{value:68.3,color:["rgb(255, 145, 210)","rgb(229, 55, 115)"]},India:{value:27.5,color:["rgb(255, 125, 210)","rgb(229, 35, 115)"]},Russia:{value:14.5,color:["rgb(255, 105, 210)","rgb(229, 15, 115)"]}}},{name:"Wheat",data:{USA:{value:51.086,color:["rgb(210, 205, 255)","rgb(115, 115, 229)"]},China:{value:136,color:["rgb(210, 185, 255)","rgb(115, 95, 229)"]},Brazil:{value:5.5,color:["rgb(210, 165, 255)","rgb(115, 75, 229)"]},EU:{value:141,color:["rgb(210, 145, 255)","rgb(115, 55, 229)"]},India:{value:107.18,color:["rgb(210, 125, 255)","rgb(115, 35, 229)"]},Russia:{value:77,color:["rgb(210, 105, 255)","rgb(115, 15, 229)"]}}}],xTitle:"Countries",yTitle:"Weight (MT)"}}}},methods:{}};var Eh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"bkh"},[t._m(0),t._v(" "),n("div",{staticStyle:{padding:"0px"}},[n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-multi",casename:"default"}}),t._v(" "),n("w-set-multi",{attrs:{opt:Object.assign({},t.WSetMulti.opt2e)}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-multi",casename:"keySelect"}}),t._v(" "),n("div",{staticStyle:{"padding-bottom":"5px","font-size":"0.8rem"}},[t._v("\n keySelect: "+t._s(t.WSetMulti.keySelect)+"\n ")]),t._v(" "),n("w-set-multi",{attrs:{opt:Object.assign({},t.WSetMulti.opt2e),keySelect:t.WSetMulti.keySelect},on:{"update:keySelect":function(e){return t.$set(t.WSetMulti,"keySelect",e)},"update:key-select":function(e){return t.$set(t.WSetMulti,"keySelect",e)}}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-multi",casename:"textPlotType & kpSelectText & widthSelect"}}),t._v(" "),n("w-set-multi",{attrs:{opt:Object.assign({},t.WSetMulti.opt2e),textPlotType:"繪圖類型",kpSelectText:{"bar-v-normal":"垂直直條圖","bar-v-stack-normal":"垂直堆疊直條圖","bar-v-stack-percent":"垂直堆疊佔比直條圖","bar-h-normal":"水平直條圖","bar-h-normal-dense":"水平直條圖(緊密)","bar-h-stack-normal":"水平堆疊直條圖","bar-h-stack-percent":"水平堆疊佔比直條圖","rose-normal":"玫瑰圖"},widthSelect:170}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-multi",casename:"hide labels"}}),t._v(" "),n("w-set-multi",{attrs:{opt:Object.assign({},t.WSetMulti.opt2e,{showLabels:!1})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-multi",casename:"hide legned"}}),t._v(" "),n("w-set-multi",{attrs:{opt:Object.assign({},t.WSetMulti.opt2e,{showLegend:!1})}})],1),t._v(" "),n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-set-multi",casename:"slot head"}}),t._v(" "),n("w-set-multi",{attrs:{opt:Object.assign({},t.WSetMulti.opt2e)},scopedSlots:t._u([{key:"head",fn:function(){return[n("div",{staticStyle:{"padding-right":"8px","font-size":"1.3rem"}},[t._v("\n 🌿\n ")])]},proxy:!0}])})],1)])])};Eh._withStripped=!0;const Ch=oo({render:Eh,staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"head1"},[n("span",{staticStyle:{cursor:"pointer"},attrs:{title:"open for copy link to view component",onclick:"window.open('//yuda-lyu.github.io/w-plot-vue/examples/app.html?cmp='+this.innerText,'_blank')"}},[t._v("w-set-multi")])])}]},function(t){t&&t("data-v-df1a9ab6_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"AppZoneWSetMulti.vue"},media:void 0})},Ah,"data-v-df1a9ab6",false,void 0,!1,ao,void 0,void 0);function Rh(t,e,n){return null==t?t:function(t,e,n,i){if(!_(t))return t;for(var r=-1,o=(e=it(e,t)).length,s=o-1,a=t;null!=a&&++r<o;){var l=rt(e[r]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(r!=s){var h=a[l];void 0===(c=i?i(h,l,a):void 0)&&(c=_(h)?h:ee(e[r+1])?[]:{})}ji(a,l,c),a=a[l]}return t}(t,e,n)}function Ph(t,e){return t<e}function Lh(t){return t&&t.length?eh(t,we,Ph):void 0}function Ih(t){return t&&t.length?eh(t,we,nh):void 0}
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2010-2023 Three.js Authors
|
|
10
|
+
* SPDX-License-Identifier: MIT
|
|
11
|
+
*/const Oh="162",kh=0,Uh=1,Dh=2,Nh=100,Bh=101,Fh=102,zh=200,Hh=201,Wh=202,Vh=203,Gh=204,jh=205,Xh=206,$h=207,Yh=208,qh=209,Zh=210,Kh=211,Jh=212,Qh=213,tu=214,eu="attached",nu="detached",iu=300,ru=301,ou=302,su=303,au=304,lu=306,cu=1e3,hu=1001,uu=1002,du=1003,pu=1004,fu=1005,mu=1006,gu=1007,vu=1008,_u=1009,yu=1012,bu=1013,xu=1014,Su=1015,wu=1016,Mu=1017,Tu=1018,Au=1020,Eu=1023,Cu=1026,Ru=1027,Pu=1028,Lu=1029,Iu=1031,Ou=1033,ku=33776,Uu=33777,Du=33778,Nu=33779,Bu=35840,Fu=35841,zu=35842,Hu=35843,Wu=36196,Vu=37492,Gu=37496,ju=37808,Xu=37809,$u=37810,Yu=37811,qu=37812,Zu=37813,Ku=37814,Ju=37815,Qu=37816,td=37817,ed=37818,nd=37819,id=37820,rd=37821,od=36492,sd=36494,ad=36495,ld=36284,cd=36285,hd=36286,ud=2300,dd=2301,pd=2302,fd=2400,md=2401,gd=2402,vd=2500,_d=2501,yd="",bd="srgb",xd="srgb-linear",Sd="display-p3",wd="display-p3-linear",Md="linear",Td="srgb",Ad="rec709",Ed="p3",Cd=7680,Rd=512,Pd=513,Ld=514,Id=515,Od=516,kd=517,Ud=518,Dd=519,Nd=35044,Bd="300 es",Fd=1035,zd=2e3,Hd=2001;let Wd=class{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t);t.target=null}}};const Vd=["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"];let Gd=1234567;const jd=Math.PI/180,Xd=180/Math.PI;function $d(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Vd[255&t]+Vd[t>>8&255]+Vd[t>>16&255]+Vd[t>>24&255]+"-"+Vd[255&e]+Vd[e>>8&255]+"-"+Vd[e>>16&15|64]+Vd[e>>24&255]+"-"+Vd[63&n|128]+Vd[n>>8&255]+"-"+Vd[n>>16&255]+Vd[n>>24&255]+Vd[255&i]+Vd[i>>8&255]+Vd[i>>16&255]+Vd[i>>24&255]).toLowerCase()}function Yd(t,e,n){return Math.max(e,Math.min(n,t))}function qd(t,e){return(t%e+e)%e}function Zd(t,e,n){return(1-n)*t+n*e}function Kd(t){return!(t&t-1)&&0!==t}function Jd(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Qd(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function tp(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const ep={DEG2RAD:jd,RAD2DEG:Xd,generateUUID:$d,clamp:Yd,euclideanModulo:qd,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Zd,damp:function(t,e,n,i){return Zd(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(qd(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(Gd=t);let e=Gd+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*jd},radToDeg:function(t){return t*Xd},isPowerOfTwo:Kd,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Jd,setQuaternionFromProperEuler:function(t,e,n,i,r){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),c=o((e+i)/2),h=s((e+i)/2),u=o((e-i)/2),d=s((e-i)/2),p=o((i-e)/2),f=s((i-e)/2);switch(r){case"XYX":t.set(a*h,l*u,l*d,a*c);break;case"YZY":t.set(l*d,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*d,a*h,a*c);break;case"XZX":t.set(a*h,l*f,l*p,a*c);break;case"YXY":t.set(l*p,a*h,l*f,a*c);break;case"ZYZ":t.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:tp,denormalize:Qd};class np{constructor(t=0,e=0){np.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Yd(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ip{constructor(t,e,n,i,r,o,s,a,l){ip.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,o,s,a,l)}set(t,e,n,i,r,o,s,a,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=s,c[3]=e,c[4]=r,c[5]=a,c[6]=n,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,o=n[0],s=n[3],a=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],_=i[4],y=i[7],b=i[2],x=i[5],S=i[8];return r[0]=o*f+s*v+a*b,r[3]=o*m+s*_+a*x,r[6]=o*g+s*y+a*S,r[1]=l*f+c*v+h*b,r[4]=l*m+c*_+h*x,r[7]=l*g+c*y+h*S,r[2]=u*f+d*v+p*b,r[5]=u*m+d*_+p*x,r[8]=u*g+d*y+p*S,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*o*c-e*s*l-n*r*c+n*s*a+i*r*l-i*o*a}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],h=c*o-s*l,u=s*a-c*r,d=l*r-o*a,p=e*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=h*f,t[1]=(i*l-c*n)*f,t[2]=(s*n-i*o)*f,t[3]=u*f,t[4]=(c*e-i*a)*f,t[5]=(i*r-s*e)*f,t[6]=d*f,t[7]=(n*a-l*e)*f,t[8]=(o*e-n*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,o,s){const a=Math.cos(r),l=Math.sin(r);return this.set(n*a,n*l,-n*(a*o+l*s)+o+t,-i*l,i*a,-i*(-l*o+a*s)+s+e,0,0,1),this}scale(t,e){return this.premultiply(rp.makeScale(t,e)),this}rotate(t){return this.premultiply(rp.makeRotation(-t)),this}translate(t,e){return this.premultiply(rp.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const rp=new ip;function op(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const sp={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function ap(t,e){return new sp[t](e)}function lp(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function cp(){const t=lp("canvas");return t.style.display="block",t}const hp={};function up(t){t in hp||(hp[t]=!0,console.warn(t))}const dp=(new ip).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),pp=(new ip).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),fp={[xd]:{transfer:Md,primaries:Ad,toReference:t=>t,fromReference:t=>t},[bd]:{transfer:Td,primaries:Ad,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[wd]:{transfer:Md,primaries:Ed,toReference:t=>t.applyMatrix3(pp),fromReference:t=>t.applyMatrix3(dp)},[Sd]:{transfer:Td,primaries:Ed,toReference:t=>t.convertSRGBToLinear().applyMatrix3(pp),fromReference:t=>t.applyMatrix3(dp).convertLinearToSRGB()}},mp=new Set([xd,wd]),gp={enabled:!0,_workingColorSpace:xd,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!mp.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=fp[e].toReference;return(0,fp[n].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return fp[t].primaries},getTransfer:function(t){return t===yd?Md:fp[t].transfer}};function vp(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function _p(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let yp;class bp{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===yp&&(yp=lp("canvas")),yp.width=t.width,yp.height=t.height;const n=yp.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=yp}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=lp("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*vp(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*vp(e[t]/255)):e[t]=vp(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let xp=0;class Sp{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:xp++}),this.uuid=$d(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(wp(i[e].image)):t.push(wp(i[e]))}else t=wp(i);n.url=t}return e||(t.images[this.uuid]=n),n}}function wp(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?bp.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Mp=0;class Tp extends Wd{constructor(t=Tp.DEFAULT_IMAGE,e=Tp.DEFAULT_MAPPING,n=1001,i=1001,r=1006,o=1008,s=1023,a=1009,l=Tp.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Mp++}),this.uuid=$d(),this.name="",this.source=new Sp(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=a,this.offset=new np(0,0),this.repeat=new np(1,1),this.center=new np(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ip,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==iu)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case cu:t.x=t.x-Math.floor(t.x);break;case hu:t.x=t.x<0?0:1;break;case uu:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case cu:t.y=t.y-Math.floor(t.y);break;case hu:t.y=t.y<0?0:1;break;case uu:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}Tp.DEFAULT_IMAGE=null,Tp.DEFAULT_MAPPING=iu,Tp.DEFAULT_ANISOTROPY=1;class Ap{constructor(t=0,e=0,n=0,i=1){Ap.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const o=.01,s=.1,a=t.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)<o&&Math.abs(h-f)<o&&Math.abs(p-m)<o){if(Math.abs(c+u)<s&&Math.abs(h+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,a=(d+1)/2,v=(g+1)/2,_=(c+u)/4,y=(h+f)/4,b=(p+m)/4;return t>a&&t>v?t<o?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=_/n,r=y/n):a>v?a<o?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(a),n=_/i,r=b/i):v<o?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(v),n=y/r,i=b/r),this.set(n,i,r,e),this}let v=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(h-f)/v,this.z=(u-c)/v,this.w=Math.acos((l+d+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Ep extends Wd{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Ap(0,0,t,e),this.scissorTest=!1,this.viewport=new Ap(0,0,t,e);const i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:mu,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const r=new Tp(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let t=0;t<o;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new Sp(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Cp extends Ep{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class Rp extends Tp{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=du,this.minFilter=du,this.wrapR=hu,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Pp extends Tp{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=du,this.minFilter=du,this.wrapR=hu,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Lp{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,o,s){let a=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3];const u=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(0===s)return t[e+0]=a,t[e+1]=l,t[e+2]=c,void(t[e+3]=h);if(1===s)return t[e+0]=u,t[e+1]=d,t[e+2]=p,void(t[e+3]=f);if(h!==f||a!==u||l!==d||c!==p){let t=1-s;const e=a*u+l*d+c*p+h*f,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),o=Math.atan2(r,e*n);t=Math.sin(t*o)/r,s=Math.sin(s*o)/r}const r=s*n;if(a=a*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+f*r,t===1-s){const t=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=t,l*=t,c*=t,h*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,o){const s=n[i],a=n[i+1],l=n[i+2],c=n[i+3],h=r[o],u=r[o+1],d=r[o+2],p=r[o+3];return t[e]=s*p+c*h+a*d-l*u,t[e+1]=a*p+c*u+l*h-s*d,t[e+2]=l*p+c*d+s*u-a*h,t[e+3]=c*p-s*h-a*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,r=t._z,o=t._order,s=Math.cos,a=Math.sin,l=s(n/2),c=s(i/2),h=s(r/2),u=a(n/2),d=a(i/2),p=a(r/2);switch(o){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],o=e[1],s=e[5],a=e[9],l=e[2],c=e[6],h=e[10],u=n+s+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-a)*t,this._y=(r-l)*t,this._z=(o-i)*t}else if(n>s&&n>h){const t=2*Math.sqrt(1+n-s-h);this._w=(c-a)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(r+l)/t}else if(s>h){const t=2*Math.sqrt(1+s-n-h);this._w=(r-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-n-s);this._w=(o-i)/t,this._x=(r+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Yd(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,o=t._w,s=e._x,a=e._y,l=e._z,c=e._w;return this._x=n*c+o*s+i*l-r*a,this._y=i*c+o*a+r*s-n*l,this._z=r*c+o*l+n*a-i*s,this._w=o*c-n*s-i*a-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,o=this._w;let s=o*t._w+n*t._x+i*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=o*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ip{constructor(t=0,e=0,n=0){Ip.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(kp.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(kp.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,s=t.z,a=t.w,l=2*(o*i-s*n),c=2*(s*e-r*i),h=2*(r*n-o*e);return this.x=e+a*l+o*h-s*c,this.y=n+a*c+s*l-r*h,this.z=i+a*h+r*c-o*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=i*a-r*s,this.y=r*o-n*a,this.z=n*s-i*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Op.copy(this).projectOnVector(t),this.sub(Op)}reflect(t){return this.sub(Op.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Yd(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Op=new Ip,kp=new Lp;class Up{constructor(t=new Ip(1/0,1/0,1/0),e=new Ip(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(Np.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(Np.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=Np.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===e&&void 0!==i&&!0!==t.isInstancedMesh)for(let e=0,n=i.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,Np):Np.fromBufferAttribute(i,e),Np.applyMatrix4(t.matrixWorld),this.expandByPoint(Np);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),Bp.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),Bp.copy(n.boundingBox)),Bp.applyMatrix4(t.matrixWorld),this.union(Bp)}const i=t.children;for(let t=0,n=i.length;t<n;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Np),Np.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(jp),Xp.subVectors(this.max,jp),Fp.subVectors(t.a,jp),zp.subVectors(t.b,jp),Hp.subVectors(t.c,jp),Wp.subVectors(zp,Fp),Vp.subVectors(Hp,zp),Gp.subVectors(Fp,Hp);let e=[0,-Wp.z,Wp.y,0,-Vp.z,Vp.y,0,-Gp.z,Gp.y,Wp.z,0,-Wp.x,Vp.z,0,-Vp.x,Gp.z,0,-Gp.x,-Wp.y,Wp.x,0,-Vp.y,Vp.x,0,-Gp.y,Gp.x,0];return!!qp(e,Fp,zp,Hp,Xp)&&(e=[1,0,0,0,1,0,0,0,1],!!qp(e,Fp,zp,Hp,Xp)&&($p.crossVectors(Wp,Vp),e=[$p.x,$p.y,$p.z],qp(e,Fp,zp,Hp,Xp)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Np).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Np).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Dp[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Dp[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Dp[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Dp[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Dp[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Dp[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Dp[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Dp[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Dp)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Dp=[new Ip,new Ip,new Ip,new Ip,new Ip,new Ip,new Ip,new Ip],Np=new Ip,Bp=new Up,Fp=new Ip,zp=new Ip,Hp=new Ip,Wp=new Ip,Vp=new Ip,Gp=new Ip,jp=new Ip,Xp=new Ip,$p=new Ip,Yp=new Ip;function qp(t,e,n,i,r){for(let o=0,s=t.length-3;o<=s;o+=3){Yp.fromArray(t,o);const s=r.x*Math.abs(Yp.x)+r.y*Math.abs(Yp.y)+r.z*Math.abs(Yp.z),a=e.dot(Yp),l=n.dot(Yp),c=i.dot(Yp);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}const Zp=new Up,Kp=new Ip,Jp=new Ip;class Qp{constructor(t=new Ip,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Zp.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;e<r;e++)i=Math.max(i,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Kp.subVectors(t,this.center);const e=Kp.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(Kp,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Jp.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Kp.copy(t.center).add(Jp)),this.expandByPoint(Kp.copy(t.center).sub(Jp))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const tf=new Ip,ef=new Ip,nf=new Ip,rf=new Ip,of=new Ip,sf=new Ip,af=new Ip;class lf{constructor(t=new Ip,e=new Ip(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,tf)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=tf.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(tf.copy(this.origin).addScaledVector(this.direction,e),tf.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){ef.copy(t).add(e).multiplyScalar(.5),nf.copy(e).sub(t).normalize(),rf.copy(this.origin).sub(ef);const r=.5*t.distanceTo(e),o=-this.direction.dot(nf),s=rf.dot(this.direction),a=-rf.dot(nf),l=rf.lengthSq(),c=Math.abs(1-o*o);let h,u,d,p;if(c>0)if(h=o*a-s,u=o*s-a,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+o*u+2*s)+u*(o*h+u+2*a)+l}else u=r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-o*r+s)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(o*r+s)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=o>0?-r:r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(ef).addScaledVector(nf,u),d}intersectSphere(t,e){tf.subVectors(t.center,this.origin);const n=tf.dot(this.direction),i=tf.dot(tf)-n*n,r=t.radius*t.radius;if(i>r)return null;const o=Math.sqrt(r-i),s=n-o,a=n+o;return a<0?null:s<0?this.at(a,e):this.at(s,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,o=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,o=(t.min.y-u.y)*c),n>o||r>i?null:((r>n||isNaN(n))&&(n=r),(o<i||isNaN(i))&&(i=o),h>=0?(s=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(s=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),n>a||s>i?null:((s>n||n!=n)&&(n=s),(a<i||i!=i)&&(i=a),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,tf)}intersectTriangle(t,e,n,i,r){of.subVectors(e,t),sf.subVectors(n,t),af.crossVectors(of,sf);let o,s=this.direction.dot(af);if(s>0){if(i)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}rf.subVectors(this.origin,t);const a=o*this.direction.dot(sf.crossVectors(rf,sf));if(a<0)return null;const l=o*this.direction.dot(of.cross(rf));if(l<0)return null;if(a+l>s)return null;const c=-o*rf.dot(af);return c<0?null:this.at(c/s,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class cf{constructor(t,e,n,i,r,o,s,a,l,c,h,u,d,p,f,m){cf.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,e,n,i,r,o,s,a,l,c,h,u,d,p,f,m)}set(t,e,n,i,r,o,s,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new cf).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/hf.setFromMatrixColumn(t,0).length(),r=1/hf.setFromMatrixColumn(t,1).length(),o=1/hf.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),s=Math.sin(n),a=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=o*c,n=o*h,i=s*c,r=s*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-s*a,e[2]=r-t*l,e[6]=i+n*l,e[10]=o*a}else if("YXZ"===t.order){const t=a*c,n=a*h,i=l*c,r=l*h;e[0]=t+r*s,e[4]=i*s-n,e[8]=o*l,e[1]=o*h,e[5]=o*c,e[9]=-s,e[2]=n*s-i,e[6]=r+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*c,n=a*h,i=l*c,r=l*h;e[0]=t-r*s,e[4]=-o*h,e[8]=i+n*s,e[1]=n+i*s,e[5]=o*c,e[9]=r-t*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*c,n=o*h,i=s*c,r=s*h;e[0]=a*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=a*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,n=o*l,i=s*a,r=s*l;e[0]=a*c,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=o*c,e[9]=-s*c,e[2]=-l*c,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=o*a,n=o*l,i=s*a,r=s*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=o*c,e[9]=n*h-i,e[2]=i*h-n,e[6]=s*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(df,t,pf)}lookAt(t,e,n){const i=this.elements;return gf.subVectors(t,e),0===gf.lengthSq()&&(gf.z=1),gf.normalize(),ff.crossVectors(n,gf),0===ff.lengthSq()&&(1===Math.abs(n.z)?gf.x+=1e-4:gf.z+=1e-4,gf.normalize(),ff.crossVectors(n,gf)),ff.normalize(),mf.crossVectors(gf,ff),i[0]=ff.x,i[4]=mf.x,i[8]=gf.x,i[1]=ff.y,i[5]=mf.y,i[9]=gf.y,i[2]=ff.z,i[6]=mf.z,i[10]=gf.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,o=n[0],s=n[4],a=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],_=n[7],y=n[11],b=n[15],x=i[0],S=i[4],w=i[8],M=i[12],T=i[1],A=i[5],E=i[9],C=i[13],R=i[2],P=i[6],L=i[10],I=i[14],O=i[3],k=i[7],U=i[11],D=i[15];return r[0]=o*x+s*T+a*R+l*O,r[4]=o*S+s*A+a*P+l*k,r[8]=o*w+s*E+a*L+l*U,r[12]=o*M+s*C+a*I+l*D,r[1]=c*x+h*T+u*R+d*O,r[5]=c*S+h*A+u*P+d*k,r[9]=c*w+h*E+u*L+d*U,r[13]=c*M+h*C+u*I+d*D,r[2]=p*x+f*T+m*R+g*O,r[6]=p*S+f*A+m*P+g*k,r[10]=p*w+f*E+m*L+g*U,r[14]=p*M+f*C+m*I+g*D,r[3]=v*x+_*T+y*R+b*O,r[7]=v*S+_*A+y*P+b*k,r[11]=v*w+_*E+y*L+b*U,r[15]=v*M+_*C+y*I+b*D,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],s=t[5],a=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*a*h-i*l*h-r*s*u+n*l*u+i*s*d-n*a*d)+t[7]*(+e*a*d-e*l*u+r*o*u-i*o*d+i*l*c-r*a*c)+t[11]*(+e*l*h-e*s*d-r*o*h+n*o*d+r*s*c-n*l*c)+t[15]*(-i*s*c-e*a*h+e*s*u+i*o*h-n*o*u+n*a*c)}transpose(){const t=this.elements;let e;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}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=h*m*l-f*u*l+f*a*d-s*m*d-h*a*g+s*u*g,_=p*u*l-c*m*l-p*a*d+o*m*d+c*a*g-o*u*g,y=c*f*l-p*h*l+p*s*d-o*f*d-c*s*g+o*h*g,b=p*h*a-c*f*a-p*s*u+o*f*u+c*s*m-o*h*m,x=e*v+n*_+i*y+r*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/x;return t[0]=v*S,t[1]=(f*u*r-h*m*r-f*i*d+n*m*d+h*i*g-n*u*g)*S,t[2]=(s*m*r-f*a*r+f*i*l-n*m*l-s*i*g+n*a*g)*S,t[3]=(h*a*r-s*u*r-h*i*l+n*u*l+s*i*d-n*a*d)*S,t[4]=_*S,t[5]=(c*m*r-p*u*r+p*i*d-e*m*d-c*i*g+e*u*g)*S,t[6]=(p*a*r-o*m*r-p*i*l+e*m*l+o*i*g-e*a*g)*S,t[7]=(o*u*r-c*a*r+c*i*l-e*u*l-o*i*d+e*a*d)*S,t[8]=y*S,t[9]=(p*h*r-c*f*r-p*n*d+e*f*d+c*n*g-e*h*g)*S,t[10]=(o*f*r-p*s*r+p*n*l-e*f*l-o*n*g+e*s*g)*S,t[11]=(c*s*r-o*h*r-c*n*l+e*h*l+o*n*d-e*s*d)*S,t[12]=b*S,t[13]=(c*f*i-p*h*i+p*n*u-e*f*u-c*n*m+e*h*m)*S,t[14]=(p*s*i-o*f*i-p*n*a+e*f*a+o*n*m-e*s*m)*S,t[15]=(o*h*i-c*s*i+c*n*a-e*h*a-o*n*u+e*s*u)*S,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,s=t.y,a=t.z,l=r*o,c=r*s;return this.set(l*o+n,l*s-i*a,l*a+i*s,0,l*s+i*a,c*s+n,c*a-i*o,0,l*a-i*s,c*a+i*o,r*a*a+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,o){return this.set(1,n,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,o=e._y,s=e._z,a=e._w,l=r+r,c=o+o,h=s+s,u=r*l,d=r*c,p=r*h,f=o*c,m=o*h,g=s*h,v=a*l,_=a*c,y=a*h,b=n.x,x=n.y,S=n.z;return i[0]=(1-(f+g))*b,i[1]=(d+y)*b,i[2]=(p-_)*b,i[3]=0,i[4]=(d-y)*x,i[5]=(1-(u+g))*x,i[6]=(m+v)*x,i[7]=0,i[8]=(p+_)*S,i[9]=(m-v)*S,i[10]=(1-(u+f))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=hf.set(i[0],i[1],i[2]).length();const o=hf.set(i[4],i[5],i[6]).length(),s=hf.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],uf.copy(this);const a=1/r,l=1/o,c=1/s;return uf.elements[0]*=a,uf.elements[1]*=a,uf.elements[2]*=a,uf.elements[4]*=l,uf.elements[5]*=l,uf.elements[6]*=l,uf.elements[8]*=c,uf.elements[9]*=c,uf.elements[10]*=c,e.setFromRotationMatrix(uf),n.x=r,n.y=o,n.z=s,this}makePerspective(t,e,n,i,r,o,s=2e3){const a=this.elements,l=2*r/(e-t),c=2*r/(n-i),h=(e+t)/(e-t),u=(n+i)/(n-i);let d,p;if(s===zd)d=-(o+r)/(o-r),p=-2*o*r/(o-r);else{if(s!==Hd)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);d=-o/(o-r),p=-o*r/(o-r)}return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,i,r,o,s=2e3){const a=this.elements,l=1/(e-t),c=1/(n-i),h=1/(o-r),u=(e+t)*l,d=(n+i)*c;let p,f;if(s===zd)p=(o+r)*h,f=-2*h;else{if(s!==Hd)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);p=r*h,f=-1*h}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=f,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const hf=new Ip,uf=new cf,df=new Ip(0,0,0),pf=new Ip(1,1,1),ff=new Ip,mf=new Ip,gf=new Ip,vf=new cf,_f=new Lp;class yf{constructor(t=0,e=0,n=0,i=yf.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],o=i[4],s=i[8],a=i[1],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(Yd(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Yd(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Yd(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-Yd(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(Yd(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-Yd(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return vf.makeRotationFromQuaternion(t),this.setFromRotationMatrix(vf,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return _f.setFromEuler(this),this.setFromQuaternion(_f,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}yf.DEFAULT_ORDER="XYZ";class bf{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return 0!==(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let xf=0;const Sf=new Ip,wf=new Lp,Mf=new cf,Tf=new Ip,Af=new Ip,Ef=new Ip,Cf=new Lp,Rf=new Ip(1,0,0),Pf=new Ip(0,1,0),Lf=new Ip(0,0,1),If={type:"added"},Of={type:"removed"},kf={type:"childadded",child:null},Uf={type:"childremoved",child:null};class Df extends Wd{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:xf++}),this.uuid=$d(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Df.DEFAULT_UP.clone();const t=new Ip,e=new yf,n=new Lp,i=new Ip(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new cf},normalMatrix:{value:new ip}}),this.matrix=new cf,this.matrixWorld=new cf,this.matrixAutoUpdate=Df.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Df.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new bf,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return wf.setFromAxisAngle(t,e),this.quaternion.multiply(wf),this}rotateOnWorldAxis(t,e){return wf.setFromAxisAngle(t,e),this.quaternion.premultiply(wf),this}rotateX(t){return this.rotateOnAxis(Rf,t)}rotateY(t){return this.rotateOnAxis(Pf,t)}rotateZ(t){return this.rotateOnAxis(Lf,t)}translateOnAxis(t,e){return Sf.copy(t).applyQuaternion(this.quaternion),this.position.add(Sf.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Rf,t)}translateY(t){return this.translateOnAxis(Pf,t)}translateZ(t){return this.translateOnAxis(Lf,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Mf.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Tf.copy(t):Tf.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Af.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Mf.lookAt(Af,Tf,this.up):Mf.lookAt(Tf,Af,this.up),this.quaternion.setFromRotationMatrix(Mf),i&&(Mf.extractRotation(i.matrixWorld),wf.setFromRotationMatrix(Mf),this.quaternion.premultiply(wf.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(If),kf.child=t,this.dispatchEvent(kf),kf.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Of),Uf.child=t,this.dispatchEvent(Uf),Uf.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Mf.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Mf.multiply(t.parent.matrixWorld)),t.applyMatrix4(Mf),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const i=this.children;for(let r=0,o=i.length;r<o;r++)i[r].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Af,t,Ef),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Af,Cf,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++){const i=e[n];!0!==i.matrixWorldAutoUpdate&&!0!==t||i.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=o(t.geometries),i=o(t.materials),r=o(t.textures),s=o(t.images),a=o(t.shapes),l=o(t.skeletons),c=o(t.animations),h=o(t.nodes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),a.length>0&&(n.shapes=a),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function o(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}}Df.DEFAULT_UP=new Ip(0,1,0),Df.DEFAULT_MATRIX_AUTO_UPDATE=!0,Df.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Nf=new Ip,Bf=new Ip,Ff=new Ip,zf=new Ip,Hf=new Ip,Wf=new Ip,Vf=new Ip,Gf=new Ip,jf=new Ip,Xf=new Ip;class $f{constructor(t=new Ip,e=new Ip,n=new Ip){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),Nf.subVectors(t,e),i.cross(Nf);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Nf.subVectors(i,e),Bf.subVectors(n,e),Ff.subVectors(t,e);const o=Nf.dot(Nf),s=Nf.dot(Bf),a=Nf.dot(Ff),l=Bf.dot(Bf),c=Bf.dot(Ff),h=o*l-s*s;if(0===h)return r.set(0,0,0),null;const u=1/h,d=(l*a-s*c)*u,p=(o*c-s*a)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return null!==this.getBarycoord(t,e,n,i,zf)&&(zf.x>=0&&zf.y>=0&&zf.x+zf.y<=1)}static getInterpolation(t,e,n,i,r,o,s,a){return null===this.getBarycoord(t,e,n,i,zf)?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(r,zf.x),a.addScaledVector(o,zf.y),a.addScaledVector(s,zf.z),a)}static isFrontFacing(t,e,n,i){return Nf.subVectors(n,e),Bf.subVectors(t,e),Nf.cross(Bf).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Nf.subVectors(this.c,this.b),Bf.subVectors(this.a,this.b),.5*Nf.cross(Bf).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return $f.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return $f.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,r){return $f.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return $f.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return $f.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let o,s;Hf.subVectors(i,n),Wf.subVectors(r,n),Gf.subVectors(t,n);const a=Hf.dot(Gf),l=Wf.dot(Gf);if(a<=0&&l<=0)return e.copy(n);jf.subVectors(t,i);const c=Hf.dot(jf),h=Wf.dot(jf);if(c>=0&&h<=c)return e.copy(i);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return o=a/(a-c),e.copy(n).addScaledVector(Hf,o);Xf.subVectors(t,r);const d=Hf.dot(Xf),p=Wf.dot(Xf);if(p>=0&&d<=p)return e.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),e.copy(n).addScaledVector(Wf,s);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return Vf.subVectors(r,i),s=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(Vf,s);const g=1/(m+f+u);return o=f*g,s=u*g,e.copy(n).addScaledVector(Hf,o).addScaledVector(Wf,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Yf={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},qf={h:0,s:0,l:0},Zf={h:0,s:0,l:0};function Kf(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class Jf{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=bd){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,gp.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=gp.workingColorSpace){return this.r=t,this.g=e,this.b=n,gp.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=gp.workingColorSpace){if(t=qd(t,1),e=Yd(e,0,1),n=Yd(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Kf(r,i,t+1/3),this.g=Kf(r,i,t),this.b=Kf(r,i,t-1/3)}return gp.toWorkingColorSpace(this,i),this}setStyle(t,e=bd){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const o=i[1],s=i[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=bd){const n=Yf[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=vp(t.r),this.g=vp(t.g),this.b=vp(t.b),this}copyLinearToSRGB(t){return this.r=_p(t.r),this.g=_p(t.g),this.b=_p(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=bd){return gp.fromWorkingColorSpace(Qf.copy(this),t),65536*Math.round(Yd(255*Qf.r,0,255))+256*Math.round(Yd(255*Qf.g,0,255))+Math.round(Yd(255*Qf.b,0,255))}getHexString(t=bd){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=gp.workingColorSpace){gp.fromWorkingColorSpace(Qf.copy(this),e);const n=Qf.r,i=Qf.g,r=Qf.b,o=Math.max(n,i,r),s=Math.min(n,i,r);let a,l;const c=(s+o)/2;if(s===o)a=0,l=0;else{const t=o-s;switch(l=c<=.5?t/(o+s):t/(2-o-s),o){case n:a=(i-r)/t+(i<r?6:0);break;case i:a=(r-n)/t+2;break;case r:a=(n-i)/t+4}a/=6}return t.h=a,t.s=l,t.l=c,t}getRGB(t,e=gp.workingColorSpace){return gp.fromWorkingColorSpace(Qf.copy(this),e),t.r=Qf.r,t.g=Qf.g,t.b=Qf.b,t}getStyle(t=bd){gp.fromWorkingColorSpace(Qf.copy(this),t);const e=Qf.r,n=Qf.g,i=Qf.b;return t!==bd?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(t,e,n){return this.getHSL(qf),this.setHSL(qf.h+t,qf.s+e,qf.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(qf),t.getHSL(Zf);const n=Zd(qf.h,Zf.h,e),i=Zd(qf.s,Zf.s,e),r=Zd(qf.l,Zf.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Qf=new Jf;Jf.NAMES=Yf;let tm=0;class em extends Wd{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:tm++}),this.uuid=$d(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Gh,this.blendDst=jh,this.blendEquation=Nh,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Jf(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Cd,this.stencilZFail=Cd,this.stencilZPass=Cd,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),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(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).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(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).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(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).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),this.blendSrc!==Gh&&(n.blendSrc=this.blendSrc),this.blendDst!==jh&&(n.blendDst=this.blendDst),this.blendEquation!==Nh&&(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!==Cd&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Cd&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Cd&&(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),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class nm extends em{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Jf(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new yf,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const im=rm();function rm(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),i=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(i[t]=0,i[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(i[t]=1024>>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),a=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,o[t]=e|n}for(let t=1024;t<2048;++t)o[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)s[t]=t<<23;s[31]=1199570944,s[32]=2147483648;for(let t=33;t<63;++t)s[t]=2147483648+(t-32<<23);s[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:o,exponentTable:s,offsetTable:a}}function om(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Yd(t,-65504,65504),im.floatView[0]=t;const e=im.uint32View[0],n=e>>23&511;return im.baseTable[n]+((8388607&e)>>im.shiftTable[n])}function sm(t){const e=t>>10;return im.uint32View[0]=im.mantissaTable[im.offsetTable[e]+(1023&t)]+im.exponentTable[e],im.floatView[0]}const am={toHalfFloat:om,fromHalfFloat:sm},lm=new Ip,cm=new np;class hm{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=Nd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Su,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return up("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)cm.fromBufferAttribute(this,e),cm.applyMatrix3(t),this.setXY(e,cm.x,cm.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)lm.fromBufferAttribute(this,e),lm.applyMatrix3(t),this.setXYZ(e,lm.x,lm.y,lm.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)lm.fromBufferAttribute(this,e),lm.applyMatrix4(t),this.setXYZ(e,lm.x,lm.y,lm.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)lm.fromBufferAttribute(this,e),lm.applyNormalMatrix(t),this.setXYZ(e,lm.x,lm.y,lm.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)lm.fromBufferAttribute(this,e),lm.transformDirection(t),this.setXYZ(e,lm.x,lm.y,lm.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Qd(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=tp(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Qd(e,this.array)),e}setX(t,e){return this.normalized&&(e=tp(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Qd(e,this.array)),e}setY(t,e){return this.normalized&&(e=tp(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Qd(e,this.array)),e}setZ(t,e){return this.normalized&&(e=tp(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Qd(e,this.array)),e}setW(t,e){return this.normalized&&(e=tp(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array),i=tp(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array),i=tp(i,this.array),r=tp(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==Nd&&(t.usage=this.usage),t}}class um extends hm{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class dm extends hm{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class pm extends hm{constructor(t,e,n){super(new Float32Array(t),e,n)}}let fm=0;const mm=new cf,gm=new Df,vm=new Ip,_m=new Up,ym=new Up,bm=new Ip;class xm extends Wd{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:fm++}),this.uuid=$d(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(op(t)?dm:um)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new ip).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return mm.makeRotationFromQuaternion(t),this.applyMatrix4(mm),this}rotateX(t){return mm.makeRotationX(t),this.applyMatrix4(mm),this}rotateY(t){return mm.makeRotationY(t),this.applyMatrix4(mm),this}rotateZ(t){return mm.makeRotationZ(t),this.applyMatrix4(mm),this}translate(t,e,n){return mm.makeTranslation(t,e,n),this.applyMatrix4(mm),this}scale(t,e,n){return mm.makeScale(t,e,n),this.applyMatrix4(mm),this}lookAt(t){return gm.lookAt(t),gm.updateMatrix(),this.applyMatrix4(gm.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(vm).negate(),this.translate(vm.x,vm.y,vm.z),this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new pm(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Up);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new Ip(-1/0,-1/0,-1/0),new Ip(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];_m.setFromBufferAttribute(n),this.morphTargetsRelative?(bm.addVectors(this.boundingBox.min,_m.min),this.boundingBox.expandByPoint(bm),bm.addVectors(this.boundingBox.max,_m.max),this.boundingBox.expandByPoint(bm)):(this.boundingBox.expandByPoint(_m.min),this.boundingBox.expandByPoint(_m.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)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Qp);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new Ip,1/0);if(t){const n=this.boundingSphere.center;if(_m.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];ym.setFromBufferAttribute(n),this.morphTargetsRelative?(bm.addVectors(_m.min,ym.min),_m.expandByPoint(bm),bm.addVectors(_m.max,ym.max),_m.expandByPoint(bm)):(_m.expandByPoint(ym.min),_m.expandByPoint(ym.max))}_m.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)bm.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(bm));if(e)for(let r=0,o=e.length;r<o;r++){const o=e[r],s=this.morphTargetsRelative;for(let e=0,r=o.count;e<r;e++)bm.fromBufferAttribute(o,e),s&&(vm.fromBufferAttribute(t,e),bm.add(vm)),i=Math.max(i,n.distanceToSquared(bm))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,i=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new hm(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),s=[],a=[];for(let t=0;t<n.count;t++)s[t]=new Ip,a[t]=new Ip;const l=new Ip,c=new Ip,h=new Ip,u=new np,d=new np,p=new np,f=new Ip,m=new Ip;function g(t,e,i){l.fromBufferAttribute(n,t),c.fromBufferAttribute(n,e),h.fromBufferAttribute(n,i),u.fromBufferAttribute(r,t),d.fromBufferAttribute(r,e),p.fromBufferAttribute(r,i),c.sub(l),h.sub(l),d.sub(u),p.sub(u);const o=1/(d.x*p.y-p.x*d.y);isFinite(o)&&(f.copy(c).multiplyScalar(p.y).addScaledVector(h,-d.y).multiplyScalar(o),m.copy(h).multiplyScalar(d.x).addScaledVector(c,-p.x).multiplyScalar(o),s[t].add(f),s[e].add(f),s[i].add(f),a[t].add(m),a[e].add(m),a[i].add(m))}let v=this.groups;0===v.length&&(v=[{start:0,count:t.count}]);for(let e=0,n=v.length;e<n;++e){const n=v[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)g(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const _=new Ip,y=new Ip,b=new Ip,x=new Ip;function S(t){b.fromBufferAttribute(i,t),x.copy(b);const e=s[t];_.copy(e),_.sub(b.multiplyScalar(b.dot(e))).normalize(),y.crossVectors(x,e);const n=y.dot(a[t])<0?-1:1;o.setXYZW(t,_.x,_.y,_.z,n)}for(let e=0,n=v.length;e<n;++e){const n=v[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)S(t.getX(e+0)),S(t.getX(e+1)),S(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new hm(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new Ip,r=new Ip,o=new Ip,s=new Ip,a=new Ip,l=new Ip,c=new Ip,h=new Ip;if(t)for(let u=0,d=t.count;u<d;u+=3){const d=t.getX(u+0),p=t.getX(u+1),f=t.getX(u+2);i.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),o.fromBufferAttribute(e,f),c.subVectors(o,r),h.subVectors(i,r),c.cross(h),s.fromBufferAttribute(n,d),a.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),s.add(c),a.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let t=0,s=e.count;t<s;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),c.subVectors(o,r),h.subVectors(i,r),c.cross(h),n.setXYZ(t+0,c.x,c.y,c.z),n.setXYZ(t+1,c.x,c.y,c.z),n.setXYZ(t+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)bm.fromBufferAttribute(t,e),bm.normalize(),t.setXYZ(e,bm.x,bm.y,bm.z)}toNonIndexed(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,o=new n.constructor(e.length*i);let s=0,a=0;for(let r=0,l=e.length;r<l;r++){s=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*i;for(let t=0;t<i;t++)o[a++]=n[s++]}return new hm(o,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new xm,n=this.index.array,i=this.attributes;for(const r in i){const o=t(i[r],n);e.setAttribute(r,o)}const r=this.morphAttributes;for(const i in r){const o=[],s=r[i];for(let e=0,i=s.length;e<i;e++){const i=t(s[e],n);o.push(i)}e.morphAttributes[i]=o}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let t=0,n=o.length;t<n;t++){const n=o[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],o=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];o.push(i.toJSON(t.data))}o.length>0&&(i[e]=o,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t<r;t++)n.push(i[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let t=0,e=o.length;t<e;t++){const e=o[t];this.addGroup(e.start,e.count,e.materialIndex)}const s=t.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Sm=new cf,wm=new lf,Mm=new Qp,Tm=new Ip,Am=new Ip,Em=new Ip,Cm=new Ip,Rm=new Ip,Pm=new Ip,Lm=new np,Im=new np,Om=new np,km=new Ip,Um=new Ip,Dm=new Ip,Nm=new Ip,Bm=new Ip;class Fm extends Df{constructor(t=new xm,e=new nm){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const s=this.morphTargetInfluences;if(r&&s){Pm.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=s[n],a=r[n];0!==i&&(Rm.fromBufferAttribute(a,t),o?Pm.addScaledVector(Rm,i):Pm.addScaledVector(Rm.sub(e),i))}e.add(Pm)}return e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),Mm.copy(n.boundingSphere),Mm.applyMatrix4(r),wm.copy(t.ray).recast(t.near),!1===Mm.containsPoint(wm.origin)){if(null===wm.intersectSphere(Mm,Tm))return;if(wm.origin.distanceToSquared(Tm)>(t.far-t.near)**2)return}Sm.copy(r).invert(),wm.copy(t.ray).applyMatrix4(Sm),null!==n.boundingBox&&!1===wm.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,wm)}}_computeIntersections(t,e,n){let i;const r=this.geometry,o=this.material,s=r.index,a=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,h=r.attributes.normal,u=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(o))for(let r=0,a=u.length;r<a;r++){const a=u[r],p=o[a.materialIndex];for(let r=Math.max(a.start,d.start),o=Math.min(s.count,Math.min(a.start+a.count,d.start+d.count));r<o;r+=3){i=zm(this,p,t,n,l,c,h,s.getX(r),s.getX(r+1),s.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=a.materialIndex,e.push(i))}}else{for(let r=Math.max(0,d.start),a=Math.min(s.count,d.start+d.count);r<a;r+=3){i=zm(this,o,t,n,l,c,h,s.getX(r),s.getX(r+1),s.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}else if(void 0!==a)if(Array.isArray(o))for(let r=0,s=u.length;r<s;r++){const s=u[r],p=o[s.materialIndex];for(let r=Math.max(s.start,d.start),o=Math.min(a.count,Math.min(s.start+s.count,d.start+d.count));r<o;r+=3){i=zm(this,p,t,n,l,c,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=s.materialIndex,e.push(i))}}else{for(let r=Math.max(0,d.start),s=Math.min(a.count,d.start+d.count);r<s;r+=3){i=zm(this,o,t,n,l,c,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}}}function zm(t,e,n,i,r,o,s,a,l,c){t.getVertexPosition(a,Am),t.getVertexPosition(l,Em),t.getVertexPosition(c,Cm);const h=function(t,e,n,i,r,o,s,a){let l;if(l=1===e.side?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,0===e.side,a),null===l)return null;Bm.copy(a),Bm.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(Bm);return c<n.near||c>n.far?null:{distance:c,point:Bm.clone(),object:t}}(t,e,n,i,Am,Em,Cm,Nm);if(h){r&&(Lm.fromBufferAttribute(r,a),Im.fromBufferAttribute(r,l),Om.fromBufferAttribute(r,c),h.uv=$f.getInterpolation(Nm,Am,Em,Cm,Lm,Im,Om,new np)),o&&(Lm.fromBufferAttribute(o,a),Im.fromBufferAttribute(o,l),Om.fromBufferAttribute(o,c),h.uv1=$f.getInterpolation(Nm,Am,Em,Cm,Lm,Im,Om,new np)),s&&(km.fromBufferAttribute(s,a),Um.fromBufferAttribute(s,l),Dm.fromBufferAttribute(s,c),h.normal=$f.getInterpolation(Nm,Am,Em,Cm,km,Um,Dm,new Ip),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const t={a:a,b:l,c:c,normal:new Ip,materialIndex:0};$f.getNormal(Am,Em,Cm,t.normal),h.face=t}return h}class Hm extends xm{constructor(t=1,e=1,n=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};const s=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const a=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,n,i,r,o,p,f,m,g,v){const _=o/m,y=p/g,b=o/2,x=p/2,S=f/2,w=m+1,M=g+1;let T=0,A=0;const E=new Ip;for(let o=0;o<M;o++){const s=o*y-x;for(let a=0;a<w;a++){const u=a*_-b;E[t]=u*i,E[e]=s*r,E[n]=S,l.push(E.x,E.y,E.z),E[t]=0,E[e]=0,E[n]=f>0?1:-1,c.push(E.x,E.y,E.z),h.push(a/m),h.push(1-o/g),T+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const n=u+e+w*t,i=u+e+w*(t+1),r=u+(e+1)+w*(t+1),o=u+(e+1)+w*t;a.push(n,i,o),a.push(i,r,o),A+=6}s.addGroup(d,A,v),d+=A,u+=T}p("z","y","x",-1,-1,n,e,t,o,r,0),p("z","y","x",1,-1,n,e,-t,o,r,1),p("x","z","y",1,1,t,n,e,i,o,2),p("x","z","y",1,-1,t,n,-e,i,o,3),p("x","y","z",1,-1,t,e,n,i,r,4),p("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(a),this.setAttribute("position",new pm(l,3)),this.setAttribute("normal",new pm(c,3)),this.setAttribute("uv",new pm(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Hm(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Wm(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function Vm(t){const e={};for(let n=0;n<t.length;n++){const i=Wm(t[n]);for(const t in i)e[t]=i[t]}return e}function Gm(t){return null===t.getRenderTarget()?t.outputColorSpace:gp.workingColorSpace}const jm={clone:Wm,merge:Vm};class Xm extends em{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Wm(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class $m extends Df{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new cf,this.projectionMatrix=new cf,this.projectionMatrixInverse=new cf,this.coordinateSystem=zd}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const Ym=new Ip,qm=new np,Zm=new np;class Km extends $m{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Xd*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*jd*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Xd*Math.atan(Math.tan(.5*jd*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Ym.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Ym.x,Ym.y).multiplyScalar(-t/Ym.z),Ym.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Ym.x,Ym.y).multiplyScalar(-t/Ym.z)}getViewSize(t,e){return this.getViewBounds(t,qm,Zm),e.subVectors(Zm,qm)}setViewOffset(t,e,n,i,r,o){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*jd*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/t,e-=o.offsetY*n/s,i*=o.width/t,n*=o.height/s}const s=this.filmOffset;0!==s&&(r+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Jm=-90;class Qm extends Df{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Km(Jm,1,t,e);i.layers=this.layers,this.add(i);const r=new Km(Jm,1,t,e);r.layers=this.layers,this.add(r);const o=new Km(Jm,1,t,e);o.layers=this.layers,this.add(o);const s=new Km(Jm,1,t,e);s.layers=this.layers,this.add(s);const a=new Km(Jm,1,t,e);a.layers=this.layers,this.add(a);const l=new Km(Jm,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,o,s,a]=e;for(const t of e)this.remove(t);if(t===zd)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(t!==Hd)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,o,s,a,l,c]=this.children,h=t.getRenderTarget(),u=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,r),t.setRenderTarget(n,1,i),t.render(e,o),t.setRenderTarget(n,2,i),t.render(e,s),t.setRenderTarget(n,3,i),t.render(e,a),t.setRenderTarget(n,4,i),t.render(e,l),n.texture.generateMipmaps=f,t.setRenderTarget(n,5,i),t.render(e,c),t.setRenderTarget(h,u,d),t.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class tg extends Tp{constructor(t,e,n,i,r,o,s,a,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:ru,n,i,r,o,s,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class eg extends Cp{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new tg(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:mu}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{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"},i=new Hm(5,5,5),r=new Xm({name:"CubemapFromEquirect",uniforms:Wm(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const o=new Fm(i,r),s=e.minFilter;e.minFilter===vu&&(e.minFilter=mu);return new Qm(1,10,this).update(t,o),e.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}const ng=new Ip,ig=new Ip,rg=new ip;class og{constructor(t=new Ip(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=ng.subVectors(n,e).cross(ig.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(ng),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||rg.getNormalMatrix(t),i=this.coplanarPoint(ng).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const sg=new Qp,ag=new Ip;class lg{constructor(t=new og,e=new og,n=new og,i=new og,r=new og,o=new og){this.planes=[t,e,n,i,r,o]}set(t,e,n,i,r,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(o),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],o=i[1],s=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],_=i[14],y=i[15];if(n[0].setComponents(a-r,u-l,m-d,y-g).normalize(),n[1].setComponents(a+r,u+l,m+d,y+g).normalize(),n[2].setComponents(a+o,u+c,m+p,y+v).normalize(),n[3].setComponents(a-o,u-c,m-p,y-v).normalize(),n[4].setComponents(a-s,u-h,m-f,y-_).normalize(),e===zd)n[5].setComponents(a+s,u+h,m+f,y+_).normalize();else{if(e!==Hd)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(s,h,f,_).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),sg.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),sg.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(sg)}intersectsSprite(t){return sg.center.set(0,0,0),sg.radius=.7071067811865476,sg.applyMatrix4(t.matrixWorld),this.intersectsSphere(sg)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<i)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(ag.x=i.normal.x>0?t.max.x:t.min.x,ag.y=i.normal.y>0?t.max.y:t.min.y,ag.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(ag)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function cg(){let t=null,e=!1,n=null,i=null;function r(e,o){n(e,o),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function hg(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version<e.version)&&i.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const o=i.get(e);if(void 0===o)i.set(e,function(e,i){const r=e.array,o=e.usage,s=r.byteLength,a=t.createBuffer();let l;if(t.bindBuffer(i,a),t.bufferData(i,r,o),e.onUploadCallback(),r instanceof Float32Array)l=t.FLOAT;else if(r instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");l=t.HALF_FLOAT}else l=t.UNSIGNED_SHORT;else if(r instanceof Int16Array)l=t.SHORT;else if(r instanceof Uint32Array)l=t.UNSIGNED_INT;else if(r instanceof Int32Array)l=t.INT;else if(r instanceof Int8Array)l=t.BYTE;else if(r instanceof Uint8Array)l=t.UNSIGNED_BYTE;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);l=t.UNSIGNED_BYTE}return{buffer:a,type:l,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version,size:s}}(e,r));else if(o.version<e.version){if(o.size!==e.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(e,i,r){const o=i.array,s=i._updateRange,a=i.updateRanges;if(t.bindBuffer(r,e),-1===s.count&&0===a.length&&t.bufferSubData(r,0,o),0!==a.length){for(let e=0,i=a.length;e<i;e++){const i=a[e];n?t.bufferSubData(r,i.start*o.BYTES_PER_ELEMENT,o,i.start,i.count):t.bufferSubData(r,i.start*o.BYTES_PER_ELEMENT,o.subarray(i.start,i.start+i.count))}i.clearUpdateRanges()}-1!==s.count&&(n?t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1),i.onUploadCallback()}(o.buffer,e,r),o.version=e.version}}}}class ug extends xm{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2,o=e/2,s=Math.floor(n),a=Math.floor(i),l=s+1,c=a+1,h=t/s,u=e/a,d=[],p=[],f=[],m=[];for(let t=0;t<c;t++){const e=t*u-o;for(let n=0;n<l;n++){const i=n*h-r;p.push(i,-e,0),f.push(0,0,1),m.push(n/s),m.push(1-t/a)}}for(let t=0;t<a;t++)for(let e=0;e<s;e++){const n=e+l*t,i=e+l*(t+1),r=e+1+l*(t+1),o=e+1+l*t;d.push(n,i,o),d.push(i,r,o)}this.setIndex(d),this.setAttribute("position",new pm(p,3)),this.setAttribute("normal",new pm(f,3)),this.setAttribute("uv",new pm(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ug(t.width,t.height,t.widthSegments,t.heightSegments)}}const dg={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\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\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#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\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 )\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 )\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",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}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\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\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:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\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}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\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_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",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\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\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_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\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.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.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.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_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\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 ) && defined( MORPHTARGETS_TEXTURE )\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\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\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.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( 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( 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 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 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 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\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\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\tfloat hard_shadow = step( compare , distribution.x );\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 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 shadow;\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 shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\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 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 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 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.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.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.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 OptimizedCineonToneMapping( 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\tfloat startCompression = 0.8 - 0.04;\n\tfloat 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(1, 1, 1), 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.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 ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\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\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\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#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_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 * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\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}"},pg={common:{diffuse:{value:new Jf(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ip},alphaMap:{value:null},alphaMapTransform:{value:new ip},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ip}},envmap:{envMap:{value:null},envMapRotation:{value:new ip},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ip}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ip}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ip},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ip},normalScale:{value:new np(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ip},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ip}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ip}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ip}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Jf(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Jf(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ip},alphaTest:{value:0},uvTransform:{value:new ip}},sprite:{diffuse:{value:new Jf(16777215)},opacity:{value:1},center:{value:new np(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ip},alphaMap:{value:null},alphaMapTransform:{value:new ip},alphaTest:{value:0}}},fg={basic:{uniforms:Vm([pg.common,pg.specularmap,pg.envmap,pg.aomap,pg.lightmap,pg.fog]),vertexShader:dg.meshbasic_vert,fragmentShader:dg.meshbasic_frag},lambert:{uniforms:Vm([pg.common,pg.specularmap,pg.envmap,pg.aomap,pg.lightmap,pg.emissivemap,pg.bumpmap,pg.normalmap,pg.displacementmap,pg.fog,pg.lights,{emissive:{value:new Jf(0)}}]),vertexShader:dg.meshlambert_vert,fragmentShader:dg.meshlambert_frag},phong:{uniforms:Vm([pg.common,pg.specularmap,pg.envmap,pg.aomap,pg.lightmap,pg.emissivemap,pg.bumpmap,pg.normalmap,pg.displacementmap,pg.fog,pg.lights,{emissive:{value:new Jf(0)},specular:{value:new Jf(1118481)},shininess:{value:30}}]),vertexShader:dg.meshphong_vert,fragmentShader:dg.meshphong_frag},standard:{uniforms:Vm([pg.common,pg.envmap,pg.aomap,pg.lightmap,pg.emissivemap,pg.bumpmap,pg.normalmap,pg.displacementmap,pg.roughnessmap,pg.metalnessmap,pg.fog,pg.lights,{emissive:{value:new Jf(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:dg.meshphysical_vert,fragmentShader:dg.meshphysical_frag},toon:{uniforms:Vm([pg.common,pg.aomap,pg.lightmap,pg.emissivemap,pg.bumpmap,pg.normalmap,pg.displacementmap,pg.gradientmap,pg.fog,pg.lights,{emissive:{value:new Jf(0)}}]),vertexShader:dg.meshtoon_vert,fragmentShader:dg.meshtoon_frag},matcap:{uniforms:Vm([pg.common,pg.bumpmap,pg.normalmap,pg.displacementmap,pg.fog,{matcap:{value:null}}]),vertexShader:dg.meshmatcap_vert,fragmentShader:dg.meshmatcap_frag},points:{uniforms:Vm([pg.points,pg.fog]),vertexShader:dg.points_vert,fragmentShader:dg.points_frag},dashed:{uniforms:Vm([pg.common,pg.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:dg.linedashed_vert,fragmentShader:dg.linedashed_frag},depth:{uniforms:Vm([pg.common,pg.displacementmap]),vertexShader:dg.depth_vert,fragmentShader:dg.depth_frag},normal:{uniforms:Vm([pg.common,pg.bumpmap,pg.normalmap,pg.displacementmap,{opacity:{value:1}}]),vertexShader:dg.meshnormal_vert,fragmentShader:dg.meshnormal_frag},sprite:{uniforms:Vm([pg.sprite,pg.fog]),vertexShader:dg.sprite_vert,fragmentShader:dg.sprite_frag},background:{uniforms:{uvTransform:{value:new ip},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:dg.background_vert,fragmentShader:dg.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ip}},vertexShader:dg.backgroundCube_vert,fragmentShader:dg.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:dg.cube_vert,fragmentShader:dg.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:dg.equirect_vert,fragmentShader:dg.equirect_frag},distanceRGBA:{uniforms:Vm([pg.common,pg.displacementmap,{referencePosition:{value:new Ip},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:dg.distanceRGBA_vert,fragmentShader:dg.distanceRGBA_frag},shadow:{uniforms:Vm([pg.lights,pg.fog,{color:{value:new Jf(0)},opacity:{value:1}}]),vertexShader:dg.shadow_vert,fragmentShader:dg.shadow_frag}};fg.physical={uniforms:Vm([fg.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ip},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ip},clearcoatNormalScale:{value:new np(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ip},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ip},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ip},sheen:{value:0},sheenColor:{value:new Jf(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ip},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ip},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ip},transmissionSamplerSize:{value:new np},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ip},attenuationDistance:{value:0},attenuationColor:{value:new Jf(0)},specularColor:{value:new Jf(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ip},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ip},anisotropyVector:{value:new np},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ip}}]),vertexShader:dg.meshphysical_vert,fragmentShader:dg.meshphysical_frag};const mg={r:0,b:0,g:0},gg=new yf,vg=new cf;function _g(t,e,n,i,r,o,s){const a=new Jf(0);let l,c,h=!0===o?0:1,u=null,d=0,p=null;function f(e,n){e.getRGB(mg,Gm(t)),i.buffers.color.setClear(mg.r,mg.g,mg.b,n,s)}return{getClearColor:function(){return a},setClearColor:function(t,e=1){a.set(t),h=e,f(a,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,f(a,h)},render:function(o,m){let g=!1,v=!0===m.isScene?m.background:null;if(v&&v.isTexture){v=(m.backgroundBlurriness>0?n:e).get(v)}null===v?f(a,h):v&&v.isColor&&(f(v,1),g=!0);const _=t.xr.getEnvironmentBlendMode();"additive"===_?i.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===_&&i.buffers.color.setClear(0,0,0,0,s),(t.autoClear||g)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.mapping===lu)?(void 0===c&&(c=new Fm(new Hm(1,1,1),new Xm({name:"BackgroundCubeMaterial",uniforms:Wm(fg.backgroundCube.uniforms),vertexShader:fg.backgroundCube.vertexShader,fragmentShader:fg.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),gg.copy(m.backgroundRotation),gg.x*=-1,gg.y*=-1,gg.z*=-1,v.isCubeTexture&&!1===v.isRenderTargetTexture&&(gg.y*=-1,gg.z*=-1),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(vg.makeRotationFromEuler(gg)),c.material.toneMapped=gp.getTransfer(v.colorSpace)!==Td,u===v&&d===v.version&&p===t.toneMapping||(c.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),c.layers.enableAll(),o.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(void 0===l&&(l=new Fm(new ug(2,2),new Xm({name:"BackgroundMaterial",uniforms:Wm(fg.background.uniforms),vertexShader:fg.background.vertexShader,fragmentShader:fg.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=v,l.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,l.material.toneMapped=gp.getTransfer(v.colorSpace)!==Td,!0===v.matrixAutoUpdate&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),u===v&&d===v.version&&p===t.toneMapping||(l.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),l.layers.enableAll(),o.unshift(l,l.geometry,l.material,0,0,null))}}}function yg(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=i.isWebGL2?null:e.get("OES_vertex_array_object"),s=i.isWebGL2||null!==o,a={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function p(t){const e=[],n=[],i=[];for(let t=0;t<r;t++)e[t]=0,n[t]=0,i[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:i,object:t,attributes:{},index:null}}function f(){const t=c.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function m(t){g(t,0)}function g(n,r){const o=c.newAttributes,s=c.enabledAttributes,a=c.attributeDivisors;if(o[n]=1,0===s[n]&&(t.enableVertexAttribArray(n),s[n]=1),a[n]!==r){(i.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),a[n]=r}}function v(){const e=c.newAttributes,n=c.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==e[i]&&(t.disableVertexAttribArray(i),n[i]=0)}function _(e,n,i,r,o,s,a){!0===a?t.vertexAttribIPointer(e,n,i,o,s):t.vertexAttribPointer(e,n,i,r,o,s)}function y(){b(),h=!0,c!==l&&(c=l,u(c.object))}function b(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(r,l,d,y,b){let x=!1;if(s){const e=function(e,n,r){const s=!0===r.wireframe;let l=a[e.id];void 0===l&&(l={},a[e.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let h=c[s];void 0===h&&(h=p(i.isWebGL2?t.createVertexArray():o.createVertexArrayOES()),c[s]=h);return h}(y,d,l);c!==e&&(c=e,u(c.object)),x=function(t,e,n,i){const r=c.attributes,o=e.attributes;let s=0;const a=n.getAttributes();for(const e in a){if(a[e].location>=0){const n=r[e];let i=o[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;s++}}return c.attributesNum!==s||c.index!==i}(r,y,d,b),x&&function(t,e,n,i){const r={},o=e.attributes;let s=0;const a=n.getAttributes();for(const e in a){if(a[e].location>=0){let n=o[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,s++}}c.attributes=r,c.attributesNum=s,c.index=i}(r,y,d,b)}else{const t=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===t||(c.geometry=y.id,c.program=d.id,c.wireframe=t,x=!0)}null!==b&&n.update(b,t.ELEMENT_ARRAY_BUFFER),(x||h)&&(h=!1,function(r,o,s,a){if(!1===i.isWebGL2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const l=a.attributes,c=s.getAttributes(),h=o.defaultAttributeValues;for(const e in c){const o=c[e];if(o.location>=0){let s=l[e];if(void 0===s&&("instanceMatrix"===e&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){const e=s.normalized,l=s.itemSize,c=n.get(s);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||s.gpuType===bu);if(s.isInterleavedBufferAttribute){const n=s.data,i=n.stride,c=s.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<o.locationSize;t++)g(o.location+t,n.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let t=0;t<o.locationSize;t++)m(o.location+t);t.bindBuffer(t.ARRAY_BUFFER,h);for(let t=0;t<o.locationSize;t++)_(o.location+t,l/o.locationSize,u,e,i*d,(c+l/o.locationSize*t)*d,p)}else{if(s.isInstancedBufferAttribute){for(let t=0;t<o.locationSize;t++)g(o.location+t,s.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let t=0;t<o.locationSize;t++)m(o.location+t);t.bindBuffer(t.ARRAY_BUFFER,h);for(let t=0;t<o.locationSize;t++)_(o.location+t,l/o.locationSize,u,e,l*d,l/o.locationSize*t*d,p)}}else if(void 0!==h){const n=h[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(o.location,n);break;case 3:t.vertexAttrib3fv(o.location,n);break;case 4:t.vertexAttrib4fv(o.location,n);break;default:t.vertexAttrib1fv(o.location,n)}}}}v()}(r,l,d,y),null!==b&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){y();for(const t in a){const e=a[t];for(const t in e){const n=e[t];for(const t in n)d(n[t].object),delete n[t];delete e[t]}delete a[t]}},releaseStatesOfGeometry:function(t){if(void 0===a[t.id])return;const e=a[t.id];for(const t in e){const n=e[t];for(const t in n)d(n[t].object),delete n[t];delete e[t]}delete a[t.id]},releaseStatesOfProgram:function(t){for(const e in a){const n=a[e];if(void 0===n[t.id])continue;const i=n[t.id];for(const t in i)d(i[t].object),delete i[t];delete n[t.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:v}}function bg(t,e,n,i){const r=i.isWebGL2;let o;this.setMode=function(t){o=t},this.render=function(e,i){t.drawArrays(o,e,i),n.update(i,o,1)},this.renderInstances=function(i,s,a){if(0===a)return;let l,c;if(r)l=t,c="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](o,i,s,a),n.update(s,o,a)},this.renderMultiDraw=function(t,i,r){if(0===r)return;const s=e.get("WEBGL_multi_draw");if(null===s)for(let e=0;e<r;e++)this.render(t[e],i[e]);else{s.multiDrawArraysWEBGL(o,t,0,i,0,r);let e=0;for(let t=0;t<r;t++)e+=i[t];n.update(e,o,1)}}}function xg(t,e,n){let i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let s=void 0!==n.precision?n.precision:"highp";const a=r(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=o||e.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),m=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),v=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),_=u>0,y=o||e.has("OES_texture_float");return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:_,floatFragmentTextures:y,floatVertexTextures:_&&y,maxSamples:o?t.getParameter(t.MAX_SAMPLES):0}}function Sg(t){const e=this;let n=null,i=0,r=!1,o=!1;const s=new og,a=new ip,l={value:null,needsUpdate:!1};function c(t,n,i,r){const o=null!==t?t.length:0;let c=null;if(0!==o){if(c=l.value,!0!==r||null===c){const e=i+4*o,r=n.matrixWorldInverse;a.getNormalMatrix(r),(null===c||c.length<e)&&(c=new Float32Array(e));for(let e=0,n=i;e!==o;++e,n+=4)s.copy(t[e]).applyMatrix4(r,a),s.normal.toArray(c,n),c[n+3]=s.constant}l.value=c,l.needsUpdate=!0}return e.numPlanes=o,e.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==i||r;return r=e,i=t.length,n},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(t,e){n=c(t,e,0)},this.setState=function(s,a,h){const u=s.clippingPlanes,d=s.clipIntersection,p=s.clipShadows,f=t.get(s);if(!r||null===u||0===u.length||o&&!p)o?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=i>0);e.numPlanes=i,e.numIntersection=0}();else{const t=o?0:i,e=4*t;let r=f.clippingState||null;l.value=r,r=c(u,a,e,h);for(let t=0;t!==e;++t)r[t]=n[t];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function wg(t){let e=new WeakMap;function n(t,e){return e===su?t.mapping=ru:e===au&&(t.mapping=ou),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const o=r.mapping;if(o===su||o===au){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const o=r.image;if(o&&o.height>0){const s=new eg(o.height);return s.fromEquirectangularTexture(t,r),e.set(r,s),r.addEventListener("dispose",i),n(s.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}class Mg extends $m{constructor(t=-1,e=1,n=1,i=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,o){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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,o=n+t,s=i+e,a=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,o=r+t*this.view.width,s-=e*this.view.offsetY,a=s-e*this.view.height}this.projectionMatrix.makeOrthographic(r,o,s,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Tg=[.125,.215,.35,.446,.526,.582],Ag=20,Eg=new Mg,Cg=new Jf;let Rg=null,Pg=0,Lg=0;const Ig=(1+Math.sqrt(5))/2,Og=1/Ig,kg=[new Ip(1,1,1),new Ip(-1,1,1),new Ip(1,1,-1),new Ip(-1,1,-1),new Ip(0,Ig,Og),new Ip(0,Ig,-Og),new Ip(Og,0,Ig),new Ip(-Og,0,Ig),new Ip(Ig,Og,0),new Ip(-Ig,Og,0)];class Ug{constructor(t){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)}fromScene(t,e=0,n=.1,i=100){Rg=this._renderer.getRenderTarget(),Pg=this._renderer.getActiveCubeFace(),Lg=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Fg(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Bg(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Rg,Pg,Lg),t.scissorTest=!1,Ng(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===ru||t.mapping===ou?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Rg=this._renderer.getRenderTarget(),Pg=this._renderer.getActiveCubeFace(),Lg=this._renderer.getActiveMipmapLevel();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:mu,minFilter:mu,generateMipmaps:!1,type:wu,format:Eu,colorSpace:xd,depthBuffer:!1},i=Dg(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Dg(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],i=[];let r=t;const o=t-4+1+Tg.length;for(let s=0;s<o;s++){const o=Math.pow(2,r);n.push(o);let a=1/o;s>t-4?a=Tg[s-t+4-1]:0===s&&(a=0),i.push(a);const l=1/(o-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),_=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let t=0;t<d;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];v.set(i,f*p*t),_.set(u,m*p*t);const r=[t,t,t,t,t,t];y.set(r,g*p*t)}const b=new xm;b.setAttribute("position",new hm(v,f)),b.setAttribute("uv",new hm(_,m)),b.setAttribute("faceIndex",new hm(y,g)),e.push(b),r>4&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(Ag),r=new Ip(0,1,0),o=new Xm({name:"SphericalGaussianBlur",defines:{n:Ag,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:zg(),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});return o}(i,t,e)}return i}_compileMaterial(t){const e=new Fm(this._lodPlanes[0],t);this._renderer.compile(e,Eg)}_sceneToCubeUV(t,e,n,i){const r=new Km(90,1,e,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(Cg),a.toneMapping=0,a.autoClear=!1;const h=new nm({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),u=new Fm(new Hm,h);let d=!1;const p=t.background;p?p.isColor&&(h.color.copy(p),t.background=null,d=!0):(h.color.copy(Cg),d=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,o[e],0),r.lookAt(s[e],0,0)):1===n?(r.up.set(0,0,o[e]),r.lookAt(0,s[e],0)):(r.up.set(0,o[e],0),r.lookAt(0,0,s[e]));const l=this._cubeSize;Ng(i,n*l,e>2?l:0,l,l),a.setRenderTarget(i),d&&a.render(u,r),a.render(t,r)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=c,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===ru||t.mapping===ou;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Fg()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Bg());const r=i?this._cubemapMaterial:this._equirectMaterial,o=new Fm(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const s=this._cubeSize;Ng(e,0,0,3*s,2*s),n.setRenderTarget(e),n.render(o,Eg)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),i=kg[(e-1)%kg.length];this._blur(t,e-1,e,n,i)}e.autoClear=n}_blur(t,e,n,i,r){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",r),this._halfBlur(o,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,o,s){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new Fm(this._lodPlanes[i],l),h=l.uniforms,u=this._sizeLods[n]-1,d=isFinite(r)?Math.PI/(2*u):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):Ag;f>Ag&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<Ag;++t){const e=t/p,n=Math.exp(-e*e/2);m.push(n),0===t?g+=n:t<f&&(g+=2*n)}for(let t=0;t<m.length;t++)m[t]=m[t]/g;h.envMap.value=t.texture,h.samples.value=f,h.weights.value=m,h.latitudinal.value="latitudinal"===o,s&&(h.poleAxis.value=s);const{_lodMax:v}=this;h.dTheta.value=d,h.mipInt.value=v-n;const _=this._sizeLods[i];Ng(e,3*_*(i>v-4?i-v+4:0),4*(this._cubeSize-_),3*_,2*_),a.setRenderTarget(e),a.render(c,Eg)}}function Dg(t,e,n){const i=new Cp(t,e,n);return i.texture.mapping=lu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Ng(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function Bg(){return new Xm({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:zg(),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 Fg(){return new Xm({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:zg(),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 zg(){return"\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"}function Hg(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const o=r.mapping,s=o===su||o===au,a=o===ru||o===ou;if(s||a){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let i=e.get(r);return null===n&&(n=new Ug(t)),i=s?n.fromEquirectangular(r,i):n.fromCubemap(r,i),e.set(r,i),i.texture}if(e.has(r))return e.get(r).texture;{const o=r.image;if(s&&o&&o.height>0||a&&o&&function(t){let e=0;const n=6;for(let i=0;i<n;i++)void 0!==t[i]&&e++;return e===n}(o)){null===n&&(n=new Ug(t));const o=s?n.fromEquirectangular(r):n.fromCubemap(r);return e.set(r,o),r.addEventListener("dispose",i),o.texture}return null}}}return r},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function Wg(t){const e={};function n(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?(n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance")):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Vg(t,e,n,i){const r={},o=new WeakMap;function s(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);for(const t in a.morphAttributes){const n=a.morphAttributes[t];for(let t=0,i=n.length;t<i;t++)e.remove(n[t])}a.removeEventListener("dispose",s),delete r[a.id];const l=o.get(a);l&&(e.remove(l),o.delete(a)),i.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(t){const n=[],i=t.index,r=t.attributes.position;let s=0;if(null!==i){const t=i.array;s=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0],r=t[e+1],o=t[e+2];n.push(i,r,r,o,o,i)}}else{if(void 0===r)return;{const t=r.array;s=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0,i=e+1,r=e+2;n.push(t,i,i,r,r,t)}}}const a=new(op(n)?dm:um)(n,1);a.version=s;const l=o.get(t);l&&e.remove(l),o.set(t,a)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",s),r[e.id]=!0,n.memory.geometries++),e},update:function(n){const i=n.attributes;for(const n in i)e.update(i[n],t.ARRAY_BUFFER);const r=n.morphAttributes;for(const n in r){const i=r[n];for(let n=0,r=i.length;n<r;n++)e.update(i[n],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=o.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&a(t)}else a(t);return o.get(t)}}}function Gg(t,e,n,i){const r=i.isWebGL2;let o,s,a;this.setMode=function(t){o=t},this.setIndex=function(t){s=t.type,a=t.bytesPerElement},this.render=function(e,i){t.drawElements(o,i,s,e*a),n.update(i,o,1)},this.renderInstances=function(i,l,c){if(0===c)return;let h,u;if(r)h=t,u="drawElementsInstanced";else if(h=e.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](o,l,s,i*a,c),n.update(l,o,c)},this.renderMultiDraw=function(t,i,r){if(0===r)return;const l=e.get("WEBGL_multi_draw");if(null===l)for(let e=0;e<r;e++)this.render(t[e]/a,i[e]);else{l.multiDrawElementsWEBGL(o,i,0,s,t,0,r);let e=0;for(let t=0;t<r;t++)e+=i[t];n.update(e,o,1)}}}function jg(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,i,r){switch(e.calls++,i){case t.TRIANGLES:e.triangles+=r*(n/3);break;case t.LINES:e.lines+=r*(n/2);break;case t.LINE_STRIP:e.lines+=r*(n-1);break;case t.LINE_LOOP:e.lines+=r*n;break;case t.POINTS:e.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function Xg(t,e){return t[0]-e[0]}function $g(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Yg(t,e,n){const i={},r=new Float32Array(8),o=new WeakMap,s=new Ap,a=[];for(let t=0;t<8;t++)a[t]=[t,0];return{update:function(l,c,h){const u=l.morphTargetInfluences;if(!0===e.isWebGL2){const d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,p=void 0!==d?d.length:0;let f=o.get(c);if(void 0===f||f.count!==p){void 0!==f&&f.texture.dispose();const m=void 0!==c.morphAttributes.position,g=void 0!==c.morphAttributes.normal,v=void 0!==c.morphAttributes.color,_=c.morphAttributes.position||[],y=c.morphAttributes.normal||[],b=c.morphAttributes.color||[];let x=0;!0===m&&(x=1),!0===g&&(x=2),!0===v&&(x=3);let S=c.attributes.position.count*x,w=1;S>e.maxTextureSize&&(w=Math.ceil(S/e.maxTextureSize),S=e.maxTextureSize);const M=new Float32Array(S*w*4*p),T=new Rp(M,S,w,p);T.type=Su,T.needsUpdate=!0;const A=4*x;for(let C=0;C<p;C++){const R=_[C],P=y[C],L=b[C],I=S*w*4*C;for(let O=0;O<R.count;O++){const k=O*A;!0===m&&(s.fromBufferAttribute(R,O),M[I+k+0]=s.x,M[I+k+1]=s.y,M[I+k+2]=s.z,M[I+k+3]=0),!0===g&&(s.fromBufferAttribute(P,O),M[I+k+4]=s.x,M[I+k+5]=s.y,M[I+k+6]=s.z,M[I+k+7]=0),!0===v&&(s.fromBufferAttribute(L,O),M[I+k+8]=s.x,M[I+k+9]=s.y,M[I+k+10]=s.z,M[I+k+11]=4===L.itemSize?s.w:1)}}function E(){T.dispose(),o.delete(c),c.removeEventListener("dispose",E)}f={count:p,texture:T,size:new np(S,w)},o.set(c,f),c.addEventListener("dispose",E)}if(!0===l.isInstancedMesh&&null!==l.morphTexture)h.getUniforms().setValue(t,"morphTexture",l.morphTexture,n);else{let U=0;for(let N=0;N<u.length;N++)U+=u[N];const D=c.morphTargetsRelative?1:1-U;h.getUniforms().setValue(t,"morphTargetBaseInfluence",D),h.getUniforms().setValue(t,"morphTargetInfluences",u)}h.getUniforms().setValue(t,"morphTargetsTexture",f.texture,n),h.getUniforms().setValue(t,"morphTargetsTextureSize",f.size)}else{const B=void 0===u?0:u.length;let F=i[c.id];if(void 0===F||F.length!==B){F=[];for(let G=0;G<B;G++)F[G]=[G,0];i[c.id]=F}for(let j=0;j<B;j++){const X=F[j];X[0]=j,X[1]=u[j]}F.sort($g);for(let $=0;$<8;$++)$<B&&F[$][1]?(a[$][0]=F[$][0],a[$][1]=F[$][1]):(a[$][0]=Number.MAX_SAFE_INTEGER,a[$][1]=0);a.sort(Xg);const z=c.morphAttributes.position,H=c.morphAttributes.normal;let W=0;for(let Y=0;Y<8;Y++){const q=a[Y],Z=q[0],K=q[1];Z!==Number.MAX_SAFE_INTEGER&&K?(z&&c.getAttribute("morphTarget"+Y)!==z[Z]&&c.setAttribute("morphTarget"+Y,z[Z]),H&&c.getAttribute("morphNormal"+Y)!==H[Z]&&c.setAttribute("morphNormal"+Y,H[Z]),r[Y]=K,W+=K):(z&&!0===c.hasAttribute("morphTarget"+Y)&&c.deleteAttribute("morphTarget"+Y),H&&!0===c.hasAttribute("morphNormal"+Y)&&c.deleteAttribute("morphNormal"+Y),r[Y]=0)}const V=c.morphTargetsRelative?1:1-W;h.getUniforms().setValue(t,"morphTargetBaseInfluence",V),h.getUniforms().setValue(t,"morphTargetInfluences",r)}}}}function qg(t,e,n,i){let r=new WeakMap;function o(t){const e=t.target;e.removeEventListener("dispose",o),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(s){const a=i.render.frame,l=s.geometry,c=e.get(s,l);if(r.get(c)!==a&&(e.update(c),r.set(c,a)),s.isInstancedMesh&&(!1===s.hasEventListener("dispose",o)&&s.addEventListener("dispose",o),r.get(s)!==a&&(n.update(s.instanceMatrix,t.ARRAY_BUFFER),null!==s.instanceColor&&n.update(s.instanceColor,t.ARRAY_BUFFER),r.set(s,a))),s.isSkinnedMesh){const t=s.skeleton;r.get(t)!==a&&(t.update(),r.set(t,a))}return c},dispose:function(){r=new WeakMap}}}class Zg extends Tp{constructor(t,e,n,i,r,o,s,a,l,c){if((c=void 0!==c?c:Cu)!==Cu&&c!==Ru)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Cu&&(n=xu),void 0===n&&c===Ru&&(n=Au),super(null,i,r,o,s,a,c,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==s?s:du,this.minFilter=void 0!==a?a:du,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}const Kg=new Tp,Jg=new Zg(1,1);Jg.compareFunction=515;const Qg=new Rp,tv=new Pp,ev=new tg,nv=[],iv=[],rv=new Float32Array(16),ov=new Float32Array(9),sv=new Float32Array(4);function av(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let o=nv[r];if(void 0===o&&(o=new Float32Array(r),nv[r]=o),0!==e){i.toArray(o,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(o,r)}return o}function lv(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function cv(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function hv(t,e){let n=iv[e];void 0===n&&(n=new Int32Array(e),iv[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function uv(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function dv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(lv(n,e))return;t.uniform2fv(this.addr,e),cv(n,e)}}function pv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(lv(n,e))return;t.uniform3fv(this.addr,e),cv(n,e)}}function fv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(lv(n,e))return;t.uniform4fv(this.addr,e),cv(n,e)}}function mv(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(lv(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),cv(n,e)}else{if(lv(n,i))return;sv.set(i),t.uniformMatrix2fv(this.addr,!1,sv),cv(n,i)}}function gv(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(lv(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),cv(n,e)}else{if(lv(n,i))return;ov.set(i),t.uniformMatrix3fv(this.addr,!1,ov),cv(n,i)}}function vv(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(lv(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),cv(n,e)}else{if(lv(n,i))return;rv.set(i),t.uniformMatrix4fv(this.addr,!1,rv),cv(n,i)}}function _v(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function yv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(lv(n,e))return;t.uniform2iv(this.addr,e),cv(n,e)}}function bv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(lv(n,e))return;t.uniform3iv(this.addr,e),cv(n,e)}}function xv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(lv(n,e))return;t.uniform4iv(this.addr,e),cv(n,e)}}function Sv(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function wv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(lv(n,e))return;t.uniform2uiv(this.addr,e),cv(n,e)}}function Mv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(lv(n,e))return;t.uniform3uiv(this.addr,e),cv(n,e)}}function Tv(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(lv(n,e))return;t.uniform4uiv(this.addr,e),cv(n,e)}}function Av(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r);const o=this.type===t.SAMPLER_2D_SHADOW?Jg:Kg;n.setTexture2D(e||o,r)}function Ev(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||tv,r)}function Cv(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||ev,r)}function Rv(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||Qg,r)}function Pv(t,e){t.uniform1fv(this.addr,e)}function Lv(t,e){const n=av(e,this.size,2);t.uniform2fv(this.addr,n)}function Iv(t,e){const n=av(e,this.size,3);t.uniform3fv(this.addr,n)}function Ov(t,e){const n=av(e,this.size,4);t.uniform4fv(this.addr,n)}function kv(t,e){const n=av(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Uv(t,e){const n=av(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Dv(t,e){const n=av(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Nv(t,e){t.uniform1iv(this.addr,e)}function Bv(t,e){t.uniform2iv(this.addr,e)}function Fv(t,e){t.uniform3iv(this.addr,e)}function zv(t,e){t.uniform4iv(this.addr,e)}function Hv(t,e){t.uniform1uiv(this.addr,e)}function Wv(t,e){t.uniform2uiv(this.addr,e)}function Vv(t,e){t.uniform3uiv(this.addr,e)}function Gv(t,e){t.uniform4uiv(this.addr,e)}function jv(t,e,n){const i=this.cache,r=e.length,o=hv(n,r);lv(i,o)||(t.uniform1iv(this.addr,o),cv(i,o));for(let t=0;t!==r;++t)n.setTexture2D(e[t]||Kg,o[t])}function Xv(t,e,n){const i=this.cache,r=e.length,o=hv(n,r);lv(i,o)||(t.uniform1iv(this.addr,o),cv(i,o));for(let t=0;t!==r;++t)n.setTexture3D(e[t]||tv,o[t])}function $v(t,e,n){const i=this.cache,r=e.length,o=hv(n,r);lv(i,o)||(t.uniform1iv(this.addr,o),cv(i,o));for(let t=0;t!==r;++t)n.setTextureCube(e[t]||ev,o[t])}function Yv(t,e,n){const i=this.cache,r=e.length,o=hv(n,r);lv(i,o)||(t.uniform1iv(this.addr,o),cv(i,o));for(let t=0;t!==r;++t)n.setTexture2DArray(e[t]||Qg,o[t])}class qv{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=function(t){switch(t){case 5126:return uv;case 35664:return dv;case 35665:return pv;case 35666:return fv;case 35674:return mv;case 35675:return gv;case 35676:return vv;case 5124:case 35670:return _v;case 35667:case 35671:return yv;case 35668:case 35672:return bv;case 35669:case 35673:return xv;case 5125:return Sv;case 36294:return wv;case 36295:return Mv;case 36296:return Tv;case 35678:case 36198:case 36298:case 36306:case 35682:return Av;case 35679:case 36299:case 36307:return Ev;case 35680:case 36300:case 36308:case 36293:return Cv;case 36289:case 36303:case 36311:case 36292:return Rv}}(e.type)}}class Zv{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Pv;case 35664:return Lv;case 35665:return Iv;case 35666:return Ov;case 35674:return kv;case 35675:return Uv;case 35676:return Dv;case 5124:case 35670:return Nv;case 35667:case 35671:return Bv;case 35668:case 35672:return Fv;case 35669:case 35673:return zv;case 5125:return Hv;case 36294:return Wv;case 36295:return Vv;case 36296:return Gv;case 35678:case 36198:case 36298:case 36306:case 35682:return jv;case 35679:case 36299:case 36307:return Xv;case 35680:case 36300:case 36308:case 36293:return $v;case 36289:case 36303:case 36311:case 36292:return Yv}}(e.type)}}class Kv{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,o=i.length;r!==o;++r){const o=i[r];o.setValue(t,e[o.id],n)}}}const Jv=/(\w+)(\])?(\[|\.)?/g;function Qv(t,e){t.seq.push(e),t.map[e.id]=e}function t_(t,e,n){const i=t.name,r=i.length;for(Jv.lastIndex=0;;){const o=Jv.exec(i),s=Jv.lastIndex;let a=o[1];const l="]"===o[2],c=o[3];if(l&&(a|=0),void 0===c||"["===c&&s+2===r){Qv(n,void 0===c?new qv(a,t,e):new Zv(a,t,e));break}{let t=n.map[a];void 0===t&&(t=new Kv(a),Qv(n,t)),n=t}}}class e_{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i);t_(n,t.getUniformLocation(e,n.name),this)}}setValue(t,e,n,i){const r=this.map[e];void 0!==r&&r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];void 0!==i&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,o=e.length;r!==o;++r){const o=e[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,i)}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];r.id in e&&n.push(r)}return n}}function n_(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}let i_=0;function r_(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";const o=/ERROR: 0:(\d+)/.exec(r);if(o){const i=parseInt(o[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(t,e){const n=t.split("\n"),i=[],r=Math.max(e-6,0),o=Math.min(e+6,n.length);for(let t=r;t<o;t++){const r=t+1;i.push(`${r===e?">":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function o_(t,e){const n=function(t){const e=gp.getPrimaries(gp.workingColorSpace),n=gp.getPrimaries(t);let i;switch(e===n?i="":e===Ed&&n===Ad?i="LinearDisplayP3ToLinearSRGB":e===Ad&&n===Ed&&(i="LinearSRGBToLinearDisplayP3"),t){case xd:case wd:return[i,"LinearTransferOETF"];case bd:case Sd:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function s_(t,e){let n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";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:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function a_(t){return""!==t}function l_(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function c_(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const h_=/^[ \t]*#include +<([\w\d./]+)>/gm;function u_(t){return t.replace(h_,p_)}const d_=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function p_(t,e){let n=dg[e];if(void 0===n){const t=d_.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=dg[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return u_(n)}const f_=/#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 m_(t){return t.replace(f_,g_)}function g_(t,e,n,i){let r="";for(let t=parseInt(e);t<parseInt(n);t++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function v_(t){let e=`precision ${t.precision} float;\n\tprecision ${t.precision} int;\n\tprecision ${t.precision} sampler2D;\n\tprecision ${t.precision} samplerCube;\n\t`;return t.isWebGL2&&(e+=`precision ${t.precision} sampler3D;\n\t\tprecision ${t.precision} sampler2DArray;\n\t\tprecision ${t.precision} sampler2DShadow;\n\t\tprecision ${t.precision} samplerCubeShadow;\n\t\tprecision ${t.precision} sampler2DArrayShadow;\n\t\tprecision ${t.precision} isampler2D;\n\t\tprecision ${t.precision} isampler3D;\n\t\tprecision ${t.precision} isamplerCube;\n\t\tprecision ${t.precision} isampler2DArray;\n\t\tprecision ${t.precision} usampler2D;\n\t\tprecision ${t.precision} usampler3D;\n\t\tprecision ${t.precision} usamplerCube;\n\t\tprecision ${t.precision} usampler2DArray;\n\t\t`),"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function __(t,e,n,i){const r=t.getContext(),o=n.defines;let s=n.vertexShader,a=n.fragmentShader;const l=function(t){let e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),c=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case ru:case ou:e="ENVMAP_TYPE_CUBE";break;case lu:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),h=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===ou&&(e="ENVMAP_MODE_REFRACTION");return e}(n),u=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),d=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),p=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.alphaToCoverage||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(a_).join("\n")}(n),f=function(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(a_).join("\n")}(n),m=function(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(o),g=r.createProgram();let v,_,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(v=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,m].filter(a_).join("\n"),v.length>0&&(v+="\n"),_=[p,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,m].filter(a_).join("\n"),_.length>0&&(_+="\n")):(v=[v_(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,m,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",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 "+h:"",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&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(a_).join("\n"),_=[p,v_(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,m,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 "+c:"",n.envMap?"#define "+h:"",n.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.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.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?"#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 "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?dg.tonemapping_pars_fragment:"",0!==n.toneMapping?s_("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",dg.colorspace_pars_fragment,o_("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(a_).join("\n")),s=u_(s),s=l_(s,n),s=c_(s,n),a=u_(a),a=l_(a,n),a=c_(a,n),s=m_(s),a=m_(a),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",v=[f,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,_=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===Bd?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Bd?"":"#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"+_);const b=y+v+s,x=y+_+a,S=n_(r,r.VERTEX_SHADER,b),w=n_(r,r.FRAGMENT_SHADER,x);function M(e){if(t.debug.checkShaderErrors){const n=r.getProgramInfoLog(g).trim(),i=r.getShaderInfoLog(S).trim(),o=r.getShaderInfoLog(w).trim();let s=!0,a=!0;if(!1===r.getProgramParameter(g,r.LINK_STATUS))if(s=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(r,g,S,w);else{const t=r_(r,S,"vertex"),i=r_(r,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(g,r.VALIDATE_STATUS)+"\n\nMaterial Name: "+e.name+"\nMaterial Type: "+e.type+"\n\nProgram Info Log: "+n+"\n"+t+"\n"+i)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==i&&""!==o||(a=!1);a&&(e.diagnostics={runnable:s,programLog:n,vertexShader:{log:i,prefix:v},fragmentShader:{log:o,prefix:_}})}r.deleteShader(S),r.deleteShader(w),T=new e_(r,g),A=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r),o=i.name;let s=1;i.type===t.FLOAT_MAT2&&(s=2),i.type===t.FLOAT_MAT3&&(s=3),i.type===t.FLOAT_MAT4&&(s=4),n[o]={type:i.type,location:t.getAttribLocation(e,o),locationSize:s}}return n}(r,g)}let T,A;r.attachShader(g,S),r.attachShader(g,w),void 0!==n.index0AttributeName?r.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(g,0,"position"),r.linkProgram(g),this.getUniforms=function(){return void 0===T&&M(this),T},this.getAttributes=function(){return void 0===A&&M(this),A};let E=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===E&&(E=r.getProgramParameter(g,37297)),E},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(g),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=i_++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=S,this.fragmentShader=w,this}let y_=0;class b_{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return!1===o.has(i)&&(o.add(i),i.usedTimes++),!1===o.has(r)&&(o.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new x_(t),e.set(t,n)),n}}class x_{constructor(t){this.id=y_++,this.code=t,this.usedTimes=0}}function S_(t,e,n,i,r,o,s){const a=new bf,l=new b_,c=new Set,h=[],u=r.isWebGL2,d=r.logarithmicDepthBuffer,p=r.vertexTextures;let f=r.precision;const m={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 g(t){return c.add(t),0===t?"uv":`uv${t}`}return{getParameters:function(o,a,h,v,_){const y=v.fog,b=_.geometry,x=o.isMeshStandardMaterial?v.environment:null,S=(o.isMeshStandardMaterial?n:e).get(o.envMap||x),w=S&&S.mapping===lu?S.image.height:null,M=m[o.type];null!==o.precision&&(f=r.getMaxPrecision(o.precision),f!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",f,"instead."));const T=b.morphAttributes.position||b.morphAttributes.normal||b.morphAttributes.color,A=void 0!==T?T.length:0;let E,C,R,P,L=0;if(void 0!==b.morphAttributes.position&&(L=1),void 0!==b.morphAttributes.normal&&(L=2),void 0!==b.morphAttributes.color&&(L=3),M){const t=fg[M];E=t.vertexShader,C=t.fragmentShader}else E=o.vertexShader,C=o.fragmentShader,l.update(o),R=l.getVertexShaderID(o),P=l.getFragmentShaderID(o);const I=t.getRenderTarget(),O=!0===_.isInstancedMesh,k=!0===_.isBatchedMesh,U=!!o.map,D=!!o.matcap,N=!!S,B=!!o.aoMap,F=!!o.lightMap,z=!!o.bumpMap,H=!!o.normalMap,W=!!o.displacementMap,V=!!o.emissiveMap,G=!!o.metalnessMap,j=!!o.roughnessMap,X=o.anisotropy>0,$=o.clearcoat>0,Y=o.iridescence>0,q=o.sheen>0,Z=o.transmission>0,K=X&&!!o.anisotropyMap,J=$&&!!o.clearcoatMap,Q=$&&!!o.clearcoatNormalMap,tt=$&&!!o.clearcoatRoughnessMap,et=Y&&!!o.iridescenceMap,nt=Y&&!!o.iridescenceThicknessMap,it=q&&!!o.sheenColorMap,rt=q&&!!o.sheenRoughnessMap,ot=!!o.specularMap,st=!!o.specularColorMap,at=!!o.specularIntensityMap,lt=Z&&!!o.transmissionMap,ct=Z&&!!o.thicknessMap,ht=!!o.gradientMap,ut=!!o.alphaMap,dt=o.alphaTest>0,pt=!!o.alphaHash,ft=!!o.extensions;let mt=0;o.toneMapped&&(null!==I&&!0!==I.isXRRenderTarget||(mt=t.toneMapping));const gt={isWebGL2:u,shaderID:M,shaderType:o.type,shaderName:o.name,vertexShader:E,fragmentShader:C,defines:o.defines,customVertexShaderID:R,customFragmentShaderID:P,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:f,batching:k,instancing:O,instancingColor:O&&null!==_.instanceColor,instancingMorph:O&&null!==_.morphTexture,supportsVertexTextures:p,outputColorSpace:null===I?t.outputColorSpace:!0===I.isXRRenderTarget?I.texture.colorSpace:xd,alphaToCoverage:!!o.alphaToCoverage,map:U,matcap:D,envMap:N,envMapMode:N&&S.mapping,envMapCubeUVHeight:w,aoMap:B,lightMap:F,bumpMap:z,normalMap:H,displacementMap:p&&W,emissiveMap:V,normalMapObjectSpace:H&&1===o.normalMapType,normalMapTangentSpace:H&&0===o.normalMapType,metalnessMap:G,roughnessMap:j,anisotropy:X,anisotropyMap:K,clearcoat:$,clearcoatMap:J,clearcoatNormalMap:Q,clearcoatRoughnessMap:tt,iridescence:Y,iridescenceMap:et,iridescenceThicknessMap:nt,sheen:q,sheenColorMap:it,sheenRoughnessMap:rt,specularMap:ot,specularColorMap:st,specularIntensityMap:at,transmission:Z,transmissionMap:lt,thicknessMap:ct,gradientMap:ht,opaque:!1===o.transparent&&1===o.blending&&!1===o.alphaToCoverage,alphaMap:ut,alphaTest:dt,alphaHash:pt,combine:o.combine,mapUv:U&&g(o.map.channel),aoMapUv:B&&g(o.aoMap.channel),lightMapUv:F&&g(o.lightMap.channel),bumpMapUv:z&&g(o.bumpMap.channel),normalMapUv:H&&g(o.normalMap.channel),displacementMapUv:W&&g(o.displacementMap.channel),emissiveMapUv:V&&g(o.emissiveMap.channel),metalnessMapUv:G&&g(o.metalnessMap.channel),roughnessMapUv:j&&g(o.roughnessMap.channel),anisotropyMapUv:K&&g(o.anisotropyMap.channel),clearcoatMapUv:J&&g(o.clearcoatMap.channel),clearcoatNormalMapUv:Q&&g(o.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&g(o.clearcoatRoughnessMap.channel),iridescenceMapUv:et&&g(o.iridescenceMap.channel),iridescenceThicknessMapUv:nt&&g(o.iridescenceThicknessMap.channel),sheenColorMapUv:it&&g(o.sheenColorMap.channel),sheenRoughnessMapUv:rt&&g(o.sheenRoughnessMap.channel),specularMapUv:ot&&g(o.specularMap.channel),specularColorMapUv:st&&g(o.specularColorMap.channel),specularIntensityMapUv:at&&g(o.specularIntensityMap.channel),transmissionMapUv:lt&&g(o.transmissionMap.channel),thicknessMapUv:ct&&g(o.thicknessMap.channel),alphaMapUv:ut&&g(o.alphaMap.channel),vertexTangents:!!b.attributes.tangent&&(H||X),vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,pointsUvs:!0===_.isPoints&&!!b.attributes.uv&&(U||ut),fog:!!y,useFog:!0===o.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===o.flatShading,sizeAttenuation:!0===o.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:A,morphTextureStride:L,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:o.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:mt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:U&&!0===o.map.isVideoTexture&&gp.getTransfer(o.map.colorSpace)===Td,premultipliedAlpha:o.premultipliedAlpha,doubleSided:2===o.side,flipSided:1===o.side,useDepthPacking:o.depthPacking>=0,depthPacking:o.depthPacking||0,index0AttributeName:o.index0AttributeName,extensionDerivatives:ft&&!0===o.extensions.derivatives,extensionFragDepth:ft&&!0===o.extensions.fragDepth,extensionDrawBuffers:ft&&!0===o.extensions.drawBuffers,extensionShaderTextureLOD:ft&&!0===o.extensions.shaderTextureLOD,extensionClipCullDistance:ft&&!0===o.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:ft&&!0===o.extensions.multiDraw&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:o.customProgramCacheKey()};return gt.vertexUv1s=c.has(1),gt.vertexUv2s=c.has(2),gt.vertexUv3s=c.has(3),c.clear(),gt},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0);e.supportsVertexTextures&&a.enable(1);e.instancing&&a.enable(2);e.instancingColor&&a.enable(3);e.instancingMorph&&a.enable(4);e.matcap&&a.enable(5);e.envMap&&a.enable(6);e.normalMapObjectSpace&&a.enable(7);e.normalMapTangentSpace&&a.enable(8);e.clearcoat&&a.enable(9);e.iridescence&&a.enable(10);e.alphaTest&&a.enable(11);e.vertexColors&&a.enable(12);e.vertexAlphas&&a.enable(13);e.vertexUv1s&&a.enable(14);e.vertexUv2s&&a.enable(15);e.vertexUv3s&&a.enable(16);e.vertexTangents&&a.enable(17);e.anisotropy&&a.enable(18);e.alphaHash&&a.enable(19);e.batching&&a.enable(20);t.push(a.mask),a.disableAll(),e.fog&&a.enable(0);e.useFog&&a.enable(1);e.flatShading&&a.enable(2);e.logarithmicDepthBuffer&&a.enable(3);e.skinning&&a.enable(4);e.morphTargets&&a.enable(5);e.morphNormals&&a.enable(6);e.morphColors&&a.enable(7);e.premultipliedAlpha&&a.enable(8);e.shadowMapEnabled&&a.enable(9);e.useLegacyLights&&a.enable(10);e.doubleSided&&a.enable(11);e.flipSided&&a.enable(12);e.useDepthPacking&&a.enable(13);e.dithering&&a.enable(14);e.transmission&&a.enable(15);e.sheen&&a.enable(16);e.opaque&&a.enable(17);e.pointsUvs&&a.enable(18);e.decodeVideoTexture&&a.enable(19);e.alphaToCoverage&&a.enable(20);t.push(a.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=m[t.type];let n;if(e){const t=fg[e];n=jm.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=h.length;t<e;t++){const e=h[t];if(e.cacheKey===n){i=e,++i.usedTimes;break}}return void 0===i&&(i=new __(t,n,e,o),h.push(i)),i},releaseProgram:function(t){if(0===--t.usedTimes){const e=h.indexOf(t);h[e]=h[h.length-1],h.pop(),t.destroy()}},releaseShaderCache:function(t){l.remove(t)},programs:h,dispose:function(){l.dispose()}}}function w_(){let t=new WeakMap;return{get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}}function M_(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function T_(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function A_(){const t=[];let e=0;const n=[],i=[],r=[];function o(n,i,r,o,s,a){let l=t[e];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:o,renderOrder:n.renderOrder,z:s,group:a},t[e]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=o,l.renderOrder=n.renderOrder,l.z=s,l.group=a),e++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){e=0,n.length=0,i.length=0,r.length=0},push:function(t,e,s,a,l,c){const h=o(t,e,s,a,l,c);s.transmission>0?i.push(h):!0===s.transparent?r.push(h):n.push(h)},unshift:function(t,e,s,a,l,c){const h=o(t,e,s,a,l,c);s.transmission>0?i.unshift(h):!0===s.transparent?r.unshift(h):n.unshift(h)},finish:function(){for(let n=e,i=t.length;n<i;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){n.length>1&&n.sort(t||M_),i.length>1&&i.sort(e||T_),r.length>1&&r.sort(e||T_)}}}function E_(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new A_,t.set(e,[r])):n>=i.length?(r=new A_,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function C_(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Ip,color:new Jf};break;case"SpotLight":n={position:new Ip,direction:new Ip,color:new Jf,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ip,color:new Jf,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ip,skyColor:new Jf,groundColor:new Jf};break;case"RectAreaLight":n={color:new Jf,position:new Ip,halfWidth:new Ip,halfHeight:new Ip}}return t[e.id]=n,n}}}let R_=0;function P_(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function L_(t,e){const n=new C_,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new np};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new np,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let t=0;t<9;t++)r.probe.push(new Ip);const o=new Ip,s=new cf,a=new cf;return{setup:function(o,s){let a=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0,b=0;o.sort(P_);const x=!0===s?Math.PI:1;for(let t=0,e=o.length;t<e;t++){const e=o[t],s=e.color,S=e.intensity,w=e.distance,M=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)a+=s.r*S*x,l+=s.g*S*x,c+=s.b*S*x;else if(e.isLightProbe){for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],S);b++}else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),e.castShadow){const t=e.shadow,n=i.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,r.directionalShadow[h]=n,r.directionalShadowMap[h]=M,r.directionalShadowMatrix[h]=e.shadow.matrix,m++}r.directional[h]=t,h++}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(s).multiplyScalar(S*x),t.distance=w,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,r.spot[d]=t;const o=e.shadow;if(e.map&&(r.spotLightMap[_]=e.map,_++,o.updateMatrices(e),e.castShadow&&y++),r.spotLightMatrix[d]=o.matrix,e.castShadow){const t=i.get(e);t.shadowBias=o.bias,t.shadowNormalBias=o.normalBias,t.shadowRadius=o.radius,t.shadowMapSize=o.mapSize,r.spotShadow[d]=t,r.spotShadowMap[d]=M,v++}d++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(s).multiplyScalar(S),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[p]=t,p++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=i.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,r.pointShadow[u]=n,r.pointShadowMap[u]=M,r.pointShadowMatrix[u]=e.shadow.matrix,g++}r.point[u]=t,u++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(S*x),t.groundColor.copy(e.groundColor).multiplyScalar(S*x),r.hemi[f]=t,f++}}p>0&&(e.isWebGL2?!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=pg.LTC_FLOAT_1,r.rectAreaLTC2=pg.LTC_FLOAT_2):(r.rectAreaLTC1=pg.LTC_HALF_1,r.rectAreaLTC2=pg.LTC_HALF_2):!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=pg.LTC_FLOAT_1,r.rectAreaLTC2=pg.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=pg.LTC_HALF_1,r.rectAreaLTC2=pg.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=l,r.ambient[2]=c;const S=r.hash;S.directionalLength===h&&S.pointLength===u&&S.spotLength===d&&S.rectAreaLength===p&&S.hemiLength===f&&S.numDirectionalShadows===m&&S.numPointShadows===g&&S.numSpotShadows===v&&S.numSpotMaps===_&&S.numLightProbes===b||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+_-y,r.spotLightMap.length=_,r.numSpotLightShadowsWithMaps=y,r.numLightProbes=b,S.directionalLength=h,S.pointLength=u,S.spotLength=d,S.rectAreaLength=p,S.hemiLength=f,S.numDirectionalShadows=m,S.numPointShadows=g,S.numSpotShadows=v,S.numSpotMaps=_,S.numLightProbes=b,r.version=R_++)},setupView:function(t,e){let n=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e<d;e++){const d=t[e];if(d.isDirectionalLight){const t=r.directional[n];t.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(u),n++}else if(d.isSpotLight){const t=r.spot[l];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),t.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(u),l++}else if(d.isRectAreaLight){const t=r.rectArea[c];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),a.identity(),s.copy(d.matrixWorld),s.premultiply(u),a.extractRotation(s),t.halfWidth.set(.5*d.width,0,0),t.halfHeight.set(0,.5*d.height,0),t.halfWidth.applyMatrix4(a),t.halfHeight.applyMatrix4(a),c++}else if(d.isPointLight){const t=r.point[i];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),i++}else if(d.isHemisphereLight){const t=r.hemi[h];t.direction.setFromMatrixPosition(d.matrixWorld),t.direction.transformDirection(u),h++}}},state:r}}function I_(t,e){const n=new L_(t,e),i=[],r=[];return{init:function(){i.length=0,r.length=0},state:{lightsArray:i,shadowsArray:r,lights:n},setupLights:function(t){n.setup(i,t)},setupLightsView:function(t){n.setupView(i,t)},pushLight:function(t){i.push(t)},pushShadow:function(t){r.push(t)}}}function O_(t,e){let n=new WeakMap;return{get:function(i,r=0){const o=n.get(i);let s;return void 0===o?(s=new I_(t,e),n.set(i,[s])):r>=o.length?(s=new I_(t,e),o.push(s)):s=o[r],s},dispose:function(){n=new WeakMap}}}class k_ extends em{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class U_ extends em{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function D_(t,e,n){let i=new lg;const r=new np,o=new np,s=new Ap,a=new k_({depthPacking:3201}),l=new U_,c={},h=n.maxTextureSize,u={[kh]:1,[Uh]:0,[Dh]:2},d=new Xm({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new np},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}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const f=new xm;f.setAttribute("position",new hm(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Fm(f,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let v=this.type;function _(n,i){const o=e.update(m);d.defines.VSM_SAMPLES!==n.blurSamples&&(d.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Cp(r.x,r.y)),d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,o,d,m,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,o,p,m,null)}function y(e,n,i,r){let o=null;const s=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==s)o=s;else if(o=!0===i.isPointLight?l:a,t.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){const t=o.uuid,e=n.uuid;let i=c[t];void 0===i&&(i={},c[t]=i);let r=i[e];void 0===r&&(r=o.clone(),i[e]=r,n.addEventListener("dispose",x)),o=r}if(o.visible=n.visible,o.wireframe=n.wireframe,o.side=3===r?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],o.alphaMap=n.alphaMap,o.alphaTest=n.alphaTest,o.map=n.map,o.clipShadows=n.clipShadows,o.clippingPlanes=n.clippingPlanes,o.clipIntersection=n.clipIntersection,o.displacementMap=n.displacementMap,o.displacementScale=n.displacementScale,o.displacementBias=n.displacementBias,o.wireframeLinewidth=n.wireframeLinewidth,o.linewidth=n.linewidth,!0===i.isPointLight&&!0===o.isMeshDistanceMaterial){t.properties.get(o).light=i}return o}function b(n,r,o,s,a){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===a)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const i=e.update(n),l=n.material;if(Array.isArray(l)){const e=i.groups;for(let c=0,h=e.length;c<h;c++){const h=e[c],u=l[h.materialIndex];if(u&&u.visible){const e=y(n,u,s,a);n.onBeforeShadow(t,n,r,o,i,e,h),t.renderBufferDirect(o,null,i,e,n,h),n.onAfterShadow(t,n,r,o,i,e,h)}}}else if(l.visible){const e=y(n,l,s,a);n.onBeforeShadow(t,n,r,o,i,e,null),t.renderBufferDirect(o,null,i,e,n,null),n.onAfterShadow(t,n,r,o,i,e,null)}}const l=n.children;for(let t=0,e=l.length;t<e;t++)b(l[t],r,o,s,a)}function x(t){t.target.removeEventListener("dispose",x);for(const e in c){const n=c[e],i=t.target.uuid;if(i in n){n[i].dispose(),delete n[i]}}}this.render=function(e,n,a){if(!1===g.enabled)return;if(!1===g.autoUpdate&&!1===g.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),c=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),d=t.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);const p=3!==v&&3===this.type,f=3===v&&3!==this.type;for(let l=0,c=e.length;l<c;l++){const c=e[l],u=c.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;r.copy(u.mapSize);const m=u.getFrameExtents();if(r.multiply(m),o.copy(u.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(o.x=Math.floor(h/m.x),r.x=o.x*m.x,u.mapSize.x=o.x),r.y>h&&(o.y=Math.floor(h/m.y),r.y=o.y*m.y,u.mapSize.y=o.y)),null===u.map||!0===p||!0===f){const t=3!==this.type?{minFilter:du,magFilter:du}:{};null!==u.map&&u.map.dispose(),u.map=new Cp(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const g=u.getViewportCount();for(let t=0;t<g;t++){const e=u.getViewport(t);s.set(o.x*e.x,o.y*e.y,o.x*e.z,o.y*e.w),d.viewport(s),u.updateMatrices(c,t),i=u.getFrustum(),b(n,a,u.camera,c,this.type)}!0!==u.isPointLightShadow&&3===this.type&&_(u,a),u.needsUpdate=!1}v=this.type,g.needsUpdate=!1,t.setRenderTarget(l,c,u)}}function N_(t,e,n){const i=n.isWebGL2;const r=new function(){let e=!1;const n=new Ap;let i=null;const r=new Ap(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,s,a){!0===a&&(e*=s,i*=s,o*=s),n.set(e,i,o,s),!1===r.equals(n)&&(t.clearColor(e,i,o,s),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},o=new function(){let e=!1,n=null,i=null,r=null;return{setTest:function(e){e?W(t.DEPTH_TEST):V(t.DEPTH_TEST)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}},s=new function(){let e=!1,n=null,i=null,r=null,o=null,s=null,a=null,l=null,c=null;return{setTest:function(n){e||(n?W(t.STENCIL_TEST):V(t.STENCIL_TEST))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,s){i===e&&r===n&&o===s||(t.stencilFunc(e,n,s),i=e,r=n,o=s)},setOp:function(e,n,i){s===e&&a===n&&l===i||(t.stencilOp(e,n,i),s=e,a=n,l=i)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,s=null,a=null,l=null,c=null}}},a=new WeakMap,l=new WeakMap;let c={},h={},u=new WeakMap,d=[],p=null,f=!1,m=null,g=null,v=null,_=null,y=null,b=null,x=null,S=new Jf(0,0,0),w=0,M=!1,T=null,A=null,E=null,C=null,R=null;const P=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let L=!1,I=0;const O=t.getParameter(t.VERSION);-1!==O.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(O)[1]),L=I>=1):-1!==O.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),L=I>=2);let k=null,U={};const D=t.getParameter(t.SCISSOR_BOX),N=t.getParameter(t.VIEWPORT),B=(new Ap).fromArray(D),F=(new Ap).fromArray(N);function z(e,n,r,o){const s=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let a=0;a<r;a++)!i||e!==t.TEXTURE_3D&&e!==t.TEXTURE_2D_ARRAY?t.texImage2D(n+a,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,s):t.texImage3D(n,0,t.RGBA,1,1,o,0,t.RGBA,t.UNSIGNED_BYTE,s);return a}const H={};function W(e){!0!==c[e]&&(t.enable(e),c[e]=!0)}function V(e){!1!==c[e]&&(t.disable(e),c[e]=!1)}H[t.TEXTURE_2D]=z(t.TEXTURE_2D,t.TEXTURE_2D,1),H[t.TEXTURE_CUBE_MAP]=z(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),i&&(H[t.TEXTURE_2D_ARRAY]=z(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),H[t.TEXTURE_3D]=z(t.TEXTURE_3D,t.TEXTURE_3D,1,1)),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),W(t.DEPTH_TEST),o.setFunc(3),$(!1),Y(1),W(t.CULL_FACE),X(0);const G={[Nh]:t.FUNC_ADD,[Bh]:t.FUNC_SUBTRACT,[Fh]:t.FUNC_REVERSE_SUBTRACT};if(i)G[103]=t.MIN,G[104]=t.MAX;else{const t=e.get("EXT_blend_minmax");null!==t&&(G[103]=t.MIN_EXT,G[104]=t.MAX_EXT)}const j={[zh]:t.ZERO,[Hh]:t.ONE,[Wh]:t.SRC_COLOR,[Gh]:t.SRC_ALPHA,[Zh]:t.SRC_ALPHA_SATURATE,[Yh]:t.DST_COLOR,[Xh]:t.DST_ALPHA,[Vh]:t.ONE_MINUS_SRC_COLOR,[jh]:t.ONE_MINUS_SRC_ALPHA,[qh]:t.ONE_MINUS_DST_COLOR,[$h]:t.ONE_MINUS_DST_ALPHA,[Kh]:t.CONSTANT_COLOR,[Jh]:t.ONE_MINUS_CONSTANT_COLOR,[Qh]:t.CONSTANT_ALPHA,[tu]:t.ONE_MINUS_CONSTANT_ALPHA};function X(e,n,i,r,o,s,a,l,c,h){if(0!==e){if(!1===f&&(W(t.BLEND),f=!0),5===e)o=o||n,s=s||i,a=a||r,n===g&&o===y||(t.blendEquationSeparate(G[n],G[o]),g=n,y=o),i===v&&r===_&&s===b&&a===x||(t.blendFuncSeparate(j[i],j[r],j[s],j[a]),v=i,_=r,b=s,x=a),!1!==l.equals(S)&&c===w||(t.blendColor(l.r,l.g,l.b,c),S.copy(l),w=c),m=e,M=!1;else if(e!==m||h!==M){if(g===Nh&&y===Nh||(t.blendEquation(t.FUNC_ADD),g=Nh,y=Nh),h)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}v=null,_=null,b=null,x=null,S.set(0,0,0),w=0,m=e,M=h}}else!0===f&&(V(t.BLEND),f=!1)}function $(e){T!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),T=e)}function Y(e){0!==e?(W(t.CULL_FACE),e!==A&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):V(t.CULL_FACE),A=e}function q(e,n,i){e?(W(t.POLYGON_OFFSET_FILL),C===n&&R===i||(t.polygonOffset(n,i),C=n,R=i)):V(t.POLYGON_OFFSET_FILL)}return{buffers:{color:r,depth:o,stencil:s},enable:W,disable:V,bindFramebuffer:function(e,n){return h[e]!==n&&(t.bindFramebuffer(e,n),h[e]=n,i&&(e===t.DRAW_FRAMEBUFFER&&(h[t.FRAMEBUFFER]=n),e===t.FRAMEBUFFER&&(h[t.DRAW_FRAMEBUFFER]=n)),!0)},drawBuffers:function(i,r){let o=d,s=!1;if(i){o=u.get(r),void 0===o&&(o=[],u.set(r,o));const e=i.textures;if(o.length!==e.length||o[0]!==t.COLOR_ATTACHMENT0){for(let n=0,i=e.length;n<i;n++)o[n]=t.COLOR_ATTACHMENT0+n;o.length=e.length,s=!0}}else o[0]!==t.BACK&&(o[0]=t.BACK,s=!0);if(s)if(n.isWebGL2)t.drawBuffers(o);else{if(!0!==e.has("WEBGL_draw_buffers"))throw new Error("THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension");e.get("WEBGL_draw_buffers").drawBuffersWEBGL(o)}},useProgram:function(e){return p!==e&&(t.useProgram(e),p=e,!0)},setBlending:X,setMaterial:function(e,n){2===e.side?V(t.CULL_FACE):W(t.CULL_FACE);let i=1===e.side;n&&(i=!i),$(i),1===e.blending&&!1===e.transparent?X(0):X(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.blendColor,e.blendAlpha,e.premultipliedAlpha),o.setFunc(e.depthFunc),o.setTest(e.depthTest),o.setMask(e.depthWrite),r.setMask(e.colorWrite);const a=e.stencilWrite;s.setTest(a),a&&(s.setMask(e.stencilWriteMask),s.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),s.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),q(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?W(t.SAMPLE_ALPHA_TO_COVERAGE):V(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:$,setCullFace:Y,setLineWidth:function(e){e!==E&&(L&&t.lineWidth(e),E=e)},setPolygonOffset:q,setScissorTest:function(e){e?W(t.SCISSOR_TEST):V(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+P-1),k!==e&&(t.activeTexture(e),k=e)},bindTexture:function(e,n,i){void 0===i&&(i=null===k?t.TEXTURE0+P-1:k);let r=U[i];void 0===r&&(r={type:void 0,texture:void 0},U[i]=r),r.type===e&&r.texture===n||(k!==i&&(t.activeTexture(i),k=i),t.bindTexture(e,n||H[e]),r.type=e,r.texture=n)},unbindTexture:function(){const e=U[k];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,n){let i=l.get(n);void 0===i&&(i=new WeakMap,l.set(n,i));let r=i.get(e);void 0===r&&(r=t.getUniformBlockIndex(n,e.name),i.set(e,r))},uniformBlockBinding:function(e,n){const i=l.get(n).get(e);a.get(n)!==i&&(t.uniformBlockBinding(n,i,e.__bindingPointIndex),a.set(n,i))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===B.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),B.copy(e))},viewport:function(e){!1===F.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),F.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),!0===i&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),c={},k=null,U={},h={},u=new WeakMap,d=[],p=null,f=!1,m=null,g=null,v=null,_=null,y=null,b=null,x=null,S=new Jf(0,0,0),w=0,M=!1,T=null,A=null,E=null,C=null,R=null,B.set(0,0,t.canvas.width,t.canvas.height),F.set(0,0,t.canvas.width,t.canvas.height),r.reset(),o.reset(),s.reset()}}}function B_(t,e,n,i,r,o,s){const a=r.isWebGL2,l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),h=new np,u=new WeakMap;let d;const p=new WeakMap;let f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function m(t,e){return f?new OffscreenCanvas(t,e):lp("canvas")}function g(t,e,n,i){let r=1;const o=z(t);if((o.width>i||o.height>i)&&(r=i/Math.max(o.width,o.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&t instanceof VideoFrame){const i=e?Jd:Math.floor,s=i(r*o.width),a=i(r*o.height);void 0===d&&(d=m(s,a));const l=n?m(s,a):d;l.width=s,l.height=a;return l.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+o.width+"x"+o.height+") to ("+s+"x"+a+")."),l}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+o.width+"x"+o.height+")."),t}return t}function v(t){const e=z(t);return Kd(e.width)&&Kd(e.height)}function _(t,e){return t.generateMipmaps&&e&&t.minFilter!==du&&t.minFilter!==mu}function y(e){t.generateMipmap(e)}function b(n,i,r,o,s=!1){if(!1===a)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;if(i===t.RED&&(r===t.FLOAT&&(l=t.R32F),r===t.HALF_FLOAT&&(l=t.R16F),r===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RED_INTEGER&&(r===t.UNSIGNED_BYTE&&(l=t.R8UI),r===t.UNSIGNED_SHORT&&(l=t.R16UI),r===t.UNSIGNED_INT&&(l=t.R32UI),r===t.BYTE&&(l=t.R8I),r===t.SHORT&&(l=t.R16I),r===t.INT&&(l=t.R32I)),i===t.RG&&(r===t.FLOAT&&(l=t.RG32F),r===t.HALF_FLOAT&&(l=t.RG16F),r===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RG_INTEGER&&(r===t.UNSIGNED_BYTE&&(l=t.RG8UI),r===t.UNSIGNED_SHORT&&(l=t.RG16UI),r===t.UNSIGNED_INT&&(l=t.RG32UI),r===t.BYTE&&(l=t.RG8I),r===t.SHORT&&(l=t.RG16I),r===t.INT&&(l=t.RG32I)),i===t.RGBA){const e=s?Md:gp.getTransfer(o);r===t.FLOAT&&(l=t.RGBA32F),r===t.HALF_FLOAT&&(l=t.RGBA16F),r===t.UNSIGNED_BYTE&&(l=e===Td?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)}return l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function x(t,e,n){return!0===_(t,n)||t.isFramebufferTexture&&t.minFilter!==du&&t.minFilter!==mu?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function S(e){return e===du||e===pu||e===fu?t.NEAREST:t.LINEAR}function w(t){const e=t.target;e.removeEventListener("dispose",w),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=p.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&T(t),0===Object.keys(r).length&&p.delete(n)}i.remove(t)}(e),e.isVideoTexture&&u.delete(e)}function M(e){const n=e.target;n.removeEventListener("dispose",M),function(e){const n=i.get(e);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let i=0;i<n.__webglFramebuffer[e].length;i++)t.deleteFramebuffer(n.__webglFramebuffer[e][i]);else t.deleteFramebuffer(n.__webglFramebuffer[e]);n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e])}else{if(Array.isArray(n.__webglFramebuffer))for(let e=0;e<n.__webglFramebuffer.length;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let e=0;e<n.__webglColorRenderbuffer.length;e++)n.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(n.__webglColorRenderbuffer[e]);n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const r=e.textures;for(let e=0,n=r.length;e<n;e++){const n=i.get(r[e]);n.__webglTexture&&(t.deleteTexture(n.__webglTexture),s.memory.textures--),i.remove(r[e])}i.remove(e)}(n)}function T(e){const n=i.get(e);t.deleteTexture(n.__webglTexture);const r=e.source;delete p.get(r)[n.__cacheKey],s.memory.textures--}let A=0;function E(e,r){const o=i.get(e);if(e.isVideoTexture&&function(t){const e=s.render.frame;u.get(t)!==e&&(u.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&o.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void O(o,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,o.__webglTexture,t.TEXTURE0+r)}const C={[cu]:t.REPEAT,[hu]:t.CLAMP_TO_EDGE,[uu]:t.MIRRORED_REPEAT},R={[du]:t.NEAREST,[pu]:t.NEAREST_MIPMAP_NEAREST,[fu]:t.NEAREST_MIPMAP_LINEAR,[mu]:t.LINEAR,[gu]:t.LINEAR_MIPMAP_NEAREST,[vu]:t.LINEAR_MIPMAP_LINEAR},P={[Rd]:t.NEVER,[Dd]:t.ALWAYS,[Pd]:t.LESS,[Id]:t.LEQUAL,[Ld]:t.EQUAL,[Ud]:t.GEQUAL,[Od]:t.GREATER,[kd]:t.NOTEQUAL};function L(n,o,s){if(o.type!==Su||!1!==e.has("OES_texture_float_linear")||o.magFilter!==mu&&o.magFilter!==gu&&o.magFilter!==fu&&o.magFilter!==vu&&o.minFilter!==mu&&o.minFilter!==gu&&o.minFilter!==fu&&o.minFilter!==vu||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s?(t.texParameteri(n,t.TEXTURE_WRAP_S,C[o.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,C[o.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,C[o.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,R[o.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,R[o.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),o.wrapS===hu&&o.wrapT===hu||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,S(o.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,S(o.minFilter)),o.minFilter!==du&&o.minFilter!==mu&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),o.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,P[o.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){if(o.magFilter===du)return;if(o.minFilter!==fu&&o.minFilter!==vu)return;if(o.type===Su&&!1===e.has("OES_texture_float_linear"))return;if(!1===a&&o.type===wu&&!1===e.has("OES_texture_half_float_linear"))return;if(o.anisotropy>1||i.get(o).__currentAnisotropy){const s=e.get("EXT_texture_filter_anisotropic");t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),i.get(o).__currentAnisotropy=o.anisotropy}}}function I(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w));const r=n.source;let o=p.get(r);void 0===o&&(o={},p.set(r,o));const a=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(a!==e.__cacheKey){void 0===o[a]&&(o[a]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,i=!0),o[a].usedTimes++;const r=o[e.__cacheKey];void 0!==r&&(o[e.__cacheKey].usedTimes--,0===r.usedTimes&&T(n)),e.__cacheKey=a,e.__webglTexture=o[a].texture}return i}function O(e,s,l){let c=t.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(c=t.TEXTURE_2D_ARRAY),s.isData3DTexture&&(c=t.TEXTURE_3D);const h=I(e,s),u=s.source;n.bindTexture(c,e.__webglTexture,t.TEXTURE0+l);const d=i.get(u);if(u.version!==d.__version||!0===h){n.activeTexture(t.TEXTURE0+l);const e=gp.getPrimaries(gp.workingColorSpace),i=s.colorSpace===yd?null:gp.getPrimaries(s.colorSpace),p=s.colorSpace===yd||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,s.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,s.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const f=function(t){return!a&&(t.wrapS!==hu||t.wrapT!==hu||t.minFilter!==du&&t.minFilter!==mu)}(s)&&!1===v(s.image);let m=g(s.image,f,!1,r.maxTextureSize);m=F(s,m);const S=v(m)||a,w=o.convert(s.format,s.colorSpace);let M,T=o.convert(s.type),A=b(s.internalFormat,w,T,s.colorSpace,s.isVideoTexture);L(c,s,S);const E=s.mipmaps,C=a&&!0!==s.isVideoTexture&&A!==Wu,R=void 0===d.__version||!0===h,P=u.dataReady,I=x(s,m,S);if(s.isDepthTexture)A=t.DEPTH_COMPONENT,a?A=s.type===Su?t.DEPTH_COMPONENT32F:s.type===xu?t.DEPTH_COMPONENT24:s.type===Au?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:s.type===Su&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),s.format===Cu&&A===t.DEPTH_COMPONENT&&s.type!==yu&&s.type!==xu&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),s.type=xu,T=o.convert(s.type)),s.format===Ru&&A===t.DEPTH_COMPONENT&&(A=t.DEPTH_STENCIL,s.type!==Au&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),s.type=Au,T=o.convert(s.type))),R&&(C?n.texStorage2D(t.TEXTURE_2D,1,A,m.width,m.height):n.texImage2D(t.TEXTURE_2D,0,A,m.width,m.height,0,w,T,null));else if(s.isDataTexture)if(E.length>0&&S){C&&R&&n.texStorage2D(t.TEXTURE_2D,I,A,E[0].width,E[0].height);for(let e=0,i=E.length;e<i;e++)M=E[e],C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,M.width,M.height,w,T,M.data):n.texImage2D(t.TEXTURE_2D,e,A,M.width,M.height,0,w,T,M.data);s.generateMipmaps=!1}else C?(R&&n.texStorage2D(t.TEXTURE_2D,I,A,m.width,m.height),P&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,m.width,m.height,w,T,m.data)):n.texImage2D(t.TEXTURE_2D,0,A,m.width,m.height,0,w,T,m.data);else if(s.isCompressedTexture)if(s.isCompressedArrayTexture){C&&R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,I,A,E[0].width,E[0].height,m.depth);for(let e=0,i=E.length;e<i;e++)M=E[e],s.format!==Eu?null!==w?C?P&&n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,M.width,M.height,m.depth,w,M.data,0,0):n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,A,M.width,M.height,m.depth,0,M.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,M.width,M.height,m.depth,w,T,M.data):n.texImage3D(t.TEXTURE_2D_ARRAY,e,A,M.width,M.height,m.depth,0,w,T,M.data)}else{C&&R&&n.texStorage2D(t.TEXTURE_2D,I,A,E[0].width,E[0].height);for(let e=0,i=E.length;e<i;e++)M=E[e],s.format!==Eu?null!==w?C?P&&n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,M.width,M.height,w,M.data):n.compressedTexImage2D(t.TEXTURE_2D,e,A,M.width,M.height,0,M.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,M.width,M.height,w,T,M.data):n.texImage2D(t.TEXTURE_2D,e,A,M.width,M.height,0,w,T,M.data)}else if(s.isDataArrayTexture)C?(R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,I,A,m.width,m.height,m.depth),P&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,m.width,m.height,m.depth,w,T,m.data)):n.texImage3D(t.TEXTURE_2D_ARRAY,0,A,m.width,m.height,m.depth,0,w,T,m.data);else if(s.isData3DTexture)C?(R&&n.texStorage3D(t.TEXTURE_3D,I,A,m.width,m.height,m.depth),P&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,m.width,m.height,m.depth,w,T,m.data)):n.texImage3D(t.TEXTURE_3D,0,A,m.width,m.height,m.depth,0,w,T,m.data);else if(s.isFramebufferTexture){if(R)if(C)n.texStorage2D(t.TEXTURE_2D,I,A,m.width,m.height);else{let e=m.width,i=m.height;for(let r=0;r<I;r++)n.texImage2D(t.TEXTURE_2D,r,A,e,i,0,w,T,null),e>>=1,i>>=1}}else if(E.length>0&&S){if(C&&R){const e=z(E[0]);n.texStorage2D(t.TEXTURE_2D,I,A,e.width,e.height)}for(let e=0,i=E.length;e<i;e++)M=E[e],C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w,T,M):n.texImage2D(t.TEXTURE_2D,e,A,w,T,M);s.generateMipmaps=!1}else if(C){if(R){const e=z(m);n.texStorage2D(t.TEXTURE_2D,I,A,e.width,e.height)}P&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,w,T,m)}else n.texImage2D(t.TEXTURE_2D,0,A,w,T,m);_(s,S)&&y(c),d.__version=u.version,s.onUpdate&&s.onUpdate(s)}e.__version=s.version}function k(e,r,s,a,c,h){const u=o.convert(s.format,s.colorSpace),d=o.convert(s.type),p=b(s.internalFormat,u,d,s.colorSpace);if(!i.get(r).__hasExternalTextures){const e=Math.max(1,r.width>>h),i=Math.max(1,r.height>>h);c===t.TEXTURE_3D||c===t.TEXTURE_2D_ARRAY?n.texImage3D(c,h,p,e,i,r.depth,0,u,d,null):n.texImage2D(c,h,p,e,i,0,u,d,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),B(r)?l.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,a,c,i.get(s).__webglTexture,0,N(r)):(c===t.TEXTURE_2D||c>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,a,c,i.get(s).__webglTexture,h),n.bindFramebuffer(t.FRAMEBUFFER,null)}function U(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let r=!0===a?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(i||B(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===Su?r=t.DEPTH_COMPONENT32F:e.type===xu&&(r=t.DEPTH_COMPONENT24));const i=N(n);B(n)?l.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,r,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,r,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,r,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=N(n);i&&!1===B(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):B(n)?l.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=n.textures;for(let r=0;r<e.length;r++){const s=e[r],a=o.convert(s.format,s.colorSpace),c=o.convert(s.type),h=b(s.internalFormat,a,c,s.colorSpace),u=N(n);i&&!1===B(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,u,h,n.width,n.height):B(n)?l.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,h,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,h,n.width,n.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function D(e){const r=i.get(e),o=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(o)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),E(r.depthTexture,0);const o=i.get(r.depthTexture).__webglTexture,s=N(r);if(r.depthTexture.format===Cu)B(r)?l.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,o,0,s):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,o,0);else{if(r.depthTexture.format!==Ru)throw new Error("Unknown depthTexture format");B(r)?l.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,o,0,s):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,o,0)}}(r.__webglFramebuffer,e)}else if(o){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[i]),r.__webglDepthbuffer[i]=t.createRenderbuffer(),U(r.__webglDepthbuffer[i],e,!1)}else n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),U(r.__webglDepthbuffer,e,!1);n.bindFramebuffer(t.FRAMEBUFFER,null)}function N(t){return Math.min(r.maxSamples,t.samples)}function B(t){const n=i.get(t);return a&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function F(t,n){const i=t.colorSpace,r=t.format,o=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Fd||i!==xd&&i!==yd&&(gp.getTransfer(i)===Td?!1===a?!0===e.has("EXT_sRGB")&&r===Eu?(t.format=Fd,t.minFilter=mu,t.generateMipmaps=!1):n=bp.sRGBToLinear(n):r===Eu&&o===_u||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),n}function z(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?(h.width=t.naturalWidth||t.width,h.height=t.naturalHeight||t.height):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?(h.width=t.displayWidth,h.height=t.displayHeight):(h.width=t.width,h.height=t.height),h}this.allocateTextureUnit=function(){const t=A;return t>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+r.maxTextures),A+=1,t},this.resetTextureUnits=function(){A=0},this.setTexture2D=E,this.setTexture2DArray=function(e,r){const o=i.get(e);e.version>0&&o.__version!==e.version?O(o,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,o.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const o=i.get(e);e.version>0&&o.__version!==e.version?O(o,e,r):n.bindTexture(t.TEXTURE_3D,o.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,s){const l=i.get(e);e.version>0&&l.__version!==e.version?function(e,s,l){if(6!==s.image.length)return;const c=I(e,s),h=s.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+l);const u=i.get(h);if(h.version!==u.__version||!0===c){n.activeTexture(t.TEXTURE0+l);const e=gp.getPrimaries(gp.workingColorSpace),i=s.colorSpace===yd?null:gp.getPrimaries(s.colorSpace),d=s.colorSpace===yd||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,s.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,s.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const p=s.isCompressedTexture||s.image[0].isCompressedTexture,f=s.image[0]&&s.image[0].isDataTexture,m=[];for(let t=0;t<6;t++)m[t]=p||f?f?s.image[t].image:s.image[t]:g(s.image[t],!1,!0,r.maxCubemapSize),m[t]=F(s,m[t]);const S=m[0],w=v(S)||a,M=o.convert(s.format,s.colorSpace),T=o.convert(s.type),A=b(s.internalFormat,M,T,s.colorSpace),E=a&&!0!==s.isVideoTexture,C=void 0===u.__version||!0===c,R=h.dataReady;let P,I=x(s,S,w);if(L(t.TEXTURE_CUBE_MAP,s,w),p){E&&C&&n.texStorage2D(t.TEXTURE_CUBE_MAP,I,A,S.width,S.height);for(let e=0;e<6;e++){P=m[e].mipmaps;for(let i=0;i<P.length;i++){const r=P[i];s.format!==Eu?null!==M?E?R&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,r.width,r.height,M,r.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,A,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):E?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,r.width,r.height,M,T,r.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,A,r.width,r.height,0,M,T,r.data)}}}else{if(P=s.mipmaps,E&&C){P.length>0&&I++;const e=z(m[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,I,A,e.width,e.height)}for(let e=0;e<6;e++)if(f){E?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,m[e].width,m[e].height,M,T,m[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,A,m[e].width,m[e].height,0,M,T,m[e].data);for(let i=0;i<P.length;i++){const r=P[i].image[e].image;E?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,r.width,r.height,M,T,r.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,A,r.width,r.height,0,M,T,r.data)}}else{E?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,M,T,m[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,A,M,T,m[e]);for(let i=0;i<P.length;i++){const r=P[i];E?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,M,T,r.image[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,A,M,T,r.image[e])}}}_(s,w)&&y(t.TEXTURE_CUBE_MAP),u.__version=h.version,s.onUpdate&&s.onUpdate(s)}e.__version=s.version}(l,e,s):n.bindTexture(t.TEXTURE_CUBE_MAP,l.__webglTexture,t.TEXTURE0+s)},this.rebindTextures=function(e,n,r){const o=i.get(e);void 0!==n&&k(o.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),void 0!==r&&D(e)},this.setupRenderTarget=function(e){const l=e.texture,c=i.get(e),h=i.get(l);e.addEventListener("dispose",M);const u=e.textures,d=!0===e.isWebGLCubeRenderTarget,p=u.length>1,f=v(e)||a;if(p||(void 0===h.__webglTexture&&(h.__webglTexture=t.createTexture()),h.__version=l.version,s.memory.textures++),d){c.__webglFramebuffer=[];for(let e=0;e<6;e++)if(a&&l.mipmaps&&l.mipmaps.length>0){c.__webglFramebuffer[e]=[];for(let n=0;n<l.mipmaps.length;n++)c.__webglFramebuffer[e][n]=t.createFramebuffer()}else c.__webglFramebuffer[e]=t.createFramebuffer()}else{if(a&&l.mipmaps&&l.mipmaps.length>0){c.__webglFramebuffer=[];for(let e=0;e<l.mipmaps.length;e++)c.__webglFramebuffer[e]=t.createFramebuffer()}else c.__webglFramebuffer=t.createFramebuffer();if(p)if(r.drawBuffers)for(let e=0,n=u.length;e<n;e++){const n=i.get(u[e]);void 0===n.__webglTexture&&(n.__webglTexture=t.createTexture(),s.memory.textures++)}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&e.samples>0&&!1===B(e)){c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){const i=u[n];c.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,c.__webglColorRenderbuffer[n]);const r=o.convert(i.format,i.colorSpace),s=o.convert(i.type),a=b(i.internalFormat,r,s,i.colorSpace,!0===e.isXRRenderTarget),l=N(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,l,a,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,c.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(c.__webglDepthRenderbuffer=t.createRenderbuffer(),U(c.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(d){n.bindTexture(t.TEXTURE_CUBE_MAP,h.__webglTexture),L(t.TEXTURE_CUBE_MAP,l,f);for(let n=0;n<6;n++)if(a&&l.mipmaps&&l.mipmaps.length>0)for(let i=0;i<l.mipmaps.length;i++)k(c.__webglFramebuffer[n][i],e,l,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,i);else k(c.__webglFramebuffer[n],e,l,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);_(l,f)&&y(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(p){for(let r=0,o=u.length;r<o;r++){const o=u[r],s=i.get(o);n.bindTexture(t.TEXTURE_2D,s.__webglTexture),L(t.TEXTURE_2D,o,f),k(c.__webglFramebuffer,e,o,t.COLOR_ATTACHMENT0+r,t.TEXTURE_2D,0),_(o,f)&&y(t.TEXTURE_2D)}n.unbindTexture()}else{let i=t.TEXTURE_2D;if((e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(a?i=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(i,h.__webglTexture),L(i,l,f),a&&l.mipmaps&&l.mipmaps.length>0)for(let n=0;n<l.mipmaps.length;n++)k(c.__webglFramebuffer[n],e,l,t.COLOR_ATTACHMENT0,i,n);else k(c.__webglFramebuffer,e,l,t.COLOR_ATTACHMENT0,i,0);_(l,f)&&y(i),n.unbindTexture()}e.depthBuffer&&D(e)},this.updateRenderTargetMipmap=function(e){const r=v(e)||a,o=e.textures;for(let s=0,a=o.length;s<a;s++){const a=o[s];if(_(a,r)){const r=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,o=i.get(a).__webglTexture;n.bindTexture(r,o),y(r),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(a&&e.samples>0&&!1===B(e)){const r=e.textures,o=e.width,s=e.height;let a=t.COLOR_BUFFER_BIT;const l=[],h=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,u=i.get(e),d=r.length>1;if(d)for(let e=0;e<r.length;e++)n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<r.length;n++){l.push(t.COLOR_ATTACHMENT0+n),e.depthBuffer&&l.push(h);const p=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===p&&(e.depthBuffer&&(a|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&(a|=t.STENCIL_BUFFER_BIT)),d&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u.__webglColorRenderbuffer[n]),!0===p&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[h]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[h])),d){const e=i.get(r[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,o,s,0,0,o,s,a,t.NEAREST),c&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,l)}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),d)for(let e=0;e<r.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,u.__webglColorRenderbuffer[e]);const o=i.get(r[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,o,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=D,this.setupFrameBufferTexture=k,this.useMultisampledRTT=B}function F_(t,e,n){const i=n.isWebGL2;return{convert:function(n,r=""){let o;const s=gp.getTransfer(r);if(n===_u)return t.UNSIGNED_BYTE;if(n===Mu)return t.UNSIGNED_SHORT_4_4_4_4;if(n===Tu)return t.UNSIGNED_SHORT_5_5_5_1;if(1010===n)return t.BYTE;if(1011===n)return t.SHORT;if(n===yu)return t.UNSIGNED_SHORT;if(n===bu)return t.INT;if(n===xu)return t.UNSIGNED_INT;if(n===Su)return t.FLOAT;if(n===wu)return i?t.HALF_FLOAT:(o=e.get("OES_texture_half_float"),null!==o?o.HALF_FLOAT_OES:null);if(1021===n)return t.ALPHA;if(n===Eu)return t.RGBA;if(1024===n)return t.LUMINANCE;if(1025===n)return t.LUMINANCE_ALPHA;if(n===Cu)return t.DEPTH_COMPONENT;if(n===Ru)return t.DEPTH_STENCIL;if(n===Fd)return o=e.get("EXT_sRGB"),null!==o?o.SRGB_ALPHA_EXT:null;if(n===Pu)return t.RED;if(n===Lu)return t.RED_INTEGER;if(1030===n)return t.RG;if(n===Iu)return t.RG_INTEGER;if(n===Ou)return t.RGBA_INTEGER;if(n===ku||n===Uu||n===Du||n===Nu)if(s===Td){if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===o)return null;if(n===ku)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Uu)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Du)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Nu)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(o=e.get("WEBGL_compressed_texture_s3tc"),null===o)return null;if(n===ku)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Uu)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Du)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Nu)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===Bu||n===Fu||n===zu||n===Hu){if(o=e.get("WEBGL_compressed_texture_pvrtc"),null===o)return null;if(n===Bu)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Fu)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===zu)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Hu)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===Wu)return o=e.get("WEBGL_compressed_texture_etc1"),null!==o?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===Vu||n===Gu){if(o=e.get("WEBGL_compressed_texture_etc"),null===o)return null;if(n===Vu)return s===Td?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(n===Gu)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}if(n===ju||n===Xu||n===$u||n===Yu||n===qu||n===Zu||n===Ku||n===Ju||n===Qu||n===td||n===ed||n===nd||n===id||n===rd){if(o=e.get("WEBGL_compressed_texture_astc"),null===o)return null;if(n===ju)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Xu)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===$u)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Yu)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===qu)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Zu)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ku)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Ju)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Qu)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===td)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ed)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===nd)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===id)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===rd)return s===Td?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===od||n===sd||n===ad){if(o=e.get("EXT_texture_compression_bptc"),null===o)return null;if(n===od)return s===Td?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===sd)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ad)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||n===ld||n===cd||n===hd){if(o=e.get("EXT_texture_compression_rgtc"),null===o)return null;if(n===od)return o.COMPRESSED_RED_RGTC1_EXT;if(n===ld)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===cd)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===hd)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===Au?i?t.UNSIGNED_INT_24_8:(o=e.get("WEBGL_depth_texture"),null!==o?o.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[n]?t[n]:null}}}class z_ extends Km{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class H_ extends Df{constructor(){super(),this.isGroup=!0,this.type="Group"}}const W_={type:"move"};class V_{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new H_,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new H_,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ip,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ip),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new H_,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ip,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ip),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,o=null;const s=this._targetRay,a=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(l&&t.hand){o=!0;for(const i of t.hand.values()){const t=e.getJointPose(i,n),r=this._getHandJoint(l,i);null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=t.radius),r.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position),a=.02,c=.005;l.inputState.pinching&&s>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&s<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));null!==s&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(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,this.dispatchEvent(W_)))}return null!==s&&(s.visible=null!==i),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==o),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new H_;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class G_{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(null===this.texture){const i=new Tp;t.properties.get(i).__webglTexture=e.texture,e.depthNear==n.depthNear&&e.depthFar==n.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}render(t,e){if(null!==this.texture){if(null===this.mesh){const t=e.cameras[0].viewport,n=new Xm({extensions:{fragDepth:!0},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_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepthEXT = 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 Fm(new ug(20,20),n)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}}class j_ extends Wd{constructor(t,e){super();const n=this;let i=null,r=1,o=null,s="local-floor",a=1,l=null,c=null,h=null,u=null,d=null,p=null;const f=new G_,m=e.getContextAttributes();let g=null,v=null;const _=[],y=[],b=new np;let x=null;const S=new Km;S.layers.enable(1),S.viewport=new Ap;const w=new Km;w.layers.enable(2),w.viewport=new Ap;const M=[S,w],T=new z_;T.layers.enable(1),T.layers.enable(2);let A=null,E=null;function C(t){const e=y.indexOf(t.inputSource);if(-1===e)return;const n=_[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||o),n.dispatchEvent({type:t.type,data:t.inputSource}))}function R(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",R),i.removeEventListener("inputsourceschange",P);for(let t=0;t<_.length;t++){const e=y[t];null!==e&&(y[t]=null,_[t].disconnect(e))}A=null,E=null,f.reset(),t.setRenderTarget(g),d=null,u=null,h=null,i=null,v=null,U.stop(),n.isPresenting=!1,t.setPixelRatio(x),t.setSize(b.width,b.height,!1),n.dispatchEvent({type:"sessionend"})}function P(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],i=y.indexOf(n);i>=0&&(y[i]=null,_[i].disconnect(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let i=y.indexOf(n);if(-1===i){for(let t=0;t<_.length;t++){if(t>=y.length){y.push(n),i=t;break}if(null===y[t]){y[t]=n,i=t;break}}if(-1===i)break}const r=_[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=_[t];return void 0===e&&(e=new V_,_[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=_[t];return void 0===e&&(e=new V_,_[t]=e),e.getGripSpace()},this.getHand=function(t){let e=_[t];return void 0===e&&(e=new V_,_[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){s=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(g=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",R),i.addEventListener("inputsourceschange",P),!0!==m.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(b),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),v=new Cp(d.framebufferWidth,d.framebufferHeight,{format:Eu,type:_u,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,o=null,s=null;m.depth&&(s=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=m.stencil?Ru:Cu,o=m.stencil?Au:xu);const a={colorFormat:e.RGBA8,depthFormat:s,scaleFactor:r};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(a),i.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),v=new Cp(u.textureWidth,u.textureHeight,{format:Eu,type:_u,depthTexture:new Zg(u.textureWidth,u.textureHeight,o,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0});t.properties.get(v).__ignoreDepthValues=u.ignoreDepthValues}v.isXRRenderTarget=!0,this.setFoveation(a),l=null,o=await i.requestReferenceSpace(s),U.setContext(i),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const L=new Ip,I=new Ip;function O(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===i)return;null!==f.texture&&(t.near=f.depthNear,t.far=f.depthFar),T.near=w.near=S.near=t.near,T.far=w.far=S.far=t.far,A===T.near&&E===T.far||(i.updateRenderState({depthNear:T.near,depthFar:T.far}),A=T.near,E=T.far,S.near=A,S.far=E,w.near=A,w.far=E,S.updateProjectionMatrix(),w.updateProjectionMatrix(),t.updateProjectionMatrix());const e=t.parent,n=T.cameras;O(T,e);for(let t=0;t<n.length;t++)O(n[t],e);2===n.length?function(t,e,n){L.setFromMatrixPosition(e.matrixWorld),I.setFromMatrixPosition(n.matrixWorld);const i=L.distanceTo(I),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(o[8]+1)/o[0],d=s*h,p=s*u,f=i/(-h+u),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=s+f,v=a+f,_=d-m,y=p+(i-m),b=l*a/v*g,x=c*a/v*g;t.projectionMatrix.makePerspective(_,y,b,x,g,v),t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}(T,S,w):T.projectionMatrix.copy(S.projectionMatrix),function(t,e,n){null===n?t.matrix.copy(e.matrixWorld):(t.matrix.copy(n.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld));t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*Xd*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)}(t,T,e)},this.getCamera=function(){return T},this.getFoveation=function(){if(null!==u||null!==d)return a},this.setFoveation=function(t){a=t,null!==u&&(u.fixedFoveation=t),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=t)},this.hasDepthSensing=function(){return null!==f.texture};let k=null;const U=new cg;U.setAnimationLoop(function(e,r){if(c=r.getViewerPose(l||o),p=r,null!==c){const e=c.views;null!==d&&(t.setRenderTargetFramebuffer(v,d.framebuffer),t.setRenderTarget(v));let n=!1;e.length!==T.cameras.length&&(T.cameras.length=0,n=!0);for(let i=0;i<e.length;i++){const r=e[i];let o=null;if(null!==d)o=d.getViewport(r);else{const e=h.getViewSubImage(u,r);o=e.viewport,0===i&&(t.setRenderTargetTextures(v,e.colorTexture,u.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(v))}let s=M[i];void 0===s&&(s=new Km,s.layers.enable(i),s.viewport=new Ap,M[i]=s),s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.quaternion,s.scale),s.projectionMatrix.fromArray(r.projectionMatrix),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),s.viewport.set(o.x,o.y,o.width,o.height),0===i&&(T.matrix.copy(s.matrix),T.matrix.decompose(T.position,T.quaternion,T.scale)),!0===n&&T.cameras.push(s)}const r=i.enabledFeatures;if(r&&r.includes("depth-sensing")){const n=h.getDepthInformation(e[0]);n&&n.isValid&&n.texture&&f.init(t,n,i.renderState)}}for(let t=0;t<_.length;t++){const e=y[t],n=_[t];null!==e&&void 0!==n&&n.update(e,r,l||o)}f.render(t,T),k&&k(e,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),p=null}),this.setAnimationLoop=function(t){k=t},this.dispose=function(){}}}const X_=new yf,$_=new cf;function Y_(t,e){function n(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix)}function i(i,r){i.opacity.value=r.opacity,r.color&&i.diffuse.value.copy(r.color),r.emissive&&i.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(i.map.value=r.map,n(r.map,i.mapTransform)),r.alphaMap&&(i.alphaMap.value=r.alphaMap,n(r.alphaMap,i.alphaMapTransform)),r.bumpMap&&(i.bumpMap.value=r.bumpMap,n(r.bumpMap,i.bumpMapTransform),i.bumpScale.value=r.bumpScale,1===r.side&&(i.bumpScale.value*=-1)),r.normalMap&&(i.normalMap.value=r.normalMap,n(r.normalMap,i.normalMapTransform),i.normalScale.value.copy(r.normalScale),1===r.side&&i.normalScale.value.negate()),r.displacementMap&&(i.displacementMap.value=r.displacementMap,n(r.displacementMap,i.displacementMapTransform),i.displacementScale.value=r.displacementScale,i.displacementBias.value=r.displacementBias),r.emissiveMap&&(i.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,i.emissiveMapTransform)),r.specularMap&&(i.specularMap.value=r.specularMap,n(r.specularMap,i.specularMapTransform)),r.alphaTest>0&&(i.alphaTest.value=r.alphaTest);const o=e.get(r),s=o.envMap,a=o.envMapRotation;if(s&&(i.envMap.value=s,X_.copy(a),X_.x*=-1,X_.y*=-1,X_.z*=-1,s.isCubeTexture&&!1===s.isRenderTargetTexture&&(X_.y*=-1,X_.z*=-1),i.envMapRotation.value.setFromMatrix4($_.makeRotationFromEuler(X_)),i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=r.reflectivity,i.ior.value=r.ior,i.refractionRatio.value=r.refractionRatio),r.lightMap){i.lightMap.value=r.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*e,n(r.lightMap,i.lightMapTransform)}r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,Gm(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,o,s,a){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,n(i.metalnessMap,t.metalnessMapTransform));t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,n(i.roughnessMap,t.roughnessMapTransform));const r=e.get(i).envMap;r&&(t.envMapIntensity.value=i.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),1===e.side&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,a)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,o,s):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function q_(t,e,n,i){let r={},o={},s=[];const a=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,n,i){const r=t.value,o=e+"_"+n;if(void 0===i[o])return i[o]="number"==typeof r||"boolean"==typeof r?r:r.clone(),!0;{const t=i[o];if("number"==typeof r||"boolean"==typeof r){if(t!==r)return i[o]=r,!0}else if(!1===t.equals(r))return t.copy(r),!0}return!1}function c(t){const e={boundary:0,storage:0};return"number"==typeof t||"boolean"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function h(e){const n=e.target;n.removeEventListener("dispose",h);const i=s.indexOf(n.__bindingPointIndex);s.splice(i,1),t.deleteBuffer(r[n.id]),delete r[n.id],delete o[n.id]}return{bind:function(t,e){const n=e.program;i.uniformBlockBinding(t,n)},update:function(n,u){let d=r[n.id];void 0===d&&(!function(t){const e=t.uniforms;let n=0;const i=16;for(let t=0,r=e.length;t<r;t++){const r=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0,e=r.length;t<e;t++){const e=r[t],o=Array.isArray(e.value)?e.value:[e.value];for(let t=0,r=o.length;t<r;t++){const r=c(o[t]),s=n%i;0!==s&&i-s<r.boundary&&(n+=i-s),e.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,n+=r.storage}}}const r=n%i;r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),d=function(e){const n=function(){for(let t=0;t<a;t++)if(-1===s.indexOf(t))return s.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=n;const i=t.createBuffer(),r=e.__size,o=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,i),t.bufferData(t.UNIFORM_BUFFER,r,o),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,n,i),i}(n),r[n.id]=d,n.addEventListener("dispose",h));const p=u.program;i.updateUBOMapping(n,p);const f=e.render.frame;o[n.id]!==f&&(!function(e){const n=r[e.id],i=e.uniforms,o=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=i.length;e<n;e++){const n=Array.isArray(i[e])?i[e]:[i[e]];for(let i=0,r=n.length;i<r;i++){const r=n[i];if(!0===l(r,e,i,o)){const e=r.__offset,n=Array.isArray(r.value)?r.value:[r.value];let i=0;for(let o=0;o<n.length;o++){const s=n[o],a=c(s);"number"==typeof s||"boolean"==typeof s?(r.__data[0]=s,t.bufferSubData(t.UNIFORM_BUFFER,e+i,r.__data)):s.isMatrix3?(r.__data[0]=s.elements[0],r.__data[1]=s.elements[1],r.__data[2]=s.elements[2],r.__data[3]=0,r.__data[4]=s.elements[3],r.__data[5]=s.elements[4],r.__data[6]=s.elements[5],r.__data[7]=0,r.__data[8]=s.elements[6],r.__data[9]=s.elements[7],r.__data[10]=s.elements[8],r.__data[11]=0):(s.toArray(r.__data,i),i+=a.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,e,r.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(n),o[n.id]=f)},dispose:function(){for(const e in r)t.deleteBuffer(r[e]);s=[],r={},o={}}}}class Z_{constructor(t={}){const{canvas:e=cp(),context:n=null,depth:i=!0,stencil:r=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:a=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:h=!1}=t;let u;this.isWebGLRenderer=!0,u=null!==n?n.getContextAttributes().alpha:o;const d=new Uint32Array(4),p=new Int32Array(4);let f=null,m=null;const g=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=bd,this._useLegacyLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const _=this;let y=!1,b=0,x=0,S=null,w=-1,M=null;const T=new Ap,A=new Ap;let E=null;const C=new Jf(0);let R=0,P=e.width,L=e.height,I=1,O=null,k=null;const U=new Ap(0,0,P,L),D=new Ap(0,0,P,L);let N=!1;const B=new lg;let F=!1,z=!1,H=null;const W=new cf,V=new np,G=new Ip,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function X(){return null===S?I:1}let $,Y,q,Z,K,J,Q,tt,et,nt,it,rt,ot,st,at,lt,ct,ht,ut,dt,pt,ft,mt,gt,vt=n;function _t(t,n){for(let i=0;i<t.length;i++){const r=t[i],o=e.getContext(r,n);if(null!==o)return o}return null}try{const t={alpha:!0,depth:i,stencil:r,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Oh}`),e.addEventListener("webglcontextlost",xt,!1),e.addEventListener("webglcontextrestored",St,!1),e.addEventListener("webglcontextcreationerror",wt,!1),null===vt){const e=["webgl2","webgl","experimental-webgl"];if(!0===_.isWebGL1Renderer&&e.shift(),vt=_t(e,t),null===vt)throw _t(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}"undefined"!=typeof WebGLRenderingContext&&vt instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),void 0===vt.getShaderPrecisionFormat&&(vt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function yt(){$=new Wg(vt),Y=new xg(vt,$,t),$.init(Y),ft=new F_(vt,$,Y),q=new N_(vt,$,Y),Z=new jg(vt),K=new w_,J=new B_(vt,$,q,K,Y,ft,Z),Q=new wg(_),tt=new Hg(_),et=new hg(vt,Y),mt=new yg(vt,$,et,Y),nt=new Vg(vt,et,Z,mt),it=new qg(vt,nt,et,Z),ut=new Yg(vt,Y,J),lt=new Sg(K),rt=new S_(_,Q,tt,$,Y,mt,lt),ot=new Y_(_,K),st=new E_,at=new O_($,Y),ht=new _g(_,Q,tt,q,it,u,a),ct=new D_(_,it,Y),gt=new q_(vt,Z,Y,q),dt=new bg(vt,$,Z,Y),pt=new Gg(vt,$,Z,Y),Z.programs=rt.programs,_.capabilities=Y,_.extensions=$,_.properties=K,_.renderLists=st,_.shadowMap=ct,_.state=q,_.info=Z}yt();const bt=new j_(_,vt);function xt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function St(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const t=Z.autoReset,e=ct.enabled,n=ct.autoUpdate,i=ct.needsUpdate,r=ct.type;yt(),Z.autoReset=t,ct.enabled=e,ct.autoUpdate=n,ct.needsUpdate=i,ct.type=r}function wt(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function Mt(t){const e=t.target;e.removeEventListener("dispose",Mt),function(t){(function(t){const e=K.get(t).programs;void 0!==e&&(e.forEach(function(t){rt.releaseProgram(t)}),t.isShaderMaterial&&rt.releaseShaderCache(t))})(t),K.remove(t)}(e)}function Tt(t,e,n){!0===t.transparent&&2===t.side&&!1===t.forceSinglePass?(t.side=1,t.needsUpdate=!0,kt(t,e,n),t.side=0,t.needsUpdate=!0,kt(t,e,n),t.side=2):kt(t,e,n)}this.xr=bt,this.getContext=function(){return vt},this.getContextAttributes=function(){return vt.getContextAttributes()},this.forceContextLoss=function(){const t=$.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=$.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(t){void 0!==t&&(I=t,this.setSize(P,L,!1))},this.getSize=function(t){return t.set(P,L)},this.setSize=function(t,n,i=!0){bt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(P=t,L=n,e.width=Math.floor(t*I),e.height=Math.floor(n*I),!0===i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(P*I,L*I).floor()},this.setDrawingBufferSize=function(t,n,i){P=t,L=n,I=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(T)},this.getViewport=function(t){return t.copy(U)},this.setViewport=function(t,e,n,i){t.isVector4?U.set(t.x,t.y,t.z,t.w):U.set(t,e,n,i),q.viewport(T.copy(U).multiplyScalar(I).round())},this.getScissor=function(t){return t.copy(D)},this.setScissor=function(t,e,n,i){t.isVector4?D.set(t.x,t.y,t.z,t.w):D.set(t,e,n,i),q.scissor(A.copy(D).multiplyScalar(I).round())},this.getScissorTest=function(){return N},this.setScissorTest=function(t){q.setScissorTest(N=t)},this.setOpaqueSort=function(t){O=t},this.setTransparentSort=function(t){k=t},this.getClearColor=function(t){return t.copy(ht.getClearColor())},this.setClearColor=function(){ht.setClearColor.apply(ht,arguments)},this.getClearAlpha=function(){return ht.getClearAlpha()},this.setClearAlpha=function(){ht.setClearAlpha.apply(ht,arguments)},this.clear=function(t=!0,e=!0,n=!0){let i=0;if(t){let t=!1;if(null!==S){const e=S.texture.format;t=e===Ou||e===Iu||e===Lu}if(t){const t=S.texture.type,e=t===_u||t===xu||t===yu||t===Au||t===Mu||t===Tu,n=ht.getClearColor(),i=ht.getClearAlpha(),r=n.r,o=n.g,s=n.b;e?(d[0]=r,d[1]=o,d[2]=s,d[3]=i,vt.clearBufferuiv(vt.COLOR,0,d)):(p[0]=r,p[1]=o,p[2]=s,p[3]=i,vt.clearBufferiv(vt.COLOR,0,p))}else i|=vt.COLOR_BUFFER_BIT}e&&(i|=vt.DEPTH_BUFFER_BIT),n&&(i|=vt.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),vt.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",xt,!1),e.removeEventListener("webglcontextrestored",St,!1),e.removeEventListener("webglcontextcreationerror",wt,!1),st.dispose(),at.dispose(),K.dispose(),Q.dispose(),tt.dispose(),it.dispose(),mt.dispose(),gt.dispose(),rt.dispose(),bt.dispose(),bt.removeEventListener("sessionstart",Et),bt.removeEventListener("sessionend",Ct),H&&(H.dispose(),H=null),Rt.stop()},this.renderBufferDirect=function(t,e,n,i,r,o){null===e&&(e=j);const s=r.isMesh&&r.matrixWorld.determinant()<0,a=function(t,e,n,i,r){!0!==e.isScene&&(e=j);J.resetTextureUnits();const o=e.fog,s=i.isMeshStandardMaterial?e.environment:null,a=null===S?_.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:xd,l=(i.isMeshStandardMaterial?tt:Q).get(i.envMap||s),c=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!n.attributes.tangent&&(!!i.normalMap||i.anisotropy>0),u=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color;let f=0;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=_.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==g?g.length:0,y=K.get(i),b=m.state.lights;if(!0===F&&(!0===z||t!==M)){const e=t===M&&i.id===w;lt.setState(i,t,e)}let x=!1;i.version===y.__version?y.needsLights&&y.lightsStateVersion!==b.state.version||y.outputColorSpace!==a||r.isBatchedMesh&&!1===y.batching?x=!0:r.isBatchedMesh||!0!==y.batching?r.isInstancedMesh&&!1===y.instancing?x=!0:r.isInstancedMesh||!0!==y.instancing?r.isSkinnedMesh&&!1===y.skinning?x=!0:r.isSkinnedMesh||!0!==y.skinning?r.isInstancedMesh&&!0===y.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===y.instancingColor&&null!==r.instanceColor||r.isInstancedMesh&&!0===y.instancingMorph&&null===r.morphTexture||r.isInstancedMesh&&!1===y.instancingMorph&&null!==r.morphTexture||y.envMap!==l||!0===i.fog&&y.fog!==o?x=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===lt.numPlanes&&y.numIntersection===lt.numIntersection?(y.vertexAlphas!==c||y.vertexTangents!==h||y.morphTargets!==u||y.morphNormals!==d||y.morphColors!==p||y.toneMapping!==f||!0===Y.isWebGL2&&y.morphTargetsCount!==v)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,y.__version=i.version);let T=y.currentProgram;!0===x&&(T=kt(i,e,r));let A=!1,E=!1,C=!1;const R=T.getUniforms(),P=y.uniforms;q.useProgram(T.program)&&(A=!0,E=!0,C=!0);i.id!==w&&(w=i.id,E=!0);if(A||M!==t){R.setValue(vt,"projectionMatrix",t.projectionMatrix),R.setValue(vt,"viewMatrix",t.matrixWorldInverse);const e=R.map.cameraPosition;void 0!==e&&e.setValue(vt,G.setFromMatrixPosition(t.matrixWorld)),Y.logarithmicDepthBuffer&&R.setValue(vt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&R.setValue(vt,"isOrthographic",!0===t.isOrthographicCamera),M!==t&&(M=t,E=!0,C=!0)}if(r.isSkinnedMesh){R.setOptional(vt,r,"bindMatrix"),R.setOptional(vt,r,"bindMatrixInverse");const t=r.skeleton;t&&(Y.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),R.setValue(vt,"boneTexture",t.boneTexture,J)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}r.isBatchedMesh&&(R.setOptional(vt,r,"batchingTexture"),R.setValue(vt,"batchingTexture",r._matricesTexture,J));const O=n.morphAttributes;(void 0!==O.position||void 0!==O.normal||void 0!==O.color&&!0===Y.isWebGL2)&&ut.update(r,n,T);(E||y.receiveShadow!==r.receiveShadow)&&(y.receiveShadow=r.receiveShadow,R.setValue(vt,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(P.envMap.value=l,P.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);E&&(R.setValue(vt,"toneMappingExposure",_.toneMappingExposure),y.needsLights&&(U=C,(k=P).ambientLightColor.needsUpdate=U,k.lightProbe.needsUpdate=U,k.directionalLights.needsUpdate=U,k.directionalLightShadows.needsUpdate=U,k.pointLights.needsUpdate=U,k.pointLightShadows.needsUpdate=U,k.spotLights.needsUpdate=U,k.spotLightShadows.needsUpdate=U,k.rectAreaLights.needsUpdate=U,k.hemisphereLights.needsUpdate=U),o&&!0===i.fog&&ot.refreshFogUniforms(P,o),ot.refreshMaterialUniforms(P,i,I,L,H),e_.upload(vt,Ut(y),P,J));var k,U;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(e_.upload(vt,Ut(y),P,J),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&R.setValue(vt,"center",r.center);if(R.setValue(vt,"modelViewMatrix",r.modelViewMatrix),R.setValue(vt,"normalMatrix",r.normalMatrix),R.setValue(vt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e<n;e++)if(Y.isWebGL2){const n=t[e];gt.update(n,T),gt.bind(n,T)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return T}(t,e,n,i,r);q.setMaterial(i,s);let l=n.index,c=1;if(!0===i.wireframe){if(l=nt.getWireframeAttribute(n),void 0===l)return;c=2}const h=n.drawRange,u=n.attributes.position;let d=h.start*c,p=(h.start+h.count)*c;null!==o&&(d=Math.max(d,o.start*c),p=Math.min(p,(o.start+o.count)*c)),null!==l?(d=Math.max(d,0),p=Math.min(p,l.count)):null!=u&&(d=Math.max(d,0),p=Math.min(p,u.count));const f=p-d;if(f<0||f===1/0)return;let g;mt.setup(r,i,a,n,l);let v=dt;if(null!==l&&(g=et.get(l),v=pt,v.setIndex(g)),r.isMesh)!0===i.wireframe?(q.setLineWidth(i.wireframeLinewidth*X()),v.setMode(vt.LINES)):v.setMode(vt.TRIANGLES);else if(r.isLine){let t=i.linewidth;void 0===t&&(t=1),q.setLineWidth(t*X()),r.isLineSegments?v.setMode(vt.LINES):r.isLineLoop?v.setMode(vt.LINE_LOOP):v.setMode(vt.LINE_STRIP)}else r.isPoints?v.setMode(vt.POINTS):r.isSprite&&v.setMode(vt.TRIANGLES);if(r.isBatchedMesh)v.renderMultiDraw(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount);else if(r.isInstancedMesh)v.renderInstances(d,f,r.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);v.renderInstances(d,f,e)}else v.render(d,f)},this.compile=function(t,e,n=null){null===n&&(n=t),m=at.get(n),m.init(),v.push(m),n.traverseVisible(function(t){t.isLight&&t.layers.test(e.layers)&&(m.pushLight(t),t.castShadow&&m.pushShadow(t))}),t!==n&&t.traverseVisible(function(t){t.isLight&&t.layers.test(e.layers)&&(m.pushLight(t),t.castShadow&&m.pushShadow(t))}),m.setupLights(_._useLegacyLights);const i=new Set;return t.traverse(function(t){const e=t.material;if(e)if(Array.isArray(e))for(let r=0;r<e.length;r++){const o=e[r];Tt(o,n,t),i.add(o)}else Tt(e,n,t),i.add(e)}),v.pop(),m=null,i},this.compileAsync=function(t,e,n=null){const i=this.compile(t,e,n);return new Promise(e=>{function n(){i.forEach(function(t){K.get(t).currentProgram.isReady()&&i.delete(t)}),0!==i.size?setTimeout(n,10):e(t)}null!==$.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)})};let At=null;function Et(){Rt.stop()}function Ct(){Rt.start()}const Rt=new cg;function Pt(t,e,n,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)m.pushLight(t),t.castShadow&&m.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||B.intersectsSprite(t)){i&&G.setFromMatrixPosition(t.matrixWorld).applyMatrix4(W);const e=it.update(t),r=t.material;r.visible&&f.push(t,e,r,n,G.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||B.intersectsObject(t))){const e=it.update(t),r=t.material;if(i&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),G.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),G.copy(e.boundingSphere.center)),G.applyMatrix4(t.matrixWorld).applyMatrix4(W)),Array.isArray(r)){const i=e.groups;for(let o=0,s=i.length;o<s;o++){const s=i[o],a=r[s.materialIndex];a&&a.visible&&f.push(t,e,a,n,G.z,s)}}else r.visible&&f.push(t,e,r,n,G.z,null)}const r=t.children;for(let t=0,o=r.length;t<o;t++)Pt(r[t],e,n,i)}function Lt(t,e,n,i){const r=t.opaque,o=t.transmissive,s=t.transparent;m.setupLightsView(n),!0===F&<.setGlobalState(_.clippingPlanes,n),o.length>0&&function(t,e,n,i){const r=!0===n.isScene?n.overrideMaterial:null;if(null!==r)return;const o=Y.isWebGL2;null===H&&(H=new Cp(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")?wu:_u,minFilter:vu,samples:o?4:0}));_.getDrawingBufferSize(V),o?H.setSize(V.x,V.y):H.setSize(Jd(V.x),Jd(V.y));const s=_.getRenderTarget();_.setRenderTarget(H),_.getClearColor(C),R=_.getClearAlpha(),R<1&&_.setClearColor(16777215,.5);_.clear();const a=_.toneMapping;_.toneMapping=0,It(t,n,i),J.updateMultisampleRenderTarget(H),J.updateRenderTargetMipmap(H);let l=!1;for(let t=0,r=e.length;t<r;t++){const r=e[t],o=r.object,s=r.geometry,a=r.material,c=r.group;if(2===a.side&&o.layers.test(i.layers)){const t=a.side;a.side=1,a.needsUpdate=!0,Ot(o,n,i,s,a,c),a.side=t,a.needsUpdate=!0,l=!0}}!0===l&&(J.updateMultisampleRenderTarget(H),J.updateRenderTargetMipmap(H));_.setRenderTarget(s),_.setClearColor(C,R),_.toneMapping=a}(r,o,e,n),i&&q.viewport(T.copy(i)),r.length>0&&It(r,e,n),o.length>0&&It(o,e,n),s.length>0&&It(s,e,n),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1)}function It(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,o=t.length;r<o;r++){const o=t[r],s=o.object,a=o.geometry,l=null===i?o.material:i,c=o.group;s.layers.test(n.layers)&&Ot(s,e,n,a,l,c)}}function Ot(t,e,n,i,r,o){t.onBeforeRender(_,e,n,i,r,o),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(_,e,n,i,t,o),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,r.needsUpdate=!0,_.renderBufferDirect(n,e,i,r,t,o),r.side=0,r.needsUpdate=!0,_.renderBufferDirect(n,e,i,r,t,o),r.side=2):_.renderBufferDirect(n,e,i,r,t,o),t.onAfterRender(_,e,n,i,r,o)}function kt(t,e,n){!0!==e.isScene&&(e=j);const i=K.get(t),r=m.state.lights,o=m.state.shadowsArray,s=r.state.version,a=rt.getParameters(t,r.state,o,e,n),l=rt.getProgramCacheKey(a);let c=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null,i.fog=e.fog,i.envMap=(t.isMeshStandardMaterial?tt:Q).get(t.envMap||i.environment),i.envMapRotation=null!==i.environment&&null===t.envMap?e.environmentRotation:t.envMapRotation,void 0===c&&(t.addEventListener("dispose",Mt),c=new Map,i.programs=c);let h=c.get(l);if(void 0!==h){if(i.currentProgram===h&&i.lightsStateVersion===s)return Dt(t,a),h}else a.uniforms=rt.getUniforms(t),t.onBuild(n,a,_),t.onBeforeCompile(a,_),h=rt.acquireProgram(a,l),c.set(l,h),i.uniforms=a.uniforms;const u=i.uniforms;return(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(u.clippingPlanes=lt.uniform),Dt(t,a),i.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),i.lightsStateVersion=s,i.needsLights&&(u.ambientLightColor.value=r.state.ambient,u.lightProbe.value=r.state.probe,u.directionalLights.value=r.state.directional,u.directionalLightShadows.value=r.state.directionalShadow,u.spotLights.value=r.state.spot,u.spotLightShadows.value=r.state.spotShadow,u.rectAreaLights.value=r.state.rectArea,u.ltc_1.value=r.state.rectAreaLTC1,u.ltc_2.value=r.state.rectAreaLTC2,u.pointLights.value=r.state.point,u.pointLightShadows.value=r.state.pointShadow,u.hemisphereLights.value=r.state.hemi,u.directionalShadowMap.value=r.state.directionalShadowMap,u.directionalShadowMatrix.value=r.state.directionalShadowMatrix,u.spotShadowMap.value=r.state.spotShadowMap,u.spotLightMatrix.value=r.state.spotLightMatrix,u.spotLightMap.value=r.state.spotLightMap,u.pointShadowMap.value=r.state.pointShadowMap,u.pointShadowMatrix.value=r.state.pointShadowMatrix),i.currentProgram=h,i.uniformsList=null,h}function Ut(t){if(null===t.uniformsList){const e=t.currentProgram.getUniforms();t.uniformsList=e_.seqWithValue(e.seq,t.uniforms)}return t.uniformsList}function Dt(t,e){const n=K.get(t);n.outputColorSpace=e.outputColorSpace,n.batching=e.batching,n.instancing=e.instancing,n.instancingColor=e.instancingColor,n.instancingMorph=e.instancingMorph,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}Rt.setAnimationLoop(function(t){At&&At(t)}),"undefined"!=typeof self&&Rt.setContext(self),this.setAnimationLoop=function(t){At=t,bt.setAnimationLoop(t),null===t?Rt.stop():Rt.start()},bt.addEventListener("sessionstart",Et),bt.addEventListener("sessionend",Ct),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===y)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===bt.enabled&&!0===bt.isPresenting&&(!0===bt.cameraAutoUpdate&&bt.updateCamera(e),e=bt.getCamera()),!0===t.isScene&&t.onBeforeRender(_,t,e,S),m=at.get(t,v.length),m.init(),v.push(m),W.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),B.setFromProjectionMatrix(W),z=this.localClippingEnabled,F=lt.init(this.clippingPlanes,z),f=st.get(t,g.length),f.init(),g.push(f),Pt(t,e,0,_.sortObjects),f.finish(),!0===_.sortObjects&&f.sort(O,k),this.info.render.frame++,!0===F&<.beginShadows();const n=m.state.shadowsArray;if(ct.render(n,t,e),!0===F&<.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1!==bt.enabled&&!1!==bt.isPresenting&&!1!==bt.hasDepthSensing()||ht.render(f,t),m.setupLights(_._useLegacyLights),e.isArrayCamera){const n=e.cameras;for(let e=0,i=n.length;e<i;e++){const i=n[e];Lt(f,t,i,i.viewport)}}else Lt(f,t,e);null!==S&&(J.updateMultisampleRenderTarget(S),J.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(_,t,e),mt.resetDefaultState(),w=-1,M=null,v.pop(),m=v.length>0?v[v.length-1]:null,g.pop(),f=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return x},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){K.get(t.texture).__webglTexture=e,K.get(t.depthTexture).__webglTexture=n;const i=K.get(t);i.__hasExternalTextures=!0,i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(t,e){const n=K.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){S=t,b=e,x=n;let i=!0,r=null,o=!1,s=!1;if(t){const a=K.get(t);void 0!==a.__useDefaultFramebuffer?(q.bindFramebuffer(vt.FRAMEBUFFER,null),i=!1):void 0===a.__webglFramebuffer?J.setupRenderTarget(t):a.__hasExternalTextures&&J.rebindTextures(t,K.get(t.texture).__webglTexture,K.get(t.depthTexture).__webglTexture);const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(s=!0);const c=K.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=Array.isArray(c[e])?c[e][n]:c[e],o=!0):r=Y.isWebGL2&&t.samples>0&&!1===J.useMultisampledRTT(t)?K.get(t).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,T.copy(t.viewport),A.copy(t.scissor),E=t.scissorTest}else T.copy(U).multiplyScalar(I).floor(),A.copy(D).multiplyScalar(I).floor(),E=N;if(q.bindFramebuffer(vt.FRAMEBUFFER,r)&&Y.drawBuffers&&i&&q.drawBuffers(t,r),q.viewport(T),q.scissor(A),q.setScissorTest(E),o){const i=K.get(t.texture);vt.framebufferTexture2D(vt.FRAMEBUFFER,vt.COLOR_ATTACHMENT0,vt.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(s){const i=K.get(t.texture),r=e||0;vt.framebufferTextureLayer(vt.FRAMEBUFFER,vt.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}w=-1},this.readRenderTargetPixels=function(t,e,n,i,r,o,s){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=K.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){q.bindFramebuffer(vt.FRAMEBUFFER,a);try{const s=t.texture,a=s.format,l=s.type;if(a!==Eu&&ft.convert(a)!==vt.getParameter(vt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===wu&&($.has("EXT_color_buffer_half_float")||Y.isWebGL2&&$.has("EXT_color_buffer_float"));if(!(l===_u||ft.convert(l)===vt.getParameter(vt.IMPLEMENTATION_COLOR_READ_TYPE)||l===Su&&(Y.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&vt.readPixels(e,n,i,r,ft.convert(a),ft.convert(l),o)}finally{const t=null!==S?K.get(S).__webglFramebuffer:null;q.bindFramebuffer(vt.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),o=Math.floor(e.image.height*i);J.setTexture2D(e,0),vt.copyTexSubImage2D(vt.TEXTURE_2D,n,0,0,t.x,t.y,r,o),q.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,o=e.image.height,s=ft.convert(n.format),a=ft.convert(n.type);J.setTexture2D(n,0),vt.pixelStorei(vt.UNPACK_FLIP_Y_WEBGL,n.flipY),vt.pixelStorei(vt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),vt.pixelStorei(vt.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?vt.texSubImage2D(vt.TEXTURE_2D,i,t.x,t.y,r,o,s,a,e.image.data):e.isCompressedTexture?vt.compressedTexSubImage2D(vt.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,s,e.mipmaps[0].data):vt.texSubImage2D(vt.TEXTURE_2D,i,t.x,t.y,s,a,e.image),0===i&&n.generateMipmaps&&vt.generateMipmap(vt.TEXTURE_2D),q.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const o=Math.round(t.max.x-t.min.x),s=Math.round(t.max.y-t.min.y),a=t.max.z-t.min.z+1,l=ft.convert(i.format),c=ft.convert(i.type);let h;if(i.isData3DTexture)J.setTexture3D(i,0),h=vt.TEXTURE_3D;else{if(!i.isDataArrayTexture&&!i.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");J.setTexture2DArray(i,0),h=vt.TEXTURE_2D_ARRAY}vt.pixelStorei(vt.UNPACK_FLIP_Y_WEBGL,i.flipY),vt.pixelStorei(vt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),vt.pixelStorei(vt.UNPACK_ALIGNMENT,i.unpackAlignment);const u=vt.getParameter(vt.UNPACK_ROW_LENGTH),d=vt.getParameter(vt.UNPACK_IMAGE_HEIGHT),p=vt.getParameter(vt.UNPACK_SKIP_PIXELS),f=vt.getParameter(vt.UNPACK_SKIP_ROWS),m=vt.getParameter(vt.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[r]:n.image;vt.pixelStorei(vt.UNPACK_ROW_LENGTH,g.width),vt.pixelStorei(vt.UNPACK_IMAGE_HEIGHT,g.height),vt.pixelStorei(vt.UNPACK_SKIP_PIXELS,t.min.x),vt.pixelStorei(vt.UNPACK_SKIP_ROWS,t.min.y),vt.pixelStorei(vt.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?vt.texSubImage3D(h,r,e.x,e.y,e.z,o,s,a,l,c,g.data):i.isCompressedArrayTexture?vt.compressedTexSubImage3D(h,r,e.x,e.y,e.z,o,s,a,l,g.data):vt.texSubImage3D(h,r,e.x,e.y,e.z,o,s,a,l,c,g),vt.pixelStorei(vt.UNPACK_ROW_LENGTH,u),vt.pixelStorei(vt.UNPACK_IMAGE_HEIGHT,d),vt.pixelStorei(vt.UNPACK_SKIP_PIXELS,p),vt.pixelStorei(vt.UNPACK_SKIP_ROWS,f),vt.pixelStorei(vt.UNPACK_SKIP_IMAGES,m),0===r&&i.generateMipmaps&&vt.generateMipmap(h),q.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?J.setTextureCube(t,0):t.isData3DTexture?J.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?J.setTexture2DArray(t,0):J.setTexture2D(t,0),q.unbindTexture()},this.resetState=function(){b=0,x=0,S=null,q.reset(),mt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return zd}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===Sd?"display-p3":"srgb",e.unpackColorSpace=gp.workingColorSpace===wd?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class K_ extends Z_{}K_.prototype.isWebGL1Renderer=!0;class J_{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Jf(t),this.density=e}clone(){return new J_(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Q_{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new Jf(t),this.near=e,this.far=n}clone(){return new Q_(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class ty extends Df{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new yf,this.environmentRotation=new yf,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class ey{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Nd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=$d()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return up("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=$d()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=$d()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.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}}}const ny=new Ip;class iy{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)ny.fromBufferAttribute(this,e),ny.applyMatrix4(t),this.setXYZ(e,ny.x,ny.y,ny.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)ny.fromBufferAttribute(this,e),ny.applyNormalMatrix(t),this.setXYZ(e,ny.x,ny.y,ny.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)ny.fromBufferAttribute(this,e),ny.transformDirection(t),this.setXYZ(e,ny.x,ny.y,ny.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Qd(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=tp(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=tp(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=tp(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=tp(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=tp(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Qd(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Qd(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Qd(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Qd(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array),i=tp(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array),i=tp(i,this.array),r=tp(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new hm(new this.array.constructor(t),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 iy(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class ry extends em{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Jf(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let oy;const sy=new Ip,ay=new Ip,ly=new Ip,cy=new np,hy=new np,uy=new cf,dy=new Ip,py=new Ip,fy=new Ip,my=new np,gy=new np,vy=new np;class _y extends Df{constructor(t=new ry){if(super(),this.isSprite=!0,this.type="Sprite",void 0===oy){oy=new xm;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new ey(t,5);oy.setIndex([0,1,2,0,2,3]),oy.setAttribute("position",new iy(e,3,0,!1)),oy.setAttribute("uv",new iy(e,2,3,!1))}this.geometry=oy,this.material=t,this.center=new np(.5,.5)}raycast(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ay.setFromMatrixScale(this.matrixWorld),uy.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),ly.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&ay.multiplyScalar(-ly.z);const n=this.material.rotation;let i,r;0!==n&&(r=Math.cos(n),i=Math.sin(n));const o=this.center;yy(dy.set(-.5,-.5,0),ly,o,ay,i,r),yy(py.set(.5,-.5,0),ly,o,ay,i,r),yy(fy.set(.5,.5,0),ly,o,ay,i,r),my.set(0,0),gy.set(1,0),vy.set(1,1);let s=t.ray.intersectTriangle(dy,py,fy,!1,sy);if(null===s&&(yy(py.set(-.5,.5,0),ly,o,ay,i,r),gy.set(0,1),s=t.ray.intersectTriangle(dy,fy,py,!1,sy),null===s))return;const a=t.ray.origin.distanceTo(sy);a<t.near||a>t.far||e.push({distance:a,point:sy.clone(),uv:$f.getInterpolation(sy,dy,py,fy,my,gy,vy,new np),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function yy(t,e,n,i,r,o){cy.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(hy.x=o*cy.x-r*cy.y,hy.y=r*cy.x+o*cy.y):hy.copy(cy),t.copy(e),t.x+=hy.x,t.y+=hy.y,t.applyMatrix4(uy)}const by=new Ip,xy=new Ip;class Sy extends Df{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,n=e.length;t<n;t++){const n=e[t];this.addLevel(n.object.clone(),n.distance,n.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,n=0){e=Math.abs(e);const i=this.levels;let r;for(r=0;r<i.length&&!(e<i[r].distance);r++);return i.splice(r,0,{distance:e,hysteresis:n,object:t}),this.add(t),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let n,i;for(n=1,i=e.length;n<i;n++){let i=e[n].distance;if(e[n].object.visible&&(i-=i*e[n].hysteresis),t<i)break}return e[n-1].object}return null}raycast(t,e){if(this.levels.length>0){by.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(by);this.getObjectForDistance(n).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){by.setFromMatrixPosition(t.matrixWorld),xy.setFromMatrixPosition(this.matrixWorld);const n=by.distanceTo(xy)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i<r;i++){let t=e[i].distance;if(e[i].object.visible&&(t-=t*e[i].hysteresis),!(n>=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;i<r;i++)e[i].object.visible=!1}}toJSON(t){const e=super.toJSON(t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const n=this.levels;for(let t=0,i=n.length;t<i;t++){const i=n[t];e.object.levels.push({object:i.object.uuid,distance:i.distance,hysteresis:i.hysteresis})}return e}}const wy=new Ip,My=new Ap,Ty=new Ap,Ay=new Ip,Ey=new cf,Cy=new Ip,Ry=new Qp,Py=new cf,Ly=new lf;class Iy extends Fm{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=eu,this.bindMatrix=new cf,this.bindMatrixInverse=new cf,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const t=this.geometry;null===this.boundingBox&&(this.boundingBox=new Up),this.boundingBox.makeEmpty();const e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,Cy),this.boundingBox.expandByPoint(Cy)}computeBoundingSphere(){const t=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new Qp),this.boundingSphere.makeEmpty();const e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,Cy),this.boundingSphere.expandByPoint(Cy)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){const n=this.material,i=this.matrixWorld;void 0!==n&&(null===this.boundingSphere&&this.computeBoundingSphere(),Ry.copy(this.boundingSphere),Ry.applyMatrix4(i),!1!==t.ray.intersectsSphere(Ry)&&(Py.copy(i).invert(),Ly.copy(t.ray).applyMatrix4(Py),null!==this.boundingBox&&!1===Ly.intersectsBox(this.boundingBox)||this._computeIntersections(t,e,Ly)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new Ap,e=this.geometry.attributes.skinWeight;for(let n=0,i=e.count;n<i;n++){t.fromBufferAttribute(e,n);const i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===eu?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===nu?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){const n=this.skeleton,i=this.geometry;My.fromBufferAttribute(i.attributes.skinIndex,t),Ty.fromBufferAttribute(i.attributes.skinWeight,t),wy.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){const i=Ty.getComponent(t);if(0!==i){const r=My.getComponent(t);Ey.multiplyMatrices(n.bones[r].matrixWorld,n.boneInverses[r]),e.addScaledVector(Ay.copy(wy).applyMatrix4(Ey),i)}}return e.applyMatrix4(this.bindMatrixInverse)}}class Oy extends Df{constructor(){super(),this.isBone=!0,this.type="Bone"}}class ky extends Tp{constructor(t=null,e=1,n=1,i,r,o,s,a,l=1003,c=1003,h,u){super(null,o,s,a,l,c,i,r,h,u),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Uy=new cf,Dy=new cf;class Ny{constructor(t=[],e=[]){this.uuid=$d(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new cf)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const e=new cf;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){const t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let i=0,r=t.length;i<r;i++){const r=t[i]?t[i].matrixWorld:Dy;Uy.multiplyMatrices(r,e[i]),Uy.toArray(n,16*i)}null!==i&&(i.needsUpdate=!0)}clone(){return new Ny(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=4*Math.ceil(t/4),t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const n=new ky(e,t,t,Eu,Su);return n.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=n,this}getBoneByName(t){for(let e=0,n=this.bones.length;e<n;e++){const n=this.bones[e];if(n.name===t)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let n=0,i=t.bones.length;n<i;n++){const i=t.bones[n];let r=e[i];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",i),r=new Oy),this.bones.push(r),this.boneInverses.push((new cf).fromArray(t.boneInverses[n]))}return this.init(),this}toJSON(){const t={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,n=this.boneInverses;for(let i=0,r=e.length;i<r;i++){const r=e[i];t.bones.push(r.uuid);const o=n[i];t.boneInverses.push(o.toArray())}return t}}class By extends hm{constructor(t,e,n,i=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const Fy=new cf,zy=new cf,Hy=[],Wy=new Up,Vy=new cf,Gy=new Fm,jy=new Qp;class Xy extends Fm{constructor(t,e,n){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new By(new Float32Array(16*n),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let t=0;t<n;t++)this.setMatrixAt(t,Vy)}computeBoundingBox(){const t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new Up),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<e;n++)this.getMatrixAt(n,Fy),Wy.copy(t.boundingBox).applyMatrix4(Fy),this.boundingBox.union(Wy)}computeBoundingSphere(){const t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new Qp),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<e;n++)this.getMatrixAt(n,Fy),jy.copy(t.boundingSphere).applyMatrix4(Fy),this.boundingSphere.union(jy)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){const n=e.morphTargetInfluences,i=this.morphTexture.source.data.data,r=t*(n.length+1)+1;for(let t=0;t<n.length;t++)n[t]=i[r+t]}raycast(t,e){const n=this.matrixWorld,i=this.count;if(Gy.geometry=this.geometry,Gy.material=this.material,void 0!==Gy.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),jy.copy(this.boundingSphere),jy.applyMatrix4(n),!1!==t.ray.intersectsSphere(jy)))for(let r=0;r<i;r++){this.getMatrixAt(r,Fy),zy.multiplyMatrices(n,Fy),Gy.matrixWorld=zy,Gy.raycast(t,Hy);for(let t=0,n=Hy.length;t<n;t++){const n=Hy[t];n.instanceId=r,n.object=this,e.push(n)}Hy.length=0}}setColorAt(t,e){null===this.instanceColor&&(this.instanceColor=new By(new Float32Array(3*this.instanceMatrix.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}setMorphAt(t,e){const n=e.morphTargetInfluences,i=n.length+1;null===this.morphTexture&&(this.morphTexture=new ky(new Float32Array(i*this.count),i,this.count,Pu,Su));const r=this.morphTexture.source.data.data;let o=0;for(let t=0;t<n.length;t++)o+=n[t];const s=this.geometry.morphTargetsRelative?1:1-o,a=i*t;r[a]=s,r.set(n,a+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}function $y(t,e){return t.z-e.z}function Yy(t,e){return e.z-t.z}class qy{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e){const n=this.pool,i=this.list;this.index>=n.length&&n.push({start:-1,count:-1,z:-1});const r=n[this.index];i.push(r),this.index++,r.start=t.start,r.count=t.count,r.z=e}reset(){this.list.length=0,this.index=0}}const Zy="batchId",Ky=new cf,Jy=new cf,Qy=new cf,tb=new cf,eb=new lg,nb=new Up,ib=new Qp,rb=new Ip,ob=new qy,sb=new Fm,ab=[];function lb(t,e,n=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const r=t.count;for(let o=0;o<r;o++)for(let r=0;r<i;r++)e.setComponent(o+n,r,t.getComponent(o,r))}else e.array.set(t.array,n*i);e.needsUpdate=!0}class cb extends Fm{get maxGeometryCount(){return this._maxGeometryCount}constructor(t,e,n=2*e,i){super(new xm,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawRanges=[],this._reservedRanges=[],this._visibility=[],this._active=[],this._bounds=[],this._maxGeometryCount=t,this._maxVertexCount=e,this._maxIndexCount=n,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(t),this._multiDrawStarts=new Int32Array(t),this._multiDrawCount=0,this._visibilityChanged=!0,this._matricesTexture=null,this._initMatricesTexture()}_initMatricesTexture(){let t=Math.sqrt(4*this._maxGeometryCount);t=4*Math.ceil(t/4),t=Math.max(t,4);const e=new Float32Array(t*t*4),n=new ky(e,t,t,Eu,Su);this._matricesTexture=n}_initializeGeometry(t){const e=this.geometry,n=this._maxVertexCount,i=this._maxGeometryCount,r=this._maxIndexCount;if(!1===this._geometryInitialized){for(const i in t.attributes){const r=t.getAttribute(i),{array:o,itemSize:s,normalized:a}=r,l=new o.constructor(n*s),c=new r.constructor(l,s,a);c.setUsage(r.usage),e.setAttribute(i,c)}if(null!==t.getIndex()){const t=n>65536?new Uint32Array(r):new Uint16Array(r);e.setIndex(new hm(t,1))}const o=i>65536?new Uint32Array(n):new Uint16Array(n);e.setAttribute(Zy,new hm(o,1)),this._geometryInitialized=!0}}_validateGeometry(t){if(t.getAttribute(Zy))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Zy}"`);const e=this.geometry;if(Boolean(t.getIndex())!==Boolean(e.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const n in e.attributes){if(n===Zy)continue;if(!t.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=t.getAttribute(n),r=e.getAttribute(n);if(i.itemSize!==r.itemSize||i.normalized!==r.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Up);const t=this._geometryCount,e=this.boundingBox,n=this._active;e.makeEmpty();for(let i=0;i<t;i++)!1!==n[i]&&(this.getMatrixAt(i,Ky),this.getBoundingBoxAt(i,nb).applyMatrix4(Ky),e.union(nb))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Qp);const t=this._geometryCount,e=this.boundingSphere,n=this._active;e.makeEmpty();for(let i=0;i<t;i++)!1!==n[i]&&(this.getMatrixAt(i,Ky),this.getBoundingSphereAt(i,ib).applyMatrix4(Ky),e.union(ib))}addGeometry(t,e=-1,n=-1){if(this._initializeGeometry(t),this._validateGeometry(t),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let r=null;const o=this._reservedRanges,s=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(r=o[o.length-1]),i.vertexCount=-1===e?t.getAttribute("position").count:e,i.vertexStart=null===r?0:r.vertexStart+r.vertexCount;const l=t.getIndex(),c=null!==l;if(c&&(i.indexCount=-1===n?l.count:n,i.indexStart=null===r?0:r.indexStart+r.indexCount),-1!==i.indexStart&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,u=this._active,d=this._matricesTexture,p=this._matricesTexture.image.data;h.push(!0),u.push(!0);const f=this._geometryCount;this._geometryCount++,Qy.toArray(p,16*f),d.needsUpdate=!0,o.push(i),s.push({start:c?i.indexStart:i.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Up,sphereInitialized:!1,sphere:new Qp});const m=this.geometry.getAttribute(Zy);for(let t=0;t<i.vertexCount;t++)m.setX(i.vertexStart+t,f);return m.needsUpdate=!0,this.setGeometryAt(f,t),f}setGeometryAt(t,e){if(t>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const n=this.geometry,i=null!==n.getIndex(),r=n.getIndex(),o=e.getIndex(),s=this._reservedRanges[t];if(i&&o.count>s.indexCount||e.attributes.position.count>s.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=s.vertexStart,l=s.vertexCount;for(const t in n.attributes){if(t===Zy)continue;const i=e.getAttribute(t),r=n.getAttribute(t);lb(i,r,a);const o=i.itemSize;for(let t=i.count,e=l;t<e;t++){const e=a+t;for(let t=0;t<o;t++)r.setComponent(e,t,0)}r.needsUpdate=!0}if(i){const t=s.indexStart;for(let e=0;e<o.count;e++)r.setX(t+e,a+o.getX(e));for(let e=o.count,n=s.indexCount;e<n;e++)r.setX(t+e,a);r.needsUpdate=!0}const c=this._bounds[t];null!==e.boundingBox?(c.box.copy(e.boundingBox),c.boxInitialized=!0):c.boxInitialized=!1,null!==e.boundingSphere?(c.sphere.copy(e.boundingSphere),c.sphereInitialized=!0):c.sphereInitialized=!1;const h=this._drawRanges[t],u=e.getAttribute("position");return h.count=i?o.count:u.count,this._visibilityChanged=!0,t}deleteGeometry(t){const e=this._active;return t>=e.length||!1===e[t]||(e[t]=!1,this._visibilityChanged=!0),this}getBoundingBoxAt(t,e){if(!1===this._active[t])return null;const n=this._bounds[t],i=n.box,r=this.geometry;if(!1===n.boxInitialized){i.makeEmpty();const e=r.index,o=r.attributes.position,s=this._drawRanges[t];for(let t=s.start,n=s.start+s.count;t<n;t++){let n=t;e&&(n=e.getX(n)),i.expandByPoint(rb.fromBufferAttribute(o,n))}n.boxInitialized=!0}return e.copy(i),e}getBoundingSphereAt(t,e){if(!1===this._active[t])return null;const n=this._bounds[t],i=n.sphere,r=this.geometry;if(!1===n.sphereInitialized){i.makeEmpty(),this.getBoundingBoxAt(t,nb),nb.getCenter(i.center);const e=r.index,o=r.attributes.position,s=this._drawRanges[t];let a=0;for(let t=s.start,n=s.start+s.count;t<n;t++){let n=t;e&&(n=e.getX(n)),rb.fromBufferAttribute(o,n),a=Math.max(a,i.center.distanceToSquared(rb))}i.radius=Math.sqrt(a),n.sphereInitialized=!0}return e.copy(i),e}setMatrixAt(t,e){const n=this._active,i=this._matricesTexture,r=this._matricesTexture.image.data;return t>=this._geometryCount||!1===n[t]||(e.toArray(r,16*t),i.needsUpdate=!0),this}getMatrixAt(t,e){const n=this._active,i=this._matricesTexture.image.data;return t>=this._geometryCount||!1===n[t]?null:e.fromArray(i,16*t)}setVisibleAt(t,e){const n=this._visibility,i=this._active;return t>=this._geometryCount||!1===i[t]||n[t]===e||(n[t]=e,this._visibilityChanged=!0),this}getVisibleAt(t){const e=this._visibility,n=this._active;return!(t>=this._geometryCount||!1===n[t])&&e[t]}raycast(t,e){const n=this._visibility,i=this._active,r=this._drawRanges,o=this._geometryCount,s=this.matrixWorld,a=this.geometry;sb.material=this.material,sb.geometry.index=a.index,sb.geometry.attributes=a.attributes,null===sb.geometry.boundingBox&&(sb.geometry.boundingBox=new Up),null===sb.geometry.boundingSphere&&(sb.geometry.boundingSphere=new Qp);for(let a=0;a<o;a++){if(!n[a]||!i[a])continue;const o=r[a];sb.geometry.setDrawRange(o.start,o.count),this.getMatrixAt(a,sb.matrixWorld).premultiply(s),this.getBoundingBoxAt(a,sb.geometry.boundingBox),this.getBoundingSphereAt(a,sb.geometry.boundingSphere),sb.raycast(t,ab);for(let t=0,n=ab.length;t<n;t++){const n=ab[t];n.object=this,n.batchId=a,e.push(n)}ab.length=0}sb.material=null,sb.geometry.index=null,sb.geometry.attributes={},sb.geometry.setDrawRange(0,1/0)}copy(t){return super.copy(t),this.geometry=t.geometry.clone(),this.perObjectFrustumCulled=t.perObjectFrustumCulled,this.sortObjects=t.sortObjects,this.boundingBox=null!==t.boundingBox?t.boundingBox.clone():null,this.boundingSphere=null!==t.boundingSphere?t.boundingSphere.clone():null,this._drawRanges=t._drawRanges.map(t=>({...t})),this._reservedRanges=t._reservedRanges.map(t=>({...t})),this._visibility=t._visibility.slice(),this._active=t._active.slice(),this._bounds=t._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=t._maxGeometryCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(t,e,n,i,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=i.getIndex(),s=null===o?1:o.array.BYTES_PER_ELEMENT,a=this._active,l=this._visibility,c=this._multiDrawStarts,h=this._multiDrawCounts,u=this._drawRanges,d=this.perObjectFrustumCulled;d&&(tb.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),eb.setFromProjectionMatrix(tb,t.coordinateSystem));let p=0;if(this.sortObjects){Jy.copy(this.matrixWorld).invert(),rb.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Jy);for(let t=0,e=l.length;t<e;t++)if(l[t]&&a[t]){this.getMatrixAt(t,Ky),this.getBoundingSphereAt(t,ib).applyMatrix4(Ky);let e=!1;if(d&&(e=!eb.intersectsSphere(ib)),!e){const e=rb.distanceTo(ib.center);ob.push(u[t],e)}}const t=ob.list,e=this.customSort;null===e?t.sort(r.transparent?Yy:$y):e.call(this,t,n);for(let e=0,n=t.length;e<n;e++){const n=t[e];c[p]=n.start*s,h[p]=n.count,p++}ob.reset()}else for(let t=0,e=l.length;t<e;t++)if(l[t]&&a[t]){let e=!1;if(d&&(this.getMatrixAt(t,Ky),this.getBoundingSphereAt(t,ib).applyMatrix4(Ky),e=!eb.intersectsSphere(ib)),!e){const e=u[t];c[p]=e.start*s,h[p]=e.count,p++}}this._multiDrawCount=p,this._visibilityChanged=!1}onBeforeShadow(t,e,n,i,r,o){this.onBeforeRender(t,null,i,r,o)}}class hb extends em{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Jf(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const ub=new Ip,db=new Ip,pb=new cf,fb=new lf,mb=new Qp;class gb extends Df{constructor(t=new xm,e=new hb){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,i=e.count;t<i;t++)ub.fromBufferAttribute(e,t-1),db.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=ub.distanceTo(db);t.setAttribute("lineDistance",new pm(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),mb.copy(n.boundingSphere),mb.applyMatrix4(i),mb.radius+=r,!1===t.ray.intersectsSphere(mb))return;pb.copy(i).invert(),fb.copy(t.ray).applyMatrix4(pb);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=new Ip,c=new Ip,h=new Ip,u=new Ip,d=this.isLineSegments?2:1,p=n.index,f=n.attributes.position;if(null!==p){for(let n=Math.max(0,o.start),i=Math.min(p.count,o.start+o.count)-1;n<i;n+=d){const i=p.getX(n),r=p.getX(n+1);l.fromBufferAttribute(f,i),c.fromBufferAttribute(f,r);if(fb.distanceSqToSegment(l,c,u,h)>a)continue;u.applyMatrix4(this.matrixWorld);const o=t.ray.origin.distanceTo(u);o<t.near||o>t.far||e.push({distance:o,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,o.start),i=Math.min(f.count,o.start+o.count)-1;n<i;n+=d){l.fromBufferAttribute(f,n),c.fromBufferAttribute(f,n+1);if(fb.distanceSqToSegment(l,c,u,h)>a)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);i<t.near||i>t.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}const vb=new Ip,_b=new Ip;class yb extends gb{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,i=e.count;t<i;t+=2)vb.fromBufferAttribute(e,t),_b.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+vb.distanceTo(_b);t.setAttribute("lineDistance",new pm(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class bb extends gb{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}}class xb extends em{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Jf(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const Sb=new cf,wb=new lf,Mb=new Qp,Tb=new Ip;class Ab extends Df{constructor(t=new xm,e=new xb){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Mb.copy(n.boundingSphere),Mb.applyMatrix4(i),Mb.radius+=r,!1===t.ray.intersectsSphere(Mb))return;Sb.copy(i).invert(),wb.copy(t.ray).applyMatrix4(Sb);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,o.start),r=Math.min(l.count,o.start+o.count);n<r;n++){const r=l.getX(n);Tb.fromBufferAttribute(c,r),Eb(Tb,r,a,i,t,e,this)}}else{for(let n=Math.max(0,o.start),r=Math.min(c.count,o.start+o.count);n<r;n++)Tb.fromBufferAttribute(c,n),Eb(Tb,n,a,i,t,e,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function Eb(t,e,n,i,r,o,s){const a=wb.distanceSqToPoint(t);if(a<n){const n=new Ip;wb.closestPointToPoint(t,n),n.applyMatrix4(i);const l=r.ray.origin.distanceTo(n);if(l<r.near||l>r.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:e,face:null,object:s})}}class Cb extends Tp{constructor(t,e,n,i,r,o,s,a,l,c,h,u){super(null,o,s,a,l,c,i,r,h,u),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Rb{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let o;o=e||t*n[r-1];let s,a=0,l=r-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),s=n[i]-o,s<0)a=i+1;else{if(!(s>0)){l=i;break}l=i-1}if(i=l,n[i]===o)return i/(r-1);const c=n[i];return(i+(o-c)/(n[i+1]-c))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const o=this.getPoint(i),s=this.getPoint(r),a=e||(o.isVector2?new np:new Ip);return a.copy(s).sub(o).normalize(),a}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new Ip,i=[],r=[],o=[],s=new Ip,a=new cf;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new Ip)}r[0]=new Ip,o[0]=new Ip;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),o[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),o[e]=o[e-1].clone(),s.crossVectors(i[e-1],i[e]),s.length()>Number.EPSILON){s.normalize();const t=Math.acos(Yd(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(s,t))}o[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(Yd(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(s.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(a.makeRotationAxis(i[n],e*n)),o[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Pb extends Rb{constructor(t=0,e=0,n=1,i=1,r=0,o=2*Math.PI,s=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=s,this.aRotation=a}getPoint(t,e=new np){const n=e,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);const s=this.aStartAngle+t*r;let a=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=a-this.aX,i=l-this.aY;a=n*t-i*e+this.aX,l=n*e+i*t+this.aY}return n.set(a,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class Lb extends Pb{constructor(t,e,n,i,r,o){super(t,e,n,n,i,r,o),this.isArcCurve=!0,this.type="ArcCurve"}}function Ib(){let t=0,e=0,n=0,i=0;function r(r,o,s,a){t=r,e=s,n=-3*r+3*o-2*s-a,i=2*r-2*o+s+a}return{initCatmullRom:function(t,e,n,i,o){r(e,n,o*(n-t),o*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,o,s,a){let l=(e-t)/o-(n-t)/(o+s)+(n-e)/s,c=(n-e)/s-(i-e)/(s+a)+(i-n)/a;l*=s,c*=s,r(e,n,l,c)},calc:function(r){const o=r*r;return t+e*r+n*o+i*(o*r)}}}const Ob=new Ip,kb=new Ib,Ub=new Ib,Db=new Ib;class Nb extends Rb{constructor(t=[],e=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=i}getPoint(t,e=new Ip){const n=e,i=this.points,r=i.length,o=(r-(this.closed?0:1))*t;let s,a,l=Math.floor(o),c=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?s=i[(l-1)%r]:(Ob.subVectors(i[0],i[1]).add(i[0]),s=Ob);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2<r?a=i[(l+2)%r]:(Ob.subVectors(i[r-1],i[r-2]).add(i[r-1]),a=Ob),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(s.distanceToSquared(h),t),n=Math.pow(h.distanceToSquared(u),t),i=Math.pow(u.distanceToSquared(a),t);n<1e-4&&(n=1),e<1e-4&&(e=n),i<1e-4&&(i=n),kb.initNonuniformCatmullRom(s.x,h.x,u.x,a.x,e,n,i),Ub.initNonuniformCatmullRom(s.y,h.y,u.y,a.y,e,n,i),Db.initNonuniformCatmullRom(s.z,h.z,u.z,a.z,e,n,i)}else"catmullrom"===this.curveType&&(kb.initCatmullRom(s.x,h.x,u.x,a.x,this.tension),Ub.initCatmullRom(s.y,h.y,u.y,a.y,this.tension),Db.initCatmullRom(s.z,h.z,u.z,a.z,this.tension));return n.set(kb.calc(c),Ub.calc(c),Db.calc(c)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Ip).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Bb(t,e,n,i,r){const o=.5*(i-e),s=.5*(r-n),a=t*t;return(2*n-2*i+o+s)*(t*a)+(-3*n+3*i-2*o-s)*a+o*t+n}function Fb(t,e,n,i){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}function zb(t,e,n,i,r){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}class Hb extends Rb{constructor(t=new np,e=new np,n=new np,i=new np){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new np){const n=e,i=this.v0,r=this.v1,o=this.v2,s=this.v3;return n.set(zb(t,i.x,r.x,o.x,s.x),zb(t,i.y,r.y,o.y,s.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Wb extends Rb{constructor(t=new Ip,e=new Ip,n=new Ip,i=new Ip){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new Ip){const n=e,i=this.v0,r=this.v1,o=this.v2,s=this.v3;return n.set(zb(t,i.x,r.x,o.x,s.x),zb(t,i.y,r.y,o.y,s.y),zb(t,i.z,r.z,o.z,s.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Vb extends Rb{constructor(t=new np,e=new np){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new np){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new np){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Gb extends Rb{constructor(t=new Ip,e=new Ip){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new Ip){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Ip){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class jb extends Rb{constructor(t=new np,e=new np,n=new np){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new np){const n=e,i=this.v0,r=this.v1,o=this.v2;return n.set(Fb(t,i.x,r.x,o.x),Fb(t,i.y,r.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Xb extends Rb{constructor(t=new Ip,e=new Ip,n=new Ip){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Ip){const n=e,i=this.v0,r=this.v1,o=this.v2;return n.set(Fb(t,i.x,r.x,o.x),Fb(t,i.y,r.y,o.y),Fb(t,i.z,r.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class $b extends Rb{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new np){const n=e,i=this.points,r=(i.length-1)*t,o=Math.floor(r),s=r-o,a=i[0===o?o:o-1],l=i[o],c=i[o>i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(Bb(s,a.x,l.x,c.x,h.x),Bb(s,a.y,l.y,c.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new np).fromArray(n))}return this}}var Yb=Object.freeze({__proto__:null,ArcCurve:Lb,CatmullRomCurve3:Nb,CubicBezierCurve:Hb,CubicBezierCurve3:Wb,EllipseCurve:Pb,LineCurve:Vb,LineCurve3:Gb,QuadraticBezierCurve:jb,QuadraticBezierCurve3:Xb,SplineCurve:$b});class qb extends Rb{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Yb[n](e,t))}return this}getPoint(t,e){const n=t*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const t=i[r]-n,o=this.curves[r],s=o.getLength(),a=0===s?0:1-t/s;return o.getPointAt(a,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const o=r[i],s=o.isEllipseCurve?2*t:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s);for(let t=0;t<a.length;t++){const i=a[t];n&&n.equals(i)||(e.push(i),n=i)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Yb[n.type]).fromJSON(n))}return this}}class Zb extends qb{constructor(t){super(),this.type="Path",this.currentPoint=new np,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new Vb(this.currentPoint.clone(),new np(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,i){const r=new jb(this.currentPoint.clone(),new np(t,e),new np(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(t,e,n,i,r,o){const s=new Hb(this.currentPoint.clone(),new np(t,e),new np(n,i),new np(r,o));return this.curves.push(s),this.currentPoint.set(r,o),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new $b(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,i,r,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,e+a,n,i,r,o),this}absarc(t,e,n,i,r,o){return this.absellipse(t,e,n,n,i,r,o),this}ellipse(t,e,n,i,r,o,s,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,n,i,r,o,s,a),this}absellipse(t,e,n,i,r,o,s,a){const l=new Pb(t,e,n,i,r,o,s,a);if(this.curves.length>0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Kb extends xm{constructor(t=[new np(0,-.5),new np(.5,0),new np(0,.5)],e=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e),i=Yd(i,0,2*Math.PI);const r=[],o=[],s=[],a=[],l=[],c=1/e,h=new Ip,u=new np,d=new Ip,p=new Ip,f=new Ip;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case t.length-1:a.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let r=0;r<=e;r++){const d=n+r*c*i,p=Math.sin(d),f=Math.cos(d);for(let n=0;n<=t.length-1;n++){h.x=t[n].x*p,h.y=t[n].y,h.z=t[n].x*f,o.push(h.x,h.y,h.z),u.x=r/e,u.y=n/(t.length-1),s.push(u.x,u.y);const i=a[3*n+0]*p,c=a[3*n+1],d=a[3*n+0]*f;l.push(i,c,d)}}for(let n=0;n<e;n++)for(let e=0;e<t.length-1;e++){const i=e+n*t.length,o=i,s=i+t.length,a=i+t.length+1,l=i+1;r.push(o,s,l),r.push(a,l,s)}this.setIndex(r),this.setAttribute("position",new pm(o,3)),this.setAttribute("uv",new pm(s,2)),this.setAttribute("normal",new pm(l,3))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Kb(t.points,t.segments,t.phiStart,t.phiLength)}}class Jb extends Kb{constructor(t=1,e=1,n=4,i=8){const r=new Zb;r.absarc(0,-e/2,t,1.5*Math.PI,0),r.absarc(0,e/2,t,0,.5*Math.PI),super(r.getPoints(n),i),this.type="CapsuleGeometry",this.parameters={radius:t,length:e,capSegments:n,radialSegments:i}}static fromJSON(t){return new Jb(t.radius,t.length,t.capSegments,t.radialSegments)}}class Qb extends xm{constructor(t=1,e=32,n=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},e=Math.max(3,e);const r=[],o=[],s=[],a=[],l=new Ip,c=new np;o.push(0,0,0),s.push(0,0,1),a.push(.5,.5);for(let r=0,h=3;r<=e;r++,h+=3){const u=n+r/e*i;l.x=t*Math.cos(u),l.y=t*Math.sin(u),o.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(o[h]/t+1)/2,c.y=(o[h+1]/t+1)/2,a.push(c.x,c.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new pm(o,3)),this.setAttribute("normal",new pm(s,3)),this.setAttribute("uv",new pm(a,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Qb(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class tx extends xm{constructor(t=1,e=1,n=1,i=32,r=1,o=!1,s=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a};const l=this;i=Math.floor(i),r=Math.floor(r);const c=[],h=[],u=[],d=[];let p=0;const f=[],m=n/2;let g=0;function v(n){const r=p,o=new np,f=new Ip;let v=0;const _=!0===n?t:e,y=!0===n?1:-1;for(let t=1;t<=i;t++)h.push(0,m*y,0),u.push(0,y,0),d.push(.5,.5),p++;const b=p;for(let t=0;t<=i;t++){const e=t/i*a+s,n=Math.cos(e),r=Math.sin(e);f.x=_*r,f.y=m*y,f.z=_*n,h.push(f.x,f.y,f.z),u.push(0,y,0),o.x=.5*n+.5,o.y=.5*r*y+.5,d.push(o.x,o.y),p++}for(let t=0;t<i;t++){const e=r+t,i=b+t;!0===n?c.push(i,i+1,e):c.push(i+1,i,e),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const o=new Ip,v=new Ip;let _=0;const y=(e-t)/n;for(let l=0;l<=r;l++){const c=[],g=l/r,_=g*(e-t)+t;for(let t=0;t<=i;t++){const e=t/i,r=e*a+s,l=Math.sin(r),f=Math.cos(r);v.x=_*l,v.y=-g*n+m,v.z=_*f,h.push(v.x,v.y,v.z),o.set(l,y,f).normalize(),u.push(o.x,o.y,o.z),d.push(e,1-g),c.push(p++)}f.push(c)}for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=f[e][t],i=f[e+1][t],r=f[e+1][t+1],o=f[e][t+1];c.push(n,i,o),c.push(i,r,o),_+=6}l.addGroup(g,_,0),g+=_}(),!1===o&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new pm(h,3)),this.setAttribute("normal",new pm(u,3)),this.setAttribute("uv",new pm(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new tx(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ex extends tx{constructor(t=1,e=1,n=32,i=1,r=!1,o=0,s=2*Math.PI){super(0,t,e,n,i,r,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:s}}static fromJSON(t){return new ex(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class nx extends xm{constructor(t=[],e=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i};const r=[],o=[];function s(t,e,n,i){const r=i+1,o=[];for(let i=0;i<=r;i++){o[i]=[];const s=t.clone().lerp(n,i/r),a=e.clone().lerp(n,i/r),l=r-i;for(let t=0;t<=l;t++)o[i][t]=0===t&&i===r?s:s.clone().lerp(a,t/l)}for(let t=0;t<r;t++)for(let e=0;e<2*(r-t)-1;e++){const n=Math.floor(e/2);e%2==0?(a(o[t][n+1]),a(o[t+1][n]),a(o[t][n])):(a(o[t][n+1]),a(o[t+1][n+1]),a(o[t+1][n]))}}function a(t){r.push(t.x,t.y,t.z)}function l(e,n){const i=3*e;n.x=t[i+0],n.y=t[i+1],n.z=t[i+2]}function c(t,e,n,i){i<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=i/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}function u(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){const n=new Ip,i=new Ip,r=new Ip;for(let o=0;o<e.length;o+=3)l(e[o+0],n),l(e[o+1],i),l(e[o+2],r),s(n,i,r,t)}(i),function(t){const e=new Ip;for(let n=0;n<r.length;n+=3)e.x=r[n+0],e.y=r[n+1],e.z=r[n+2],e.normalize().multiplyScalar(t),r[n+0]=e.x,r[n+1]=e.y,r[n+2]=e.z}(n),function(){const t=new Ip;for(let e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];const n=h(t)/2/Math.PI+.5,i=u(t)/Math.PI+.5;o.push(n,1-i)}(function(){const t=new Ip,e=new Ip,n=new Ip,i=new Ip,s=new np,a=new np,l=new np;for(let u=0,d=0;u<r.length;u+=9,d+=6){t.set(r[u+0],r[u+1],r[u+2]),e.set(r[u+3],r[u+4],r[u+5]),n.set(r[u+6],r[u+7],r[u+8]),s.set(o[d+0],o[d+1]),a.set(o[d+2],o[d+3]),l.set(o[d+4],o[d+5]),i.copy(t).add(e).add(n).divideScalar(3);const p=h(i);c(s,d+0,t,p),c(a,d+2,e,p),c(l,d+4,n,p)}})(),function(){for(let t=0;t<o.length;t+=6){const e=o[t+0],n=o[t+2],i=o[t+4],r=Math.max(e,n,i),s=Math.min(e,n,i);r>.9&&s<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),i<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new pm(r,3)),this.setAttribute("normal",new pm(r.slice(),3)),this.setAttribute("uv",new pm(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new nx(t.vertices,t.indices,t.radius,t.details)}}class ix extends nx{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[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],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new ix(t.radius,t.detail)}}const rx=new Ip,ox=new Ip,sx=new Ip,ax=new $f;class lx extends xm{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const n=4,i=Math.pow(10,n),r=Math.cos(jd*e),o=t.getIndex(),s=t.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t<a;t+=3){o?(l[0]=o.getX(t),l[1]=o.getX(t+1),l[2]=o.getX(t+2)):(l[0]=t,l[1]=t+1,l[2]=t+2);const{a:e,b:n,c:a}=ax;if(e.fromBufferAttribute(s,l[0]),n.fromBufferAttribute(s,l[1]),a.fromBufferAttribute(s,l[2]),ax.getNormal(sx),h[0]=`${Math.round(e.x*i)},${Math.round(e.y*i)},${Math.round(e.z*i)}`,h[1]=`${Math.round(n.x*i)},${Math.round(n.y*i)},${Math.round(n.z*i)}`,h[2]=`${Math.round(a.x*i)},${Math.round(a.y*i)},${Math.round(a.z*i)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let t=0;t<3;t++){const e=(t+1)%3,n=h[t],i=h[e],o=ax[c[t]],s=ax[c[e]],a=`${n}_${i}`,p=`${i}_${n}`;p in u&&u[p]?(sx.dot(u[p].normal)<=r&&(d.push(o.x,o.y,o.z),d.push(s.x,s.y,s.z)),u[p]=null):a in u||(u[a]={index0:l[t],index1:l[e],normal:sx.clone()})}}for(const t in u)if(u[t]){const{index0:e,index1:n}=u[t];rx.fromBufferAttribute(s,e),ox.fromBufferAttribute(s,n),d.push(rx.x,rx.y,rx.z),d.push(ox.x,ox.y,ox.z)}this.setAttribute("position",new pm(d,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class cx extends Zb{constructor(t){super(t),this.uuid=$d(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new Zb).fromJSON(n))}return this}}const hx=function(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let o=ux(t,0,r,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c,h,u,d,p;if(i&&(o=function(t,e,n,i){const r=[];let o,s,a,l,c;for(o=0,s=e.length;o<s;o++)a=e[o]*i,l=o<s-1?e[o+1]*i:t.length,c=ux(t,a,l,i,!1),c===c.next&&(c.steiner=!0),r.push(Sx(c));for(r.sort(_x),o=0;o<r.length;o++)n=yx(r[o],n);return n}(t,e,o,n)),t.length>80*n){a=c=t[0],l=h=t[1];for(let e=n;e<r;e+=n)u=t[e],d=t[e+1],u<a&&(a=u),d<l&&(l=d),u>c&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return px(o,s,n,a,l,p,0),s};function ux(t,e,n,i,r){let o,s;if(r===function(t,e,n,i){let r=0;for(let o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,e,n,i)>0)for(o=e;o<n;o+=i)s=Ix(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=Ix(o,t[o],t[o+1],s);return s&&Ax(s,s.next)&&(Ox(s),s=s.next),s}function dx(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!Ax(i,i.next)&&0!==Tx(i.prev,i,i.next))i=i.next;else{if(Ox(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function px(t,e,n,i,r,o,s){if(!t)return;!s&&o&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=xx(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<c&&(a++,i=i.nextZ,i);e++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(s>1)}(r)}(t,i,r,o);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,o?mx(t,i,r,o):fx(t))e.push(a.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),Ox(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?px(t=gx(dx(t),e,n),e,n,i,r,o,2):2===s&&vx(t,e,n,i,r,o):px(dx(t),e,n,i,r,o,1);break}}function fx(t){const e=t.prev,n=t,i=t.next;if(Tx(e,n,i)>=0)return!1;const r=e.x,o=n.x,s=i.x,a=e.y,l=n.y,c=i.y,h=r<o?r<s?r:s:o<s?o:s,u=a<l?a<c?a:c:l<c?l:c,d=r>o?r>s?r:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c;let f=i.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&wx(r,a,o,l,s,c,f.x,f.y)&&Tx(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function mx(t,e,n,i){const r=t.prev,o=t,s=t.next;if(Tx(r,o,s)>=0)return!1;const a=r.x,l=o.x,c=s.x,h=r.y,u=o.y,d=s.y,p=a<l?a<c?a:c:l<c?l:c,f=h<u?h<d?h:d:u<d?u:d,m=a>l?a>c?a:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,v=xx(p,f,e,n,i),_=xx(m,g,e,n,i);let y=t.prevZ,b=t.nextZ;for(;y&&y.z>=v&&b&&b.z<=_;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==r&&y!==s&&wx(a,h,l,u,c,d,y.x,y.y)&&Tx(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==r&&b!==s&&wx(a,h,l,u,c,d,b.x,b.y)&&Tx(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==r&&y!==s&&wx(a,h,l,u,c,d,y.x,y.y)&&Tx(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=_;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==r&&b!==s&&wx(a,h,l,u,c,d,b.x,b.y)&&Tx(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function gx(t,e,n){let i=t;do{const r=i.prev,o=i.next.next;!Ax(r,o)&&Ex(r,i,i.next,o)&&Px(r,o)&&Px(o,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(o.i/n|0),Ox(i),Ox(i.next),i=t=o),i=i.next}while(i!==t);return dx(i)}function vx(t,e,n,i,r,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&Mx(s,t)){let a=Lx(s,t);return s=dx(s,s.next),a=dx(a,a.next),px(s,e,n,i,r,o,0),void px(a,e,n,i,r,o,0)}t=t.next}s=s.next}while(s!==t)}function _x(t,e){return t.x-e.x}function yx(t,e){const n=function(t,e){let n,i=e,r=-1/0;const o=t.x,s=t.y;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){const t=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=o&&t>r&&(r=t,n=i.x<i.next.x?i:i.next,t===o))return n}i=i.next}while(i!==e);if(!n)return null;const a=n,l=n.x,c=n.y;let h,u=1/0;i=n;do{o>=i.x&&i.x>=l&&o!==i.x&&wx(s<c?o:r,s,l,c,s<c?r:o,s,i.x,i.y)&&(h=Math.abs(s-i.y)/(o-i.x),Px(i,t)&&(h<u||h===u&&(i.x>n.x||i.x===n.x&&bx(n,i)))&&(n=i,u=h)),i=i.next}while(i!==a);return n}(t,e);if(!n)return e;const i=Lx(n,t);return dx(i,i.next),dx(n,n.next)}function bx(t,e){return Tx(t.prev,t,e.prev)<0&&Tx(e.next,t,t.next)<0}function xx(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Sx(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function wx(t,e,n,i,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function Mx(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ex(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Px(t,e)&&Px(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(Tx(t.prev,t,e.prev)||Tx(t,e.prev,e))||Ax(t,e)&&Tx(t.prev,t,t.next)>0&&Tx(e.prev,e,e.next)>0)}function Tx(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ax(t,e){return t.x===e.x&&t.y===e.y}function Ex(t,e,n,i){const r=Rx(Tx(t,e,n)),o=Rx(Tx(t,e,i)),s=Rx(Tx(n,i,t)),a=Rx(Tx(n,i,e));return r!==o&&s!==a||(!(0!==r||!Cx(t,n,e))||(!(0!==o||!Cx(t,i,e))||(!(0!==s||!Cx(n,t,i))||!(0!==a||!Cx(n,e,i)))))}function Cx(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Rx(t){return t>0?1:t<0?-1:0}function Px(t,e){return Tx(t.prev,t,t.next)<0?Tx(t,e,t.next)>=0&&Tx(t,t.prev,e)>=0:Tx(t,e,t.prev)<0||Tx(t,t.next,e)<0}function Lx(t,e){const n=new kx(t.i,t.x,t.y),i=new kx(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Ix(t,e,n,i){const r=new kx(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Ox(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function kx(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Ux{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n}static isClockWise(t){return Ux.area(t)<0}static triangulateShape(t,e){const n=[],i=[],r=[];Dx(t),Nx(n,t);let o=t.length;e.forEach(Dx);for(let t=0;t<e.length;t++)i.push(o),o+=e[t].length,Nx(n,e[t]);const s=hx(n,i);for(let t=0;t<s.length;t+=3)r.push(s.slice(t,t+3));return r}}function Dx(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Nx(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Bx extends xm{constructor(t=new cx([new np(.5,.5),new np(-.5,.5),new np(-.5,-.5),new np(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,i=[],r=[];for(let e=0,n=t.length;e<n;e++){o(t[e])}function o(t){const o=[],s=void 0!==e.curveSegments?e.curveSegments:12,a=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:1;let c=void 0===e.bevelEnabled||e.bevelEnabled,h=void 0!==e.bevelThickness?e.bevelThickness:.2,u=void 0!==e.bevelSize?e.bevelSize:h-.1,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3;const f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Fx;let g,v,_,y,b,x=!1;f&&(g=f.getSpacedPoints(a),x=!0,c=!1,v=f.computeFrenetFrames(a,!1),_=new Ip,y=new Ip,b=new Ip),c||(p=0,h=0,u=0,d=0);const S=t.extractPoints(s);let w=S.shape;const M=S.holes;if(!Ux.isClockWise(w)){w=w.reverse();for(let t=0,e=M.length;t<e;t++){const e=M[t];Ux.isClockWise(e)&&(M[t]=e.reverse())}}const T=Ux.triangulateShape(w,M),A=w;for(let t=0,e=M.length;t<e;t++){const e=M[t];w=w.concat(e)}function E(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,n)}const C=w.length,R=T.length;function P(t,e,n){let i,r,o;const s=t.x-e.x,a=t.y-e.y,l=n.x-t.x,c=n.y-t.y,h=s*s+a*a,u=s*c-a*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/u,f=e.y+s/u,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(s*c-a*l);i=p+s*m-t.x,r=f+a*m-t.y;const g=i*i+r*r;if(g<=2)return new np(i,r);o=Math.sqrt(g/2)}else{let t=!1;s>Number.EPSILON?l>Number.EPSILON&&(t=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(i=-a,r=s,o=Math.sqrt(h)):(i=s,r=a,o=Math.sqrt(h/2))}return new np(i/o,r/o)}const L=[];for(let t=0,e=A.length,n=e-1,i=t+1;t<e;t++,n++,i++)n===e&&(n=0),i===e&&(i=0),L[t]=P(A[t],A[n],A[i]);const I=[];let O,k=L.concat();for(let t=0,e=M.length;t<e;t++){const e=M[t];O=[];for(let t=0,n=e.length,i=n-1,r=t+1;t<n;t++,i++,r++)i===n&&(i=0),r===n&&(r=0),O[t]=P(e[t],e[i],e[r]);I.push(O),k=k.concat(O)}for(let t=0;t<p;t++){const e=t/p,n=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=A.length;t<e;t++){const e=E(A[t],L[t],i);N(e.x,e.y,-n)}for(let t=0,e=M.length;t<e;t++){const e=M[t];O=I[t];for(let t=0,r=e.length;t<r;t++){const r=E(e[t],O[t],i);N(r.x,r.y,-n)}}}const U=u+d;for(let t=0;t<C;t++){const e=c?E(w[t],k[t],U):w[t];x?(y.copy(v.normals[0]).multiplyScalar(e.x),_.copy(v.binormals[0]).multiplyScalar(e.y),b.copy(g[0]).add(y).add(_),N(b.x,b.y,b.z)):N(e.x,e.y,0)}for(let t=1;t<=a;t++)for(let e=0;e<C;e++){const n=c?E(w[e],k[e],U):w[e];x?(y.copy(v.normals[t]).multiplyScalar(n.x),_.copy(v.binormals[t]).multiplyScalar(n.y),b.copy(g[t]).add(y).add(_),N(b.x,b.y,b.z)):N(n.x,n.y,l/a*t)}for(let t=p-1;t>=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=A.length;t<e;t++){const e=E(A[t],L[t],i);N(e.x,e.y,l+n)}for(let t=0,e=M.length;t<e;t++){const e=M[t];O=I[t];for(let t=0,r=e.length;t<r;t++){const r=E(e[t],O[t],i);x?N(r.x,r.y+g[a-1].y,g[a-1].x+n):N(r.x,r.y,l+n)}}}function D(t,e){let n=t.length;for(;--n>=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=a+2*p;t<n;t++){const n=C*t,o=C*(t+1);F(e+i+n,e+r+n,e+r+o,e+i+o)}}}function N(t,e,n){o.push(t),o.push(e),o.push(n)}function B(t,e,r){z(t),z(e),z(r);const o=i.length/3,s=m.generateTopUV(n,i,o-3,o-2,o-1);H(s[0]),H(s[1]),H(s[2])}function F(t,e,r,o){z(t),z(e),z(o),z(e),z(r),z(o);const s=i.length/3,a=m.generateSideWallUV(n,i,s-6,s-3,s-2,s-1);H(a[0]),H(a[1]),H(a[3]),H(a[1]),H(a[2]),H(a[3])}function z(t){i.push(o[3*t+0]),i.push(o[3*t+1]),i.push(o[3*t+2])}function H(t){r.push(t.x),r.push(t.y)}!function(){const t=i.length/3;if(c){let t=0,e=C*t;for(let t=0;t<R;t++){const n=T[t];B(n[2]+e,n[1]+e,n[0]+e)}t=a+2*p,e=C*t;for(let t=0;t<R;t++){const n=T[t];B(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<R;t++){const e=T[t];B(e[2],e[1],e[0])}for(let t=0;t<R;t++){const e=T[t];B(e[0]+C*a,e[1]+C*a,e[2]+C*a)}}n.addGroup(t,i.length/3-t,0)}(),function(){const t=i.length/3;let e=0;D(A,e),e+=A.length;for(let t=0,n=M.length;t<n;t++){const n=M[t];D(n,e),e+=n.length}n.addGroup(t,i.length/3-t,1)}()}this.setAttribute("position",new pm(i,3)),this.setAttribute("uv",new pm(r,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,i=t.length;e<i;e++){const i=t[e];n.shapes.push(i.uuid)}else n.shapes.push(t.uuid);n.options=Object.assign({},e),void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let i=0,r=t.shapes.length;i<r;i++){const r=e[t.shapes[i]];n.push(r)}const i=t.options.extrudePath;return void 0!==i&&(t.options.extrudePath=(new Yb[i.type]).fromJSON(i)),new Bx(n,t.options)}}const Fx={generateTopUV:function(t,e,n,i,r){const o=e[3*n],s=e[3*n+1],a=e[3*i],l=e[3*i+1],c=e[3*r],h=e[3*r+1];return[new np(o,s),new np(a,l),new np(c,h)]},generateSideWallUV:function(t,e,n,i,r,o){const s=e[3*n],a=e[3*n+1],l=e[3*n+2],c=e[3*i],h=e[3*i+1],u=e[3*i+2],d=e[3*r],p=e[3*r+1],f=e[3*r+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(a-h)<Math.abs(s-c)?[new np(s,1-l),new np(c,1-u),new np(d,1-f),new np(m,1-v)]:[new np(a,1-l),new np(h,1-u),new np(p,1-f),new np(g,1-v)]}};class zx extends nx{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,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],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new zx(t.radius,t.detail)}}class Hx extends nx{constructor(t=1,e=0){super([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],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Hx(t.radius,t.detail)}}class Wx extends xm{constructor(t=.5,e=1,n=32,i=1,r=0,o=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},n=Math.max(3,n);const s=[],a=[],l=[],c=[];let h=t;const u=(e-t)/(i=Math.max(1,i)),d=new Ip,p=new np;for(let t=0;t<=i;t++){for(let t=0;t<=n;t++){const i=r+t/n*o;d.x=h*Math.cos(i),d.y=h*Math.sin(i),a.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/e+1)/2,p.y=(d.y/e+1)/2,c.push(p.x,p.y)}h+=u}for(let t=0;t<i;t++){const e=t*(n+1);for(let t=0;t<n;t++){const i=t+e,r=i,o=i+n+1,a=i+n+2,l=i+1;s.push(r,o,l),s.push(o,a,l)}}this.setIndex(s),this.setAttribute("position",new pm(a,3)),this.setAttribute("normal",new pm(l,3)),this.setAttribute("uv",new pm(c,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Wx(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class Vx extends xm{constructor(t=new cx([new np(0,.5),new np(-.5,-.5),new np(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const n=[],i=[],r=[],o=[];let s=0,a=0;if(!1===Array.isArray(t))l(t);else for(let e=0;e<t.length;e++)l(t[e]),this.addGroup(s,a,e),s+=a,a=0;function l(t){const s=i.length/3,l=t.extractPoints(e);let c=l.shape;const h=l.holes;!1===Ux.isClockWise(c)&&(c=c.reverse());for(let t=0,e=h.length;t<e;t++){const e=h[t];!0===Ux.isClockWise(e)&&(h[t]=e.reverse())}const u=Ux.triangulateShape(c,h);for(let t=0,e=h.length;t<e;t++){const e=h[t];c=c.concat(e)}for(let t=0,e=c.length;t<e;t++){const e=c[t];i.push(e.x,e.y,0),r.push(0,0,1),o.push(e.x,e.y)}for(let t=0,e=u.length;t<e;t++){const e=u[t],i=e[0]+s,r=e[1]+s,o=e[2]+s;n.push(i,r,o),a+=3}}this.setIndex(n),this.setAttribute("position",new pm(i,3)),this.setAttribute("normal",new pm(r,3)),this.setAttribute("uv",new pm(o,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,i=t.length;n<i;n++){const i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){const n=[];for(let i=0,r=t.shapes.length;i<r;i++){const r=e[t.shapes[i]];n.push(r)}return new Vx(n,t.curveSegments)}}class Gx extends xm{constructor(t=1,e=32,n=16,i=0,r=2*Math.PI,o=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:s},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const a=Math.min(o+s,Math.PI);let l=0;const c=[],h=new Ip,u=new Ip,d=[],p=[],f=[],m=[];for(let d=0;d<=n;d++){const g=[],v=d/n;let _=0;0===d&&0===o?_=.5/e:d===n&&a===Math.PI&&(_=-.5/e);for(let n=0;n<=e;n++){const a=n/e;h.x=-t*Math.cos(i+a*r)*Math.sin(o+v*s),h.y=t*Math.cos(o+v*s),h.z=t*Math.sin(i+a*r)*Math.sin(o+v*s),p.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(a+_,1-v),g.push(l++)}c.push(g)}for(let t=0;t<n;t++)for(let i=0;i<e;i++){const e=c[t][i+1],r=c[t][i],s=c[t+1][i],l=c[t+1][i+1];(0!==t||o>0)&&d.push(e,r,l),(t!==n-1||a<Math.PI)&&d.push(r,s,l)}this.setIndex(d),this.setAttribute("position",new pm(p,3)),this.setAttribute("normal",new pm(f,3)),this.setAttribute("uv",new pm(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Gx(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class jx extends nx{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new jx(t.radius,t.detail)}}class Xx extends xm{constructor(t=1,e=.4,n=12,i=48,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},n=Math.floor(n),i=Math.floor(i);const o=[],s=[],a=[],l=[],c=new Ip,h=new Ip,u=new Ip;for(let o=0;o<=n;o++)for(let d=0;d<=i;d++){const p=d/i*r,f=o/n*Math.PI*2;h.x=(t+e*Math.cos(f))*Math.cos(p),h.y=(t+e*Math.cos(f))*Math.sin(p),h.z=e*Math.sin(f),s.push(h.x,h.y,h.z),c.x=t*Math.cos(p),c.y=t*Math.sin(p),u.subVectors(h,c).normalize(),a.push(u.x,u.y,u.z),l.push(d/i),l.push(o/n)}for(let t=1;t<=n;t++)for(let e=1;e<=i;e++){const n=(i+1)*t+e-1,r=(i+1)*(t-1)+e-1,s=(i+1)*(t-1)+e,a=(i+1)*t+e;o.push(n,r,a),o.push(r,s,a)}this.setIndex(o),this.setAttribute("position",new pm(s,3)),this.setAttribute("normal",new pm(a,3)),this.setAttribute("uv",new pm(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Xx(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class $x extends xm{constructor(t=1,e=.4,n=64,i=8,r=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},n=Math.floor(n),i=Math.floor(i);const s=[],a=[],l=[],c=[],h=new Ip,u=new Ip,d=new Ip,p=new Ip,f=new Ip,m=new Ip,g=new Ip;for(let s=0;s<=n;++s){const _=s/n*r*Math.PI*2;v(_,r,o,t,d),v(_+.01,r,o,t,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let t=0;t<=i;++t){const r=t/i*Math.PI*2,o=-e*Math.cos(r),p=e*Math.sin(r);h.x=d.x+(o*g.x+p*f.x),h.y=d.y+(o*g.y+p*f.y),h.z=d.z+(o*g.z+p*f.z),a.push(h.x,h.y,h.z),u.subVectors(h,d).normalize(),l.push(u.x,u.y,u.z),c.push(s/n),c.push(t/i)}}for(let t=1;t<=n;t++)for(let e=1;e<=i;e++){const n=(i+1)*(t-1)+(e-1),r=(i+1)*t+(e-1),o=(i+1)*t+e,a=(i+1)*(t-1)+e;s.push(n,r,a),s.push(r,o,a)}function v(t,e,n,i,r){const o=Math.cos(t),s=Math.sin(t),a=n/e*t,l=Math.cos(a);r.x=i*(2+l)*.5*o,r.y=i*(2+l)*s*.5,r.z=i*Math.sin(a)*.5}this.setIndex(s),this.setAttribute("position",new pm(a,3)),this.setAttribute("normal",new pm(l,3)),this.setAttribute("uv",new pm(c,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new $x(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class Yx extends xm{constructor(t=new Xb(new Ip(-1,-1,0),new Ip(-1,1,0),new Ip(1,1,0)),e=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r};const o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const s=new Ip,a=new Ip,l=new np;let c=new Ip;const h=[],u=[],d=[],p=[];function f(r){c=t.getPointAt(r/e,c);const l=o.normals[r],d=o.binormals[r];for(let t=0;t<=i;t++){const e=t/i*Math.PI*2,r=Math.sin(e),o=-Math.cos(e);a.x=o*l.x+r*d.x,a.y=o*l.y+r*d.y,a.z=o*l.z+r*d.z,a.normalize(),u.push(a.x,a.y,a.z),s.x=c.x+n*a.x,s.y=c.y+n*a.y,s.z=c.z+n*a.z,h.push(s.x,s.y,s.z)}}!function(){for(let t=0;t<e;t++)f(t);f(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=i;n++)l.x=t/e,l.y=n/i,d.push(l.x,l.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=i;e++){const n=(i+1)*(t-1)+(e-1),r=(i+1)*t+(e-1),o=(i+1)*t+e,s=(i+1)*(t-1)+e;p.push(n,r,s),p.push(r,o,s)}}()}(),this.setIndex(p),this.setAttribute("position",new pm(h,3)),this.setAttribute("normal",new pm(u,3)),this.setAttribute("uv",new pm(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Yx((new Yb[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class qx extends xm{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],n=new Set,i=new Ip,r=new Ip;if(null!==t.index){const o=t.attributes.position,s=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:s.count,materialIndex:0}]);for(let t=0,l=a.length;t<l;++t){const l=a[t],c=l.start;for(let t=c,a=c+l.count;t<a;t+=3)for(let a=0;a<3;a++){const l=s.getX(t+a),c=s.getX(t+(a+1)%3);i.fromBufferAttribute(o,l),r.fromBufferAttribute(o,c),!0===Zx(i,r,n)&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}}else{const o=t.attributes.position;for(let t=0,s=o.count/3;t<s;t++)for(let s=0;s<3;s++){const a=3*t+s,l=3*t+(s+1)%3;i.fromBufferAttribute(o,a),r.fromBufferAttribute(o,l),!0===Zx(i,r,n)&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new pm(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Zx(t,e,n){const i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==n.has(i)&&!0!==n.has(r)&&(n.add(i),n.add(r),!0)}var Kx=Object.freeze({__proto__:null,BoxGeometry:Hm,CapsuleGeometry:Jb,CircleGeometry:Qb,ConeGeometry:ex,CylinderGeometry:tx,DodecahedronGeometry:ix,EdgesGeometry:lx,ExtrudeGeometry:Bx,IcosahedronGeometry:zx,LatheGeometry:Kb,OctahedronGeometry:Hx,PlaneGeometry:ug,PolyhedronGeometry:nx,RingGeometry:Wx,ShapeGeometry:Vx,SphereGeometry:Gx,TetrahedronGeometry:jx,TorusGeometry:Xx,TorusKnotGeometry:$x,TubeGeometry:Yx,WireframeGeometry:qx});class Jx extends em{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Jf(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}class Qx extends Xm{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class tS extends em{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Jf(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jf(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new np(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new yf,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class eS extends tS{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new np(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Yd(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Jf(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Jf(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Jf(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class nS extends em{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Jf(16777215),this.specular=new Jf(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jf(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new np(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new yf,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class iS extends em{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Jf(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jf(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new np(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class rS extends em{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new np(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class oS extends em{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Jf(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jf(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new np(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new yf,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class sS extends em{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Jf(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new np(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class aS extends hb{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function lS(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function cS(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function hS(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort(function(e,n){return t[e]-t[n]}),n}function uS(t,e,n){const i=t.length,r=new t.constructor(i);for(let o=0,s=0;s!==i;++o){const i=n[o]*e;for(let n=0;n!==e;++n)r[s++]=t[i+n]}return r}function dS(t,e,n,i){let r=1,o=t[0];for(;void 0!==o&&void 0===o[i];)o=t[r++];if(void 0===o)return;let s=o[i];if(void 0!==s)if(Array.isArray(s))do{s=o[i],void 0!==s&&(e.push(o.time),n.push.apply(n,s)),o=t[r++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[i],void 0!==s&&(e.push(o.time),s.toArray(n,n.length)),o=t[r++]}while(void 0!==o);else do{s=o[i],void 0!==s&&(e.push(o.time),n.push(s)),o=t[r++]}while(void 0!==o)}const pS={convertArray:lS,isTypedArray:cS,getKeyframeOrder:hS,sortedArray:uS,flattenJSON:dS,subclip:function(t,e,n,i,r=30){const o=t.clone();o.name=e;const s=[];for(let t=0;t<o.tracks.length;++t){const e=o.tracks[t],a=e.getValueSize(),l=[],c=[];for(let t=0;t<e.times.length;++t){const o=e.times[t]*r;if(!(o<n||o>=i)){l.push(e.times[t]);for(let n=0;n<a;++n)c.push(e.values[t*a+n])}}0!==l.length&&(e.times=lS(l,e.times.constructor),e.values=lS(c,e.values.constructor),s.push(e))}o.tracks=s;let a=1/0;for(let t=0;t<o.tracks.length;++t)a>o.tracks[t].times[0]&&(a=o.tracks[t].times[0]);for(let t=0;t<o.tracks.length;++t)o.tracks[t].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(t,e=0,n=t,i=30){i<=0&&(i=30);const r=n.tracks.length,o=e/i;for(let e=0;e<r;++e){const i=n.tracks[e],r=i.ValueTypeName;if("bool"===r||"string"===r)continue;const s=t.tracks.find(function(t){return t.name===i.name&&t.ValueTypeName===r});if(void 0===s)continue;let a=0;const l=i.getValueSize();i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const h=s.getValueSize();s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=h/3);const u=i.times.length-1;let d;if(o<=i.times[0]){const t=a,e=l-a;d=i.values.slice(t,e)}else if(o>=i.times[u]){const t=u*l+a,e=t+l-a;d=i.values.slice(t,e)}else{const t=i.createInterpolant(),e=a,n=l-a;t.evaluate(o),d=t.resultBuffer.slice(e,n)}if("quaternion"===r){(new Lp).fromArray(d).normalize().conjugate().toArray(d)}const p=s.times.length;for(let t=0;t<p;++t){const e=t*h+c;if("quaternion"===r)Lp.multiplyQuaternionsFlat(s.values,e,d,0,s.values,e);else{const t=h-2*c;for(let n=0;n<t;++n)s.values[e+n]-=d[n]}}}return t.blendMode=_d,t}};class fS{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{let o;n:{i:if(!(t<i)){for(let o=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=e[++n],t<i)break e}o=e.length;break n}if(!(t>=r)){const s=e[1];t<s&&(n=2,r=s);for(let o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===o)break;if(i=r,r=e[--n-1],t>=r)break e}o=n,n=0;break n}break t}for(;n<o;){const i=n+o>>>1;t<e[i]?o=i:n=i+1}if(i=e[n],r=e[n-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i;for(let t=0;t!==i;++t)e[t]=n[r+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class mS extends fS{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:fd,endingEnd:fd}}intervalChanged_(t,e,n){const i=this.parameterPositions;let r=t-2,o=t+1,s=i[r],a=i[o];if(void 0===s)switch(this.getSettings_().endingStart){case md:r=t,s=2*e-n;break;case gd:r=i.length-2,s=e+i[r]-i[r+1];break;default:r=t,s=n}if(void 0===a)switch(this.getSettings_().endingEnd){case md:o=t,a=2*n-e;break;case gd:o=1,a=n+i[1]-i[0];break;default:o=t-1,a=e}const l=.5*(n-e),c=this.valueSize;this._weightPrev=l/(e-s),this._weightNext=l/(a-n),this._offsetPrev=r*c,this._offsetNext=o*c}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(n-e)/(i-e),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,_=(-1-d)*m+(1.5+d)*f+.5*p,y=d*m-d*f;for(let t=0;t!==s;++t)r[t]=g*o[c+t]+v*o[l+t]+_*o[a+t]+y*o[h+t];return r}}class gS extends fS{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=(n-e)/(i-e),h=1-c;for(let t=0;t!==s;++t)r[t]=o[l+t]*h+o[a+t]*c;return r}}class vS extends fS{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}}class _S{constructor(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=lS(e,this.TimeBufferType),this.values=lS(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:lS(t.times,Array),values:lS(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(n.interpolation=e)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new vS(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new gS(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new mS(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case ud:e=this.InterpolantFactoryMethodDiscrete;break;case dd:e=this.InterpolantFactoryMethodLinear;break;case pd:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ud;case this.InterpolantFactoryMethodLinear:return dd;case this.InterpolantFactoryMethodSmooth:return pd}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){const n=this.times,i=n.length;let r=0,o=i-1;for(;r!==i&&n[r]<t;)++r;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==r||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const t=this.getValueSize();this.times=n.slice(r,o),this.values=this.values.slice(r*t,o*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==o&&o>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,o),t=!1;break}o=i}if(void 0!==i&&cS(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===pd,r=t.length-1;let o=1;for(let s=1;s<r;++s){let r=!1;const a=t[s];if(a!==t[s+1]&&(1!==s||a!==t[0]))if(i)r=!0;else{const t=s*n,i=t-n,o=t+n;for(let s=0;s!==n;++s){const n=e[t+s];if(n!==e[i+s]||n!==e[o+s]){r=!0;break}}}if(r){if(s!==o){t[o]=t[s];const i=s*n,r=o*n;for(let t=0;t!==n;++t)e[r+t]=e[i+t]}++o}}if(r>0){t[o]=t[r];for(let t=r*n,i=o*n,s=0;s!==n;++s)e[i+s]=e[t+s];++o}return o!==t.length?(this.times=t.slice(0,o),this.values=e.slice(0,o*n)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}_S.prototype.TimeBufferType=Float32Array,_S.prototype.ValueBufferType=Float32Array,_S.prototype.DefaultInterpolation=dd;class yS extends _S{}yS.prototype.ValueTypeName="bool",yS.prototype.ValueBufferType=Array,yS.prototype.DefaultInterpolation=ud,yS.prototype.InterpolantFactoryMethodLinear=void 0,yS.prototype.InterpolantFactoryMethodSmooth=void 0;class bS extends _S{}bS.prototype.ValueTypeName="color";class xS extends _S{}xS.prototype.ValueTypeName="number";class SS extends fS{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(n-e)/(i-e);let l=t*s;for(let t=l+s;l!==t;l+=4)Lp.slerpFlat(r,0,o,l-s,o,l,a);return r}}class wS extends _S{InterpolantFactoryMethodLinear(t){return new SS(this.times,this.values,this.getValueSize(),t)}}wS.prototype.ValueTypeName="quaternion",wS.prototype.DefaultInterpolation=dd,wS.prototype.InterpolantFactoryMethodSmooth=void 0;class MS extends _S{}MS.prototype.ValueTypeName="string",MS.prototype.ValueBufferType=Array,MS.prototype.DefaultInterpolation=ud,MS.prototype.InterpolantFactoryMethodLinear=void 0,MS.prototype.InterpolantFactoryMethodSmooth=void 0;class TS extends _S{}TS.prototype.ValueTypeName="vector";class AS{constructor(t,e=-1,n,i=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=$d(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push(ES(n[t]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(_S.toJSON(n[t]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,o=[];for(let t=0;t<r;t++){let s=[],a=[];s.push((t+r-1)%r,t,(t+1)%r),a.push(0,1,0);const l=hS(s);s=uS(s,1,l),a=uS(a,1,l),i||0!==s[0]||(s.push(r),a.push(a[0])),o.push(new xS(".morphTargetInfluences["+e[t].name+"]",s,a).scale(1/n))}return new this(t,-1,o)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const e=t;n=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<n.length;t++)if(n[t].name===e)return n[t];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,n=t.length;e<n;e++){const n=t[e],o=n.name.match(r);if(o&&o.length>1){const t=o[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const o=[];for(const t in i)o.push(this.CreateFromMorphTargetSequence(t,i[t],e,n));return o}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const o=[],s=[];dS(n,o,s,i),0!==o.length&&r.push(new t(e,o,s))}},i=[],r=t.name||"default",o=t.fps||30,s=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t<l.length;t++){const r=l[t].keys;if(r&&0!==r.length)if(r[0].morphTargets){const t={};let e;for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let n=0;n<r[e].morphTargets.length;n++)t[r[e].morphTargets[n]]=-1;for(const n in t){const t=[],o=[];for(let i=0;i!==r[e].morphTargets.length;++i){const i=r[e];t.push(i.time),o.push(i.morphTarget===n?1:0)}i.push(new xS(".morphTargetInfluence["+n+"]",t,o))}a=t.length*o}else{const o=".bones["+e[t].name+"]";n(TS,o+".position",r,"pos",i),n(wS,o+".quaternion",r,"rot",i),n(TS,o+".scale",r,"scl",i)}}if(0===i.length)return null;return new this(r,a,i,s)}resetDuration(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const n=this.tracks[e];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function ES(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return xS;case"vector":case"vector2":case"vector3":case"vector4":return TS;case"color":return bS;case"quaternion":return wS;case"bool":case"boolean":return yS;case"string":return MS}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],n=[];dS(t.keys,e,n,"value"),t.times=e,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const CS={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class RS{constructor(t,e,n){const i=this;let r,o=!1,s=0,a=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===o&&void 0!==i.onStart&&i.onStart(t,s,a),o=!0},this.itemEnd=function(t){s++,void 0!==i.onProgress&&i.onProgress(t,s,a),s===a&&(o=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=l.length;e<n;e+=2){const n=l[e],i=l[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return i}return null}}}const PS=new RS;class LS{constructor(t){this.manager=void 0!==t?t:PS,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise(function(i,r){n.load(t,i,e,r)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}LS.DEFAULT_MATERIAL_NAME="__DEFAULT";const IS={};class OS extends Error{constructor(t,e){super(t),this.response=e}}class kS extends LS{constructor(t){super(t)}load(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=CS.get(t);if(void 0!==r)return this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==IS[t])return void IS[t].push({onLoad:e,onProgress:n,onError:i});IS[t]=[],IS[t].push({onLoad:e,onProgress:n,onError:i});const o=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,a=this.responseType;fetch(o).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=IS[t],i=e.body.getReader(),r=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),o=r?parseInt(r):0,s=0!==o;let a=0;const l=new ReadableStream({start(t){!function e(){i.read().then(({done:i,value:r})=>{if(i)t.close();else{a+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:s,loaded:a,total:o});for(let t=0,e=n.length;t<e;t++){const e=n[t];e.onProgress&&e.onProgress(i)}t.enqueue(r),e()}})}()}});return new Response(l)}throw new OS(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>(new DOMParser).parseFromString(t,s));case"json":return t.json();default:if(void 0===s)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(s),n=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(n);return t.arrayBuffer().then(t=>i.decode(t))}}}).then(e=>{CS.add(t,e);const n=IS[t];delete IS[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onLoad&&i.onLoad(e)}}).catch(e=>{const n=IS[t];if(void 0===n)throw this.manager.itemError(t),e;delete IS[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onError&&i.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class US extends LS{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=CS.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;const s=lp("img");function a(){c(),CS.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){c(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function c(){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",a,!1),s.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(t),s.src=t,s}}class DS extends Df{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new Jf(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}class NS extends DS{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Df.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Jf(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const BS=new cf,FS=new Ip,zS=new Ip;class HS{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new np(512,512),this.map=null,this.mapPass=null,this.matrix=new cf,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new lg,this._frameExtents=new np(1,1),this._viewportCount=1,this._viewports=[new Ap(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;FS.setFromMatrixPosition(t.matrixWorld),e.position.copy(FS),zS.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(zS),e.updateMatrixWorld(),BS.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(BS),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(BS)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class WS extends HS{constructor(){super(new Km(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,n=2*Xd*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class VS extends DS{constructor(t,e,n=0,i=Math.PI/3,r=0,o=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Df.DEFAULT_UP),this.updateMatrix(),this.target=new Df,this.distance=n,this.angle=i,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new WS}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const GS=new cf,jS=new Ip,XS=new Ip;class $S extends HS{constructor(){super(new Km(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new np(4,2),this._viewportCount=6,this._viewports=[new Ap(2,1,1,1),new Ap(0,1,1,1),new Ap(3,1,1,1),new Ap(1,1,1,1),new Ap(3,0,1,1),new Ap(1,0,1,1)],this._cubeDirections=[new Ip(1,0,0),new Ip(-1,0,0),new Ip(0,0,1),new Ip(0,0,-1),new Ip(0,1,0),new Ip(0,-1,0)],this._cubeUps=[new Ip(0,1,0),new Ip(0,1,0),new Ip(0,1,0),new Ip(0,1,0),new Ip(0,0,1),new Ip(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),jS.setFromMatrixPosition(t.matrixWorld),n.position.copy(jS),XS.copy(n.position),XS.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(XS),n.updateMatrixWorld(),i.makeTranslation(-jS.x,-jS.y,-jS.z),GS.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(GS)}}class YS extends DS{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new $S}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class qS extends HS{constructor(){super(new Mg(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ZS extends DS{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Df.DEFAULT_UP),this.updateMatrix(),this.target=new Df,this.shadow=new qS}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class KS extends DS{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class JS extends DS{constructor(t,e,n=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class QS{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new Ip)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,i=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*i),e.addScaledVector(o[2],.488603*r),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*i*1.092548),e.addScaledVector(o[5],i*r*1.092548),e.addScaledVector(o[6],.315392*(3*r*r-1)),e.addScaledVector(o[7],n*r*1.092548),e.addScaledVector(o[8],.546274*(n*n-i*i)),e}getIrradianceAt(t,e){const n=t.x,i=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*i),e.addScaledVector(o[2],1.023328*r),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*i),e.addScaledVector(o[5],.858086*i*r),e.addScaledVector(o[6],.743125*r*r-.247708),e.addScaledVector(o[7],.858086*n*r),e.addScaledVector(o[8],.429043*(n*n-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){const n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}class tw extends DS{constructor(t=new QS,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class ew extends LS{constructor(t){super(t),this.textures={}}load(t,e,n,i){const r=this,o=new kS(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}},n,i)}parse(t){const e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const i=ew.createMaterialFromType(t.type);if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&void 0!==i.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.sheen&&(i.sheen=t.sheen),void 0!==t.sheenColor&&(i.sheenColor=(new Jf).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(i.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==i.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==i.specular&&i.specular.setHex(t.specular),void 0!==t.specularIntensity&&(i.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==i.specularColor&&i.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearcoat&&(i.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(i.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.iridescence&&(i.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(i.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(i.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.thickness&&(i.thickness=t.thickness),void 0!==t.attenuationDistance&&(i.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==i.attenuationColor&&i.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(i.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(i.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.shadowSide&&(i.shadowSide=t.shadowSide),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(i.alphaHash=t.alphaHash),void 0!==t.depthFunc&&(i.depthFunc=t.depthFunc),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.blendSrc&&(i.blendSrc=t.blendSrc),void 0!==t.blendDst&&(i.blendDst=t.blendDst),void 0!==t.blendEquation&&(i.blendEquation=t.blendEquation),void 0!==t.blendSrcAlpha&&(i.blendSrcAlpha=t.blendSrcAlpha),void 0!==t.blendDstAlpha&&(i.blendDstAlpha=t.blendDstAlpha),void 0!==t.blendEquationAlpha&&(i.blendEquationAlpha=t.blendEquationAlpha),void 0!==t.blendColor&&void 0!==i.blendColor&&i.blendColor.setHex(t.blendColor),void 0!==t.blendAlpha&&(i.blendAlpha=t.blendAlpha),void 0!==t.stencilWriteMask&&(i.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(i.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(i.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(i.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(i.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(i.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(i.stencilZPass=t.stencilZPass),void 0!==t.stencilWrite&&(i.stencilWrite=t.stencilWrite),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),void 0!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.alphaToCoverage&&(i.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(i.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(i.forceSinglePass=t.forceSinglePass),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.toneMapped&&(i.toneMapped=t.toneMapped),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?i.vertexColors=t.vertexColors>0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new Jf).setHex(r.value);break;case"v2":i.uniforms[e].value=(new np).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new Ip).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new Ap).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new ip).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new cf).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new np).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=n(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=n(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapRotation&&i.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new np).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=n(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=n(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=n(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=n(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=n(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:Jx,SpriteMaterial:ry,RawShaderMaterial:Qx,ShaderMaterial:Xm,PointsMaterial:xb,MeshPhysicalMaterial:eS,MeshStandardMaterial:tS,MeshPhongMaterial:nS,MeshToonMaterial:iS,MeshNormalMaterial:rS,MeshLambertMaterial:oS,MeshDepthMaterial:k_,MeshDistanceMaterial:U_,MeshBasicMaterial:nm,MeshMatcapMaterial:sS,LineDashedMaterial:aS,LineBasicMaterial:hb,Material:em}[t]}}class nw{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return-1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}}class iw extends xm{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class rw extends LS{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new kS(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}},n,i)}parse(t){const e={},n={};function i(t,i){if(void 0!==e[i])return e[i];const r=t.interleavedBuffers[i],o=function(t,e){if(void 0!==n[e])return n[e];const i=t.arrayBuffers,r=i[e],o=new Uint32Array(r).buffer;return n[e]=o,o}(t,r.buffer),s=ap(r.type,o),a=new ey(s,r.stride);return a.uuid=r.uuid,e[i]=a,a}const r=t.isInstancedBufferGeometry?new iw:new xm,o=t.data.index;if(void 0!==o){const t=ap(o.type,o.array);r.setIndex(new hm(t,1))}const s=t.data.attributes;for(const e in s){const n=s[e];let o;if(n.isInterleavedBufferAttribute){const e=i(t.data,n.data);o=new iy(e,n.itemSize,n.offset,n.normalized)}else{const t=ap(n.type,n.array);o=new(n.isInstancedBufferAttribute?By:hm)(t,n.itemSize,n.normalized)}void 0!==n.name&&(o.name=n.name),void 0!==n.usage&&o.setUsage(n.usage),r.setAttribute(e,o)}const a=t.data.morphAttributes;if(a)for(const e in a){const n=a[e],o=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];let s;if(r.isInterleavedBufferAttribute){const e=i(t.data,r.data);s=new iy(e,r.itemSize,r.offset,r.normalized)}else{const t=ap(r.type,r.array);s=new hm(t,r.itemSize,r.normalized)}void 0!==r.name&&(s.name=r.name),o.push(s)}r.morphAttributes[e]=o}t.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const l=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==l)for(let t=0,e=l.length;t!==e;++t){const e=l[t];r.addGroup(e.start,e.count,e.materialIndex)}const c=t.data.boundingSphere;if(void 0!==c){const t=new Ip;void 0!==c.center&&t.fromArray(c.center),r.boundingSphere=new Qp(t,c.radius)}return t.name&&(r.name=t.name),t.userData&&(r.userData=t.userData),r}}const ow={UVMapping:iu,CubeReflectionMapping:ru,CubeRefractionMapping:ou,EquirectangularReflectionMapping:su,EquirectangularRefractionMapping:au,CubeUVReflectionMapping:lu},sw={RepeatWrapping:cu,ClampToEdgeWrapping:hu,MirroredRepeatWrapping:uu},aw={NearestFilter:du,NearestMipmapNearestFilter:pu,NearestMipmapLinearFilter:fu,LinearFilter:mu,LinearMipmapNearestFilter:gu,LinearMipmapLinearFilter:vu};let lw;class cw{static getContext(){return void 0===lw&&(lw=new(window.AudioContext||window.webkitAudioContext)),lw}static setContext(t){lw=t}}const hw=new cf,uw=new cf,dw=new cf;class pw{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=fw(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=fw();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function fw(){return("undefined"==typeof performance?Date:performance).now()}const mw=new Ip,gw=new Lp,vw=new Ip,_w=new Ip;class yw extends Df{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){return this.detune=t,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}const bw=new Ip,xw=new Lp,Sw=new Ip,ww=new Ip;class Mw{constructor(t,e,n){let i,r,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":i=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":i=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:i=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const n=this.buffer,i=this.valueSize,r=t*i+i;let o=this.cumulativeWeight;if(0===o){for(let t=0;t!==i;++t)n[r+t]=n[t];o=e}else{o+=e;const t=e/o;this._mixBufferRegion(n,r,0,t,i)}this.cumulativeWeight=o}accumulateAdditive(t){const e=this.buffer,n=this.valueSize,i=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,i,0,t,n),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const t=e*this._origIndex;this._mixBufferRegion(n,i,t,1-r,e)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){s.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]}_select(t,e,n,i,r){if(i>=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]}_slerp(t,e,n,i){Lp.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,r){const o=this._workIndex*r;Lp.multiplyQuaternionsFlat(t,o,t,e,t,n),Lp.slerpFlat(t,e,t,e,t,o,i)}_lerp(t,e,n,i,r){const o=1-i;for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]*o+t[n+s]*i}}_lerpAdditive(t,e,n,i,r){for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]+t[n+o]*i}}}const Tw="\\[\\]\\.:\\/",Aw=new RegExp("["+Tw+"]","g"),Ew="[^"+Tw+"]",Cw="[^"+Tw.replace("\\.","")+"]",Rw=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",Ew)+/(WCOD+)?/.source.replace("WCOD",Cw)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ew)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ew)+"$"),Pw=["material","materials","bones","map"];class Lw{constructor(t,e,n){this.path=e,this.parsedPath=n||Lw.parseTrackName(e),this.node=Lw.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new Lw.Composite(t,e,n):new Lw(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Aw,"")}static parseTrackName(t){const e=Rw.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==Pw.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.name===e||r.uuid===e)return r;const o=n(r.children);if(o)return o}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,n=e.objectName,i=e.propertyName;let r=e.propertyIndex;if(t||(t=Lw.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(n){let i=e.objectIndex;switch(n){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(let e=0;e<t.length;e++)if(t[e].name===i){i=e;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[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==i){if(void 0===t[i])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[i]}}const o=t[i];if(void 0===o){const n=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t)}let s=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){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[r]&&(r=t.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Lw.Composite=class{constructor(t,e,n){const i=n||Lw.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)}setValue(t,e){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},Lw.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Lw.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Lw.prototype.GetterByBindingType=[Lw.prototype._getValue_direct,Lw.prototype._getValue_array,Lw.prototype._getValue_arrayElement,Lw.prototype._getValue_toArray],Lw.prototype.SetterByBindingTypeAndVersioning=[[Lw.prototype._setValue_direct,Lw.prototype._setValue_direct_setNeedsUpdate,Lw.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Lw.prototype._setValue_array,Lw.prototype._setValue_array_setNeedsUpdate,Lw.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Lw.prototype._setValue_arrayElement,Lw.prototype._setValue_arrayElement_setNeedsUpdate,Lw.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Lw.prototype._setValue_fromArray,Lw.prototype._setValue_fromArray_setNeedsUpdate,Lw.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Iw{constructor(t,e,n=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=i;const r=e.tracks,o=r.length,s=new Array(o),a={endingStart:fd,endingEnd:fd};for(let t=0;t!==o;++t){const e=r[t].createInterpolant(null);s[t]=e,e.settings=a}this._interpolantSettings=a,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,i=t._clip.duration,r=i/n,o=n/i;t.warp(1,r,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const i=this._mixer,r=i.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=r,a[1]=r+n,l[0]=t/o,l[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,i){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const i=(t-r)*n;i<0||0===n?e=0:(this._startTime=null,e=n*i)}e*=this._updateTimeScale(t);const o=this._updateTime(e),s=this._updateWeight(t);if(s>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===_d)for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(o),e[n].accumulateAdditive(s);else for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(o),e[n].accumulate(i,s)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const o=2202===n;if(0===t)return-1===r||!o||1&~r?i:e-i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(o&&!(1&~r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=md,i.endingEnd=md):(i.endingStart=t?this.zeroSlopeAtStart?md:fd:gd,i.endingEnd=e?this.zeroSlopeAtEnd?md:fd:gd)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=r,a[0]=e,s[1]=r+t,a[1]=n,this}}const Ow=new Float32Array(1);class kw{constructor(t){this.value=t}clone(){return new kw(void 0===this.value.clone?this.value:this.value.clone())}}let Uw=0;const Dw=new cf;function Nw(t,e){return t.distance-e.distance}function Bw(t,e,n,i){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===i){const i=t.children;for(let t=0,r=i.length;t<r;t++)Bw(i[t],e,n,!0)}}const Fw=new np;const zw=new Ip,Hw=new Ip;const Ww=new Ip;const Vw=new Ip,Gw=new cf,jw=new cf;function Xw(t){const e=[];!0===t.isBone&&e.push(t);for(let n=0;n<t.children.length;n++)e.push.apply(e,Xw(t.children[n]));return e}const $w=new Ip,Yw=new Jf,qw=new Jf;class Zw extends yb{constructor(t=10,e=10,n=4473924,i=8947848){n=new Jf(n),i=new Jf(i);const r=e/2,o=t/e,s=t/2,a=[],l=[];for(let t=0,c=0,h=-s;t<=e;t++,h+=o){a.push(-s,0,h,s,0,h),a.push(h,0,-s,h,0,s);const e=t===r?n:i;e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3}const c=new xm;c.setAttribute("position",new pm(a,3)),c.setAttribute("color",new pm(l,3));super(c,new hb({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Kw=new Ip,Jw=new Ip,Qw=new Ip;const tM=new Ip,eM=new $m;function nM(t,e,n,i,r,o,s){tM.set(r,o,s).unproject(i);const a=e[t];if(void 0!==a){const t=n.getAttribute("position");for(let e=0,n=a.length;e<n;e++)t.setXYZ(a[e],tM.x,tM.y,tM.z)}}const iM=new Up;const rM=new Ip;let oM,sM;class aM extends yb{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new xm;n.setAttribute("position",new pm(e,3)),n.setAttribute("color",new pm([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new hb({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,n){const i=new Jf,r=this.geometry.attributes.color.array;return i.set(t),i.toArray(r,0),i.toArray(r,3),i.set(e),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Oh}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Oh);var lM=Object.freeze({__proto__:null,ACESFilmicToneMapping:4,AddEquation:Nh,AddOperation:2,AdditiveAnimationBlendMode:_d,AdditiveBlending:2,AgXToneMapping:6,AlphaFormat:1021,AlwaysCompare:519,AlwaysDepth:1,AlwaysStencilFunc:519,AmbientLight:KS,AnimationAction:Iw,AnimationClip:AS,AnimationLoader:class extends LS{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new kS(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}},n,i)}parse(t){const e=[];for(let n=0;n<t.length;n++){const i=AS.parse(t[n]);e.push(i)}return e}},AnimationMixer:class extends Wd{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,s=t._interpolants,a=n.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==r;++t){const r=i[t],l=r.name;let h=c[l];if(void 0!==h)++h.referenceCount,o[t]=h;else{if(h=o[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;h=new Mw(Lw.create(n,l,i),r.ValueTypeName,r.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),o[t]=h}s[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0===n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,n){const i=this._actions,r=this._actionsByClip;let o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{const e=o.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t}_removeInactiveAction(t){const e=this._actions,n=e[e.length-1],i=t._cacheIndex;n._cacheIndex=i,e[i]=n,e.pop(),t._cacheIndex=null;const r=t._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,l=a[a.length-1],c=t._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),t._byClipCacheIndex=null;delete s.actionByRoot[(t._localRoot||this._root).uuid],0===a.length&&delete o[r],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0===--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(t){const e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r}_takeBackAction(t){const e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r}_addInactiveBinding(t,e,n){const i=this._bindingsByRootAndName,r=this._bindings;let o=i[e];void 0===o&&(o={},i[e]=o),o[n]=t,t._cacheIndex=r.length,r.push(t)}_removeInactiveBinding(t){const e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,s=o[i],a=e[e.length-1],l=t._cacheIndex;a._cacheIndex=l,e[l]=a,e.pop(),delete s[r],0===Object.keys(s).length&&delete o[i]}_lendBinding(t){const e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r}_takeBackBinding(t){const e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let n=t[e];return void 0===n&&(n=new gS(new Float32Array(2),new Float32Array(2),1,Ow),n.__cacheIndex=e,t[e]=n),n}_takeBackControlInterpolant(t){const e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];t.__cacheIndex=i,e[i]=t,r.__cacheIndex=n,e[n]=r}clipAction(t,e,n){const i=e||this._root,r=i.uuid;let o="string"==typeof t?AS.findByName(i,t):t;const s=null!==o?o.uuid:t,a=this._actionsByClip[s];let l=null;if(void 0===n&&(n=null!==o?o.blendMode:vd),void 0!==a){const t=a.actionByRoot[r];if(void 0!==t&&t.blendMode===n)return t;l=a.knownActions[0],null===o&&(o=l._clip)}if(null===o)return null;const c=new Iw(this,o,e,n);return this._bindAction(c,l),this._addInactiveAction(c,s,r),c}existingAction(t,e){const n=e||this._root,i=n.uuid,r="string"==typeof t?AS.findByName(n,t):t,o=r?r.uuid:t,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[i]||null}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1;for(let s=0;s!==n;++s){e[s]._update(i,t,r,o)}const s=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)s[t].apply(o);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){const t=r.knownActions;for(let n=0,i=t.length;n!==i;++n){const i=t[n];this._deactivateAction(i);const r=i._cacheIndex,o=e[e.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,o._cacheIndex=r,e[r]=o,e.pop(),this._removeInactiveBindingsForAction(i)}delete i[n]}}uncacheRoot(t){const e=t.uuid,n=this._actionsByClip;for(const t in n){const i=n[t].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}const i=this._bindingsByRootAndName[e];if(void 0!==i)for(const t in i){const e=i[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}},AnimationObjectGroup:class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=$d(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){const t=this._objects,e=this._indicesByUUID,n=this._paths,i=this._parsedPaths,r=this._bindings,o=r.length;let s,a=t.length,l=this.nCachedObjects_;for(let c=0,h=arguments.length;c!==h;++c){const h=arguments[c],u=h.uuid;let d=e[u];if(void 0===d){d=a++,e[u]=d,t.push(h);for(let t=0,e=o;t!==e;++t)r[t].push(new Lw(h,n[t],i[t]))}else if(d<l){s=t[d];const a=--l,c=t[a];e[c.uuid]=d,t[d]=c,e[u]=a,t[a]=h;for(let t=0,e=o;t!==e;++t){const e=r[t],o=e[a];let s=e[d];e[d]=o,void 0===s&&(s=new Lw(h,n[t],i[t])),e[a]=s}}else t[d]!==s&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o],a=s.uuid,l=e[a];if(void 0!==l&&l>=r){const o=r++,c=t[o];e[c.uuid]=l,t[l]=c,e[a]=o,t[o]=s;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[o],r=e[l];e[l]=i,e[o]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,o=t.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s].uuid,l=e[a];if(void 0!==l)if(delete e[a],l<r){const s=--r,a=t[s],c=--o,h=t[c];e[a.uuid]=l,t[l]=a,e[h.uuid]=s,t[s]=h,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[c];e[l]=i,e[s]=r,e.pop()}}else{const r=--o,s=t[r];r>0&&(e[s.uuid]=l),t[l]=s,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const o=this._paths,s=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);i=r.length,n[t]=i,o.push(t),s.push(e),r.push(h);for(let n=c,i=a.length;n!==i;++n){const i=a[n];h[n]=new Lw(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s];e[t[s]]=n,o[n]=a,o.pop(),r[n]=r[s],r.pop(),i[n]=i[s],i.pop()}}},AnimationUtils:pS,ArcCurve:Lb,ArrayCamera:z_,ArrowHelper:class extends Df{constructor(t=new Ip(0,0,1),e=new Ip(0,0,0),n=1,i=16776960,r=.2*n,o=.2*r){super(),this.type="ArrowHelper",void 0===oM&&(oM=new xm,oM.setAttribute("position",new pm([0,0,0,0,1,0],3)),sM=new tx(0,.5,1,5,1),sM.translate(0,-.5,0)),this.position.copy(e),this.line=new gb(oM,new hb({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Fm(sM,new nm({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{rM.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(rM,e)}}setLength(t,e=.2*t,n=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},AttachedBindMode:eu,Audio:yw,AudioAnalyser:class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}},AudioContext:cw,AudioListener:class extends Df{constructor(){super(),this.type="AudioListener",this.context=cw.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new pw}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(mw,gw,vw),_w.set(0,0,-1).applyQuaternion(gw),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(mw.x,t),e.positionY.linearRampToValueAtTime(mw.y,t),e.positionZ.linearRampToValueAtTime(mw.z,t),e.forwardX.linearRampToValueAtTime(_w.x,t),e.forwardY.linearRampToValueAtTime(_w.y,t),e.forwardZ.linearRampToValueAtTime(_w.z,t),e.upX.linearRampToValueAtTime(n.x,t),e.upY.linearRampToValueAtTime(n.y,t),e.upZ.linearRampToValueAtTime(n.z,t)}else e.setPosition(mw.x,mw.y,mw.z),e.setOrientation(_w.x,_w.y,_w.z,n.x,n.y,n.z)}},AudioLoader:class extends LS{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new kS(this.manager);function s(e){i?i(e):console.error(e),r.manager.itemError(t)}o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(t){try{const n=t.slice(0);cw.getContext().decodeAudioData(n,function(t){e(t)}).catch(s)}catch(t){s(t)}},n,i)}},AxesHelper:aM,BackSide:1,BasicDepthPacking:3200,BasicShadowMap:0,BatchedMesh:cb,Bone:Oy,BooleanKeyframeTrack:yS,Box2:class{constructor(t=new np(1/0,1/0),e=new np(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=Fw.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Fw).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Box3:Up,Box3Helper:class extends yb{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new xm;i.setIndex(new hm(n,1)),i.setAttribute("position",new pm([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new hb({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},BoxGeometry:Hm,BoxHelper:class extends yb{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new xm;r.setIndex(new hm(n,1)),r.setAttribute("position",new hm(i,3)),super(r,new hb({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&iM.setFromObject(this.object),iM.isEmpty())return;const e=iM.min,n=iM.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},BufferAttribute:hm,BufferGeometry:xm,BufferGeometryLoader:rw,ByteType:1010,Cache:CS,Camera:$m,CameraHelper:class extends yb{constructor(t){const e=new xm,n=new hb({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],o={};function s(t,e){a(t),a(e)}function a(t){i.push(0,0,0),r.push(0,0,0),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}s("n1","n2"),s("n2","n4"),s("n4","n3"),s("n3","n1"),s("f1","f2"),s("f2","f4"),s("f4","f3"),s("f3","f1"),s("n1","f1"),s("n2","f2"),s("n3","f3"),s("n4","f4"),s("p","n1"),s("p","n2"),s("p","n3"),s("p","n4"),s("u1","u2"),s("u2","u3"),s("u3","u1"),s("c","t"),s("p","c"),s("cn1","cn2"),s("cn3","cn4"),s("cf1","cf2"),s("cf3","cf4"),e.setAttribute("position",new pm(i,3)),e.setAttribute("color",new pm(r,3)),super(e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const l=new Jf(16755200),c=new Jf(16711680),h=new Jf(43775),u=new Jf(16777215),d=new Jf(3355443);this.setColors(l,c,h,u,d)}setColors(t,e,n,i,r){const o=this.geometry.getAttribute("color");o.setXYZ(0,t.r,t.g,t.b),o.setXYZ(1,t.r,t.g,t.b),o.setXYZ(2,t.r,t.g,t.b),o.setXYZ(3,t.r,t.g,t.b),o.setXYZ(4,t.r,t.g,t.b),o.setXYZ(5,t.r,t.g,t.b),o.setXYZ(6,t.r,t.g,t.b),o.setXYZ(7,t.r,t.g,t.b),o.setXYZ(8,t.r,t.g,t.b),o.setXYZ(9,t.r,t.g,t.b),o.setXYZ(10,t.r,t.g,t.b),o.setXYZ(11,t.r,t.g,t.b),o.setXYZ(12,t.r,t.g,t.b),o.setXYZ(13,t.r,t.g,t.b),o.setXYZ(14,t.r,t.g,t.b),o.setXYZ(15,t.r,t.g,t.b),o.setXYZ(16,t.r,t.g,t.b),o.setXYZ(17,t.r,t.g,t.b),o.setXYZ(18,t.r,t.g,t.b),o.setXYZ(19,t.r,t.g,t.b),o.setXYZ(20,t.r,t.g,t.b),o.setXYZ(21,t.r,t.g,t.b),o.setXYZ(22,t.r,t.g,t.b),o.setXYZ(23,t.r,t.g,t.b),o.setXYZ(24,e.r,e.g,e.b),o.setXYZ(25,e.r,e.g,e.b),o.setXYZ(26,e.r,e.g,e.b),o.setXYZ(27,e.r,e.g,e.b),o.setXYZ(28,e.r,e.g,e.b),o.setXYZ(29,e.r,e.g,e.b),o.setXYZ(30,e.r,e.g,e.b),o.setXYZ(31,e.r,e.g,e.b),o.setXYZ(32,n.r,n.g,n.b),o.setXYZ(33,n.r,n.g,n.b),o.setXYZ(34,n.r,n.g,n.b),o.setXYZ(35,n.r,n.g,n.b),o.setXYZ(36,n.r,n.g,n.b),o.setXYZ(37,n.r,n.g,n.b),o.setXYZ(38,i.r,i.g,i.b),o.setXYZ(39,i.r,i.g,i.b),o.setXYZ(40,r.r,r.g,r.b),o.setXYZ(41,r.r,r.g,r.b),o.setXYZ(42,r.r,r.g,r.b),o.setXYZ(43,r.r,r.g,r.b),o.setXYZ(44,r.r,r.g,r.b),o.setXYZ(45,r.r,r.g,r.b),o.setXYZ(46,r.r,r.g,r.b),o.setXYZ(47,r.r,r.g,r.b),o.setXYZ(48,r.r,r.g,r.b),o.setXYZ(49,r.r,r.g,r.b),o.needsUpdate=!0}update(){const t=this.geometry,e=this.pointMap;eM.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),nM("c",e,t,eM,0,0,-1),nM("t",e,t,eM,0,0,1),nM("n1",e,t,eM,-1,-1,-1),nM("n2",e,t,eM,1,-1,-1),nM("n3",e,t,eM,-1,1,-1),nM("n4",e,t,eM,1,1,-1),nM("f1",e,t,eM,-1,-1,1),nM("f2",e,t,eM,1,-1,1),nM("f3",e,t,eM,-1,1,1),nM("f4",e,t,eM,1,1,1),nM("u1",e,t,eM,.7,1.1,-1),nM("u2",e,t,eM,-.7,1.1,-1),nM("u3",e,t,eM,0,2,-1),nM("cf1",e,t,eM,-1,0,1),nM("cf2",e,t,eM,1,0,1),nM("cf3",e,t,eM,0,-1,1),nM("cf4",e,t,eM,0,1,1),nM("cn1",e,t,eM,-1,0,-1),nM("cn2",e,t,eM,1,0,-1),nM("cn3",e,t,eM,0,-1,-1),nM("cn4",e,t,eM,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},CanvasTexture:class extends Tp{constructor(t,e,n,i,r,o,s,a,l){super(t,e,n,i,r,o,s,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},CapsuleGeometry:Jb,CatmullRomCurve3:Nb,CineonToneMapping:3,CircleGeometry:Qb,ClampToEdgeWrapping:hu,Clock:pw,Color:Jf,ColorKeyframeTrack:bS,ColorManagement:gp,CompressedArrayTexture:class extends Cb{constructor(t,e,n,i,r,o){super(t,e,n,r,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=hu}},CompressedCubeTexture:class extends Cb{constructor(t,e,n){super(void 0,t[0].width,t[0].height,e,n,ru),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}},CompressedTexture:Cb,CompressedTextureLoader:class extends LS{constructor(t){super(t)}load(t,e,n,i){const r=this,o=[],s=new Cb,a=new kS(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials);let l=0;function c(c){a.load(t[c],function(t){const n=r.parse(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(s.minFilter=mu),s.image=o,s.format=n.format,s.needsUpdate=!0,e&&e(s))},n,i)}if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)c(e);else a.load(t,function(t){const n=r.parse(t,!0);if(n.isCubemap){const t=n.mipmaps.length/n.mipmapCount;for(let e=0;e<t;e++){o[e]={mipmaps:[]};for(let t=0;t<n.mipmapCount;t++)o[e].mipmaps.push(n.mipmaps[e*n.mipmapCount+t]),o[e].format=n.format,o[e].width=n.width,o[e].height=n.height}s.image=o}else s.image.width=n.width,s.image.height=n.height,s.mipmaps=n.mipmaps;1===n.mipmapCount&&(s.minFilter=mu),s.format=n.format,s.needsUpdate=!0,e&&e(s)},n,i);return s}},ConeGeometry:ex,ConstantAlphaFactor:213,ConstantColorFactor:211,CubeCamera:Qm,CubeReflectionMapping:ru,CubeRefractionMapping:ou,CubeTexture:tg,CubeTextureLoader:class extends LS{constructor(t){super(t)}load(t,e,n,i){const r=new tg;r.colorSpace=bd;const o=new US(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;function a(n){o.load(t[n],function(t){r.images[n]=t,s++,6===s&&(r.needsUpdate=!0,e&&e(r))},void 0,i)}for(let e=0;e<t.length;++e)a(e);return r}},CubeUVReflectionMapping:lu,CubicBezierCurve:Hb,CubicBezierCurve3:Wb,CubicInterpolant:mS,CullFaceBack:1,CullFaceFront:2,CullFaceFrontBack:3,CullFaceNone:0,Curve:Rb,CurvePath:qb,CustomBlending:5,CustomToneMapping:5,CylinderGeometry:tx,Cylindrical:class{constructor(t=1,e=0,n=0){return this.radius=t,this.theta=e,this.y=n,this}set(t,e,n){return this.radius=t,this.theta=e,this.y=n,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}clone(){return(new this.constructor).copy(this)}},Data3DTexture:Pp,DataArrayTexture:Rp,DataTexture:ky,DataTextureLoader:class extends LS{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new ky,s=new kS(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(r.withCredentials),s.load(t,function(t){let n;try{n=r.parse(t)}catch(t){if(void 0===i)return void console.error(t);i(t)}void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:hu,o.wrapT=void 0!==n.wrapT?n.wrapT:hu,o.magFilter=void 0!==n.magFilter?n.magFilter:mu,o.minFilter=void 0!==n.minFilter?n.minFilter:mu,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.colorSpace&&(o.colorSpace=n.colorSpace),void 0!==n.flipY&&(o.flipY=n.flipY),void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=vu),1===n.mipmapCount&&(o.minFilter=mu),void 0!==n.generateMipmaps&&(o.generateMipmaps=n.generateMipmaps),o.needsUpdate=!0,e&&e(o,n)},n,i),o}},DataUtils:am,DecrementStencilOp:7683,DecrementWrapStencilOp:34056,DefaultLoadingManager:PS,DepthFormat:Cu,DepthStencilFormat:Ru,DepthTexture:Zg,DetachedBindMode:nu,DirectionalLight:ZS,DirectionalLightHelper:class extends Df{constructor(t,e,n){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",void 0===e&&(e=1);let i=new xm;i.setAttribute("position",new pm([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new hb({fog:!1,toneMapped:!1});this.lightPlane=new gb(i,r),this.add(this.lightPlane),i=new xm,i.setAttribute("position",new pm([0,0,0,0,0,1],3)),this.targetLine=new gb(i,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Kw.setFromMatrixPosition(this.light.matrixWorld),Jw.setFromMatrixPosition(this.light.target.matrixWorld),Qw.subVectors(Jw,Kw),this.lightPlane.lookAt(Jw),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Jw),this.targetLine.scale.z=Qw.length()}},DiscreteInterpolant:vS,DisplayP3ColorSpace:Sd,DodecahedronGeometry:ix,DoubleSide:2,DstAlphaFactor:206,DstColorFactor:208,DynamicCopyUsage:35050,DynamicDrawUsage:35048,DynamicReadUsage:35049,EdgesGeometry:lx,EllipseCurve:Pb,EqualCompare:514,EqualDepth:4,EqualStencilFunc:514,EquirectangularReflectionMapping:su,EquirectangularRefractionMapping:au,Euler:yf,EventDispatcher:Wd,ExtrudeGeometry:Bx,FileLoader:kS,Float16BufferAttribute:class extends hm{constructor(t,e,n){super(new Uint16Array(t),e,n),this.isFloat16BufferAttribute=!0}getX(t){let e=sm(this.array[t*this.itemSize]);return this.normalized&&(e=Qd(e,this.array)),e}setX(t,e){return this.normalized&&(e=tp(e,this.array)),this.array[t*this.itemSize]=om(e),this}getY(t){let e=sm(this.array[t*this.itemSize+1]);return this.normalized&&(e=Qd(e,this.array)),e}setY(t,e){return this.normalized&&(e=tp(e,this.array)),this.array[t*this.itemSize+1]=om(e),this}getZ(t){let e=sm(this.array[t*this.itemSize+2]);return this.normalized&&(e=Qd(e,this.array)),e}setZ(t,e){return this.normalized&&(e=tp(e,this.array)),this.array[t*this.itemSize+2]=om(e),this}getW(t){let e=sm(this.array[t*this.itemSize+3]);return this.normalized&&(e=Qd(e,this.array)),e}setW(t,e){return this.normalized&&(e=tp(e,this.array)),this.array[t*this.itemSize+3]=om(e),this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array)),this.array[t+0]=om(e),this.array[t+1]=om(n),this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array),i=tp(i,this.array)),this.array[t+0]=om(e),this.array[t+1]=om(n),this.array[t+2]=om(i),this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=tp(e,this.array),n=tp(n,this.array),i=tp(i,this.array),r=tp(r,this.array)),this.array[t+0]=om(e),this.array[t+1]=om(n),this.array[t+2]=om(i),this.array[t+3]=om(r),this}},Float32BufferAttribute:pm,FloatType:Su,Fog:Q_,FogExp2:J_,FramebufferTexture:class extends Tp{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=du,this.minFilter=du,this.generateMipmaps=!1,this.needsUpdate=!0}},FrontSide:0,Frustum:lg,GLBufferAttribute:class{constructor(t,e,n,i,r){this.isGLBufferAttribute=!0,this.name="",this.buffer=t,this.type=e,this.itemSize=n,this.elementSize=i,this.count=r,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}},GLSL1:"100",GLSL3:Bd,GreaterCompare:516,GreaterDepth:6,GreaterEqualCompare:518,GreaterEqualDepth:5,GreaterEqualStencilFunc:518,GreaterStencilFunc:516,GridHelper:Zw,Group:H_,HalfFloatType:wu,HemisphereLight:NS,HemisphereLightHelper:class extends Df{constructor(t,e,n){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new Hx(e);i.rotateY(.5*Math.PI),this.material=new nm({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=i.getAttribute("position"),o=new Float32Array(3*r.count);i.setAttribute("color",new hm(o,3)),this.add(new Fm(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");Yw.copy(this.light.color),qw.copy(this.light.groundColor);for(let t=0,n=e.count;t<n;t++){const i=t<n/2?Yw:qw;e.setXYZ(t,i.r,i.g,i.b)}e.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),t.lookAt($w.setFromMatrixPosition(this.light.matrixWorld).negate())}},IcosahedronGeometry:zx,ImageBitmapLoader:class extends LS{constructor(t){super(t),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=CS.get(t);if(void 0!==o)return r.manager.itemStart(t),o.then?void o.then(n=>{e&&e(n),r.manager.itemEnd(t)}).catch(t=>{i&&i(t)}):(setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o);const s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader;const a=fetch(t,s).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(n){return CS.add(t,n),e&&e(n),r.manager.itemEnd(t),n}).catch(function(e){i&&i(e),CS.remove(t),r.manager.itemError(t),r.manager.itemEnd(t)});CS.add(t,a),r.manager.itemStart(t)}},ImageLoader:US,ImageUtils:bp,IncrementStencilOp:7682,IncrementWrapStencilOp:34055,InstancedBufferAttribute:By,InstancedBufferGeometry:iw,InstancedInterleavedBuffer:class extends ey{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}},InstancedMesh:Xy,Int16BufferAttribute:class extends hm{constructor(t,e,n){super(new Int16Array(t),e,n)}},Int32BufferAttribute:class extends hm{constructor(t,e,n){super(new Int32Array(t),e,n)}},Int8BufferAttribute:class extends hm{constructor(t,e,n){super(new Int8Array(t),e,n)}},IntType:bu,InterleavedBuffer:ey,InterleavedBufferAttribute:iy,Interpolant:fS,InterpolateDiscrete:ud,InterpolateLinear:dd,InterpolateSmooth:pd,InvertStencilOp:5386,KeepStencilOp:Cd,KeyframeTrack:_S,LOD:Sy,LatheGeometry:Kb,Layers:bf,LessCompare:513,LessDepth:2,LessEqualCompare:515,LessEqualDepth:3,LessEqualStencilFunc:515,LessStencilFunc:513,Light:DS,LightProbe:tw,Line:gb,Line3:class{constructor(t=new Ip,e=new Ip){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){zw.subVectors(t,this.start),Hw.subVectors(this.end,this.start);const n=Hw.dot(Hw);let i=Hw.dot(zw)/n;return e&&(i=Yd(i,0,1)),i}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},LineBasicMaterial:hb,LineCurve:Vb,LineCurve3:Gb,LineDashedMaterial:aS,LineLoop:bb,LineSegments:yb,LinearDisplayP3ColorSpace:wd,LinearFilter:mu,LinearInterpolant:gS,LinearMipMapLinearFilter:1008,LinearMipMapNearestFilter:1007,LinearMipmapLinearFilter:vu,LinearMipmapNearestFilter:gu,LinearSRGBColorSpace:xd,LinearToneMapping:1,LinearTransfer:Md,Loader:LS,LoaderUtils:nw,LoadingManager:RS,LoopOnce:2200,LoopPingPong:2202,LoopRepeat:2201,LuminanceAlphaFormat:1025,LuminanceFormat:1024,MOUSE:{LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Material:em,MaterialLoader:ew,MathUtils:ep,Matrix3:ip,Matrix4:cf,MaxEquation:104,Mesh:Fm,MeshBasicMaterial:nm,MeshDepthMaterial:k_,MeshDistanceMaterial:U_,MeshLambertMaterial:oS,MeshMatcapMaterial:sS,MeshNormalMaterial:rS,MeshPhongMaterial:nS,MeshPhysicalMaterial:eS,MeshStandardMaterial:tS,MeshToonMaterial:iS,MinEquation:103,MirroredRepeatWrapping:uu,MixOperation:1,MultiplyBlending:4,MultiplyOperation:0,NearestFilter:du,NearestMipMapLinearFilter:1005,NearestMipMapNearestFilter:1004,NearestMipmapLinearFilter:fu,NearestMipmapNearestFilter:pu,NeutralToneMapping:7,NeverCompare:512,NeverDepth:0,NeverStencilFunc:512,NoBlending:0,NoColorSpace:yd,NoToneMapping:0,NormalAnimationBlendMode:vd,NormalBlending:1,NotEqualCompare:517,NotEqualDepth:7,NotEqualStencilFunc:517,NumberKeyframeTrack:xS,Object3D:Df,ObjectLoader:class extends LS{constructor(t){super(t)}load(t,e,n,i){const r=this,o=""===this.path?nw.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;const s=new kS(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(n){let o=null;try{o=JSON.parse(n)}catch(e){return void 0!==i&&i(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}const s=o.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())return void 0!==i&&i(new Error("THREE.ObjectLoader: Can't load "+t)),void console.error("THREE.ObjectLoader: Can't load "+t);r.parse(o,e)},n,i)}async loadAsync(t,e){const n=""===this.path?nw.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||n;const i=new kS(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);const r=await i.loadAsync(t,e),o=JSON.parse(r),s=o.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(o)}parse(t,e){const n=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,i),o=this.parseImages(t.images,function(){void 0!==e&&e(l)}),s=this.parseTextures(t.textures,o),a=this.parseMaterials(t.materials,s),l=this.parseObject(t.object,r,a,s,n),c=this.parseSkeletons(t.skeletons,l);if(this.bindSkeletons(l,c),void 0!==e){let t=!1;for(const e in o)if(o[e].data instanceof HTMLImageElement){t=!0;break}!1===t&&e(l)}return l}async parseAsync(t){const e=this.parseAnimations(t.animations),n=this.parseShapes(t.shapes),i=this.parseGeometries(t.geometries,n),r=await this.parseImagesAsync(t.images),o=this.parseTextures(t.textures,r),s=this.parseMaterials(t.materials,o),a=this.parseObject(t.object,i,s,o,e),l=this.parseSkeletons(t.skeletons,a);return this.bindSkeletons(a,l),a}parseShapes(t){const e={};if(void 0!==t)for(let n=0,i=t.length;n<i;n++){const i=(new cx).fromJSON(t[n]);e[i.uuid]=i}return e}parseSkeletons(t,e){const n={},i={};if(e.traverse(function(t){t.isBone&&(i[t.uuid]=t)}),void 0!==t)for(let e=0,r=t.length;e<r;e++){const r=(new Ny).fromJSON(t[e],i);n[r.uuid]=r}return n}parseGeometries(t,e){const n={};if(void 0!==t){const i=new rw;for(let r=0,o=t.length;r<o;r++){let o;const s=t[r];switch(s.type){case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;default:s.type in Kx?o=Kx[s.type].fromJSON(s,e):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${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}parseMaterials(t,e){const n={},i={};if(void 0!==t){const r=new ew;r.setTextures(e);for(let e=0,o=t.length;e<o;e++){const o=t[e];void 0===n[o.uuid]&&(n[o.uuid]=r.parse(o)),i[o.uuid]=n[o.uuid]}}return i}parseAnimations(t){const e={};if(void 0!==t)for(let n=0;n<t.length;n++){const i=t[n],r=AS.parse(i);e[r.uuid]=r}return e}parseImages(t,e){const n=this,i={};let r;function o(t){if("string"==typeof t){const e=t;return function(t){return n.manager.itemStart(t),r.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:n.resourcePath+e)}return t.data?{data:ap(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){const n=new RS(e);r=new US(n),r.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e<n;e++){const n=t[e],r=n.url;if(Array.isArray(r)){const t=[];for(let e=0,n=r.length;e<n;e++){const n=o(r[e]);null!==n&&(n instanceof HTMLImageElement?t.push(n):t.push(new ky(n.data,n.width,n.height)))}i[n.uuid]=new Sp(t)}else{const t=o(n.url);i[n.uuid]=new Sp(t)}}}return i}async parseImagesAsync(t){const e=this,n={};let i;async function r(t){if("string"==typeof t){const n=t,r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:e.resourcePath+n;return await i.loadAsync(r)}return t.data?{data:ap(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){i=new US(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){const i=t[e],o=i.url;if(Array.isArray(o)){const t=[];for(let e=0,n=o.length;e<n;e++){const n=o[e],i=await r(n);null!==i&&(i instanceof HTMLImageElement?t.push(i):t.push(new ky(i.data,i.width,i.height)))}n[i.uuid]=new Sp(t)}else{const t=await r(i.url);n[i.uuid]=new Sp(t)}}}return n}parseTextures(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}const i={};if(void 0!==t)for(let r=0,o=t.length;r<o;r++){const o=t[r];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const s=e[o.image],a=s.data;let l;Array.isArray(a)?(l=new tg,6===a.length&&(l.needsUpdate=!0)):(l=a&&a.data?new ky:new Tp,a&&(l.needsUpdate=!0)),l.source=s,l.uuid=o.uuid,void 0!==o.name&&(l.name=o.name),void 0!==o.mapping&&(l.mapping=n(o.mapping,ow)),void 0!==o.channel&&(l.channel=o.channel),void 0!==o.offset&&l.offset.fromArray(o.offset),void 0!==o.repeat&&l.repeat.fromArray(o.repeat),void 0!==o.center&&l.center.fromArray(o.center),void 0!==o.rotation&&(l.rotation=o.rotation),void 0!==o.wrap&&(l.wrapS=n(o.wrap[0],sw),l.wrapT=n(o.wrap[1],sw)),void 0!==o.format&&(l.format=o.format),void 0!==o.internalFormat&&(l.internalFormat=o.internalFormat),void 0!==o.type&&(l.type=o.type),void 0!==o.colorSpace&&(l.colorSpace=o.colorSpace),void 0!==o.minFilter&&(l.minFilter=n(o.minFilter,aw)),void 0!==o.magFilter&&(l.magFilter=n(o.magFilter,aw)),void 0!==o.anisotropy&&(l.anisotropy=o.anisotropy),void 0!==o.flipY&&(l.flipY=o.flipY),void 0!==o.generateMipmaps&&(l.generateMipmaps=o.generateMipmaps),void 0!==o.premultiplyAlpha&&(l.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(l.unpackAlignment=o.unpackAlignment),void 0!==o.compareFunction&&(l.compareFunction=o.compareFunction),void 0!==o.userData&&(l.userData=o.userData),i[o.uuid]=l}return i}parseObject(t,e,n,i,r){let o,s,a;function l(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function c(t){if(void 0!==t){if(Array.isArray(t)){const e=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];void 0===n[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(n[r])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}function h(t){return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined texture",t),i[t]}switch(t.type){case"Scene":o=new ty,void 0!==t.background&&(Number.isInteger(t.background)?o.background=new Jf(t.background):o.background=h(t.background)),void 0!==t.environment&&(o.environment=h(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?o.fog=new Q_(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(o.fog=new J_(t.fog.color,t.fog.density)),""!==t.fog.name&&(o.fog.name=t.fog.name)),void 0!==t.backgroundBlurriness&&(o.backgroundBlurriness=t.backgroundBlurriness),void 0!==t.backgroundIntensity&&(o.backgroundIntensity=t.backgroundIntensity),void 0!==t.backgroundRotation&&o.backgroundRotation.fromArray(t.backgroundRotation),void 0!==t.environmentRotation&&o.environmentRotation.fromArray(t.environmentRotation);break;case"PerspectiveCamera":o=new Km(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(o.focus=t.focus),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.filmGauge&&(o.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(o.filmOffset=t.filmOffset),void 0!==t.view&&(o.view=Object.assign({},t.view));break;case"OrthographicCamera":o=new Mg(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.view&&(o.view=Object.assign({},t.view));break;case"AmbientLight":o=new KS(t.color,t.intensity);break;case"DirectionalLight":o=new ZS(t.color,t.intensity);break;case"PointLight":o=new YS(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":o=new JS(t.color,t.intensity,t.width,t.height);break;case"SpotLight":o=new VS(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":o=new NS(t.color,t.groundColor,t.intensity);break;case"LightProbe":o=(new tw).fromJSON(t);break;case"SkinnedMesh":s=l(t.geometry),a=c(t.material),o=new Iy(s,a),void 0!==t.bindMode&&(o.bindMode=t.bindMode),void 0!==t.bindMatrix&&o.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(o.skeleton=t.skeleton);break;case"Mesh":s=l(t.geometry),a=c(t.material),o=new Fm(s,a);break;case"InstancedMesh":s=l(t.geometry),a=c(t.material);const e=t.count,n=t.instanceMatrix,i=t.instanceColor;o=new Xy(s,a,e),o.instanceMatrix=new By(new Float32Array(n.array),16),void 0!==i&&(o.instanceColor=new By(new Float32Array(i.array),i.itemSize));break;case"BatchedMesh":s=l(t.geometry),a=c(t.material),o=new cb(t.maxGeometryCount,t.maxVertexCount,t.maxIndexCount,a),o.geometry=s,o.perObjectFrustumCulled=t.perObjectFrustumCulled,o.sortObjects=t.sortObjects,o._drawRanges=t.drawRanges,o._reservedRanges=t.reservedRanges,o._visibility=t.visibility,o._active=t.active,o._bounds=t.bounds.map(t=>{const e=new Up;e.min.fromArray(t.boxMin),e.max.fromArray(t.boxMax);const n=new Qp;return n.radius=t.sphereRadius,n.center.fromArray(t.sphereCenter),{boxInitialized:t.boxInitialized,box:e,sphereInitialized:t.sphereInitialized,sphere:n}}),o._maxGeometryCount=t.maxGeometryCount,o._maxVertexCount=t.maxVertexCount,o._maxIndexCount=t.maxIndexCount,o._geometryInitialized=t.geometryInitialized,o._geometryCount=t.geometryCount,o._matricesTexture=h(t.matricesTexture.uuid);break;case"LOD":o=new Sy;break;case"Line":o=new gb(l(t.geometry),c(t.material));break;case"LineLoop":o=new bb(l(t.geometry),c(t.material));break;case"LineSegments":o=new yb(l(t.geometry),c(t.material));break;case"PointCloud":case"Points":o=new Ab(l(t.geometry),c(t.material));break;case"Sprite":o=new _y(c(t.material));break;case"Group":o=new H_;break;case"Bone":o=new Oy;break;default:o=new Df}if(o.uuid=t.uuid,void 0!==t.name&&(o.name=t.name),void 0!==t.matrix?(o.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(o.matrixAutoUpdate=t.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(void 0!==t.position&&o.position.fromArray(t.position),void 0!==t.rotation&&o.rotation.fromArray(t.rotation),void 0!==t.quaternion&&o.quaternion.fromArray(t.quaternion),void 0!==t.scale&&o.scale.fromArray(t.scale)),void 0!==t.up&&o.up.fromArray(t.up),void 0!==t.castShadow&&(o.castShadow=t.castShadow),void 0!==t.receiveShadow&&(o.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(o.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(o.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(o.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&o.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(o.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(o.visible=t.visible),void 0!==t.frustumCulled&&(o.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(o.renderOrder=t.renderOrder),void 0!==t.userData&&(o.userData=t.userData),void 0!==t.layers&&(o.layers.mask=t.layers),void 0!==t.children){const s=t.children;for(let t=0;t<s.length;t++)o.add(this.parseObject(s[t],e,n,i,r))}if(void 0!==t.animations){const e=t.animations;for(let t=0;t<e.length;t++){const n=e[t];o.animations.push(r[n])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(o.autoUpdate=t.autoUpdate);const e=t.levels;for(let t=0;t<e.length;t++){const n=e[t],i=o.getObjectByProperty("uuid",n.object);void 0!==i&&o.addLevel(i,n.distance,n.hysteresis)}}return o}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse(function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){const n=e[t.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(n,t.bindMatrix)}})}},ObjectSpaceNormalMap:1,OctahedronGeometry:Hx,OneFactor:201,OneMinusConstantAlphaFactor:214,OneMinusConstantColorFactor:212,OneMinusDstAlphaFactor:207,OneMinusDstColorFactor:209,OneMinusSrcAlphaFactor:jh,OneMinusSrcColorFactor:203,OrthographicCamera:Mg,P3Primaries:Ed,PCFShadowMap:1,PCFSoftShadowMap:2,PMREMGenerator:Ug,Path:Zb,PerspectiveCamera:Km,Plane:og,PlaneGeometry:ug,PlaneHelper:class extends gb{constructor(t,e=1,n=16776960){const i=n,r=new xm;r.setAttribute("position",new pm([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),r.computeBoundingSphere(),super(r,new hb({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const o=new xm;o.setAttribute("position",new pm([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),o.computeBoundingSphere(),this.add(new Fm(o,new nm({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(t)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},PointLight:YS,PointLightHelper:class extends Fm{constructor(t,e,n){super(new Gx(e,4,2),new nm({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},Points:Ab,PointsMaterial:xb,PolarGridHelper:class extends yb{constructor(t=10,e=16,n=8,i=64,r=4473924,o=8947848){r=new Jf(r),o=new Jf(o);const s=[],a=[];if(e>1)for(let n=0;n<e;n++){const i=n/e*(2*Math.PI),l=Math.sin(i)*t,c=Math.cos(i)*t;s.push(0,0,0),s.push(l,0,c);const h=1&n?r:o;a.push(h.r,h.g,h.b),a.push(h.r,h.g,h.b)}for(let e=0;e<n;e++){const l=1&e?r:o,c=t-t/n*e;for(let t=0;t<i;t++){let e=t/i*(2*Math.PI),n=Math.sin(e)*c,r=Math.cos(e)*c;s.push(n,0,r),a.push(l.r,l.g,l.b),e=(t+1)/i*(2*Math.PI),n=Math.sin(e)*c,r=Math.cos(e)*c,s.push(n,0,r),a.push(l.r,l.g,l.b)}}const l=new xm;l.setAttribute("position",new pm(s,3)),l.setAttribute("color",new pm(a,3));super(l,new hb({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},PolyhedronGeometry:nx,PositionalAudio:class extends yw{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(bw,xw,Sw),ww.set(0,0,1).applyQuaternion(xw);const e=this.panner;if(e.positionX){const t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(bw.x,t),e.positionY.linearRampToValueAtTime(bw.y,t),e.positionZ.linearRampToValueAtTime(bw.z,t),e.orientationX.linearRampToValueAtTime(ww.x,t),e.orientationY.linearRampToValueAtTime(ww.y,t),e.orientationZ.linearRampToValueAtTime(ww.z,t)}else e.setPosition(bw.x,bw.y,bw.z),e.setOrientation(ww.x,ww.y,ww.z)}},PropertyBinding:Lw,PropertyMixer:Mw,QuadraticBezierCurve:jb,QuadraticBezierCurve3:Xb,Quaternion:Lp,QuaternionKeyframeTrack:wS,QuaternionLinearInterpolant:SS,RED_GREEN_RGTC2_Format:cd,RED_RGTC1_Format:36283,REVISION:Oh,RGBADepthPacking:3201,RGBAFormat:Eu,RGBAIntegerFormat:Ou,RGBA_ASTC_10x10_Format:nd,RGBA_ASTC_10x5_Format:Qu,RGBA_ASTC_10x6_Format:td,RGBA_ASTC_10x8_Format:ed,RGBA_ASTC_12x10_Format:id,RGBA_ASTC_12x12_Format:rd,RGBA_ASTC_4x4_Format:ju,RGBA_ASTC_5x4_Format:Xu,RGBA_ASTC_5x5_Format:$u,RGBA_ASTC_6x5_Format:Yu,RGBA_ASTC_6x6_Format:qu,RGBA_ASTC_8x5_Format:Zu,RGBA_ASTC_8x6_Format:Ku,RGBA_ASTC_8x8_Format:Ju,RGBA_BPTC_Format:od,RGBA_ETC2_EAC_Format:Gu,RGBA_PVRTC_2BPPV1_Format:Hu,RGBA_PVRTC_4BPPV1_Format:zu,RGBA_S3TC_DXT1_Format:Uu,RGBA_S3TC_DXT3_Format:Du,RGBA_S3TC_DXT5_Format:Nu,RGB_BPTC_SIGNED_Format:sd,RGB_BPTC_UNSIGNED_Format:ad,RGB_ETC1_Format:Wu,RGB_ETC2_Format:Vu,RGB_PVRTC_2BPPV1_Format:Fu,RGB_PVRTC_4BPPV1_Format:Bu,RGB_S3TC_DXT1_Format:ku,RGFormat:1030,RGIntegerFormat:Iu,RawShaderMaterial:Qx,Ray:lf,Raycaster:class{constructor(t,e,n=0,i=1/0){this.ray=new lf(t,e),this.near=n,this.far=i,this.camera=null,this.layers=new bf,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return Dw.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Dw),this}intersectObject(t,e=!0,n=[]){return Bw(t,this,n,e),n.sort(Nw),n}intersectObjects(t,e=!0,n=[]){for(let i=0,r=t.length;i<r;i++)Bw(t[i],this,n,e);return n.sort(Nw),n}},Rec709Primaries:Ad,RectAreaLight:JS,RedFormat:Pu,RedIntegerFormat:Lu,ReinhardToneMapping:2,RenderTarget:Ep,RepeatWrapping:cu,ReplaceStencilOp:7681,ReverseSubtractEquation:102,RingGeometry:Wx,SIGNED_RED_GREEN_RGTC2_Format:hd,SIGNED_RED_RGTC1_Format:ld,SRGBColorSpace:bd,SRGBTransfer:Td,Scene:ty,ShaderChunk:dg,ShaderLib:fg,ShaderMaterial:Xm,ShadowMaterial:Jx,Shape:cx,ShapeGeometry:Vx,ShapePath:class{constructor(){this.type="ShapePath",this.color=new Jf,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Zb,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.currentPath.bezierCurveTo(t,e,n,i,r,o),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let i=!1;for(let r=n-1,o=0;o<n;r=o++){let n=e[r],s=e[o],a=s.x-n.x,l=s.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=e[o],a=-a,s=e[r],l=-l),t.y<n.y||t.y>s.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-a*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(s.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=s.x)return!0}}return i}const n=Ux.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,o,s;const a=[];if(1===i.length)return o=i[0],s=new cx,s.curves=o.curves,a.push(s),a;let l=!n(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let e=0,s=i.length;e<s;e++)o=i[e],u=o.getPoints(),r=n(u),r=t?!r:r,r?(!l&&h[f]&&f++,h[f]={s:new cx,p:u},h[f].s.curves=o.curves,l&&f++,p[f]=[]):p[f].push({h:o,p:u[0]});if(!h[0])return function(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n],r=new cx;r.curves=i.curves,e.push(r)}return e}(i);if(h.length>1){let t=!1,n=0;for(let t=0,e=h.length;t<e;t++)c[t]=[];for(let i=0,r=h.length;i<r;i++){const r=p[i];for(let o=0;o<r.length;o++){const s=r[o];let a=!0;for(let r=0;r<h.length;r++)e(s.p,h[r].p)&&(i!==r&&n++,a?(a=!1,c[r].push(s)):t=!0);a&&c[i].push(s)}}n>0&&!1===t&&(p=c)}for(let t=0,e=h.length;t<e;t++){s=h[t].s,a.push(s),d=p[t];for(let t=0,e=d.length;t<e;t++)s.holes.push(d[t].h)}return a}},ShapeUtils:Ux,ShortType:1011,Skeleton:Ny,SkeletonHelper:class extends yb{constructor(t){const e=Xw(t),n=new xm,i=[],r=[],o=new Jf(0,0,1),s=new Jf(0,1,0);for(let t=0;t<e.length;t++){const n=e[t];n.parent&&n.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}n.setAttribute("position",new pm(i,3)),n.setAttribute("color",new pm(r,3));super(n,new hb({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,n=this.geometry,i=n.getAttribute("position");jw.copy(this.root.matrixWorld).invert();for(let t=0,n=0;t<e.length;t++){const r=e[t];r.parent&&r.parent.isBone&&(Gw.multiplyMatrices(jw,r.matrixWorld),Vw.setFromMatrixPosition(Gw),i.setXYZ(n,Vw.x,Vw.y,Vw.z),Gw.multiplyMatrices(jw,r.parent.matrixWorld),Vw.setFromMatrixPosition(Gw),i.setXYZ(n+1,Vw.x,Vw.y,Vw.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}dispose(){this.geometry.dispose(),this.material.dispose()}},SkinnedMesh:Iy,Source:Sp,Sphere:Qp,SphereGeometry:Gx,Spherical:class{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Yd(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},SphericalHarmonics3:QS,SplineCurve:$b,SpotLight:VS,SpotLightHelper:class extends Df{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const n=new xm,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,n=32;t<n;t++,e++){const r=t/n*Math.PI*2,o=e/n*Math.PI*2;i.push(Math.cos(r),Math.sin(r),1,Math.cos(o),Math.sin(o),1)}n.setAttribute("position",new pm(i,3));const r=new hb({fog:!1,toneMapped:!1});this.cone=new yb(n,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Ww.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Ww),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},Sprite:_y,SpriteMaterial:ry,SrcAlphaFactor:Gh,SrcAlphaSaturateFactor:210,SrcColorFactor:202,StaticCopyUsage:35046,StaticDrawUsage:Nd,StaticReadUsage:35045,StereoCamera:class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Km,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Km,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,dw.copy(t.projectionMatrix);const n=e.eyeSep/2,i=n*e.near/e.focus,r=e.near*Math.tan(jd*e.fov*.5)/e.zoom;let o,s;uw.elements[12]=-n,hw.elements[12]=n,o=-r*e.aspect+i,s=r*e.aspect+i,dw.elements[0]=2*e.near/(s-o),dw.elements[8]=(s+o)/(s-o),this.cameraL.projectionMatrix.copy(dw),o=-r*e.aspect-i,s=r*e.aspect-i,dw.elements[0]=2*e.near/(s-o),dw.elements[8]=(s+o)/(s-o),this.cameraR.projectionMatrix.copy(dw)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(uw),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(hw)}},StreamCopyUsage:35042,StreamDrawUsage:35040,StreamReadUsage:35041,StringKeyframeTrack:MS,SubtractEquation:101,SubtractiveBlending:3,TOUCH:{ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},TangentSpaceNormalMap:0,TetrahedronGeometry:jx,Texture:Tp,TextureLoader:class extends LS{constructor(t){super(t)}load(t,e,n,i){const r=new Tp,o=new US(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)},n,i),r}},TorusGeometry:Xx,TorusKnotGeometry:$x,Triangle:$f,TriangleFanDrawMode:2,TriangleStripDrawMode:1,TrianglesDrawMode:0,TubeGeometry:Yx,UVMapping:iu,Uint16BufferAttribute:um,Uint32BufferAttribute:dm,Uint8BufferAttribute:class extends hm{constructor(t,e,n){super(new Uint8Array(t),e,n)}},Uint8ClampedBufferAttribute:class extends hm{constructor(t,e,n){super(new Uint8ClampedArray(t),e,n)}},Uniform:kw,UniformsGroup:class extends Wd{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:Uw++}),this.name="",this.usage=Nd,this.uniforms=[]}add(t){return this.uniforms.push(t),this}remove(t){const e=this.uniforms.indexOf(t);return-1!==e&&this.uniforms.splice(e,1),this}setName(t){return this.name=t,this}setUsage(t){return this.usage=t,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(t){this.name=t.name,this.usage=t.usage;const e=t.uniforms;this.uniforms.length=0;for(let t=0,n=e.length;t<n;t++){const n=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0;t<n.length;t++)this.uniforms.push(n[t].clone())}return this}clone(){return(new this.constructor).copy(this)}},UniformsLib:pg,UniformsUtils:jm,UnsignedByteType:_u,UnsignedInt248Type:Au,UnsignedIntType:xu,UnsignedShort4444Type:Mu,UnsignedShort5551Type:Tu,UnsignedShortType:yu,VSMShadowMap:3,Vector2:np,Vector3:Ip,Vector4:Ap,VectorKeyframeTrack:TS,VideoTexture:class extends Tp{constructor(t,e,n,i,r,o,s,a,l){super(t,e,n,i,r,o,s,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==o?o:mu,this.magFilter=void 0!==r?r:mu,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)})}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},WebGL1Renderer:K_,WebGL3DRenderTarget:class extends Cp{constructor(t=1,e=1,n=1,i={}){super(t,e,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Pp(null,t,e,n),this.texture.isRenderTargetTexture=!0}},WebGLArrayRenderTarget:class extends Cp{constructor(t=1,e=1,n=1,i={}){super(t,e,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Rp(null,t,e,n),this.texture.isRenderTargetTexture=!0}},WebGLCoordinateSystem:zd,WebGLCubeRenderTarget:eg,WebGLMultipleRenderTargets:class extends Cp{constructor(t=1,e=1,n=1,i={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(t,e,{...i,count:n}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}},WebGLRenderTarget:Cp,WebGLRenderer:Z_,WebGLUtils:F_,WebGPUCoordinateSystem:Hd,WireframeGeometry:qx,WrapAroundEnding:gd,ZeroCurvatureEnding:fd,ZeroFactor:200,ZeroSlopeEnding:md,ZeroStencilOp:0,_SRGBAFormat:Fd,createCanvasElement:cp});class cM extends LS{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new kS(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(n){try{e(r.parse(n))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}},n,i)}parse(t){function e(t,e,n){for(let i=0,r=t.length;i<r;i++)if(t[i]!==e.getUint8(n+i))return!1;return!0}const n=function(t){if("string"==typeof t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=255&t.charCodeAt(n);return e.buffer||e}return t}(t);return function(t){const n=new DataView(t);if(84+50*n.getUint32(80,!0)===n.byteLength)return!0;const i=[115,111,108,105,100];for(let t=0;t<5;t++)if(e(i,n,t))return!1;return!0}(n)?function(t){const e=new DataView(t),n=e.getUint32(80,!0);let i,r,o,s,a,l,c,h,u=!1;for(let t=0;t<70;t++)1129270351==e.getUint32(t,!1)&&82==e.getUint8(t+4)&&61==e.getUint8(t+5)&&(u=!0,s=new Float32Array(3*n*3),a=e.getUint8(t+6)/255,l=e.getUint8(t+7)/255,c=e.getUint8(t+8)/255,h=e.getUint8(t+9)/255);const d=new xm,p=new Float32Array(3*n*3),f=new Float32Array(3*n*3),m=new Jf;for(let t=0;t<n;t++){const n=84+50*t,h=e.getFloat32(n,!0),d=e.getFloat32(n+4,!0),g=e.getFloat32(n+8,!0);if(u){const t=e.getUint16(n+48,!0);32768&t?(i=a,r=l,o=c):(i=(31&t)/31,r=(t>>5&31)/31,o=(t>>10&31)/31)}for(let a=1;a<=3;a++){const l=n+12*a,c=3*t*3+3*(a-1);p[c]=e.getFloat32(l,!0),p[c+1]=e.getFloat32(l+4,!0),p[c+2]=e.getFloat32(l+8,!0),f[c]=h,f[c+1]=d,f[c+2]=g,u&&(m.set(i,r,o).convertSRGBToLinear(),s[c]=m.r,s[c+1]=m.g,s[c+2]=m.b)}}return d.setAttribute("position",new hm(p,3)),d.setAttribute("normal",new hm(f,3)),u&&(d.setAttribute("color",new hm(s,3)),d.hasColors=!0,d.alpha=h),d}(n):function(t){const e=new xm,n=/solid([\s\S]*?)endsolid/g,i=/facet([\s\S]*?)endfacet/g,r=/solid\s(.+)/;let o=0;const s=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,a=new RegExp("vertex"+s+s+s,"g"),l=new RegExp("normal"+s+s+s,"g"),c=[],h=[],u=[],d=new Ip;let p,f=0,m=0,g=0;for(;null!==(p=n.exec(t));){m=g;const t=p[0],n=null!==(p=r.exec(t))?p[1]:"";for(u.push(n);null!==(p=i.exec(t));){let t=0,e=0;const n=p[0];for(;null!==(p=l.exec(n));)d.x=parseFloat(p[1]),d.y=parseFloat(p[2]),d.z=parseFloat(p[3]),e++;for(;null!==(p=a.exec(n));)c.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),h.push(d.x,d.y,d.z),t++,g++;1!==e&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+o),3!==t&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+o),o++}const s=m,v=g-m;e.userData.groupNames=u,e.addGroup(s,v,f),f++}return e.setAttribute("position",new pm(c,3)),e.setAttribute("normal",new pm(h,3)),e}("string"!=typeof(i=t)?(new TextDecoder).decode(i):i);var i}}class hM extends Df{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new np(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)})})}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}const uM=new Ip,dM=new cf,pM=new cf,fM=new Ip,mM=new Ip;class gM{constructor(t={}){const e=this;let n,i,r,o;const s={objects:new WeakMap},a=void 0!==t.element?t.element:document.createElement("div");function l(t,n,i){if(t.isCSS2DObject){uM.setFromMatrixPosition(t.matrixWorld),uM.applyMatrix4(pM);const l=!0===t.visible&&uM.z>=-1&&uM.z<=1&&!0===t.layers.test(i.layers);if(t.element.style.display=!0===l?"":"none",!0===l){t.onBeforeRender(e,n,i);const s=t.element;s.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(uM.x*r+r)+"px,"+(-uM.y*o+o)+"px)",s.parentNode!==a&&a.appendChild(s),t.onAfterRender(e,n,i)}const h={distanceToCameraSquared:c(i,t)};s.objects.set(t,h)}for(let e=0,r=t.children.length;e<r;e++)l(t.children[e],n,i)}function c(t,e){return fM.setFromMatrixPosition(t.matrixWorld),mM.setFromMatrixPosition(e.matrixWorld),fM.distanceToSquared(mM)}a.style.overflow="hidden",this.domElement=a,this.getSize=function(){return{width:n,height:i}},this.render=function(t,e){!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),dM.copy(e.matrixWorldInverse),pM.multiplyMatrices(e.projectionMatrix,dM),l(t,t,e),function(t){const e=function(t){const e=[];return t.traverse(function(t){t.isCSS2DObject&&e.push(t)}),e}(t).sort(function(t,e){if(t.renderOrder!==e.renderOrder)return e.renderOrder-t.renderOrder;return s.objects.get(t).distanceToCameraSquared-s.objects.get(e).distanceToCameraSquared}),n=e.length;for(let t=0,i=e.length;t<i;t++)e[t].element.style.zIndex=n-t}(t)},this.setSize=function(t,e){n=t,i=e,r=n/2,o=i/2,a.style.width=t+"px",a.style.height=e+"px"}}}
|
|
12
|
+
/*!
|
|
13
|
+
* camera-controls
|
|
14
|
+
* https://github.com/yomotsu/camera-controls
|
|
15
|
+
* (c) 2017 @yomotsu
|
|
16
|
+
* Released under the MIT License.
|
|
17
|
+
*/const vM=1,_M=2,yM=4,bM=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),xM=0,SM=1,wM=-1;function MM(t){return t.isPerspectiveCamera}function TM(t){return t.isOrthographicCamera}const AM=2*Math.PI,EM=Math.PI/2,CM=Math.PI/180;function RM(t,e,n){return Math.max(e,Math.min(n,t))}function PM(t,e=1e-5){return Math.abs(t)<e}function LM(t,e,n=1e-5){return PM(t-e,n)}function IM(t,e){return Math.round(t/e)*e}function OM(t){return isFinite(t)?t:t<0?-Number.MAX_VALUE:Number.MAX_VALUE}function kM(t){return Math.abs(t)<Number.MAX_VALUE?t:t*(1/0)}function UM(t,e,n,i,r=1/0,o){const s=2/(i=Math.max(1e-4,i)),a=s*o,l=1/(1+a+.48*a*a+.235*a*a*a);let c=t-e;const h=e,u=r*i;c=RM(c,-u,u),e=t-c;const d=(n.value+s*c)*o;n.value=(n.value-s*d)*l;let p=e+(c+d)*l;return h-t>0==p>h&&(p=h,n.value=(p-h)/o),p}function DM(t,e,n,i,r=1/0,o,s){const a=2/(i=Math.max(1e-4,i)),l=a*o,c=1/(1+l+.48*l*l+.235*l*l*l);let h=e.x,u=e.y,d=e.z,p=t.x-h,f=t.y-u,m=t.z-d;const g=h,v=u,_=d,y=r*i,b=p*p+f*f+m*m;if(b>y*y){const t=Math.sqrt(b);p=p/t*y,f=f/t*y,m=m/t*y}h=t.x-p,u=t.y-f,d=t.z-m;const x=(n.x+a*p)*o,S=(n.y+a*f)*o,w=(n.z+a*m)*o;n.x=(n.x-a*x)*c,n.y=(n.y-a*S)*c,n.z=(n.z-a*w)*c,s.x=h+(p+x)*c,s.y=u+(f+S)*c,s.z=d+(m+w)*c;const M=g-t.x,T=v-t.y,A=_-t.z;return M*(s.x-g)+T*(s.y-v)+A*(s.z-_)>0&&(s.x=g,s.y=v,s.z=_,n.x=(s.x-g)/o,n.y=(s.y-v)/o,n.z=(s.z-_)/o),s}function NM(t,e){e.set(0,0),t.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=t.length,e.y/=t.length}function BM(t,e){return!!TM(t)&&(console.warn(`${e} is not supported in OrthographicCamera`),!0)}class FM{constructor(){this._listeners={}}addEventListener(t,e){const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}removeAllEventListeners(t){t?Array.isArray(this._listeners[t])&&(this._listeners[t].length=0):this._listeners={}}dispatchEvent(t){const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t)}}}var zM;const HM=1/8,WM=/Mac/.test(null===(zM=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===zM?void 0:zM.platform);let VM,GM,jM,XM,$M,YM,qM,ZM,KM,JM,QM,tT,eT,nT,iT,rT,oT,sT,aT,lT,cT,hT,uT;class dT extends FM{static install(t){VM=t.THREE,GM=Object.freeze(new VM.Vector3(0,0,0)),jM=Object.freeze(new VM.Vector3(0,1,0)),XM=Object.freeze(new VM.Vector3(0,0,1)),$M=new VM.Vector2,YM=new VM.Vector3,qM=new VM.Vector3,ZM=new VM.Vector3,KM=new VM.Vector3,JM=new VM.Vector3,QM=new VM.Vector3,tT=new VM.Vector3,eT=new VM.Vector3,nT=new VM.Vector3,iT=new VM.Spherical,rT=new VM.Spherical,oT=new VM.Box3,sT=new VM.Box3,aT=new VM.Sphere,lT=new VM.Quaternion,cT=new VM.Quaternion,hT=new VM.Matrix4,uT=new VM.Raycaster}static get ACTION(){return bM}set verticalDragToForward(t){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(t,e){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=bM.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=xM,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new VM.Vector3,this._focalOffsetVelocity=new VM.Vector3,this._zoomVelocity={value:0},this._truckInternal=(t,e,n,i)=>{let r,o;if(MM(this._camera)){const n=YM.copy(this._camera.position).sub(this._target),i=this._camera.getEffectiveFOV()*CM,s=n.length()*Math.tan(.5*i);r=this.truckSpeed*t*s/this._elementRect.height,o=this.truckSpeed*e*s/this._elementRect.height}else{if(!TM(this._camera))return;{const n=this._camera;r=this.truckSpeed*t*(n.right-n.left)/n.zoom/this._elementRect.width,o=this.truckSpeed*e*(n.top-n.bottom)/n.zoom/this._elementRect.height}}i?(n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(r,0,!0),this.forward(-o,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y+o,this._focalOffsetEnd.z,!0):this.truck(r,o,!0)},this._rotateInternal=(t,e)=>{const n=AM*this.azimuthRotateSpeed*t/this._elementRect.height,i=AM*this.polarRotateSpeed*e/this._elementRect.height;this.rotate(n,i,!0)},this._dollyInternal=(t,e,n)=>{const i=Math.pow(.95,-t*this.dollySpeed),r=this._sphericalEnd.radius,o=this._sphericalEnd.radius*i,s=RM(o,this.minDistance,this.maxDistance),a=s-o;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(o,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(a,!0),this._dollyToNoClamp(s,!0)):this._dollyToNoClamp(s,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?o:s)-r,this._dollyControlCoord.set(e,n)),this._lastDollyDirection=Math.sign(-t)},this._zoomInternal=(t,e,n)=>{const i=Math.pow(.95,t*this.dollySpeed),r=this._zoom,o=this._zoom*i;this.zoomTo(o,!0),this.dollyToCursor&&(this._changedZoom+=o-r,this._dollyControlCoord.set(e,n))},void 0===VM&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=(new VM.Quaternion).setFromUnitVectors(this._camera.up,jM),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=bM.NONE,this._target=new VM.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new VM.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=(new VM.Spherical).setFromVector3(YM.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new VM.Vector3,new VM.Vector3,new VM.Vector3,new VM.Vector3],this._updateNearPlaneCorners(),this._boundary=new VM.Box3(new VM.Vector3(-1/0,-1/0,-1/0),new VM.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new VM.Vector2,this.mouseButtons={left:bM.ROTATE,middle:bM.DOLLY,right:bM.TRUCK,wheel:MM(this._camera)?bM.DOLLY:TM(this._camera)?bM.ZOOM:bM.NONE},this.touches={one:bM.TOUCH_ROTATE,two:MM(this._camera)?bM.TOUCH_DOLLY_TRUCK:TM(this._camera)?bM.TOUCH_ZOOM_TRUCK:bM.NONE,three:bM.TOUCH_TRUCK};const n=new VM.Vector2,i=new VM.Vector2,r=new VM.Vector2,o=t=>{if(!this._enabled||!this._domElement)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const e=this._domElement.getBoundingClientRect(),n=t.clientX/e.width,i=t.clientY/e.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||i<this._interactiveArea.top||i>this._interactiveArea.bottom)return}const e="mouse"!==t.pointerType?null:(t.buttons&vM)===vM?vM:(t.buttons&yM)===yM?yM:(t.buttons&_M)===_M?_M:null;if(null!==e){const t=this._findPointerByMouseButton(e);t&&this._disposePointer(t)}if((t.buttons&vM)===vM&&this._lockedPointer)return;const n={pointerId:t.pointerId,clientX:t.clientX,clientY:t.clientY,deltaX:0,deltaY:0,mouseButton:e};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener("pointermove",s,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",a),this._domElement.ownerDocument.addEventListener("pointermove",s,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",a),this._isDragging=!0,u(t)},s=t=>{t.cancelable&&t.preventDefault();const e=t.pointerId,n=this._lockedPointer||this._findPointerById(e);if(n){if(n.clientX=t.clientX,n.clientY=t.clientY,n.deltaX=t.movementX,n.deltaY=t.movementY,this._state=0,"touch"===t.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(t.buttons&vM)===vM)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(t.buttons&yM)===yM&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(t.buttons&_M)===_M&&(this._state=this._state|this.mouseButtons.right);d()}},a=t=>{const e=this._findPointerById(t.pointerId);if(!e||e!==this._lockedPointer){if(e&&this._disposePointer(e),"touch"===t.pointerType)switch(this._activePointers.length){case 0:this._state=bM.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=bM.NONE;p()}};let l=-1;const c=t=>{if(!this._domElement)return;if(!this._enabled||this.mouseButtons.wheel===bM.NONE)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const e=this._domElement.getBoundingClientRect(),n=t.clientX/e.width,i=t.clientY/e.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||i<this._interactiveArea.top||i>this._interactiveArea.bottom)return}if(t.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===bM.ROTATE||this.mouseButtons.wheel===bM.TRUCK){const t=performance.now();l-t<1e3&&this._getClientRect(this._elementRect),l=t}const e=WM?-1:-3,n=1===t.deltaMode||t.ctrlKey?t.deltaY/e:t.deltaY/(10*e),i=this.dollyToCursor?(t.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,r=this.dollyToCursor?(t.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case bM.ROTATE:this._rotateInternal(t.deltaX,t.deltaY),this._isUserControllingRotate=!0;break;case bM.TRUCK:this._truckInternal(t.deltaX,t.deltaY,!1,!1),this._isUserControllingTruck=!0;break;case bM.SCREEN_PAN:this._truckInternal(t.deltaX,t.deltaY,!1,!0),this._isUserControllingTruck=!0;break;case bM.OFFSET:this._truckInternal(t.deltaX,t.deltaY,!0,!1),this._isUserControllingOffset=!0;break;case bM.DOLLY:this._dollyInternal(-n,i,r),this._isUserControllingDolly=!0;break;case bM.ZOOM:this._zoomInternal(-n,i,r),this._isUserControllingZoom=!0}this.dispatchEvent({type:"control"})},h=t=>{if(this._domElement&&this._enabled){if(this.mouseButtons.right===dT.ACTION.NONE){const e=t instanceof PointerEvent?t.pointerId:0,n=this._findPointerById(e);return n&&this._disposePointer(n),this._domElement.ownerDocument.removeEventListener("pointermove",s,{passive:!1}),void this._domElement.ownerDocument.removeEventListener("pointerup",a)}t.preventDefault()}},u=t=>{if(!this._enabled)return;NM(this._activePointers,$M),this._getClientRect(this._elementRect),n.copy($M),i.copy($M);if(this._activePointers.length>=2){const t=$M.x-this._activePointers[1].clientX,e=$M.y-this._activePointers[1].clientY,n=Math.sqrt(t*t+e*e);r.set(0,n);const o=.5*(this._activePointers[0].clientX+this._activePointers[1].clientX),s=.5*(this._activePointers[0].clientY+this._activePointers[1].clientY);i.set(o,s)}if(this._state=0,t)if("pointerType"in t&&"touch"===t.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._lockedPointer||(t.buttons&vM)!==vM||(this._state=this._state|this.mouseButtons.left),(t.buttons&yM)===yM&&(this._state=this._state|this.mouseButtons.middle),(t.buttons&_M)===_M&&(this._state=this._state|this.mouseButtons.right);else this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);(this._state&bM.ROTATE)!==bM.ROTATE&&(this._state&bM.TOUCH_ROTATE)!==bM.TOUCH_ROTATE&&(this._state&bM.TOUCH_DOLLY_ROTATE)!==bM.TOUCH_DOLLY_ROTATE&&(this._state&bM.TOUCH_ZOOM_ROTATE)!==bM.TOUCH_ZOOM_ROTATE||(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),(this._state&bM.TRUCK)!==bM.TRUCK&&(this._state&bM.SCREEN_PAN)!==bM.SCREEN_PAN&&(this._state&bM.TOUCH_TRUCK)!==bM.TOUCH_TRUCK&&(this._state&bM.TOUCH_SCREEN_PAN)!==bM.TOUCH_SCREEN_PAN&&(this._state&bM.TOUCH_DOLLY_TRUCK)!==bM.TOUCH_DOLLY_TRUCK&&(this._state&bM.TOUCH_DOLLY_SCREEN_PAN)!==bM.TOUCH_DOLLY_SCREEN_PAN&&(this._state&bM.TOUCH_ZOOM_TRUCK)!==bM.TOUCH_ZOOM_TRUCK&&(this._state&bM.TOUCH_ZOOM_SCREEN_PAN)!==bM.TOUCH_DOLLY_SCREEN_PAN||(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),(this._state&bM.DOLLY)!==bM.DOLLY&&(this._state&bM.TOUCH_DOLLY)!==bM.TOUCH_DOLLY&&(this._state&bM.TOUCH_DOLLY_TRUCK)!==bM.TOUCH_DOLLY_TRUCK&&(this._state&bM.TOUCH_DOLLY_SCREEN_PAN)!==bM.TOUCH_DOLLY_SCREEN_PAN&&(this._state&bM.TOUCH_DOLLY_OFFSET)!==bM.TOUCH_DOLLY_OFFSET&&(this._state&bM.TOUCH_DOLLY_ROTATE)!==bM.TOUCH_DOLLY_ROTATE||(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),(this._state&bM.ZOOM)!==bM.ZOOM&&(this._state&bM.TOUCH_ZOOM)!==bM.TOUCH_ZOOM&&(this._state&bM.TOUCH_ZOOM_TRUCK)!==bM.TOUCH_ZOOM_TRUCK&&(this._state&bM.TOUCH_ZOOM_SCREEN_PAN)!==bM.TOUCH_ZOOM_SCREEN_PAN&&(this._state&bM.TOUCH_ZOOM_OFFSET)!==bM.TOUCH_ZOOM_OFFSET&&(this._state&bM.TOUCH_ZOOM_ROTATE)!==bM.TOUCH_ZOOM_ROTATE||(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),(this._state&bM.OFFSET)!==bM.OFFSET&&(this._state&bM.TOUCH_OFFSET)!==bM.TOUCH_OFFSET&&(this._state&bM.TOUCH_DOLLY_OFFSET)!==bM.TOUCH_DOLLY_OFFSET&&(this._state&bM.TOUCH_ZOOM_OFFSET)!==bM.TOUCH_ZOOM_OFFSET||(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},d=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,NM(this._activePointers,$M);const t=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,e=t?-t.deltaX:i.x-$M.x,o=t?-t.deltaY:i.y-$M.y;if(i.copy($M),(this._state&bM.ROTATE)!==bM.ROTATE&&(this._state&bM.TOUCH_ROTATE)!==bM.TOUCH_ROTATE&&(this._state&bM.TOUCH_DOLLY_ROTATE)!==bM.TOUCH_DOLLY_ROTATE&&(this._state&bM.TOUCH_ZOOM_ROTATE)!==bM.TOUCH_ZOOM_ROTATE||(this._rotateInternal(e,o),this._isUserControllingRotate=!0),(this._state&bM.DOLLY)===bM.DOLLY||(this._state&bM.ZOOM)===bM.ZOOM){const t=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,e=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,i=this.dollyDragInverted?-1:1;(this._state&bM.DOLLY)===bM.DOLLY?(this._dollyInternal(i*o*HM,t,e),this._isUserControllingDolly=!0):(this._zoomInternal(i*o*HM,t,e),this._isUserControllingZoom=!0)}if((this._state&bM.TOUCH_DOLLY)===bM.TOUCH_DOLLY||(this._state&bM.TOUCH_ZOOM)===bM.TOUCH_ZOOM||(this._state&bM.TOUCH_DOLLY_TRUCK)===bM.TOUCH_DOLLY_TRUCK||(this._state&bM.TOUCH_ZOOM_TRUCK)===bM.TOUCH_ZOOM_TRUCK||(this._state&bM.TOUCH_DOLLY_SCREEN_PAN)===bM.TOUCH_DOLLY_SCREEN_PAN||(this._state&bM.TOUCH_ZOOM_SCREEN_PAN)===bM.TOUCH_ZOOM_SCREEN_PAN||(this._state&bM.TOUCH_DOLLY_OFFSET)===bM.TOUCH_DOLLY_OFFSET||(this._state&bM.TOUCH_ZOOM_OFFSET)===bM.TOUCH_ZOOM_OFFSET||(this._state&bM.TOUCH_DOLLY_ROTATE)===bM.TOUCH_DOLLY_ROTATE||(this._state&bM.TOUCH_ZOOM_ROTATE)===bM.TOUCH_ZOOM_ROTATE){const t=$M.x-this._activePointers[1].clientX,e=$M.y-this._activePointers[1].clientY,n=Math.sqrt(t*t+e*e),o=r.y-n;r.set(0,n);const s=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,a=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&bM.TOUCH_DOLLY)===bM.TOUCH_DOLLY||(this._state&bM.TOUCH_DOLLY_ROTATE)===bM.TOUCH_DOLLY_ROTATE||(this._state&bM.TOUCH_DOLLY_TRUCK)===bM.TOUCH_DOLLY_TRUCK||(this._state&bM.TOUCH_DOLLY_SCREEN_PAN)===bM.TOUCH_DOLLY_SCREEN_PAN||(this._state&bM.TOUCH_DOLLY_OFFSET)===bM.TOUCH_DOLLY_OFFSET?(this._dollyInternal(o*HM,s,a),this._isUserControllingDolly=!0):(this._zoomInternal(o*HM,s,a),this._isUserControllingZoom=!0)}(this._state&bM.TRUCK)!==bM.TRUCK&&(this._state&bM.TOUCH_TRUCK)!==bM.TOUCH_TRUCK&&(this._state&bM.TOUCH_DOLLY_TRUCK)!==bM.TOUCH_DOLLY_TRUCK&&(this._state&bM.TOUCH_ZOOM_TRUCK)!==bM.TOUCH_ZOOM_TRUCK||(this._truckInternal(e,o,!1,!1),this._isUserControllingTruck=!0),(this._state&bM.SCREEN_PAN)!==bM.SCREEN_PAN&&(this._state&bM.TOUCH_SCREEN_PAN)!==bM.TOUCH_SCREEN_PAN&&(this._state&bM.TOUCH_DOLLY_SCREEN_PAN)!==bM.TOUCH_DOLLY_SCREEN_PAN&&(this._state&bM.TOUCH_ZOOM_SCREEN_PAN)!==bM.TOUCH_ZOOM_SCREEN_PAN||(this._truckInternal(e,o,!1,!0),this._isUserControllingTruck=!0),(this._state&bM.OFFSET)!==bM.OFFSET&&(this._state&bM.TOUCH_OFFSET)!==bM.TOUCH_OFFSET&&(this._state&bM.TOUCH_DOLLY_OFFSET)!==bM.TOUCH_DOLLY_OFFSET&&(this._state&bM.TOUCH_ZOOM_OFFSET)!==bM.TOUCH_ZOOM_OFFSET||(this._truckInternal(e,o,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},p=()=>{NM(this._activePointers,$M),i.copy($M),this._dragNeedsUpdate=!1,(0===this._activePointers.length||1===this._activePointers.length&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),0===this._activePointers.length&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",s,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",a),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{this._enabled&&this._domElement&&(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",s,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",a),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",f),this._domElement.ownerDocument.addEventListener("pointerlockerror",m),this._domElement.ownerDocument.addEventListener("pointermove",s,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",a),u())},this.unlockPointer=()=>{var t,e,n;null!==this._lockedPointer&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),null===(t=this._domElement)||void 0===t||t.ownerDocument.exitPointerLock(),null===(e=this._domElement)||void 0===e||e.ownerDocument.removeEventListener("pointerlockchange",f),null===(n=this._domElement)||void 0===n||n.ownerDocument.removeEventListener("pointerlockerror",m),this.cancel()};const f=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},m=()=>{this.unlockPointer()};this._addAllEventListeners=t=>{this._domElement=t,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),this._domElement.addEventListener("pointercancel",a),this._domElement.addEventListener("wheel",c,{passive:!1}),this._domElement.addEventListener("contextmenu",h)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("pointercancel",a),this._domElement.removeEventListener("wheel",c,{passive:!1}),this._domElement.removeEventListener("contextmenu",h),this._domElement.ownerDocument.removeEventListener("pointermove",s,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",a),this._domElement.ownerDocument.removeEventListener("pointerlockchange",f),this._domElement.ownerDocument.removeEventListener("pointerlockerror",m))},this.cancel=()=>{this._state!==bM.NONE&&(this._state=bM.NONE,this._activePointers.length=0,p())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=RM(t.width,0,1),this._interactiveArea.height=RM(t.height,0,1),this._interactiveArea.x=RM(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=RM(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,n=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,n)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,n=!1){this._isUserControllingRotate=!1;const i=RM(t,this.minAzimuthAngle,this.maxAzimuthAngle),r=RM(e,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!n||LM(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&LM(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=xM,this._changedDolly=0,this._dollyToNoClamp(RM(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const e=this._collisionTest(),i=LM(e,this._spherical.radius);if(!(n>t)&&i)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,e)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const i=!e||LM(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(i)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(KM).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const n=!e||LM(this._target.x,this._targetEnd.x,this.restThreshold)&&LM(this._target.y,this._targetEnd.y,this.restThreshold)&&LM(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=RM(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const n=!e||LM(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(t,e,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,n)}truck(t,e,n=!1){this._camera.updateMatrix(),JM.setFromMatrixColumn(this._camera.matrix,0),QM.setFromMatrixColumn(this._camera.matrix,1),JM.multiplyScalar(t),QM.multiplyScalar(-e);const i=YM.copy(JM).add(QM),r=qM.copy(this._targetEnd).add(i);return this.moveTo(r.x,r.y,r.z,n)}forward(t,e=!1){YM.setFromMatrixColumn(this._camera.matrix,0),YM.crossVectors(this._camera.up,YM),YM.multiplyScalar(t);const n=qM.copy(this._targetEnd).add(YM);return this.moveTo(n.x,n.y,n.z,e)}elevate(t,e=!1){return YM.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+YM.x,this._targetEnd.y+YM.y,this._targetEnd.z+YM.z,e)}moveTo(t,e,n,i=!1){this._isUserControllingTruck=!1;const r=YM.set(t,e,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||LM(this._target.x,this._targetEnd.x,this.restThreshold)&&LM(this._target.y,this._targetEnd.y,this.restThreshold)&&LM(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,n,i=!1){const r=YM.set(t,e,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(r.x,r.y,r.z,i)}fitToBox(t,e,{cover:n=!1,paddingLeft:i=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:s=0}={}){const a=[],l=t.isBox3?oT.copy(t):oT.setFromObject(t);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const c=IM(this._sphericalEnd.theta,EM),h=IM(this._sphericalEnd.phi,EM);a.push(this.rotateTo(c,h,e));const u=YM.setFromSpherical(this._sphericalEnd).normalize(),d=lT.setFromUnitVectors(u,XM),p=LM(Math.abs(u.y),1);p&&d.multiply(cT.setFromAxisAngle(jM,c)),d.multiply(this._yAxisUpSpaceInverse);const f=sT.makeEmpty();qM.copy(l.min).applyQuaternion(d),f.expandByPoint(qM),qM.copy(l.min).setX(l.max.x).applyQuaternion(d),f.expandByPoint(qM),qM.copy(l.min).setY(l.max.y).applyQuaternion(d),f.expandByPoint(qM),qM.copy(l.max).setZ(l.min.z).applyQuaternion(d),f.expandByPoint(qM),qM.copy(l.min).setZ(l.max.z).applyQuaternion(d),f.expandByPoint(qM),qM.copy(l.max).setY(l.min.y).applyQuaternion(d),f.expandByPoint(qM),qM.copy(l.max).setX(l.min.x).applyQuaternion(d),f.expandByPoint(qM),qM.copy(l.max).applyQuaternion(d),f.expandByPoint(qM),f.min.x-=i,f.min.y-=o,f.max.x+=r,f.max.y+=s,d.setFromUnitVectors(XM,u),p&&d.premultiply(cT.invert()),d.premultiply(this._yAxisUpSpace);const m=f.getSize(YM),g=f.getCenter(qM).applyQuaternion(d);if(MM(this._camera)){const t=this.getDistanceToFitBox(m.x,m.y,m.z,n);a.push(this.moveTo(g.x,g.y,g.z,e)),a.push(this.dollyTo(t,e)),a.push(this.setFocalOffset(0,0,0,e))}else if(TM(this._camera)){const t=this._camera,i=t.right-t.left,r=t.top-t.bottom,o=n?Math.max(i/m.x,r/m.y):Math.min(i/m.x,r/m.y);a.push(this.moveTo(g.x,g.y,g.z,e)),a.push(this.zoomTo(o,e)),a.push(this.setFocalOffset(0,0,0,e))}return Promise.all(a)}fitToSphere(t,e){const n=[],i="isObject3D"in t?dT.createBoundingSphere(t,aT):aT.copy(t);if(n.push(this.moveTo(i.center.x,i.center.y,i.center.z,e)),MM(this._camera)){const t=this.getDistanceToFitSphere(i.radius);n.push(this.dollyTo(t,e))}else if(TM(this._camera)){const t=this._camera.right-this._camera.left,r=this._camera.top-this._camera.bottom,o=2*i.radius,s=Math.min(t/o,r/o);n.push(this.zoomTo(s,e))}return n.push(this.setFocalOffset(0,0,0,e)),Promise.all(n)}setLookAt(t,e,n,i,r,o,s=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=xM,this._changedDolly=0;const a=qM.set(i,r,o),l=YM.set(t,e,n);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,s||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const c=!s||LM(this._target.x,this._targetEnd.x,this.restThreshold)&&LM(this._target.y,this._targetEnd.y,this.restThreshold)&&LM(this._target.z,this._targetEnd.z,this.restThreshold)&&LM(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&LM(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&LM(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(c)}lerpLookAt(t,e,n,i,r,o,s,a,l,c,h,u,d,p=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=xM,this._changedDolly=0;const f=YM.set(i,r,o),m=qM.set(t,e,n);iT.setFromVector3(m.sub(f).applyQuaternion(this._yAxisUpSpace));const g=ZM.set(c,h,u),v=qM.set(s,a,l);rT.setFromVector3(v.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(f.lerp(g,d));const _=rT.theta-iT.theta,y=rT.phi-iT.phi,b=rT.radius-iT.radius;this._sphericalEnd.set(iT.radius+b*d,iT.phi+y*d,iT.theta+_*d),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const x=!p||LM(this._target.x,this._targetEnd.x,this.restThreshold)&&LM(this._target.y,this._targetEnd.y,this.restThreshold)&&LM(this._target.z,this._targetEnd.z,this.restThreshold)&&LM(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&LM(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&LM(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(x)}setPosition(t,e,n,i=!1){return this.setLookAt(t,e,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(t,e,n,i=!1){const r=this.getPosition(YM),o=this.setLookAt(r.x,r.y,r.z,t,e,n,i);return this._sphericalEnd.phi=RM(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,n,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,n),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const r=!i||LM(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&LM(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&LM(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(t,e,n){this._camera.updateMatrixWorld(),JM.setFromMatrixColumn(this._camera.matrixWorldInverse,0),QM.setFromMatrixColumn(this._camera.matrixWorldInverse,1),tT.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=YM.set(t,e,n),r=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);JM.multiplyScalar(o.x),QM.multiplyScalar(o.y),tT.multiplyScalar(o.z),YM.copy(JM).add(QM).add(tT),YM.z=YM.z+r,this.dollyTo(r,!1),this.setFocalOffset(-YM.x,YM.y,-YM.z,!1),this.moveTo(t,e,n,!1)}setBoundary(t){if(!t)return this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),void(this._needsUpdate=!0);this._boundary.copy(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,n,i){null!==t?(this._viewport=this._viewport||new VM.Vector4,"number"==typeof t?this._viewport.set(t,e,n,i):this._viewport.copy(t)):this._viewport=null}getDistanceToFitBox(t,e,n,i=!1){if(BM(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=t/e,o=this._camera.getEffectiveFOV()*CM,s=this._camera.aspect;return.5*((i?r>s:r<s)?e:t/s)/Math.tan(.5*o)+.5*n}getDistanceToFitSphere(t){if(BM(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const e=this._camera.getEffectiveFOV()*CM,n=2*Math.atan(Math.tan(.5*e)*this._camera.aspect),i=1<this._camera.aspect?e:n;return t/Math.sin(.5*i)}getTarget(t,e=!0){return(t&&t.isVector3?t:new VM.Vector3).copy(e?this._targetEnd:this._target)}getPosition(t,e=!0){return(t&&t.isVector3?t:new VM.Vector3).setFromSpherical(e?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(e?this._targetEnd:this._target)}getSpherical(t,e=!0){return(t||new VM.Spherical).copy(e?this._sphericalEnd:this._spherical)}getFocalOffset(t,e=!0){return(t&&t.isVector3?t:new VM.Vector3).copy(e?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%AM,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=AM),this._spherical.theta+=AM*Math.round((this._sphericalEnd.theta-this._spherical.theta)/AM)}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(t=!1){if(!LM(this._camera.up.x,this._cameraUp0.x)||!LM(this._camera.up.y,this._cameraUp0.y)||!LM(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const t=this.getPosition(YM);this.updateCameraUp(),this.setPosition(t.x,t.y,t.z)}const e=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,t),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,t),this.zoomTo(this._zoom0,t)];return Promise.all(e)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,jM),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const t=YM.subVectors(this._target,this._camera.position).normalize(),e=qM.crossVectors(t,this._camera.up);this._camera.up.crossVectors(e,t).normalize(),this._camera.updateMatrixWorld();const n=this.getPosition(YM);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(t){const e=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,i=this._sphericalEnd.radius-this._spherical.radius,r=eT.subVectors(this._targetEnd,this._target),o=nT.subVectors(this._focalOffsetEnd,this._focalOffset),s=this._zoomEnd-this._zoom;if(PM(e))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const e=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=UM(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,e,1/0,t),this._needsUpdate=!0}if(PM(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const e=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=UM(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,e,1/0,t),this._needsUpdate=!0}if(PM(i))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const e=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=UM(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,e,this.maxSpeed,t),this._needsUpdate=!0}if(PM(r.x)&&PM(r.y)&&PM(r.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const e=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;DM(this._target,this._targetEnd,this._targetVelocity,e,this.maxSpeed,t,this._target),this._needsUpdate=!0}if(PM(o.x)&&PM(o.y)&&PM(o.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const e=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;DM(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,e,this.maxSpeed,t,this._focalOffset),this._needsUpdate=!0}if(PM(s))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const e=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=UM(this._zoom,this._zoomEnd,this._zoomVelocity,e,1/0,t)}if(this.dollyToCursor)if(MM(this._camera)&&0!==this._changedDolly){const t=this._spherical.radius-this._lastDistance,e=this._camera,n=this._getCameraDirection(KM),i=YM.copy(n).cross(e.up).normalize();0===i.lengthSq()&&(i.x=1);const r=qM.crossVectors(i,n),o=this._sphericalEnd.radius*Math.tan(e.getEffectiveFOV()*CM*.5),s=(this._sphericalEnd.radius-t-this._sphericalEnd.radius)/this._sphericalEnd.radius,a=ZM.copy(this._targetEnd).add(i.multiplyScalar(this._dollyControlCoord.x*o*e.aspect)).add(r.multiplyScalar(this._dollyControlCoord.y*o)),l=YM.copy(this._targetEnd).lerp(a,s),c=this._lastDollyDirection===SM&&this._spherical.radius<=this.minDistance,h=this._lastDollyDirection===wM&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(c||h)){this._sphericalEnd.radius-=t,this._spherical.radius-=t;const e=qM.copy(n).multiplyScalar(-t);l.add(e)}this._boundary.clampPoint(l,l);const u=qM.subVectors(l,this._targetEnd);this._targetEnd.copy(l),this._target.add(u),this._changedDolly-=t,PM(this._changedDolly)&&(this._changedDolly=0)}else if(TM(this._camera)&&0!==this._changedZoom){const t=this._zoom-this._lastZoom,e=this._camera,n=YM.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(e.near+e.far)/(e.near-e.far)).unproject(e),i=qM.set(0,0,-1).applyQuaternion(e.quaternion),r=ZM.copy(n).add(i.multiplyScalar(-n.dot(e.up))),o=-(this._zoom-t-this._zoom)/this._zoom,s=this._getCameraDirection(KM),a=this._targetEnd.dot(s),l=YM.copy(this._targetEnd).lerp(r,o),c=l.dot(s),h=s.multiplyScalar(c-a);l.sub(h),this._boundary.clampPoint(l,l);const u=qM.subVectors(l,this._targetEnd);this._targetEnd.copy(l),this._target.add(u),this._changedZoom-=t,PM(this._changedZoom)&&(this._changedZoom=0)}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const a=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,a),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target);(!PM(this._focalOffset.x)||!PM(this._focalOffset.y)||!PM(this._focalOffset.z))&&(JM.setFromMatrixColumn(this._camera.matrix,0),QM.setFromMatrixColumn(this._camera.matrix,1),tT.setFromMatrixColumn(this._camera.matrix,2),JM.multiplyScalar(this._focalOffset.x),QM.multiplyScalar(-this._focalOffset.y),tT.multiplyScalar(this._focalOffset.z),YM.copy(JM).add(QM).add(tT),this._camera.position.add(YM),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),YM.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const l=this._needsUpdate;return l&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):l?(this.dispatchEvent({type:"update"}),PM(e,this.restThreshold)&&PM(n,this.restThreshold)&&PM(i,this.restThreshold)&&PM(r.x,this.restThreshold)&&PM(r.y,this.restThreshold)&&PM(r.z,this.restThreshold)&&PM(o.x,this.restThreshold)&&PM(o.y,this.restThreshold)&&PM(o.z,this.restThreshold)&&PM(s,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!l&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=l,this._needsUpdate=!1,l}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:OM(this.maxDistance),minZoom:this.minZoom,maxZoom:OM(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:OM(this.maxPolarAngle),minAzimuthAngle:OM(this.minAzimuthAngle),maxAzimuthAngle:OM(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:YM.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(t,e=!1){const n=JSON.parse(t);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=kM(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=kM(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=kM(n.maxPolarAngle),this.minAzimuthAngle=kM(n.minAzimuthAngle),this.maxAzimuthAngle=kM(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],e),iT.setFromVector3(YM.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(iT.theta,iT.phi,e),this.dollyTo(iT.radius,e),this.zoomTo(n.zoom,e),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],e),this._needsUpdate=!0}connect(t){this._domElement?console.warn("camera-controls is already connected."):(t.setAttribute("data-camera-controls-version","2.10.1"),this._addAllEventListeners(t),this._getClientRect(this._elementRect))}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(t){return t.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(t){return this._getTargetDirection(t).negate()}_findPointerById(t){return this._activePointers.find(e=>e.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,n){const i=e.lengthSq();if(0===i)return t;const r=qM.copy(e).add(t),o=this._boundary.clampPoint(r,ZM).sub(r),s=o.lengthSq();if(0===s)return t.add(e);if(s===i)return t;if(0===n)return t.add(e).add(o);{const i=1+n*s/e.dot(o);return t.add(qM.copy(e).multiplyScalar(i)).add(o.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(MM(this._camera)){const t=this._camera,e=t.near,n=t.getEffectiveFOV()*CM,i=Math.tan(.5*n)*e,r=i*t.aspect;this._nearPlaneCorners[0].set(-r,-i,0),this._nearPlaneCorners[1].set(r,-i,0),this._nearPlaneCorners[2].set(r,i,0),this._nearPlaneCorners[3].set(-r,i,0)}else if(TM(this._camera)){const t=this._camera,e=1/t.zoom,n=t.left*e,i=t.right*e,r=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(n,r,0),this._nearPlaneCorners[1].set(i,r,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(n,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1))return t;if(BM(this._camera,"_collisionTest"))return t;const e=this._getTargetDirection(KM);hT.lookAt(GM,e,this._camera.up);for(let n=0;n<4;n++){const i=qM.copy(this._nearPlaneCorners[n]);i.applyMatrix4(hT);const r=ZM.addVectors(this._target,i);uT.set(r,e),uT.far=this._spherical.radius+1;const o=uT.intersectObjects(this.colliderMeshes);0!==o.length&&o[0].distance<t&&(t=o[0].distance)}return t}_getClientRect(t){if(!this._domElement)return;const e=this._domElement.getBoundingClientRect();return t.x=e.left,t.y=e.top,this._viewport?(t.x+=this._viewport.x,t.y+=e.height-this._viewport.w-this._viewport.y,t.width=this._viewport.z,t.height=this._viewport.w):(t.width=e.width,t.height=e.height),t}_createOnRestPromise(t){return t?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const e=()=>{this.removeEventListener("rest",e),t()};this.addEventListener("rest",e)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new VM.Sphere){const n=e,i=n.center;oT.makeEmpty(),t.traverseVisible(t=>{t.isMesh&&oT.expandByObject(t)}),oT.getCenter(i);let r=0;return t.traverseVisible(t=>{if(!t.isMesh)return;const e=t;if(!e.geometry)return;const n=e.geometry.clone();n.applyMatrix4(e.matrixWorld);const o=n.attributes.position;for(let t=0,e=o.count;t<e;t++)YM.fromBufferAttribute(o,t),r=Math.max(r,i.distanceToSquared(YM))}),n.radius=Math.sqrt(r),n}}let pT=Math.PI/180,fT=180/Math.PI,mT=t=>{let e=Qs.toHexString(t);return e=e.replace("#",""),e=parseInt(e,16),e},gT=t=>{let e=(t=>{let e=gi(t,t=>{let e=(t=>{let e=(t=>{let e=t.geometry;return{cs:e.boundingSphere.center,rd:e.boundingSphere.radius}})(t);return{xmin:e.cs.x-e.rd,xmax:e.cs.x+e.rd,ymin:e.cs.y-e.rd,ymax:e.cs.y+e.rd,zmin:e.cs.z-e.rd,zmax:e.cs.z+e.rd}})(t);return e});return{xmin:Lh(gi(e,"xmin")),xmax:Ih(gi(e,"xmax")),ymin:Lh(gi(e,"ymin")),ymax:Ih(gi(e,"ymax")),zmin:Lh(gi(e,"zmin")),zmax:Ih(gi(e,"zmax"))}})(t),n=e.xmax-e.xmin,i=e.ymax-e.ymin,r=e.zmax-e.zmin;return{cs:{x:(e.xmax+e.xmin)/2,y:(e.ymax+e.ymin)/2,z:(e.zmax+e.zmin)/2},rd:Ih([n,i,r])}};async function vT(t,e={}){io(t)||(t=[]);let n=st(e,"domPanel");Yr(n)||(n=document.body);let i=t=>{let e=0;if(Jr(t.innerWidth))e=t.innerWidth;else{if(!Jr(t.clientWidth))throw console.log("ele",t),new Error("can not get width from ele");e=t.clientWidth}let n=0;if(Jr(t.innerWidth))n=t.innerHeight;else{if(!Jr(t.clientWidth))throw console.log("ele",t),new Error("can not get height from ele");n=t.clientHeight}return{w:e,h:n}},r=i(n),o=r.w,s=r.h,a=st(e,"backgroundColor");Ae(a)||(a="#222");let l=st(e,"useHelperAxes");Kr(l)||(l=!0);let c=st(e,"helperAxesType");Fe(c)||(c=5),c=ze(c);let h=st(e,"useHelperGrid");Kr(h)||(h=!0);let u=st(e,"helperGridSize");Fe(u)||(u=5),u=ze(u);let d=st(e,"helperGridDivisions");Fe(d)||(d=50),d=ze(d);let p=st(e,"helperGridPosratZ");Fe(p)||(p=-1),p=ze(p);let f=st(e,"useLightAmbient");Kr(f)||(f=!0);let m=st(e,"lightAmbientColor");Ae(m)||(m="#999");let g=st(e,"useLightPoint");Kr(g)||(g=!1);let v=st(e,"lightPointPoss");io(v)||(v=[[5,5,5],[-5,5,5],[5,-5,5]]);let _=st(e,"lightPointColor");Ae(_)||(_="#fff");let y=st(e,"lightPointIntensity");Fe(y)||(y=100),y=ze(y);let b=st(e,"lightPointDistance");Fe(b)||(b=0),b=ze(b);let x=st(e,"lightPointDecay");Fe(x)||(x=2),x=ze(x);let S=st(e,"useLightDirection");Kr(S)||(S=!0);let w=st(e,"lightDirectionColor");Ae(w)||(w="#fff");let M=st(e,"lightDirectionIntensity");Fe(M)||(M=3),M=ze(M);let T=st(e,"lightDirectionPos");io(T)||(T=[10,10,10]);let A=st(e,"cameraType");"perspective"!==A&&"orthographic"!==A&&(A="perspective");let E=st(e,"cameraFov");Fe(E)||(E=30),E=ze(E);let C=st(e,"cameraNear");Fe(C)||(C=.1),C=ze(C);let R=st(e,"cameraFar");Fe(R)||(R=1e3),R=ze(R);let P=st(e,"cameraOrthographicRatio");Fe(P)||(P=.5),P=ze(P);let L=st(e,"cameraPos");io(L)||(L=[1,1.3,1]);let I=st(e,"labelColor");Ae(I)||(I="#fff");let O=st(e,"labelFontFamily");Ae(O)||(O="Microsoft JhengHei");let k=st(e,"labelFontSize");Ae(k)||(k="0.8rem");let U=st(e,"useAutoRotate");Kr(U)||(U=!1);let D=st(e,"autoRotateDir");"clockwise"!==D&&"counterclockwise"!==D&&(D="counterclockwise");let N=st(e,"autoRotateDeg");Fe(N)||(N=20),N=ze(N);let B=Pr(),F=new pw,z=new ty;z.background=new Jf(mT(a));let H=null;l&&(H=new aM(c),z.add(H));let W=null;if(h&&(W=new Zw(u,d),W.geometry.rotateX(.5*Math.PI),W.geometry.translate(0,0,p),z.add(W)),f){let t=new KS(mT(m));z.add(t)}if(g&&Me(v,t=>{let e=new YS(mT(_),y,b,x),n=st(t,0,0),i=st(t,1,0),r=st(t,2,0);e.position.set([n,i,r]),z.add(e)}),S){let t=new ZS(mT(w),M),e=st(T,0,0),n=st(T,1,0),i=st(T,2,0);t.position.set(e,n,i),z.add(t)}let V,G=(t,e)=>{let n=1;return e>0&&(n=t/e),n},j=G(o,s);if("perspective"===A)V=new Km(E,j,C,R);else if("orthographic"===A){V=new Mg(-P*j,P*j,P,-P,C,R)}{let t=st(L,0,0),e=st(L,1,0),n=st(L,2,0);V.position.set(t,e,n)}V.up.x=0,V.up.y=0,V.up.z=1;let X=new Z_({antialias:!0});X.setSize(o,s),n.appendChild(X.domElement);let $=new gM;$.setSize(o,s),$.domElement.style.position="absolute",$.domElement.style.top="0px",$.domElement.style.left="0px",n.appendChild($.domElement),dT.install({THREE:lM});let Y=new dT(V,$.domElement);Y.mouseButtons={left:dT.ACTION.ROTATE,middle:dT.ACTION.DOLLY,right:dT.ACTION.OFFSET,wheel:dT.ACTION.ZOOM},Y.touches={one:dT.ACTION.TOUCH_ROTATE,two:dT.ACTION.TOUCH_DOLLY_OFFSET,three:dT.ACTION.TOUCH_OFFSET};let q=[];await Bl(t,async t=>{let e=await(async(t,e,n={})=>{let i=st(n,"color",null);Ae(i)||(i="#fff");let r=st(n,"opacity",null);Jr(r)||(r=1);let o=r<1,s=new cM,a=await s.loadAsync(e,e=>{let n=e.loaded/e.total*100;t.emit("loading",n)}),l=new oS({color:mT(i),depthTest:!0,depthWrite:!0,transparent:o,opacity:r,side:2});return new Fm(a,l)})(B,t.url,{color:st(t,"color",""),opacity:st(t,"opacity",1)});e.name=t.name,q.push(e)}),console.log("meshs",q);let Z=new H_;Me(q,t=>{Z.add(t)}),z.add(Z),setTimeout(()=>{let t=gT(q),e=t.cs,n=1;t.rd>0&&(n=1/t.rd),Me(q,t=>{let i=t.geometry;i.translate(-e.x,-e.y,-e.z),i.scale(n,n,n);let r=document.createElement("div");r.className="label",r.textContent=t.name,r.style.color=I,r.style.fontFamily=O,r.style.fontSize=k;let o=new hM(r),s=t.geometry.boundingSphere.center;o.position.set(s.x,s.y,s.z),t.add(o)})},1);let K=()=>{try{X.render(z,V),$.render(z,V)}catch(t){console.log(t)}};K(),setTimeout(()=>{K()},100);let J=!1,Q=()=>{if(!J)try{let t=F.getDelta(),e=Y.update(t);if(U){let e=("clockwise"===D?1:-1)*N*pT*t;Y.azimuthAngle+=e}requestAnimationFrame(Q),e&&K()}catch(t){console.log(t)}};Q();return B.render=K,B.resize=()=>{let t=i(n);o=t.w,s=t.h,j=G(o,s),V.aspect=j,V.updateProjectionMatrix(),X.setSize(o,s),$.setSize(o,s),K()},B.dispose=()=>{let t=t=>{t.dispose();for(let e of Object.keys(t)){let n=t[e];n&&"object"==typeof n&&"minFilter"in n&&n.dispose()}};J=!0,Z.traverse(function(t){t.isMesh&&(t.geometry.dispose(),t.material.dispose())}),z.remove(Z),Z=null,l&&(z.remove(H),H.dispose(),H=null),h&&(z.remove(W),W.dispose(),W=null),z.traverse(e=>{if(e.isLight&&e.dispose(),e.isMesh)if(e.geometry.dispose(),e.material.isMaterial)t(e.material);else for(let n of e.material)t(n)}),qr(X.domElement),qr($.domElement),X.dispose(),X=null,$=null,F=null,Y=null,V=null,z=null},B.setUseAutoRotate=t=>{U=t},B.getMeshsInfor=()=>{let t=gi(q,t=>{let e={r:255*st(t,"material.color.r",0),g:255*st(t,"material.color.g",0),b:255*st(t,"material.color.b",0)},n=Qs.toRgbString(e),i=st(t,"material.opacity",1);return{name:t.name,visible:t.visible,color:n,opacity:i}});return t},B.setMeshVisible=(t,e)=>{if(!Hr(st(q,t)))return null;try{q[t].visible=e}catch(t){console.log(t)}},B.setMeshColor=(t,e)=>{if(!Hr(st(q,t)))return null;try{q[t].material.color.setHex(mT(e))}catch(t){console.log(t)}},B.setViewAngle=(t,e)=>{Rh(Y,"azimuthAngle",t*pT),Rh(Y,"polarAngle",e*pT)},B.getViewAngle=()=>{let t=st(Y,"azimuthAngle"),e=st(Y,"polarAngle");return{azimuthAngle:t*fT,polarAngle:e*fT}},B}const _T={directives:{domresize:Ir()},components:{},props:{options:{type:Object,default:()=>{}},width:{type:Number,default:400},height:{type:Number,default:400}},data:function(){return{ev:null}},beforeDestroy:function(){this.dispose()},computed:{changeOptions:function(){return this.plot(),""},widthInp:function(){let t=this.width,e=st(this,"options.width","");return Fe(e)&&(t=ze(e)),t},heightInp:function(){let t=this.height,e=st(this,"options.height","");return Fe(e)&&(t=ze(e)),t}},methods:{updatePanel:function(t){let e=this;if(null===e.ev)return;let n=st(e,"ev.resize");Lr(n)&&(n(),e.$emit("resize",t))},plot:function(){let t=this;(async function(){t.dispose(),await zl(()=>Yr(t.$refs.panel));let e=st(t,"options.items",[]),n={...t.options,domPanel:t.$refs.panel},i=await vT(e,n);i.on("loading",e=>{t.$emit("loading",e)}),t.ev=i,setTimeout(()=>{console.log("ev.getMeshsInfor()",i.getMeshsInfor())},1e3)})().catch(t=>{console.log(t)})},dispose:function(){let t=this;setTimeout(()=>{if(null===t.ev)return;Lr(st(t,"ev.dispose"))&&(t.ev.dispose(),t.ev=null)},1)}}};var yT=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{style:"display:inline-block; width:"+t.widthInp+"px; min-width:"+t.widthInp+"px; height:"+t.heightInp+"px; overflow-y:hidden;",attrs:{changeOptions:t.changeOptions}},[n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],ref:"panel",style:"position:relative; width:"+t.widthInp+"px; height:"+t.heightInp+"px;",on:{domresize:t.updatePanel}})])};yT._withStripped=!0;const bT={components:{demolink:Nl,WPlot3d:oo({render:yT,staticRenderFns:[]},function(t){t&&t("data-v-4be063f9_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WPlot3d.vue"},media:void 0})},_T,"data-v-4be063f9",false,void 0,!1,ao,void 0,void 0)},props:{},data:function(){return{WPlot3d:{option1:{width:600,height:600,items:[{url:"./topo_surface.stl",name:"Surface",color:"#d65c5c",opacity:.9},{url:"./A.stl",name:"A",color:"#d6d65c",opacity:.9},{url:"./B.stl",name:"B",color:"#5cd65c",opacity:.9},{url:"./C.stl",name:"C",color:"#5cd6d6",opacity:.9},{url:"./D.stl",name:"D",color:"#5c5cd6",opacity:.9},{url:"./E.stl",name:"E",color:"#d65cd6",opacity:.9}]}}}},methods:{}};var xT=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"bkh"},[t._m(0),t._v(" "),n("div",{staticStyle:{padding:"0px"}},[n("div",{staticClass:"bk"},[n("demolink",{attrs:{kbname:"w-plot-3d",casename:"default"}}),t._v(" "),n("w-plot-3d",{attrs:{options:t.WPlot3d.option1}})],1)])])};xT._withStripped=!0;let ST=t=>{let e=Ft(t);return"2-d"===Ye(e,3)?e=Ze(e,3)+"2d":"3-d"===Ye(e,3)&&(e=Ze(e,3)+"3d"),e};const wT={components:{WListHorizontal:xo,AppZoneWPlot2d:ic,AppZoneWBar:wc,AppZoneWPie:Lc,AppZoneWRose:Fc,AppZoneWSetOne:Th,AppZoneWSetMulti:Ch,AppZoneWPlot3d:oo({render:xT,staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"head1"},[n("span",{staticStyle:{cursor:"pointer"},attrs:{title:"open for copy link to view component",onclick:"window.open('//yuda-lyu.github.io/w-geo-vue/examples/app.html?cmp='+this.innerText,'_blank')"}},[t._v("w-plot-3d")])])}]},function(t){t&&t("data-v-65b3fbbe_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"AppZoneWPlot3d.vue"},media:void 0})},bT,"data-v-65b3fbbe",false,void 0,!1,ao,void 0,void 0)},data:function(){return{kebabCaseFix:ST,cmpsL1:[{name:"2d",cmps:[{name:"basic",cmps:[{name:"WPlot2d"},{name:"WBar"},{name:"WPie"},{name:"WRose"}]},{name:"set",cmps:[{name:"WSetOne"},{name:"WSetMulti"}]}]}],indP1:null,cmpP1:null,cmpsL2:null,indP2:null,cmpP2:null,cmpsL3:null,indP3:null,cmpP3:null,cmpsL4:null,cmpPick:""}},mounted:function(){let t=this;t.indP1=0,t.indP2=0,t.indP3=0;let e=bi(location.href);t.viewPick(st(e,"cmp",""))},computed:{changeMenus:function(){let t=this;return t.modifyMenus(t.indP1,t.indP2,t.indP3),""},isNarrow:function(){return window.innerWidth<1e3}},methods:{modifyMenus:function(){let t=this,e="";setTimeout(()=>{t.cmpP1=st(t.cmpsL1,t.indP1,{}),t.cmpsL2=st(t.cmpP1,"cmps",[]);let n=st(t.cmpP1,"name","");n&&(e=n)},50),setTimeout(()=>{let n=st(t.cmpP1,"cmps",[]);t.cmpP2=st(n,t.indP2,{}),t.cmpsL3=st(t.cmpP2,"cmps",[]);let i=st(t.cmpP2,"name","");i&&(e=i)},100),setTimeout(()=>{let n=st(t.cmpP2,"cmps",[]);t.cmpP3=st(n,t.indP3,{}),t.cmpsL4=st(t.cmpP3,"cmps",[]);let i=st(t.cmpP3,"name","");i&&(e=i),t.cmpPick=e},150)},getInd:function(t,e){let n=-1;return Me(e,(e,i)=>{if(t.name===e.name)return n=i,!1}),n},viewPick:function(t){let e=this,n=ST(t),i="",r=[],o=t=>{Me(t,(t,e)=>{r.push(e);let s=st(t,"name",""),a=ST(s),l=st(t,"cmps",[]);r.join("."),a===n&&(i=JSON.parse(JSON.stringify(r))),l.length>0&&o(l),r.pop()})};o(e.cmpsL1),e.indP1=st(i,0,0),e.indP2=st(i,1,0),e.indP3=st(i,2,0)}}};var MT=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{changeMenus:t.changeMenus}},[t.isNarrow?t._e():[n("a",{staticClass:"github-corner",staticStyle:{position:"fixed",top:"0",right:"0",border:"0","z-index":"10000"},attrs:{href:"https://github.com/yuda-lyu/w-plot-vue","aria-label":"View source on GitHub",target:"_blank",rel:"noreferrer noopener"}},[n("svg",{staticStyle:{fill:"rgba(0,0,0,0.25)",color:"#fff",position:"absolute",top:"0",border:"0",right:"0"},attrs:{width:"80",height:"80",viewBox:"0 0 250 250","aria-hidden":"true"}},[n("path",{attrs:{d:"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"}}),n("path",{staticClass:"octo-arm",staticStyle:{"transform-origin":"130px 106px"},attrs:{d:"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2",fill:"currentColor"}}),n("path",{staticClass:"octo-body",attrs:{d:"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z",fill:"currentColor"}})])])],t._v(" "),n("div",{staticStyle:{background:"#f5f5f5"}},[t.cmpsL1&&t.cmpsL1.length>0?n("div",{staticStyle:{width:"calc( 100vw - 20px )","overflow-x":"auto"}},[n("WListHorizontal",{attrs:{items:t.cmpsL1,itemActive:t.cmpP1,itemBackgroundColor:"transparent",itemBackgroundColorHover:"#eee",itemBackgroundColorActive:"#eee",keyText:"name",paddingStyle:{v:12,h:20}},on:{"update:itemActive":[function(e){t.cmpP1=e},function(e){t.indP3=0,t.indP2=0,t.indP1=t.getInd(e,t.cmpsL1)}],"update:item-active":function(e){t.cmpP1=e}},scopedSlots:t._u([{key:"item",fn:function(e){return[n("div",{},[t._v("\n "+t._s(t.kebabCaseFix(e.item.name))+"\n ")])]}}],null,!1,3901629136)}),t._v(" "),n("div",{staticStyle:{height:"1px",background:"#ddd"}})],1):t._e(),t._v(" "),t.cmpsL2&&t.cmpsL2.length>0?n("div",{staticStyle:{width:"calc( 100vw - 20px )","overflow-x":"auto"}},[n("div",{staticStyle:{height:"3px",background:"#fff"}}),t._v(" "),n("WListHorizontal",{attrs:{items:t.cmpsL2,itemActive:t.cmpP2,itemBackgroundColor:"transparent",itemBackgroundColorHover:"#eee",itemBackgroundColorActive:"#eee",keyText:"name",paddingStyle:{v:12,h:20}},on:{"update:itemActive":[function(e){t.cmpP2=e},function(e){t.indP3=0,t.indP2=t.getInd(e,t.cmpsL2)}],"update:item-active":function(e){t.cmpP2=e}},scopedSlots:t._u([{key:"item",fn:function(e){return[n("div",{},[t._v("\n "+t._s(t.kebabCaseFix(e.item.name))+"\n ")])]}}],null,!1,3901629136)}),t._v(" "),n("div",{staticStyle:{height:"1px",background:"#ddd"}})],1):t._e(),t._v(" "),t.cmpsL3&&t.cmpsL3.length>0?n("div",{staticStyle:{width:"calc( 100vw - 20px )","overflow-x":"auto"}},[n("div",{staticStyle:{height:"3px",background:"#fff"}}),t._v(" "),n("WListHorizontal",{attrs:{items:t.cmpsL3,itemActive:t.cmpP3,itemBackgroundColor:"transparent",itemBackgroundColorHover:"#eee",itemBackgroundColorActive:"#eee",keyText:"name",paddingStyle:{v:12,h:20}},on:{"update:itemActive":[function(e){t.cmpP3=e},function(e){t.indP3=t.getInd(e,t.cmpsL3)}],"update:item-active":function(e){t.cmpP3=e}},scopedSlots:t._u([{key:"item",fn:function(e){return[n("div",{},[t._v("\n "+t._s(t.kebabCaseFix(e.item.name))+"\n ")])]}}],null,!1,3901629136)}),t._v(" "),n("div",{staticStyle:{height:"1px",background:"#ddd"}})],1):t._e()]),t._v(" "),n("div",["WPlot2d"===t.cmpPick?n("AppZoneWPlot2d"):t._e(),t._v(" "),"WBar"===t.cmpPick?n("AppZoneWBar"):t._e(),t._v(" "),"WPie"===t.cmpPick?n("AppZoneWPie"):t._e(),t._v(" "),"WRose"===t.cmpPick?n("AppZoneWRose"):t._e(),t._v(" "),"WSetOne"===t.cmpPick?n("AppZoneWSetOne"):t._e(),t._v(" "),"WSetMulti"===t.cmpPick?n("AppZoneWSetMulti"):t._e(),t._v(" "),"WPlot3d"===t.cmpPick?n("AppZoneWPlot3d"):t._e()],1)],2)};MT._withStripped=!0;return oo({render:MT,staticRenderFns:[]},function(t){t&&t("data-v-5bde5125_0",{source:"\n.head1 {\n padding: 0px 0px 20px 0px;\n font-size: 2.5rem;\n}\n.bkh { /* 寬 */\n padding:20px;\n}\n@media screen and (max-width:800px){ /* 中 */\n.bkh {\n padding:10px;\n}\n}\n@media screen and (max-width:400px){ /* 窄 */\n.bkh {\n padding:5px;\n}\n}\n.bk { /* 寬 */\n display: inline-block;\n vertical-align: top;\n padding: 0px 80px 60px 0px;\n}\n@media screen and (max-width:1000px){ /* 中窄 */\n.bk {\n display: block;\n padding: 0px 0px 50px 0px;\n}\n}\n",map:{version:3,sources:["C:\\opensrc\\開源-JS-106-7-w-plot-vue\\w-plot-vue\\src\\App.vue"],names:[],mappings:";AAkWA;IACA,yBAAA;IACA,iBAAA;AACA;AACA,OAAA,MAAA;IACA,YAAA;AACA;AACA,qCAAA,MAAA;AACA;QACA,YAAA;AACA;AACA;AACA,qCAAA,MAAA;AACA;QACA,WAAA;AACA;AACA;AACA,MAAA,MAAA;IACA,qBAAA;IACA,mBAAA;IACA,0BAAA;AACA;AACA,sCAAA,OAAA;AACA;QACA,cAAA;QACA,yBAAA;AACA;AACA",file:"App.vue",sourcesContent:["<template>\n <div\n style=\"\"\n :changeMenus=\"changeMenus\"\n >\n\n\n <template v-if=\"!isNarrow\">\n <a href=\"https://github.com/yuda-lyu/w-plot-vue\" class=\"github-corner\" style=\"position:fixed; top:0; right:0; border:0; z-index:10000;\" aria-label=\"View source on GitHub\" target=\"_blank\" rel=\"noreferrer noopener\">\n <svg width=\"80\" height=\"80\" viewBox=\"0 0 250 250\" style=\"fill:rgba(0,0,0,0.25); color:#fff; position: absolute; top: 0; border: 0; right: 0;\" aria-hidden=\"true\"><path d=\"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z\"></path><path d=\"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2\" fill=\"currentColor\" style=\"transform-origin: 130px 106px;\" class=\"octo-arm\"></path><path d=\"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z\" fill=\"currentColor\" class=\"octo-body\"></path></svg>\n </a>\n </template>\n\n\n <div style=\"background:#f5f5f5;\">\n\n <div style=\"width:calc( 100vw - 20px ); overflow-x:auto;\" v-if=\"cmpsL1 && cmpsL1.length>0\">\n <WListHorizontal\n :items=\"cmpsL1\"\n :itemActive.sync=\"cmpP1\"\n :itemBackgroundColor=\"'transparent'\"\n :itemBackgroundColorHover=\"'#eee'\"\n :itemBackgroundColorActive=\"'#eee'\"\n :keyText=\"'name'\"\n :paddingStyle=\"{v:12,h:20}\"\n @update:itemActive=\"(v)=>{indP3=0;indP2=0;indP1=getInd(v,cmpsL1)}\"\n >\n <template v-slot:item=\"props\">\n <div style=\"\">\n {{kebabCaseFix(props.item.name)}}\n </div>\n </template>\n </WListHorizontal>\n <div style=\"height:1px; background:#ddd;\"></div>\n </div>\n\n\n <div style=\"width:calc( 100vw - 20px ); overflow-x:auto;\" v-if=\"cmpsL2 && cmpsL2.length>0\">\n <div style=\"height:3px; background:#fff;\"></div>\n <WListHorizontal\n :items=\"cmpsL2\"\n :itemActive.sync=\"cmpP2\"\n :itemBackgroundColor=\"'transparent'\"\n :itemBackgroundColorHover=\"'#eee'\"\n :itemBackgroundColorActive=\"'#eee'\"\n :keyText=\"'name'\"\n :paddingStyle=\"{v:12,h:20}\"\n @update:itemActive=\"(v)=>{indP3=0;indP2=getInd(v,cmpsL2)}\"\n >\n <template v-slot:item=\"props\">\n <div style=\"\">\n {{kebabCaseFix(props.item.name)}}\n </div>\n </template>\n </WListHorizontal>\n <div style=\"height:1px; background:#ddd;\"></div>\n </div>\n\n <div style=\"width:calc( 100vw - 20px ); overflow-x:auto;\" v-if=\"cmpsL3 && cmpsL3.length>0\">\n <div style=\"height:3px; background:#fff;\"></div>\n <WListHorizontal\n :items=\"cmpsL3\"\n :itemActive.sync=\"cmpP3\"\n :itemBackgroundColor=\"'transparent'\"\n :itemBackgroundColorHover=\"'#eee'\"\n :itemBackgroundColorActive=\"'#eee'\"\n :keyText=\"'name'\"\n :paddingStyle=\"{v:12,h:20}\"\n @update:itemActive=\"(v)=>{indP3=getInd(v,cmpsL3)}\"\n >\n <template v-slot:item=\"props\">\n <div style=\"\">\n {{kebabCaseFix(props.item.name)}}\n </div>\n </template>\n </WListHorizontal>\n <div style=\"height:1px; background:#ddd;\"></div>\n </div>\n\n </div>\n\n\n <div>\n\n <AppZoneWPlot2d v-if=\"cmpPick==='WPlot2d'\"></AppZoneWPlot2d>\n\n <AppZoneWBar v-if=\"cmpPick==='WBar'\"></AppZoneWBar>\n\n <AppZoneWPie v-if=\"cmpPick==='WPie'\"></AppZoneWPie>\n\n <AppZoneWRose v-if=\"cmpPick==='WRose'\"></AppZoneWRose>\n\n <AppZoneWSetOne v-if=\"cmpPick==='WSetOne'\"></AppZoneWSetOne>\n\n <AppZoneWSetMulti v-if=\"cmpPick==='WSetMulti'\"></AppZoneWSetMulti>\n\n <AppZoneWPlot3d v-if=\"cmpPick==='WPlot3d'\"></AppZoneWPlot3d>\n\n </div>\n\n\n </div>\n</template>\n\n<script>\nimport get from 'lodash-es/get.js'\nimport kebabCase from 'lodash-es/kebabCase.js'\nimport each from 'lodash-es/each.js'\n// import cloneDeep from 'lodash-es/cloneDeep.js'\nimport strright from 'wsemi/src/strright.mjs'\nimport strdelright from 'wsemi/src/strdelright.mjs'\nimport urlParse from 'wsemi/src/urlParse.mjs'\nimport WListHorizontal from 'w-component-vue/src/components/WListHorizontal.vue'\nimport AppZoneWPlot2d from './AppZoneWPlot2d.vue'\nimport AppZoneWBar from './AppZoneWBar.vue'\nimport AppZoneWPie from './AppZoneWPie.vue'\nimport AppZoneWRose from './AppZoneWRose.vue'\nimport AppZoneWSetOne from './AppZoneWSetOne.vue'\nimport AppZoneWSetMulti from './AppZoneWSetMulti.vue'\nimport AppZoneWPlot3d from './AppZoneWPlot3d.vue'\n\n\nlet kebabCaseFix = (c) => {\n let r = kebabCase(c)\n if (strright(r, 3) === '2-d') {\n r = strdelright(r, 3) + '2d'\n }\n else if (strright(r, 3) === '3-d') {\n r = strdelright(r, 3) + '3d'\n }\n return r\n}\n\n\nexport default {\n components: {\n WListHorizontal,\n AppZoneWPlot2d,\n AppZoneWBar,\n AppZoneWPie,\n AppZoneWRose,\n AppZoneWSetOne,\n AppZoneWSetMulti,\n AppZoneWPlot3d,\n },\n data: function() {\n let cmps = [\n {\n name: '2d',\n cmps: [\n {\n name: 'basic',\n cmps: [\n { name: 'WPlot2d', },\n { name: 'WBar', },\n { name: 'WPie', },\n { name: 'WRose', },\n ],\n },\n {\n name: 'set',\n cmps: [\n { name: 'WSetOne', },\n { name: 'WSetMulti', },\n // {\n // name: 'VTest',\n // cmps: [\n // { name: 'VTest1', },\n // { name: 'VTest2', },\n // { name: 'VTest3', },\n // ],\n // },\n ],\n },\n ],\n },\n // {\n // name: '3d',\n // cmps: [\n // { name: 'WPlot3d', },\n // ],\n // },\n ]\n return {\n kebabCaseFix,\n\n cmpsL1: cmps,\n indP1: null,\n cmpP1: null,\n\n cmpsL2: null,\n indP2: null,\n cmpP2: null,\n\n cmpsL3: null,\n indP3: null,\n cmpP3: null,\n\n cmpsL4: null,\n\n cmpPick: '',\n\n }\n },\n mounted: function() {\n let vo = this\n\n //default\n vo.indP1 = 0\n vo.indP2 = 0\n vo.indP3 = 0\n\n //urlParse, http://localhost:8080/?cmp=w-set-multi\n let p = urlParse(location.href)\n // console.log('p', p)\n\n //viewPick\n vo.viewPick(get(p, 'cmp', ''))\n\n },\n computed: {\n\n changeMenus: function() {\n let vo = this\n vo.modifyMenus(vo.indP1, vo.indP2, vo.indP3)\n return ''\n },\n\n isNarrow: function() {\n return window.innerWidth < 1000\n },\n\n },\n methods: {\n\n modifyMenus: function() {\n let vo = this\n\n let cmpPick = ''\n\n setTimeout(() => {\n\n // console.log('call P1')\n vo.cmpP1 = get(vo.cmpsL1, vo.indP1, {})\n vo.cmpsL2 = get(vo.cmpP1, `cmps`, [])\n let _cmpPick = get(vo.cmpP1, `name`, '')\n if (_cmpPick) {\n cmpPick = _cmpPick\n }\n // console.log('vo.cmpP1', cloneDeep(vo.cmpP1))\n // console.log('vo.cmpsL2', cloneDeep(vo.cmpsL2))\n\n }, 50)\n\n setTimeout(() => {\n\n // console.log('call P2')\n let cmps = get(vo.cmpP1, `cmps`, [])\n vo.cmpP2 = get(cmps, vo.indP2, {})\n vo.cmpsL3 = get(vo.cmpP2, `cmps`, [])\n let _cmpPick = get(vo.cmpP2, `name`, '')\n if (_cmpPick) {\n cmpPick = _cmpPick\n }\n // console.log('vo.cmpP2', cloneDeep(vo.cmpP2))\n // console.log('vo.cmpsL3', cloneDeep(vo.cmpsL3))\n\n }, 100)\n\n setTimeout(() => {\n\n // console.log('call P3')\n let cmps = get(vo.cmpP2, `cmps`, [])\n vo.cmpP3 = get(cmps, vo.indP3, {})\n vo.cmpsL4 = get(vo.cmpP3, `cmps`, [])\n let _cmpPick = get(vo.cmpP3, `name`, '')\n if (_cmpPick) {\n cmpPick = _cmpPick\n }\n // console.log('vo.cmpP3', cloneDeep(vo.cmpP3))\n // console.log('vo.cmpsL4', cloneDeep(vo.cmpsL4))\n\n //update\n vo.cmpPick = cmpPick\n // console.log('cmpPick', cmpPick)\n\n }, 150)\n\n },\n\n getInd: function(item, items) {\n // let vo = this\n let ind = -1\n each(items, (v, k) => {\n if (item.name === v.name) {\n ind = k\n return false //跳出\n }\n })\n return ind\n },\n\n viewPick: function(cmpPick) {\n let vo = this\n let _cmpPick = kebabCaseFix(cmpPick)\n let r = ''\n let rs = []\n let ls = []\n let pv = (ts) => {\n each(ts, (v, k) => {\n ls.push(k)\n\n //name, _name\n let name = get(v, `name`, '')\n let _name = kebabCaseFix(name)\n\n //cmps\n let cmps = get(v, `cmps`, [])\n\n //push\n let cls = ls.join('.')\n let b = _name === _cmpPick\n rs.push({\n cls,\n name,\n b,\n })\n\n //save\n if (b) {\n r = JSON.parse(JSON.stringify(ls))\n }\n\n //遞迴pv\n if (cmps.length > 0) {\n pv(cmps)\n }\n\n ls.pop()\n })\n }\n pv(vo.cmpsL1)\n // console.log('rs', rs)\n // console.log('r', r)\n vo.indP1 = get(r, 0, 0)\n vo.indP2 = get(r, 1, 0)\n vo.indP3 = get(r, 2, 0)\n },\n\n },\n}\n<\/script>\n\n<style>\n.head1 {\n padding: 0px 0px 20px 0px;\n font-size: 2.5rem;\n}\n.bkh { /* 寬 */\n padding:20px;\n}\n@media screen and (max-width:800px){ /* 中 */\n .bkh {\n padding:10px;\n }\n}\n@media screen and (max-width:400px){ /* 窄 */\n .bkh {\n padding:5px;\n }\n}\n.bk { /* 寬 */\n display: inline-block;\n vertical-align: top;\n padding: 0px 80px 60px 0px;\n}\n@media screen and (max-width:1000px){ /* 中窄 */\n .bk {\n display: block;\n padding: 0px 0px 50px 0px;\n }\n}\n</style>\n"]},media:void 0})},wT,void 0,false,void 0,!1,ao,void 0,void 0)});
|
|
18
|
+
//# sourceMappingURL=app.umd.js.map
|