PageSourceSearch

https://strataworldwide.com/assets/js/bundle.js?id=b93d1536e7d6375b1f9c

js strataworldwide.com collected 2026-09-24 19:11:23 UTC 587,259 bytes, 2 lines download raw bytes

1/*! For license information please see bundle.js.LICENSE.txt */
2(()=>{var t,e={7757:(t,e,n)=>{t.exports=n(5666)},4060:(t,e,n)=>{"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function a(t,e,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=u(t);if(e){var r=u(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return c(this,n)}}function c(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,{Z:()=>h});var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(h,t);var e,n,i,c=l(h);function h(){return r(this,h),c.apply(this,arguments)}return e=h,(n=[{key:"init",value:function(){a(u(h.prototype),"init",this).call(this),this.sectionViewed=!1,this.lastViewed=!1,this.inView=this.inView.bind(this),this.animateIn=this.animateIn.bind(this),this.animateOut=this.animateOut.bind(this),this.observer=new IntersectionObserver(this.inView,{threshold:.15,rootMargin:"0% 0% -40% 0%"})}},{key:"observe",value:function(){this.observer.observe(this.el)}},{key:"unobserve",value:function(){this.observer.unobserve(this.el)}},{key:"animateIn",value:function(){}},{key:"animateOut",value:function(){}},{key:"inView",value:function(t){var e=this;t.forEach((function(t){var n=t.isIntersecting,i=t.target;if(n)if(e.isIntersecting=!0,i===e.el){if(e.sectionViewed)return;e.animateIn(),e.sectionViewed=!0}else{if(e.lastViewed)return;e.lastViewed=!0}}))}}])&&o(e.prototype,n),i&&o(e,i),h}(n(4711).gO)},8960:(t,e,n)=>{"use strict";n.d(e,{Z:()=>T});var i=n(7757),r=n.n(i),o=n(7071),a=n(7438),s=n(339),l=n(8502),c=n(4448),u=n.n(c);const h={linear:function(t){return t},circIn:function(t){return 1-Math.cos(t*(Math.PI/2))},circOut:function(t){return Math.sin(t*(Math.PI/2))},circInOut:function(t){return-.5*(Math.cos(Math.PI*t)-1)},quadIn:function(t){return t*t},quadOut:function(t){return t*(2-t)},quadInOut:function(t){return t<.5?2*t*t:(4-2*t)*t-1},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},quartIn:function(t){return t*t*t*t},quartOut:function(t){return--t*t*t*t+1},quartInOut:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},quintIn:function(t){return t*t*t*t*t},quinOut:function(t){return--t*t*t*t*t+1},quinInOut:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},expoIn:function(t){return 0===t?0:Math.pow(2,10*(t-1))},expoOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},expoInOut:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},elasticIn:function(t){return Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},elasticOut:function(t){return Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1}};function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to de
2structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t){return function(t){if(Array.isArray(t))return v(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(t,e):void 0}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function y(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function _(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){y(o,i,r,a,s,"next",t)}function s(t){y(o,i,r,a,s,"throw",t)}a(void 0)}))}}function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function w(t,e,n){return e&&b(t.prototype,e),n&&b(t,n),t}var M=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};x(this,t);var n={el:null,delay:null,fill:"both",duration:1e3,easing:"linear",raf:!1,end:null,debug:!1,transformsConverted:null,keyframes:[]};this.params=Object.assign(n,e),this.els=[],this.params.raf&&(this.params.transformsConverted=this.convertTransforms(e.keyframes)),this.animations=[],this.finished=!1,this.id=(0,s.Z)(),this.init()}var e;return w(t,[{key:"init",value:(e=_(r().mark((function t(){var e,n,i=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.params,void 0===this.params.el.length?(n=e.raf?new E(this.params.el,e):new S(this.params.el,e),this.animations.push(n)):(this.els=m(this.params.el),this.params.stagger<0&&this.els.reverse(),this.els.forEac
2h((function(t,n){var r;void 0!==e.stagger&&(e.delay+=n*Math.abs(e.stagger)),r=e.raf?new E(t,e):new S(t,e),i.animations.push(r)}))),null===this.params.end){t.next=7;break}if(!this.finished){t.next=5;break}return t.abrupt("return",!1);case 5:this.finished=!0,this.onFinish(this.params.end);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"onFinish",value:function(t){var e=this;this.params.raf?(this.promises=[],this.animations.forEach((function(t){e.promises.push(t.done)})),Promise.all(this.promises).then((function(e){t()}))):(this.last=this.animations[this.animations.length-1].instance,this.last.onfinish=function(){t()})}},{key:"pause",value:function(){this.params.raf&&this.animations.forEach((function(t){t.onDone()}))}},{key:"convertTransforms",value:function(t){var e=this,n=[];return t.forEach((function(t){for(var i={},r={},o={},a={},s={},c=[],u=0,h=Object.entries(t);u<h.length;u++){var m=p(h[u],2),g=m[0],v=m[1],y=e.seperateUnitAndValue(v),_=y.val,x=y.unit;switch(g){case"x":case"y":case"z":i[g]=_,x&&(i.unit=x);break;case"sc":r={scX:_,scY:_};break;case"scX":case"scY":r[g]=_;break;case"rX":case"rY":case"rZ":o[g]=_,x&&(o.unit=x);break;case"skX":case"skY":a[g]=_,x&&(a.unit=x);break;default:s[g]=_}}(0,l.xb)(i)||c.push({translate:i}),(0,l.xb)(o)||c.push({rotate:o}),(0,l.xb)(r)||c.push({scale:r}),(0,l.xb)(a)||c.push({skew:a}),(0,l.xb)(s)||c.push({misc:s}),n.push(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},c))})),n}},{key:"seperateUnitAndValue",value:function(t){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|em|rem|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(e)return{unit:e[1],val:parseFloat(t)}}}]),t}(),S=function(){function t(e,n){x(this,t),this.el=e,this.params=n,this.el.style="",this.keyframes=this.params.keyframes,this.start()}return w(t,[{key:"start",value:function(){this.instance=this.el.animate(this.keyframes,{delay:this.params.delay,fill:"both",duration:this.params.duration,easing:u()[this.params.ease]})}}]),t}(),E=function(){function t(e,n){var i=this;x(this,t),this.tick=this.tick.bind(this),this.el=e,this.params=n,this.isNode=(0,l.UG)(e),this.transforms=this.params.transformsConverted,this.begin=this.transforms[0],this.end=this.transforms[1],this.singleTransform=1===this.end.length,this.isDone=!1,this.done=new Promise((function(t,e){i.resolve=t})),this.duration=this.params.duration,this.id=(0,s.Z)(),this.start()}var e;return w(t,[{key:"start",value:(e=_(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,a.Z)(this.params.delay);case 2:this.time={start:performance.now(),total:this.params.duration},o.Z.raf.add(this.tick,this.id);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTypeAnimation",value:function(t){var e=[];return void 0!==t.y&&e.push("translateY"),void 0!==t.x&&e.push("translateX"),void 0!==t.z&&e.push("translateZ"),e}},{key:"getElementTransforms",value:function(t){for(var e,n=t.style.transform||"",i=/(\w+)\(([^)]*)\)/g,r=new Map;e=i.exec(n);)r.set(e[1],e[2]);return r}},{key:"getProgress",value:function(t){var e=t.elapsed,n=t.total;return Math.min(e/n,1)}},{key:"round",value:function(t){return Math.round(1e3*t)/1e3}},{key:"getTransform",value:function(t,e,n,i,r){var o=e[r][i]-n[r][i];return this.round(e[r][i]-o*t)||0}},{key:"getTransformSimple",value:function(t,e,n,i,r){var o=e[r][i]-n[r][i];return this.round(e[r][i]-o*t)||0}},{key:"tick",value:function(t){if(o.Z.animating=!this.isDone,!this.isDone){this.time.elapsed=t-this.time.start;for(var e=this.getProgress(this.time),n=h[this.params.ease](e),i=[],r=0;r<Object.keys(this.end).length;r++){var a=this.begin[r],s=this.end[r];if(s.translate){var l=this.getTransform(n,a,s,"x","translate"),c=this.getTransform(n,a,s,"y","translate"),u=this.getTransform(n,a,s,"z","translate"),d=s.translate.unit||a.translate.unit;i.push("translate3d(".concat(l).concat(0!==l?d:"",", ").concat(c).concat(0!==c?d:"",", ").concat(u).
2concat(0!==u?d:"",")"))}if(s.rotate){var f=this.getTransform(n,a,s,"rX","rotate"),p=this.getTransform(n,a,s,"rY","rotate"),m=this.getTransform(n,a,s,"rZ","rotate"),g=s.rotate.unit||a.rotate.unit;0!==f&&i.push("rotateX(".concat(f).concat(0!==f?g:"",")")),0!==p&&i.push("rotateY(".concat(p).concat(0!==p?g:"",")")),0!==m&&i.push("rotateZ(".concat(m).concat(0!==m?g:"",")"))}}if(this.isNode)this.el.style.transform=i.join(" ");else for(var v=0;v<Object.keys(this.end).length;v++){var y=this.begin[v],_=this.end[v],x=Object.keys(_.misc)[0];this.el[x]=this.getTransformSimple(n,y,_,x,"misc")}1===e&&this.onDone()}}},{key:"onDone",value:function(){this.isDone=!0,this.resolve(),o.Z.raf.remove(this.id)}}]),t}();const T=M},8189:(t,e,n)=>{"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=s(t);if(e){var r=s(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return a(this,n)}}function a(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,{Y:()=>l});var l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}(n,t);var e=o(n);function n(t,i,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(o=e.call(this,t,i)).view=void 0!==r?r:"",o}return n}(n(4711).gO)},3336:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});const i={app:null}},7071:(t,e,n)=>{"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}n.d(e,{Z:()=>a});const r=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.frames=[],this.render=function(t){return e.frame(t)}}var e,n,r;return e=t,(n=[{key:"start",value:function(){this.stopped=!1,this.now=performance.now(),this.id=window.requestAnimationFrame(this.render)}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&window.cancelAnimationFrame(this.id),this.stopped=!0}},{key:"frame",value:function(t){if(this.frames.length<1)return!1;for(var e=0;e<this.frames.length&&this.frames.length>0;e++)this.frames.length&&this.frames[e].handler(t);this.stopped||(this.id=window.requestAnimationFrame(this.render))}},{key:"add",value:function(t,e){if("function"!=typeof t)throw new Error("Expected function as handler");return void 0===e&&(e="h_".concat(++this.uidCounter)),this.frames.push({id:e,handler:t}),1===this.frames.length&&this.start(),e}},{key:"moveToFirst",value:function(t){if(void 0===t)throw new Error("Expected id");var e=this.frames.findIndex((function(e){return e.id===t}));e<0||this.frames.unshift(this.frames.splice(e,1)[0])}},{key:"remove",value:function(t){if(void 0===t)throw new Error("Expected id");var e=this.frames.findIndex((function(e){return e.id===t}));e<0||(this.frames.splice(e,1),this.frames.length<=0&&this.stop())}}])&&i(e.prototype,n),r&&i(e,r),t}();var o=window.innerWidth<850;const a={raf:new r,env:"production",loaded:!1,doc:document,body:document.body,win:window,html:document.documentElement,isMobile:o,ticker:!1,animating:!1,promises:{},xhrActive:!1,chunks:{},webgl:!o,smooth:!o,drag:!0,dragComponent:!1,webp:!1,state:{},observer:{threshold:0},mouse:{x:0,y:0},scroll:{offsetTop:0},view:{previous:null,previousScroll:0,current:null,previousType:null}}},8661:(t,e,n)=>{"use strict";var i=n(7757),r=n.n(i),o=n(4711),a=n(7071),s=n(3336);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function f(t,e,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=v(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}
2function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=v(t);if(e){var r=v(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return g(this,n)}}function g(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(u,t);var e,i,r,l=m(u);function u(){return h(this,u),l.apply(this,arguments)}return e=u,(i=[{key:"init",value:function(){f(v(u.prototype),"init",this).call(this),this.build(),this.scrollToTarget=this.scrollToTarget.bind(this)}},{key:"addEvents",value:function(){var t=this;f(v(u.prototype),"addEvents",this).call(this),this.scrollTargets=c(a.Z.doc.querySelectorAll("[data-scroll-to]")),this.scrollTargets.forEach((function(e){e.addEventListener("click",(function(e){return t.scrollTo(e)}))}))}},{key:"removeEvents",value:function(){var t=this;f(v(u.prototype),"removeEvents",this).call(this),this.scrollTargets.forEach((function(e){e.removeEventListener("click",(function(e){return t.scrollTo(e)}))}))}},{key:"build",value:function(){var t=this;this.getAll("[data-chunk]").forEach((function(e){return t.getChuck(e)}))}},{key:"getChuck",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el,i=t.getAttribute("data-chunk"),r=(0,o.YM)(i);if(!a.Z.isMobile||"theme-toggle"!==i){var s=n(9365)("./".concat(i));a.Z.chunks[r]=new s.default(t,r,e)}}},{key:"scrollToTarget",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=a.Z.smooth?a.Z.doc.querySelector("[data-scroll]"):a.Z.doc;if(""!==t){var i,r;if(void 0!==t){var o=n.querySelector("#".concat(t));if(!o)return;window.pageYOffset,o.getBoundingClientRect().top,a.Z.layout.h,r=o.offsetParent.hasAttribute("data-scroll-items")?o.offsetParent.offsetTop:0,i=-(o.offsetTop+r)+a.Z.layout.h/10}else i=0;a.Z.smooth&&("#contact"===t&&(i=-s.Z.scroll.scroll.max),clearTimeout(s.Z.scroll.wheelTimeOut),e||(s.Z.scroll.scroll.current=s.Z.scroll.scroll.lerped=i))}}},{key:"scrollTo",value:function(t){""!==t.target.dataset.scrollTo&&this.scrollToTarget(t.target.dataset.scrollTo)}}])&&d(e.prototype,i),r&&d(e,r),u}(o.gO),_=n(788),x=n(8960),b=n(4060),w=n(3582);function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function T(t,e,n){return(T="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=R(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function L(t,e){return(L=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=R(t);if(e){var r=R(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return P(this,n)}}function P(t,e){return!e||"object"!==M(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}
2function R(t){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&L(t,e)}(o,t);var e,n,i,r=A(o);function o(){return S(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"init",value:function(){T(R(o.prototype),"init",this).call(this),this.splitText()}},{key:"splitText",value:function(){var t=this.getAll(".split-lines"),e=this.getAll(".split-article"),n=this.getAll(".split-titles"),i=this.getAll(".split-characters");t.length&&t.forEach((function(t){return(0,w.C2)(t)})),n.length&&n.forEach((function(t){t.querySelectorAll("h1, h2, h3, h4, h4").forEach((function(t){return(0,w.Rg)(t)}))})),e.length&&e.forEach((function(t){var e=t.querySelectorAll("h2, h3"),n=t.querySelectorAll("p");e.forEach((function(t){return(0,w.Rg)(t)})),n.forEach((function(t){(0,w.Rg)(t)}))})),i.length&&i.forEach((function(t){(0,w.C2)(t,{classWord:"word",classWords:"words",classLine:"line",classLetter:"letter",splitLetters:!0})}))}}])&&E(e.prototype,n),i&&E(e,i),o}(b.Z),D=n(5507);function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t){return function(t){if(Array.isArray(t))return I(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return I(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function U(t,e){return(U=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=G(t);if(e){var r=G(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return B(this,n)}}function B(t,e){return!e||"object"!==O(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function G(t){return(G=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var H=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&U(t,e)}(o,t);var e,n,i,r=k(o);function o(){return F(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"headerIn",value:function(){var t=this.get(".header-image");t&&(t.classList.remove("opacity-0"),new x.Z({el:t,duration:1e3,delay:500,ease:"linear",keyframes:[{opacity:0},{opacity:1}]}))}},{key:"pageNumberingIn",value:function(t){var e=this.getAll(".header-numbering-inner"),n=this.get(".header-numbering-divider");e.length&&new x.Z({el:e,duration:1e3,delay:t,stagger:-200,ease:"expoOut",keyframes:[{transform:"translate3d(0,-150%,0)"}
2,{transform:"translate3d(0,0,0)"}]}),n&&new x.Z({el:n,duration:1800,delay:t,ease:"expoOut",keyframes:[{transform:"scaleX(0)"},{transform:"scaleX(1)"}]})}},{key:"missionIn",value:function(t){var e=this.get(".header-mission"),n=this.getAll(".header-mission-title .line-inner");e&&e.classList.remove("opacity-0"),a.Z.isMobile&&new x.Z({el:e,duration:500,delay:t,ease:"linear",keyframes:[{opacity:0},{opacity:1}]}),n.length&&new x.Z({el:n,duration:2200,delay:t,stagger:60,ease:"expoOut",keyframes:[{transform:"translate3d(0,-150%,0)"},{transform:"translate3d(0,0,0)"}]});var i=this.getAll(".header-mission-subtitle");new x.Z({el:i,delay:t+300,duration:600,ease:"linear",keyframes:[{opacity:0},{opacity:1}]})}},{key:"titleIn",value:function(t){var e=this.getAll(".header-title-inner"),n=this.getAll(".header-title-inner .line");e.length&&new x.Z({el:e,duration:2400,delay:t,ease:"expoOut",keyframes:[{transform:"rotateY(-65deg)",opacity:0},{transform:"rotateY(0)",opacity:1}]}),n.length&&n.forEach((function(e){var n=e.querySelectorAll(".char");new x.Z({el:n,duration:2400,delay:t,stagger:-5,ease:"expoOut",keyframes:[{transform:"rotateX(10deg)"},{transform:"rotateX(0)"}]})}))}},{key:"textExtendedIn",value:function(t){var e=this.get(".header-text-extended"),n=N(this.getAll(".header-text-extended p"));e&&n.push(e),e&&e.classList.remove("opacity-0"),a.Z.isMobile&&e&&new x.Z({el:e,duration:500,delay:t,ease:"linear",keyframes:[{opacity:0},{opacity:1}]}),n.length&&n.forEach((function(e){var n=e.querySelectorAll(".line-inner");n.length&&new x.Z({el:n,duration:2200,delay:t,stagger:20,ease:"expoOut",keyframes:[{transform:"translate3d(0, 150%,0)"},{transform:"translate3d(0,0,0)"}]}),new x.Z({el:e,duration:500,delay:t+300,ease:"linear",keyframes:[{opacity:0},{opacity:1}]})}))}},{key:"textBottomIn",value:function(t){var e=this.get(".header-text-bottom"),n=this.getAll(".header-text-bottom .line-inner");e&&e.classList.remove("opacity-0"),a.Z.isMobile&&new x.Z({el:e,duration:500,delay:t,ease:"linear",keyframes:[{opacity:0},{opacity:1}]}),n.length&&new x.Z({el:n,duration:2200,delay:t,stagger:60,ease:"expoOut",keyframes:[{transform:"translate3d(0, 150%,0)"},{transform:"translate3d(0,0,0)"}]})}},{key:"textIn",value:function(t){var e=this.get(".header-text-primary"),n=e?[].concat(N(e.querySelectorAll("p")),N(e.querySelectorAll("h3")),N(e.querySelectorAll("h2"))):[];e&&e.classList.remove("opacity-0"),a.Z.isMobile&&new x.Z({el:e,duration:500,delay:t,ease:"linear",keyframes:[{opacity:0},{opacity:1}]}),n.length&&n.forEach((function(e){var n=e.querySelectorAll(".line-inner");new x.Z({el:n,duration:2200,delay:t,stagger:30,ease:"expoOut",keyframes:[{transform:"translate3d(0, 150%,0)"},{transform:"translate3d(0,0,0)"}]})}))}},{key:"scrollIndicator",value:function(t){var e=this.get(".header-scroll");e&&(0,D.I)(e,{className:"header-scroll",delay:t,duration:1800})}},{key:"headerButtonIn",value:function(t){var e=this.get(".header-button");e&&(0,D.I)(e,{className:"header-button",delay:t,duration:1800})}},{key:"headerCrumbsIn",value:function(t){var e=this.getAll(".header-crumbs-li-inner"),n=this.getAll(".header-crumbs-li-divider");new x.Z({el:e,duration:2200,delay:t,stagger:30,ease:"expoOut",keyframes:[{transform:"translate3d(0, 150%,0)"},{transform:"translate3d(0,0,0)"}]}),new x.Z({el:n,duration:2200,delay:t+100,stagger:30,ease:"expoOut",keyframes:[{transform:"translate3d(0, 150%,0)"},{transform:"translate3d(0,0,0)"}]})}},{key:"animateIn",value:function(){this.headerIn(),this.titleIn(0),this.missionIn(500),this.pageNumberingIn(1e3),this.textBottomIn(1e3),this.textIn(1100),this.textExtendedIn(1100),this.scrollIndicator(1400),this.headerButtonIn(1700),this.headerCrumbsIn(1700)}},{key:"animateOut",value:function(){new x.Z({el:this.el,duration:200,ease:"linear",keyframes:[{opacity:1},{opacity:0}]})}}])&&z(e.prototype,n),i&&z(e,i),o}(b.Z);function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}
vendor: 1,317 bytes, line 2
2function X(t,e){return(X=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=q(t);if(e){var r=q(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Y(this,n)}}function Y(t,e){return!e||"object"!==V(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function q(t){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var K=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&X(t,e)}(o,t);var e,n,i,r=Z(o);function o(){return j(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"titleIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.get(".section-cta-title-inner"),n=this.getAll(".
2section-cta-title .line"),i=2400;e&&new x.Z({el:e,duration:i,delay:t,ease:"expoOut",keyframes:[{transform:"rotateY(65deg)",opacity:0},{transform:"rotateY(0)",opacity:1}]}),n.length&&n.forEach((function(e){var n=e.querySelectorAll(".char");new x.Z({el:n,duration:i,delay:t,stagger:5,ease:"expoOut",keyframes:[{transform:"rotateX(10deg)"},{transform:"rotateX(0)"}]})}))}},{key:"textIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getAll(".section-cta-text"),n=this.getAll(".section-cta-text p"),i=this.getAll(".section-cta-text .line-inner");e.length&&e.forEach((function(t){t.classList.remove("opacity-0")})),a.Z.isMobile&&e.length&&new x.Z({el:e,duration:500,delay:t,ease:"linear",keyframes:[{opacity:0},{opacity:1}]}),n.length&&new x.Z({el:n,duration:1e3,delay:t+500,ease:"linear",keyframes:[{opacity:0},{opacity:1}]}),i.length&&new x.Z({el:i,duration:2200,delay:t,stagger:30,ease:"expoOut",keyframes:[{transform:"translate3d(0, 150%,0)"},{transform:"translate3d(0,0,0)"}]})}},{key:"buttonIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.get(".section-cta-button");e&&(0,D.I)(e,{className:"section-cta-button",delay:t,duration:1800})}},{key:"imageIn",value:function(t){var e=this.get(".section-cta-image-inner");e&&(e.classList.remove("opacity-0"),new x.Z({el:e,duration:1e3,delay:500,ease:"linear",keyframes:[{opacity:0},{opacity:1}]}))}}])&&W(e.prototype,n),i&&W(e,i),o}(b.Z),J=n(2790),Q=n.n(J);function $(t){return($="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tt(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function it(t,e,n){return(it="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=st(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function rt(t,e){return(rt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ot(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=st(t);if(e){var r=st(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return at(this,n)}}function at(t,e){return!e||"object"!==$(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function st(t){return(st=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var lt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&rt(t,e)}(l,t);var e,n,i,o,a,s=ot(l);function l(){return et(this,l),s.apply(this,arguments)}return e=l,(n=[{key:"init",value:(o=r().mark((function t(){var e=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return it(st(l.prototype),"init",this).call(this),this.lines=this.getAll(".header-title-inner .line"),t.next=4,Q();case 4:this.lines.forEach((function(t){var n=t.querySelectorAll(".char");n.length>13&&e.el.classList.add("header-adjust-text-sm"),n.length>17&&(e.el.classList.remove("header-adjust-text-sm"),e.el.classList.add("header-adjust-text-xs"))}));case 5:case"end":return t.stop()}}),t,this)})),a=function(){var t=this,e=arguments;return new Promise((function(n,i){var r=o.apply(t,e);function a(t){tt(r,n,i,a,s,"next",t)}function s(t){tt(r,n,i,a,s,"throw",t)}a(void 0)}))},function(){return a.apply(this,arguments)})}])&&nt(e.prototype,n),i&&nt(e,i),l}(b.Z);function ct(t){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function dt(t,e,n){return(dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gt(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function ft(t,e){return(ft=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=gt(t);if(e){var r=gt(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return mt(this,n)}}function mt(t,e){return!e||"object"!==ct(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function gt(t){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var vt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ft(t,e)}(o,t);var e,n,i,r=pt(o);function o(){return ut(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"init",value:function(){dt(gt(o.prototype),"init",this).call(this)}}])&&ht(e.prototype,n),i&&ht(e,i),o}(b.Z);function yt(t){return(yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _t(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function xt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function wt(t,e,n){return(wt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Tt(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function Mt(t,e){return(Mt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function St(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Tt(t);if(e){var r=Tt(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Et(this,n)}}function Et(t,e){return!e||"object"!==yt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Tt(t){return(Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mt(t,e)}(l,t);var e,n,i,o,a,s=St(l);function l(){return xt(this,l),s.apply(this,arguments)}return e=l,(n=[{key:"init",value:(o=r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wt(Tt(l.prototype),"init",this).call(this),this.onClick=this.onClick.bind(this),this.onBgClick=this.onBgClick.bind(this),this.modal=document.querySelector("[data-modal='".concat(this.el.dataset.modalTrigger,"']")),this.modalBg=this.modal.querySelector(".form-modal-close"),this.el.addEventListener("click",this.onClick),this.modalBg.addEventListener("click",this.onBgClick);case 7:case"end":return t.stop()}}),t,this)})),a=function(){var t=this,e=arguments;return new Promise((function(n,i){var r=o.apply(t,e);function a(t){_t(r,n,i,a,s,"next",t)}function s(t){_t(r,n,i,a,s,"throw",t)}a(void 0)}))},function(){return a.apply(this,arguments)})},{key:"removeEvents",value:function(){wt(Tt(l.prototype),"removeEvents",this).call(this),this.el.removeEventListener("click",this.onClick),this.modalBg.removeEventListener("click",this.onBgClick)}},{key:"onClick",value:function(){this.modal.classList.add("form-modal-active")}},{key:"onBgClick",value:function(){this.modal.classList.remove("form-modal-active")}}])&&bt(e.prototype,n),i&&bt(e,i),l}(b.Z),At=n(6627);const Pt=[];for(let t=0;t<256;t++)Pt[t]=(t<16?"0":"")+t.toString(16);let Rt=1234567;const Ct={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Pt[255&t]+Pt[t>>8&255]+Pt[t>>16&255]+Pt[t>>24&255]+"-"+Pt[255&e]+Pt[e>>8&255]+"-"+Pt[e>>16&15|64]+Pt[e>>24&255]+"-"+Pt[63&n|128]+Pt[n>>8&255]+"-"+Pt[n>>16&255]+Pt[n>>24&255]+Pt[255&i]+Pt[i>>8&255]+Pt[i>>16&255]+Pt[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},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:function(t,e,n){return(1-n)*t+n*e},damp:function(t,e,n,i){return Ct.lerp(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(Ct.euclideanModulo(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)}
vendor: 20,689 bytes, line 2
2,randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(Rt=t%2147483647),Rt=16807*Rt%2147483647,(Rt-1)/2147483646},degToRad:function(t){return t*Ct.DEG2RAD},radToDeg:function(t){return t*Ct.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+i)/2),u=a((e+i)/2),h=o((e-i)/2),d=a((e-i)/2),f=o((i-e)/2),p=a((i-e)/2);switch(r){case"XYX":t.set(s*u,l*h,l*d,s*c);break;case"YZY":t.set(l*d,s*u,l*h,s*c);break;case"ZXZ":t.set(l*h,l*d,s*u,s*c);break;case"XZX":t.set(s*u,l*p,l*f,s*c);break;case"YXY":t.set(l*f,s*u,l*p,s*c);break;case"ZYZ":t.set(l*p,l*f,s*u,s*c)}}};class Dt{constructor(t=0,e=0,n=0,i=1){this._x=t,this._y=e,this._z=n,this._w=i}static slerp(t,e,n,i){return n.slerpQuaternions(t,e,i)}static slerpFlat(t,e,n,i,r,o,a){let s=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3];const h=r[o+0],d=r[o+1],f=r[o+2],p=r[o+3];if(0===a)return t[e+0]=s,t[e+1]=l,t[e+2]=c,void(t[e+3]=u);if(1===a)return t[e+0]=h,t[e+1]=d,t[e+2]=f,void(t[e+3]=p);if(u!==p||s!==h||l!==d||c!==f){let t=1-a;const e=s*h+l*d+c*f+u*p,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,a=Math.sin(a*o)/r}const r=a*n;if(s=s*t+h*r,l=l*t+d*r,c=c*t+f*r,u=u*t+p*r,t===1-a){const t=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=t,l*=t,c*=t,u*=t}}t[e]=s,t[e+1]=l,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,o){const a=n[i],s=n[i+1],l=n[i+2],c=n[i+3],u=r[o],h=r[o+1],d=r[o+2],f=r[o+3];return t[e]=a*f+c*u+s*d-l*h,t[e+1]=s*f+c*h+l*u-a*d,t[e+2]=l*f+c*d+a*h-s*u,t[e+3]=c*f-a*u-s*h-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){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,i=t._y,r=t._z,o=t._order,a=Math.cos,s=Math.sin,l=a(n/2),c=a(i/2),u=a(r/2),h=s(n/2),d=s(i/2),f=s(r/2);switch(o){case"XYZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"YXZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"ZXY":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"ZYX":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"YZX":this._x=h*c*u+l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u-h*d*f;break;case"XZY":this._x=h*c*u-l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u+h*d*f}return!1!==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],a=e[5],s=e[9],l=e[2],c=e[6],u=e[10],h=n+a+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(c-s)*t,this._y=(r-l)*t,this._z=(o-i)*t}else if(n>a&&n>u){const t=2*Math.sqrt(1+n-a-u);this._w=(c-s)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(r+l)/t}else if(a>u){const t=2*Math.sqrt(1+a-n-u);this._w=(r-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(s+c)/t}else{const t=2*Math.sqrt(1+u-n-a);this._w=(o-i)/t,this._x=(r+l)/t,this._y=(s+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(Ct.clamp(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,e){return void 0!==e?this.multiplyQuaternions(t,e):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,a=e._x,s=e._y,l=e._z,c=e._w;return this._x=n*c+o*a+i*l-r*s,this._y=i*c+o*s+r*a-n*l,this._z=r*c+o*l+n*s-i*a,this._w=o*c-n*a-i*s-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 a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const s=1-a*a;if(s<=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._onChangeCallback(),this}const l=Math.sqrt(s),c=Math.atan2(l,a),u=Math.sin((1-e)*c)/l,h=Math.sin(e*c)/l;return this._w=o*u+this._w*h,this._x=n*u+this._x*h,this._y=i*u+this._y*h,this._z=r*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(t,e,n){this.copy(t).slerp(e,n)}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}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Dt.prototype.isQuaternion=!0;class Ot{constructor(t=0,e=0,n=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,e){return void 0!==e?this.addVectors(t,e):(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,e){return void 0!==e?this.subVectors(t,e):(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,e){return void 0!==e?this.multiplyVectors(t,e):(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!t||t.isEuler,this.applyQuaternion(It.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(It.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,a=t.z,s=t.w,l=s*e+o*i-a*n,c=s*n+a*e-r*i,u=s*i+r*n-o*e,h=-r*e-o*n-a*i;return this.x=l*s+h*-r+c*-a-u*-o,this.y=c*s+h*-o+u*-r-l*-a,this.z=u*s+h*-a+l*-o-c*-r,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){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,e){return void 0!==e?this.crossVectors(t,e):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-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 Nt.copy(this).projectOnVector(t),this.sub(Nt)}reflect(t){return this.sub(Nt.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(Ct.clamp(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)}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,n){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}}Ot.prototype.isVector3=!0;const Nt=new Ot,It=new Dt;class Ft{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,n,i,r,o,a,s,l,c,u,h,d,f,p,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]=a,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,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 Ft).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/zt.setFromMatrixColumn(t,0).length(),r=1/zt.setFromMatrixColumn(t,1).length(),o=1/zt.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){!t||t.isEuler;const e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){const t=o*c,n=o*u,i=a*c,r=a*u;e[0]=s*c,e[4]=-s*u,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*s,e[2]=r-t*l,e[6]=i+n*l,e[10]=o*s}else if("YXZ"===t.order){const t=s*c,n=s*u,i=l*c,r=l*u;e[0]=t+r*a,e[4]=i*a-n,e[8]=o*l,e[1]=o*u,e[5]=o*c,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=o*s}else if("ZXY"===t.order){const t=s*c,n=s*u,i=l*c,r=l*u;e[0]=t-r*a,e[4]=-o*u,e[8]=i+n*a,e[1]=n+i*a,e[5]=o*c,e[9]=r-t*a,e[2]=-o*l,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){const t=o*c,n=o*u,i=a*c,r=a*u;e[0]=s*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=s*u,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){const t=o*s,n=o*l,i=a*s,r=a*l;e[0]=s*c,e[4]=r-t*u,e[8]=i*u+n,e[1]=u,e[5]=o*c,e[9]=-a*c,e[2]=-l*c,e[6]=n*u+i,e[10]=t-r*u}else if("XZY"===t.order){const t=o*s,n=o*l,i=a*s,r=a*l;e[0]=s*c,e[4]=-u,e[8]=l*c,e[1]=t*u+r,e[5]=o*c,e[9]=n*u-i,e[2]=i*u-n,e[6]=a*c,e[10]=r*u+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(kt,t,Bt)}lookAt(t,e,n){const i=this.elements;return Vt.subVectors(t,e),0===Vt.lengthSq()&&(Vt.z=1),Vt.normalize(),Gt.crossVectors(n,Vt),0===Gt.lengthSq()&&(1===Math.abs(n.z)?Vt.x+=1e-4:Vt.z+=1e-4,Vt.normalize(),Gt.crossVectors(n,Vt)),Gt.normalize(),Ht.crossVectors(Vt,Gt),i[0]=Gt.x,i[4]=Ht.x,i[8]=Vt.x,i[1]=Gt.y,i[5]=Ht.y,i[9]=Vt.y,i[2]=Gt.z,i[6]=Ht.z,i[10]=Vt.z,this}multiply(t,e){return void 0!==e?this.multiplyMatrices(t,e):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],a=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],_=n[11],x=n[15],b=i[0],w=i[4],M=i[8],S=i[12],E=i[1],T=i[5],L=i[9],A=i[13],P=i[2],R=i[6],C=i[10],D=i[14],O=i[3],N=i[7],I=i[11],F=i[15];return r[0]=o*b+a*E+s*P+l*O,r[4]=o*w+a*T+s*R+l*N,r[8]=o*M+a*L+s*C+l*I,r[12]=o*S+a*A+s*D+l*F,r[1]=c*b+u*E+h*P+d*O,r[5]=c*w+u*T+h*R+d*N,r[9]=c*M+u*L+h*C+d*I,r[13]=c*S+u*A+h*D+d*F,r[2]=f*b+p*E+m*P+g*O,r[6]=f*w+p*T+m*R+g*N,r[10]=f*M+p*L+m*C+g*I,r[14]=f*S+p*A+m*D+g*F,r[3]=v*b+y*E+_*P+x*O,r[7]=v*w+y*T+_*R+x*N,r[11]=v*M+y*L+_*C+x*I,r[15]=v*S+y*A+_*D+x*F,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],a=t[5],s=t[9],l=t[13],c=t[2],u=t[6],h=t[10],d=t[14];return t[3]*(+r*s*u-i*l*u-r*a*h+n*l*h+i*a*d-n*s*d)+t[7]*(+e*s*d-e*l*h+r*o*h-i*o*d+i*l*c-r*s*c)+t[11]*(+e*l*u-e*a*d-r*o*u+n*o*d+r*a*c-n*l*c)+t[15]*(-i*a*c-e*s*u+e*a*h+i*o*u-n*o*h+n*s*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],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],v=u*m*l-p*h*l+p*s*d-a*m*d-u*s*g+a*h*g,y=f*h*l-c*m*l-f*s*d+o*m*d+c*s*g-o*h*g,_=c*p*l-f*u*l+f*a*d-o*p*d-c*a*g+o*u*g,x=f*u*s-c*p*s-f*a*h+o*p*h+c*a*m-o*u*m,b=e*v+n*y+i*_+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return t[0]=v*w,t[1]=(p*h*r-u*m*r-p*i*d+n*m*d+u*i*g-n*h*g)*w,t[2]=(a*m*r-p*s*r+p*i*l-n*m*l-a*i*g+n*s*g)*w,t[3]=(u*s*r-a*h*r-u*i*l+n*h*l+a*i*d-n*s*d)*w,t[4]=y*w,t[5]=(c*m*r-f*h*r+f*i*d-e*m*d-c*i*g+e*h*g)*w,t[6]=(f*s*r-o*m*r-f*i*l+e*m*l+o*i*g-e*s*g)*w,t[7]=(o*h*r-c*s*r+c*i*l-e*h*l-o*i*d+e*s*d)*w,t[8]=_*w,t[9]=(f*u*r-c*p*r-f*n*d+e*p*d+c*n*g-e*u*g)*w,t[10]=(o*p*r-f*a*r+f*n*l-e*p*l-o*n*g+e*a*g)*w,t[11]=(c*a*r-o*u*r-c*n*l+e*u*l+o*n*d-e*a*d)*w,t[12]=x*w,t[13]=(c*p*i-f*u*i+f*n*h-e*p*h-c*n*m+e*u*m)*w,t[14]=(f*a*i-o*p*i-f*n*s+e*p*s+o*n*m-e*a*m)*w,t[15]=(o*u*i-c*a*i+c*n*s-e*u*s-o*n*h+e*a*h)*w,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 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,a=t.y,s=t.z,l=r*o,c=r*a;return this.set(l*o+n,l*a-i*s,l*s+i*a,0,l*a+i*s,c*a+n,c*s-i*o,0,l*s-i*a,c*s+i*o,r*s*s+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){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,l=r+r,c=o+o,u=a+a,h=r*l,d=r*c,f=r*u,p=o*c,m=o*u,g=a*u,v=s*l,y=s*c,_=s*u,x=n.x,b=n.y,w=n.z;return i[0]=(1-(p+g))*x,i[1]=(d+_)*x,i[2]=(f-y)*x,i[3]=0,i[4]=(d-_)*b,i[5]=(1-(h+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(f+y)*w,i[9]=(m-v)*w,i[10]=(1-(h+p))*w,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=zt.set(i[0],i[1],i[2]).length();const o=zt.set(i[4],i[5],i[6]).length(),a=zt.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],Ut.copy(this);const s=1/r,l=1/o,c=1/a;return Ut.elements[0]*=s,Ut.elements[1]*=s,Ut.elements[2]*=s,Ut.elements[4]*=l,Ut.elements[5]*=l,Ut.elements[6]*=l,Ut.elements[8]*=c,Ut.elements[9]*=c,Ut.elements[10]*=c,e.setFromRotationMatrix(Ut),n.x=r,n.y=o,n.z=a,this}makePerspective(t,e,n,i,r,o){const a=this.elements,s=2*r/(e-t),l=2*r/(n-i),c=(e+t)/(e-t),u=(n+i)/(n-i),h=-(o+r)/(o-r),d=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}
vendor: 23,834 bytes, line 2
2makeOrthographic(t,e,n,i,r,o){const a=this.elements,s=1/(e-t),l=1/(n-i),c=1/(o-r),u=(e+t)*s,h=(n+i)*l,d=(o+r)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,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}}Ft.prototype.isMatrix4=!0;const zt=new Ot,Ut=new Ft,kt=new Ot(0,0,0),Bt=new Ot(1,1,1),Gt=new Ot,Ht=new Ot,Vt=new Ot;function jt(){}Object.assign(jt.prototype,{addEventListener:function(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:function(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(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:function(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 Wt=new Ft,Xt=new Dt;class Zt{constructor(t=0,e=0,n=0,i=Zt.DefaultOrder){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){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,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,n){const i=Ct.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],l=r[1],c=r[5],u=r[9],h=r[2],d=r[6],f=r[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,f));break;case"XZY":this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,f),this._y=0)}return this._order=e,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Wt.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Wt,e,n)}setFromVector3(t,e){return this.set(t.x,t.y,t.z,e||this._order)}reorder(t){return Xt.setFromEuler(this),this.setFromQuaternion(Xt,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}toVector3(t){return t?t.set(this._x,this._y,this._z):new Ot(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Zt.prototype.isEuler=!0,Zt.DefaultOrder="XYZ",Zt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Yt{constructor(){this.mask=1}set(t){this.mask=1<<t|0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}}class qt{constructor(){this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,n,i,r,o,a,s,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=a,c[3]=e,c[4]=r,c[5]=s,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],a=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],f=n[8],p=i[0],m=i[3],g=i[6],v=i[1],y=i[4],_=i[7],x=i[2],b=i[5],w=i[8];return r[0]=o*p+a*v+s*x,r[3]=o*m+a*y+s*b,r[6]=o*g+a*_+s*w,r[1]=l*p+c*v+u*x,r[4]=l*m+c*y+u*b,r[7]=l*g+c*_+u*w,r[2]=h*p+d*v+f*x,r[5]=h*m+d*y+f*b,r[8]=h*g+d*_+f*w,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],a=t[5],s=t[6],l=t[7],c=t[8];return e*o*c-e*a*l-n*r*c+n*a*s+i*r*l-i*o*s}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=c*o-a*l,h=a*s-c*r,d=l*r-o*s,f=e*u+n*h+i*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return t[0]=u*p,t[1]=(i*l-c*n)*p,t[2]=(a*n-i*o)*p,t[3]=h*p,t[4]=(c*e-i*s)*p,t[5]=(i*r-a*e)*p,t[6]=d*p,t[7]=(n*s-l*e)*p,t[8]=(o*e-n*r)*p,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,a){const s=Math.cos(r),l=Math.sin(r);return this.set(n*s,n*l,-n*(s*o+l*a)+o+t,-i*l,i*s,-i*(-l*o+s*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],o=i[3],a=i[6],s=i[1],l=i[4],c=i[7];return i[0]=e*r+n*s,i[3]=e*o+n*l,i[6]=e*a+n*c,i[1]=-n*r+e*s,i[4]=-n*o+e*l,i[7]=-n*a+e*c,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],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)}}qt.prototype.isMatrix3=!0;let Kt=0;const Jt=new Ot,Qt=new Dt,$t=new Ft,te=new Ot,ee=new Ot,ne=new Ot,ie=new Dt,re=new Ot(1,0,0),oe=new Ot(0,1,0),ae=new Ot(0,0,1),se={type:"added"},le={type:"removed"};function ce(){Object.defineProperty(this,"id",{value:Kt++}),this.uuid=Ct.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ce.DefaultUp.clone();const t=new Ot,e=new Zt,n=new Dt,i=new Ot(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 Ft},normalMatrix:{value:new qt}}),this.matrix=new Ft,this.matrixWorld=new Ft,this.matrixAutoUpdate=ce.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Yt,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}ce.DefaultUp=new Ot(0,1,0),ce.DefaultMatrixAutoUpdate=!0,ce.prototype=Object.assign(Object.create(jt.prototype),{constructor:ce,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return Qt.setFromAxisAngle(t,e),this.quaternion.multiply(Qt),this},rotateOnWorldAxis:function(t,e){return Qt.setFromAxisAngle(t,e),this.quaternion.premultiply(Qt),this},rotateX:function(t){return this.rotateOnAxis(re,t)},rotateY:function(t){return this.rotateOnAxis(oe,t)},rotateZ:function(t){return this.rotateOnAxis(ae,t)},translateOnAxis:function(t,e){return Jt.copy(t).applyQuaternion(this.quaternion),this.position.add(Jt.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(re,t)},translateY:function(t){return this.translateOnAxis(oe,t)},translateZ:function(t){return this.translateOnAxis(ae,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4($t.copy(this.matrixWorld).invert())},lookAt:function(t,e,n){t.isVector3?te.copy(t):te.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),ee.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?$t.lookAt(ee,te,this.up):$t.lookAt(te,ee,this.up),this.quaternion.setFromRotationMatrix($t),i&&($t.extractRotation(i.matrixWorld),Qt.setFromRotationMatrix($t),this.quaternion.premultiply(Qt.invert()))},add:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this||t&&t.isObject3D&&(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(se)),this},remove:function(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(le)),this},clear:function(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(le)}return this.children.length=0,this},attach:function(t){return this.updateWorldMatrix(!0,!1),$t.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),$t.multiply(t.parent.matrixWorld)),t.applyMatrix4($t),this.add(t),t.updateWorldMatrix(!1,!0),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(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}},getWorldPosition:function(t){return void 0===t&&(t=new Ot),this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(t=new Dt),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ee,t,ne),t},getWorldScale:function(t){return void 0===t&&(t=new Ot),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ee,ie,t),t},getWorldDirection:function(t){void 0===t&&(t=new Ot),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(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:function(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(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++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){const n=this.parent;if(!0===t&&null!==n&&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++)t[e].updateWorldMatrix(!1,!0)}},toJSON:function(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,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),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.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.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),a=o(t.images),s=o(t.shapes),l=o(t.skeletons),c=o(t.animations);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}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:function(t){return(new this.constructor).copy(this,t)},copy:function(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.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.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}});class ue extends ce{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"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()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}ue.prototype.isScene=!0;const he=100,de=1e3,fe=1001,pe=1002,me=1003,ge=1006,ve=1008,ye=1009,_e=1012,xe=1014,be=1015,we=1016,Me=1020,Se=1022,Ee=1023,Te=1026,Le=1027,Ae=3e3,Pe=7680,Re="300 es";class Ce{constructor(t=0,e=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,e){return void 0!==e?this.addVectors(t,e):(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,e){return void 0!==e?this.subVectors(t,e):(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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){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}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,n){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}}let De;Ce.prototype.isVector2=!0;const Oe=function(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===De&&(De=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),De.width=t.width,De.height=t.height;const n=De.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=De}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")};let Ne=0;class Ie extends jt{constructor(t=Ie.DEFAULT_IMAGE,e=Ie.DEFAULT_MAPPING,n=1001,i=1001,r=1006,o=1008,a=1023,s=1009,l=1,c=3e3){super(),Object.defineProperty(this,"id",{value:Ne++}),this.uuid=Ct.generateUUID(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=s,this.offset=new Ce(0,0),this.repeat=new Ce(1,1),this.center=new Ce(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new qt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}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.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,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.encoding=t.encoding,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.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const i=this.image;if(void 0===i.uuid&&(i.uuid=Ct.generateUUID()),!e&&void 0===t.images[i.uuid]){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)i[t].isDataTexture?e.push(Fe(i[t].image)):e.push(Fe(i[t]))}else e=Fe(i);t.images[i.uuid]={uuid:i.uuid,url:e}}n.image=i.uuid}return e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;
vendor: 19,993 bytes, line 2
2if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case de:t.x=t.x-Math.floor(t.x);break;case fe:t.x=t.x<0?0:1;break;case pe: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 de:t.y=t.y-Math.floor(t.y);break;case fe:t.y=t.y<0?0:1;break;case pe: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++}}function Fe(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Oe(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:{}}Ie.DEFAULT_IMAGE=void 0,Ie.DEFAULT_MAPPING=300,Ie.prototype.isTexture=!0;class ze extends Ie{constructor(t,e,n,i,r,o,a,s,l,c,u,h){super(null,o,a,s,l,c,i,r,u,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==l?l:me,this.minFilter=void 0!==c?c:me,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}ze.prototype.isDataTexture=!0;class Ue{constructor(t=new Ot(1/0,1/0,1/0),e=new Ot(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0;for(let s=0,l=t.length;s<l;s+=3){const l=t[s],c=t[s+1],u=t[s+2];l<e&&(e=l),c<n&&(n=c),u<i&&(i=u),l>r&&(r=l),c>o&&(o=c),u>a&&(a=u)}return this.min.set(e,n,i),this.max.set(r,o,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0;for(let s=0,l=t.count;s<l;s++){const l=t.getX(s),c=t.getY(s),u=t.getZ(s);l<e&&(e=l),c<n&&(n=c),u<i&&(i=u),l>r&&(r=l),c>o&&(o=c),u>a&&(a=u)}return this.min.set(e,n,i),this.max.set(r,o,a),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=Be.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}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 void 0===t&&(t=new Ot),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return void 0===t&&(t=new Ot),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){t.updateWorldMatrix(!1,!1);const e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),Ge.copy(e.boundingBox),Ge.applyMatrix4(t.matrixWorld),this.union(Ge));const n=t.children;for(let t=0,e=n.length;t<e;t++)this.expandByObject(n[t]);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 void 0===e&&(e=new Ot),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,Be),Be.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(Ye),qe.subVectors(this.max,Ye),He.subVectors(t.a,Ye),Ve.subVectors(t.b,Ye),je.subVectors(t.c,Ye),We.subVectors(Ve,He),Xe.subVectors(je,Ve),Ze.subVectors(He,je);let e=[0,-We.z,We.y,0,-Xe.z,Xe.y,0,-Ze.z,Ze.y,We.z,0,-We.x,Xe.z,0,-Xe.x,Ze.z,0,-Ze.x,-We.y,We.x,0,-Xe.y,Xe.x,0,-Ze.y,Ze.x,0];return!!Qe(e,He,Ve,je,qe)&&(e=[1,0,0,0,1,0,0,0,1],!!Qe(e,He,Ve,je,qe)&&(Ke.crossVectors(We,Xe),e=[Ke.x,Ke.y,Ke.z],Qe(e,He,Ve,je,qe)))}clampPoint(t,e){return void 0===e&&(e=new Ot),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Be.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Be).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()||(ke[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ke[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ke[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ke[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ke[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ke[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ke[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ke[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ke)),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)}}Ue.prototype.isBox3=!0;const ke=[new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot,new Ot],Be=new Ot,Ge=new Ue,He=new Ot,Ve=new Ot,je=new Ot,We=new Ot,Xe=new Ot,Ze=new Ot,Ye=new Ot,qe=new Ot,Ke=new Ot,Je=new Ot;function Qe(t,e,n,i,r){for(let o=0,a=t.length-3;o<=a;o+=3){Je.fromArray(t,o);const a=r.x*Math.abs(Je.x)+r.y*Math.abs(Je.y)+r.z*Math.abs(Je.z),s=e.dot(Je),l=n.dot(Je),c=i.dot(Je);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>a)return!1}return!0}const $e=new Ue,tn=new Ot,en=new Ot,nn=new Ot;class rn{constructor(t=new Ot,e=-1){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):$e.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 void 0===e&&(e=new Ot),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return void 0===t&&(t=new Ue),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){nn.subVectors(t,this.center);const e=nn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.add(nn.multiplyScalar(n/t)),this.radius+=n}return this}union(t){return en.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(tn.copy(t.center).add(en)),this.expandByPoint(tn.copy(t.center).sub(en)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const on=new Ot,an=new Ot,sn=new qt;class ln{constructor(t=new Ot(1,0,0),e=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=on.subVectors(n,e).cross(an.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 void 0===e&&(e=new Ot),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){void 0===e&&(e=new Ot);const n=t.delta(on),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(n).multiplyScalar(r).add(t.start)}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 void 0===t&&(t=new Ot),t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||sn.getNormalMatrix(t),i=this.coplanarPoint(on).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)}}ln.prototype.isPlane=!0;const cn=new rn,un=new Ot;class hn{constructor(t=new ln,e=new ln,n=new ln,i=new ln,r=new ln,o=new ln){this.planes=[t,e,n,i,r,o]}set(t,e,n,i,r,o){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[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){const e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],h=n[8],d=n[9],f=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-i,u-s,p-h,y-m).normalize(),e[1].setComponents(a+i,u+s,p+h,y+m).normalize(),e[2].setComponents(a+r,u+l,p+d,y+g).normalize(),e[3].setComponents(a-r,u-l,p-d,y-g).normalize(),e[4].setComponents(a-o,u-c,p-f,y-v).normalize(),e[5].setComponents(a+o,u+c,p+f,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),cn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(cn)}intersectsSprite(t){return cn.center.set(0,0,0),cn.radius=.7071067811865476,cn.applyMatrix4(t.matrixWorld),this.intersectsSphere(cn)}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(un.x=i.normal.x>0?t.max.x:t.min.x,un.y=i.normal.y>0?t.max.y:t.min.y,un.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(un)<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)}}class dn{constructor(t=0,e=0,n=0,i=1){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,e){return void 0!==e?this.addVectors(t,e):(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,e){return void 0!==e?this.subVectors(t,e):(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,a=.1,s=t.elements,l=s[0],c=s[4],u=s[8],h=s[1],d=s[5],f=s[9],p=s[2],m=s[6],g=s[10];if(Math.abs(c-h)<o&&Math.abs(u-p)<o&&Math.abs(f-m)<o){if(Math.abs(c+h)<a&&Math.abs(u+p)<a&&Math.abs(f+m)<a&&Math.abs(l+d+g-3)<a)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,s=(d+1)/2,v=(g+1)/2,y=(c+h)/4,_=(u+p)/4,x=(f+m)/4;return t>s&&t>v?t<o?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=y/n,r=_/n):s>v?s<o?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(s),n=y/i,r=x/i):v<o?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(v),n=_/r,i=x/r),this.set(n,i,r,e),this}let v=Math.sqrt((m-f)*(m-f)+(u-p)*(u-p)+(h-c)*(h-c));return Math.abs(v)<.001&&(v=1),this.x=(m-f)/v,this.y=(u-p)/v,this.z=(h-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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(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,n){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}}dn.prototype.isVector4=!0;const fn={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},pn={h:0,s:0,l:0},mn={h:0,s:0,l:0};function gn(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}
vendor: 7,859 bytes, line 2
2function vn(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function yn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class _n{constructor(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=Ct.euclideanModulo(t,1),e=Ct.clamp(e,0,1),n=Ct.clamp(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=gn(r,i,t+1/3),this.g=gn(r,i,t),this.b=gn(r,i,t-1/3)}return this}setStyle(t){function e(t){void 0!==t&&parseFloat(t)}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const i=n[1],r=n[2];switch(i){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const n=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(n,i,r)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=fn[t];return void 0!==e&&this.setHex(e),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}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=vn(t.r),this.g=vn(t.g),this.b=vn(t.b),this}copyLinearToSRGB(t){return this.r=yn(t.r),this.g=yn(t.g),this.b=yn(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){void 0===t&&(t={h:0,s:0,l:0});const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i),o=Math.min(e,n,i);let a,s;const l=(o+r)/2;if(o===r)a=0,s=0;else{const t=r-o;switch(s=l<=.5?t/(r+o):t/(2-r-o),r){case e:a=(n-i)/t+(n<i?6:0);break;case n:a=(i-e)/t+2;break;case i:a=(e-n)/t+4}a/=6}return t.h=a,t.s=s,t.l=l,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,n){return this.getHSL(pn),pn.h+=t,pn.s+=e,pn.l+=n,this.setHSL(pn.h,pn.s,pn.l),this}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(pn),t.getHSL(mn);const n=Ct.lerp(pn.h,mn.h,e),i=Ct.lerp(pn.s,mn.s,e),r=Ct.lerp(pn.l,mn.l,e);return this.setHSL(n,i,r),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),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}function xn(){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 bn(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);void 0===o?i.set(e,function(e,i){const r=e.array,o=e.usage,a=t.createBuffer();t.bindBuffer(i,a),t.bufferData(i,r,o),e.onUploadCallback();let s=t.FLOAT;return r instanceof Float32Array?s=t.FLOAT:r instanceof Float64Array||(r instanceof Uint16Array?e.isFloat16BufferAttribute?n&&(s=t.HALF_FLOAT):s=t.UNSIGNED_SHORT:r instanceof Int16Array?s=t.SHORT:r instanceof Uint32Array?s=t.UNSIGNED_INT:r instanceof Int32Array?s=t.INT:r instanceof Int8Array?s=t.BYTE:r instanceof Uint8Array&&(s=t.UNSIGNED_BYTE)),{buffer:a,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(e,r)):o.version<e.version&&(!function(e,i,r){const o=i.array,a=i.updateRange;t.bindBuffer(r,e),-1===a.count?t.bufferSubData(r,0,o):(n?t.bufferSubData(r,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):t.bufferSubData(r,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1)}(o.buffer,e,r),o.version=e.version)}}}_n.NAMES=fn,_n.prototype.isColor=!0,_n.prototype.r=1,_n.prototype.g=1,_n.prototype.b=1;const wn=new Ot,Mn=new Ce;function Sn(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function En(t,e,n){Sn.call(this,new Int8Array(t),e,n)}function Tn(t,e,n){Sn.call(this,new Uint8Array(t),e,n)}function Ln(t,e,n){Sn.call(this,new Uint8ClampedArray(t),e,n)}function An(t,e,n){Sn.call(this,new Int16Array(t),e,n)}function Pn(t,e,n){Sn.call(this,new Uint16Array(t),e,n)}function Rn(t,e,n){Sn.call(this,new Int32Array(t),e,n)}function Cn(t,e,n){Sn.call(this,new Uint32Array(t),e,n)}function Dn(t,e,n){Sn.call(this,new Uint16Array(t),e,n)}function On(t,e,n){Sn.call(this,new Float32Array(t),e,n)}function Nn(t,e,n){Sn.call(this,new Float64Array(t),e,n)}function In(t){if(0===t.length)return-1/0;let e=t[0];for(let n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(Sn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Sn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(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},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;
2for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(r=new _n),e[n++]=r.r,e[n++]=r.g,e[n++]=r.b}return this},copyVector2sArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(r=new Ce),e[n++]=r.x,e[n++]=r.y}return this},copyVector3sArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(r=new Ot),e[n++]=r.x,e[n++]=r.y,e[n++]=r.z}return this},copyVector4sArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(r=new dn),e[n++]=r.x,e[n++]=r.y,e[n++]=r.z,e[n++]=r.w}return this},applyMatrix3:function(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Mn.fromBufferAttribute(this,e),Mn.applyMatrix3(t),this.setXY(e,Mn.x,Mn.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)wn.fromBufferAttribute(this,e),wn.applyMatrix3(t),this.setXYZ(e,wn.x,wn.y,wn.z);return this},applyMatrix4:function(t){for(let e=0,n=this.count;e<n;e++)wn.x=this.getX(e),wn.y=this.getY(e),wn.z=this.getZ(e),wn.applyMatrix4(t),this.setXYZ(e,wn.x,wn.y,wn.z);return this},applyNormalMatrix:function(t){for(let e=0,n=this.count;e<n;e++)wn.x=this.getX(e),wn.y=this.getY(e),wn.z=this.getZ(e),wn.applyNormalMatrix(t),this.setXYZ(e,wn.x,wn.y,wn.z);return this},transformDirection:function(t){for(let e=0,n=this.count;e<n;e++)wn.x=this.getX(e),wn.y=this.getY(e),wn.z=this.getZ(e),wn.transformDirection(t),this.setXYZ(e,wn.x,wn.y,wn.z);return this},set:function(t,e=0){return this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),35044!==this.usage&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}}),En.prototype=Object.create(Sn.prototype),En.prototype.constructor=En,Tn.prototype=Object.create(Sn.prototype),Tn.prototype.constructor=Tn,Ln.prototype=Object.create(Sn.prototype),Ln.prototype.constructor=Ln,An.prototype=Object.create(Sn.prototype),An.prototype.constructor=An,Pn.prototype=Object.create(Sn.prototype),Pn.prototype.constructor=Pn,Rn.prototype=Object.create(Sn.prototype),Rn.prototype.constructor=Rn,Cn.prototype=Object.create(Sn.prototype),Cn.prototype.constructor=Cn,Dn.prototype=Object.create(Sn.prototype),Dn.prototype.constructor=Dn,Dn.prototype.isFloat16BufferAttribute=!0,On.prototype=Object.create(Sn.prototype),On.prototype.constructor=On,Nn.prototype=Object.create(Sn.prototype),Nn.prototype.constructor=Nn;Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let Fn=0;const zn=new Ft,Un=new ce,kn=new Ot,Bn=new Ue,Gn=new Ue,Hn=new Ot;function Vn(){Object.defineProperty(this,"id",{value:Fn++}),this.uuid=Ct.generateUUID(),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={}}Vn.prototype=Object.assign(Object.create(jt.prototype),{constructor:Vn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){return Array.isArray(t)?this.index=new(In(t)>65535?Cn:Pn)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;
vendor: 4,559 bytes, line 2
2void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new qt).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},rotateX:function(t){return zn.makeRotationX(t),this.applyMatrix4(zn),this},rotateY:function(t){return zn.makeRotationY(t),this.applyMatrix4(zn),this},rotateZ:function(t){return zn.makeRotationZ(t),this.applyMatrix4(zn),this},translate:function(t,e,n){return zn.makeTranslation(t,e,n),this.applyMatrix4(zn),this},scale:function(t,e,n){return zn.makeScale(t,e,n),this.applyMatrix4(zn),this},lookAt:function(t){return Un.lookAt(t),Un.updateMatrix(),this.applyMatrix4(Un.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(kn).negate(),this.translate(kn.x,kn.y,kn.z),this},setFromPoints:function(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 On(e,3)),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Ue);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)this.boundingBox.set(new Ot(-1/0,-1/0,-1/0),new Ot(1/0,1/0,1/0));else{if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];Bn.setFromBufferAttribute(n),this.morphTargetsRelative?(Hn.addVectors(this.boundingBox.min,Bn.min),this.boundingBox.expandByPoint(Hn),Hn.addVectors(this.boundingBox.max,Bn.max),this.boundingBox.expandByPoint(Hn)):(this.boundingBox.expandByPoint(Bn.min),this.boundingBox.expandByPoint(Bn.max))}}else this.boundingBox.makeEmpty();isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)}},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new rn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)this.boundingSphere.set(new Ot,1/0);else if(t){const n=this.boundingSphere.center;if(Bn.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];Gn.setFromBufferAttribute(n),this.morphTargetsRelative?(Hn.addVectors(Bn.min,Gn.min),Bn.expandByPoint(Hn),Hn.addVectors(Bn.max,Gn.max),Bn.expandByPoint(Hn)):(Bn.expandByPoint(Gn.min),Bn.expandByPoint(Gn.max))}Bn.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)Hn.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(Hn));if(e)for(let r=0,o=e.length;r<o;r++){const o=e[r],a=this.morphTargetsRelative;for(let e=0,r=o.count;e<r;e++)Hn.fromBufferAttribute(o,e),a&&(kn.fromBufferAttribute(t,e),Hn.add(kn)),i=Math.max(i,n.distanceToSquared(Hn))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)}},computeFaceNormals:function(){},computeTangents:function(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return;const n=t.array,i=e.position.array,r=e.normal.array,o=e.uv.array,a=i.length/3;void 0===e.tangent&&this.setAttribute("tangent",new Sn(new Float32Array(4*a),4));const s=e.tangent.array,l=[],c=[];for(let t=0;t<a;t++)l[t]=new Ot,c[t]=new Ot;const u=new Ot,h=new Ot,d=new Ot,f=new Ce,p=new Ce,m=new Ce,g=new Ot,v=new Ot;function y(t,e,n){u.fromArray(i,3*t),h.fromArray(i,3*e),d.fromArray(i,3*n),f.fromArray(o,2*t),p.fromArray(o,2*e),m.fromArray(o,2*n),h.sub(u),d.sub(u),p.sub(f),m.sub(f);const r=1/(p.x*m.y-m.x*p.y);isFinite(r)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(d,-p.y).multiplyScalar(r),v.copy(d).multiplyScalar(p.x).addScaledVector(h,-m.x).multiplyScalar(r),l[t].add(g),l[e].add(g),l[n].add(g),c[t].add(v),c[e].add(v),c[n].add(v))}let _=this.groups;0===_.length&&(_=[{start:0,count:n.length}]);for(let t=0,e=_.length;t<e;++t){const e=_[t],i=e.start;for(let t=i,r=i+e.count;t<r;t+=3)y(n[t+0],n[t+1],n[t+2])}const x=new Ot,b=new Ot,w=new Ot,M=new Ot;function S(t){w.fromArray(r,3*t),M.copy(w);const e=l[t];x.copy(e),x.sub(w.multiplyScalar(w.dot(e))).normalize(),b.crossVectors(M,e);const n=b.dot(c[t])<0?-1:1;s[4*t]=x.x,s[4*t+1]=x.y,s[4*t+2]=x.z,s[4*t+3]=n}for(let t=0,e=_.length;t<e;++t){const e=_[t],i=e.start;for(let t=i,r=i+e.count;t<r;t+=3)S(n[t+0]),S(n[t+1]),S(n[t+2])}},computeVertexNormals:function(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Sn(new Float32Array(3*e.count),3),this.setAttribute("normal",n
vendor: 5,030 bytes, line 2
2);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new Ot,r=new Ot,o=new Ot,a=new Ot,s=new Ot,l=new Ot,c=new Ot,u=new Ot;if(t)for(let h=0,d=t.count;h<d;h+=3){const d=t.getX(h+0),f=t.getX(h+1),p=t.getX(h+2);i.fromBufferAttribute(e,d),r.fromBufferAttribute(e,f),o.fromBufferAttribute(e,p),c.subVectors(o,r),u.subVectors(i,r),c.cross(u),a.fromBufferAttribute(n,d),s.fromBufferAttribute(n,f),l.fromBufferAttribute(n,p),a.add(c),s.add(c),l.add(c),n.setXYZ(d,a.x,a.y,a.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let t=0,a=e.count;t<a;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),c.subVectors(o,r),u.subVectors(i,r),c.cross(u),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}},merge:function(t,e){if(!t||!t.isBufferGeometry)return;void 0===e&&(e=0);const n=this.attributes;for(const i in n){if(void 0===t.attributes[i])continue;const r=n[i].array,o=t.attributes[i],a=o.array,s=o.itemSize*e,l=Math.min(a.length,r.length-s);for(let t=0,e=s;t<l;t++,e++)r[e]=a[t]}return this},normalizeNormals:function(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Hn.fromBufferAttribute(t,e),Hn.normalize(),t.setXYZ(e,Hn.x,Hn.y,Hn.z)},toNonIndexed:function(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,o=new n.constructor(e.length*i);let a=0,s=0;for(let t=0,r=e.length;t<r;t++){a=e[t]*i;for(let t=0;t<i;t++)o[s++]=n[a++]}return new Sn(o,i,r)}if(null===this.index)return this;const e=new Vn,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=[],a=r[i];for(let e=0,i=a.length;e<i;e++){const i=t(a[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:function(){const t={metadata:{version:4.5,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 a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t},clone:function(){return(new Vn).copy(this)},copy:function(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 a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const s=t.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class jn extends Vn{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 a=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const s=[],l=[],c=[],u=[];let h=0,d=0;function f(t,e,n,i,r,o,f,p,m,g,v){const y=o/m,_=f/g,x=o/2,b=f/2,w=p/2,M=m+1,S=g+1;let E=0,T=0;const L=new Ot;for(let o=0;o<S;o++){const a=o*_-b;for(let s=0;s<M;s++){const h=s*y-x;L[t]=h*i,L[e]=a*r,L[n]=w,l.push(L.x,L.y,L.z),L[t]=0,L[e]=0,L[n]=p>0?1:-1,c.push(L.x,L.y,L.z),u.push(s/m),u.push(1-o/g),E+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const n=h+e+M*t,i=h+e+M*(t+1),r=h+(e+1)+M*(t+1),o=h+(e+1)+M*t;s.push(n,i,o),s.push(i,r,o),T+=6}a.addGroup(d,T,v),d+=T,h+=E}f("z","y","x",-1,-1,n,e,t,o,r,0),f("z","y","x",1,-1,n,e,-t,o,r,1),f("x","z","y",1,1,t,n,e,i,o,2),f("x","z","y",1,-1,t,n,-e,i,o,3),f("x","y","z",1,-1,t,e,n,i,r,4),f("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(s),this.setAttribute("position",new On(l,3)),this.setAttribute("normal",new On(c,3)),this.setAttribute("uv",new On(u,2))}}
vendor: 2,642 bytes, line 2
2class Wn extends Vn{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,a=Math.floor(n),s=Math.floor(i),l=a+1,c=s+1,u=t/a,h=e/s,d=[],f=[],p=[],m=[];for(let t=0;t<c;t++){const e=t*h-o;for(let n=0;n<l;n++){const i=n*u-r;f.push(i,-e,0),p.push(0,0,1),m.push(n/a),m.push(1-t/s)}}for(let t=0;t<s;t++)for(let e=0;e<a;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 On(f,3)),this.setAttribute("normal",new On(p,3)),this.setAttribute("uv",new On(m,2))}}let Xn=0;function Zn(){Object.defineProperty(this,"id",{value:Xn++}),this.uuid=Ct.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=he,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Pe,this.stencilZFail=Pe,this.stencilZPass=Pe,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.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function Yn(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)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function qn(t){const e={};for(let n=0;n<t.length;n++){const i=Yn(t[n]);for(const t in i)e[t]=i[t]}return e}Zn.prototype=Object.assign(Object.create(jt.prototype),{constructor:Zn,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n)continue;if("shading"===e){this.flatShading=1===n;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)}},toJSON:function(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,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}
vendor: 4,615 bytes, line 2
2if(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),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.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()),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.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),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),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,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),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.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&
vendor: 6,056 bytes, line 2
2(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(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:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,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.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.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Zn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});const Kn={clone:Yn,merge:qn};function Jn(t){Zn.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(t.attributes,this.setValues(t))}Jn.prototype=Object.create(Zn.prototype),Jn.prototype.constructor=Jn,Jn.prototype.isShaderMaterial=!0,Jn.prototype.copy=function(t){return Zn.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Yn(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this},Jn.prototype.toJSON=function(t){const e=Zn.prototype.toJSON.call(this,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;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};const Qn=new Ot,$n=new Ot,ti=new Ot,ei=new Ot,ni=new Ot,ii=new Ot,ri=new Ot;const oi=new Ot,ai=new Ot,si=new Ot,li=new Ot,ci=new Ot,ui=new Ot,hi=new Ot,di=new Ot,fi=new Ot,pi=new Ot;class mi{constructor(t=new Ot,e=new Ot,n=new Ot){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){void 0===i&&(i=new Ot),i.subVectors(n,e),oi.subVectors(t,e),i.cross(oi);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){oi.subVectors(i,e),ai.subVectors(n,e),si.subVectors(t,e);const o=oi.dot(oi),a=oi.dot(ai),s=oi.dot(si),l=ai.dot(ai),c=ai.dot(si),u=o*l-a*a;if(void 0===r&&(r=new Ot),0===u)return r.set(-2,-1,-1);const h=1/u,d=(l*s-a*c)*h,f=(o*c-a*s)*h;return r.set(1-d-f,f,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,li),li.x>=0&&li.y>=0&&li.x+li.y<=1}static getUV(t,e,n,i,r,o,a,s){return this.getBarycoord(t,e,n,i,li),s.set(0,0),s.addScaledVector(r,li.x),s.addScaledVector(o,li.y),s.addScaledVector(a,li.z),s}static isFrontFacing(t,e,n,i){return oi.subVectors(n,e),ai.subVectors(t,e),oi.cross(ai).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}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 oi.subVectors(this.c,this.b),ai.subVectors(this.a,this.b),.5*oi.cross(ai).length()}getMidpoint(t){return void 0===t&&(t=new Ot),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return mi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return void 0===t&&(t=new ln),t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return mi.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return mi.getUV(t,this.a,this.b,this.c,e,n,i,r)}
vendor: 5,231 bytes, line 2
2containsPoint(t){return mi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return mi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){void 0===e&&(e=new Ot);const n=this.a,i=this.b,r=this.c;let o,a;ci.subVectors(i,n),ui.subVectors(r,n),di.subVectors(t,n);const s=ci.dot(di),l=ui.dot(di);if(s<=0&&l<=0)return e.copy(n);fi.subVectors(t,i);const c=ci.dot(fi),u=ui.dot(fi);if(c>=0&&u<=c)return e.copy(i);const h=s*u-c*l;if(h<=0&&s>=0&&c<=0)return o=s/(s-c),e.copy(n).addScaledVector(ci,o);pi.subVectors(t,r);const d=ci.dot(pi),f=ui.dot(pi);if(f>=0&&d<=f)return e.copy(r);const p=d*l-s*f;if(p<=0&&l>=0&&f<=0)return a=l/(l-f),e.copy(n).addScaledVector(ui,a);const m=c*f-d*u;if(m<=0&&u-c>=0&&d-f>=0)return hi.subVectors(r,i),a=(u-c)/(u-c+(d-f)),e.copy(i).addScaledVector(hi,a);const g=1/(m+p+h);return o=p*g,a=h*g,e.copy(n).addScaledVector(ci,o).addScaledVector(ui,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class gi extends Zn{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new _n(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.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,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.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.skinning=t.skinning,this.morphTargets=t.morphTargets,this}}gi.prototype.isMeshBasicMaterial=!0;const vi=new Ft,yi=new class{constructor(t=new Ot,e=new Ot(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 void 0===e&&(e=new Ot),e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Qn)),this}closestPointToPoint(t,e){void 0===e&&(e=new Ot),e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Qn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Qn.copy(this.direction).multiplyScalar(e).add(this.origin),Qn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){$n.copy(t).add(e).multiplyScalar(.5),ti.copy(e).sub(t).normalize(),ei.copy(this.origin).sub($n);const r=.5*t.distanceTo(e),o=-this.direction.dot(ti),a=ei.dot(this.direction),s=-ei.dot(ti),l=ei.lengthSq(),c=Math.abs(1-o*o);let u,h,d,f;if(c>0)if(u=o*s-a,h=o*a-s,f=r*c,u>=0)if(h>=-f)if(h<=f){const t=1/c;u*=t,h*=t,d=u*(u+o*h+2*a)+h*(o*u+h+2*s)+l}else h=r,u=Math.max(0,-(o*h+a)),d=-u*u+h*(h+2*s)+l;else h=-r,u=Math.max(0,-(o*h+a)),d=-u*u+h*(h+2*s)+l;else h<=-f?(u=Math.max(0,-(-o*r+a)),h=u>0?-r:Math.min(Math.max(-r,-s),r),d=-u*u+h*(h+2*s)+l):h<=f?(u=0,h=Math.min(Math.max(-r,-s),r),d=h*(h+2*s)+l):(u=Math.max(0,-(o*r+a)),h=u>0?r:Math.min(Math.max(-r,-s),r),d=-u*u+h*(h+2*s)+l);else h=o>0?-r:r,u=Math.max(0,-(o*h+a)),d=-u*u+h*(h+2*s)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),i&&i.copy(ti).multiplyScalar(h).add($n),d}intersectSphere(t,e){Qn.subVectors(t.center,this.origin);const n=Qn.dot(this.direction),i=Qn.dot(Qn)-n*n,r=t.radius*t.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,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,a,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(t.min.x-h.x)*l,i=(t.max.x-h.x)*l):(n=(t.max.x-h.x)*l,i=(t.min.x-h.x)*l),c>=0?(r=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(r=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),n>o||r>i?null:((r>n||n!=n)&&(n=r),(o<i||i!=i)&&(i=o),u>=0?(a=(t.min.z-h.z)*u,s=(t.max.z-h.z)*u):(a=(t.max.z-h.z)*u,s=(t.min.z-h.z)*u),n>s||a>i?null:((a>n||n!=n)&&(n=a),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,Qn)}intersectTriangle(t,e,n,i,r){ni.subVectors(e,t),ii.subVectors(n,t),r
vendor: 5,283 bytes, line 2
2i.crossVectors(ni,ii);let o,a=this.direction.dot(ri);if(a>0){if(i)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}ei.subVectors(this.origin,t);const s=o*this.direction.dot(ii.crossVectors(ei,ii));if(s<0)return null;const l=o*this.direction.dot(ni.cross(ei));if(l<0)return null;if(s+l>a)return null;const c=-o*ei.dot(ri);return c<0?null:this.at(c/a,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)}},_i=new rn,xi=new Ot,bi=new Ot,wi=new Ot,Mi=new Ot,Si=new Ot,Ei=new Ot,Ti=new Ot,Li=new Ot,Ai=new Ot,Pi=new Ce,Ri=new Ce,Ci=new Ce,Di=new Ot,Oi=new Ot;function Ni(t=new Vn,e=new gi){ce.call(this),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}function Ii(t,e,n,i,r,o,a,s,l,c,u,h){xi.fromBufferAttribute(r,c),bi.fromBufferAttribute(r,u),wi.fromBufferAttribute(r,h);const d=t.morphTargetInfluences;if(e.morphTargets&&o&&d){Ti.set(0,0,0),Li.set(0,0,0),Ai.set(0,0,0);for(let t=0,e=o.length;t<e;t++){const e=d[t],n=o[t];0!==e&&(Mi.fromBufferAttribute(n,c),Si.fromBufferAttribute(n,u),Ei.fromBufferAttribute(n,h),a?(Ti.addScaledVector(Mi,e),Li.addScaledVector(Si,e),Ai.addScaledVector(Ei,e)):(Ti.addScaledVector(Mi.sub(xi),e),Li.addScaledVector(Si.sub(bi),e),Ai.addScaledVector(Ei.sub(wi),e)))}xi.add(Ti),bi.add(Li),wi.add(Ai)}t.isSkinnedMesh&&e.skinning&&(t.boneTransform(c,xi),t.boneTransform(u,bi),t.boneTransform(h,wi));const f=function(t,e,n,i,r,o,a,s){let l;if(l=1===e.side?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,2!==e.side,s),null===l)return null;Oi.copy(s),Oi.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(Oi);return c<n.near||c>n.far?null:{distance:c,point:Oi.clone(),object:t}}(t,e,n,i,xi,bi,wi,Di);if(f){s&&(Pi.fromBufferAttribute(s,c),Ri.fromBufferAttribute(s,u),Ci.fromBufferAttribute(s,h),f.uv=mi.getUV(Di,xi,bi,wi,Pi,Ri,Ci,new Ce)),l&&(Pi.fromBufferAttribute(l,c),Ri.fromBufferAttribute(l,u),Ci.fromBufferAttribute(l,h),f.uv2=mi.getUV(Di,xi,bi,wi,Pi,Ri,Ci,new Ce));const t={a:c,b:u,c:h,normal:new Ot,materialIndex:0};mi.getNormal(xi,bi,wi,t.normal),f.face=t}return f}Ni.prototype=Object.assign(Object.create(ce.prototype),{constructor:Ni,isMesh:!0,copy:function(t){return ce.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length}},raycast:function(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),_i.copy(n.boundingSphere),_i.applyMatrix4(r),!1===t.ray.intersectsSphere(_i))return;if(vi.copy(r).invert(),yi.copy(t.ray).applyMatrix4(vi),null!==n.boundingBox&&!1===yi.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const r=n.index,a=n.attributes.position,s=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,u=n.attributes.uv2,h=n.groups,d=n.drawRange;if(null!==r)if(Array.isArray(i))for(let n=0,f=h.length;n<f;n++){const f=h[n],p=i[f.materialIndex];for(let n=Math.max(f.start,d.start),i=Math.min(f.start+f.count,d.start+d.count);n<i;n+=3){const i=r.getX(n),h=r.getX(n+1),d=r.getX(n+2);o=Ii(this,p,t,yi,a,s,l,c,u,i,h,d),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=f.materialIndex,e.push(o))}}else{for(let n=Math.max(0,d.start),h=Math.min(r.count,d.start+d.count);n<h;n+=3){const h=r.getX(n),d=r.getX(n+1),f=r.getX(n+2);o=Ii(this,i,t,yi,a,s,l,c,u,h,d,f),o&&(o.faceIndex=Math.floor(n/3),e.push(o))}}else if(void 0!==a)if(Array.isArray(i))for(let n=0,r=h.length;n<r;n++){const r=h[n],f=i[r.materialIndex];for(let n=Math.max(r.start,d.start),i=Math.min(r.start+r.count,d.start+d.count);n<i;n+=3){o=Ii(this,f,t,yi,a,s,l,c,u,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=r.materialIndex,e.push(o))}}else{for(let n=Math.max(0,d.start),r=Math.min(a.count,d.start+d.count);n<r;n+=3){o=Ii(this,i,t,yi,a,s,l,c,u,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),e.push(o))}}}else n.isGeometry}});const Fi={alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot
2( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:'\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n}\n\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\n\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t// page 32, equation 26: E[window1]\n\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t// this is intended to be used on spot and point lights who are represented as luminous intensity\n\t// but who must be converted to luminous irradiance for surface lighting calculation\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\tif( cutoffDistance > 0.0 ) {\n\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t}\n\n\treturn distanceFalloff;\n\n#else\n\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t}\n\n\treturn 1.0;\n\n#endif\n\n}\n\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\n\t// Original approximation by Christophe Schlick \'94\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n} // validated\n\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\n\t// See F_Schlick\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\n\treturn Fr * fresnel + F0;\n\n}\n\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\n\t// also see #12151\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\n\treturn 1.0 / ( gl * gv );\n\n} // validated\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );
2\n\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\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\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\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\n\tfloat theta_sintheta = ( x >
2 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\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\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\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\n\t// project rect onto sphere\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\n\t// calculate vector form factor\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\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\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\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\n\treturn specularColor * brdf.x + brdf.y;\n\n} // validated\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );
2\n\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\n\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L94\nfloat D_Charlie(float roughness, float NoH) {\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L136\nfloat V_Neubelt(float NoV, float NoL) {\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\n\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n\n}\n\n#endif\n',bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvClipPosition = - mvPosition.xyz;\n\n#endif\n",color_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tdiffuseColor *= vColor;\n\n#elif defined( USE_COLOR )\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvColor = vec4( 1.0 );\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvColor = vec3( 1.0 );\n\n#endif\n\n#ifdef USE_COLOR\n\n\tvColor *= color;\n\n#endif\n\n#ifdef USE_INSTANCING_COLOR\n\n\tvColor.xyz *= instanceColor.xyz;\n\n#endif\n",common:"\n#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\n#ifndef saturate\n// <tonemapping_pars_fragment> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float 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 average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\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\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t// dir can be either a direction vector or a normal vector\n\t// upper-left 3x3 of matrix is assumed to be orthogonal\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\n\treturn - distance * planeNormal + point;\n\n}\n\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n\n}\n\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\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\n\treturn tmp;\n\n}\n\n// https://en.wikipedia.org/wiki/Relative_luminance\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\n\treturn dot( weights, color.rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n\treturn m[ 2 ][ 3 ] == - 1.0;\n\n}\n\nvec2 equirectUv( in vec3 dir ) {\n\n\t// dir is assumed to be unit length\n\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\treturn vec2( u, v );\n\n}\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\n\t// These shader functions convert between the UV coordinates of a single face of\n\t// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n\t// sampling a textureCube (not generally normalized ).\n\n\tfloat getFace( vec3 direction ) {\n\n\t\tvec3 absDirection = abs( direction );\n\n\t\tfloat face = - 1.0;\n\n\t\tif ( absDirection.x > absDirection.z ) {\n\n\t\t\tif ( absDirection.x > absDirection.y )\n\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t} else {\n\n\t\t\tif ( absDirection.z > absDirection.y )\n\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t}\n\n\t\treturn face;\n\n\t}\n\n\t// RH coordinate system; PMREM face-indexing convention\n\tvec2 getUV( vec3 direction, float face ) {\n\n\t\tvec2 uv;\n\n\t\tif ( face == 0.0 ) {\n\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n\n\t\t} else if ( face == 1.0 ) {\n\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n\n\t\t} else if ( face == 2.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n\n\t\t} else if ( face == 3.0 ) {\n\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n\n\t\t} else if ( face == 4.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n\n\t\t} else {\n\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n\n\t\t}\n\n\t\treturn 0.5 * ( uv + 1.0 );\n\n\t}\n\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\n\t\tfloat face = getFace( direction );\n\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\n\t\tfloat faceSize = exp2( mipInt );\n\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\n\t\tvec2 f = fract( uv );\n\n\t\tuv += 0.5 - f;\n\n\t\tif ( face > 2.0 ) {\n\n\t\t\tuv.y += faceSize;\n\n\t\t\tface -= 3.0;\n\n\t\t}\n\n\t\tuv.x += face * faceSize;\n\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\n\t\t}\n\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\n\t\tuv *= texelSize;\n\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\n\t\tuv.x += texelSize;\n\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\n\t\tuv.y += texelSize;\n\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\n\t\tuv.x -= texelSize;\n\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\n\t\tvec3 tm = mix( tl, tr, f.x );\n\n\t\tvec3 bm = mix( bl, br, f.x );\n\n\t\treturn mix( tm, bm, f.y );\n\n\t}\n\n\t// These defines must match with PMREMGenerator\n\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\n\tfloat roughnessToMip( float roughness ) {\n\n\t\tfloat mip = 0.0;\n\n\t\tif ( roughness >= r1 ) {\n\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\n\t\t} else if ( roughness >= r4 ) {\n\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\n\t\t} else if ( roughness >= r5 ) {\n\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\n\t\t} else if ( roughness >= r6 ) {\n\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\n\t\t} else {\n\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness ); // 1.16 = 1.79^0.25\n\t\t}\n\n\t\treturn mip;\n\n\t}\n\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\n\t\tfloat mipF = fract( mip );\n\n\t\tfloat mipInt = floor( mip );\n\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\n\t\tif ( mipF == 0.0 ) {\n\n\t\t\treturn vec4( color0, 1.0 );\n\n\t\t} else {\n\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\n\t\t}\n\n\t}\n\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\t// this is in lieu of a per-instance normal-matrix\n\t// shear transforms in the instance matrix are not supported\n\n\tmat3 m = mat3( instanceMatrix );\n\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\n\ttransformedNormal = m * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + dis
2placementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",encodings_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\n// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\n\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\n\nvec4 LinearTosRGB( 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}\n\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\n\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n\t// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\n\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\n\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\t// NOTE: The implementation with min causes the shader to not compile on\n\t// a common Alcatel A502DL in Chrome 78/Android 8.1. Some research suggests \n\t// that the chipset is Mediatek MT6739 w/ IMG PowerVR GE8100 GPU.\n\t// D = min( floor( D ) / 255.0, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\n\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\n\n// M matrix, for encoding\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\n\n// Inverse M matrix, for decoding\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\n\t\tenvColor = envMapTexelToLinear( envColor );\n\n\t#endif\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\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\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#if defined( USE_ENVMAP )\n\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\n\tvec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {\n\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#else\n\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\n\t\t#else\n\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\n\t\t#endif\n\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t}\n\n\t// Trowbridge-Reitz distribution to Mip level, following the logic of http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\n\t\t// clamp to allowable LOD ranges.\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\n\t}\n\n\tvec3 getLightProbeIndirectRadiance( /*const in SpecularLightProbe specularLightProbe,*/ const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\n\t\t\t// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\n\t\t#endif\n\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t#endif\n\n\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t}\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t}
2 else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tfogDepth = - mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float fogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n\n#ifdef USE_GRADIENTMAP\n\n\tuniform sampler2D gradientMap;\n\n#endif\n\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t// dotNL will be from -1.0 to 1.0\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t#ifdef USE_GRADIENTMAP\n\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\n\t#else\n\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\n\t#endif\n\n}\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_vertex:"\nvec3 diffuse = vec3( 1.0 );\n\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\n\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\n\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\n\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\n\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n\n#ifdef DOUBLE_SIDED\n\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n\n#endif\n\n#if NUM_POINT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_SPOT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n/*\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\t// TODO (abelnation): implement\n\n\t}\n\n#endif\n*/\n\n#if NUM_DIR_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_HEMI_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\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\n\t// band 2\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\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI;\n\n\t#endif\n\n\treturn irradiance;\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\n\t}
2\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\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\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\n\t\tif ( angleCos > spotLight.coneCos ) {\n\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\n\t\t} else {\n\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\n\t\t}\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tirradiance *= PI;\n\n\t\t#endif\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_toon_fragment:"\nToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\n",lights_toon_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct ToonMaterial {\n\n\tvec3 diffuseColor;\n\n};\n\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct BlinnPhongMaterial {\n\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot
2( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n\n#ifdef REFLECTIVITY\n\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n\n#endif\n\n#ifdef CLEARCOAT\n\n\tmaterial.clearcoat = clearcoat;
2\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\n\t#ifdef USE_CLEARCOATMAP\n\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\n\t#endif\n\n\tmaterial.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n\n#endif\n\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheen;\n\n#endif\n",lights_physical_pars_fragment:"\nstruct PhysicalMaterial {\n\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n\n};\n\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\n\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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.specularRoughness;\n\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\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\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tccIrradiance *= PI; // punctual light\n\n\t\t#endif\n\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNV = saturate( dot
2( geometry.clearcoatNormal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\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\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n",lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - If you have defined an RE_IndirectSpecular, you need to also provide a Material_LightProbeLOD. <---- ???\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( 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\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_L
2IGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\n\t#ifdef CLEARCOAT\n\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n\n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_MAP\n\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tuniform mat3 uvTransform;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifndef USE_MORPHNORMALS\n\n\t\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\t\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\nfloat faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n\n#ifdef FLAT_SHADED\n\n\t// Workaround for Adreno GPUs not able to do dFdx( vViewPosition )\n\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * faceDirection;\n\n\t#endif\n\n\t#ifdef USE_TANGENT\n\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\n\t\t#endif\n\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 geometryNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * faceDirection;\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( TANGENTSPACE_NORMALMAP )\n\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tnormal = normalize( vTBN * mapN );
2\n\n\t#else\n\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection );\n\n\t#endif\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection );\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\n\t// Normal Mapping Without Precomputed Tangents\n\t// http://www.thetenthplanet.de/archives/1180\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 N = surf_norm; // normalized\n\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef CLEARCOAT\n\n\tvec3 clearcoatNormal = geometryNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\n\t#else\n\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\n\t#endif\n\n#endif\n",clearcoat_pars_fragment:"\n\n#ifdef USE_CLEARCOATMAP\n\n\tuniform sampler2D clearcoatMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform sampler2D clearcoatRoughnessMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\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}\n\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\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 linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\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 invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift acording to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n",shadowmap_pars_fragment:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\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\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
2\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\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\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\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\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\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 ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\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\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\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\n\t\t\tvec2 uv = shadowCoord.xy;
2\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\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\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t//  y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim    := ( 4 , 2 )\n\t\t//  # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\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\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\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\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n",shadowmap_pars_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\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\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
2\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\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\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\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\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\t// Offsetting the position used for querying occlusion along the world normal can be used to reduce shadow acne.\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\n\t#endif\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLightShadow directionalLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLightShadow spotLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLightShadow pointLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\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\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\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\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\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\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\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\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// <common> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;
2\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn toneMappingExposure * color;\n\n}\n\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\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\n}\n\n// source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs\nvec3 RRTAndODTFit( vec3 v ) {\n\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\n}\n\n// this implementation of ACES is modified to accommodate a brighter viewing environment.\n// the scale factor of 1/0.6 is subjective. see discussion in #19621.\n\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\t// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ), // transposed from source\n\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\n\t// ODT_SAT => XYZ => D60_2_D65 => sRGB\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ), // transposed from source\n\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\n\tcolor *= toneMappingExposure / 0.6;\n\n\tcolor = ACESInputMat * color;\n\n\t// Apply RRT and ODT\n\tcolor = RRTAndODTFit( color );\n\n\tcolor = ACESOutputMat * color;\n\n\t// Clamp to [0, 1]\n\treturn saturate( color );\n\n}\n\nvec3 CustomToneMapping( vec3 color ) { return color; }\n",transmissionmap_fragment:"\n#ifdef USE_TRANSMISSIONMAP\n\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n\n#endif\n",transmissionmap_pars_fragment:"\n#ifdef USE_TRANSMISSIONMAP\n\n\tuniform sampler2D transmissionMap;\n\n#endif\n",uv_pars_fragment:"\n#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\n\tvarying vec2 vUv;\n\n#endif\n",uv_pars_vertex:"\n#ifdef USE_UV\n\n\t#ifdef UVS_VERTEX_ONLY\n\n\t\tvec2 vUv;\n\n\t#else\n\n\t\tvarying vec2 vUv;\n\n\t#endif\n\n\tuniform mat3 uvTransform;\n\n#endif\n",uv_vertex:"\n#ifdef USE_UV\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n",uv2_pars_fragment:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvarying vec2 vUv2;\n\n#endif\n",uv2_pars_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n\tuniform mat3 uv2Transform;\n\n#endif\n",uv2_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",background_frag:"\nuniform sampler2D t2D;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",cube_frag:"\n#include <envmap_common_pars_fragment>\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\
2n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n",depth_vert:"\n#include <common>\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>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\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\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\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\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV = equirectUv( direction );\n\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\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\nvoid main() {\n\n\tvLineDistance = scale * lineDistance;\n\n\t#include <color_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\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_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 <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\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 <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshbasic_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\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\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshlambert_frag:"\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_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 <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\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 <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\t#include <lightmap_fragment>\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\n\t// modulation\n\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\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\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\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\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\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 <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\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; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matc
2apColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( 1.0 );\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\t\tvNormal = normalize( transformedNormal );\n\n\t#endif\n\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\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshtoon_frag:"\n#define TOON\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_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 <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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\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 <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshtoon_vert:"\n#define TOON\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_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 <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\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 <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_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 <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n\n#ifdef CLEARCOAT\n\tuniform float clearcoat;
2\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\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 <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\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 <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 <transmissionmap_fragment>\n\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t// this is a stub for the transmission model\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",normal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n}\n",normal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\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\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\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\nvoid main() {\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n\nvoid main() {\n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",shadow_vert:"\n#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n\nvoid main() {\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\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\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\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\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\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\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n"},zi={common:{diffuse:{value:new _n(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new qt},uv2Transform:{value:new qt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ce(1,1)}}
vendor: 5,160 bytes, line 2
2,displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _n(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new _n(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new qt}},sprite:{diffuse:{value:new _n(15658734)},opacity:{value:1},center:{value:new Ce(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new qt}}},Ui={basic:{uniforms:qn([zi.common,zi.specularmap,zi.envmap,zi.aomap,zi.lightmap,zi.fog]),vertexShader:Fi.meshbasic_vert,fragmentShader:Fi.meshbasic_frag},lambert:{uniforms:qn([zi.common,zi.specularmap,zi.envmap,zi.aomap,zi.lightmap,zi.emissivemap,zi.fog,zi.lights,{emissive:{value:new _n(0)}}]),vertexShader:Fi.meshlambert_vert,fragmentShader:Fi.meshlambert_frag},phong:{uniforms:qn([zi.common,zi.specularmap,zi.envmap,zi.aomap,zi.lightmap,zi.emissivemap,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.fog,zi.lights,{emissive:{value:new _n(0)},specular:{value:new _n(1118481)},shininess:{value:30}}]),vertexShader:Fi.meshphong_vert,fragmentShader:Fi.meshphong_frag},standard:{uniforms:qn([zi.common,zi.envmap,zi.aomap,zi.lightmap,zi.emissivemap,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.roughnessmap,zi.metalnessmap,zi.fog,zi.lights,{emissive:{value:new _n(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Fi.meshphysical_vert,fragmentShader:Fi.meshphysical_frag},toon:{uniforms:qn([zi.common,zi.aomap,zi.lightmap,zi.emissivemap,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.gradientmap,zi.fog,zi.lights,{emissive:{value:new _n(0)}}]),vertexShader:Fi.meshtoon_vert,fragmentShader:Fi.meshtoon_frag},matcap:{uniforms:qn([zi.common,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.fog,{matcap:{value:null}}]),vertexShader:Fi.meshmatcap_vert,fragmentShader:Fi.meshmatcap_frag},points:{uniforms:qn([zi.points,zi.fog]),vertexShader:Fi.points_vert,fragmentShader:Fi.points_frag},dashed:{uniforms:qn([zi.common,zi.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Fi.linedashed_vert,fragmentShader:Fi.linedashed_frag},depth:{uniforms:qn([zi.common,zi.displacementmap]),vertexShader:Fi.depth_vert,fragmentShader:Fi.depth_frag},normal:{uniforms:qn([zi.common,zi.bumpmap,zi.normalmap,zi.displacementmap,{opacity:{value:1}}]),vertexShader:Fi.normal_vert,fragmentShader:Fi.normal_frag},sprite:{uniforms:qn([zi.sprite,zi.fog]),vertexShader:Fi.sprite_vert,fragmentShader:Fi.sprite_frag},background:{uniforms:{uvTransform:{value:new qt},t2D:{value:null}},vertexShader:Fi.background_vert,fragmentShader:Fi.background_frag},cube:{uniforms:qn([zi.envmap,{opacity:{value:1}}]),vertexShader:Fi.cube_vert,fragmentShader:Fi.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Fi.equirect_vert,fragmentShader:Fi.equirect_frag},distanceRGBA:{uniforms:qn([zi.common,zi.displacementmap,{referencePosition:{value:new Ot},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Fi.distanceRGBA_vert,fragmentShader:Fi.distanceRGBA_frag},shadow:{uniforms:qn([zi.lights,zi.fog,{color:{value:new _n(0)},opacity:{value:1}}]),vertexShader:Fi.shadow_vert,fragmentShader:Fi.shadow_frag}};function ki(t,e,n,i,r){const o=new _n(0);let a,s,l=0,c=null,u=0,h=null;function d(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),l=e,d(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(t){l=t,d(o,l)},render:function(n,r,f,p){let m=!0===r.isScene?r.background:null;m&&m.isTexture&&(m=e.get(m));const g=t.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?d(o,l):m&&m.isColor&&(d(m,1),p=!0),(t.autoClear||p)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||306===m.mapping)?(void 0===s&&(s=new Ni(new jn(1,1,1),new Jn({name:"Backgroun
2dCubeMaterial",uniforms:Yn(Ui.cube.uniforms),vertexShader:Ui.cube.vertexShader,fragmentShader:Ui.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(s)),s.material.uniforms.envMap.value=m,s.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,c===m&&u===m.version&&h===t.toneMapping||(s.material.needsUpdate=!0,c=m,u=m.version,h=t.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null)):m&&m.isTexture&&(void 0===a&&(a=new Ni(new Wn(2,2),new Jn({name:"BackgroundMaterial",uniforms:Yn(Ui.background.uniforms),vertexShader:Ui.background.vertexShader,fragmentShader:Ui.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(a)),a.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),a.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&u===m.version&&h===t.toneMapping||(a.material.needsUpdate=!0,c=m,u=m.version,h=t.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function Bi(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==o,s={},l=d(null);let c=l;function u(e){return i.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function h(e){return i.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function d(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 p(t){m(t,0)}function m(n,r){const o=c.newAttributes,a=c.enabledAttributes,s=c.attributeDivisors;if(o[n]=1,0===a[n]&&(t.enableVertexAttribArray(n),a[n]=1),s[n]!==r){(i.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),s[n]=r}}function g(){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 v(e,n,r,o,a,s){!0!==i.isWebGL2||r!==t.INT&&r!==t.UNSIGNED_INT?t.vertexAttribPointer(e,n,r,o,a,s):t.vertexAttribIPointer(e,n,r,a,s)}function y(){_(),c!==l&&(c=l,u(c.object))}function _(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(r,l,h,y,_){let x=!1;if(a){const e=function(e,n,r){const a=!0===r.wireframe;let l=s[e.id];void 0===l&&(l={},s[e.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let u=c[a];void 0===u&&(u=d(i.isWebGL2?t.createVertexArray():o.createVertexArrayOES()),c[a]=u);return u}(y,h,l);c!==e&&(c=e,u(c.object)),x=function(t,e){const n=c.attributes,i=t.attributes;let r=0;for(const t in i){const e=n[t],o=i[t];if(void 0===e)return!0;if(e.attribute!==o)return!0;if(e.data!==o.data)return!0;r++}return c.attributesNum!==r||c.index!==e}(y,_),x&&function(t,e){const n={},i=t.attributes;let r=0;for(const t in i){const e=i[t],o={};o.attribute=e,e.data&&(o.data=e.data),n[t]=o,r++}c.attributes=n,c.attributesNum=r,c.index=e}(y,_)}else{const t=!0===l.wireframe;c.geometry===y.id&&c.program===h.id&&c.wireframe===t||(c.geometry=y.id,c.program=h.id,c.wireframe=t,x=!0)}!0===r.isInstancedMesh&&(x=!0),null!==_&&n.update(_,t.ELEMENT_ARRAY_BUFFER),x&&(!function(r,o,a,s){if(!1===i.isWebGL2&&(r.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const l=s.attributes,c=a.getAttributes(),u=o.defaultAttributeValues;for(const e in c){const i=c[e];if(i>=0){const o=l[e];if(void 0!==o){const e=o.normalized,r=o.itemSize,a=n.get(o);if(void 0===a)continue;const l=a.buffer,c=a.type,u=a.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,a=n.stride,h=o.offset;n&&n.isInstancedInterleavedBuffer?(m(i,n.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)):p(i),t.bindBuffer(t.ARRAY_BUFFER,l),v(i,r,c,e,a*u,h*u)}else o.isInstancedBufferAttribute?(m(i,o.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)):p(i),t.bindBuffer(t.ARRAY_BUFFER,l),v(i,r,c,e,0,0
vendor: 1,407 bytes, line 2
2)}else if("instanceMatrix"===e){const e=n.get(r.instanceMatrix);if(void 0===e)continue;const o=e.buffer,a=e.type;m(i+0,1),m(i+1,1),m(i+2,1),m(i+3,1),t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(i+0,4,a,!1,64,0),t.vertexAttribPointer(i+1,4,a,!1,64,16),t.vertexAttribPointer(i+2,4,a,!1,64,32),t.vertexAttribPointer(i+3,4,a,!1,64,48)}else if("instanceColor"===e){const e=n.get(r.instanceColor);if(void 0===e)continue;const o=e.buffer,a=e.type;m(i,1),t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(i,3,a,!1,12,0)}else if(void 0!==u){const n=u[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(i,n);break;case 3:t.vertexAttrib3fv(i,n);break;case 4:t.vertexAttrib4fv(i,n);break;default:t.vertexAttrib1fv(i,n)}}}}g()}(r,l,h,y),null!==_&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(_).buffer))},reset:y,resetDefaultState:_,dispose:function(){y();for(const t in s){const e=s[t];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0===s[t.id])return;const e=s[t.id];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t.id]},releaseStatesOfProgram:function(t){for(const e in s){const n=s[e];if(void 0===n[t.id])continue;const i=n[t.id];for(const t in i)h(i[t].object),delete i[t];delete n[t.id]}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:g}}
2function Gi(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,a,s){if(0===s)return;let l,c;if(r)l=t,c="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return;l[c](o,i,a,s),n.update(a,o,s)}}function Hi(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&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const s=r(a);s!==a&&(a=s);const l=!0===n.logarithmicDepthBuffer,c=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_TEXTURE_SIZE),d=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),g=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,y=o||e.has("OES_texture_float");return{isWebGL2:o,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:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:o?t.getParameter(t.MAX_SAMPLES):0}}function Vi(t){const e=this;let n=null,i=0,r=!1,o=!1;const a=new ln,s=new qt,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(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;s.getNormalMatrix(r),(null===c||c.length<e)&&(c=new Float32Array(e));for(let e=0,n=i;e!==o;++e,n+=4)a.copy(t[e]).applyMatrix4(r,s),a.normal.toArray(c,n),c[n+3]=a.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,o){const a=0!==t.length||e||0!==i||r;return r=e,n=u(t,o,0),i=t.length,a},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(e,a,s){const h=e.clippingPlanes,d=e.clipIntersection,f=e.clipShadows,p=t.get(e);if(!r||null===h||0===h.length||o&&!f)o?u(null):c();else{const t=o?0:i,e=4*t;let r=p.clippingState||null;l.value=r,r=u(h,a,e,s);for(let t=0;t!==e;++t)r[t]=n[t];p.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}Ui.physical={uniforms:qn([Ui.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ce(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _n(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:Fi.meshphysical_vert,fragmentShader:Fi.meshphysical_frag};class ji extends jt{constructor(t,e,n){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new dn(0,0,t,e),this.scissorTest=!1,this.viewport=new dn(0,0,t,e),n=n||{},this.texture=new Ie(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:ge,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.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){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}function Wi(){ce.call(this),this.type="Camera",this.matrixWorldInverse=new Ft,this.projectionMatrix=new Ft,this.projectionMatrixInverse=new Ft}function Xi(t=50,e=1,n=.1,i=2e3){Wi.call(this),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()}ji.prototype.isWebGLRenderTarget=!0,Wi.prototype=Object.assign(Object.create(ce.prototype),{constructor:Wi,isCamera:!0,copy:function(t,e){return ce.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(t=new Ot),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){ce.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){ce.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Xi.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Xi,isPerspectiveCamera:!0,copy:function(t,e){return Wi.prototype.copy.call(this,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:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Ct.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*Ct.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t}
2,getEffectiveFOV:function(){return 2*Ct.RAD2DEG*Math.atan(Math.tan(.5*Ct.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(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:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=this.near;let e=t*Math.tan(.5*Ct.DEG2RAD*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,a=o.fullHeight;r+=o.offsetX*i/t,e-=o.offsetY*n/a,i*=o.width/t,n*=o.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=ce.prototype.toJSON.call(this,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 Zi=90;class Yi extends ce{constructor(t,e,n){if(super(),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return;this.renderTarget=n;const i=new Xi(Zi,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Ot(1,0,0)),this.add(i);const r=new Xi(Zi,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Ot(-1,0,0)),this.add(r);const o=new Xi(Zi,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Ot(0,1,0)),this.add(o);const a=new Xi(Zi,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Ot(0,-1,0)),this.add(a);const s=new Xi(Zi,1,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Ot(0,0,1)),this.add(s);const l=new Xi(Zi,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ot(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[i,r,o,a,s,l]=this.children,c=t.xr.enabled,u=t.getRenderTarget();t.xr.enabled=!1;const h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,s),n.texture.generateMipmaps=h,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(u),t.xr.enabled=c}}class qi extends Ie{constructor(t,e,n,i,r,o,a,s,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:301,n,i,r,o,a=void 0!==a?a:Se,s,l,c),this._needsFlipEnvMap=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}qi.prototype.isCubeTexture=!0;class Ki extends ji{constructor(t,e,n){Number.isInteger(e)&&(e=n),super(t,t,e),e=e||{},this.texture=new qi(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:ge,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=Ee,this.texture.encoding=e.encoding,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 jn(5,5,5),r=new Jn({name:"CubemapFromEquirect",uniforms:Yn(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const o=new Ni(i,r),a=e.minFilter;e.minFilter===ve&&(e.minFilter=ge);return new Yi(1,10,this).update(t,o),e.minFilter=a,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)}}function Ji(t){let e=new WeakMap;function n(t,e){return 303===e?t.mapping=301:304===e&&(t.mapping=302),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(303===o||304===o){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const o=r.image;if(o&&o.height>0){const a=t.getRenderTarget(),s=new Ki(o.height/2);return s.fromEquirectangularTexture(t,r),e.set(r,s),t.setRenderTarget(a),r.addEventListener("dispose",i),n(s.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}function Qi(t){const e={};
vendor: 2,485 bytes, line 2
2function 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_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")},get:function(t){const e=n(t);return e}}}function $i(t,e,n,i){const r={},o=new WeakMap;function a(t){const s=t.target;null!==s.index&&e.remove(s.index);for(const t in s.attributes)e.remove(s.attributes[t]);s.removeEventListener("dispose",a),delete r[s.id];const l=o.get(s);l&&(e.remove(l),o.delete(s)),i.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){const n=[],i=t.index,r=t.attributes.position;let a=0;if(null!==i){const t=i.array;a=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{const t=r.array;a=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 s=new(In(n)>65535?Cn:Pn)(n,1);s.version=a;const l=o.get(t);l&&e.remove(l),o.set(t,s)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",a),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&&s(t)}else s(t);return o.get(t)}}}
vendor: 18,900 bytes, line 2
2function tr(t,e,n,i){const r=i.isWebGL2;let o,a,s;this.setMode=function(t){o=t},this.setIndex=function(t){a=t.type,s=t.bytesPerElement},this.render=function(e,i){t.drawElements(o,i,a,e*s),n.update(i,o,1)},this.renderInstances=function(i,l,c){if(0===c)return;let u,h;if(r)u=t,h="drawElementsInstanced";else if(u=e.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===u)return;u[h](o,l,a,i*s,c),n.update(l,o,c)}}function er(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.frame++,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}}}}function nr(t,e){return t[0]-e[0]}function ir(t,e){return Math.abs(e[1])-Math.abs(t[1])}function rr(t){const e={},n=new Float32Array(8),i=[];for(let t=0;t<8;t++)i[t]=[t,0];return{update:function(r,o,a,s){const l=r.morphTargetInfluences,c=void 0===l?0:l.length;let u=e[o.id];if(void 0===u){u=[];for(let t=0;t<c;t++)u[t]=[t,0];e[o.id]=u}for(let t=0;t<c;t++){const e=u[t];e[0]=t,e[1]=l[t]}u.sort(ir);for(let t=0;t<8;t++)t<c&&u[t][1]?(i[t][0]=u[t][0],i[t][1]=u[t][1]):(i[t][0]=Number.MAX_SAFE_INTEGER,i[t][1]=0);i.sort(nr);const h=a.morphTargets&&o.morphAttributes.position,d=a.morphNormals&&o.morphAttributes.normal;let f=0;for(let t=0;t<8;t++){const e=i[t],r=e[0],a=e[1];r!==Number.MAX_SAFE_INTEGER&&a?(h&&o.getAttribute("morphTarget"+t)!==h[r]&&o.setAttribute("morphTarget"+t,h[r]),d&&o.getAttribute("morphNormal"+t)!==d[r]&&o.setAttribute("morphNormal"+t,d[r]),n[t]=a,f+=a):(h&&!0===o.hasAttribute("morphTarget"+t)&&o.deleteAttribute("morphTarget"+t),d&&!0===o.hasAttribute("morphNormal"+t)&&o.deleteAttribute("morphNormal"+t),n[t]=0)}const p=o.morphTargetsRelative?1:1-f;s.getUniforms().setValue(t,"morphTargetBaseInfluence",p),s.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function or(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(a){const s=i.render.frame,l=a.geometry,c=e.get(a,l);return r.get(c)!==s&&(e.update(c),r.set(c,s)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",o)&&a.addEventListener("dispose",o),n.update(a.instanceMatrix,t.ARRAY_BUFFER),null!==a.instanceColor&&n.update(a.instanceColor,t.ARRAY_BUFFER)),c},dispose:function(){r=new WeakMap}}}Ki.prototype.isWebGLCubeRenderTarget=!0;class ar extends Ie{constructor(t=null,e=1,n=1,i=1){super(null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=me,this.minFilter=me,this.wrapR=fe,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}}ar.prototype.isDataTexture2DArray=!0;class sr extends Ie{constructor(t=null,e=1,n=1,i=1){super(null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=me,this.minFilter=me,this.wrapR=fe,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}}sr.prototype.isDataTexture3D=!0;const lr=new Ie,cr=new ar,ur=new sr,hr=new qi,dr=[],fr=[],pr=new Float32Array(16),mr=new Float32Array(9),gr=new Float32Array(4);function vr(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let o=dr[r];if(void 0===o&&(o=new Float32Array(r),dr[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 yr(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 _r(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function xr(t,e){let n=fr[e];void 0===n&&(n=new Int32Array(e),fr[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function br(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function wr(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(yr(n,e))return;t.uniform2fv(this.addr,e),_r(n,e)}}function Mr(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(yr(n,e))return;t.uniform3fv(this.addr,e),_r(n,e)}}function Sr(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(yr(n,e))return;t.uniform4fv(this.addr,e),_r(n,e)}}function Er(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(yr(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),_r(n,e)}else{if(yr(n,i))return;gr.set(i),t.uniformMatrix2fv(this.addr,!1,gr),_r(n,i)}}function Tr(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(yr(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),_r(n,e)}else{if(yr(n,i))return;mr.set(i),t.uniformMatrix3fv(this.addr,!1,mr),_r(n,i)}}function Lr(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(yr(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),_r(n,e)}else{if(yr(n,i))return;pr.set(i),t.uniformMatrix4fv(this.addr,!1,pr),_r(n,i)}}function Ar(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Pr(t,e){const n=this.cache;yr(n,e)||(t.uniform2iv(this.addr,e),_r(n,e))}function Rr(t,e){const n=this.cache;yr(n,e)||(t.uniform3iv(this.addr,e),_r(n,e))}function Cr(t,e){const n=this.cache;yr(n,e)||(t.uniform4iv(this.addr,e),_r(n,e))}function Dr(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Or(t,e){const n=this.cache;yr(n,e)||(t.uniform2uiv(this.addr,e),_r(n,e))}function Nr(t,e){const n=this.cache;yr(n,e)||(t.uniform3uiv(this.addr,e),_r(n,e))}function Ir(t,e){const n=this.cache;yr(n,e)||(t.uniform4uiv(this.addr,e),_r(n,e))}function Fr(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(e||lr,r)}function zr(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||ur,r)}function Ur(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(e||hr,r)}function kr(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||cr,r)}function Br(t,e){t.uniform1fv(this.addr,e)}function Gr(t,e){const n=vr(e,this.size,2);t.uniform2fv(this.addr,n)}function Hr(t,e){const n=vr(e,this.size,3);t.uniform3fv(this.addr,n)}function Vr(t,e){const n=vr(e,this.size,4);t.uniform4fv(this.addr,n)}function jr(t,e){const n=vr(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Wr(t,e){const n=vr(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Xr(t,e){const n=vr(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Zr(t,e){t.uniform1iv(this.addr,e)}function Yr(t,e){t.uniform2iv(this.addr,e)}function qr(t,e){t.uniform3iv(this.addr,e)}function Kr(t,e){t.uniform4iv(this.addr,e)}function Jr(t,e){t.uniform1uiv(this.addr,e)}function Qr(t,e){t.uniform2uiv(this.addr,e)}function $r(t,e){t.uniform3uiv(this.addr,e)}function to(t,e){t.uniform4uiv(this.addr,e)}function eo(t,e,n){const i=e.length,r=xr(n,i);t.uniform1iv(this.addr,r);for(let t=0;t!==i;++t)n.safeSetTexture2D(e[t]||lr,r[t])}function no(t,e,n){const i=e.length,r=xr(n,i);t.uniform1iv(this.addr,r);for(let t=0;t!==i;++t)n.safeSetTextureCube(e[t]||hr,r[t])}function io(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return br;case 35664:return wr;case 35665:return Mr;case 35666:return Sr;case 35674:return Er;case 35675:return Tr;case 35676:return Lr;case 5124:case 35670:return Ar;case 35667:case 35671:return Pr;case 35668:case 35672:return Rr;case 35669:case 35673:return Cr;case 5125:return Dr;case 36294:return Or;case 36295:return Nr;case 36296:return Ir;case 35678:case 36198:case 36298:case 36306:case 35682:return Fr;case 35679:case 36299:case 36307:return zr;case 35680:case 36300:case 36308:case 36293:return Ur;case 36289:case 36303:case 36311:case 36292:return kr}}(e.type)}function ro(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Br;case 35664:return Gr;case 35665:return Hr;case 35666:return Vr;case 35674:return jr;case 35675:return Wr;case 35676:return Xr;case 5124:case 35670:return Zr;case 35667:case 35671:return Yr;case 35668:case 35672:return qr;case 35669:case 35673:return Kr;case 5125:return Jr;case 36294:return Qr;case 36295:return $r;case 36296:return to;case 35678:case 36198:case 36298:case 36306:case 35682:return eo;case 35680:case 36300:case 36308:case 36293:return no}}(e.type)}function oo(t){this.id=t,this.seq=[],this.map={}}ro.prototype.updateCache=function(t){const e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),_r(e,t)},oo.prototype.setValue=function(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 ao=/(\w+)(\])?(\[|\.)?/g;function so(t,e){t.seq.push(e),t.map[e.id]=e}function lo(t,e,n){const i=t.name,r=i.length;for(ao.lastIndex=0;;){const o=ao.exec(i),a=ao.lastIndex;let s=o[1];const l="]"===o[2],c=o[3];if(l&&(s|=0),void 0===c||"["===c&&a+2===r){so(n,void 0===c?new io(s,t,e):new ro(s,t,e));break}{let t=n.map[s];void 0===t&&(t=new oo(s),so(n,t)),n=t}}}function co(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);lo(n,t.getUniformLocation(e,n.name),this)}}function uo(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}co.prototype.setValue=function(t,e,n,i){const r=this.map[e];void 0!==r&&r.setValue(t,n,i)},co.prototype.setOptional=function(t,e,n){const i=e[n];void 0!==i&&this.setValue(t,n,i)},co.upload=function(t,e,n,i){for(let r=0,o=e.length;r!==o;++r){const o=e[r],a=n[o.id];!1!==a.needsUpdate&&o.setValue(t,a.value,i)}},co.seqWithValue=function(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};let ho=0;function fo(t){switch(t){case Ae:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return["Linear","( value )"]}}function po(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";return"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+function(t){const e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}(t.getShaderSource(e))}function mo(t,e){const n=fo(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function go(t,e){const n=fo(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function vo(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 5:n="Custom";break;default:n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function yo(t){return""!==t}function _o(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).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/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function xo(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const bo=/^[ \t]*#include +<([\w\d./]+)>/gm;function wo(t){return t.replace(bo,Mo)}function Mo(t,e){const n=Fi[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return wo(n)}const So=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Eo=/#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 To(t){return t.replace(Eo,Ao).replace(So,Lo)}function Lo(t,e,n,i){return Ao(t,e,n,i)}function Ao(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 Po(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"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 Ro(t,e,n,i){const r=t.getContext(),o=n.defines;let a=n.vertexShader,s=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 301:case 302:e="ENVMAP_TYPE_CUBE";break;case 306:case 307:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),u=function(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case 302:case 307:e="ENVMAP_MODE_REFRACTION"}return e}(n),h=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=t.gammaFactor>0?t.gammaFactor:1,f=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"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.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(yo).join("\n")}(n),p=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),m=r.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[p].filter(yo).join("\n"),g.length>0&&(g+="\n"),v=[f,p].filter(yo).join("\n"),v.length>0&&(v+="\n")):(g=[Po(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,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 "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",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.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","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\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(yo).join("\n"),v=[f,Po(n),"#define SHADER_NAME "+n.shaderName,p,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alph
2aMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",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.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Fi.tonemapping_pars_fragment:"",0!==n.toneMapping?vo("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Fi.encodings_pars_fragment,n.map?mo("mapTexelToLinear",n.mapEncoding):"",n.matcap?mo("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?mo("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?mo("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?mo("lightMapTexelToLinear",n.lightMapEncoding):"",go("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(yo).join("\n")),a=wo(a),a=_o(a,n),a=xo(a,n),s=wo(s),s=_o(s,n),s=xo(s,n),a=To(a),s=To(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",n.glslVersion===Re?"":"out highp vec4 pc_fragColor;",n.glslVersion===Re?"":"#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"+v);const _=y+g+a,x=y+v+s,b=uo(r,r.VERTEX_SHADER,_),w=uo(r,r.FRAGMENT_SHADER,x);if(r.attachShader(m,b),r.attachShader(m,w),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(m).trim(),e=r.getShaderInfoLog(b).trim(),n=r.getShaderInfoLog(w).trim();let i=!0,o=!0;if(!1===r.getProgramParameter(m,r.LINK_STATUS)){i=!1;po(r,b,"vertex"),po(r,w,"fragment")}else""!==t||""!==e&&""!==n||(o=!1);o&&(this.diagnostics={runnable:i,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:n,prefix:v}})}let M,S;return r.deleteShader(b),r.deleteShader(w),this.getUniforms=function(){return void 0===M&&(M=new co(r,m)),M},this.getAttributes=function(){return void 0===S&&(S=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).name;n[i]=t.getAttribLocation(e,i)}return n}(r,m)),S},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=ho++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=w,this}function Co(t,e,n,i,r,o){const a=[],s=i.isWebGL2,l=i.logarithmicDepthBuffer,c=i.floatVertexTextures,u=i.maxVertexUniforms,h=i.vertexTextures;let d=i.precision;const f={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"},p=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmissionMap"];function m(t){let e;return e=t&&t.isTexture?t.encoding:t&&t.isWebGLRenderTarget?t.texture.encoding:Ae,e}return{getParameters:function(r,a,p,g,v){const y=g.fog,_=r.isMeshStandardMaterial?g.environment:null,x=e.get(r.envMap||_),b=f[r.type],w=v.isSkinnedMesh?function(t){const e=t.skeleton.bones;if(c)return 1024;{const t=u,n=Math.floor((t-20)/4),i=Math.min(n,e.length);return i<e.length?0:i}}(v):0;let M,S;if(null!==r.precision&&(d=i.getMaxPrecision(r.precision),r.precision),b){const t=Ui[b];M=t.vertexShader,S=t.fragmentShader}else M=r.vertexShader,S=r.fragmentShader;const E=t.getRenderTarget();return{isWebGL2:s,shaderID:b,shaderName:r.type,vertexShader:M,fragmentShader:S,defines:r.defines,isRawShaderMaterial:!0===r.isRawShaderMaterial,glslVersion:r.glslVersion,precision:d,instancing:!0===v.isInstancedMesh,instancingColor:!0===v.isInstancedMesh&&null!==v.instanceColor,supportsVertexTextures:h,outputEncoding:null!==E?m(E.texture):t.outputEncoding,map:!!r.map,mapEncoding:m(r.map),matcap:!!r.matcap,matc
vendor: 4,760 bytes, line 2
2apEncoding:m(r.matcap),envMap:!!x,envMapMode:x&&x.mapping,envMapEncoding:m(x),envMapCubeUV:!!x&&(306===x.mapping||307===x.mapping),lightMap:!!r.lightMap,lightMapEncoding:m(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:m(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:1===r.normalMapType,tangentSpaceNormalMap:0===r.normalMapType,clearcoatMap:!!r.clearcoatMap,clearcoatRoughnessMap:!!r.clearcoatRoughnessMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,transmissionMap:!!r.transmissionMap,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexAlphas:!0===r.vertexColors&&v.geometry.attributes.color&&4===v.geometry.attributes.color.itemSize,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatMap||r.clearcoatRoughnessMap||r.clearcoatNormalMap||r.displacementMap||r.transmissionMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||r.transmissionMap||!r.displacementMap),fog:!!y,useFog:r.fog,fogExp2:y&&y.isFogExp2,flatShading:!!r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:l,skinning:r.skinning&&w>0,maxBones:w,useVertexTexture:c,morphTargets:r.morphTargets,morphNormals:r.morphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&p.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);if(!1===e.isRawShaderMaterial){for(let t=0;t<p.length;t++)n.push(e[p[t]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=f[t.type];let n;if(e){const t=Ui[e];n=Kn.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=a.length;t<e;t++){const e=a[t];if(e.cacheKey===n){i=e,++i.usedTimes;break}}return void 0===i&&(i=new Ro(t,n,e,r),a.push(i)),i},releaseProgram:function(t){if(0==--t.usedTimes){const e=a.indexOf(t);a[e]=a[a.length-1],a.pop(),t.destroy()}},programs:a}}function Do(){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 Oo(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id: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 No(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 Io(t){const e=[];let n=0;const i=[],r=[],o={id:-1};function a(i,r,a,s,l,c){let u=e[n];const h=t.get(a);return void 0===u?(u={id:i.id,object:i,geometry:r,material:a,program:h.program||o,groupOrder:s,renderOrder:i.renderOrder,z:l,group:c},e[n]=u):(u.id=i.id,u.object=i,u.geometry=r,u.material=a,u.program=h.program||o,u.groupOrder=s,u.renderOrder=i.renderOrder,u.z=l,u.group=c),n++,u}return{opaque:i,transparent:r,init:function(){n=0,i.length=0,r.length=0},push:function(t,e,n,o,s,l){const c=a(t,e,n,o,s,l);
vendor: 8,979 bytes, line 2
2(!0===n.transparent?r:i).push(c)},unshift:function(t,e,n,o,s,l){const c=a(t,e,n,o,s,l);(!0===n.transparent?r:i).unshift(c)},finish:function(){for(let t=n,i=e.length;t<i;t++){const n=e[t];if(null===n.id)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.program=null,n.group=null}},sort:function(t,e){i.length>1&&i.sort(t||Oo),r.length>1&&r.sort(e||No)}}}function Fo(t){let e=new WeakMap;return{get:function(n,i){let r;return!1===e.has(n)?(r=new Io(t),e.set(n,[r])):i>=e.get(n).length?(r=new Io(t),e.get(n).push(r)):r=e.get(n)[i],r},dispose:function(){e=new WeakMap}}}function zo(){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 Ot,color:new _n};break;case"SpotLight":n={position:new Ot,direction:new Ot,color:new _n,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ot,color:new _n,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ot,skyColor:new _n,groundColor:new _n};break;case"RectAreaLight":n={color:new _n,position:new Ot,halfWidth:new Ot,halfHeight:new Ot}}return t[e.id]=n,n}}}let Uo=0;function ko(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Bo(t,e){const n=new zo,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 Ce};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ce,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},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new Ot);const o=new Ot,a=new Ft,s=new Ft;return{setup:function(o){let a=0,s=0,l=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0;o.sort(ko);for(let t=0,e=o.length;t<e;t++){const e=o[t],v=e.color,y=e.intensity,_=e.distance,x=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)a+=v.r*y,s+=v.g*y,l+=v.b*y;else if(e.isLightProbe)for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],y);else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity),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[c]=n,r.directionalShadowMap[c]=x,r.directionalShadowMatrix[c]=e.shadow.matrix,p++}r.directional[c]=t,c++}else if(e.isSpotLight){const t=n.get(e);if(t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(v).multiplyScalar(y),t.distance=_,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),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,r.spotShadow[h]=n,r.spotShadowMap[h]=x,r.spotShadowMatrix[h]=e.shadow.matrix,g++}r.spot[h]=t,h++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(v).multiplyScalar(y),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[d]=t,d++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity),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]=x,r.pointShadowMatrix[u]=e.shadow.matrix,m++}r.point[u]=t,u++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(y),t.groundColor.copy(e.groundColor).multiplyScalar(y),r.hemi[f]=t,f++}}d>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=zi.LTC_FLOAT_1,r.rectAreaLTC2=zi.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")&&(r.rectAreaLTC1=zi.LTC_HALF_1,r.rectAreaLTC2=zi.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=s,r.ambient[2]=l;const v=r.hash;v.directionalLength===c&&v.pointLength===u&&v.spotLength===h&&v.rectAreaLength===d&&v.hemiLength===f&&v.numDirectionalShadows===p&&v.numPointShadows===m&&v.numSpotShadows===g||(r.directional.length=c,r.spot.length=h,r.rectArea.length=d,r.point.length=u,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=g,r.spotShadowMap.length=g,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotShadowMatrix.length=g,v.directionalLength=c,v.pointLength=u,v.spotLength=h,v.rectAreaLength=d,v.hemiLength=f,v.numDirectionalShadows=p,v.numPointShadows=m,v.numSpotShadows=g,r.version=Uo++)},setupView:function(t,e){let n=0,i=0,l=0,c=0,u=0;const h=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(h),n++}else if(d.isSpotLight){const t=r.spot[l];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),t.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(h),l++}else if(d.isRectAreaLight){const t=r.rectArea[c];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),s.identity(),a.copy(d.matrixWorld),a.premultiply(h),s.extractRotation(a),t.halfWidth.set(.5*d.width,0,0),t.halfHeight.set(0,.5*d.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),c++}else if(d.isPointLight){const t=r.point[i];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),i++}else if(d.isHemisphereLight){const t=r.hemi[u];t.direction.setFromMatrixPosition(d.matrixWorld),t.direction.transformDirection(h),t.direction.normalize(),u++}}},state:r}}function Go(t,e){const n=new Bo(t,e),i=[],r=[];return{init:function(){i.length=0,r.length=0},state:{lightsArray:i,shadowsArray:r,lights:n},setupLights:function(){n.setup(i)},setupLightsView:function(t){n.setupView(i,t)},pushLight:function(t){i.push(t)},pushShadow:function(t){r.push(t)}}}function Ho(t,e){let n=new WeakMap;return{get:function(i,r=0){let o;return!1===n.has(i)?(o=new Go(t,e),n.set(i,[o])):r>=n.get(i).length?(o=new Go(t,e),n.get(i).push(o)):o=n.get(i)[r],o},dispose:function(){n=new WeakMap}}}class Vo extends Zn{constructor(t){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,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}}Vo.prototype.isMeshDepthMaterial=!0;class jo extends Zn{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new Ot,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}jo.prototype.isMeshDistanceMaterial=!0;function Wo(t,e,n){let i=new hn;const r=new Ce,o=new Ce,a=new dn,s=[],l=[],c={},u=n.maxTextureSize,h={0:1,1:0,2:2},d=new Jn({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ce},radius:{value:4}},vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",fragmentShader:"\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include <packing>\n\nvoid main() {\n\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\n\t// This seems totally useless but it's a crazy work around for a Adreno compiler bug\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );
2\n\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\n\t\t#ifdef HORIZONTAL_PASS\n\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n\t\t#else\n\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\n\t\t#endif\n\n\t}\n\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const p=new Vn;p.setAttribute("position",new Sn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Ni(p,d),g=this;function v(n,i){const r=e.update(m);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,r,d,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,f,m,null)}function y(t,e,n){const i=t<<0|e<<1|n<<2;let r=s[i];return void 0===r&&(r=new Vo({depthPacking:3201,morphTargets:t,skinning:e}),s[i]=r),r}function _(t,e,n){const i=t<<0|e<<1|n<<2;let r=l[i];return void 0===r&&(r=new jo({morphTargets:t,skinning:e}),l[i]=r),r}function x(e,n,i,r,o,a,s){let l=null,u=y,d=e.customDepthMaterial;if(!0===r.isPointLight&&(u=_,d=e.customDistanceMaterial),void 0===d){let t=!1;!0===i.morphTargets&&(t=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let r=!1;
vendor: 2,490 bytes, line 2
2!0===e.isSkinnedMesh&&!0===i.skinning&&(r=!0);l=u(t,r,!0===e.isInstancedMesh)}else l=d;if(t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){const t=l.uuid,e=i.uuid;let n=c[t];void 0===n&&(n={},c[t]=n);let r=n[e];void 0===r&&(r=l.clone(),n[e]=r),l=r}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=3===s?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:h[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=o,l.farDistance=a),l}function b(n,r,o,a,s){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],u=r[c.materialIndex];if(u&&u.visible){const e=x(n,i,u,a,o.near,o.far,s);t.renderBufferDirect(o,null,i,e,n,c)}}}else if(r.visible){const e=x(n,i,r,a,o.near,o.far,s);t.renderBufferDirect(o,null,i,e,n,null)}}const l=n.children;for(let t=0,e=l.length;t<e;t++)b(l[t],r,o,a,s)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,n,s){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(),h=t.getActiveMipmapLevel(),d=t.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let l=0,c=e.length;l<c;l++){const c=e[l],h=c.shadow;if(void 0===h)continue;if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;r.copy(h.mapSize);const f=h.getFrameExtents();if(r.multiply(f),o.copy(h.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(o.x=Math.floor(u/f.x),r.x=o.x*f.x,h.mapSize.x=o.x),r.y>u&&(o.y=Math.floor(u/f.y),r.y=o.y*f.y,h.mapSize.y=o.y)),null===h.map&&!h.isPointLightShadow&&3===this.type){const t={minFilter:ge,magFilter:ge,format:Ee};h.map=new ji(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.mapPass=new ji(r.x,r.y,t),h.camera.updateProjectionMatrix()}if(null===h.map){const t={minFilter:me,magFilter:me,format:Ee};h.map=new ji(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}
2t.setRenderTarget(h.map),t.clear();const p=h.getViewportCount();for(let t=0;t<p;t++){const e=h.getViewport(t);a.set(o.x*e.x,o.y*e.y,o.x*e.z,o.y*e.w),d.viewport(a),h.updateMatrices(c,t),i=h.getFrustum(),b(n,s,h.camera,c,this.type)}h.isPointLightShadow||3!==this.type||v(h,s),h.needsUpdate=!1}g.needsUpdate=!1,t.setRenderTarget(l,c,h)}}function Xo(t,e,n){const i=n.isWebGL2;const r=new function(){let e=!1;const n=new dn;let i=null;const r=new dn(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,a,s){!0===s&&(e*=a,i*=a,o*=a),n.set(e,i,o,a),!1===r.equals(n)&&(t.clearColor(e,i,o,a),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?I(t.DEPTH_TEST):F(t.DEPTH_TEST)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(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: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);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);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}}},a=new function(){let e=!1,n=null,i=null,r=null,o=null,a=null,s=null,l=null,c=null;return{setTest:function(n){e||(n?I(t.STENCIL_TEST):F(t.STENCIL_TEST))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&o===a||(t.stencilFunc(e,n,a),i=e,r=n,o=a)},setOp:function(e,n,i){a===e&&s===n&&l===i||(t.stencilOp(e,n,i),a=e,s=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,a=null,s=null,l=null,c=null}}};let s={},l=null,c={},u=null,h=!1,d=null,f=null,p=null,m=null,g=null,v=null,y=null,_=!1,x=null,b=null,w=null,M=null,S=null;const E=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let T=!1,L=0;const A=t.getParameter(t.VERSION);-1!==A.indexOf("WebGL")?(L=parseFloat(/^WebGL (\d)/.exec(A)[1]),T=L>=1):-1!==A.indexOf("OpenGL ES")&&(L=parseFloat(/^OpenGL ES (\d)/.exec(A)[1]),T=L>=2);let P=null,R={};const C=new dn(0,0,t.canvas.width,t.canvas.height),D=new dn(0,0,t.canvas.width,t.canvas.height);function O(e,n,i){const r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let e=0;e<i;e++)t.texImage2D(n+e,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);return o}const N={};function I(e){!0!==s[e]&&(t.enable(e),s[e]=!0)}function F(e){!1!==s[e]&&(t.disable(e),s[e]=!1)}N[t.TEXTURE_2D]=O(t.TEXTURE_2D,t.TEXTURE_2D,1),N[t.TEXTURE_CUBE_MAP]=O(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),o.setClear(1),a.setClear(0),I(t.DEPTH_TEST),o.setFunc(3),B(!1),G(1),I(t.CULL_FACE),k(0);const z={[he]:t.FUNC_ADD,101:t.FUNC_SUBTRACT,102:t.FUNC_REVERSE_SUBTRACT};if(i)z[103]=t.MIN,z[104]=t.MAX;else{const t=e.get("EXT_blend_minmax");null!==t&&(z[103]=t.MIN_EXT,z[104]=t.MAX_EXT)}const U={200:t.ZERO,201:t.ONE,202:t.SRC_COLOR,204:t.SRC_ALPHA,210:t.SRC_ALPHA_SATURATE,208:t.DST_COLOR,206:t.DST_ALPHA,203:t.ONE_MINUS_SRC_COLOR,205:t.ONE_MINUS_SRC_ALPHA,209:t.ONE_MINUS_DST_COLOR,207:t.ONE_MINUS_DST_ALPHA};function k(e,n,i,r,o,a,s,l){if(0!==e){if(!1===h&&(I(t.BLEND),h=!0),5===e)o=o||n,a=a||i,s=s||r,n===f&&o===g||(t.blendEquationSeparate(z[n],z[o]),f=n,g=o),i===p&&r===m&&a===v&&s===y||(t.blendFuncSeparate(U[i],U[r],U[a],U[s]),p=i,m=r,v=a,y=s),d=e,_=null;else if(e!==d||l!==_){if(f===he&&g===he||(t.blendEquation(t.FUNC_ADD),f=he,g=he),l)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.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA)}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.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR)}p=null,m=null,v=null,y=null,d=e,_=l}}else!0===h&&(F(t.BLEND),h=!1)}function B(e){x!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),x=e)}function G(e){0!==e?(I(t.CULL_FACE),e!==b&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):F(t.CULL_FACE),b=e}function H(e,n,i){e?(I(t.POLYGON_OFFSET_FILL),M===n&&S===i||(t.polygonOffset(n,i),M=n,S=i)):F(t.POLYGON_OFFSET_FILL)}function V(e){void 0===e&&(e=t.TEXTURE0+E-1),P!==e&&(t.activeTexture(e),P=e)}return{buffers:{color:r,depth:o,stencil:a}
2,enable:I,disable:F,bindFramebuffer:function(e,n){null===n&&null!==l&&(n=l),c[e]!==n&&(t.bindFramebuffer(e,n),c[e]=n)},bindXRFramebuffer:function(e){e!==l&&(t.bindFramebuffer(t.FRAMEBUFFER,e),l=e)},useProgram:function(e){return u!==e&&(t.useProgram(e),u=e,!0)},setBlending:k,setMaterial:function(e,n){2===e.side?F(t.CULL_FACE):I(t.CULL_FACE);let i=1===e.side;n&&(i=!i),B(i),1===e.blending&&!1===e.transparent?k(0):k(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),o.setFunc(e.depthFunc),o.setTest(e.depthTest),o.setMask(e.depthWrite),r.setMask(e.colorWrite);const s=e.stencilWrite;a.setTest(s),s&&(a.setMask(e.stencilWriteMask),a.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),a.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),H(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?I(t.SAMPLE_ALPHA_TO_COVERAGE):F(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:B,setCullFace:G,setLineWidth:function(e){e!==w&&(T&&t.lineWidth(e),w=e)},setPolygonOffset:H,setScissorTest:function(e){e?I(t.SCISSOR_TEST):F(t.SCISSOR_TEST)}
2,activeTexture:V,bindTexture:function(e,n){null===P&&V();let i=R[P];void 0===i&&(i={type:void 0,texture:void 0},R[P]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||N[e]),i.type=e,i.texture=n)},unbindTexture:function(){const e=R[P];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){}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){}},scissor:function(e){!1===C.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),C.copy(e))},viewport:function(e){!1===D.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),D.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.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),s={},P=null,R={},l=null,c={},u=null,h=!1,d=null,f=null,p=null,m=null,g=null,v=null,y=null,_=!1,x=null,b=null,w=null,M=null,S=null,C.set(0,0,t.canvas.width,t.canvas.height),D.set(0,0,t.canvas.width,t.canvas.height),r.reset(),o.reset(),a.reset()}}}function Zo(t,e,n,i,r,o,a){const s=r.isWebGL2,l=(r.maxTextures,r.maxCubemapSize),c=r.maxTextureSize,u=r.maxSamples,h=new WeakMap;let d,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function p(t,e){return f?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function m(t,e,n,i){let r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?Ct.floorPowerOfTwo:Math.floor,o=i(r*t.width),a=i(r*t.height);void 0===d&&(d=p(o,a));const s=n?p(o,a):d;s.width=o,s.height=a;return s.getContext("2d").drawImage(t,0,0,o,a),s}return t}return t}function g(t){return Ct.isPowerOfTwo(t.width)&&Ct.isPowerOfTwo(t.height)}function v(t,e){return t.generateMipmaps&&e&&t.minFilter!==me&&t.minFilter!==ge}function y(e,n,r,o){t.generateMipmap(e);i.get(n).__maxMipLevel=Math.log2(Math.max(r,o))}function _(n,i,r){if(!1===s)return i;if(null!==n&&void 0!==t[n])return t[n];let o=i;return i===t.RED&&(r===t.FLOAT&&(o=t.R32F),r===t.HALF_FLOAT&&(o=t.R16F),r===t.UNSIGNED_BYTE&&(o=t.R8)),i===t.RGB&&(r===t.FLOAT&&(o=t.RGB32F),r===t.HALF_FLOAT&&(o=t.RGB16F),r===t.UNSIGNED_BYTE&&(o=t.RGB8)),i===t.RGBA&&(r===t.FLOAT&&(o=t.RGBA32F),r===t.HALF_FLOAT&&(o=t.RGBA16F),r===t.UNSIGNED_BYTE&&(o=t.RGBA8)),o!==t.R16F&&o!==t.R32F&&o!==t.RGBA16F&&o!==t.RGBA32F||e.get("EXT_color_buffer_float"),o}function x(e){return e===me||1004===e||1005===e?t.NEAREST:t.LINEAR}function b(e){const n=e.target;n.removeEventListener("dispose",b),function(e){const n=i.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),i.remove(e)}(n),n.isVideoTexture&&h.delete(n),a.memory.textures--}function w(e){const n=e.target;n.removeEventListener("dispose",w),function(e){const n=e.texture,r=i.get(e),o=i.get(n);if(!e)return;void 0!==o.__webglTexture&&t.deleteTexture(o.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRen
2derbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);i.remove(n),i.remove(e)}(n),a.memory.textures--}let M=0;function S(e,r){const o=i.get(e);if(e.isVideoTexture&&function(t){const e=a.render.frame;h.get(t)!==e&&(h.set(t,e),t.update())}(e),e.version>0&&o.__version!==e.version){const t=e.image;if(void 0===t);else if(!1!==t.complete)return void R(o,e,r)}n.activeTexture(t.TEXTURE0+r),n.bindTexture(t.TEXTURE_2D,o.__webglTexture)}function E(e,r){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,i,r){if(6!==i.image.length)return;P(e,i),n.activeTexture(t.TEXTURE0+r),n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,i.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const a=i&&(i.isCompressedTexture||i.image[0].isCompressedTexture),c=i.image[0]&&i.image[0].isDataTexture,u=[];for(let t=0;t<6;t++)u[t]=a||c?c?i.image[t].image:i.image[t]:m(i.image[t],!1,!0,l);const h=u[0],d=g(h)||s,f=o.convert(i.format),p=o.convert(i.type),x=_(i.internalFormat,f,p);let b;if(A(t.TEXTURE_CUBE_MAP,i,d),a){for(let e=0;e<6;e++){b=u[e].mipmaps;for(let r=0;r<b.length;r++){const o=b[r];i.format!==Ee&&i.format!==Se?null!==f&&n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,x,o.width,o.height,0,o.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,x,o.width,o.height,0,f,p,o.data)}}e.__maxMipLevel=b.length-1}else{b=i.mipmaps;for(let e=0;e<6;e++)if(c){n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,x,u[e].width,u[e].height,0,f,p,u[e].data);for(let i=0;i<b.length;i++){const r=b[i].image[e].image;n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,x,r.width,r.height,0,f,p,r.data)}}else{n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,x,f,p,u[e]);for(let i=0;i<b.length;i++){const r=b[i];n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,x,f,p,r.image[e])}}e.__maxMipLevel=b.length}v(i,d)&&y(t.TEXTURE_CUBE_MAP,i,h.width,h.height);e.__version=i.version,i.onUpdate&&i.onUpdate(i)}(a,e,r):(n.activeTexture(t.TEXTURE0+r),n.bindTexture(t.TEXTURE_CUBE_MAP,a.__webglTexture))}const T={[de]:t.REPEAT,[fe]:t.CLAMP_TO_EDGE,[pe]:t.MIRRORED_REPEAT},L={[me]:t.NEAREST,1004:t.NEAREST_MIPMAP_NEAREST,1005:t.NEAREST_MIPMAP_LINEAR,[ge]:t.LINEAR,1007:t.LINEAR_MIPMAP_NEAREST,[ve]:t.LINEAR_MIPMAP_LINEAR};function A(n,o,a){if(a?(t.texParameteri(n,t.TEXTURE_WRAP_S,T[o.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,T[o.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,T[o.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,L[o.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,L[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!==fe||o.wrapT,t.texParameteri(n,t.TEXTURE_MAG_FILTER,x(o.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,x(o.minFilter)),o.minFilter!==me&&o.minFilter),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(o.type===be&&!1===e.has("OES_texture_float_linear"))return;if(!1===s&&o.type===we&&!1===e.has("OES_texture_half_float_linear"))return;(o.anisotropy>1||i.get(o).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),i.get(o).__currentAnisotropy=o.anisotropy)}}function P(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",b),e.__webglTexture=t.createTexture(),a.memory.textures++)}function R(e,i,r){let a=t.TEXTURE_2D;i.isDataTexture2DArray&&(a=t.TEXTURE_2D_ARRAY),i.isDataTexture3D&&(a=t.TEXTURE_3D),P(e,i),n.activeTexture(t.TEXTURE0+r),n.bindTexture(a,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,i.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const l=function(t){return!s&&(t.wrapS!==fe||t.wrapT!==fe||t.minFilter!==me&&t.minFilter!==ge)}(i)&&!1===g(i.image),u=m(i.image,l,!1,c),h=g(u)||s,d=o.convert(i.format);let f,p=o.convert(i.type),x=_(i.internalFormat,d,p);A(a,i,h);const b=i.mipmaps;if(i.isDepthTexture)x=t.DEPTH_COMPONENT,s?x=i.type===be?t.DEPTH_COMPONENT32F:i.type===xe?t.DEPTH_COMPONENT24:i.type===Me?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:i.type,i.format===Te&&x===t.DEPTH_COMPONENT&&i.type!==_e&&i.type!==xe&&(i.type=_e,p=o.convert(i.type)),i.format===Le&&x===t.DEPTH_COMPONENT&&(x=t.DEPTH_STENCIL,i.type!==Me&&(i.type=Me,p=o.convert(i.type))),n.texImage2D(t.TEXTURE_2D,0,x,u.width,u.height,0,d,p,null);else if(i.isDataTexture)if(b.length>0&&h){for(let e=0,i=b.length;e<i;e++)f=b[e],n.texImage2D(t.TEXTURE_2D,e,x,f.width,f.height,0,d,p,f.data);i.generateMipmaps=!1,e.__maxMipLevel=b.length-1}else n.texImage2D(t.TEXTURE_2D,0,x,u.width,u.height,0,d,p,u.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(let e=0,r=b.length;e<r;e++)f=b[e],i.format!==Ee&&i.format!==Se?null!==d&&n.compressedTexImage2D(t.TEXTURE_2D,e,x,f.width,f.height,0,f.data):n.texImage2D(t.TEXTURE_2D,e,x,f.width,f.height,0,d,p,f.data);e.__maxMipLevel=b.length-1}else if(i.isDataTexture2DArray)n.texImage3D(t.TEXTURE_2D_ARRAY,0,x,u.width,u.height,u.depth,0,d,p,u.data),e.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(t.TEXTURE_3D,0,x,u.width,u.height,u.depth,0,d,p,u.data),e.__maxMipLevel=0;else if(b.length>0&&h){for(let e=0,i=b.length;e<i;e++)f=b[e],n.texImage2D(t.TEXTURE_2D,e,x,d,p,f);i.generateMipmaps=!1,e.__maxMipLevel=b.length-1}else n.texImage2D(t.TEXTURE_2D,0,x,d,p,u),e.__maxMipLevel=0;
2v(i,h)&&y(a,i,u.width,u.height),e.__version=i.version,i.onUpdate&&i.onUpdate(i)}function C(e,r,a,s){const l=r.texture,c=o.convert(l.format),u=o.convert(l.type),h=_(l.internalFormat,c,u);s===t.TEXTURE_3D||s===t.TEXTURE_2D_ARRAY?n.texImage3D(s,0,h,r.width,r.height,r.depth,0,c,u,null):n.texImage2D(s,0,h,r.width,r.height,0,c,u,null),n.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,a,s,i.get(l).__webglTexture,0),n.bindFramebuffer(t.FRAMEBUFFER,null)}function D(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(i){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===be?r=t.DEPTH_COMPONENT32F:e.type===xe&&(r=t.DEPTH_COMPONENT24));const i=N(n);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){if(i){const e=N(n);t.renderbufferStorageMultisample(t.RENDERBUFFER,e,t.DEPTH24_STENCIL8,n.width,n.height)}else 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.texture,r=o.convert(e.format),a=o.convert(e.type),s=_(e.internalFormat,r,a);if(i){const e=N(n);t.renderbufferStorageMultisample(t.RENDERBUFFER,e,s,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,s,n.width,n.height)}t.bindRenderbuffer(t.RENDERBUFFER,null)}function O(e){const r=i.get(e),o=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){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),S(r.depthTexture,0);const o=i.get(r.depthTexture).__webglTexture;if(r.depthTexture.format===Te)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,o,0);else{if(r.depthTexture.format!==Le)throw new Error("Unknown depthTexture format");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(),D(r.__webglDepthbuffer[i],e,!1)}else n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),D(r.__webglDepthbuffer,e,!1);n.bindFramebuffer(t.FRAMEBUFFER,null)}function N(t){return s&&t.isWebGLMultisampleRenderTarget?Math.min(u,t.samples):0}let I=!1,F=!1;this.allocateTextureUnit=function(){const t=M;return M+=1,t},this.resetTextureUnits=function(){M=0},this.setTexture2D=S,this.setTexture2DArray=function(e,r){const o=i.get(e);e.version>0&&o.__version!==e.version?R(o,e,r):(n.activeTexture(t.TEXTURE0+r),n.bindTexture(t.TEXTURE_2D_ARRAY,o.__webglTexture))},this.setTexture3D=function(e,r){const o=i.get(e);e.version>0&&o.__version!==e.version?R(o,e,r):(n.activeTexture(t.TEXTURE0+r),n.bindTexture(t.TEXTURE_3D,o.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(e){const r=e.texture,l=i.get(e),c=i.get(r);e.addEventListener("dispose",w),c.__webglTexture=t.createTexture(),c.__version=r.version,a.memory.textures++;const u=!0===e.isWebGLCubeRenderTarget,h=!0===e.isWebGLMultisampleRenderTarget,d=r.isDataTexture3D||r.isDataTexture2DArray,f=g(e)||s;if(!s||r.format!==Se||r.type!==be&&r.type!==we||(r.format=Ee),u){l.__webglFramebuffer=[];for(let e=0;e<6;e++)l.__webglFramebuffer[e]=t.createFramebuffer()}else if(l.__webglFramebuffer=t.createFramebuffer(),h&&s){l.__webglMultisampledFramebuffer=t.createFramebuffer(),l.__webglColorRen
2derbuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,l.__webglColorRenderbuffer);const i=o.convert(r.format),a=o.convert(r.type),s=_(r.internalFormat,i,a),c=N(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,c,s,e.width,e.height),n.bindFramebuffer(t.FRAMEBUFFER,l.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,l.__webglColorRenderbuffer),t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(l.__webglDepthRenderbuffer=t.createRenderbuffer(),D(l.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}if(u){n.bindTexture(t.TEXTURE_CUBE_MAP,c.__webglTexture),A(t.TEXTURE_CUBE_MAP,r,f);for(let n=0;n<6;n++)C(l.__webglFramebuffer[n],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n);v(r,f)&&y(t.TEXTURE_CUBE_MAP,r,e.width,e.height),n.bindTexture(t.TEXTURE_CUBE_MAP,null)}else{let i=t.TEXTURE_2D;if(d&&s){i=r.isDataTexture3D?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY}n.bindTexture(i,c.__webglTexture),A(i,r,f),C(l.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,i),v(r,f)&&y(t.TEXTURE_2D,r,e.width,e.height),n.bindTexture(t.TEXTURE_2D,null)}e.depthBuffer&&O(e)},this.updateRenderTargetMipmap=function(e){const r=e.texture;if(v(r,g(e)||s)){const o=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=i.get(r).__webglTexture;n.bindTexture(o,a),y(o,r,e.width,e.height),n.bindTexture(o,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget&&s){const r=i.get(e);n.bindFramebuffer(t.READ_FRAMEBUFFER,r.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,r.__webglFramebuffer);const o=e.width,a=e.height;let s=t.COLOR_BUFFER_BIT;e.depthBuffer&&(s|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&(s|=t.STENCIL_BUFFER_BIT),t.blitFramebuffer(0,0,o,a,0,0,o,a,s,t.NEAREST),n.bindFramebuffer(t.FRAMEBUFFER,r.__webglMultisampledFramebuffer)}},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===I&&(I=!0),t=t.texture),S(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===F&&(F=!0),t=t.texture),E(t,e)}}function Yo(t,e,n){const i=n.isWebGL2;return{convert:function(n){let r;if(n===ye)return t.UNSIGNED_BYTE;if(1017===n)return t.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return t.UNSIGNED_SHORT_5_5_5_1;if(1019===n)return t.UNSIGNED_SHORT_5_6_5;if(1010===n)return t.BYTE;if(1011===n)return t.SHORT;if(n===_e)return t.UNSIGNED_SHORT;if(1013===n)return t.INT;if(n===xe)return t.UNSIGNED_INT;if(n===be)return t.FLOAT;if(n===we)return i?t.HALF_FLOAT:(r=e.get("OES_texture_half_float"),null!==r?r.HALF_FLOAT_OES:null);if(1021===n)return t.ALPHA;if(n===Se)return t.RGB;if(n===Ee)return t.RGBA;if(1024===n)return t.LUMINANCE;if(1025===n)return t.LUMINANCE_ALPHA;if(n===Te)return t.DEPTH_COMPONENT;if(n===Le)return t.DEPTH_STENCIL;if(1028===n)return t.RED;if(1029===n)return t.RED_INTEGER;if(1030===n)return t.RG;if(1031===n)return t.RG_INTEGER;if(1032===n)return t.RGB_INTEGER;if(1033===n)return t.RGBA_INTEGER;if(33776===n||33777===n||33778===n||33779===n){if(r=e.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(33776===n)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(r=e.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n)return r=e.get("WEBGL_compressed_texture_etc1"),null!==r?r.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===n||37496===n)&&(r=e.get("WEBGL_compressed_texture_etc"),null!==r)){if(37492===n)return r.COMPRESSED_RGB8_ETC2;if(37496===n)return r.COMPRESSED_RGBA8_ETC2_EAC}return 37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n||37840===n||37841===n||37842===n||37843===n||37844===n||37845===n||37846===n||37847===n||37848===n||37849===n||37850===n||37851===n||37852===n||37853===n?(r=e.get("WEBGL_compressed_texture_astc"),null!==r?n:null):36492===n?(r=e.get("EXT_texture_compression_bptc"),null!==r?n:null):n===Me?i?t.UNSIGNED_INT_24_8:(r=e.get("WEBGL_depth_texture"),null!==r?r.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class qo extends Xi{constructor(t=[]){super(),this.cameras=t}}qo.prototype.isArrayCamera=!0;class Ko extends ce{constructor(){super(),this.type="Group"}}function Jo(){this._targetRay=null,this._grip=null,this._hand=null}function Qo(t,e){const n=this,i=t.state;let r=null,o=1,a=null,s="local-floor",l=null;const c=[],u=new Map,h=new Xi;h.layers.enable(1),h.viewport=new dn;const d=new Xi;d.layers.enable(2),d.viewport=new dn;const f=[h,d],p=new qo;p.layers.enable(1),p.layers.enable(2);let m=null,g=null;function v(t){const e=u.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function y(){u.forEach((function(t,e){t.disconnect(e)})),u.clear(),m=null,g=null,i.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function _(t){const e=r.inputSources;for(let t=0;t<c.length;t++)u.set(e[t],c[t]);for(let e=0;e<t.removed.length;e++){const n=t.removed[e],i=u.get(n);i&&(i.dispatchEvent({type:"disconnected",data:n}),u.delete(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e],i=u.get(n);i&&i.dispatchEvent({type:"connected",data:n})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=c[t];return void 0===e&&(e=new Jo,c[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=c[t];return void 0===e&&(e=new Jo,c[t]=e),e.getGripSpace()},this.getHand=function(t){let e=c[t];return void 0===e&&(e=new Jo,c[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){o=t,n.isPresenting},this.setReferenceSpaceType=function(t){s=t,n.isPresenting},this.getReferenceSpace=function(){return a}
vendor: 11,640 bytes, line 2
2,this.getSession=function(){return r},this.setSession=async function(t){if(r=t,null!==r){r.addEventListener("select",v),r.addEventListener("selectstart",v),r.addEventListener("selectend",v),r.addEventListener("squeeze",v),r.addEventListener("squeezestart",v),r.addEventListener("squeezeend",v),r.addEventListener("end",y),r.addEventListener("inputsourceschange",_);const t=e.getContextAttributes();!0!==t.xrCompatible&&await e.makeXRCompatible();const i={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:o},l=new XRWebGLLayer(r,e,i);r.updateRenderState({baseLayer:l}),a=await r.requestReferenceSpace(s),S.setContext(r),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const x=new Ot,b=new Ot;function w(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.getCamera=function(t){p.near=d.near=h.near=t.near,p.far=d.far=h.far=t.far,m===p.near&&g===p.far||(r.updateRenderState({depthNear:p.near,depthFar:p.far}),m=p.near,g=p.far);const e=t.parent,n=p.cameras;w(p,e);for(let t=0;t<n.length;t++)w(n[t],e);t.matrixWorld.copy(p.matrixWorld),t.matrix.copy(p.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale);const i=t.children;for(let t=0,e=i.length;t<e;t++)i[t].updateMatrixWorld(!0);return 2===n.length?function(t,e,n){x.setFromMatrixPosition(e.matrixWorld),b.setFromMatrixPosition(n.matrixWorld);const i=x.distanceTo(b),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(o[8]+1)/o[0],d=a*u,f=a*h,p=i/(-u+h),m=p*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=a+p,v=s+p,y=d-m,_=f+(i-m),w=l*s/v*g,M=c*s/v*g;t.projectionMatrix.makePerspective(y,_,w,M,g,v)}(p,h,d):p.projectionMatrix.copy(h.projectionMatrix),p};let M=null;const S=new xn;S.setAnimationLoop((function(t,e){if(l=e.getViewerPose(a),null!==l){const t=l.views,e=r.renderState.baseLayer;i.bindXRFramebuffer(e.framebuffer);let n=!1;t.length!==p.cameras.length&&(p.cameras.length=0,n=!0);for(let i=0;i<t.length;i++){const r=t[i],o=e.getViewport(r),a=f[i];a.matrix.fromArray(r.transform.matrix),a.projectionMatrix.fromArray(r.projectionMatrix),a.viewport.set(o.x,o.y,o.width,o.height),0===i&&p.matrix.copy(a.matrix),!0===n&&p.cameras.push(a)}}const n=r.inputSources;for(let t=0;t<c.length;t++){const i=c[t],r=n[t];i.update(r,e,a)}M&&M(t,e)})),this.setAnimationLoop=function(t){M=t},this.dispose=function(){}}function $o(t){function e(e,n){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.specularMap&&(e.specularMap.value=n.specularMap);const i=t.get(n).envMap;if(i){e.envMap.value=i,e.flipEnvMap.value=i.isCubeTexture&&i._needsFlipEnvMap?-1:1,e.reflectivity.value=n.reflectivity,e.refractionRatio.value=n.refractionRatio;const r=t.get(i).__maxMipLevel;void 0!==r&&(e.maxMipLevel.value=r)}let r,o;n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity),n.map?r=n.map:n.specularMap?r=n.specularMap:n.displacementMap?r=n.displacementMap:n.normalMap?r=n.normalMap:n.bumpMap?r=n.bumpMap:n.roughnessMap?r=n.roughnessMap:n.metalnessMap?r=n.metalnessMap:n.alphaMap?r=n.alphaMap:n.emissiveMap?r=n.emissiveMap:n.clearcoatMap?r=n.clearcoatMap:n.clearcoatNormalMap?r=n.clearcoatNormalMap:n.clearcoatRoughnessMap&&(r=n.clearcoatRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uv2Transform.value.copy(o.matrix))}function n(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,1===n.side&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),1===n.side&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias);t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,i,r,o){i.isMeshBasicMaterial?e(t,i):i.isMeshLambertMaterial?(e(t,i),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,i)):i.isMeshToonMaterial?(e(t,i),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isMeshPhongMaterial?(e(t,i),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isMeshStandardMaterial?(e(t,i),i.isMeshPhysicalMaterial?function(t,e){n(t,e),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap);e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate());t.transmission.value=e.transmission,e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap)}(t,i):n(t,i)):i.isMeshMatcapMaterial?(e(t,i),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isMeshDepthMaterial?(e(t,i),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isMeshDistanceMaterial?(e(t,i),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,i)):i.isMeshNormalMaterial?(e(t,i),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,i),i.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,i)):i.isPointsMaterial?function(t,e,n,i){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*i,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);let r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,i,r,o):i.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);e.alphaMap&&(t.alphaMap.value=e.alphaMap);let n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(t,i):i.isShadowMaterial?(t.color.value.copy(i.color),t.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function ta(t){const e=void 0!==(t=t||{}).canvas?t.canvas:function(){const t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return t.style.display="block",t}(),n=void 0!==t.context?t.context:null,i=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",u=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let h=null,d=null;const f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Ae,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const m=this;let g=!1,v=0,y=0,_=null,x=-1,b=null;const w=new dn,M=new dn;let S=null,E=e.width,T=e.height,L=1,A=null,P=null;const R=new dn(0,0,E,T),C=new dn(0,0,E,T);let D=!1;const O=new hn;let N=!1,I=!1;const F=new Ft,z=new Ot,U={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function k(){return null===_?L:1}let B,G,H,V,j,W,X,Z,Y,q,K,J,Q,$,tt,et,nt,it,rt,ot,at,st,lt=n;function ct(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:i,depth:r,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if(e.addEventListener("webglcontextlost",dt,!1),e.addEventListener("webglcontextrestored",ft,!1),null===lt){const e=["webgl2","webgl","experimental-webgl"];if(!0===m.isWebGL1Renderer&&e.shift(),lt=ct(e,t),null===lt)throw ct(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===lt.getShaderPrecisionFormat&&(lt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw t}function ut(){B=new Qi(lt),G=new Hi(lt,B,t),B.init(G),at=new Yo(lt,B,G),H=new Xo(lt,B,G),V=new er(lt),j=new Do,W=new Zo(lt,B,H,j,G,at,V),X=new Ji(m),Z=new bn(lt,G),st=new Bi(lt,B,Z,G),Y=new $i(lt,Z,V,st),q=ne
2w or(lt,Y,Z,V),it=new rr(lt),tt=new Vi(j),K=new Co(m,X,B,G,st,tt),J=new $o(j),Q=new Fo(j),$=new Ho(B,G),nt=new ki(m,X,H,q,s),et=new Wo(m,q,G),rt=new Gi(lt,B,V,G),ot=new tr(lt,B,V,G),V.programs=K.programs,m.capabilities=G,m.extensions=B,m.properties=j,m.renderLists=Q,m.shadowMap=et,m.state=H,m.info=V}ut();const ht=new Qo(m,lt);function dt(t){t.preventDefault(),g=!0}function ft(){g=!1;const t=V.autoReset,e=et.enabled,n=et.autoUpdate,i=et.needsUpdate,r=et.type;ut(),V.autoReset=t,et.enabled=e,et.autoUpdate=n,et.needsUpdate=i,et.type=r}function pt(t){const e=t.target;e.removeEventListener("dispose",pt),function(t){(function(t){const e=j.get(t).programs;void 0!==e&&e.forEach((function(t){K.releaseProgram(t)}))})(t),j.remove(t)}(e)}this.xr=ht,this.getContext=function(){return lt},this.getContextAttributes=function(){return lt.getContextAttributes()},this.forceContextLoss=function(){const t=B.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=B.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(t){void 0!==t&&(L=t,this.setSize(E,T,!1))},this.getSize=function(t){return void 0===t&&(t=new Ce),t.set(E,T)},this.setSize=function(t,n,i){ht.isPresenting||(E=t,T=n,e.width=Math.floor(t*L),e.height=Math.floor(n*L),!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(t=new Ce),t.set(E*L,T*L).floor()},this.setDrawingBufferSize=function(t,n,i){E=t,T=n,L=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(t=new dn),t.copy(w)},this.getViewport=function(t){return t.copy(R)},this.setViewport=function(t,e,n,i){t.isVector4?R.set(t.x,t.y,t.z,t.w):R.set(t,e,n,i),H.viewport(w.copy(R).multiplyScalar(L).floor())},this.getScissor=function(t){return t.copy(C)},this.setScissor=function(t,e,n,i){t.isVector4?C.set(t.x,t.y,t.z,t.w):C.set(t,e,n,i),H.scissor(M.copy(C).multiplyScalar(L).floor())},this.getScissorTest=function(){return D},this.setScissorTest=function(t){H.setScissorTest(D=t)},this.setOpaqueSort=function(t){A=t},this.setTransparentSort=function(t){P=t},this.getClearColor=function(t){return void 0===t&&(t=new _n),t.copy(nt.getClearColor())},this.setClearColor=function(){nt.setClearColor.apply(nt,arguments)},this.getClearAlpha=function(){return nt.getClearAlpha()},this.setClearAlpha=function(){nt.setClearAlpha.apply(nt,arguments)},this.clear=function(t,e,n){let i=0;(void 0===t||t)&&(i|=lt.COLOR_BUFFER_BIT),(void 0===e||e)&&(i|=lt.DEPTH_BUFFER_BIT),(void 0===n||n)&&(i|=lt.STENCIL_BUFFER_BIT),lt.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",dt,!1),e.removeEventListener("webglcontextrestored",ft,!1),Q.dispose(),$.dispose(),j.dispose(),X.dispose(),q.dispose(),st.dispose(),ht.dispose(),ht.removeEventListener("sessionstart",gt),ht.removeEventListener("sessionend",vt),yt.stop()},this.renderBufferImmediate=function(t,e){st.initAttributes();const n=j.get(t);t.hasPositions&&!n.position&&(n.position=lt.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=lt.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=lt.createBuffer()),t.hasColors&&!n.color&&(n.color=lt.createBuffer());const i=e.getAttributes();t.hasPositions&&(lt.bindBuffer(lt.ARRAY_BUFFER,n.position),lt.bufferData(lt.ARRAY_BUFFER,t.positionArray,lt.DYNAMIC_DRAW),st.enableAttribute(i.position),lt.vertexAttribPointer(i.position,3,lt.FLOAT,!1,0,0)),t.hasNormals&&
2(lt.bindBuffer(lt.ARRAY_BUFFER,n.normal),lt.bufferData(lt.ARRAY_BUFFER,t.normalArray,lt.DYNAMIC_DRAW),st.enableAttribute(i.normal),lt.vertexAttribPointer(i.normal,3,lt.FLOAT,!1,0,0)),t.hasUvs&&(lt.bindBuffer(lt.ARRAY_BUFFER,n.uv),lt.bufferData(lt.ARRAY_BUFFER,t.uvArray,lt.DYNAMIC_DRAW),st.enableAttribute(i.uv),lt.vertexAttribPointer(i.uv,2,lt.FLOAT,!1,0,0)),t.hasColors&&(lt.bindBuffer(lt.ARRAY_BUFFER,n.color),lt.bufferData(lt.ARRAY_BUFFER,t.colorArray,lt.DYNAMIC_DRAW),st.enableAttribute(i.color),lt.vertexAttribPointer(i.color,3,lt.FLOAT,!1,0,0)),st.disableUnusedAttributes(),lt.drawArrays(lt.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,i,r,o){null===e&&(e=U);const a=r.isMesh&&r.matrixWorld.determinant()<0,s=St(t,e,i,r);H.setMaterial(i,a);let l=n.index;const c=n.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let u,h=1;!0===i.wireframe&&(l=Y.getWireframeAttribute(n),h=2),(i.morphTargets||i.morphNormals)&&it.update(r,n,i,s),st.setup(r,i,s,n,l);let d=rt;null!==l&&(u=Z.get(l),d=ot,d.setIndex(u));const f=null!==l?l.count:c.count,p=n.drawRange.start*h,m=n.drawRange.count*h,g=null!==o?o.start*h:0,v=null!==o?o.count*h:1/0,y=Math.max(p,g),_=Math.min(f,p+m,g+v)-1,x=Math.max(0,_-y+1);if(0!==x){if(r.isMesh)!0===i.wireframe?(H.setLineWidth(i.wireframeLinewidth*k()),d.setMode(lt.LINES)):d.setMode(lt.TRIANGLES);else if(r.isLine){let t=i.linewidth;void 0===t&&(t=1),H.setLineWidth(t*k()),r.isLineSegments?d.setMode(lt.LINES):r.isLineLoop?d.setMode(lt.LINE_LOOP):d.setMode(lt.LINE_STRIP)}else r.isPoints?d.setMode(lt.POINTS):r.isSprite&&d.setMode(lt.TRIANGLES);if(r.isInstancedMesh)d.renderInstances(y,x,r.count);else if(n.isInstancedBufferGeometry){const t=Math.min(n.instanceCount,n._maxInstanceCount);d.renderInstances(y,x,t)}else d.render(y,x)}},this.compile=function(t,e){d=$.get(t),d.init(),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights(),t.traverse((function(e){const n=e.material;if(n)if(Array.isArray(n))for(let i=0;i<n.length;i++){wt(n[i],t,e)}else wt(n,t,e)}))};let mt=null;function gt(){yt.stop()}function vt(){yt.start()}const yt=new xn;function _t(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)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||O.intersectsSprite(t)){i&&z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F);const e=q.update(t),r=t.material;r.visible&&h.push(t,e,r,n,z.z,null)}}else if(t.isImmediateRenderObject)i&&z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F),h.push(t,null,t.material,n,z.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==V.render.frame&&(t.skeleton.update(),t.skeleton.frame=V.render.frame),!t.frustumCulled||O.intersectsObject(t))){i&&z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F);const e=q.update(t),r=t.material;if(Array.isArray(r)){const i=e.groups;for(let o=0,a=i.length;o<a;o++){const a=i[o],s=r[a.materialIndex];s&&s.visible&&h.push(t,e,s,n,z.z,a)}}else r.visible&&h.push(t,e,r,n,z.z,null)}const r=t.children;for(let t=0,o=r.length;t<o;t++)_t(r[t],e,n,i)}function xt(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],a=o.object,s=o.geometry,l=null===i?o.material:i,c=o.group;if(n.isArrayCamera){const t=n.cameras;for(let n=0,i=t.length;n<i;n++){const i=t[n];a.layers.test(i.layers)&&(H.viewport(w.copy(i.viewport)),d.setupLightsView(i),bt(a,e,i,s,l,c))}}else bt(a,e,n,s,l,c)}}function bt(t,e,n,i,r,o){if(t.onBeforeRender(m,e,n,i,r,o),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){const i=St(n,e,r,t);H.setMaterial(r),st.reset(),function(t,e){t.render((function(t){m.renderBufferImmediate(t,e)}))}(t,i)}else m.renderBufferDirect(n,e,i,r,t,o);t.onAfterRender(m,e,n,i,r,o)}function wt(t,e,n){!0!==e.isScene&&(e=U);const i=j.get(t),r=d.state.lights,o=d.state.shadowsArray,a=r.state.ver
2sion,s=K.getParameters(t,r.state,o,e,n),l=K.getProgramCacheKey(s);let c=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null,i.fog=e.fog,i.envMap=X.get(t.envMap||i.environment),void 0===c&&(t.addEventListener("dispose",pt),c=new Map,i.programs=c);let u=c.get(l);if(void 0!==u){if(i.currentProgram===u&&i.lightsStateVersion===a)return Mt(t,s),u}else s.uniforms=K.getUniforms(t),t.onBeforeCompile(s,m),u=K.acquireProgram(s,l),c.set(l,u),i.uniforms=s.uniforms;const h=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(h.clippingPlanes=tt.uniform),Mt(t,s),i.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),i.lightsStateVersion=a,i.needsLights&&(h.ambientLightColor.value=r.state.ambient,h.lightProbe.value=r.state.probe,h.directionalLights.value=r.state.directional,h.directionalLightShadows.value=r.state.directionalShadow,h.spotLights.value=r.state.spot,h.spotLightShadows.value=r.state.spotShadow,h.rectAreaLights.value=r.state.rectArea,h.ltc_1.value=r.state.rectAreaLTC1,h.ltc_2.value=r.state.rectAreaLTC2,h.pointLights.value=r.state.point,h.pointLightShadows.value=r.state.pointShadow,h.hemisphereLights.value=r.state.hemi,h.directionalShadowMap.value=r.state.directionalShadowMap,h.directionalShadowMatrix.value=r.state.directionalShadowMatrix,h.spotShadowMap.value=r.state.spotShadowMap,h.spotShadowMatrix.value=r.state.spotShadowMatrix,h.pointShadowMap.value=r.state.pointShadowMap,h.pointShadowMatrix.value=r.state.pointShadowMatrix);const f=u.getUniforms(),p=co.seqWithValue(f.seq,h);return i.currentProgram=u,i.uniformsList=p,u}function Mt(t,e){const n=j.get(t);n.outputEncoding=e.outputEncoding,n.instancing=e.instancing,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas}function St(t,e,n,i){!0!==e.isScene&&(e=U),W.resetTextureUnits();const r=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=null===_?m.outputEncoding:_.texture.encoding,s=X.get(n.envMap||o),l=!0===n.vertexColors&&i.geometry.attributes.color&&4===i.geometry.attributes.color.itemSize,c=j.get(n),u=d.state.lights;if(!0===N&&(!0===I||t!==b)){const e=t===b&&n.id===x;tt.setState(n,t,e)}let h=!1;n.version===c.__version?c.needsLights&&c.lightsStateVersion!==u.state.version||c.outputEncoding!==a||i.isInstancedMesh&&!1===c.instancing?h=!0:i.isInstancedMesh||!0!==c.instancing?c.envMap!==s||n.fog&&c.fog!==r?h=!0:void 0===c.numClippingPlanes||c.numClippingPlanes===tt.numPlanes&&c.numIntersection===tt.numIntersection?c.vertexAlphas!==l&&(h=!0):h=!0:h=!0:(h=!0,c.__version=n.version);let f=c.currentProgram;!0===h&&(f=wt(n,e,i));let p=!1,g=!1,v=!1;const y=f.getUniforms(),w=c.uniforms;if(H.useProgram(f.program)&&(p=!0,g=!0,v=!0),n.id!==x&&(x=n.id,g=!0),p||b!==t){if(y.setValue(lt,"projectionMatrix",t.projectionMatrix),G.logarithmicDepthBuffer&&y.setValue(lt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),b!==t&&(b=t,g=!0,v=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const e=y.map.cameraPosition;void 0!==e&&e.setValue(lt,z.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&y.setValue(lt,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&y.setValue(lt,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){y.setOptional(lt,i,"bindMatrix"),y.setOptional(lt,i,"bindMatrixInverse");const t=i.skeleton;if(t){const e=t.bones;if(G.floatVertexTextures){if(null===t.boneTexture){let n=Math.sqrt(4*e.length);n=Ct.ceilPowerOfTwo(n),n=Math.max(n,4);const i=new Float32Array(n*n*4);i.set(t.boneMatrices);const r=new ze(i,n,n,Ee,be);t.boneMatrices=i,t.boneTexture=r,t.boneTextureSize=n}y.setValue(lt,"boneTexture",t.boneTexture,W),y.setValue(lt,"boneTextureSize",t.boneTextureSize)}else y.setOptional(lt,t,"boneMatrices")}}var M,S;return(g||c.receiveShadow!==i.receiveShadow)&&(c.receiveShadow=i.receiveShadow,y.setValue(lt,"receiveShadow",i.receiveShadow)),g&&(y.setValue(lt,"toneMappingExposure",m.toneMappingExposure),c.needsLights&&(S=v,(M=w).ambientLightColor.needsUpdate=S,M.lightProbe.needsUpdate=S,M.directionalLights.needsUpdate=S,M.directionalLightShadows.needsUpdate=S,M.pointLights.needsUpdate=S,M.pointLightShadows.needsUpdate=S,M.spotLights.needsUpdate=S,M.spotLightShadows.needsUpdate=S,M.rectAreaLights.needsUpdate=S,M.hemisphereLights.needsUpdate=S),r&&n.fog&&J.refreshFogUniforms(w,r),J.refreshMaterialUniforms(w,n,L,T),co.upload(lt,c.uniformsList,w,W)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(co.upload(lt,c.uniformsList,w,W),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&y.setValue(lt,"center",i.center),y.setValue(lt,"modelViewMatrix",i.modelViewMatrix),y.setValue(lt,"normalMatrix",i.normalMatrix),y.setValue(lt,"modelMatrix",i.matrixWorld),f}yt.setAnimationLoop((function(t){mt&&mt(t)})),"undefined"!=typeof window&&yt.setContext(window),this.setAnimationLoop=function(t){mt=t,ht.setAnimationLoop(t),null===t?yt.stop():yt.start()},ht.addEventListener("sessionstart",gt),ht.addEventListener("sessionend",vt),this.render=function(t,e){let n,i;if(void 0!==arguments[2]&&(n=arguments[2]),void 0!==arguments[3]&&(i=arguments[3]),void 0!==e&&!0!==e.isCamera)return;if(!0===g)return;!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===ht.enabled&&!0===ht.isPresenting&&(e=ht.getCamera(e)),!0===t.isScene&&t.onBeforeRender(m,t,e,n||_),d=$.get(t,p.length),d.init(),p.push(d),F.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),O.setFromProjectionMatrix(F),I=this.localClippingEnabled,N=tt.init(this.clippingPlanes,I,e),h=Q.get(t,f.length),h.init(),f.pu
2sh(h),_t(t,e,0,m.sortObjects),h.finish(),!0===m.sortObjects&&h.sort(A,P),!0===N&&tt.beginShadows();const r=d.state.shadowsArray;et.render(r,t,e),d.setupLights(),d.setupLightsView(e),!0===N&&tt.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),nt.render(h,t,e,i);const o=h.opaque,a=h.transparent;o.length>0&&xt(o,t,e),a.length>0&&xt(a,t,e),null!==_&&(W.updateRenderTargetMipmap(_),W.updateMultisampleRenderTarget(_)),!0===t.isScene&&t.onAfterRender(m,t,e),H.buffers.depth.setTest(!0),H.buffers.depth.setMask(!0),H.buffers.color.setMask(!0),H.setPolygonOffset(!1),st.resetDefaultState(),x=-1,b=null,p.pop(),d=p.length>0?p[p.length-1]:null,f.pop(),h=f.length>0?f[f.length-1]:null},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return _},this.setRenderTarget=function(t,e=0,n=0){_=t,v=e,y=n,t&&void 0===j.get(t).__webglFramebuffer&&W.setupRenderTarget(t);let i=null,r=!1,o=!1;if(t){const n=t.texture;(n.isDataTexture3D||n.isDataTexture2DArray)&&(o=!0);const a=j.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=a[e],r=!0):i=t.isWebGLMultisampleRenderTarget?j.get(t).__webglMultisampledFramebuffer:a,w.copy(t.viewport),M.copy(t.scissor),S=t.scissorTest}else w.copy(R).multiplyScalar(L).floor(),M.copy(C).multiplyScalar(L).floor(),S=D;if(H.bindFramebuffer(lt.FRAMEBUFFER,i),H.viewport(w),H.scissor(M),H.setScissorTest(S),r){const i=j.get(t.texture);lt.framebufferTexture2D(lt.FRAMEBUFFER,lt.COLOR_ATTACHMENT0,lt.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(o){const i=j.get(t.texture),r=e||0;lt.framebufferTextureLayer(lt.FRAMEBUFFER,lt.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}},this.readRenderTargetPixels=function(t,e,n,i,r,o,a){if(!t||!t.isWebGLRenderTarget)return;let s=j.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){H.bindFramebuffer(lt.FRAMEBUFFER,s);try{const a=t.texture,s=a.format,l=a.type;if(s!==Ee&&at.convert(s)!==lt.getParameter(lt.IMPLEMENTATION_COLOR_READ_FORMAT))return;const c=l===we&&(B.has("EXT_color_buffer_half_float")||G.isWebGL2&&B.has("EXT_color_buffer_float"));if(!(l===ye||at.convert(l)===lt.getParameter(lt.IMPLEMENTATION_COLOR_READ_TYPE)||l===be&&(G.isWebGL2||B.has("OES_texture_float")||B.has("WEBGL_color_buffer_float"))||c))return;lt.checkFramebufferStatus(lt.FRAMEBUFFER)===lt.FRAMEBUFFER_COMPLETE&&e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&lt.readPixels(e,n,i,r,at.convert(s),at.convert(l),o)}finally{const t=null!==_?j.get(_).__webglFramebuffer:null;H.bindFramebuffer(lt.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),a=at.convert(e.format);W.setTexture2D(e,0),lt.copyTexImage2D(lt.TEXTURE_2D,n,a,t.x,t.y,r,o,0),H.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,o=e.image.height,a=at.convert(n.format),s=at.convert(n.type);W.setTexture2D(n,0),lt.pixelStorei(lt.UNPACK_FLIP_Y_WEBGL,n.flipY),lt.pixelStorei(lt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),lt.pixelStorei(lt.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?lt.texSubImage2D(lt.TEXTURE_2D,i,t.x,t.y,r,o,a,s,e.image.data):e.isCompressedTexture?lt.compressedTexSubImage2D(lt.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):lt.texSubImage2D(lt.TEXTURE_2D,i,t.x,t.y,a,s,e.image),0===i&&n.generateMipmaps&&lt.generateMipmap(lt.TEXTURE_2D),H.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(m.isWebGL1Renderer)return;const{width:o,height:a,data:s}=n.image,l=at.convert(i.format),c=at.convert(i.type);let u;if(i.isDataTexture3D)W.setTexture3D(i,0),u=lt.TEXTURE_3D;else{if(!i.isDataTexture2DArray)return;W.setTexture2DArray(i,0),u=lt.TEXTURE_2D_ARRAY}lt.pixelStorei(lt.UNPACK_FLIP_Y_WEBGL,i.flipY),lt.pixelStorei(lt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),lt.pixelStorei(lt.UNPACK_ALIGNMENT,i.unpackAlignment);const h=lt.getParameter(lt.UNPACK_ROW_LENGTH),d=lt.getParameter(lt.UNPACK_IMAGE_HEIGHT),f=lt.getParameter(lt.UNPACK_SKIP_PIXELS),p=lt.getParameter(lt.UNPACK_SKIP_ROWS),g=lt.getParameter(lt.UNPACK_SKIP_IMAGES);lt.pixelStorei(lt.UNPACK_ROW_LENGTH,o),lt.pixelStorei(lt.UNPACK_IMAGE_HEIGHT,a),lt.pixelStorei(lt.UNPACK_SKIP_PIXELS,t.min.x),lt.pixelStorei(lt.UNPACK_SKIP_ROWS,t.min.y),lt.pixelStorei(lt.UNPACK_SKIP_IMAGES,t.min.z),lt.texSubImage3D(u,r,e.x,e.y,e.z,t.max.x-t.min.x+1,t.max.y-t.min.y+1,t.max.z-t.min.z+1,l,c,s),lt.pixelStorei(lt.UNPACK_ROW_LENGTH,h),lt.pixelStorei(lt.UNPACK_IMAGE_HEIGHT,d),lt.pixelStorei(lt.UNPACK_SKIP_PIXELS,f),lt.pixelStorei(lt.UNPACK_SKIP_ROWS,p),lt.pixelStorei(lt.UNPACK_SKIP_IMAGES,g),0===r&&i.generateMipmaps&&lt.generateMipmap(u),H.unbindTexture()},this.initTexture=function(t){W.setTexture2D(t,0),H.unbindTexture()},this.resetState=function(){v=0,y=0,_=null,H.reset(),st.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Ko.prototype.isGroup=!0,Object.assign(Jo.prototype,{constructor:Jo,getHandSpace:function(){return null===this._hand&&(this._hand=new Ko,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Ko,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Ko,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(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:function(t,e,n){let i=null,r=null,o=null;const a=this._targetRay,s=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(null!==a&&(i=e.getPose(t.targetRaySpace,n),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),l&&t.hand){o=!0;for(const i of t.hand.values()){const t=e.getJointPose(i,n);if(void 0===l.joints[i.jointName]){const t=new Ko;t.matrixAutoUpdate=!1,t.visible=!1,l.joints[i.jointName]=t,l.add(t)}const r=l.joints[i.jointName];null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=t.radius),r.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],a=i.position.distanceTo(r.position),s=.02,c=.005;l.inputState.pinching&&a>s+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=s-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==s&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)));return null!==a&&(a.visible=null!==i),null!==s&&(s.visible=null!==r),null!==l&&(l.visible=null!==o),this}}),Object.assign(Qo.prototype,jt.prototype);class ea extends ce{constructor(t,e=1){super(),this.type="Light",this.color=new _n(t),this.intensity=e}copy(t){return super.copy(t),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}}ea.prototype.isLight=!0;const na=new Ft,ia=new Ot,ra=new Ot;class oa extends Wi{constructor(t=-1,e=1,n=1,i=-1,r=.1,o=2e3){super(),this.type="Orthogra
2phicCamera",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,a=i+e,s=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,a-=e*this.view.offsetY,s=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=ce.prototype.toJSON.call(this,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}}oa.prototype.isOrthographicCamera=!0;class aa extends class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Ce(512,512),this.map=null,this.mapPass=null,this.matrix=new Ft,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new hn,this._frameExtents=new Ce(1,1),this._viewportCount=1,this._viewports=[new dn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;ia.setFromMatrixPosition(t.matrixWorld),e.position.copy(ia),ra.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(ra),e.updateMatrixWorld(),na.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(na),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}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}}{constructor(){super(new oa(-5,5,5,-5,.5,500))}}aa.prototype.isDirectionalLightShadow=!0;class sa extends ea{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(ce.DefaultUp),this.updateMatrix(),this.target=new ce,this.shadow=new aa}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}sa.prototype.isDirectionalLight=!0;class la extends ea{constructor(t,e){super(t,e),this.type="AmbientLight"}}la.prototype.isAmbientLight=!0;class ca extends ea{constructor(t,e,n){super(t,n),this.type="HemisphereLight",this.position.copy(ce.DefaultUp),this.updateMatrix(),this.groundColor=new _n(e)}copy(t){return ea.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}ca.prototype.isHemisphereLight=!0;class ua extends Vn{constructor(t=1,e=8,n=6,i=0,r=2*Math.PI,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const s=Math.min(o+a,Math.PI);let l=0;const c=[],u=new Ot,h=new Ot,d=[],f=[],p=[],m=[];for(let d=0;d<=n;d++){const g=[],v=d/n;let y=0;0==d&&0==o?y=.5/e:d==n&&s==Math.PI&&(y=-.5/e);for(let n=0;n<=e;n++){const s=n/e;u.x=-t*Math.cos(i+s*r)*Math.sin(o+v*a),u.y=t*Math.cos(o+v*a),u.z=t*Math.sin(i+s*r)*Math.sin(o+v*a),f.push(u.x,u.y,u.z),h.copy(u).normalize(),p.push(h.x,h.y,h.z),m.push(s+y,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],a=c[t+1][i],l=c[t+1][i+1];(0!==t||o>0)&&d.push(e,r,l),(t!==n-1||s<Math.PI)&&d.push(r,a,l)}this.setIndex(d),this.setAttribute("position",new On(f,3)),this.setAttribute("normal",new On(p,3)),this.setAttribute("uv",new On(m,2))}}function ha(t){Zn.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _n(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 _n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(t)}ha.prototype=Object.create(Zn.prototype),ha.prototype.constructor=ha,ha.prototype.isMeshStandardMaterial=!0,ha.prototype.copy=function(t){return Zn.prototype.copy.call(this,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.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this};const da={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={}}};const fa=new function(t,e,n){const i=this;let r,o=!1,a=0,s=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===o&&void 0!==i.onStart&&i.onStart(t,a,s),o=!0},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,s),a===s&&(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}};function pa(t){this.manager=void 0!==t?t:fa,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(pa.prototype,{load:function(){},loadAsync:function(t,e){const n=this;return new Promise((function(i,r){n.load(t,i,e,r)}))},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});class ma extends pa{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=da.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),da.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a}}function ga(t){pa.call(this,t)}ga.prototype=Object.assign(Object.create(pa.prototype),{constructor:ga,load:function(t,e,n,i){const r=new Ie,o=new ma(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){r.image=n;const i=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=i?Se:Ee,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r}});var va=n(7438);function ya(t){return(ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function xa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
2e%2?_a(Object(n),!0).forEach((function(e){ba(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ba(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wa(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function Ma(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sa(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ea(t,e,n){return(Ea="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pa(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function Ta(t,e){return(Ta=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function La(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Pa(t);if(e){var r=Pa(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Aa(this,n)}}function Aa(t,e){return!e||"object"!==ya(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Pa(t){return(Pa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ra=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ta(t,e)}(c,t);var e,n,i,o,s,l=La(c);function c(){return Ma(this,c),l.apply(this,arguments)}return e=c,(n=[{key:"init",value:(o=r().mark((function t(){var e,n,i,o=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ea(Pa(c.prototype),"init",this).call(this),e=this.el,n=e.clientWidth,i=e.clientHeight,this.observer=new IntersectionObserver(this.inView,{threshold:0,rootMargin:"0% 0% 0% 0%"}),this.w=n,this.h=i,this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.tick=this.tick.bind(this),this.isPointerDown=!1,this.animating=!0,this.generalParams={rotation:.1},this.rotationX=Math.PI/6,this.rotationXLerp=Math.PI/6,this.cloudsRotation=0,this.center=new Ot(0,0,0),this.points=[],this.markers=this.getAll(".location"),this.markers.forEach((function(t){var e=t.dataset,n=e.lat,i=e.lng;o.points.push({position:o.convertCoordinates(parseFloat(n),parseFloat(i)),element:t})})),this.pointer={x:this.w,y:this.h},this.targetRotationOnMouseDown={x:0,y:0},this.targetRotation={x:0,y:0},this.currentMove={x:0,y:0},this.mouseOnMouseDown={x:0,y:0},this.cameraDistance=1.935,this.settings={backgroundColor:new _n(16777215)},this.resizeCb=function(){return o.onResize()},this.loader=new ga,this.createScene(),this.createCamera(),this.createRenderer(),this.createWorld(),this.createLight(),a.Z.raf.add(this.tick,this.id),t.next=36,(0,va.Z)(500);case 36:this.observe();case 37:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,i){var r=o.apply(t,e);function a(t){wa(r,n,i,a,s,"next",t)}function s(t){wa(r,n,i,a,s,"throw",t)}a(void 0)}))},function(){return s.apply(this,arguments)})},{key:"animateIn",value:function(){this.animating=!0}},{key:"animateOut",value:function(){this.animating=!1}},{key:"tick",value:function(){this.animating&&(this.update(),this.render())}},{key:"inView",value:function(t){var e=this;t.forEach((function(t){var n=t.isIntersecting;e.animating=n}))}},{key:"addEvents",value:function(){Ea(Pa(c.prototype),"addEvents",this).call(this),window.addEventListener("resize",this.resizeCb,{passive:!0}),"ontouchmove"in a.Z.win?(this.el.addEventListener("touchstart",this.onMouseDown,{passive:!0}),this.el.addEventListener("touchmove",this.onMouseMove,{passive:!0}),this.el.addEventListener("touchend",this.onMouseUp)):(this.el.addEventListener("mousedown",this.onMouseDown),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseup",this.onMouseUp))}},{key:"removeEvents",value:function(){Ea(Pa(c.prototype),"removeEvents",this).call(this),this.unobserve(),window.removeEventListener("resize",this.resizeCb),"ontouchmove"in a.Z.win?(this.el.removeEventListener("touchstart",this.onMouseDown),this.el.removeEventListener("touchmove",this.onMouseMove),this.el.removeEventListener("touchend",this.onMouseUp)):(this.el.removeEventListener("mousedown",this.onMouseDown),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseup",this.onMouseUp)),this.renderer.dispose()}},{key:"update",value:function(){this.cloudsRotation+=15e-6,this.clouds.rotation.y+=this.cloudsRotation+.03*(this.targetRotation.x-this.clouds.rotation.y),this.worldGroup1.rotation.y+=.05*(this.targetRotation.x-this.worldGroup1.rotation.y),this.rotationX+=.05*(this.targetRotation.y-this.rotationX),this.rotationXLerp=(0,At.t7)(this.rotationXLerp,(0,At.uZ)(this.rotationX,-.5,.5),.1),this.worldGroup2.rotation.x=this.rotationXLerp;for(var t=0;t<this.points.length;t++){var e=this.pointGroup.children[t],n=e.getWorldPosition(this.center).clone(),i=e.getWorldPosition(this.center).clone();n.project(this.camera);var r=n.x*this.w*.5,o=-n.y*this.h*.5,a=i.z;this.points[t].element.style.transform="translateX(".concat(r,"px) translateY(").concat(o,"px) scale(").concat(a,")"),i.y<1&&i.z>.5?this.points[t].element.classList.add("visible"):this.points[t].element.classList.remove("visible")}}},{key:"render",value:function(){this.renderer.render(this.scene,this.camera)}},{key:"createScene",value:function(){this.scene=new ue}},{key:"resizeCamera",value:function(t,e,n){this.camera.aspect=t/e,this.camera.fov=70,this.camera.updateProjectionMatrix()}},{key:"createCamera",value:function(){var t=this.w,e=this.h,n=this.cameraDistance;this.camera=new Xi,this.camera.near=.01,this.camera.far=1e3,this.resizeCamera(t,e,n),this.camera.position.set(0,0,n)}},{key:"createRenderer",value:function(){this.renderer=new ta({alpha:!0,antialias:!0}),this.el.appendChild(this.renderer.domElement),this.renderer.setSize(this.el.clientWidth,this.el.clientHeight),this.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),this.renderer.setClearColor(this.settings.backgroundColor),this.renderer.gammaOutput=!0,this.renderer.physicallyCorrectLights=!0}},{key:"onMouseDown",value:function(t){this.isPointerDown||(this.isPointerDown=!0,a.Z.dragComponent=!0,this.pointer.x=t.touches?t.touches[0].clientX:t.clientX,this.pointer.y=t.touches?t.touches[0].clientY:t.clientY,this.targetRotationOnMouseDown.x=this.targetRotation.x,this.targetRotationOnMouseDown.y=this.targetRotation.y)}},{key:"onMouseMove",value:function(t){if(this.isPointerDown){var e=t.touches?t.touches[0].clientX:t.clientX,n=t.touches?t.touches[0].clientY:t.clientY;this.currentMove.x=e-this.pointer.x,this.currentMove.y=n-this.pointer.y,this.targetRotation.y=(0,At.uZ)(this.targetRotationOnMouseDown.y+.01*(this.currentMove.y-this.mouseOnMouseDown.y),-.5,.5),this.targetRotation.x=this.targetRotationOnMouseDown.x+.01*(this.currentMove.x-this.mouseOnMouseDown.x)}}},{key:"onMouseUp",value:function(){this.isPointerDown=!1,a.Z.dragComponent=!1}},{key:"convertToRGB",value:function(t){if(6!=t.length)throw"Only six-digit hex colors are allowed.";var e=t.match(/.{1,2}/g);return{r:parseInt(e[0],16),g:parseInt(e[1],16),b:parseInt(e[2],16)}}},{key:"createLight",value:function(){this.ligthParams={directional:{strength:.7,pos:{x:3,y:2.39,z:1.32},color:this.convertToRGB("ffffff")},hemisphere:{strength:2,colors:{top:this.convertToRGB("c9c9c9"),bottom:this.convertToRGB("343434")},pos:{x:0,y:1,z:0}},ambient:{strength:40,color:this.convertToRGB("0c0c0c")}},this.setupAmbientLight(),this.setupDirectionalLight(),this.setupHemisphere()}},{key:"setupAmbientLight",value:function(){var t=this.ligthParams.ambient,e=t.color,n=t.strength,i=e.r,r=e.g,o=e.b;this.ambientLight=new la("rgb(".concat(i,", ").concat(r,", ").concat(o,")"),n),this.scene.add(this.ambientLight)}},{key:"setupDirectionalLight",value:function(){var t=this.ligthParams.directional,e=t.color,n=t.strength,i=t.pos,r=i.x,o=i.y,a=i.z,s=e.r,l=e.g,c=e.b;this.directionalLight=new sa("rgb(".concat(s,", ").concat(l,", ").concat(c,")"),n),this.directionalLight.position.set(r,o,a)}},{key:"setupHemisphere",value:function(){var t=this.ligthParams.hemisphere,e=t.colors,n=t.strength,i=t.pos,r=i.x,o=i.y,a=i.z,s=e.top,l=e.bottom;this.hemisphereLight=new ca("rgb(".concat(s.r,", ").concat(s.g,", ").concat(s.b,")"),"rgb(".concat(l.r,", ").concat(l.g,", ").concat(l.b,")"),n),this.hemisphereLight.position.set(r,o,a),this.scene.add(this.hemisphereLight),this.scene.add(this.directionalLight)}},{key:"convertCoordinates",value:function(t,e){var n=t*(Math.PI/180),i=(e+180)*(Math.PI/180),r=-Math.cos(n)*Math.cos(i),o=Math.sin(n),a=Math.cos(n)*Math.sin(i);return new Ot(r,o,a)}},{key:"createWorld",value:function(){var t=this;this.worldGroup1=new Ko,this.worldGroup2=new Ko,this.worldGroup3=new Ko,this.pointGroup=new Ko,this.worldParams={roughness:.63,bumpScale:.005,rotation:{x:.3525901723,y:-.29946}}
2,this.points.forEach((function(e){var n=new ce;n.position.set(e.position.x,e.position.y,e.position.z),t.pointGroup.add(n)})),this.worldGroup1.add(this.pointGroup),this.worldGeometry=new ua(1,60,60),this.cloudsGeometry=new ua(1.005,60,60),this.worldMaterial=new ha(xa(xa({},this.worldParams),{},{map:this.loader.load("/assets/images/earth/earth_diffuse.webp"),bumpMap:this.loader.load("/assets/images/earth/earth_bump.webp"),roughnessMap:this.loader.load("/assets/images/earth/earth_rough.webp")})),this.materialParams={saturation:.9,fresnel:.15};var e=this;this.worldMaterial.onBeforeCompile=function(n){n.uniforms.fresnelFactor={value:e.materialParams.fresnel},n.uniforms.saturateFactor={value:e.materialParams.saturation},e.worldMaterial.fresnelFactor=n.uniforms.fresnelFactor,e.worldMaterial.saturateFactor=n.uniforms.saturateFactor,n.vertexShader=n.vertexShader.replace("varying vec3 vViewPosition;","\n              varying vec3 vViewPosition;\n              varying vec3 vNN;\n              varying vec3 vEye;\n          "),n.vertexShader=n.vertexShader.replace("#include <fog_vertex>","\n            #include <fog_vertex>;\n            mat4 LM = modelMatrix;\n            LM[2][3] = 0.0;\n            LM[3][0] = 0.0;\n            LM[3][1] = 0.0;\n            LM[3][2] = 0.0;\n\n            vec4 GN = LM * vec4(objectNormal.xyz, 1.0);\n            vNN = normalize(GN.xyz);\n            vEye = normalize(GN.xyz-cameraPosition);\n          "),n.fragmentShader=n.fragmentShader.replace("uniform vec3 diffuse;","\n              uniform vec3 diffuse;\n\n              uniform float fresnelFactor;\n              uniform float saturateFactor;\n\n              varying vec3 vNN;\n              varying vec3 vEye;\n\n              vec3 desaturate(vec3 color) {\n                    float bw = (min(color.r, min(color.g, color.b)) + max(color.r, max(color.g, color.b))) * 0.5;\n                    return vec3(bw, bw, bw);\n            }\n          "),n.fragmentShader=n.fragmentShader.replace("gl_FragColor = vec4( outgoingLight, diffuseColor.a );","\n            vec3 outgoingLightCopy = outgoingLight;\n            outgoingLightCopy.rgb +=  1. - -min(dot(vEye, normalize(vNN) ), .0);\n\n            vec3 fresnelMixed = mix(outgoingLightCopy, outgoingLight, 1. - fresnelFactor);\n            vec3 desaturatedCopy = desaturate(fresnelMixed);\n\n            gl_FragColor = vec4(mix(fresnelMixed,desaturatedCopy, 1. - saturateFactor), diffuseColor.a);\n          "),t.worldMaterial.userData.shader=n},this.cloudsMaterial=new ha({map:this.loader.load("/assets/images/earth/earth_clouds.webp"),transparent:!0}),this.world=new Ni(this.worldGeometry,this.worldMaterial),this.clouds=new Ni(this.cloudsGeometry,this.cloudsMaterial),this.worldGroup1.add(this.world),this.worldGroup2.add(this.worldGroup1),this.worldGroup2.add(this.clouds),this.worldGroup3.add(this.worldGroup2),this.worldGroup3.rotation.y=this.worldParams.rotation.y,this.worldGroup3.rotation.x=this.worldParams.rotation.x,this.scene.add(this.worldGroup3)}},{key:"onResize",value:function(){var t=this.el,e=t.clientWidth,n=t.clientHeight;this.w=e,this.h=n,this.resizeCamera(e,n,this.cameraDistance),this.renderer.setSize(e,n)}}])&&Sa(e.prototype,n),i&&Sa(e,i),c}(b.Z),Ca=n(2442),Da=n.n(Ca);function Oa(t){return(Oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Na(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function Ia(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){Na(o,i,r,a,s,"next",t)}function s(t){Na(o,i,r,a,s,"throw",t)}a(void 0)}))}}function Fa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function za(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ua(t,e,n){return(Ua="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ha(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}
2function ka(t,e){return(ka=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ba(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ha(t);if(e){var r=Ha(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ga(this,n)}}function Ga(t,e){return!e||"object"!==Oa(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ha(t){return(Ha=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Va=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ka(t,e)}(u,t);var e,n,i,o,l,c=Ba(u);function u(){return Fa(this,u),c.apply(this,arguments)}return e=u,(n=[{key:"init",value:(l=Ia(r().mark((function t(){var e=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ua(Ha(u.prototype),"init",this).call(this),this.updateCounter=this.updateCounter.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this.onResize=this.onResize.bind(this),this.onDrag=this.onDrag.bind(this),this.carousels=[],this.mediaQueryList=window.matchMedia("(min-width: 850px)"),this.items=this.getAll(".product-news-li"),this.total=this.get(".controls-total"),this.total.innerHTML=(0,At.vk)(this.items.length),this.list=this.get(".product-news-ul"),this.controls=this.get(".product-news-controls"),this.carousel=new(Da())(this.get(".product-news-ul"),{cellAlign:"left",freeScroll:!a.Z.isMobile,freeScrollFriction:.1,prevNextButtons:!1,pageDots:!1,contain:!0,on:{dragStart:function(){e.list.style.pointerEvents="none"},dragEnd:function(){e.list.style.pointerEvents="all"}}}),this.counter=this.get(".controls-counter"),this.nextButton=this.get(".controls-next"),this.prevButton=this.get(".controls-prev"),this.prevListener=null,this.nextListener=null,this.counterListener=null,t.next=22,(0,va.Z)(200);case 22:this.carousel.on("scroll",this.onDrag),this.onResize();case 24:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"onDrag",value:(o=Ia(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Q();case 2:return s.Z.images.force=!0,s.Z.images.onResize(),t.next=6,Q();case 6:s.Z.images.force=!1;case 7:case"end":return t.stop()}}),t)}))),function(){return o.apply(this,arguments)})},{key:"addEvents",value:function(){var t=this;Ua(Ha(u.prototype),"addEvents",this).call(this),this.resizeListener=function(){return t.onResize},window.addEventListener("resize",this.resizeListener()),this.nextListener=function(){return t.next()},this.prevListener=function(){return t.prev()},this.counterListener=function(e){t.updateCounter(e)},this.updateCounter(0),this.nextButton.addEventListener("click",this.nextListener),this.prevButton.addEventListener("click",this.prevListener),this.carousel.on("change",this.counterListener)}},{key:"onResize",value:function(){}},{key:"onSelectChange",value:function(t){this.update(t.target.value)}},{key:"removeEvents",value:function(){Ua(Ha(u.prototype),"removeEvents",this).call(this),window.removeEventListener("resize",this.resizeListener),this.mediaQueryList.removeEventListener("change",this.mediaListener),this.items.length>3&&(this.nextButton.removeEventListener("click",this.nextListener),this.prevButton.removeEventListener("click",this.prevListener),this.carousel.off("change",this.counterListener))}},{key:"next",value:function(){this.carousel.next()}},{key:"prev",value:function(){this.carousel.previous()}},{key:"updateCounter",value:function(t){this.counter.innerHTML=(0,At.vk)(t+1)}}])&&za(e.prototype,n),i&&za(e,i),u}(b.Z);function ja(t){return(ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xa(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Za(t,e,n){return(Za="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ja(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}
2function Ya(t,e){return(Ya=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Ja(t);if(e){var r=Ja(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ka(this,n)}}function Ka(t,e){return!e||"object"!==ja(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ja(t){return(Ja=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ya(t,e)}(o,t);var e,n,i,r=qa(o);function o(){return Wa(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"init",value:function(){Za(Ja(o.prototype),"init",this).call(this),this.envImg=this.get(".lazyload"),this.onLazyLoaded=this.onLazyLoaded.bind(this)}},{key:"addEvents",value:function(){Za(Ja(o.prototype),"addEvents",this).call(this),a.Z.doc.addEventListener("lazyloaded",this.onLazyLoaded)}},{key:"removeEvents",value:function(){Za(Ja(o.prototype),"removeEvents",this).call(this),a.Z.doc.removeEventListener("lazyloaded",this.onLazyLoaded)}},{key:"onLazyLoaded",value:function(t){t.target===this.envImg&&(0,D.I)(this.el,{className:"environment-image",delay:200,duration:1800})}}])&&Xa(e.prototype,n),i&&Xa(e,i),o}(b.Z),$a=n(8189);function ts(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var es=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.init(e)}var e,n,i;return e=t,(n=[{key:"init",value:function(t){this.designToggle=t.querySelector(".js-design-toggle"),this.toggle=this.toggle.bind(this),this.active=!1,this.opacity=0,this.addEvents()}},{key:"addEvents",value:function(){a.Z.win.addEventListener("keydown",this.toggle)}},{key:"removeEvents",value:function(){a.Z.win.removeEventListener("keydown",this.toggle)}},{key:"toggle",value:function(t){68===t.keyCode&&(this.active||(this.designToggle.style.display="block"),this.opacity<1?(this.opacity+=.25,this.designToggle.style.opacity=this.opacity,this.active=!0):(this.designToggle.style.display="none",this.designToggle.style.opacity=0,this.opacity=0,this.active=!1))}}])&&ts(e.prototype,n),i&&ts(e,i),t}();function ns(t){return(ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function is(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function rs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function os(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function as(t,e,n){return(as="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=us(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function ss(t,e){return(ss=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ls(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=us(t);if(e){var r=us(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return cs(this,n)}}function cs(t,e){return!e||"object"!==ns(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}
2function us(t){return(us=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var hs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ss(t,e)}(c,t);var e,i,o,a,s,l=ls(c);function c(){return rs(this,c),l.apply(this,arguments)}return e=c,(i=[{key:"init",value:(a=r().mark((function t(){var e=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:as(us(c.prototype),"init",this).call(this),this.animateIn=this.animateIn.bind(this),this.animateOut=this.animateOut.bind(this),this.sections=this.getAll(".section"),this.headerEl=this.get(".header"),this.sectionCtaEl=this.get(".section-cta"),this.headerAdjustTextEl=this.get(".header-adjust-text"),this.formEl=this.get(".form"),this.newsEl=this.get(".news"),this.formModalEls=this.getAll("[data-modal-trigger]"),this.productNewsEl=this.get(".product-news"),this.environmentImageEl=this.get(".environment-image"),this.aroundTheWorldEl=this.get(".around-the-globe-gl"),this.splitTexts=new C(this.el),this.headerEl&&(this.header=new H(this.headerEl)),this.sectionCtaEl&&(this.sectionCta=new K(this.sectionCtaEl)),this.headerAdjustTextEl&&(this.headerAdjustText=new lt(this.headerAdjustTextEl)),this.newsEl&&(this.news=new vt(this.newsEl)),this.formModalEls.length&&(this.formModals=[],this.formModalEls.forEach((function(t){e.formModals.push(new Lt(t))}))),this.productNewsEl&&(this.productNews=new Va(this.productNewsEl)),this.formEl&&n.e(680).then(n.bind(n,6688)).then((function(t){e.form=new t.default(e.formEl)})),this.environmentImageEl&&(this.environmentImage=new Qa(this.environmentImageEl)),this.aroundTheWorldEl&&(this.aroundTheWorld=new Ra(this.aroundTheWorldEl)),this.checkPageComponents(),this.designToggle=new es(this.el);case 25:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,i){var r=a.apply(t,e);function o(t){is(r,n,i,o,s,"next",t)}function s(t){is(r,n,i,o,s,"throw",t)}o(void 0)}))},function(){return s.apply(this,arguments)})},{key:"addEvents",value:function(){var t=this;as(us(c.prototype),"addEvents",this).call(this),_.z.on("ANIMATE_IN",(function(){return t.animateIn()}))}},{key:"removeEvents",value:function(){as(us(c.prototype),"removeEvents",this).call(this),this.designToggle.removeEvents(),this.headerEl&&this.header.destroy(),this.sectionCtaEl&&this.sectionCta.destroy(),this.formEl&&this.form.destroy(),this.newsEl&&this.news.destroy(),this.productNewsEl&&this.productNews.destroy(),this.formModalEls.length&&this.formModals.forEach((function(t){t.destroy()}))}},{key:"checkPageComponents",value:function(){var t=this;switch(this.type){case"products":case"product-service":n.e(893).then(n.bind(n,7426)).then((function(e){new e.default(t.el)}));break;case"about":n.e(443).then(n.bind(n,5463)).then((function(e){new e.default(t.el)}))}}},{key:"animateIn",value:function(){this.headerEl&&this.header.animateIn(),this.sectionCtaEl&&this.sectionCta.observe(),new x.Z({el:this.sections,duration:500,delay:1e3,stagger:40,ease:"linear",keyframes:[{opacity:0},{opacity:1}]})}},{key:"animateOut",value:function(){this.headerEl&&this.header.animateOut(),this.sectionCtaEl&&this.sectionCta.unobserve(),new x.Z({el:this.el,duration:200,ease:"linear",keyframes:[{opacity:1},{opacity:0}]})}}])&&os(e.prototype,i),o&&os(e,o),c}(y),ds=n(3435),fs=n(5853),ps=n(6837),ms=n(216),gs=n(4453),vs=n(5380);function ys(t){return(ys="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xs(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function bs(t,e,n){return(bs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Es(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}
2function ws(t,e){return(ws=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ms(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=Es(t);if(e){var r=Es(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ss(this,n)}}function Ss(t,e){return!e||"object"!==ys(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Es(t){return(Es=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}$a.Y;function Ts(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function Ls(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}n(7090);new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.views={},this.promises={},this.init()}var e,n,i,l,c;return e=t,(n=[{key:"init",value:(l=r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return history.scrollRestoration="manual",t.next=3,(0,o.AE)();case 3:return t.next=5,document.fonts.ready;case 5:return s.Z.app=this,s.Z.scroll=new fs.default("[data-scroll]",(0,o.YM)("scroll")),s.Z.nav=new ps.default(".nav",(0,o.YM)("nav")),s.Z.logo=new ms.default(".header-logo",(0,o.YM)("logo")),s.Z.router=ds.default,s.Z.layout=new vs.default,window.Store=a.Z,window.Modules=s.Z,window.App=this,a.Z.env,this.build(),t.next=18,(0,va.Z)(100);case 18:return a.Z.webgl&&(s.Z.images=new gs.default("#gl-images",(0,o.YM)("images"))),t.next=21,(0,va.Z)(500);case 21:a.Z.loaded=!0,_.z.emit("LOAD_DONE"),_.z.emit("ANIMATE_IN");case 24:case"end":return t.stop()}}),t,this)})),c=function(){var t=this,e=arguments;return new Promise((function(n,i){var r=l.apply(t,e);function o(t){Ts(r,n,i,o,a,"next",t)}function a(t){Ts(r,n,i,o,a,"throw",t)}o(void 0)}))},function(){return c.apply(this,arguments)})},{key:"build",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===t&&(t=document.querySelector("[data-router-view]")),this.getView(t,t.dataset.routerView)}},{key:"getView",value:function(t,e){var n=(0,o.YM)(e);a.Z.view.current=new hs(t,n,e)}},{key:"clear",value:function(){this.promises={}}},{key:"serviceWorker",value:function(){"serviceWorker"in navigator&&window.addEventListener("load",(function(){navigator.serviceWorker.register("/sw.js").then((function(t){t.update()})).catch((function(t){}))}))}},{key:"helpers",value:function(){}}])&&Ls(e.prototype,n),i&&Ls(e,i),t}())},4453:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>rt});var i=n(7757),r=n.n(i),o=n(8189),a=n(8960),s=n(7071);function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var u=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.vertex,r=void 0===i?"\n      attribute vec2 position;\n      attribute vec2 uv;\n\n      uniform mat4 projection;\n      uniform vec2 size;\n      uniform float time;\n\n      void main() {\n        vec4 p = vec4(position, 0.0, 1.0);\n        gl_Position = projection * p;\n      }\n    ":i,o=n.fragment,a=void 0===o?"\n      precision highp float;\n\n      void main() {\n        gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n      }\n    ":o,s=n.uniforms,c=void 0===s?{}:s;l(this,t),this.uniforms=c,this.instance=e,this.gl=this.instance.gl,this.program=this.createProgram(this.gl,r,a),this.parse()}var e,n,i;return e=t,(n=[{key:"setUniforms",value:function(t){for(var e in this.texUnit=-1,t)this.setUniform(e,t[e])}},{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.gl;this.uniformsList=new Map,this.attributesList=new Map,this.uniformsLoc=new Map,this.attributeLoc=new Map;for(var e=0;e<t.getProgramParameter(this.program,t.ACTIVE_UNIFORMS);e++){var n=t.getActiveUniform(this.program,e);this.uniformsList.set(n.name,n),this.uniformsLoc.set(n.name,t.getUniformLocation(this.program,n.name))}for(var i=0;i<t.getProgramParameter(this.program,t.ACTIVE_ATTRIBUTES);i++){var r=t.getActiveAttrib(this.program,i);this.attributesList.set(r.name,r),this.attributeLoc.set(r.name,t.getAttribLocation(this.program,r.name))}}},{key:"setUniform",value:function(t,e){var n=this.uniformsList.get(t);if(n){var i=this.gl,r=n.type,o=this.uniformsLoc.get(t);
2if(35678!==r)switch(r){case 5126:return e.length?i.uniform1fv(o,e):i.uniform1f(o,e);case 35664:return i.uniform2fv(o,e);case 35665:return i.uniform3fv(o,e);case 35666:return i.uniform4fv(o,e);case 35670:case 5124:case 35678:case 35680:return e.length?i.uniform1iv(o,e):i.uniform1i(o,e);case 35671:case 35667:return i.uniform2iv(o,e);case 35672:case 35668:return i.uniform3iv(o,e);case 35673:case 35669:return i.uniform4iv(o,e);case 35674:return i.uniformMatrix2fv(o,!1,e);case 35675:return i.uniformMatrix3fv(o,!1,e);case 35676:return i.uniformMatrix4fv(o,!1,e)}}}},{key:"createShader",value:function(t,e,n){var i=t.createShader(e);if(t.shaderSource(i,n),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS))return i;t.deleteShader(i)}},{key:"createProgram",value:function(t,e,n){var i=this.createShader(t,t.VERTEX_SHADER,e),r=this.createShader(t,t.FRAGMENT_SHADER,n),o=t.createProgram();if(t.attachShader(o,i),t.attachShader(o,r),t.linkProgram(o),t.deleteShader(i),t.deleteShader(r),t.getProgramParameter(o,t.LINK_STATUS))return o;t.deleteProgram(o)}}])&&c(e.prototype,n),i&&c(e,i),t}();function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function p(t,e){return!e||"object"!==h(e)&&"function"!=typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(t){var e="function"==typeof Map?new Map:void 0;return(g=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return v(t,arguments,x(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_(i,t)})(t)}function v(t,e,n){return(v=y()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&_(r,n.prototype),r}).apply(null,arguments)}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function _(t,e){return(_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],_=n[0],x=n[1],b=n[2],w=n[3];return t[0]=_*i+x*s+b*h+w*m,t[1]=_*r+x*l+b*d+w*g,t[2]=_*o+x*c+b*f+w*v,t[3]=_*a+x*u+b*p+w*y,_=n[4],x=n[5],b=n[6],w=n[7],t[4]=_*i+x*s+b*h+w*m,t[5]=_*r+x*l+b*d+w*g,t[6]=_*o+x*c+b*f+w*v,t[7]=_*a+x*u+b*p+w*y,_=n[8],x=n[9],b=n[10],w=n[11],t[8]=_*i+x*s+b*h+w*m,t[9]=_*r+x*l+b*d+w*g,t[10]=_*o+x*c+b*f+w*v,t[11]=_*a+x*u+b*p+w*y,_=n[12],x=n[13],b=n[14],w=n[15],t[12]=_*i+x*s+b*h+w*m,t[13]=_*r+x*l+b*d+w*g,t[14]=_*o+x*c+b*f+w*v,t[15]=_*a+x*u+b*p+w*y,t}function w(t,e,n){var i,r,o,a,s,l,c,u,h,d,f,p,m=n[0],g=n[1],v=n[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=i*m+s*g+h*v+e[12],t[13]=r*m+l*g+d*v+e[13],t[14]=o*m+c*g+f*v+e[14],t[15]=a*m+u*g+p*v+e[15]),t}function M(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function S(t,e,n,i,r){var o=1/Math.tan(e/2),a=1/(i-r);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+i)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*i*a,t[15]=0,t}var E=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=y(),function(){var t,i=x(e);if(n){var r=x(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return p(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,g=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,v=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,y=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,_=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,x=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,b=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return d(this,s),p(t=a.call(this,e,n,i,r,o,l,c,u,h,f,g,v,y,_,x,b),m(t))}return i=s,(r=[{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;return w(this,e,t),this}},{key:"rotate",value:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return rotate(this,n,t,e),this}))},{key:"scale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;return M(this,e,"number"==typeof t?[t,t,t]:t),this}},{key:"multiply",value:function(t,e){return e?b(this,t,e):b(this,this,t),this}},{key:"fromPerspective",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fov,n=t.aspect,i=t.near,r=t.far;return S(this,e,n,i,r),this}}])&&f(i.prototype,r),o&&f(i,o),s}(g(Array)),T=n(2790),L=n.n(T);function A(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function P(t){return function(){var e=this,n=arguments;
2return new Promise((function(i,r){var o=t.apply(e,n);function a(t){A(o,i,r,a,s,"next",t)}function s(t){A(o,i,r,a,s,"throw",t)}a(void 0)}))}}function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var D=function(){function t(e,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.material,a=r.imgParallax,s=r.imgParallaxTop,l=r.forceResize,c=r.hover,u=r.wireframe,h=void 0!==u&&u,d=r.uniforms,f=void 0===d?{}:d,p=r.position,m=void 0===p?[0,0]:p,g=r.scale,v=void 0===g?[1,1]:g,y=r.order,_=void 0===y?10:y,x=r.loaded,b=void 0===x||x;R(this,t),o&&(this.instance=e,this.plane=this.instance.plane,this.dom=n,this.material=o,this.wireframe=h,this.middle=0,this.middleLerp=0,this.uniforms=f,this.position=m,this.scale=v,this.order=_,this.loaded=b,this.forceResize=l,this.hover=c,this.fixed=!1,this.imgParallax=a||0,this.imgParallaxTop=s||!1,this.resize=this.resize.bind(this),this.vao=this.instance.vao.createVertexArrayOES(),this.setupVao(),this.dom.classList.add("image-gl"),this.active=!0,this.resize(),this.mouseActive=!0,this.hovering=!1,this.hover&&(this.dom.addEventListener("mouseenter",(function(t){i.onMouseEnter(t)})),this.dom.addEventListener("mouseleave",(function(t){i.onMouseLeave(t)}))))}var e,n,i,o,s;return e=t,(n=[{key:"onMouseEnter",value:(s=P(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.mouseActive){t.next=2;break}return t.abrupt("return");case 2:return this.mouseLeaveTl&&this.mouseLeaveTl.pause(),this.hovering=!0,t.next=6,L()();case 6:this.mouseEnterTl=new a.Z({el:this.uniforms,duration:1800,ease:"expoOut",keyframes:[{scale:this.uniforms.scale},{scale:1.05}],raf:!0});case 7:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"onMouseLeave",value:(o=P(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.mouseActive){t.next=2;break}return t.abrupt("return");case 2:return this.mouseEnterTl&&this.mouseEnterTl.pause(),this.hovering=!1,t.next=6,L()();case 6:this.mouseLeaveTl=new a.Z({el:this.uniforms,duration:1e3,ease:"expoOut",keyframes:[{scale:this.uniforms.scale},{scale:1}],raf:!0});case 7:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"destroy",value:function(){this.active=!1}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.dom?(this.bounding=this.dom.getBoundingClientRect(),this.bounds={top:this.bounding.top+this.instance.y,left:this.bounding.left,width:this.bounding.width,height:this.bounding.height},this.fixed&&(this.bounds.top=this.bounding.top),t&&(this.bounds.top=this.bounding.top+this.instance.y),this.uniforms.size=[this.bounds.width,this.bounds.height],this.updateProjection()):this.destroy()}},{key:"updateProjection",value:function(){this.projection=new E;var t=this.instance.aspect,e=Math.PI/180*45,n=this.order,i=2*Math.tan(e/2)*n,r=i*t,o=this.bounds.width/this.instance.width*r,a=this.bounds.height/this.instance.height*i;this.projection.fromPerspective({fov:e,aspect:t,near:.01,far:1e3}),this.projection.translate([0,0,-n,0]),this.projection.translate([-r/2+o/2,i/2-a/2,0,0]);var s=this.instance.x-this.position[0],l=this.instance.y-this.position[1];this.projection.translate([(this.bounds.left-s)/this.instance.width*r,-(this.bounds.top-l)/this.instance.height*i,0,0]),this.projection.scale([o*this.scale[0],a*this.scale[1],1,1])}},{key:"setupVao",value:function(){var t=this.instance.gl;this.instance.vao.bindVertexArrayOES(this.vao);var e=this.material.attributeLoc.get("position");void 0!==e&&(t.enableVertexAttribArray(e),t.bindBuffer(t.ARRAY_BUFFER,this.plane.position),t.vertexAttribPointer(e,2,t.FLOAT,!1,0,0));var n=this.material.attributeLoc.get("uv");void 0!==n&&(t.enableVertexAttribArray(n),t.bindBuffer(t.ARRAY_BUFFER,this.plane.uv),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0)),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.plane.index),this.instance.vao.bindVertexArrayOES(null)}},{key:"draw",value:function(){var t=this.instance.gl;this.updateProjection(),t.uniformMatrix4fv(this.material.uniformsLoc.get("projection"),!1,this.projection),t.drawElements(this.wireframe?t.LINES:t.TRIANGLES,this.plane.n,t.UNSIGNED_SHORT,0)}}])&&C(e.prototype,n),i&&C(e,i),t}();function O(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var N=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.gl,i=this.build(e.density),r=i.position,o=i.index,a=i.uv;this.index=n.createBuffer(),this.position=n.createBuffer(),this.uv=n.createBuffer(),this.n=o.length,n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.index),n.bufferData(n.ELEMENT_ARRAY_BUFFER,o,n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,this.position),n.bufferData(n.ARRAY_BUFFER,r,n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,this.uv),n.bufferData(n.ARRAY_BUFFER,a,n.STATIC_DRAW)}var e,n,i;return e=t,(n=[{key:"build",value:function(t){for(var e=0,n=0,i=t,r=t,o=(i+1)*(r+1),a=i*r*6,s=new Float32Array(2*o),l=new Float32Array(2*o),c=o>65536?new Uint32Array(a):new Uint16Array(a),u=e,h=1/i,d=1/r,f=0;f<=r;f++)for(var p=f*d-.5,m=0;m<=i;m++,e++){var g=m*h-.5;if(s[2*e+0]=1*g,s[2*e+1]=-1*p,l[2*e]=m/i,l[2*e+1]=1-f/r,f!==r&&m!==i){var v=u+m+f*(i+1),y=u+m+(f+1)*(i+1),_=u+m+(f+1)*(i+1)+1,x=u+m+f*(i+1)+1;c[6*n]=v,c[6*n+1]=y,c[6*n+2]=x,c[6*n+3]=y,c[6*n+4]=_,c[6*n+5]=x,n++}}return{position:s,uv:l,index:c}}}
2])&&O(e.prototype,n),i&&O(e,i),t}();function I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var z=function(){var t=void 0,e=void 0,n=new Promise((function(n,i){t=n,e=i}));return n.resolve=t,n.reject=e,n},U=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.anisotropy,o=void 0!==r&&r;I(this,t),this.instance=e,this.gl=this.instance.gl,this.url=n,this.anisotropy=o,this.loading=z(),this.onLoad=this.onLoad.bind(this);var a=this.gl;this.texture=a.createTexture(),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,this.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,new Uint8Array(4)),this.load()}var e,n,i;return e=t,(n=[{key:"load",value:function(){this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=this.onLoad.bind(this),this.image.onerror=this.onError.bind(this),this.image.src=this.url}},{key:"onError",value:function(){}},{key:"onLoad",value:function(){var t=this.gl;if(t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),this.anisotropy&&this.instance.anisotropy){var e=this.instance.anisotropy,n=t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT);t.texParameterf(t.TEXTURE_2D,e.TEXTURE_MAX_ANISOTROPY_EXT,n)}t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.image),this.loading.resolve(this)}}])&&F(e.prototype,n),i&&F(e,i),t}();function k(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var G=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.canvas,i=void 0===n?document.createElement("canvas"):n,r=e.dpr,o=void 0===r?Math.min(devicePixelRatio,2):r,a=e.density,s=void 0===a?1:a,l=e.autoScroll,c=void 0!==l&&l,u=e.post,h=void 0!==u&&u,d=e.attribs,f=void 0===d?{antialias:!1,premultipliedAlpha:!1}:d,p=e.autoTick,m=void 0!==p&&p;k(this,t),this.dpr=o,this.canvas=i,this.density=s,this.autoScroll=c,this.carpets=[],this.lastProgramUsed=null,this.post=h,this.autoTick=m,this.x=0,this.y=0,this.post&&(f.antialias=!1);try{this.gl=i.getContext("webgl",f)||i.getContext("experimental-webgl",f),this.vao=this.gl.getExtension("OES_vertex_array_object")}catch(t){return}this.anisotropy=this.gl.getExtension("EXT_texture_filter_anisotropic")||this.gl.getExtension("MOZ_EXT_texture_filter_anisotropic")||this.gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.gl.enable(this.gl.DEPTH_TEST),this.gl.clearColor(0,0,0,0),this.plane=new N(this),this.init()}var e,n,i;return e=t,(n=[{key:"init",value:function(){this.resize=this.resize.bind(this),this.draw=this.draw.bind(this),window.addEventListener("resize",this.resize),this.autoScroll&&(this.scroll=this.scroll.bind(this),window.addEventListener("scroll",this.scroll),this.scroll()),this.resize(),this.post&&this.setupPost(),this.autoTick&&this.draw()}},{key:"destroy",value:function(){window.removeEventListener("resize",this.resize),this.requestID&&cancelAnimationFrame(this.requestID)}},{key:"scroll",value:function(){var t=document.documentElement;this.x=(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0),this.y=window.pageYOffset||document.documentElement.scrollTop}},{key:"resize",value:function(){this.width=window.innerWidth,this.height=window.innerHeight,this.aspect=this.width/this.height;var t=this.gl;t.canvas.width=this.width*this.dpr,t.canvas.height=this.height*this.dpr,Object.assign(this.gl.canvas.style,{width:"".concat(this.width,"px"),height:"".concat(this.height,"px")}),t.viewport(0,0,t.canvas.width,t.canvas.height),this.post&&this.postTexture&&(t.bindTexture(t.TEXTURE_2D,this.postTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.canvas.width,t.canvas.height,0,t.RGBA,t.UNSIGNED_BYTE,null)),this.reset=!0}},{key:"material",value:function(t){return new u(this,t)}},{key:"carpet",value:function(t,e){var n=new D(this,t,e);return this.carpets.push(n),this.reset=!0,n}},{key:"texture",value:function(t,e){return new U(this,t,e)}},{key:"setupPost",value:function(){var t=this.gl;this.postTexture=t.createTexture(),this.postFb=t.createFramebuffer(),t.bindTexture(t.TEXTURE_2D,this.postTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.canvas.width,t.canvas.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.bindFramebuffer(t.FRAMEBUFFER,this.postFb),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.postTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null),this.postMaterial=this.material({vertex:"\n        attribute vec2 position;\n\n        void main() {\n          gl_Position = vec4(position, 0.0, 1.0);\n        }\n      ",fragment:this.post.fragment||"\n        precision highp float;\n\n        uniform vec2 viewport;\n        uniform sampler2D image;\n\n        void main() {\n          vec2 uv = gl_FragCoord.xy / viewport;\n          vec4 color = texture2D(image, uv);\n          gl_FragColor = color;\n        }\n      ",uniforms:this.post.uniforms||{}}),this.postTriangle=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.postTriangle),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),t.STATIC_DRAW),this.postVao=this.vao.createVertexArrayOES(),this.vao.bindVertexArrayOES(this.postVao);var e=this.postMaterial.attributeLoc.get("position");t.enableVertexAttribArray(e),t.bindBuffer(t.ARRAY_BUFFER,this.postTriangle),t.vertexAttribPointer(e,2,t.FLOAT,!1,0,0),this.vao.bindVertexArrayOES(null)}},{key:"setTextures",value:function(t,e){var n=this.gl,i=0;t.uniformsList.forEach((function(r){if(35678===r.type){var o=e[r.name];if(!o)return;n.activeTexture(n.TEXTURE0+i),n.bindTexture(n.TEXTURE_2D,o.texture),n.uniform1i(t.uniformsLoc.get(r.name),i);
2var a=r.name,s="size"+a.charAt(0).toUpperCase()+a.substring(1);t.setUniform(s,[o.image.width,o.image.height]),i++}}))}},{key:"draw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:performance.now();this.autoTick&&(this.requestID=requestAnimationFrame(this.draw));var n=this.gl,i=void 0,r=n.canvas.width,o=n.canvas.height;if(this.post&&n.bindFramebuffer(n.FRAMEBUFFER,this.postFb),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),this.carpets.forEach((function(a){a.active&&((a.material.program!==t.lastProgramUsed||t.reset)&&(n.useProgram(a.material.program),t.vao.bindVertexArrayOES(a.vao),t.setTextures(a.material,a.material.uniforms),t.reset=!1),a.material.program!==i&&(a.material.uniforms.time=e,a.material.uniforms.viewport=[r,o],a.material.setUniforms(a.material.uniforms)),t.setTextures(a.material,a.uniforms),a.material.setUniforms(a.uniforms),a.draw(),i=a.material.program,t.lastProgramUsed=a.material.program)})),this.post){var a=this.postMaterial;n.bindFramebuffer(n.FRAMEBUFFER,null),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.useProgram(a.program),a.uniforms.time=e,a.uniforms.viewport=[r,o],a.setUniforms(a.uniforms),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this.postTexture),n.uniform1i(a.uniformsLoc.get("image"),0),this.vao.bindVertexArrayOES(this.postVao),n.drawArrays(n.TRIANGLES,0,3),this.reset=!0}}}])&&B(e.prototype,n),i&&B(e,i),t}(),H=n(6627),V=n(7438),j=n(2645),W=n.n(j),X=n(5402),Z=n(8643);function Y(t){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function q(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function K(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){q(o,i,r,a,s,"next",t)}function s(t){q(o,i,r,a,s,"throw",t)}a(void 0)}))}}function J(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $(t,e,n){return($="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=it(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function tt(t,e){return(tt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function et(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=it(t);if(e){var r=it(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return nt(this,n)}}function nt(t,e){return!e||"object"!==Y(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function it(t){return(it=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var rt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&tt(t,e)}(h,t);var e,n,i,o,l,c,u=et(h);function h(){return J(this,h),u.apply(this,arguments)}return e=h,(n=[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;$(it(h.prototype),"init",this).call(this),this.update=this.update.bind(this),this.inView=this.inView.bind(this),this.onResize=this.onResize.bind(this),this.in=this.in.bind(this),this.out=this.out.bind(this),this.aladino=new G({canvas:this.el,density:20,autoScroll:!s.Z.smooth,autoTick:!s.Z.smooth}),this.imagesIntances=[],this.images=document.querySelectorAll(".header-image"),this.imagesLoaded=[],this.observer=new IntersectionObserver(this.inView,{threshold:0,rootMargin:"0% 0% 0% 0%"}),this.bendNormal=.5,this.material=this.aladino.material({vertex:W()(Z.default),fragment:W()(X.default),uniforms:{speed:0,bend:this.bendNormal,opacity:0,imgOpacity:0,scale:1}}),this.in(t),this.oldPos=this.aladino.y,this.speed=0,this.force=!1,this.aladino.y=s.Z.scroll.offsetTop=0,s.Z.raf.add(this.update,this.id),this.ready=!0}},{key:"addImage",value:function(t){var e=t.classList.contains("placeholder"),n=this.aladino.carpet(t,{material:this.material,imgParallax:parseFloat(t.dataset.imgParallax)||0,imgParallaxTop:void 0!==t.dataset.imgParallaxTop,forceResize:void 0!==t.dataset.imgResize,hover:void 0!==t.dataset.imgHover,uniforms:{placeholder:e,opacity:0,imgOpacity:0,placeholderColor:[.93,.93,.93],bend:this.bendNormal,offset:0,scale:1,image:null!=e?this.aladino.texture(t.dataset.imgWebp):null}});setTimeout((function(){n.fixed=!0}),100),this.imagesIntances.push(n),this.imagesLoaded.push(n.uniforms.image.loading),this.animateIn(n.uniforms,t.dataset)}},{key:"animateOut",value:(c=K(r().mark((function t(e){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.animating=!0,new a.Z({el:e.uniforms,duration:200,ease:"linear",keyframes:[{opacity:1},{opacity:0}
2],raf:!0}),t.next=4,(0,V.Z)(200);case 4:e.destroy();case 5:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"animateIn",value:(l=K(r().mark((function t(e,n){var i,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n.bendIn,o=n.animateIn,new a.Z({el:e,duration:500,ease:"expoOut",keyframes:[{opacity:0},{opacity:1}],raf:!0}),new a.Z({el:e,duration:o||2e3,ease:"expoOut",keyframes:[{bend:i||this.bendNormal},{bend:0}],raf:!0}),t.next=5,e.image.loading;case 5:return new a.Z({el:e,duration:1e3,ease:"linear",keyframes:[{imgOpacity:0},{imgOpacity:1}],raf:!0}),t.next=8,(0,V.Z)(1e3);case 8:e.placeholderColor=[1,1,1];case 9:case"end":return t.stop()}}),t,this)}))),function(t,e){return l.apply(this,arguments)})},{key:"observe",value:(o=K(r().mark((function t(){var e=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,V.Z)(200);case 2:return this.images.forEach((function(t,n){e.observer.observe(t)})),t.next=5,(0,V.Z)(100);case 5:this.onResize();case 6:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"unobserve",value:function(){var t=this;this.images.forEach((function(e,n){t.observer.unobserve(e)}))}},{key:"inView",value:function(t){var e=this;t.forEach((function(t){var n=t.isIntersecting,i=t.target;if(n){if(i){if(e.imagesIntances.forEach((function(t){t.dom===i&&(t.active=!0)})),i.viewed)return;e.addImage(i),i.viewed=!0}}else e.imagesIntances.forEach((function(t){t.dom===i&&(t.active=!1)}))}))}},{key:"in",value:function(t){this.images=t.querySelectorAll(".image-gl"),s.Z.win.addEventListener("resize",this.onResize),this.observe()}},{key:"out",value:function(){var t=this;this.unobserve(),this.imagesIntances.forEach((function(e){t.animateOut(e)})),s.Z.win.removeEventListener("resize",this.onResize),this.aladino.carpets=[],this.images=[]}},{key:"onResize",value:function(){var t=this;clearTimeout(this.resizeTimeOut),this.resizing=!0,this.aladino.carpets.forEach((function(e,n){t.force?e.forceResize&&e.resize():e.resize()})),this.resizeTimeOut=setTimeout((function(){t.resizing=!1}),300)}},{key:"update",value:function(){s.Z.smooth&&(s.Z.scroll.ticking||s.Z.animating||this.animating||this.resizing)&&(this.aladino.y=s.Z.scroll.offsetTop,this.applyPlanesParallax(),this.speed=.1*(this.aladino.y-this.oldPos),this.material.uniforms.speed=(0,H.t7)(this.material.uniforms.speed,.05*(0,H.uZ)(this.speed,-10,10),.06),this.oldPos=this.aladino.y,this.aladino.draw())}},{key:"applyPlanesParallax",value:function(){for(var t=0;t<this.aladino.carpets.length;t++){var e=this.aladino.carpets[t];if(0!==e.imgParallax){var n=e.dom.getBoundingClientRect(),i=n.top,r=(n.bottom-i)/2+i,o=s.Z.layout.h/2-r,a=(e.imgParallaxTop?s.Z.scroll.offsetTop*-e.imgParallax:o*-e.imgParallax)/s.Z.layout.h;e.uniforms.offset=Math.round(1e4*a)/1e4}(e.dom.glParallax||!this.ready||e.forceResize)&&e.resize(!0)}}}])&&Q(e.prototype,n),i&&Q(e,i),h}(o.Y)},5380:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var i=n(7071);function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onResize=this.onResize.bind(this),i.Z.layout={w:0,h:0,aspect:1},i.Z.isMobile&&i.Z.html.classList.add("is-mobile"),i.Z.win.addEventListener("resize",this.onResize),i.Z.win.addEventListener("scroll",(function(){clearTimeout(e.timeOut),e.scroll=!0,e.timeOut=setTimeout((function(){e.scroll=!1}),100)})),this.onResize(),i.Z.win.addEventListener("mousemove",(function(t){e.onMouseMove(t)}))}var e,n,o;return e=t,(n=[{key:"onResize",value:function(){var t=i.Z.win,e=t.innerWidth,n=t.innerHeight;i.Z.layout.w=e,i.Z.layout.h=n,i.Z.layout.aspect=e/n,this.calculateLayout()}},{key:"calculateLayout",value:function(){var t=.01*window.innerHeight;i.Z.html.style.setProperty("--vh","".concat(t,"px"))}},{key:"onMouseMove",value:function(t){i.Z.mouse.x=t.clientX,i.Z.mouse.y=t.clientY}}])&&r(e.prototype,n),o&&r(e,o),t}()},216:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>p});var i=n(8189),r=n(788),o=n(5507);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function c(t,e,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=f(t);if(e){var r=f(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return d(this,n)}}function d(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var p=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(d,t);var e,n,i,a=h(d);function d(){return s(this,d),a.apply(this,arguments)}return e=d,(n=[{key:"init",value:function(){c(f(d.prototype),"init",this).call(this)}},{key:"addEvents",value:function(){var t=this;c(f(d.prototype),"addEvents",this).call(this),r.z.on("LOAD_DONE",(function(){return t.animateIn()}))}},{key:"animateIn",value:function(){this.el&&(0,o.I)(this.el,{className:"header-logo",duration:1800})}}])&&l(e.prototype,n),i&&l(e,i),d}(i.Y)},6837:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var i=n(8189),r=n(788),o=n(5507),a=n(8960);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}
2function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=p(t);if(e){var r=p(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f(this,n)}}function f(t,e){return!e||"object"!==s(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(f,t);var e,n,i,s=d(f);function f(){return l(this,f),s.apply(this,arguments)}return e=f,(n=[{key:"init",value:function(){u(p(f.prototype),"init",this).call(this),this.isOpen=!1,this.numbers=this.el.querySelectorAll(".nav-number-inner"),this.titles=this.el.querySelectorAll(".nav-title-inner"),this.links=this.el.querySelectorAll(".nav-a"),this.button=this.get(".nav-button"),this.active=this.el.querySelector(".nav-a.is-active"),this.setActive=this.setActive.bind(this),this.reset=this.reset.bind(this),this.onButtonClick=this.onButtonClick.bind(this)}},{key:"addEvents",value:function(){var t=this;u(p(f.prototype),"addEvents",this).call(this),this.links.forEach((function(e){e.addEventListener("click",(function(e){return t.onClick(e)}))})),this.button.addEventListener("click",this.onButtonClick),r.z.on("LOAD_DONE",(function(){return t.animateIn()}))}},{key:"onButtonClick",value:function(){this.isOpen||(this.el.classList.add("is-open"),this.isOpen=!0)}},{key:"onClick",value:function(t){var e=t.target;Store.view.current.type!==e.dataset.slug&&this.setActive(e.dataset.slug)}},{key:"close",value:function(){this.isOpen&&(this.el.classList.remove("is-open"),this.isOpen=!1)}},{key:"reset",value:function(){this.links.forEach((function(t){t.classList.remove("is-active")}))}},{key:"setActive",value:function(t){this.reset(),this.activeEl=this.el.querySelector('[data-slug="'.concat(t,'"]')),this.activeEl&&this.activeEl.classList.add("is-active")}},{key:"animateIn",value:function(){new a.Z({el:this.numbers,duration:1800,delay:200,stagger:80,ease:"expoOut",keyframes:[{transform:"translate3d(0,150%,0)"},{transform:"translate3d(0,0,0)"}]}),new a.Z({el:this.titles,duration:1800,delay:280,stagger:80,ease:"expoOut",keyframes:[{transform:"translate3d(0,150%,0)"},{transform:"translate3d(0,0,0)"}]}),(0,o.I)(this.el,{className:"nav",duration:1800})}}])&&c(e.prototype,n),i&&c(e,i),f}(i.Y)},3435:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>b});var i=n(4279),r=n.n(i);class o{constructor(t){this.wrap=document.querySelector("[data-router-wrapper]"),this.properties=t,this.Transition=t.transition?new t.transition.class(this.wrap,t.transition.name):null}setup(){this.onEnter&&this.onEnter(),this.onEnterCompleted&&this.onEnterCompleted()}add(){this.wrap.insertAdjacentHTML("beforeend",this.properties.view.outerHTML)}update(){document.title=this.properties.page.title}show(t){return new Promise((async e=>{this.update(),this.onEnter&&this.onEnter(),this.Transition&&await this.Transition.show(t),this.onEnterCompleted&&this.onEnterCompleted(),e()}))}hide(t){return new Promise((async e=>{this.onLeave&&this.onLeave(),this.Transition&&await this.Transition.hide(t),this.onLeaveCompleted&&this.onLeaveCompleted(),e()}))}}const a=new window.DOMParser;class s{constructor(t,e){this.renderers=t,this.transitions=e}getOrigin(t){const e=t.match(/(https?:\/\/[\w\-.]+)/);return e?e[1].replace(/https?:\/\//,""):null}getPathname(t){const e=t.match(/https?:\/\/.*?(\/[\w_\-./]+)/);return e?e[1]:"/"}getAnchor(t){const e=t.match(/(#.*)$/);return e?e[1]:null}getParams(t){const e=t.match(/\?([\w_\-.=&]+)/);if(!e)return null;const n=e[1].split("&"),i={};for(let t=0;t<n.length;t++){const e=n[t].split("="),{0:r}=e,{1:o}=e;i[r]=o}return i}getDOM(t){return"string"==typeof t?a.parseFromString(t,"text/html"):t}getView(t){return t.querySelector("[data-router-view]")}getSlug(t){return t.getAttribute("data-router-view")}getRenderer(t){if(!this.renderers)return Promise.resolve(o);if(t in this.renderers){const e=this.renderers[t];return"function"!=typeof e||o.isPrototypeOf(e)?"function"==typeof e.then?Promise.resolve(e).then((({default:t})=>t)):Promise.resolve(e):Promise.resolve(e()).then((({default:t})=>t))}return Promise.resolve(o)}getTransition(t){return this.transitions?t in this.transitions?{class:this.transitions[t],name:t}:"default"in this.transitions?{class:this.transitions.default,name:"default"}:null:null}getProperties(t){const e=this.getDOM(t),n=this.getView(e),i=this.getSlug(n);return{page:e,view:n,slug:i,renderer:this.getRenderer(i,this.renderers),transition:this.getTransition(i,this.transitions)}}getLocation(t){return{href:t,anchor:this.getAnchor(t),origin:this.getOrigin(t),params:this.getParams(t),pathname:this.getPathname(t)}}}class l extends(r()){constructor({renderers:t,transitions:e}={}){super(),this.Helpers=new s(t,e),this.Transitions=e,this.Contextual=!1,this.location=this.Helpers.getLocation(window.location.href),this.properties=this.Helpers.getProperties(document.cloneNode(!0)),this.popping=!1,this.running=!1,this.trigger=null,this.cache=new Map,this.cache.set(this.location.href,this.properties),this.properties.renderer.then((t=>{this.From=new t(this.properties),this.From.setup()})),this._navigate=this.navigate.bind(this),window.addEventListener("popstate",this.popState.bind(this)),this.links=document.querySelectorAll("a:not([target]):not([data-router-disabled])"),this.attach(this.links)}attach(t){for(const e of t)e.addEventListener("click",this._navigate)}detach(t){for(const e of t)e.removeEventListener("click",this._navigate)}navigate(t){if(!t.metaKey&&!t.ctrlKey){t.preventDefault();const e=!!t.currentTarget.hasAttribute("data-transition")&&t.currentTarget.dataset.transition;this.redirect(t.currentTarget.href,e,t.currentTarget)}}redirect(t,e=!1,n="script"){if(this.trigger=n,!this.running&&t!==this.location.href){const n=this.Helpers.getLocation(t);this.Contextual=!1,e&&(this.Contextual=this.Transitions.contextual[e].prototype,this.Contextual.name=e),n.origin!==this.location.origin||n.anchor&&n.pathname===this.location.pathname?window.location.href=t:(this.location=n,this.beforeFetch())}}popState(){this.trigger="popstate",this.Contextual=!1;const t=this.Helpers.getLocation(window.location.href);this.location.pathname!==t.pathname||!this.location.anchor&&!t.anchor?(this.popping=!0,this.location=t,this.beforeFetch()):this.location=t}pushState(){this.popping||window.history.pushState(this.location,"",this.location.href)}async fetch(){const t=await fetch(this.location.href,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Highway"},credentials:"same-origin"});if(t.status>=200&&t.status<300)return t.text();window.location.href=this.location.href}
2async beforeFetch(){this.pushState(),this.running=!0,this.emit("NAVIGATE_OUT",{from:{page:this.From.properties.page,view:this.From.properties.view},trigger:this.trigger,location:this.location});const t={trigger:this.trigger,contextual:this.Contextual};if(this.cache.has(this.location.href))await this.From.hide(t),this.properties=this.cache.get(this.location.href);else{const e=await Promise.all([this.fetch(),this.From.hide(t)]);this.properties=this.Helpers.getProperties(e[0]),this.cache.set(this.location.href,this.properties)}this.afterFetch()}async afterFetch(){const t=await this.properties.renderer;this.To=new t(this.properties),this.To.add(),this.emit("NAVIGATE_IN",{to:{page:this.To.properties.page,view:this.To.wrap.lastElementChild},trigger:this.trigger,location:this.location}),await this.To.show({trigger:this.trigger,contextual:this.Contextual}),this.popping=!1,this.running=!1,this.detach(this.links),this.links=document.querySelectorAll("a:not([target]):not([data-router-disabled])"),this.attach(this.links),this.emit("NAVIGATE_END",{to:{page:this.To.properties.page,view:this.To.wrap.lastElementChild},from:{page:this.From.properties.page,view:this.From.properties.view},trigger:this.trigger,location:this.location}),this.From=this.To,this.trigger=null}}const c={Core:l,Helpers:s,Renderer:o,Transition:class{constructor(t,e){this.wrap=t,this.name=e}show({trigger:t,contextual:e}){const n=this.wrap.lastElementChild,i=this.wrap.firstElementChild;return new Promise((r=>{e?(n.setAttribute("data-transition-in",e.name),n.removeAttribute("data-transition-out",e.name),e.in&&e.in({to:n,from:i,trigger:t,done:r})):(n.setAttribute("data-transition-in",this.name),n.removeAttribute("data-transition-out",this.name),this.in&&this.in({to:n,from:i,trigger:t,done:r}))}))}hide({trigger:t,contextual:e}){const n=this.wrap.firstElementChild;return new Promise((i=>{e?(n.setAttribute("data-transition-out",e.name),n.removeAttribute("data-transition-in",e.name),e.out&&e.out({from:n,trigger:t,done:i})):(n.setAttribute("data-transition-out",this.name),n.removeAttribute("data-transition-in",this.name),this.out&&this.out({from:n,trigger:t,done:i}))}))}}};var u=n(7071),h=n(3336),d=n(4711),f=n(5853);n(4453);function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=x(t);if(e){var r=x(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return _(this,n)}}function _(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}const b=new c.Core({transitions:{default:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(o,t);var e,n,i,r=y(o);function o(){return m(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"in",value:function(t){var e=t.from,n=t.to,i=t.trigger,r=t.done;n.style.pointerEvents="none",e.style.position="fixed",e.style.width="100%",window.scrollTo(0,0),Object.keys(u.Z.chunks).forEach((function(t){u.Z.chunks[t].destroy()})),u.Z.chunks={}
2,h.Z.scroll=new f.default(n.querySelector("[data-scroll]"),(0,d.YM)("scroll")),u.Z.view.previous=u.Z.view.current.id,u.Z.view.current.destroy(),h.Z.app.build(n),"popstate"===i?(e.remove(),u.Z.view.current.animateIn(i),h.Z.nav.setActive(u.Z.view.current.el.dataset.slug),u.Z.webgl&&h.Z.images.in(n),n.style.pointerEvents="",r()):setTimeout((function(){n.style.pointerEvents="",e.remove(),r(),u.Z.view.current.animateIn(i),u.Z.webgl&&h.Z.images.in(n)}),300),setTimeout((function(){h.Z.nav.close(),h.Z.scroll.activate()}),300),setTimeout((function(){h.Z.scroll.onResize()}),600)}},{key:"out",value:function(t){var e=t.from,n=t.trigger,i=t.done;u.Z.xhrActive&&location.reload(),setTimeout((function(){u.Z.xhrActive=!1}),600),u.Z.xhrActive=!0,"popstate"===n||u.Z.isMobile?(h.Z.scroll.destroy(),h.Z.app.clear(),i()):setTimeout((function(){h.Z.scroll.destroy(),h.Z.app.clear(),i()}),300),e.style.pointerEvents="none",u.Z.view.current.animateOut(),u.Z.webgl&&h.Z.images.out()}}])&&g(e.prototype,n),i&&g(e,i),o}(c.Transition)}})},5853:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>T});var i=n(7757),r=n.n(i),o=n(7071),a=n(8189),s=n(4711),l=n(788),c=(document,document,"ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&(document,DocumentTouch),navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints,window.navigator.msPointerEnabled,document,navigator.userAgent.indexOf("Firefox")>-1),u=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,h=(/constructor/i.test(window.HTMLElement)||(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),!!!document.documentMode&&window.StyleMedia,(!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime)||u)&&window.CSS,n(2790)),d=n.n(h),f=n(7438);function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function v(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function y(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){v(o,i,r,a,s,"next",t)}function s(t){v(o,i,r,a,s,"throw",t)}a(void 0)}))}}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function b(t,e,n){return(b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=E(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function w(t,e){return(w=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function M(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=E(t);if(e){var r=E(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return S(this,n)}}function S(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}
2function E(t){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var T=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&w(t,e)}(p,t);var e,n,i,a,u,h=M(p);function p(){return _(this,p),h.apply(this,arguments)}return e=p,(n=[{key:"init",value:(u=y(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return b(E(p.prototype),"init",this).call(this),this.setDefaults(),this.animate=this.animate.bind(this),this.onWheel=this.onWheel.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onResize=this.onResize.bind(this),this.getSections=this.getSections.bind(this),this.activate=this.activate.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.mouseDownHandler=this.mouseDownHandler.bind(this),this.mouseMoveHandler=this.mouseMoveHandler.bind(this),this.mouseUpHandler=this.mouseUpHandler.bind(this),this.container=this.el||o.Z.doc.querySelector("[data-scroll]"),this.els=m(this.el.querySelectorAll("[data-scroll] > [data-scroll-item]")),this.elGroups=m(this.el.querySelectorAll("[data-scroll] > [data-scroll-items]")),o.Z.raf.add(this.animate,this.id),o.Z.raf.moveToFirst(this.id),o.Z.scroll.offsetTop=0,this.isScrolling=!1,this.scrollClassAdded=!1,this.isDraggingScrollbar=!1,o.Z.body.classList.remove("is-scrolling"),o.Z.smooth||o.Z.body.classList.add("is-scroll-native"),this.makeScrollBar(),t.next=27,d()();case 27:this.onResize();case 28:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"addEvents",value:function(){b(E(p.prototype),"addEvents",this).call(this),l.z.on("LOAD_DONE",this.activate),o.Z.win.addEventListener("wheel",this.onWheel,{passive:!0}),o.Z.win.addEventListener("resize",this.onResize),o.Z.smooth&&(o.Z.win.addEventListener("keydown",this.onKeyDown,!1),this.addScrollbarEvents(),o.Z.drag&&("ontouchmove"in o.Z.win?(this.container.addEventListener("touchstart",this.mouseDownHandler,{passive:!0}),this.container.addEventListener("touchmove",this.mouseMoveHandler,{passive:!0}),this.container.addEventListener("touchend",this.mouseUpHandler)):(this.container.addEventListener("mousedown",this.mouseDownHandler),this.container.addEventListener("mousemove",this.mouseMoveHandler),this.container.addEventListener("mouseup",this.mouseUpHandler))))}},{key:"setDefaults",value:function(){this.container=null,this.els=[],this.sections=[],this.settings={interpolation:o.Z.smooth?.1:1,speed:.9,speedFirefox:1.2,dragSpeed:2,horizontal:!1},this.pointer={active:!1,move:!1,y:0},this.scroll={current:0,lerped:0,limit:0,delta:0,deltaY:0,dragY:0,max:0},this.state={active:!1,ticking:!1}}},{key:"activate",value:function(){this.calcSizes(),this.state.active=!0}},{key:"start",value:function(){o.Z.scroll.ticking=this.state.ticking=!0,Modules.nav.isOpen&&Modules.nav.close()}},{key:"stop",value:function(){o.Z.scroll.ticking=this.state.ticking=!1}},{key:"destroy",value:(a=y(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.z.off("LOAD_DONE"),o.Z.win.removeEventListener("wheel",this.onWheel,{passive:!0}),o.Z.win.removeEventListener("resize",this.onResize),o.Z.smooth&&(o.Z.win.removeEventListener("keydown",this.onKeyDown,!1),this.destroyScrollBar(),o.Z.drag&&("ontouchmove"in o.Z.win?(this.container.removeEventListener("touchstart",this.mouseDownHandler,{passive:!0}),this.container.removeEventListener("touchmove",this.mouseMoveHandler,{passive:!0}),this.container.removeEventListener("touchend",this.mouseUpHandler)):(this.container.removeEventListener("mousedown",this.mouseDownHandler),this.container.removeEventListener("mousemove",this.mouseMoveHandler),this.container.removeEventListener("mouseup",this.mouseUpHandler)))),t.next=6,d()();case 6:return this.stop(),this.container=null,this.els=null,this.elGroups=null,t.next=12,(0,f.Z)(200);case 12:o.Z.raf.remove(this.id);case 13:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"calculateScroll",value:function(){if(o.Z.smooth)if(this.scroll.max<0)this.scroll.current=0,this.isScrolling=!1;else{this.scroll.current=this.scroll.current+this.scroll.deltaY;var t=Math.abs(this.scroll.current)>this.scroll.max;-this.scroll.current<0?this.scroll.current=0:t&&(this.scroll.current=-this.scroll.max),this.isScrolling=-this.scroll.current>20}else this.scroll.current=window.scrollY;this.isScrolling&&!this.scrollClassAdded&&(o.Z.body.classList.add("is-scrolling"),this.scrollClassAdded=!0),!this.isScrolling&&this.scrollClassAdded&&(o.Z.body.classList.remove("is-scrolling"),this.scrollClassAdded=!1);var e=this.scroll.current/this.scroll.max*this.scrollBarLimit.y;(0,s.qL)(this.scrollbarThumb,-e)}},{key:"lerpScroll",value:function(){this.scroll.lerped=(0,s.t7)(this.scroll.lerped,this.scroll.current,this.settings.interpolation),o.Z.scroll.offsetTop=-this.scroll.lerped}},{key:"transformSection",value:function(t,e){t.active;var n=t.el,i=t.partsTop,r=t.parts;if(t.parent,t.inView){if(o.Z.smooth&&((0,s.qL)(n,e),n.classList.add("in-view"),n.style.visibility="",i.length))for(var a=0;a<i.length;a++)this.transformPart(i[a],e);if(r.length)for(var l=0;l<r.length;l++){var c=r[l];if(c.el.classList.add("in-view"),o.Z.smooth){var u=(-this.scroll.lerped+o.Z.layout.h/2-c.middle)*-c.parallax;(0,s.qL)(c.el,u),c.el.transform.y=u}}}else if(o.Z.smooth&&(n.classList.remove("in-view"),n.style.visibility="hidden"),r.length)for(var h=0;h<r.length;h++)r[h].el.classList.remove("in-view")}},{key:"checkInView",value:function(t){for(var e=0;e<t.length;e++)t[e].inView=(0,s.UD)(t[e].elBounds,this.scroll.lerped,{parent:t[e].parent})}},{key:"transformPart",value:function(t,e){var n=t.el,i=t.parallax;(0,s.qL)(n,e*i-e)}},{key:"transformSections",value:function(t){for(var e=0;e<t.length;e++)this.transformSection(t[e],this.scroll.lerped)}},{key:"animate",value:function(){this.state.active&&o.Z.smooth&&(this.calculateScroll(),this.checkInView(this.sections)),this.lerpScroll(),this.transformSections(this.sections),this.scroll.deltaY=0}},{key:"mouseDownHandler",value:function(t){if(!o.Z.dragComponent)return!!this.state.active&&void(this.pointer.active||(this.pointer.active=!0,this.state.ticking=!0,this.pointer.y=t.touches?t.touches[0].clientY:t.clientY))}},{key:"mouseMoveHandler",value:function(t){var e=this;if(this.mouseMoveTimeOut1&&clearTimeout(this.mouseMoveTimeOut1),this.mouseMoveTimeOut2&&clearTimeout(this.mouseMoveTimeOut2),!o.Z.dragComponent&&this.pointer.active){this.start(),this.checkInView(this.sections);var n=t.touches?t.touches[0].clientY:t.clientY;this.pointer.move=!0,this.scroll.dragY=n-this.pointer.y,this.scroll.current+=this.scroll.dragY*this.settings.dragSpeed,this.pointer.y=n,l.z.emit("MOUSE_DRAG"),this.mouseMoveTimeOut1=setTimeout((function(){e.pointer.active=!1}),100),this.mouseMoveTimeOut2=setTimeout((function(){e.pointer.active=!1,e.pointer.move=!1,e.stop()}),1e3)}}},{key:"mouseUpHandler",value:function(){var t=this;this.pointer.active=!1,setTimeout((function(){t.pointer.move=!1}),1e3),this.scroll.dragY=0}},{key:"onWheel",value:function(t){var e=this;if(o.Z.smooth){if(!this.state.active)return!1;this.wheelTimeOut&&clearTimeout(this.wheelTimeOut),this.start();var n=s.Q$.normalizeWheel(t).pixelY;this.scroll.deltaY=Math.max(Math.min(this.scroll.delta=t.wheelDeltaY||-1*n,300),-300),this.scroll.deltaY*=this.settings.speed,c&&(this.scroll.deltaY*=this.settings.speedFirefox),this.wheelTimeOut=setTimeout((function(){e.pointer.move||e.stop()}),1e3)}else this.scroll.current=-window.scrollY}},{key:"onKeyDown",value:function(t){switch(t.code){case"ArrowUp":this.scroll.current+=150;break;case"ArrowDown":this.scroll.current-=150;break;case"PageUp":this.scroll.current+=o.Z.layout.h;break;case"PageDown":this.scroll.current-=o.Z.layout.h;break;case"Space":document.activeElement instanceof HTMLInputElement||document.activeElement instanceof HTMLTextAreaElement||(t.shiftKey?this.scroll.current+=o.Z.layout.h:this.scroll.current-=o.Z.layout.h)}}},{key:"getSections",value:function(){var t=this;
2this.sections=[],this.els.forEach((function(e){t.sections.push({active:!1,el:e,elBounds:{offsetTop:e.offsetTop,offsetHeight:e.offsetHeight,offsetLeft:e.offsetLeft,offsetWidth:e.offsetWidth,w:window.innerWidth,h:window.innerHeight},inView:!0,partsTop:[],parts:[],parent:null})})),this.elGroups.forEach((function(e){e.querySelectorAll("[data-scroll-item]").forEach((function(n){t.sections.push({active:!1,el:n,partsTop:[],parts:[],parent:e})}))})),this.sections.forEach((function(t){var e=t.el.querySelectorAll("[data-parallax-top]"),n=t.el.querySelectorAll("[data-parallax]");e.length&&e.forEach((function(e){t.partsTop.push({el:e,parallax:o.Z.webgl&&e.dataset.parallaxTop||1})})),n.length&&n.forEach((function(e){var n=e.querySelectorAll(".image");n.length&&n.forEach((function(t){t.glParallax=o.Z.webgl&&e.dataset.parallax/10||0}));var i=e.getBoundingClientRect(),r=i.top,a=i.bottom;e.transform={x:0,y:0},t.parts.push({el:e,middle:(a-r)/2+r,parallax:o.Z.webgl&&e.dataset.parallax/10||0})}))}))}},{key:"scrollSize",value:function(){this.settings.horizontal?(this.container&&(this.sectionsTotalWidth=this.container.getBoundingClientRect().width),this.scroll.max=this.sectionsTotalWidth-o.Z.layout.w,this.options.offsetBottom&&(this.scroll.max+=this.options.offsetBottom)):this.container&&(this.scroll.max=this.container.getBoundingClientRect().height-o.Z.layout.h)}},{key:"reset",value:function(){[].concat(m(this.el.querySelectorAll("[data-scroll-item]")),m(this.el.querySelectorAll("[data-parallax-top]")),m(this.el.querySelectorAll("[data-parallax]"))).forEach((function(t){return t.style.transform=""}))}},{key:"calcSizes",value:function(){this.getSections(),this.scrollSize(),this.calcScrollBar()}},{key:"onResize",value:function(){this.reset(),this.calcSizes(),this.checkInView(this.sections)}},{key:"makeScrollBar",value:function(){this.scrollbar=document.createElement("span"),this.scrollbarThumb=document.createElement("span"),this.scrollbar.classList.add("scrollbar"),this.scrollbarThumb.classList.add("scrollbar-thumb"),this.scrollbar.append(this.scrollbarThumb),o.Z.body.append(this.scrollbar),this.getScrollBar=this.getScrollBar.bind(this),this.releaseScrollBar=this.releaseScrollBar.bind(this),this.moveScrollBar=this.moveScrollBar.bind(this),this.hasScrollbar=!1}},{key:"addScrollbarEvents",value:function(){this.scrollbarThumb.addEventListener("mousedown",this.getScrollBar),o.Z.win.addEventListener("mouseup",this.releaseScrollBar),o.Z.win.addEventListener("mousemove",this.moveScrollBar)}},{key:"calcScrollBar",value:function(){this.hasScrollbar=!1,this.scroll.max+o.Z.layout.h<=o.Z.layout.h||(this.hasScrollbar=!0,this.scrollbarBCR=this.scrollbar.getBoundingClientRect(),this.scrollbarHeight=this.scrollbarBCR.height,this.scrollbarWidth=this.scrollbarBCR.width,this.scrollbarThumb.style.height="".concat(this.scrollbarHeight*this.scrollbarHeight/(this.scroll.max+this.scrollbarHeight),"px"),this.scrollbarThumbBCR=this.scrollbarThumb.getBoundingClientRect(),this.scrollBarLimit={x:this.scrollbarWidth-this.scrollbarThumbBCR.width,y:this.scrollbarHeight-this.scrollbarThumbBCR.height})}},{key:"destroyScrollBar",value:function(){this.scrollbarThumb.removeEventListener("mousedown",this.getScrollBar),o.Z.win.removeEventListener("mouseup",this.releaseScrollBar),o.Z.win.removeEventListener("mousemove",this.moveScrollBar),this.scrollbar.remove()}},{key:"getScrollBar",value:function(t){this.isDraggingScrollbar=!0,this.calculateScroll()}},{key:"releaseScrollBar",value:function(t){this.isDraggingScrollbar=!1}},{key:"moveScrollBar",value:function(t){var e=this;this.isDraggingScrollbar&&requestAnimationFrame((function(){var n=100*(t.clientY-e.scrollbarBCR.top)/e.scrollbarHeight*e.scroll.max/100;n>0&&n<e.scroll.max&&(e.scroll.current=-1*n)}))}}])&&x(e.prototype,n),i&&x(e,i),p}(a.Y)},4448:t=>{t.exports={circIn:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",circOut:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",circInOut:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",quadIn:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",quadOut:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",quadInOut:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",cubicIn:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",cubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)",cubicInOut:"cub
2ic-bezier(0.645, 0.045, 0.355, 1.000)",quartIn:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",quartOut:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",quartInOut:"cubic-bezier(0.770, 0.000, 0.175, 1.000)",quintIn:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",quintOut:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",quintInOut:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",expoIn:"cubic-bezier(0.950, 0.050, 0.795, 0.035)",expoOut:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",expoInOut:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",sineIn:"cubic-bezier(0.470, 0.000, 0.745, 0.715)",sineOut:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",sineInOut:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",backIn:"cubic-bezier(0.600, -0.280, 0.735, 0.045)",backOut:"cubic-bezier(0.175,  0.885, 0.320, 1.275)",BackInOut:"cubic-bezier(0.680, -0.550, 0.265, 1.550)"}},5507:(t,e,n)=>{"use strict";n.d(e,{I:()=>l});var i=n(7757),r=n.n(i),o=n(7438);function a(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function s(t){a(o,i,r,s,l,"next",t)}function l(t){a(o,i,r,s,l,"throw",t)}s(void 0)}))}}function l(t){return c.apply(this,arguments)}function c(){return(c=s(r().mark((function t(e){var n,i=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{className:"element",duration:1e3,delay:0},t.next=3,(0,o.Z)(n.delay);case 3:return e.classList.remove("".concat(n.className,"-leave-to")),e.classList.add("".concat(n.className,"-enter-to")),t.next=7,(0,o.Z)(n.duration);case 7:e.classList.remove("".concat(n.className,"-enter")),e.classList.remove("".concat(n.className,"-enter-to"));case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},788:(t,e,n)=>{"use strict";function i(t){throw new TypeError('"'+t+'" is read-only')}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}n.d(e,{z:()=>o});var o=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"on",value:function(t,e,n){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:n}),this}},{key:"once",value:function(t,e,n){var i=this;function r(){i.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)}},{key:"emit",value:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,e);return this}},{key:"off",value:function(t,e){var n=this.e||(this.e={}),r=n[t],o=[];if(r&&e)for(var a=0,s=r.length;a<s;i("i"),a++)r[a].fn!==e&&r[a].fn._!==e&&o.push(r[a]);return o.length?n[t]=o:delete n[t],this}}])&&r(e.prototype,n),o&&r(e,o),t}())},339:(t,e,n)=>{"use strict";function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t+"_"+Math.random().toString(36).substr(2,9)}n.d(e,{Z:()=>i})},4711:(t,e,n)=>{"use strict";n.d(e,{gO:()=>o,YM:()=>a.Z,Q$:()=>s,AE:()=>h,UD:()=>u,t7:()=>l.t7,qL:()=>c});var i=n(8502);function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(0,i.kK)(e)?this.el=void 0!==e?e:null:this.el=this.get(e,document),this.id=n,this.type=r,this.init(),this.addEvents()}var e,n,o;return e=t,(n=[{key:"init",value:function(){}},{key:"destroy",value:function(){this.removeEvents()}},{key:"addEvents",value:function(){}},{key:"removeEvents",value:function(){}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el;return e.querySelector(t)}},{key:"getAll",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el;return Array.from(e.querySelectorAll(t))}}])&&r(e.prototype,n),o&&r(e,o),t}(),a=n(339),s=(n(788),function(){var t={normalizeWheel:function(t){var e=0,n=0,i=0,r=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120
2),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),i=10*e,r=10*n,"deltaY"in t&&(r=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||r)&&t.deltaMode&&(1==t.deltaMode?(i*=40,r*=40):(i*=800,r*=800)),i&&!e&&(e=i<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:e,spinY:n,pixelX:i,pixelY:r}}};return t}()),l=n(6627);function c(t,e){return t.style.transform="translate3d(0, ".concat(Math.round(100*e)/100,"px, 0)")}function u(t,e,n){var i={tolerance:100,horizontal:!1,parent:null,w:window.innerWidth,h:window.innerHeight};if(Object.assign(i,n),!t)throw new Error("You should specify the element you want to test");if("string"==typeof t&&(t=document.querySelector(t)),i.horizontal){var r=-e+i.w,o=t.offsetLeft;return t.offsetWidth+o+i.tolerance>-e&&o-i.tolerance<=r}var a=null!==i.parent?i.parent.offsetTop:0,s=-e+i.h,l=t.offsetTop+a;return t.offsetHeight+l+i.tolerance>-e&&l-i.tolerance<=s}function h(){return new Promise((function(t){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",t):t()}))}},8502:(t,e,n)=>{"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return 0===Object.keys(t).length}function o(t){return"object"===("undefined"==typeof Node?"undefined":i(Node))?t instanceof Node:t&&"object"===i(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName}function a(t){return"object"===("undefined"==typeof HTMLElement?"undefined":i(HTMLElement))?t instanceof HTMLElement:t&&"object"===i(t)&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}n.d(e,{xb:()=>r,UG:()=>o,kK:()=>a})},6627:(t,e,n)=>{"use strict";function i(t,e,n){return(1-n)*t+n*e}function r(t,e,n){return Math.min(Math.max(e,t),n)}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"000",n=""+t;return e.substring(0,e.length-n.length)+n}n.d(e,{t7:()=>i,uZ:()=>r,vk:()=>o})},2790:t=>{t.exports=function(){return new Promise((function(t){setTimeout(t,0)}))}},7438:(t,e,n)=>{"use strict";function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){setTimeout(e,t)}))}n.d(e,{Z:()=>i})},3582:(t,e,n)=>{"use strict";function i(t,e){var n={classWord:"word",classWords:"words",classLine:"line",classLetter:"letter",splitLetters:!1};Object.assign(n,e);var i=t.querySelectorAll("p"),r=[];function o(e){var i=e.innerHTML.split("<br>");e.innerHTML="",i.forEach((function(t){if(""===t)return!1;var e=document.createElement("div");e.innerHTML=t,e.classList.add("".concat(n.classLine,"-inner"));var i=document.createElement("div");i.innerHTML=e.outerHTML,i.classList.add(n.classLine),n.splitLetters&&function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.tagName,i=void 0===n?"span":n,r=e.split,o=e.setClassName,a=void 0===o?function(t){return"char"+t}:o;t.normalize();var s=1;function l(t){var e=t.parentNode,n=t.nodeValue;
2(r?r(n):n.split("")).forEach((function(n){var r=document.createElement(i),o=a(s++,n);o&&(r.className=o)," "===n&&(n="&nbsp;"),r.innerHTML=n,r.setAttribute("aria-hidden","true"),e.insertBefore(r,t)})),""!==n.trim()&&e.setAttribute("aria-label",n),e.removeChild(t)}!function t(e){if(3===e.nodeType)return l(e);var n=Array.prototype.slice.call(e.childNodes);if(1===n.length&&3===n[0].nodeType)return l(n[0]);n.forEach((function(e){t(e)}))}(t)}(i,{setClassName:function(){return"char"}}),r.push(i)})),r.forEach((function(e){t.appendChild(e)}))}i.length?i.forEach((function(e){o(e),t.removeChild(e)})):o(t)}function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={debug:!1};function i(t){var e=t.children,n=0,i="";t.innerHTML=t.textContent.replace(/\S+/g,"<n>$&</n>");for(var r=0;r<e.length;r++){var o=e[r].getBoundingClientRect().top;n<o&&(i+='</span></span><span class="line"><span class="line-inner">'),n=o,i+=e[r].textContent+" "}t.innerHTML=i+="</span></span>"}Object.assign(n,e),i(t)}n.d(e,{C2:()=>i,Rg:()=>r})},9741:(t,e,n)=>{var i,r;!function(o,a){"use strict";void 0===(r="function"==typeof(i=a)?i.call(e,n,e,t):i)||(t.exports=r)}(window,(function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],n=0;n<e.length;n++){var i=e[n]+"MatchesSelector";if(t[i])return i}}();return function(e,n){return e[t](n)}}))},7158:function(t,e,n){var i,r;"undefined"!=typeof window&&window,void 0===(r="function"==typeof(i=function(){"use strict";function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var i=this._onceEvents&&this._onceEvents[t],r=0;r<n.length;r++){var o=n[r];i&&i[o]&&(this.off(t,o),delete i[o]),o.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t})?i.call(e,n,e,t):i)||(t.exports=r)},9047:(t,e,n)=>{var i,r;!function(o,a){i=[n(9741)],void 0===(r=function(t){return function(t,e){"use strict";var n={extend:function(t,e){for(var n in e)t[n]=e[n];return t},modulo:function(t,e){return(t%e+e)%e}},i=Array.prototype.slice;n.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?i.call(t):[t]},n.removeFrom=function(t,e){var n=t.indexOf(e);-1!=n&&t.splice(n,1)},n.getParent=function(t,n){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,n))return t},n.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},n.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},n.filterFindElements=function(t,i){t=n.makeArray(t);var r=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(i){e(t,i)&&r.push(t);for(var n=t.querySelectorAll(i),o=0;o<n.length;o++)r.push(n[o])}else r.push(t)})),r},n.debounceMethod=function(t,e,n){n=n||100;var i=t.prototype[e],r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments,o=this;this[r]=setTimeout((function(){i.apply(o,e),delete o[r]}),n)}},n.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},n.toDashed=function(t){return t.replace(/(.)([A-Z])/g,(function(t,e,n){return e+"-"+n})).toLowerCase()};var r=t.console;return n.htmlInit=function(e,i){n.docReady((function(){var o=n.toDashed(i),a="data-"+o,s=document.querySelectorAll("["+a+"]"),l=document.querySelectorAll(".js-"+o),c=n.makeArray(s).concat(n.makeArray(l)),u=a+"-options",h=t.jQuery;c.forEach((function(t){var n,o=t.getAttribute(a)||t.getAttribute(u);try{n=o&&JSON.parse(o)}catch(e){return void(r&&r.error("Error parsing "+a+" on "+t.className+": "+e))}var s=new e(t,n);h&&h.data(t,i,s)}))}))},n}(o,t)}.apply(e,i))||(t.exports=r)}(window)},3597:(t,e,n)=>{var i,r;window,i=[n(7217),n(9047)],void 0===(r=function(t,e){return function(t,e,n){"use strict";function i(t){var e=document.createDocumentFragment();return t.forEach((function(t){e.appendChild(t.element)})),e}var r=e.prototype;return r.insert=function(t,e){var n=this._makeCells(t);if(n&&n.length){var r=this.cells.length;e=void 0===e?r:e;var o=i(n),a=e==r;if(a)this.slider.appendChild(o);else{var s=this.cells[e].element;this.slider.insertBefore(o,s)}if(0===e)this.cells=n.concat(this.cells);else if(a)this.cells=this.cells.concat(n);else{var l=this.cells.splice(e,r-e);this.cells=this.cells.concat(n).concat(l)}this._sizeCells(n),this.cellChange(e,!0)}},r.append=function(t){this.insert(t,this.cells.length)},r.prepend=function(t){this.insert(t,0)},r.remove=function(t){var e=this.getCells(t);if(e&&e.length){var i=this.cells.length-1;e.forEach((function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i),n.removeFrom(this.cells,t)}),this),this.cellChange(i,!0)}},r.cellSizeChange=function(t){var e=this.getCell(t);if(e){e.getSize();var n=this.cells.indexOf(e);this.cellChange(n)}}
vendor: 16,603 bytes, line 2
2,r.cellChange=function(t,e){var n=this.selectedElement;this._positionCells(t),this._getWrapShiftCells(),this.setGallerySize();var i=this.getCell(n);i&&(this.selectedIndex=this.getCellSlideIndex(i)),this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex),this.emitEvent("cellChange",[t]),this.select(this.selectedIndex),e&&this.positionSliderAtSelected()},e}(0,t,e)}.apply(e,i))||(t.exports=r)},7880:(t,e,n)=>{var i,r;window,i=[n(9047)],void 0===(r=function(t){return function(t,e){"use strict";var n={startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();var t=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(t),this.isAnimating){var e=this;requestAnimationFrame((function(){e.animate()}))}},positionSlider:function(){var t=this.x;this.options.wrapAround&&this.cells.length>1&&(t=e.modulo(t,this.slideableWidth),t-=this.slideableWidth,this.shiftWrapCells(t)),this.setTranslateX(t,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(t,e){t+=this.cursorPosition,t=this.options.rightToLeft?-t:t;var n=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+n+",0,0)":"translateX("+n+")"},dispatchScrollEvent:function(){var t=this.slides[0];if(t){var e=-this.x-t.target,n=e/this.slidesWidth;this.dispatchEvent("scroll",null,[n,e])}},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},settle:function(t){!this.isPointerDown&&Math.round(100*this.x)==Math.round(100*t)&&this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var n=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,n,1)},_shiftCells:function(t,e,n){for(var i=0;i<t.length;i++){var r=t[i],o=e>0?n:0;r.wrapShift(o),e-=r.size.outerWidth}},_unshiftCells:function(t){if(t&&t.length)for(var e=0;e<t.length;e++)t[e].wrapShift(0)},integratePhysics:function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},applyForce:function(t){this.velocity+=t},getFrictionFactor:function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},getRestingPosition:function(){return this.x+this.velocity/(1-this.getFrictionFactor())},applyDragForce:function(){if(this.isDraggable&&this.isPointerDown){var t=this.dragX-this.x-this.velocity;this.applyForce(t)}},applySelectedAttraction:function(){if((!this.isDraggable||!this.isPointerDown)&&!this.isFreeScrolling&&this.slides.length){var t=(-1*this.selectedSlide.target-this.x)*this.options.selectedAttraction;this.applyForce(t)}}};return n}(0,t)}.apply(e,i))||(t.exports=r)},7229:(t,e,n)=>{var i,r;window,i=[n(6131)],void 0===(r=function(t){return function(t,e){"use strict";function n(t,e){this.element=t,this.parent=e,this.create()}var i=n.prototype;return i.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-hidden","true"),this.x=0,this.shift=0},i.destroy=function(){this.unselect(),this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="",this.element.removeAttribute("aria-hidden")},i.getSize=function(){this.size=e(this.element)},i.setPosition=function(t){this.x=t,this.updateTarget(),this.renderPosition(t)},i.updateTarget=i.setDefaultTarget=function(){var t="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign},i.renderPosition=function(t){var e=this.parent.originSide;this.element.style[e]=this.parent.getPositionValue(t)},i.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden")},i.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true")},i.wrapShift=function(t){this.shift=t,this.renderPosition(this.x+this.parent.slideableWidth*t)},i.remove=function(){this.element.parentNode.removeChild(this.element)},n}(0,t)}.apply(e,i))||(t.exports=r)},9690:(t,e,n)=>{var i,r;!function(o,a){i=[n(7217),n(4842),n(9047)],void 0===(r=function(t,e,n){return function(t,e,n,i){"use strict";i.extend(e.defaults,{draggable:">1",dragThreshold:3}),e.createMethods.push("_createDrag");var r=e.prototype;i.extend(r,n.prototype),r._touchActionValue="pan-y";var o="createTouch"in document,a=!1;r._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),o&&!a&&(t.addEventListener("touchmove",(function(){})),a=!0)},r.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},r.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},r.updateDraggable=function(){">1"==this.options.draggable?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},r.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},r.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},r._uiChangeDrag=function(){delete this.isFreeScrolling},r.pointerDown=function(e,n){this.isDraggable?this.okayPointerDown(e)&&(this._pointerDownPreventDefault(e),this.pointerDownFocus(e),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=l(),t.addEventListener("scroll",this),this._pointerDownDefault(e,n)):this._pointerDownDefault(e,n)},r._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY},this._bindPostStartEvents(t),this.dispatchEvent("pointerDown",t,[e])};var s={INPUT:!0,TEXTAREA:!0,SELECT:!0};function l(){return{x:t.pageXOffset,y:t.pageYOffset}}return r.pointerDownFocus=function(t){s[t.target.nodeName]||this.focus()},r._pointerDownPreventDefault=function(t){var e="touchstart"==t.type,n="touch"==t.pointerType,i=s[t.target.nodeName];e||n||i||t.preventDefault()},r.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold},r.pointerUp=function(t,e){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",t,[e]),this._dragPointerUp(t,e)},r.pointerDone=function(){t.removeEventListener("scroll",this),delete this.pointerDownScroll},r.dragStart=function(e,n){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),t.removeEventListener("scroll",this),this.dispatchEvent("dragStart",e,[n]))},r.pointerMove=function(t,e){var n=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,n]),this._dragMove(t,e,n)},r.dragMove=function(t,e,n){if(this.isDraggable){t.preventDefault(),this.previousDragX=this.dragX;var i=this.options.rightToLeft?-1:1;this.options.wrapAround&&(n.x%=this.slideableWidth);var r=this.dragStartPosition+n.x*i;if(!this.options.wrapAround&&this.slides.length){var o=Math.max(-this.slides[0].target,this.dragStartPosition);r=r>o?.5*(r+o):r;var a=Math.min(-this.getLastSlide().target,this.dragStartPosition);r=r<a?.5*(r+a):r}this.dragX=r,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",t,[e,n])}},r.dragEnd=function(t,e){if(this.isDraggable){this.options.freeScroll&&(this.isFreeScrolling=!0);var n=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var i=this.getRestingPosition();this.isFreeScrolling=-i>this.slides[0].target&&-i<this.getLastSlide().target}else this.options.freeScroll||n!=this.selectedIndex||(n+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(n),delete this.isDragSelect,this.dispatchEvent("dragEnd",t,[e])}},r.dragEndRestingSelect=function(){var t=this.getRestingPosition(),e=Math.abs(this.getSlideDistance(-t,this.selectedIndex)),n=this._getClosestResting(t,e,1),i=this._getClosestResting(t,e,-1);return n.distance<i.distance?n.index:i.index},r._getClosestResting=function(t,e,n){for(var i=this.selectedIndex,r=1/0,o=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};o(e,r)&&(i+=n,r=e,null!==(e=this.getSlideDistance(-t,i)));)e=Math.abs(e);return{distance:r,index:i-n}},r.getSlideDistance=function(t,e){var n=this.slides.length,r=this.options.wrapAround&&n>1,o=r?i.modulo(e,n):e,a=this.slides[o];if(!a)return null;var s=r?this.slideableWidth*Math.floor(e/n):0;return t-(a.target+s)},r.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var t=this.getSlideDistance(-this.dragX,this.selectedIndex),e=this.previousDragX-this.dragX;return t>0&&e>0?1:t<0&&e<0?-1:0},r.staticClick=function(t,e){var n=this.getParentCell(t.target),i=n&&n.element,r=n&&this.cells.indexOf(n);this.dispatchEvent("staticClick",t,[e,i,r])},r.onscroll=function(){var t=l(),e=this.pointerDownScroll.x-t.x,n=this.pointerDownScroll.y-t.y;(Math.abs(e)>3||Math.abs(n)>3)&&this._pointerDone()},e}(o,t,e,n)}.apply(e,i))||(t.exports=r)}(window)},7217:(t,e,n)=>{var i,r;!function(o,a){i=[n(7158),n(6131),n(9047),n(7229),n(9714),n(7880)],void 0===(r=function(t,e,n,i,r,a){return function(t,e,n,i,r,o,a){"use strict";var s=t.jQuery,l=t.getComputedStyle,c=t.console;function u(t,e){for(t=i.makeArray(t);t.length;)e.appendChild(t.shift())}var h=0,d={};function f(t,e){var n=i.getQueryElement(t);if(n){if(this.element=n,this.element.flickityGUID){var r=d[this.element.flickityGUID];return r&&r.option(e),r}s&&(this.$element=s(this.element)),this.options=i.extend({},this.constructor.defaults),this.option(e),this._create()}else c&&c.error("Bad element for Flickity: "+(n||t))}f.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},f.createMethods=[];var p=f.prototype;i.extend(p,e.prototype),p._create=function(){var e=this.guid=++h;for(var n in this.element.flickityGUID=e,d[e]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&t.addEventListener("resize",this),this.options.on){var i=this.options.on[n];this.on(n,i)}f.createMethods.forEach((function(t){this[t]()}),this),this.options.watchCSS?this.watchCSS():this.activate()},p.option=function(t){i.extend(this.options,t)},p.activate=function(){this.isActive||(this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize(),u(this._filterFindCellElements(this.element.children),this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready"))},p._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},p._filterFindCellElements=function(t){return i.filterFindElements(t,this.options.cellSelector)},p.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},p._makeCells=function(t){return this._filterFindCellElements(t).map((function(t){return new r(t,this)}),this)},p.getLastCell=function(){return this.cells[this.cells.length-1]},p.getLastSlide=function(){return this.slides[this.slides.length-1]},p.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},p._positionCells=function(t){t=t||0,this.maxCellHeight=t&&this.maxCellHeight||0;var e=0;if(t>0){var n=this.cells[t-1];e=n.x+n.size.outerWidth}for(var i=this.cells.length,r=t;r<i;r++){var o=this.cells[r];o.setPosition(e),e+=o.size.outerWidth,this.maxCellHeight=Math.max(o.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e,this.updateSlides(),this._containSlides(),this.slidesWidth=i?this.getLastSlide().target-this.slides[0].target:0},p._sizeCells=function(t){t.forEach((function(t){t.getSize()}))},p.updateSlides=function(){if(this.slides=[],this.cells.length){var t=new o(this);this.slides.push(t);var e="left"==this.originSide?"marginRight":"marginLeft",n=this._getCanCellFit();this.cells.forEach((function(i,r){if(t.cells.length){var a=t.outerWidth-t.firstMargin+(i.size.outerWidth-i.size[e]);n.call(this,r,a)||(t.updateTarget(),t=new o(this),this.slides.push(t)),t.addCell(i)}else t.addCell(i)}),this),t.updateTarget(),this.updateSelectedSlide()}},p._getCanCellFit=function(){var t=this.options.groupCells;if(!t)return function(){return!1};if("number"==typeof t){var e=parseInt(t,10);return function(t){return t%e!=0}}var n="string"==typeof t&&t.match(/^(\d+)%$/),i=n?parseInt(n[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*i}},p._init=p.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},p.getSize=function(){this.size=n(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};var m={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};p.setCellAlign=function(){var t=m[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign},p.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}},p._getWrapShiftCells=function(){if(this.options.wrapAround){this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition,e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1),t=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(t,0,1)}},p._getGapCells=function(t,e,n){for(var i=[];t>0;){var r=this.cells[e];if(!r)break;i.push(r),e+=n,t-=r.size.outerWidth}return i},p._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var t=this.options.rightToLeft,e=t?"marginRight":"marginLeft",n=t?"marginLeft":"marginRight",i=this.slideableWidth-this.getLastCell().size[n],r=i<this.size.innerWidth,o=this.cursorPosition+this.cells[0].size[e],a=i-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach((function(t){r?t.target=i*this.cellAlign:(t.target=Math.max(t.target,o),t.target=Math.min(t.target,a))}),this)}},p.dispatchEvent=function(t,e,n){var i=e?[e].concat(n):n;if(this.emitEvent(t,i),s&&this.$element){var r=t+=this.options.namespaceJQueryEvents?".flickity":"";if(e){var o=new s.Event(e);o.type=t,r=o}this.$element.trigger(r,n)}},p.select=function(t,e,n){if(this.isActive&&(t=parseInt(t,10),this._wrapSelect(t),(this.options.wrapAround||e)&&(t=i.modulo(t,this.slides.length)),this.slides[t])){var r=this.selectedIndex;this.selectedIndex=t,this.updateSelectedSlide(),n?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[t]),t!=r&&this.dispatchEvent("change",null,[t]),this.dispatchEvent("cellSelect")}},p._wrapSelect=function(t){var e=this.slides.length;if(!(this.options.wrapAround&&e>1))return t;var n=i.modulo(t,e),r=Math.abs(n-this.selectedIndex),o=Math.abs(n+e-this.selectedIndex),a=Math.abs(n-e-this.selectedIndex);!this.isDragSelect&&o<r?t+=e:!this.isDragSelect&&a<r&&(t-=e),t<0?this.x-=this.slideableWidth:t>=e&&(this.x+=this.slideableWidth)},p.previous=function(t,e){this.select(this.selectedIndex-1,t,e)},p.next=function(t,e){this.select(this.selectedIndex+1,t,e)},p.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];t&&(this.unselectSelectedSlide(),this.selectedSlide=t,t.select(),this.selectedCells=t.cells,this.selectedElements=t.getCellElements(),this.selectedCell=t.cells[0],this.selectedElement=this.selectedElements[0])},p.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},p.selectInitialIndex=function(){var t=this.options.initialIndex;
2if(this.isInitActivated)this.select(this.selectedIndex,!1,!0);else{if(t&&"string"==typeof t)if(this.queryCell(t))return void this.selectCell(t,!1,!0);var e=0;t&&this.slides[t]&&(e=t),this.select(e,!1,!0)}},p.selectCell=function(t,e,n){var i=this.queryCell(t);if(i){var r=this.getCellSlideIndex(i);this.select(r,e,n)}},p.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){if(-1!=this.slides[e].cells.indexOf(t))return e}},p.getCell=function(t){for(var e=0;e<this.cells.length;e++){var n=this.cells[e];if(n.element==t)return n}},p.getCells=function(t){t=i.makeArray(t);var e=[];return t.forEach((function(t){var n=this.getCell(t);n&&e.push(n)}),this),e},p.getCellElements=function(){return this.cells.map((function(t){return t.element}))},p.getParentCell=function(t){var e=this.getCell(t);return e||(t=i.getParent(t,".flickity-slider > *"),this.getCell(t))},p.getAdjacentCellElements=function(t,e){if(!t)return this.selectedSlide.getCellElements();e=void 0===e?this.selectedIndex:e;var n=this.slides.length;if(1+2*t>=n)return this.getCellElements();for(var r=[],o=e-t;o<=e+t;o++){var a=this.options.wrapAround?i.modulo(o,n):o,s=this.slides[a];s&&(r=r.concat(s.getCellElements()))}return r},p.queryCell=function(t){if("number"==typeof t)return this.cells[t];if("string"==typeof t){if(t.match(/^[#.]?[\d/]/))return;t=this.element.querySelector(t)}return this.getCell(t)},p.uiChange=function(){this.emitEvent("uiChange")},p.childUIPointerDown=function(t){"touchstart"!=t.type&&t.preventDefault(),this.focus()},p.onresize=function(){this.watchCSS(),this.resize()},i.debounceMethod(f,"onresize",150),p.resize=function(){if(this.isActive){this.getSize(),this.options.wrapAround&&(this.x=i.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,!1,!0)}},p.watchCSS=function(){this.options.watchCSS&&(-1!=l(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},p.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(this.options.accessibility&&!e){var n=f.keyboardHandlers[t.keyCode];n&&n.call(this)}},f.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange(),this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange(),this[t]()}},p.focus=function(){var e=t.pageYOffset;this.element.focus({preventScroll:!0}),t.pageYOffset!=e&&t.scrollTo(t.pageXOffset,e)},p.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach((function(t){t.destroy()})),this.element.removeChild(this.viewport),u(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},p.destroy=function(){this.deactivate(),t.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),s&&this.$element&&s.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete d[this.guid]},i.extend(p,a),f.data=function(t){var e=(t=i.getQueryElement(t))&&t.flickityGUID;return e&&d[e]},i.htmlInit(f,"flickity"),s&&s.bridget&&s.bridget("flickity",f);return f.setJQuery=function(t){s=t},f.Cell=r,f.Slide=o,f}(o,t,e,n,i,r,a)}.apply(e,i))||(t.exports=r)}(window)},2442:(t,e,n)=>{var i,r,o;window,r=[n(7217),n(9690),n(2410),n(7573),n(8516),n(3597),n(7227)],void 0===(o="function"==typeof(i=function(t){return t})?i.apply(e,r):i)||(t.exports=o)},7227:(t,e,n)=>{var i,r;window,i=[n(7217),n(9047)],void 0===(r=function(t,e){return function(t,e,n){"use strict";e.createMethods.push("_createLazyload");var i=e.prototype;function r(t){if("IMG"==t.nodeName){var e=t.getAttribute("data-flickity-lazyload"),i=t.getAttribute("data-flickity-lazyload-src"),r=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||r)return[t]}var o="img[data-flickity-lazyload], img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]",a=t.querySelectorAll(
vendor: 10,140 bytes, line 2
2o);return n.makeArray(a)}function o(t,e){this.img=t,this.flickity=e,this.load()}return i._createLazyload=function(){this.on("select",this.lazyLoad)},i.lazyLoad=function(){var t=this.options.lazyLoad;if(t){var e="number"==typeof t?t:0,n=this.getAdjacentCellElements(e),i=[];n.forEach((function(t){var e=r(t);i=i.concat(e)})),i.forEach((function(t){new o(t,this)}),this)}},o.prototype.handleEvent=n.handleEvent,o.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src"),e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t,e&&this.img.setAttribute("srcset",e),this.img.removeAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload-src"),this.img.removeAttribute("data-flickity-lazyload-srcset")},o.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")},o.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")},o.prototype.complete=function(t,e){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var n=this.flickity.getParentCell(this.img),i=n&&n.element;this.flickity.cellSizeChange(i),this.img.classList.add(e),this.flickity.dispatchEvent("lazyLoad",t,i)},e.LazyLoader=o,e}(0,t,e)}.apply(e,i))||(t.exports=r)},7573:(t,e,n)=>{var i,r;window,i=[n(7217),n(4704),n(9047)],void 0===(r=function(t,e,n){return function(t,e,n,i){"use strict";function r(t){this.parent=t,this._create()}r.prototype=Object.create(n.prototype),r.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.handleClick=this.onClick.bind(this),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},r.prototype.activate=function(){this.setDots(),this.holder.addEventListener("click",this.handleClick),this.bindStartEvent(this.holder),this.parent.element.appendChild(this.holder)},r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick),this.unbindStartEvent(this.holder),this.parent.element.removeChild(this.holder)},r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;t>0?this.addDots(t):t<0&&this.removeDots(-t)},r.prototype.addDots=function(t){for(var e=document.createDocumentFragment(),n=[],i=this.dots.length,r=i+t,o=i;o<r;o++){var a=document.createElement("li");a.className="dot",a.setAttribute("aria-label","Page dot "+(o+1)),e.appendChild(a),n.push(a)}this.holder.appendChild(e),this.dots=this.dots.concat(n)},r.prototype.removeDots=function(t){this.dots.splice(this.dots.length-t,t).forEach((function(t){this.holder.removeChild(t)}),this)},r.prototype.updateSelected=function(){this.selectedDot&&(this.selectedDot.className="dot",this.selectedDot.removeAttribute("aria-current")),this.dots.length&&(this.selectedDot=this.dots[this.parent.selectedIndex],this.selectedDot.className="dot is-selected",this.selectedDot.setAttribute("aria-current","step"))},r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if("LI"==e.nodeName){this.parent.uiChange();var n=this.dots.indexOf(e);this.parent.select(n)}},r.prototype.destroy=function(){this.deactivate(),this.allOff()},e.PageDots=r,i.extend(e.defaults,{pageDots:!0}),e.createMethods.push("_createPageDots");var o=e.prototype;return o._createPageDots=function(){this.options.pageDots&&(this.pageDots=new r(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots))},o.activatePageDots=function(){this.pageDots.activate()},o.updateSelectedPageDots=function(){this.pageDots.updateSelected()},o.updatePageDots=function(){this.pageDots.setDots()},o.deactivatePageDots=function(){this.pageDots.deactivate()},e.PageDots=r,e}(0,t,e,n)}.apply(e,i))||(t.exports=r)},8516:(t,e,n)=>{var i,r;window,i=[n(7158),n(9047),n(7217)],void 0===(r=function(t,e,n){return function(t,e,n){"use strict";function i(t){this.parent=t,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}i.prototype=Object.create(t.prototype),i.prototype.play=function(){"playing"!=this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},i.prototype.tick=function(){if("playing"==this.state){var t=this.parent.options.autoPlay;t="number"==typeof t?t:3e3;var e=this;this.clear(),this.timeout=setTimeout((function(){e.parent.next(!0),e.tick()}),t)}},i.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},i.prototype.clear=function(){clearTimeout(this.timeout)},i.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},i.prototype.unpause=function(){"paused"==this.state&&this.play()},i.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},i.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},e.extend(n.defaults,{pauseAutoPlayOnHover:!0}),n.createMethods.push("_createPlayer");var r=n.prototype;return r._createPlayer=function(){this.player=new i(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},r.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},r.playPlayer=function(){this.player.play()},r.stopPlayer=function(){this.player.stop()},r.pausePlayer=function(){this.player.pause()},r.unpausePlayer=function(){this.player.unpause()},r.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},r.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},r.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},n.Player=i,n}(t,e,n)}.apply(e,i))||(t.exports=r)},2410:(t,e,n)=>{var i,r;window,i=[n(7217),n(4704),n(9047)],void 0===(r=function(t,e,n){return function(t,e,n,i){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t,this.parent=e,this._create()}function a(t){return"string"==typeof t?t:"M "+t.x0+",50 L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50  L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype=Object.create(n.prototype),o.prototype._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button",e.className+=this.isPrevious?" previous":" next",e.setAttribute("type","button"),this.disable(),e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var n=this.createSVG();e.appendChild(n),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},o.prototype.activate=function(){this.bindStartEvent(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},o.prototype.deactivate=function(){this.parent.element.removeChild(this.element),this.unbindStartEvent(this.element),this.element.removeEventListener("click",this)},o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon"),t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path"),n=a(this.parent.options.arrowShape);return e.setAttribute("d",n),e.setAttribute("class","arrow"),this.isLeft||e.setAttribute("transform","translate(100, 100) rotate(180) "),t.appendChild(e),t},o.prototype.handleEvent=i.handleEvent,o.prototype.onclick=function(){if(this.isEnabled){this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()}},o.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},o.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1)this.enable();else{var e=t.length?t.length-1:0,n=this.isPrevious?0:e;this[this.parent.selectedIndex==n?"disable":"enable"]()}},o.prototype.destroy=function(){this.deactivate(),this.allOff()},i.extend(e.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),e.createMethods.push("_createPrevNextButtons");var s=e.prototype;return s._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new o(-1,this),this.nextButton=new o(1,this),this.on("activate",this.activatePrevNextButtons))},s.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},s.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},e.PrevNextButton=o,e}(0,t,e,n)}.apply(e,i))||(t.exports=r)},9714:(t,e,n)=>{var i,r;window,void 0===(r="function"==typeof(i=function(){"use strict";function t(t){this.parent=t,this.isOriginLeft="left"==t.originSide,this.cells=[],this.outerWidth=0,this.height=0}var e=t.prototype;return e.addCell=function(t){if(this.cells.push(t),this.outerWidth+=t.size.outerWidth,this.height=Math.max(t.size.outerHeight,this.height),1==this.cells.length){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}},e.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft",e=this.getLastCell(),n=e?e.size[t]:0,i=this.outerWidth-(this.firstMargin+n);this.target=this.x+this.firstMargin+i*this.parent.cellAlign},e.getLastCell=function(){return this.cells[this.cells.length-1]}
2,e.select=function(){this.cells.forEach((function(t){t.select()}))},e.unselect=function(){this.cells.forEach((function(t){t.unselect()}))},e.getCellElements=function(){return this.cells.map((function(t){return t.element}))},t})?i.call(e,n,e,t):i)||(t.exports=r)},6131:(t,e,n)=>{var i,r;window,void 0===(r="function"==typeof(i=function(){"use strict";function t(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}function e(){}var n="undefined"==typeof console?e:function(t){},i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],r=i.length;function o(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<r;e++)t[i[e]]=0;return t}function a(t){var e=getComputedStyle(t);return e||n("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}var s,l=!1;function c(){if(!l){l=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(e);var i=a(e);s=200==Math.round(t(i.width)),u.isBoxSizeOuter=s,n.removeChild(e)}}function u(e){if(c(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var n=a(e);if("none"==n.display)return o();var l={};l.width=e.offsetWidth,l.height=e.offsetHeight;for(var u=l.isBorderBox="border-box"==n.boxSizing,h=0;h<r;h++){var d=i[h],f=n[d],p=parseFloat(f);l[d]=isNaN(p)?0:p}var m=l.paddingLeft+l.paddingRight,g=l.paddingTop+l.paddingBottom,v=l.marginLeft+l.marginRight,y=l.marginTop+l.marginBottom,_=l.borderLeftWidth+l.borderRightWidth,x=l.borderTopWidth+l.borderBottomWidth,b=u&&s,w=t(n.width);!1!==w&&(l.width=w+(b?0:m+_));var M=t(n.height);return!1!==M&&(l.height=M+(b?0:g+x)),l.innerWidth=l.width-(m+_),l.innerHeight=l.height-(g+x),l.outerWidth=l.width+v,l.outerHeight=l.height+y,l}}return u})?i.call(e,n,e,t):i)||(t.exports=r)},2645:t=>{t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),n=[],i=0;i<t.length-1;i++)n.push(t[i],e[i]||"");return n.push(t[i]),n.join("")}},7090:t=>{!function(e,n){var i=function(t,e,n){"use strict";var i,r;if(function(){var e,n={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(e in r=t.lazySizesConfig||t.lazysizesConfig||{},n)e in r||(r[e]=n[e])}(),!e||!e.getElementsByClassName)return{init:function(){},cfg:r,noSupport:!0};var o=e.documentElement,a=t.HTMLPictureElement,s="addEventListener",l="getAttribute",c=t[s].bind(t),u=t.setTimeout,h=t.requestAnimationFrame||u,d=t.requestIdleCallback,f=/^picture$/i,p=["load","error","lazyincluded","_lazyloaded"],m={},g=Array.prototype.forEach,v=function(t,e){return m[e]||(m[e]=new RegExp("(\\s|^)"+e+"(\\s|$)")),m[e].test(t[l]("class")||"")&&m[e]},y=function(t,e){v(t,e)||t.setAttribute("class",(t[l]("class")||"").trim()+" "+e)},_=function(t,e){var n;(n=v(t,e))&&t.setAttribute("class",(t[l]("class")||"").replace(n," "))},x=function(t,e,n){var i=n?s:"removeEventListener";n&&x(t,e),p.forEach((function(n){t[i](n,e)}))},b=function(t,n,r,o,a){var s=e.createEvent("Event");return r||(r={}),r.instance=i,s.initEvent(n,!o,!a),s.detail=r,t.dispatchEvent(s),s},w=function(e,n){var i;!a&&(i=t.picturefill||r.pf)?(n&&n.src&&!e[l]("srcset")&&e.setAttribute("srcset",n.src),i({reevaluate:!0,elements:[e]})):n&&n.src&&(e.src=n.src)},M=function(t,e){return(getComputedStyle(t,null)||{})[e]},S=function(t,e,n){for(n=n||t.offsetWidth;n<r.minSize&&e&&!t._lazysizesWidth;)n=e.offsetWidth,e=e.parentNode;return n},E=(yt=[],_t=[],xt=yt,bt=function(){var t=xt;for(xt=yt.length?_t:yt,gt=!0,vt=!1;t.length;)t.shift()();gt=!1},wt=function(t,n){gt&&!n?t.apply(this,arguments):(xt.push(t),vt||(vt=!0,(e.hidden?u:h)(bt)))},wt._lsFlush=bt,wt),T=function(t,e){return e?function(){E(t)}:function(){var e=this,n=arguments;E((function(){t.apply(e,n)}))}},L=function(t){var e,i=0,o=r.throttleDelay,a=r.ricTimeout,s=function(){e=!1,i=n.now(),t()},l=d&&a>49?function(){d(s,{timeout:a}),a!==r.ricTimeout&&(a=r.ricTimeout)}:T((function(){u(s)}),!0);return function(t){var r;(t=!0===t)&&(a=33),e||(e=!0,(r=o-(n.now()-i))<0&&(r=0),t||r<9?l():u(l,r))}},A=function(t){var e,i,r=99,o=function(){e=null,t()},a=function(){var t=n.now()-i;t<r?u(a,r-t):(d||o)(o)};return function(){i=n.now(),e||(e=u(a,r))}},P=(Y=/^img$/i,q=/^iframe$/i,K="onscroll"in t&&!/(gle|ing)bot/.test(navigator.userAgent),J=0,Q=0,$=0,tt=-1,et=function(t){$--,(!t||$<0||!t.target)&&($=0)},nt=function(t){return null==Z&&(Z="hidden"==M(e.body,"visibility")),Z||!("hidden"==M(t.parentNode,"visibility")&&"hidden"==M(t,"visibility"))},it=function(t,n){var i,r=t,a=nt(t);for(V-=n,X+=n,j-=n,W+=n;a&&(r=r.offsetParent)&&r!=e.body&&r!=o;)(a=(M(r,"opacity")||1)>0)&&"visible"!=M(r,"overflow")&&(i=r.getBoundingClientRect(),a=W>i.left&&j<i.right&&X>i.top-1&&V<i.bottom+1);return a},rt=function(){var t,n,a,s,c,u,h,d,f,p,m,g,v=i.elements;if((k=r.loadMode)&&$<8&&(t=v.length)){for(n=0,tt++;n<t;n++)if(v[n]&&!v[n]._lazyRace)if(!K||i.prematureUnveil&&i.prematureUnveil(v[n]))dt(v[n]);else if((d=v[n][l]("data-expand"))&&(u=1*d)||(u=Q),p||(p=!r.expand||r.expand<1?o.clientHeight>500&&o.clientWidth>500?500:370:r.expand,i._defEx=p,m=p*r.expFactor,g=r.hFac,Z=null,Q<m&&$<1&&tt>2&&k>2&&!e.hidden?(Q=m,tt=0):Q=k>1&&tt>1&&$<6?p:J),f!==u&&(G=innerWidth+u*g,H=innerHeight+u,h=-1*u,f=u),a=v[n].getBoundingClientRect(),(X=a.bottom)>=h&&(V=a.top)<=H&&(W=a.right)>=h*g&&(j=a.left)<=G&&(X||W||j||V)&&(r.loadHidden||nt(v[n]))&&(z&&$<3&&!d&&(k<3||tt<4)||it(v[n],u))){if(dt(v[n]),c=!0,$>9)break}else!c&&z&&!s&&$<4&&tt<4&&k>
22&&(F[0]||r.preloadAfterLoad)&&(F[0]||!d&&(X||W||j||V||"auto"!=v[n][l](r.sizesAttr)))&&(s=F[0]||v[n]);s&&!c&&dt(s)}},ot=L(rt),at=function(t){var e=t.target;e._lazyCache?delete e._lazyCache:(et(t),y(e,r.loadedClass),_(e,r.loadingClass),x(e,lt),b(e,"lazyloaded"))},st=T(at),lt=function(t){st({target:t.target})},ct=function(t,e){var n=t.getAttribute("data-load-mode")||r.iframeLoadMode;0==n?t.contentWindow.location.replace(e):1==n&&(t.src=e)},ut=function(t){var e,n=t[l](r.srcsetAttr);(e=r.customMedia[t[l]("data-media")||t[l]("media")])&&t.setAttribute("media",e),n&&t.setAttribute("srcset",n)},ht=T((function(t,e,n,i,o){var a,s,c,h,d,p;(d=b(t,"lazybeforeunveil",e)).defaultPrevented||(i&&(n?y(t,r.autosizesClass):t.setAttribute("sizes",i)),s=t[l](r.srcsetAttr),a=t[l](r.srcAttr),o&&(h=(c=t.parentNode)&&f.test(c.nodeName||"")),p=e.firesLoad||"src"in t&&(s||a||h),d={target:t},y(t,r.loadingClass),p&&(clearTimeout(U),U=u(et,2500),x(t,lt,!0)),h&&g.call(c.getElementsByTagName("source"),ut),s?t.setAttribute("srcset",s):a&&!h&&(q.test(t.nodeName)?ct(t,a):t.src=a),o&&(s||h)&&w(t,{src:a})),t._lazyRace&&delete t._lazyRace,_(t,r.lazyClass),E((function(){var e=t.complete&&t.naturalWidth>1;p&&!e||(e&&y(t,r.fastLoadedClass),at(d),t._lazyCache=!0,u((function(){"_lazyCache"in t&&delete t._lazyCache}),9)),"lazy"==t.loading&&$--}),!0)})),dt=function(t){if(!t._lazyRace){var e,n=Y.test(t.nodeName),i=n&&(t[l](r.sizesAttr)||t[l]("sizes")),o="auto"==i;(!o&&z||!n||!t[l]("src")&&!t.srcset||t.complete||v(t,r.errorClass)||!v(t,r.lazyClass))&&(e=b(t,"lazyunveilread").detail,o&&R.updateElem(t,!0,t.offsetWidth),t._lazyRace=!0,$++,ht(t,e,o,i,n))}},ft=A((function(){r.loadMode=3,ot()})),pt=function(){3==r.loadMode&&(r.loadMode=2),ft()},mt=function(){z||(n.now()-B<999?u(mt,999):(z=!0,r.loadMode=3,ot(),c("scroll",pt,!0)))},{_:function(){B=n.now(),i.elements=e.getElementsByClassName(r.lazyClass),F=e.getElementsByClassName(r.lazyClass+" "+r.preloadClass),c("scroll",ot,!0),c("resize",ot,!0),c("pageshow",(function(t){if(t.persisted){var n=e.querySelectorAll("."+r.loadingClass);n.length&&n.forEach&&h((function(){n.forEach((function(t){t.complete&&dt(t)}))}))}})),t.MutationObserver?new MutationObserver(ot).observe(o,{childList:!0,subtree:!0,attributes:!0}):(o[s]("DOMNodeInserted",ot,!0),o[s]("DOMAttrModified",ot,!0),setInterval(ot,999)),c("hashchange",ot,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach((function(t){e[s](t,ot,!0)})),/d$|^c/.test(e.readyState)?mt():(c("load",mt),e[s]("DOMContentLoaded",ot),u(mt,2e4)),i.elements.length?(rt(),E._lsFlush()):ot()},checkElems:ot,unveil:dt,_aLSL:pt}),R=(O=T((function(t,e,n,i){var r,o,a;if(t._lazysizesWidth=i,i+="px",t.setAttribute("sizes",i),f.test(e.nodeName||""))for(o=0,a=(r=e.getElementsByTagName("source")).length;o<a;o++)r[o].setAttribute("sizes",i);n.detail.dataAttr||w(t,n.detail)})),N=function(t,e,n){var i,r=t.parentNode;r&&(n=S(t,r,n),(i=b(t,"lazybeforesizes",{width:n,dataAttr:!!e})).defaultPrevented||(n=i.detail.width)&&n!==t._lazysizesWidth&&O(t,r,i,n))},I=A((function(){var t,e=D.length;if(e)for(t=0;t<e;t++)N(D[t])})),{_:function(){D=e.getElementsByClassName(r.autosizesClass),c("resize",I)},checkElems:I,updateElem:N}),C=function(){!C.i&&e.getElementsByClassName&&(C.i=!0,R._(),P._())};var D,O,N,I;var F,z,U,k,B,G,H,V,j,W,X,Z,Y,q,K,J,Q,$,tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,ft,pt,mt;var gt,vt,yt,_t,xt,bt,wt;return u((function(){r.init&&C()})),i={cfg:r,autoSizer:R,loader:P,init:C,uP:w,aC:y,rC:_,hC:v,fire:b,gW:S,rAF:E}}(e,e.document,Date);e.lazySizes=i,t.exports&&(t.exports=i)}("undefined"!=typeof window?window:{})},9089:()=>{},5402:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});const i="precision highp float;\n#define GLSLIFY 1\n\nuniform vec2 size;\nuniform vec2 sizeImage;\nuniform vec3 placeholderColor;\nuniform float opacity;\nuniform float imgOpacity;\n\nuniform sampler2D image;\nvarying float intensity;\nuniform bool placeholder;\nvarying vec2 vUv;\nvarying vec4 vPos;\nvarying float vY;\nuniform float scale;\nuniform float offset;\n\nvec4 coverTexture(sampler2D tex, vec2 imgSize, vec2 ouv) {\n    vec2 s = size;\n    vec2 i = imgSize;\n    float rs = s.x / s.y;\n    float ri = i.x / i.y;\n    vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x);\n    vec2 newOffset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new;\n    vec2 uv = ouv * s / new + newOffset;\n\n    return texture2D(tex, uv);\n}\n\nvoid main() {\n    vec2 coords = vUv;\n    // vec4 placeholderColor = vec4(1., 1., 1., 1.);\n    if(vPos.y > 0.5) discard;\n\n    coords -= 0.5;\n    coords /= scale;\n    coords += 0.5;\n\n    coords.y += offset;\n\n    vec3 img = coverTexture(image, sizeImage, coords).rgb;\n\n    if(placeholder) {\n        gl_FragColor = vec4(placeholderColor.rgb, opacity);\n    } else {\n        gl_FragColor = vec4( mix(placeholderColor.rgb, img , imgOpacity), opacity);\n    }\n}"},8643:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});const i="#define GLSLIFY 1\nattribute vec2 position;\nattribute vec2 uv;\nuniform mat4 projection;\nuniform float time;\nuniform float speed;\nuniform float bend;\nvarying vec2 vUv;\nvarying vec4 vPos;\nvarying float intensity;\nvarying float vY;\n\nmat4 rotationY( in float angle ) {\n    return mat4(cos(angle),0,sin(angle),0, 0,1.0,0,0,-sin(angle),0,cos(angle),0,0,0,0,1);\n}\n\nmat4 rotationX( in float angle ) {\n    return mat4(1.0, 0, 0, 0, 0, cos(angle), -sin(angle), 0, 0, sin(angle), cos(angle), 0, 0, 0.5, 0, 1);\n}\n\nvoid main() {\n    vUv = uv;\n    vec4 pos = vec4(position, 0.0, 1.0);\n\n    pos.y -= .5;
2\n\n    vec4 rotatedPosition = rotationX((vUv.y - 1.5) * bend) * pos;\n\n    float test = rotatedPosition.x * (1. + (vUv.y - 1.));\n\n    rotatedPosition.x = mix(test, rotatedPosition.x, 1. - (bend * .5));\n    vPos = rotatedPosition;\n\n    intensity = pos.z;\n\n    gl_Position = projection * rotatedPosition;\n}"},5666:t=>{var e=function(t){"use strict";var e,n=Object.prototype,i=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var r=e&&e.prototype instanceof g?e:g,o=Object.create(r.prototype),a=new A(i||[]);return o._invoke=function(t,e,n){var i=h;return function(r,o){if(i===f)throw new Error("Generator is already running");if(i===p){if("throw"===r)throw o;return R()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var l=u(t,e,n);if("normal"===l.type){if(i=n.done?p:d,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=p,n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",m={};function g(){}function v(){}function y(){}var _={};_[o]=function(){return this};var x=Object.getPrototypeOf,b=x&&x(x(P([])));b&&b!==n&&i.call(b,o)&&(_=b);var w=y.prototype=g.prototype=Object.create(_);function M(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(r,o,a,s){var l=u(t[r],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(l.arg)}var r;this._invoke=function(t,i){function o(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(o,o):o()}}function E(t,n){var i=t.iterator[n.method];if(i===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var r=u(i,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,m;var o=r.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function P(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:R}}function R(){return{value:e,done:!0}}return v.prototype=w.constructor=y,y.constructor=v,v.displayName=l(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},M(S.prototype),S.prototype[a]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new S(c(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},M(w),l(w,s,"Generator"),w[o]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=P,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEac
2h(L),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(i,r){return s.type="throw",s.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;L(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:P(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},4279:t=>{function e(){}e.prototype={on:function(t,e,n){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var i=this;function r(){i.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),i=n[t],r=[];if(i&&e)for(var o=0,a=i.length;o<a;o++)i[o].fn!==e&&i[o].fn._!==e&&r.push(i[o]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e},4842:(t,e,n)=>{var i,r;!function(o,a){i=[n(4704)],void 0===(r=function(t){return function(t,e){"use strict";function n(){}var i=n.prototype=Object.create(e.prototype);i.bindHandles=function(){this._bindHandles(!0)},i.unbindHandles=function(){this._bindHandles(!1)},i._bindHandles=function(e){for(var n=(e=void 0===e||e)?"addEventListener":"removeEventListener",i=e?this._touchActionValue:"",r=0;r<this.handles.length;r++){var o=this.handles[r];this._bindStartEvent(o,e),o[n]("click",this),t.PointerEvent&&(o.style.touchAction=i)}},i._touchActionValue="none",i.pointerDown=function(t,e){this.okayPointerDown(t)&&(this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY},t.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,e]))};var r={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},o={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};return i.okayPointerDown=function(t){var e=r[t.target.nodeName],n=o[t.target.type],i=!e||n;return i||this._pointerReset(),i},i.pointerDownBlur=function(){var t=document.activeElement;t&&t.blur&&t!=document.body&&t.blur()},i.pointerMove=function(t,e){var n=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,n]),this._dragMove(t,e,n)},i._dragPointerMove=function(t,e){var n={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this._dragStart(t,e),n},i.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3},i.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]),this._dragPointerUp(t,e)},i._dragPointerUp=function(t,e){this.isDragging?this._dragEnd(t,e):this._staticClick(t,e)},i._dragStart=function(t,e){this.isDragging=!0,this.isPreventing
2Clicks=!0,this.dragStart(t,e)},i.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])},i._dragMove=function(t,e,n){this.isDragging&&this.dragMove(t,e,n)},i.dragMove=function(t,e,n){t.preventDefault(),this.emitEvent("dragMove",[t,e,n])},i._dragEnd=function(t,e){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,e)},i.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])},i.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},i._staticClick=function(t,e){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,e),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},i.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])},n.getPointerPoint=e.getPointerPoint,n}(o,t)}.apply(e,i))||(t.exports=r)}(window)},4704:(t,e,n)=>{var i,r;!function(o,a){i=[n(7158)],void 0===(r=function(t){return function(t,e){"use strict";function n(){}function i(){}var r=i.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,!0)},r.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},r._bindStartEvent=function(e,n){var i=(n=void 0===n||n)?"addEventListener":"removeEventListener",r="mousedown";t.PointerEvent?r="pointerdown":"ontouchstart"in t&&(r="touchstart"),e[i](r,this)},r.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},r.getTouch=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.identifier==this.pointerIdentifier)return n}},r.onmousedown=function(t){var e=t.button;e&&0!==e&&1!==e||this._pointerDown(t,t)},r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},r.onpointerdown=function(t){this._pointerDown(t,t)},r._pointerDown=function(t,e){t.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==e.pointerId?e.pointerId:e.identifier,this.pointerDown(t,e))},r.pointerDown=function(t,e){this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};return r._bindPostStartEvents=function(e){if(e){var n=o[e.type];n.forEach((function(e){t.addEventListener(e,this)}),this),this._boundPointerEvents=n}},r._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach((function(e){t.removeEventListener(e,this)}),this),delete this._boundPointerEvents)},r.onmousemove=function(t){this._pointerMove(t,t)},r.onpointermove=function(t){t.pointerId==this.pointerIdentifier&&this._pointerMove(t,t)},r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerMove(t,e)},r._pointerMove=function(t,e){this.pointerMove(t,e)},r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])},r.onmouseup=function(t){this._pointerUp(t,t)},r.onpointerup=function(t){t.pointerId==this.pointerIdentifier&&this._pointerUp(t,t)},r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerUp(t,e)},r._pointerUp=function(t,e){this._pointerDone(),this.pointerUp(t,e)},r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])},r._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},r._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},r.pointerDone=n,r.onpointercancel=function(t){t.pointerId==this.pointerIdentifier&&this._pointerCancel(t,t)},r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerCancel(t,e)},r._pointerCancel=function(t,e){this._pointerDone(),this.pointerCancel(t,e)},r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])},i.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}},i}(o,t)}.apply(e,i))||(t.exports=r)}(window)},9365:(t,e,n)=>{var i={"./images":4453,"./images.js":4453,"./layout":5380,"./layout.js":5380,"./logo":216,"./logo.js":216,"./nav":6837,"./nav.js":6837,"./router":3435,"./router.js":3435,"./scroll":5853,"./scroll.js":5853,"./shaders/image.frag":5402,"./shaders/image.vert":8643};function r(t){var e=o(t);return n(e)}function o(t){if(!n.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}r.keys=function(){return Object.keys(i)},r.resolve=o,t.exports=r,r.id=9365}},n={};function i(t){if(n[t])return n[t].exports;var r=n[t]={exports:{}};
2return e[t].call(r.exports,r,r.exports,i),r.exports}i.m=e,i.x=t=>{},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.f={},i.e=t=>Promise.all(Object.keys(i.f).reduce(((e,n)=>(i.f[n](t,e),e)),[])),i.u=t=>"js/"+{443:"about",680:"form",893:"products"}[t]+".js",i.miniCssF=t=>"css/bundle.css",i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},i.l=(e,n,r,o)=>{if(t[e])t[e].push(n);else{var a,s;if(void 0!==r)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=e),t[e]=[n];var h=(n,i)=>{a.onerror=a.onload=null,clearTimeout(d);var r=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((t=>t(i))),n)return n(i)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}},i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.p="/assets/",(()=>{var t={985:0},e=[[8661],[9089]];i.f.j=(e,n)=>{var r=i.o(t,e)?t[e]:void 0;if(0!==r)if(r)n.push(r[2]);else if(123!=e){var o=new Promise(((n,i)=>{r=t[e]=[n,i]}));n.push(r[2]=o);var a=i.p+i.u(e),s=new Error;i.l(a,(n=>{if(i.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,r[1](s)}}),"chunk-"+e,e)}else t[e]=0};var n=t=>{},r=(r,o)=>{for(var a,s,[l,c,u,h]=o,d=0,f=[];d<l.length;d++)s=l[d],i.o(t,s)&&t[s]&&f.push(t[s][0]),t[s]=0;for(a in c)i.o(c,a)&&(i.m[a]=c[a]);for(u&&u(i),r&&r(o);f.length;)f.shift()();return h&&e.push.apply(e,h),n()},o=self.webpackChunk=self.webpackChunk||[];function a(){for(var n,r=0;r<e.length;r++){for(var o=e[r],a=!0,s=1;s<o.length;s++){var l=o[s];0!==t[l]&&(a=!1)}a&&(e.splice(r--,1),n=i(i.s=o[0]))}return 0===e.length&&(i.x(),i.x=t=>{}),n}o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var s=i.x;i.x=()=>(i.x=s||(t=>{}),(n=a)())})();i.x()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.